2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2001 The LyX Team.
10 * ======================================================*/
21 #include <sigc++/signal_system.h>
23 #include FORMS_H_LOCATION
30 WorkArea(int xpos, int ypos, int width, int height);
34 Painter & getPainter() { return painter_; }
36 int workWidth() const { return work_area->w; }
38 unsigned int width() const { return work_area->w + scrollbar->w; }
39 //unsigned int width() const { return backgroundbox->w + 15; }
41 unsigned int height() const { return work_area->h; }
42 //unsigned int height() const { return backgroundbox->h; }
44 int xpos() const { return work_area->x; }
45 //int xpos() const { return backgroundbox->x; }
47 int ypos() const { return work_area->y; }
48 //int ypos() const { return backgroundbox->y; }
50 void resize(int xpos, int ypos, int width, int height);
53 fl_redraw_object(work_area);
54 fl_redraw_object(scrollbar);
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 belowMouse() const;
67 bool visible() const { return work_area->form->visible; }
71 void setScrollbar(double pos, double length_fraction) const;
73 void setScrollbarValue(double y) const {
74 fl_set_scrollbar_value(scrollbar, y);
77 void setScrollbarBounds(double, double) const;
79 void setScrollbarIncrements(double inc) const;
81 double getScrollbarValue() const {
82 return fl_get_scrollbar_value(scrollbar);
85 std::pair<float, float> const getScrollbarBounds() const {
86 std::pair<float, float> p;
87 fl_get_scrollbar_bounds(scrollbar, &p.first, &p.second);
91 Pixmap getPixmap() const { return workareapixmap; }
93 static int work_area_handler(FL_OBJECT *, int event,
95 int /*key*/, void * xev);
97 static void scroll_cb(FL_OBJECT *, long);
99 string const getClipboard() const;
101 void putClipboard(string const &) const;
104 SigC::Signal0<void> workAreaExpose;
106 SigC::Signal1<void, double> scrollCB;
108 SigC::Signal2<void, KeySym, unsigned int> workAreaKeyPress;
110 SigC::Signal3<void, int, int, unsigned int> workAreaButtonPress;
112 SigC::Signal3<void, int, int, unsigned int> workAreaButtonRelease;
114 SigC::Signal3<void, int, int, unsigned int> workAreaMotionNotify;
116 SigC::Signal0<void> workAreaFocus;
118 SigC::Signal0<void> workAreaUnfocus;
120 SigC::Signal0<void> workAreaEnter;
122 SigC::Signal0<void> workAreaLeave;
124 SigC::Signal3<void, int, int, unsigned int> workAreaDoubleClick;
126 SigC::Signal3<void, int, int, unsigned int> workAreaTripleClick;
129 void createPixmap(int, int);
131 FL_OBJECT * backgroundbox;
133 FL_OBJECT * work_area;
135 FL_OBJECT * scrollbar;
136 /// The pixmap overlay on the workarea
137 Pixmap workareapixmap;
141 FL_OBJECT * figinset_canvas;
142 /// if we call redraw with true needed for locking-insets