GTK eradication -- the build chain.
[sxemacs] / src / ui / Gtk / scrollbar-gtk.h
1 /* Define Gtk-specific scrollbar instance.
2    Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
3
4 This file is part of SXEmacs
5
6 SXEmacs is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 SXEmacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
18
19
20 /* Synched up with: Not in FSF. */
21
22 #ifndef _XEMACS_SCROLLBAR_GTK_H_
23 #define _XEMACS_SCROLLBAR_GTK_H_
24
25 #if defined (HAVE_GTK) && defined (HAVE_SCROLLBARS)
26
27 #include "ui/scrollbar.h"
28
29 typedef struct _scrollbar_values {
30         int line_increment;
31         int page_increment;
32
33         int minimum;
34         int maximum;
35
36         int slider_size;
37         int slider_position;
38
39         int scrollbar_width, scrollbar_height;
40         int scrollbar_x, scrollbar_y;
41 } scrollbar_values;
42
43 struct gtk_scrollbar_data {
44         /* Unique scrollbar identifier and name. */
45         unsigned int id;
46
47         /* Is set if we have already set the backing_store attribute correctly */
48         char backing_store_initialized;
49
50         /* Positioning and sizing information for scrollbar and slider. */
51         scrollbar_values pos_data;
52
53         /* Pointer to the scrollbar widget this structure describes. */
54         GtkWidget *widget;
55
56         gfloat last_value;
57
58         /* Recorded starting position for Motif-like scrollbar drags. */
59         int vdrag_orig_value;
60         Bufpos vdrag_orig_window_start;
61 };
62
63 #define SCROLLBAR_GTK_DATA(i) ((struct gtk_scrollbar_data *) ((i)->scrollbar_data))
64
65 #define SCROLLBAR_GTK_ID(i) (SCROLLBAR_GTK_DATA (i)->id)
66 #define SCROLLBAR_GTK_BACKING_STORE_INITIALIZED(i) \
67   (SCROLLBAR_GTK_DATA (i)->backing_store_initialized)
68 #define SCROLLBAR_GTK_POS_DATA(i) (SCROLLBAR_GTK_DATA (i)->pos_data)
69 #define SCROLLBAR_GTK_WIDGET(i) (SCROLLBAR_GTK_DATA (i)->widget)
70 #define SCROLLBAR_GTK_LAST_VALUE(i) SCROLLBAR_GTK_DATA (i)->last_value
71
72 #define SCROLLBAR_GTK_VDRAG_ORIG_VALUE(i) \
73   (SCROLLBAR_GTK_DATA (i)->vdrag_orig_value)
74 #define SCROLLBAR_GTK_VDRAG_ORIG_WINDOW_START(i) \
75   (SCROLLBAR_GTK_DATA (i)->vdrag_orig_window_start)
76
77 void gtk_update_frame_scrollbars(struct frame *f);
78 void gtk_set_scrollbar_pointer(struct frame *f, Lisp_Object cursor);
79
80 #endif                          /* HAVE_GDK and HAVE_SCROLLBARS */
81 #endif                          /* _XEMACS_SCROLLBAR_GTK_H_ */