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 <sigc++/signal_system.h>
23 #include FORMS_H_LOCATION
26 #ifdef SIGC_CXX_NAMESPACES
38 WorkArea(int xpos, int ypos, int width, int height);
42 Painter & getPainter() { return painter_; }
44 int workWidth() const { return work_area->w; }
46 unsigned int width() const { return work_area->w + scrollbar->w; }
48 unsigned int height() const { return work_area->h; }
50 int xpos() const { return work_area->x; }
52 int ypos() const { return work_area->y; }
54 void resize(int xpos, int ypos, int width, int height);
57 fl_redraw_object(work_area);
58 fl_redraw_object(scrollbar);
61 void setFocus() const;
63 Window getWin() const { return work_area->form->window; }
65 bool hasFocus() const { return work_area->focus; }
67 bool active() const { return work_area->active; }
69 bool belowMouse() const;
71 bool visible() const { return work_area->form->visible; }
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 Signal0<void> workAreaExpose;
110 Signal1<void, double> scrollCB;
112 Signal2<void, KeySym, unsigned int> workAreaKeyPress;
114 Signal3<void, int, int, unsigned int> workAreaButtonPress;
116 Signal3<void, int, int, unsigned int> workAreaButtonRelease;
118 Signal3<void, int, int, unsigned int> workAreaMotionNotify;
120 Signal0<void> workAreaFocus;
122 Signal0<void> workAreaUnfocus;
124 Signal0<void> workAreaEnter;
126 Signal0<void> workAreaLeave;
128 Signal3<void, int, int, unsigned int> workAreaDoubleClick;
130 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;
140 /// The pixmap overlay on the workarea
141 Pixmap workareapixmap;
145 FL_OBJECT * figinset_canvas;
146 /// if we call redraw with true needed for locking-insets