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
27 //using SigC::Signal0;
28 //using SigC::Signal3;
37 WorkArea(BufferView *, int xpos, int ypos, int width, int height);
41 Painter & getPainter() { return painter_; }
43 int workWidth() const { return work_area->w; }
45 unsigned int width() const { return work_area->w + scrollbar->w; }
47 unsigned int height() const { return work_area->h; }
49 int xpos() const { return work_area->x; }
51 int ypos() const { return work_area->y; }
53 void resize(int xpos, int ypos, int width, int height);
56 fl_redraw_object(work_area);
57 fl_redraw_object(scrollbar);
60 void setFocus() const;
62 Window getWin() const { return work_area->form->window; }
64 bool hasFocus() const { return work_area->focus; }
66 bool active() const { return work_area->active; }
68 bool belowMouse() const;
70 bool visible() const { return work_area->form->visible; }
74 void setScrollbar(double pos, double length_fraction) const;
76 void setScrollbarValue(double y) const {
77 fl_set_scrollbar_value(scrollbar, y);
80 void setScrollbarBounds(double, double) const;
82 void setScrollbarIncrements(double inc) const;
84 double getScrollbarValue() const {
85 return fl_get_scrollbar_value(scrollbar);
88 std::pair<float, float> getScrollbarBounds() const {
89 std::pair<float, float> p;
90 fl_get_scrollbar_bounds(scrollbar, &p.first, &p.second);
94 Pixmap getPixmap() const { return workareapixmap; }
96 static int work_area_handler(FL_OBJECT *, int event,
98 int /*key*/, void * xev);
100 static void scroll_cb(FL_OBJECT *, long);
102 string getClipboard() const;
104 void putClipboard(string const &) const;
106 BufferView * owner() const { return owner_; }
110 //Signal0<void> workAreaExpose;
112 //Signal3<void, int, int, unsigned int> workAreaButtonPress;
114 //Signal3<void, int, int, unsigned int> workAreaButtonRelease;
116 //Signal3<void, int, int, unsigned int> workAreaMotionNotify;
118 //Signal0<void> workAreaFocus;
120 //Signal0<void> workAreaUnfocus;
122 //Signal0<void> workAreaEnter;
124 //Signal0<void> workAreaLeave;
126 //Signal3<void, int, int, unsigned int> workAreaDoubleClick;
128 //Signal3<void, int, int, unsigned int> workAreaTripleClick;
131 void createPixmap(int, int);
133 FL_OBJECT * backgroundbox;
135 FL_OBJECT * work_area;
137 FL_OBJECT * scrollbar;
140 /// The pixmap overlay on the workarea
141 Pixmap workareapixmap;
145 FL_OBJECT * figinset_canvas;