]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.h
* remove various xforms relicts, in particular:
[lyx.git] / src / BufferView.h
index 5723cb72cd811925b704a2d8b75c755a5b02f1c7..924637e10c1832713f24c2d28c3bc9dacb10130f 100644 (file)
@@ -34,12 +34,7 @@ class LCursor;
 class LyXText;
 class LyXView;
 class ParIterator;
-
-namespace lyx {
-namespace frontend {
-class Painter;
-}
-}
+class ViewMetricsInfo;
 
 namespace Update {
        enum flags {
@@ -61,6 +56,23 @@ inline flags operator&(flags const f, flags const g)
 
 } // namespace
 
+/// Scrollbar Parameters
+struct ScrollbarParameters
+{
+       void reset(int h = 0, int p = 0, int l = 0)
+       {
+               height = h;
+               position = p;
+               lineScrollHeight = l;
+       }
+
+       /// The total document height in pixels
+       int height;
+       /// The current position in the document, in pixels
+       int position;
+       /// the line-scroll amount, in pixels
+       int lineScrollHeight;
+};
 
 /**
  * A buffer view encapsulates a view onto a particular
@@ -76,7 +88,7 @@ public:
         * Create a view with the given owner main window,
         * of the given dimensions.
         */
-       BufferView(LyXView * owner, int w, int h);
+       BufferView(LyXView * owner);
 
        ~BufferView();
 
@@ -85,9 +97,6 @@ public:
        /// return the buffer being viewed
        Buffer * buffer() const;
 
-       /// return the painter object for drawing onto the view
-       lyx::frontend::Painter & painter() const;
-
        /// return the owning main view
        LyXView * owner() const;
 
@@ -114,6 +123,8 @@ public:
        bool fitCursor();
        /// reset the scrollbar to reflect current view position
        void updateScrollbar();
+       /// return the Scrollbar Parameters
+       ScrollbarParameters const & scrollbarParameters() const;
 
        /// FIXME
        bool available() const;
@@ -167,13 +178,6 @@ public:
        /// switch between primary and secondary keymaps for RTL entry
        void switchKeyMap();
 
-       /// get the contents of the window system clipboard
-       std::string const getClipboard() const;
-       /// fill the window system clipboard
-       void stuffClipboard(std::string const &) const;
-       /// tell the window system we have a selection
-       void haveSelection(bool sel);
-
        /// return true for events that will handle
        FuncStatus getStatus(FuncRequest const & cmd);
        /// execute the given function
@@ -185,10 +189,10 @@ public:
        void selectionLost();
 
        ///
-       void workAreaResize();
+       void workAreaResize(int width, int height);
 
-        /// Receive a keypress
-        void workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state);
+       /// Receive a keypress
+       void workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state);
 
        /// a function should be executed from the workarea
        bool workAreaDispatch(FuncRequest const & ev);
@@ -219,11 +223,9 @@ public:
         */
        void putSelectionAt(DocIterator const & cur,
                int length, bool backwards);
-       ///
-       bool const repaintAll() const;
-       ///
-       void const repaintAll(bool r) const;
 
+       ///
+       ViewMetricsInfo const & viewMetricsInfo();
 private:
        ///
        class Pimpl;