2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2000 The LyX Team.
10 * ====================================================== */
19 #include FORMS_H_LOCATION
20 #include "BackStack.h"
23 #include "UpdateInset.h"
36 BufferView(LyXView * owner, int , int , int, int);
40 Buffer * buffer() const { return buffer_; }
44 Painter & getPainter() const;
46 void buffer(Buffer * b);
48 void resize(int, int, int, int);
58 void update(signed char f);
60 void smallUpdate(signed char f);
62 void updateScrollbar();
64 void redoCurrentBuffer();
66 int resizeCurrentBuffer();
70 void cursorPrevious();
74 bool available() const;
76 LyXView * owner() const { return owner_; }
82 void restorePosition();
83 /** This holds the mapping between buffer paragraphs and screen rows.
84 This should be private...but not yet. (Lgb)
88 unsigned short paperWidth() const;
90 UpdatableInset * the_locking_inset;
92 void updateInset(Inset * inset, bool mark_dirty);
106 void replaceWord(string const & replacestring);
108 void endOfSpellCheck();
110 void selectLastWord();
112 char * nextWord(float & value);
114 void insertCorrectQuote();
118 bool gotoLabel(string const & label);
126 void pasteEnvironment();
128 void copyEnvironment();
132 void protectedBlank();
136 void menuSeparator();
138 void endOfSentenceDot();
142 void hyphenationPoint();
154 void allFloats(char flag, char figmar);
155 /// removes all autodeletable insets
156 bool removeAutoInsets();
158 void insertErrors(TeXErrors & terr);
160 void setCursorFromRow(int row);
161 /** Insert an inset into the buffer
162 Insert inset into buffer, placing it in a layout of lout,
163 if no_table make sure that it doesn't end up in a table. */
164 void insertInset(Inset * inset, string const & lout = string(),
165 bool no_table = false);
166 /// open and lock an updatable inset
167 void open_new_inset(UpdatableInset * new_inset);
168 /// Inserts a lyx file at cursor position. Returns false if it fails.
169 bool insertLyXFile(string const & file);
171 int lockInset(UpdatableInset * inset);
173 void showLockedInsetCursor(long x, long y, int asc, int desc);
175 void hideLockedInsetCursor();
177 void fitLockedInsetCursor(long x, long y, int asc, int desc);
179 int unlockInset(UpdatableInset * inset);
181 void lockedInsetStoreUndo(Undo::undo_kind kind);
187 void toggleSelection(bool = true);
194 friend class WorkArea;
196 /// Update pixmap of screen
199 void workAreaExpose();
201 void scrollUpOnePage();
203 void scrollDownOnePage();
207 Inset * checkInsetHit(int & x, int & y);
209 int scrollUp(long time);
211 int scrollDown(long time);
221 bool belowMouse() const;
222 /// A callback for the up arrow in the scrollbar.
223 void upCB(long time, int button);
224 /// A callback for the slider in the scrollbar.
225 void scrollCB(double);
226 /// A callback for the down arrow in the scrollbar.
227 void downCB(long time, int button);
230 static void cursorToggleCB(FL_OBJECT * ob, long);
237 void workAreaMotionNotify(int x, int y, unsigned int state);
239 void workAreaButtonPress(int x, int y, unsigned int button);
241 void workAreaButtonRelease(int x, int y, unsigned int button);
243 void workAreaSelectionNotify(Window win, XEvent * event);
245 void doubleClick(int x, int y, unsigned int button);
247 void trippleClick(int x, int y, unsigned int button);
255 long current_scrollbar_value;
259 bool work_area_focus;
261 FL_OBJECT * figinset_canvas;
263 FL_OBJECT * timer_cursor;
267 int last_click_x, last_click_y;
271 UpdateInset updatelist;
274 void pushIntoUpdateList(Inset * i) {