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"
37 BufferView(LyXView * owner, int , int , int, int);
41 Buffer * buffer() const { return buffer_; }
48 WorkArea * getWorkArea() { return workarea; }
51 FL_OBJECT * getWorkArea() { return work_area; }
54 void buffer(Buffer * b);
57 void resize(int, int, int, int);
68 void update(signed char f);
70 void smallUpdate(signed char f);
72 void updateScrollbar();
74 void redoCurrentBuffer();
76 int resizeCurrentBuffer();
80 void cursorPrevious();
84 bool available() const;
86 LyXView * owner() const { return owner_; }
88 LyXScreen * getScreen() {
89 fl_set_timer(timer_cursor, 0.4);
97 void restorePosition();
98 /** This holds the mapping between buffer paragraphs and screen rows.
99 This should be private...but not yet. (Lgb)
103 UpdatableInset * the_locking_inset;
117 void replaceWord(string const & replacestring);
119 void endOfSpellCheck();
121 void selectLastWord();
123 char * nextWord(float & value);
125 void insertCorrectQuote();
129 bool gotoLabel(string const & label);
137 void pasteEnvironment();
139 void copyEnvironment();
143 void protectedBlank();
147 void menuSeparator();
149 void endOfSentenceDot();
153 void hyphenationPoint();
165 void allFloats(char flag, char figmar);
166 /// removes all autodeletable insets
167 bool removeAutoInsets();
169 void insertErrors(TeXErrors & terr);
171 void setCursorFromRow(int row);
172 /** Insert an inset into the buffer
173 Insert inset into buffer, placing it in a layout of lout,
174 if no_table make sure that it doesn't end up in a table. */
175 void insertInset(Inset * inset, string const & lout = string(),
176 bool no_table = false);
177 /// open and lock an updatable inset
178 void open_new_inset(UpdatableInset * new_inset);
179 /// Inserts a lyx file at cursor position. Returns false if it fails.
180 bool insertLyXFile(string const & file);
182 int lockInset(UpdatableInset * inset);
184 void showLockedInsetCursor(long x, long y, int asc, int desc);
186 void hideLockedInsetCursor(long x, long y, int asc, int desc);
188 void fitLockedInsetCursor(long x, long y, int asc, int desc);
190 int unlockInset(UpdatableInset * inset);
192 void lockedInsetStoreUndo(Undo::undo_kind kind);
194 friend class WorkArea;
196 /// Update pixmap of screen
200 void workAreaExpose();
202 void ScrollUpOnePage();
204 void ScrollDownOnePage();
207 int workAreaExpose();
209 void ScrollUpOnePage(long /*time*/);
211 void ScrollDownOnePage(long /*time*/);
214 void create_view(int, int, int, int);
216 Inset * checkInsetHit(int & x, int & y);
218 int ScrollUp(long time);
220 int ScrollDown(long time);
231 /// A callback for the up arrow in the scrollbar.
232 void UpCB(long time, int button);
233 /// A callback for the slider in the scrollbar.
234 void ScrollCB(double);
235 /// A callback for the down arrow in the scrollbar.
236 void DownCB(long time, int button);
238 /// A callback for the up arrow in the scrollbar.
239 static void UpCB(FL_OBJECT * ob, long);
240 /// A callback for the slider in the scrollbar.
241 static void ScrollCB(FL_OBJECT * ob, long);
243 /// A callback for the down arrow in the scrollbar.
244 static void DownCB(FL_OBJECT * ob, long);
248 static void CursorToggleCB(FL_OBJECT * ob, long);
249 /** Work area free object handler
251 static int work_area_handler(FL_OBJECT *, int event,
252 FL_Coord, FL_Coord, int key, void *xev);
260 void WorkAreaMotionNotify(int x, int y, unsigned int state);
262 void WorkAreaButtonPress(int x, int y, unsigned int button);
264 void WorkAreaButtonRelease(int x, int y, unsigned int button);
266 void WorkAreaSelectionNotify(Window win, XEvent * event);
269 int WorkAreaMotionNotify(FL_OBJECT * ob,
272 XEvent * ev, void * d);
274 int WorkAreaButtonPress(FL_OBJECT * ob,
277 XEvent * ev, void * d);
279 int WorkAreaButtonRelease(FL_OBJECT * ob,
282 XEvent * ev, void * d);
284 int WorkAreaSelectionNotify(FL_OBJECT *, Window win,
285 int /*w*/, int /*h*/,
286 XEvent * event, void * /*d*/);
295 long current_scrollbar_value;
299 bool work_area_focus;
302 FL_OBJECT * work_area;
304 FL_OBJECT * scrollbar;
306 FL_OBJECT * button_down;
308 FL_OBJECT * button_up;
311 FL_OBJECT * figinset_canvas;
313 FL_OBJECT * timer_cursor;
317 int last_click_x, last_click_y;