]> git.lyx.org Git - lyx.git/blobdiff - src/WorkArea.h
citation patch from Angus
[lyx.git] / src / WorkArea.h
index 3be02d3625d7687c1f6e4db31bdda263e01a16c2..18b10611c796ce68e1040099a1ff1c84da88df22 100644 (file)
 
 #include <utility>
 
+#include <sigc++/signal_system.h>
+
 #include FORMS_H_LOCATION
 #include "Painter.h"
 
-class BufferView;
+#ifdef SIGC_CXX_NAMESPACES
+using SigC::Signal0;
+using SigC::Signal2;
+using SigC::Signal3;
+#endif
 
-#define XFORMS_CLIPBOARD 1
+class BufferView;
 
+///
 class WorkArea {
 public:
        ///
@@ -34,7 +41,7 @@ public:
        ///
        Painter & getPainter() { return painter_; }
        ///
-       unsigned int workWidth() const { return work_area->w; }
+       int workWidth() const { return work_area->w; }
        ///
        unsigned int width() const { return work_area->w + scrollbar->w; }
        ///
@@ -92,12 +99,36 @@ public:
                                     int /*key*/, void * xev);
        /// xforms callback
        static void scroll_cb(FL_OBJECT *, long);
-#ifdef XFORMS_CLIPBOARD
        ///
        string getClipboard() const;
        ///
        void putClipboard(string const &) const;
-#endif
+       ///
+       BufferView * owner() const { return owner_; }
+
+       // Signals
+       ///
+       Signal0<void> workAreaExpose;
+       ///
+       Signal2<void, KeySym, unsigned int> workAreaKeyPress;
+       ///
+       Signal3<void, int, int, unsigned int> workAreaButtonPress;
+       ///
+       Signal3<void, int, int, unsigned int> workAreaButtonRelease;
+       ///
+       Signal3<void, int, int, unsigned int> workAreaMotionNotify;
+       ///
+       Signal0<void> workAreaFocus;
+       ///
+       Signal0<void> workAreaUnfocus;
+       ///
+       Signal0<void> workAreaEnter;
+       ///
+       Signal0<void> workAreaLeave;
+       ///
+       Signal3<void, int, int, unsigned int> workAreaDoubleClick;
+       ///
+       Signal3<void, int, int, unsigned int> workAreaTripleClick;
 private:
        ///
        void createPixmap(int, int);
@@ -108,12 +139,14 @@ private:
        ///
        FL_OBJECT * scrollbar;
        ///
-       BufferView * owner;
+       BufferView * owner_;
        /// The pixmap overlay on the workarea
        Pixmap workareapixmap;
        ///
        Painter painter_;
        ///
        FL_OBJECT * figinset_canvas;
+       /// if we call redraw with true needed for locking-insets
+       bool screen_cleared;
 };
 #endif