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);
34 Painter & getPainter() { return painter_; }
36 int workWidth() const { return work_area->w; }
38 int width() const { return work_area->w + scrollbar->w; }
40 int height() const { return work_area->h; }
42 int xpos() const { return work_area->x; }
44 int ypos() const { return work_area->y; }
46 void resize(int xpos, int ypos, int width, int height);
49 fl_redraw_object(work_area);
50 fl_redraw_object(scrollbar);
51 fl_redraw_object(button_down);
52 fl_redraw_object(button_up);
55 void setFocus() const;
57 Window getWin() const { return work_area->form->window; }
59 bool hasFocus() const { return work_area->focus; }
61 bool active() const { return work_area->active; }
63 bool belowMouse() const;
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 static int work_area_handler(FL_OBJECT *, int event,
91 int /*key*/, void * xev);
93 static void up_cb(FL_OBJECT *, long);
95 static void down_cb(FL_OBJECT *, long);
97 static void scroll_cb(FL_OBJECT *, long);
100 void createPixmap(int, int);
102 FL_OBJECT * backgroundbox;
104 FL_OBJECT * work_area;
106 FL_OBJECT * scrollbar;
108 FL_OBJECT * button_down;
110 FL_OBJECT * button_up;
113 /// The pixmap overlay on the workarea
114 Pixmap workareapixmap;
118 FL_OBJECT * figinset_canvas;