0
|
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 XEmacs.
|
|
7
|
|
8 XEmacs is free software; you can redistribute it and/or modify it
|
|
9 under the terms of the GNU General Public License as published by the
|
|
10 Free Software Foundation; either version 2, or (at your option) any
|
|
11 later version.
|
|
12
|
|
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
16 for more details.
|
|
17
|
|
18 You should have received a copy of the GNU General Public License
|
|
19 along with XEmacs; see the file COPYING. If not, write to
|
|
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
21 Boston, MA 02111-1307, USA. */
|
|
22
|
|
23 /* Synched up with: Not in FSF. */
|
|
24
|
|
25 #ifndef _XEMACS_TOOLBAR_H_
|
|
26 #define _XEMACS_TOOLBAR_H_
|
|
27
|
|
28 #include "specifier.h"
|
|
29
|
|
30 #ifdef HAVE_TOOLBARS
|
|
31
|
|
32 /* There are 4 of these per frame. They don't really need to be an
|
|
33 lrecord (they're not lisp-accessible) but it makes marking slightly
|
|
34 more modular. */
|
|
35 struct toolbar_data
|
|
36 {
|
|
37 struct lcrecord_header header;
|
|
38
|
|
39 /* The last buffer for which the toolbars were displayed. */
|
|
40 Lisp_Object last_toolbar_buffer;
|
|
41
|
|
42 /* The actual buttons are chained through this. */
|
|
43 Lisp_Object toolbar_buttons;
|
|
44 };
|
|
45
|
|
46 DECLARE_LRECORD (toolbar_data, struct toolbar_data);
|
|
47 #define XTOOLBAR_DATA(x) XRECORD (x, toolbar_data, struct toolbar_data)
|
|
48 #define XSETTOOLBAR_DATA(x, p) XSETRECORD (x, p, toolbar_data)
|
|
49 #define TOOLBAR_DATAP(x) RECORDP (x, toolbar_data)
|
|
50 #define GC_TOOLBAR_DATAP(x) GC_RECORDP (x, toolbar_data)
|
|
51 #define CHECK_TOOLBAR_DATA(x) CHECK_RECORD (x, toolbar_data)
|
|
52 #define CONCHECK_TOOLBAR_DATA(x) CONCHECK_RECORD (x, toolbar_data)
|
|
53
|
|
54 #define FRAME_TOOLBAR_DATA(frame, position) \
|
|
55 (XTOOLBAR_DATA ((frame)->toolbar_data[position]))
|
|
56 #define FRAME_TOOLBAR_BUFFER(frame, position) \
|
|
57 (XTOOLBAR_DATA ((frame)->toolbar_data[position])->last_toolbar_buffer)
|
|
58
|
|
59 /* These are chained together through toolbar_buttons in struct
|
|
60 toolbar_data. These don't need to be an lrecord either, but again,
|
|
61 it makes marking easier. */
|
|
62 struct toolbar_button
|
|
63 {
|
|
64 struct lcrecord_header header;
|
|
65
|
|
66 Lisp_Object next;
|
|
67 Lisp_Object frame;
|
|
68
|
|
69 Lisp_Object up_glyph;
|
|
70 Lisp_Object down_glyph;
|
|
71 Lisp_Object disabled_glyph;
|
|
72
|
|
73 Lisp_Object cap_up_glyph;
|
|
74 Lisp_Object cap_down_glyph;
|
|
75 Lisp_Object cap_disabled_glyph;
|
|
76
|
|
77 Lisp_Object callback;
|
|
78 Lisp_Object enabled_p;
|
|
79 Lisp_Object help_string;
|
|
80
|
|
81 char enabled;
|
|
82 char down;
|
|
83 char pushright;
|
|
84 char blank;
|
|
85
|
|
86 int x, y;
|
|
87 int width, height;
|
|
88 int dirty;
|
215
|
89 /* is this button in a left or right toolbar? */
|
|
90 int vertical;
|
|
91 /* border_width when this button was layed out */
|
|
92 int border_width;
|
0
|
93 };
|
|
94
|
|
95 DECLARE_LRECORD (toolbar_button, struct toolbar_button);
|
|
96 #define XTOOLBAR_BUTTON(x) XRECORD (x, toolbar_button, struct toolbar_button)
|
|
97 #define XSETTOOLBAR_BUTTON(x, p) XSETRECORD (x, p, toolbar_button)
|
|
98 #define TOOLBAR_BUTTONP(x) RECORDP (x, toolbar_button)
|
|
99 #define GC_TOOLBAR_BUTTONP(x) GC_RECORDP (x, toolbar_button)
|
|
100 #define CHECK_TOOLBAR_BUTTON(x) CHECK_RECORD (x, toolbar_button)
|
|
101 #define CONCHECK_TOOLBAR_BUTTON(x) CONCHECK_RECORD (x, toolbar_button)
|
|
102
|
|
103 extern void get_toolbar_coords (struct frame *f, enum toolbar_pos pos, int *x,
|
|
104 int *y, int *width, int *height, int *vert,
|
|
105 int for_layout);
|
|
106 extern Lisp_Object toolbar_button_at_pixpos (struct frame *f, int x_coord,
|
|
107 int y_coord);
|
|
108 DECLARE_SPECIFIER_TYPE (toolbar);
|
|
109 #define XTOOLBAR_SPECIFIER(x) XSPECIFIER_TYPE (x, toolbar)
|
|
110 #define XSETTOOLBAR_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, toolbar)
|
|
111 #define TOOLBAR_SPECIFIERP(x) SPECIFIER_TYPEP (x, toolbar)
|
|
112 #define CHECK_TOOLBAR_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, toolbar)
|
|
113 #define CONCHECK_TOOLBAR_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, toolbar)
|
|
114
|
|
115 #define DEFAULT_TOOLBAR_HEIGHT 37
|
|
116 #define DEFAULT_TOOLBAR_WIDTH 40
|
|
117 #define DEFAULT_TOOLBAR_BLANK_SIZE 8
|
215
|
118 #define DEFAULT_TOOLBAR_BORDER_WIDTH 0
|
207
|
119 #define MINIMUM_SHADOW_THICKNESS 1
|
0
|
120
|
|
121 extern Lisp_Object Vtoolbar_size[4];
|
215
|
122 extern Lisp_Object Vtoolbar_border_width[4];
|
0
|
123 void update_frame_toolbars (struct frame *f);
|
|
124 void init_frame_toolbars (struct frame *f);
|
|
125 void init_device_toolbars (struct device *d);
|
|
126 void init_global_toolbars (struct device *d);
|
|
127 void free_frame_toolbars (struct frame *f);
|
|
128 Lisp_Object get_toolbar_button_glyph (struct window *w,
|
|
129 struct toolbar_button *tb);
|
215
|
130 void mark_frame_toolbar_buttons_dirty (struct frame *f, enum toolbar_pos pos);
|
0
|
131
|
|
132 #endif /* HAVE_TOOLBARS */
|
|
133
|
|
134 #endif /* _XEMACS_TOOLBAR_H_ */
|