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 void buffer(Buffer * b);
46 void resize(int, int, int, int);
56 void update(signed char f);
58 void smallUpdate(signed char f);
60 void updateScrollbar();
62 void redoCurrentBuffer();
64 int resizeCurrentBuffer();
68 void cursorPrevious();
72 bool available() const;
74 LyXView * owner() const { return owner_; }
80 void restorePosition();
81 /** This holds the mapping between buffer paragraphs and screen rows.
82 This should be private...but not yet. (Lgb)
86 UpdatableInset * the_locking_inset;
100 void replaceWord(string const & replacestring);
102 void endOfSpellCheck();
104 void selectLastWord();
106 char * nextWord(float & value);
108 void insertCorrectQuote();
112 bool gotoLabel(string const & label);
120 void pasteEnvironment();
122 void copyEnvironment();
126 void protectedBlank();
130 void menuSeparator();
132 void endOfSentenceDot();
136 void hyphenationPoint();
148 void allFloats(char flag, char figmar);
149 /// removes all autodeletable insets
150 bool removeAutoInsets();
152 void insertErrors(TeXErrors & terr);
154 void setCursorFromRow(int row);
155 /** Insert an inset into the buffer
156 Insert inset into buffer, placing it in a layout of lout,
157 if no_table make sure that it doesn't end up in a table. */
158 void insertInset(Inset * inset, string const & lout = string(),
159 bool no_table = false);
160 /// open and lock an updatable inset
161 void open_new_inset(UpdatableInset * new_inset);
162 /// Inserts a lyx file at cursor position. Returns false if it fails.
163 bool insertLyXFile(string const & file);
165 int lockInset(UpdatableInset * inset);
167 void showLockedInsetCursor(long x, long y, int asc, int desc);
169 void hideLockedInsetCursor();
171 void fitLockedInsetCursor(long x, long y, int asc, int desc);
173 int unlockInset(UpdatableInset * inset);
175 void lockedInsetStoreUndo(Undo::undo_kind kind);
181 void toggleSelection(bool = true);
188 friend class WorkArea;
190 /// Update pixmap of screen
193 void workAreaExpose();
195 void scrollUpOnePage();
197 void scrollDownOnePage();
201 Inset * checkInsetHit(int & x, int & y);
203 int scrollUp(long time);
205 int scrollDown(long time);
215 bool belowMouse() const;
216 /// A callback for the up arrow in the scrollbar.
217 void upCB(long time, int button);
218 /// A callback for the slider in the scrollbar.
219 void scrollCB(double);
220 /// A callback for the down arrow in the scrollbar.
221 void downCB(long time, int button);
224 static void cursorToggleCB(FL_OBJECT * ob, long);
231 void workAreaMotionNotify(int x, int y, unsigned int state);
233 void workAreaButtonPress(int x, int y, unsigned int button);
235 void workAreaButtonRelease(int x, int y, unsigned int button);
237 void workAreaSelectionNotify(Window win, XEvent * event);
239 void doubleClick(int x, int y, unsigned int button);
241 void trippleClick(int x, int y, unsigned int button);
249 long current_scrollbar_value;
253 bool work_area_focus;
255 FL_OBJECT * figinset_canvas;
257 FL_OBJECT * timer_cursor;
261 int last_click_x, last_click_y;
265 UpdateInset updatelist;
268 void updateInset(Inset *, bool);
270 void pushIntoUpdateList(Inset * i) {