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
31 WorkArea(BufferView *, int xpos, int ypos, int width, int height);
35 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 belowMouse() const;
66 bool visible() const { return work_area->form->visible; }
70 void setScrollbar(double pos, double length_fraction) const;
72 void setScrollbarValue(double y) const { fl_set_slider_value(scrollbar, y); }
74 void setScrollbarBounds(double, double) const;
76 void setScrollbarIncrements(float inc) const;
78 double getScrollbarValue() const {
79 return fl_get_slider_value(scrollbar);
82 pair<double, double> getScrollbarBounds() const {
83 pair<double, double> p;
84 fl_get_slider_bounds(scrollbar, &p.first, &p.second);
88 Pixmap getPixmap() const { return workareapixmap; }
90 static int work_area_handler(FL_OBJECT *, int event,
92 int /*key*/, void * xev);
94 static void up_cb(FL_OBJECT *, long);
96 static void down_cb(FL_OBJECT *, long);
98 static void scroll_cb(FL_OBJECT *, long);
101 void createPixmap(int, int);
103 FL_OBJECT * backgroundbox;
105 FL_OBJECT * work_area;
107 FL_OBJECT * scrollbar;
109 FL_OBJECT * button_down;
111 FL_OBJECT * button_up;
114 /// The pixmap overlay on the workarea
115 Pixmap workareapixmap;
119 FL_OBJECT * figinset_canvas;