2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2000 The LyX Team.
10 * ======================================================*/
21 #include FORMS_H_LOCATION
29 WorkArea(BufferView *, int xpos, int ypos, int width, int height);
33 Painter & getPainter() { return painter_; }
35 int workWidth() const { return work_area->w; }
37 int width() const { return work_area->w + scrollbar->w; }
39 int height() const { return work_area->h; }
41 int xpos() const { return work_area->x; }
43 int ypos() const { return work_area->y; }
45 void resize(int xpos, int ypos, int width, int height);
48 fl_redraw_object(work_area);
49 fl_redraw_object(scrollbar);
50 fl_redraw_object(button_down);
51 fl_redraw_object(button_up);
54 void setFocus() const;
56 Window getWin() const { return work_area->form->window; }
58 bool hasFocus() const { return work_area->focus; }
60 bool active() const { return work_area->active; }
62 bool belowMouse() const;
64 bool visible() const { return work_area->form->visible; }
68 void setScrollbar(double pos, double length_fraction) const;
70 void setScrollbarValue(double y) const { fl_set_slider_value(scrollbar, y); }
72 void setScrollbarBounds(double, double) const;
74 void setScrollbarIncrements(float inc) const;
76 double getScrollbarValue() const {
77 return fl_get_slider_value(scrollbar);
80 std::pair<double, double> getScrollbarBounds() const {
81 std::pair<double, double> p;
82 fl_get_slider_bounds(scrollbar, &p.first, &p.second);
86 Pixmap getPixmap() const { return workareapixmap; }
88 static int work_area_handler(FL_OBJECT *, int event,
90 int /*key*/, void * xev);
92 static void up_cb(FL_OBJECT *, long);
94 static void down_cb(FL_OBJECT *, long);
96 static void scroll_cb(FL_OBJECT *, long);
99 void createPixmap(int, int);
101 FL_OBJECT * backgroundbox;
103 FL_OBJECT * work_area;
105 FL_OBJECT * scrollbar;
107 FL_OBJECT * button_down;
109 FL_OBJECT * button_up;
112 /// The pixmap overlay on the workarea
113 Pixmap workareapixmap;
117 FL_OBJECT * figinset_canvas;