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);
34 Painter & getPainter() { return painter_; }
37 int workWidth() const { return work_area->w; }
39 int width() const { return work_area->w + scrollbar->w; }
41 int height() const { return work_area->h; }
43 int xpos() const { return work_area->x; }
45 int ypos() const { return work_area->y; }
47 void resize(int xpos, int ypos, int width, int height);
50 fl_redraw_object(work_area);
51 fl_redraw_object(scrollbar);
52 fl_redraw_object(button_down);
53 fl_redraw_object(button_up);
56 void setFocus() const;
58 Window getWin() const { return work_area->form->window; }
60 bool hasFocus() const { return work_area->focus; }
62 bool active() const { return work_area->active; }
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 pair<double, double> getScrollbarBounds() const {
81 pair<double, double> p;
82 fl_get_slider_bounds(scrollbar, &p.first, &p.second);
86 Pixmap getPixmap() const { return workareapixmap; }
88 //Signal2<long, int> up;
90 //Signal2<long, int> down;
92 //Signal1<double> scroll;
96 //Signal3<int, int, unsigned int> buttonPress;
98 //Signal3<int, int, unsigned int> buttonRelease;
100 //Signal3<int, int, unsigned int> motion;
110 //Signal3<int, int, unsigned int> doubleclick;
112 //Signal3<int, int, unsigned int> trippleclick;
114 //Signal2<Window, XEvent *> selection;
117 void createPixmap(int, int);
119 static int work_area_handler(FL_OBJECT *, int event,
121 int /*key*/, void * xev);
123 static void up_cb(FL_OBJECT *, long);
125 static void down_cb(FL_OBJECT *, long);
127 static void scroll_cb(FL_OBJECT *, long);
129 FL_OBJECT * backgroundbox;
131 FL_OBJECT * work_area;
133 FL_OBJECT * scrollbar;
135 FL_OBJECT * button_down;
137 FL_OBJECT * button_up;
140 /// The pixmap overlay on the workarea
141 Pixmap workareapixmap;
147 FL_OBJECT * figinset_canvas;