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 * ======================================================*/
22 #include FORMS_H_LOCATION
30 WorkArea(BufferView *, int xpos, int ypos, int width, int height);
35 Painter & getPainter() { return painter_; }
38 int workWidth() const { return work_area->w; }
40 int width() const { return work_area->w + scrollbar->w; }
42 int height() const { return work_area->h; }
44 int xpos() const { return work_area->x; }
46 int ypos() const { return work_area->y; }
48 void resize(int xpos, int ypos, int width, int height);
51 fl_redraw_object(work_area);
52 fl_redraw_object(scrollbar);
53 fl_redraw_object(button_down);
54 fl_redraw_object(button_up);
57 void setFocus() const;
59 Window getWin() const { return work_area->form->window; }
61 bool hasFocus() const { return work_area->focus; }
63 bool active() const { return work_area->active; }
65 bool visible() const { return work_area->form->visible; }
69 void setScrollbar(double pos, double length_fraction) const;
71 void setScrollbarValue(double y) const { fl_set_slider_value(scrollbar, y); }
73 void setScrollbarBounds(double, double) const;
75 void setScrollbarIncrements(float inc) const;
77 double getScrollbarValue() const {
78 return fl_get_slider_value(scrollbar);
81 pair<double, double> getScrollbarBounds() const {
82 pair<double, double> p;
83 fl_get_slider_bounds(scrollbar, &p.first, &p.second);
87 Pixmap getPixmap() const { return workareapixmap; }
89 //Signal2<long, int> up;
91 //Signal2<long, int> down;
93 //Signal1<double> scroll;
97 //Signal3<int, int, unsigned int> buttonPress;
99 //Signal3<int, int, unsigned int> buttonRelease;
101 //Signal3<int, int, unsigned int> motion;
111 //Signal3<int, int, unsigned int> doubleclick;
113 //Signal3<int, int, unsigned int> trippleclick;
115 //Signal2<Window, XEvent *> selection;
117 static int work_area_handler(FL_OBJECT *, int event,
119 int /*key*/, void * xev);
121 static void up_cb(FL_OBJECT *, long);
123 static void down_cb(FL_OBJECT *, long);
125 static void scroll_cb(FL_OBJECT *, long);
128 void createPixmap(int, int);
130 FL_OBJECT * backgroundbox;
132 FL_OBJECT * work_area;
134 FL_OBJECT * scrollbar;
136 FL_OBJECT * button_down;
138 FL_OBJECT * button_up;
141 /// The pixmap overlay on the workarea
142 Pixmap workareapixmap;
148 FL_OBJECT * figinset_canvas;