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*/);
92 /// A callback for the up arrow in the scrollbar.
93 static void UpCB(FL_OBJECT *ob, long);
95 /// A callback for the slider in the scrollbar.
96 static void ScrollCB(FL_OBJECT *ob, long);
98 /// A callback for the down arrow in the scrollbar.
99 static void DownCB(FL_OBJECT *ob, long);
101 /** Work area free object handler
103 static int work_area_handler(FL_OBJECT *, int event,
104 FL_Coord, FL_Coord, int key, void *xev);
106 int WorkAreaMotionNotify(FL_OBJECT *ob,
109 XEvent *ev, void *d);
111 int WorkAreaSelectionNotify(FL_OBJECT *, Window win,
112 int /*w*/, int /*h*/,
113 XEvent *event, void */*d*/);
115 int WorkAreaButtonPress(FL_OBJECT *ob,
118 XEvent *ev, void *d);
120 int WorkAreaButtonRelease(FL_OBJECT *ob,
123 XEvent *ev, void *d);
125 static void CursorToggleCB(FL_OBJECT *ob, long);
133 long current_scrollbar_value;
139 bool work_area_focus;
141 FL_OBJECT *work_area;
143 FL_OBJECT *figinset_canvas;
145 FL_OBJECT *scrollbar;
147 FL_OBJECT *button_down;
149 FL_OBJECT *button_up;
151 FL_OBJECT *timer_cursor;
153 BackStack *backstack;
155 int last_click_x, last_click_y;