]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/WorkArea.h
Move Color::color enum to ColorCode.h
[lyx.git] / src / frontends / WorkArea.h
index f53f221c316946005ed0ca0378e4d670c80d325a..74a875f241f83141cd65b1589b14f4c662d8a192 100644 (file)
 #ifndef BASE_WORKAREA_H
 #define BASE_WORKAREA_H
 
-#include "frontends/key_state.h"
-#include "frontends/LyXKeySym.h"
-#include "frontends/Timeout.h"
+#include "frontends/KeyModifier.h"
+#include "frontends/Delegates.h"
 
+#include "support/Timeout.h"
 #include "support/docstring.h"
 
-#include <boost/signals/trackable.hpp>
-
+#undef CursorShape
 
 namespace lyx {
 
+class Buffer;
 class BufferView;
 class FuncRequest;
-class LyXView;
+class KeySymbol;
 
 namespace frontend {
 
+class LyXView;
 class Painter;
 
 /// types of cursor in work area
@@ -50,15 +51,16 @@ enum CursorShape {
  * It works in concert with the BaseScreen class to update the
  * widget view of a document.
  */
-class WorkArea : public boost::signals::trackable {
+class WorkArea
+{
 public:
-       WorkArea(int id, LyXView & lyx_view);
-
-       virtual ~WorkArea() {}
+       ///
+       WorkArea(Buffer & buffer, LyXView & lv);
 
-       int const id() const { return id_; }
+       virtual ~WorkArea();
 
-       void setBufferView(BufferView * buffer_view);
+       ///
+       void setLyXView(LyXView & lv) { lyx_view_ = &lv; }
 
        ///
        BufferView & bufferView();
@@ -67,7 +69,10 @@ public:
 
        /// \return true if has the keyboard input focus.
        virtual bool hasFocus() const = 0;
-       
+
+       /// \return true if has this WorkArea is visible.
+       virtual bool isVisible() const = 0;
+
        /// return the width of the work area in pixels
        virtual int width() const = 0;
 
@@ -83,7 +88,7 @@ public:
        virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
 
        ///
-       virtual void sheduleRedraw() = 0;
+       virtual void scheduleRedraw() = 0;
 
        /// redraw the screen, without using existing pixmap
        virtual void redraw();
@@ -93,16 +98,20 @@ public:
 
        /// Process Key pressed event.
        /// This needs to be public because it is accessed externally by GuiView.
-       void processKeySym(LyXKeySymPtr key, key_modifier::state state);
+       void processKeySym(KeySymbol const & key, KeyModifier mod);
+
+       /// close this work area.
+       /// Slot for Buffer::closing signal.
+       void close();
+
 protected:
        /// cause the display of the given area of the work area
        virtual void expose(int x, int y, int w, int h) = 0;
        ///
-       void dispatch(FuncRequest const & cmd0);
+       void dispatch(FuncRequest const & cmd0, KeyModifier = NoModifier);
+
        ///
        void resizeBufferView();
-       ///
-       void scrollBufferView(int position);
        /// hide the visible cursor, if it is visible
        void hideCursor();
        /// show the cursor if it is not visible
@@ -118,20 +127,10 @@ protected:
 
        ///
        BufferView * buffer_view_;
-
        ///
-       LyXView & lyx_view_;
-       ///
-       bool greyed_out_;
+       LyXView * lyx_view_;
 
 private:
-       ///
-       int id_;
-       ///
-       void displayMessage(docstring const &);
-       /// buffer messages signal connection
-       boost::signals::connection message_connection_;
-
        /// is the cursor currently displayed
        bool cursor_visible_;