GTK eradication -- the build chain.
[sxemacs] / src / ui / toolbar.h
1 /* Define general toolbar support.
2    Copyright (C) 1995 Board of Trustees, University of Illinois.
3    Copyright (C) 1995, 1996 Ben Wing.
4    Copyright (C) 1996 Chuck Thompson.
5
6 This file is part of SXEmacs
7
8 SXEmacs is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 SXEmacs is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
20
21
22 /* Synched up with: Not in FSF. */
23
24 #ifndef INCLUDED_toolbar_h_
25 #define INCLUDED_toolbar_h_
26
27 #ifdef HAVE_TOOLBARS
28
29 #include "specifier.h"
30
31 #define FRAME_TOOLBAR_BUTTONS(frame, pos)       \
32   ((frame)->toolbar_buttons[pos])
33 #define FRAME_CURRENT_TOOLBAR_SIZE(frame, pos)  \
34   ((frame)->current_toolbar_size[pos])
35 #define DEVICE_SUPPORTS_TOOLBARS_P(d)           \
36   HAS_DEVMETH_P (d, output_frame_toolbars)
37
38 struct toolbar_button {
39         struct lcrecord_header header;
40
41         Lisp_Object next;
42         Lisp_Object frame;
43
44         Lisp_Object up_glyph;
45         Lisp_Object down_glyph;
46         Lisp_Object disabled_glyph;
47
48         Lisp_Object cap_up_glyph;
49         Lisp_Object cap_down_glyph;
50         Lisp_Object cap_disabled_glyph;
51
52         Lisp_Object callback;
53         Lisp_Object enabled_p;
54         Lisp_Object help_string;
55
56         char enabled;
57         char down;
58         char pushright;
59         char blank;
60
61         int x, y;
62         int width, height;
63         int dirty;
64         /* is this button in a left or right toolbar? */
65         int vertical;
66         /* border_width when this button was laid out */
67         int border_width;
68 };
69
70 DECLARE_LRECORD(toolbar_button, struct toolbar_button);
71 #define XTOOLBAR_BUTTON(x) XRECORD (x, toolbar_button, struct toolbar_button)
72 #define XSETTOOLBAR_BUTTON(x, p) XSETRECORD (x, p, toolbar_button)
73 #define TOOLBAR_BUTTONP(x) RECORDP (x, toolbar_button)
74 #define CHECK_TOOLBAR_BUTTON(x) CHECK_RECORD (x, toolbar_button)
75 #define CONCHECK_TOOLBAR_BUTTON(x) CONCHECK_RECORD (x, toolbar_button)
76
77 void get_toolbar_coords(struct frame *f, enum toolbar_pos pos, int *x,
78                         int *y, int *width, int *height, int *vert,
79                         int for_layout);
80 Lisp_Object toolbar_button_at_pixpos(struct frame *f, int x_coord, int y_coord);
81 DECLARE_SPECIFIER_TYPE(toolbar);
82 #define XTOOLBAR_SPECIFIER(x) XSPECIFIER_TYPE (x, toolbar)
83 #define XSETTOOLBAR_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, toolbar)
84 #define TOOLBAR_SPECIFIERP(x) SPECIFIER_TYPEP (x, toolbar)
85 #define CHECK_TOOLBAR_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, toolbar)
86 #define CONCHECK_TOOLBAR_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, toolbar)
87
88 #define MSWINDOWS_DEFAULT_TOOLBAR_HEIGHT        37
89 #define MSWINDOWS_DEFAULT_TOOLBAR_WIDTH         40
90 #define MSWINDOWS_DEFAULT_TOOLBAR_BORDER_WIDTH  0
91 #define DEFAULT_TOOLBAR_HEIGHT  37
92 #define DEFAULT_TOOLBAR_WIDTH           40
93 #define DEFAULT_TOOLBAR_BLANK_SIZE      8
94 #define DEFAULT_TOOLBAR_BORDER_WIDTH    0
95 #define MINIMUM_SHADOW_THICKNESS        1
96
97 extern Lisp_Object Vtoolbar_size[4];
98 extern Lisp_Object Vtoolbar_border_width[4];
99 void update_frame_toolbars(struct frame *f);
100 void update_frame_toolbars_geometry(struct frame *f);
101 void init_frame_toolbars(struct frame *f);
102 void init_device_toolbars(struct device *d);
103 void init_global_toolbars(struct device *d);
104 void free_frame_toolbars(struct frame *f);
105 Lisp_Object get_toolbar_button_glyph(struct window *w,
106                                      struct toolbar_button *tb);
107 void mark_frame_toolbar_buttons_dirty(struct frame *f, enum toolbar_pos pos);
108
109 #endif                          /* HAVE_TOOLBARS */
110
111 #endif                          /* INCLUDED_toolbar_h_ */