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 *======================================================*/
12 #ifndef _BUFFER_VIEW_H
13 #define _BUFFER_VIEW_H
19 #include FORMS_H_LOCATION
31 BufferView(LyXView *owner, int ,int ,int, int);
35 Buffer *currentBuffer() { return _buffer; }
37 FL_OBJECT *getWorkArea() { return work_area; }
39 void setBuffer(Buffer *b);
49 void updateScrollbar();
51 void redoCurrentBuffer();
53 int resizeCurrentBuffer();
57 void cursorPrevious();
61 bool available() const;
63 LyXView *getOwner() { return _owner; }
65 LyXScreen *getScreen()
67 fl_set_timer(timer_cursor, 0.4);
73 void restorePosition();
75 /// Update pixmap of screen
80 void create_view(int, int, int, int);
82 Inset * checkInsetHit(int &x, int &y);
84 int ScrollUp(long time);
86 int ScrollDown(long time);
88 void ScrollUpOnePage(long /*time*/);
90 void ScrollDownOnePage(long /*time*/);
93 /// A callback for the up arrow in the scrollbar.
94 static void UpCB(FL_OBJECT *ob, long);
96 /// A callback for the slider in the scrollbar.
97 static void ScrollCB(FL_OBJECT *ob, long);
99 /// A callback for the down arrow in the scrollbar.
100 static void DownCB(FL_OBJECT *ob, long);
103 static void CursorToggleCB(FL_OBJECT *ob, long);
104 /** Work area free object handler
106 static int work_area_handler(FL_OBJECT *, int event,
107 FL_Coord, FL_Coord, int key, void *xev);
110 int WorkAreaMotionNotify(FL_OBJECT *ob,
113 XEvent *ev, void *d);
115 int WorkAreaSelectionNotify(FL_OBJECT *, Window win,
116 int /*w*/, int /*h*/,
117 XEvent *event, void */*d*/);
119 int WorkAreaButtonPress(FL_OBJECT *ob,
122 XEvent *ev, void *d);
124 int WorkAreaButtonRelease(FL_OBJECT *ob,
127 XEvent *ev, void *d);
135 long current_scrollbar_value;
141 bool work_area_focus;
143 FL_OBJECT *work_area;
145 FL_OBJECT *figinset_canvas;
147 FL_OBJECT *scrollbar;
149 FL_OBJECT *button_down;
151 FL_OBJECT *button_up;
153 FL_OBJECT *timer_cursor;
155 BackStack *backstack;
157 int last_click_x, last_click_y;