4 * Copyright 1995-2002 the LyX Team
5 * Read the file COPYING
8 * \author John Levon <moz@compsoc.man.ac.uk>
18 #include FORMS_H_LOCATION
20 #include "frontends/mouse_state.h"
21 #include "frontends/key_state.h"
23 #include <boost/signals/signal0.hpp>
24 #include <boost/signals/signal1.hpp>
25 #include <boost/signals/signal2.hpp>
26 #include <boost/signals/signal3.hpp>
34 WorkArea(int xpos, int ypos, int width, int height);
38 Painter & getPainter() { return painter_; }
40 int workWidth() const { return work_area->w; }
42 int workHeight() const { return work_area->h; }
44 unsigned int width() const { return work_area->w + scrollbar->w; }
45 //unsigned int width() const { return backgroundbox->w + 15; }
47 int xpos() const { return work_area->x; }
48 //int xpos() const { return backgroundbox->x; }
50 int ypos() const { return work_area->y; }
51 //int ypos() const { return backgroundbox->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 visible() const { return work_area->form->visible; }
70 void setScrollbarParams(int height, int pos, int line_height);
72 Pixmap getPixmap() const { return workareapixmap; }
74 static int work_area_handler(FL_OBJECT *, int event,
76 int /*key*/, void * xev);
78 /// xforms callback from scrollbar
80 /// a selection exists
81 void haveSelection(bool) const;
83 string const getClipboard() const;
85 void putClipboard(string const &) const;
88 boost::signal0<void> workAreaExpose;
90 boost::signal1<void, int> scrollDocView;
92 boost::signal2<void, KeySym, key_modifier::state> workAreaKeyPress;
94 boost::signal3<void, int, int, mouse_button::state> workAreaButtonPress;
96 boost::signal3<void, int, int, mouse_button::state> workAreaButtonRelease;
98 boost::signal3<void, int, int, mouse_button::state> workAreaMotionNotify;
100 boost::signal0<void> workAreaFocus;
102 boost::signal0<void> workAreaUnfocus;
104 boost::signal3<void, int, int, mouse_button::state> workAreaDoubleClick;
106 boost::signal3<void, int, int, mouse_button::state> workAreaTripleClick;
107 /// emitted when an X client has requested our selection
108 boost::signal0<void> selectionRequested;
109 /// emitted when another X client has stolen our selection
110 boost::signal0<void> selectionLost;
112 /// handles SelectionRequest X Event, to fill the clipboard
113 int event_cb(XEvent * xev);
116 void createPixmap(int, int);
119 FL_OBJECT * backgroundbox;
121 FL_OBJECT * work_area;
123 FL_OBJECT * scrollbar;
125 mutable FL_OBJECT * splash_;
127 mutable FL_OBJECT * splash_text_;
128 /// The pixmap overlay on the workarea
129 Pixmap workareapixmap;
132 /// if we call redraw with true needed for locking-insets
134 /// the current document's height (for scrollbar)
138 #endif // XWORKAREA_H