2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright (C) 1995 Matthias Ettrich
8 * Copyright (C) 1995-1998 The LyX Team.
10 * ====================================================== */
19 #include FORMS_H_LOCATION
20 #include "BackStack.h"
33 BufferView(LyXView * owner, int , int , int, int);
37 Buffer * buffer() const { return buffer_; }
39 FL_OBJECT * getWorkArea() { return work_area; }
41 void buffer(Buffer * b);
51 void update(signed char f);
53 void smallUpdate(signed char f);
55 void updateScrollbar();
57 void redoCurrentBuffer();
59 int resizeCurrentBuffer();
63 void cursorPrevious();
67 bool available() const;
69 LyXView * owner() const { return owner_; }
71 LyXScreen * getScreen() {
72 fl_set_timer(timer_cursor, 0.4);
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(long x, long y, int asc, int desc);
171 void fitLockedInsetCursor(long x, long y, int asc, int desc);
173 int unlockInset(UpdatableInset * inset);
175 void lockedInsetStoreUndo(Undo::undo_kind kind);
177 /// Update pixmap of screen
180 int workAreaExpose();
182 void create_view(int, int, int, int);
184 Inset * checkInsetHit(int & x, int & y);
186 int ScrollUp(long time);
188 int ScrollDown(long time);
190 void ScrollUpOnePage(long /*time*/);
192 void ScrollDownOnePage(long /*time*/);
195 /// A callback for the up arrow in the scrollbar.
196 static void UpCB(FL_OBJECT * ob, long);
198 /// A callback for the slider in the scrollbar.
199 static void ScrollCB(FL_OBJECT * ob, long);
201 /// A callback for the down arrow in the scrollbar.
202 static void DownCB(FL_OBJECT * ob, long);
205 static void CursorToggleCB(FL_OBJECT * ob, long);
206 /** Work area free object handler
208 static int work_area_handler(FL_OBJECT *, int event,
209 FL_Coord, FL_Coord, int key, void *xev);
212 int WorkAreaMotionNotify(FL_OBJECT * ob,
215 XEvent * ev, void * d);
217 int WorkAreaSelectionNotify(FL_OBJECT *, Window win,
218 int /*w*/, int /*h*/,
219 XEvent * event, void * /*d*/);
221 int WorkAreaButtonPress(FL_OBJECT * ob,
224 XEvent * ev, void * d);
226 int WorkAreaButtonRelease(FL_OBJECT * ob,
229 XEvent * ev, void * d);
237 long current_scrollbar_value;
241 bool work_area_focus;
243 FL_OBJECT * work_area;
245 FL_OBJECT * figinset_canvas;
247 FL_OBJECT * scrollbar;
249 FL_OBJECT * button_down;
251 FL_OBJECT * button_up;
253 FL_OBJECT * timer_cursor;
257 int last_click_x, last_click_y;