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"
35 BufferView(LyXView * owner, int , int , int, int);
39 Buffer * buffer() const { return buffer_; }
45 WorkArea * getWorkArea() { return workarea; }
47 void buffer(Buffer * b);
49 void resize(int, int, int, int);
59 void update(signed char f);
61 void smallUpdate(signed char f);
63 void updateScrollbar();
65 void redoCurrentBuffer();
67 int resizeCurrentBuffer();
71 void cursorPrevious();
75 bool available() const;
77 LyXView * owner() const { return owner_; }
79 LyXScreen * getScreen() {
80 fl_set_timer(timer_cursor, 0.4);
88 void restorePosition();
89 /** This holds the mapping between buffer paragraphs and screen rows.
90 This should be private...but not yet. (Lgb)
94 UpdatableInset * the_locking_inset;
108 void replaceWord(string const & replacestring);
110 void endOfSpellCheck();
112 void selectLastWord();
114 char * nextWord(float & value);
116 void insertCorrectQuote();
120 bool gotoLabel(string const & label);
128 void pasteEnvironment();
130 void copyEnvironment();
134 void protectedBlank();
138 void menuSeparator();
140 void endOfSentenceDot();
144 void hyphenationPoint();
156 void allFloats(char flag, char figmar);
157 /// removes all autodeletable insets
158 bool removeAutoInsets();
160 void insertErrors(TeXErrors & terr);
162 void setCursorFromRow(int row);
163 /** Insert an inset into the buffer
164 Insert inset into buffer, placing it in a layout of lout,
165 if no_table make sure that it doesn't end up in a table. */
166 void insertInset(Inset * inset, string const & lout = string(),
167 bool no_table = false);
168 /// open and lock an updatable inset
169 void open_new_inset(UpdatableInset * new_inset);
170 /// Inserts a lyx file at cursor position. Returns false if it fails.
171 bool insertLyXFile(string const & file);
173 int lockInset(UpdatableInset * inset);
175 void showLockedInsetCursor(long x, long y, int asc, int desc);
177 void hideLockedInsetCursor(long x, long y, int asc, int desc);
179 void fitLockedInsetCursor(long x, long y, int asc, int desc);
181 int unlockInset(UpdatableInset * inset);
183 void lockedInsetStoreUndo(Undo::undo_kind kind);
185 friend class WorkArea;
187 /// Update pixmap of screen
190 void workAreaExpose();
192 void ScrollUpOnePage();
194 void ScrollDownOnePage();
198 Inset * checkInsetHit(int & x, int & y);
200 int ScrollUp(long time);
202 int ScrollDown(long time);
211 /// A callback for the up arrow in the scrollbar.
212 void UpCB(long time, int button);
213 /// A callback for the slider in the scrollbar.
214 void ScrollCB(double);
215 /// A callback for the down arrow in the scrollbar.
216 void DownCB(long time, int button);
219 static void CursorToggleCB(FL_OBJECT * ob, long);
221 /** Work area free object handler
223 static int work_area_handler(FL_OBJECT *, int event,
224 FL_Coord, FL_Coord, int key, void *xev);
232 void WorkAreaMotionNotify(int x, int y, unsigned int state);
234 void WorkAreaButtonPress(int x, int y, unsigned int button);
236 void WorkAreaButtonRelease(int x, int y, unsigned int button);
238 void WorkAreaSelectionNotify(Window win, XEvent * event);
246 long current_scrollbar_value;
250 bool work_area_focus;
252 FL_OBJECT * figinset_canvas;
254 FL_OBJECT * timer_cursor;
258 int last_click_x, last_click_y;