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"
34 BufferView(LyXView * owner, int , int , int, int);
38 Buffer * buffer() const { return buffer_; }
40 FL_OBJECT * getWorkArea() { return work_area; }
42 void buffer(Buffer * b);
52 void update(signed char f);
54 void smallUpdate(signed char f);
56 void updateScrollbar();
58 void redoCurrentBuffer();
60 int resizeCurrentBuffer();
64 void cursorPrevious();
68 bool available() const;
70 LyXView * owner() const { return owner_; }
72 LyXScreen * getScreen() {
73 fl_set_timer(timer_cursor, 0.4);
81 void restorePosition();
82 /** This holds the mapping between buffer paragraphs and screen rows.
83 This should be private...but not yet. (Lgb)
87 UpdatableInset * the_locking_inset;
101 void replaceWord(string const & replacestring);
103 void endOfSpellCheck();
105 void selectLastWord();
107 char * nextWord(float & value);
109 void insertCorrectQuote();
113 bool gotoLabel(string const & label);
121 void pasteEnvironment();
123 void copyEnvironment();
127 void protectedBlank();
131 void menuSeparator();
133 void endOfSentenceDot();
137 void hyphenationPoint();
149 void allFloats(char flag, char figmar);
150 /// removes all autodeletable insets
151 bool removeAutoInsets();
153 void insertErrors(TeXErrors & terr);
155 void setCursorFromRow(int row);
156 /** Insert an inset into the buffer
157 Insert inset into buffer, placing it in a layout of lout,
158 if no_table make sure that it doesn't end up in a table. */
159 void insertInset(Inset * inset, string const & lout = string(),
160 bool no_table = false);
161 /// open and lock an updatable inset
162 void open_new_inset(UpdatableInset * new_inset);
163 /// Inserts a lyx file at cursor position. Returns false if it fails.
164 bool insertLyXFile(string const & file);
166 int lockInset(UpdatableInset * inset);
168 void showLockedInsetCursor(long x, long y, int asc, int desc);
170 void hideLockedInsetCursor(long x, long y, int asc, int desc);
172 void fitLockedInsetCursor(long x, long y, int asc, int desc);
174 int unlockInset(UpdatableInset * inset);
176 void lockedInsetStoreUndo(Undo::undo_kind kind);
178 /// Update pixmap of screen
181 int workAreaExpose();
183 void create_view(int, int, int, int);
185 Inset * checkInsetHit(int & x, int & y);
187 int ScrollUp(long time);
189 int ScrollDown(long time);
191 void ScrollUpOnePage(long /*time*/);
193 void ScrollDownOnePage(long /*time*/);
196 /// A callback for the up arrow in the scrollbar.
197 static void UpCB(FL_OBJECT * ob, long);
199 /// A callback for the slider in the scrollbar.
200 static void ScrollCB(FL_OBJECT * ob, long);
202 /// A callback for the down arrow in the scrollbar.
203 static void DownCB(FL_OBJECT * ob, long);
206 static void CursorToggleCB(FL_OBJECT * ob, long);
207 /** Work area free object handler
209 static int work_area_handler(FL_OBJECT *, int event,
210 FL_Coord, FL_Coord, int key, void *xev);
217 int WorkAreaMotionNotify(FL_OBJECT * ob,
220 XEvent * ev, void * d);
222 int WorkAreaSelectionNotify(FL_OBJECT *, Window win,
223 int /*w*/, int /*h*/,
224 XEvent * event, void * /*d*/);
226 int WorkAreaButtonPress(FL_OBJECT * ob,
229 XEvent * ev, void * d);
231 int WorkAreaButtonRelease(FL_OBJECT * ob,
234 XEvent * ev, void * d);
242 long current_scrollbar_value;
246 bool work_area_focus;
248 FL_OBJECT * work_area;
250 FL_OBJECT * figinset_canvas;
252 FL_OBJECT * scrollbar;
254 FL_OBJECT * button_down;
256 FL_OBJECT * button_up;
258 FL_OBJECT * timer_cursor;
262 int last_click_x, last_click_y;