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; }
73 void destroySplash() const;
75 void setScrollbar(double pos, double length_fraction) const;
77 void setScrollbarValue(double y) const {
78 fl_set_scrollbar_value(scrollbar, y);
81 void setScrollbarBounds(double, double) const;
83 void setScrollbarIncrements(double inc) const;
85 double getScrollbarValue() const {
86 return fl_get_scrollbar_value(scrollbar);
89 std::pair<float, float> const getScrollbarBounds() const {
90 std::pair<float, float> p;
91 fl_get_scrollbar_bounds(scrollbar, &p.first, &p.second);
95 Pixmap getPixmap() const { return workareapixmap; }
97 static int work_area_handler(FL_OBJECT *, int event,
99 int /*key*/, void * xev);
101 static void scroll_cb(FL_OBJECT *, long);
103 string const getClipboard() const;
105 void putClipboard(string const &) const;
108 SigC::Signal0<void> workAreaExpose;
110 SigC::Signal1<void, double> scrollCB;
112 SigC::Signal2<void, KeySym, unsigned int> workAreaKeyPress;
114 SigC::Signal3<void, int, int, unsigned int> workAreaButtonPress;
116 SigC::Signal3<void, int, int, unsigned int> workAreaButtonRelease;
118 SigC::Signal3<void, int, int, unsigned int> workAreaMotionNotify;
120 SigC::Signal0<void> workAreaFocus;
122 SigC::Signal0<void> workAreaUnfocus;
124 SigC::Signal0<void> workAreaEnter;
126 SigC::Signal0<void> workAreaLeave;
128 SigC::Signal3<void, int, int, unsigned int> workAreaDoubleClick;
130 SigC::Signal3<void, int, int, unsigned int> workAreaTripleClick;
133 void createPixmap(int, int);
135 FL_OBJECT * backgroundbox;
137 FL_OBJECT * work_area;
139 FL_OBJECT * scrollbar;
141 mutable FL_OBJECT * splash_;
143 mutable FL_OBJECT * splash_text_;
144 /// The pixmap overlay on the workarea
145 Pixmap workareapixmap;
149 FL_OBJECT * figinset_canvas;
150 /// if we call redraw with true needed for locking-insets