]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.h
redraw fix 1.
[lyx.git] / src / BufferView.h
index 548306dbac80fb9af1fb991ec66b5ab2189f6fd9..0c91f1c3808f2c21d70619f96105dc22d86186d7 100644 (file)
@@ -1,13 +1,10 @@
 // -*- C++ -*-
-/* This file is part of
- * ====================================================== 
- * 
- *           LyX, The Document Processor
- *        
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
+/** \file
+ *  Copyright 2002 the LyX Team
+ *  Read the file COPYING
  *
- * ====================================================== */
+ *  \author Lars Gullik Bjønnes
+*/
 
 #ifndef BUFFER_VIEW_H
 #define BUFFER_VIEW_H
@@ -19,7 +16,9 @@
 #include "LString.h"
 #include "undo.h"
 #include "commandtags.h"
+
 #include "insets/inset.h"
+
 #include <boost/utility.hpp>
 
 class LyXView;
@@ -27,7 +26,6 @@ class LyXText;
 class TeXErrors;
 class Buffer;
 class LyXScreen;
-class WorkArea;
 class Language;
 class Painter;
 class UpdatableInset;
@@ -46,7 +44,7 @@ public:
                ///
                CHANGE = 4
        };
-                                           
+
        ///
        BufferView(LyXView * owner, int , int , int, int);
        ///
@@ -54,19 +52,21 @@ public:
        ///
        Buffer * buffer() const;
        ///
-       Painter & painter();
+       Painter & painter() const;
        ///
-       LyXScreen * screen() const;
+       LyXScreen & screen() const;
        ///
        void buffer(Buffer * b);
        ///
-       void resize(int, int, int, int);
-       ///
        void resize();
+       /**
+        * Repaint the pixmap. Used for when we don't want
+        * to go through the full update() logic, just a simple
+        * repaint of the whole screen.
+        */
+       void repaint();
        ///
-       void redraw();
-       ///
-       void fitCursor(LyXText *);
+       bool fitCursor();
        ///
        void update();
        //
@@ -74,26 +74,23 @@ public:
        ///
        void updateScrollbar();
        ///
-       Inset * checkInsetHit(LyXText *, int & x, int & y,
-                             unsigned int button);
-       /// 
-       void redoCurrentBuffer();
+       Inset * checkInsetHit(LyXText *, int & x, int & y);
        ///
-       int resizeCurrentBuffer();
+       void redoCurrentBuffer();
        ///
        void cursorPrevious(LyXText *);
        ///
        void cursorNext(LyXText *);
-       /// 
+       ///
        bool available() const;
        ///
        LyXView * owner() const;
        ///
        void beforeChange(LyXText *);
-        ///
-        void savePosition(unsigned int i);
-        ///
-        void restorePosition(unsigned int i);
+       ///
+       void savePosition(unsigned int i);
+       ///
+       void restorePosition(unsigned int i);
        ///
        bool isSavedPosition(unsigned int i);
        /** This holds the mapping between buffer paragraphs and screen rows.
@@ -111,7 +108,7 @@ public:
        ///
        UpdatableInset * theLockingInset() const;
        ///
-       void theLockingInset(UpdatableInset * inset); 
+       void theLockingInset(UpdatableInset * inset);
        ///
        void updateInset(Inset * inset, bool mark_dirty);
        ///
@@ -121,10 +118,6 @@ public:
        ///
        void insetUnlock();
        ///
-       void insetSleep();
-       ///
-       void insetWakeup();
-       ///
        void replaceWord(string const & replacestring);
        ///
        void endOfSpellCheck();
@@ -137,7 +130,7 @@ public:
        ///
        void paste();
        ///
-       void cut();
+       void cut(bool realcut = true);
        ///
        void copy();
        ///
@@ -162,7 +155,7 @@ public:
        //               bool no_table = false);
        bool insertInset(Inset * inset, string const & lout = string());
        /** Inserts a lyx file at cursor position.
-           @return #false# if it fails.
+           \return #false# if it fails.
        */
        bool insertLyXFile(string const & file);
        ///
@@ -172,7 +165,7 @@ public:
        ///
        void hideLockedInsetCursor();
        ///
-       void fitLockedInsetCursor(int x, int y, int asc, int desc);
+       bool fitLockedInsetCursor(int x, int y, int asc, int desc);
        ///
        int unlockInset(UpdatableInset * inset);
        ///
@@ -187,25 +180,15 @@ public:
        void toggleToggle();
        ///
        void center();
-       
-       ///
-       bool focus() const;
-       ///
-       void focus(bool);
-       ///
-       bool active() const;
-       ///
-       bool belowMouse() const;
-       /// A callback for the slider in the scrollbar.
-       void scrollCB(double);
+
+       /// Scroll the view by a number of pixels
+       void scrollDocView(int);
 
        ///
        void setState();
 
        ///
-       void pushIntoUpdateList(Inset * i);
-       ///
-       bool ChangeInsets(Inset::Code code, string const & from, 
+       bool ChangeInsets(Inset::Code code, string const & from,
                          string const & to);
        ///
        bool ChangeRefsIfUnique(string const & from, string const & to);
@@ -220,6 +203,7 @@ public:
        ///
        bool Dispatch(kb_action action, string const & argument);
 private:
+       ///
        struct Pimpl;
        ///
        friend struct BufferView::Pimpl;