annotate src/native-gtk-toolbar.c @ 5735:ff13c44ce0d9

Hack in rudimentary group support for WIN32 in support of Mats ID-FORMAT patch
author Vin Shelton <acs@xemacs.org>
date Wed, 24 Apr 2013 20:16:14 -0400
parents 308d34e9f07d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
1 /* toolbar implementation -- GTK interface.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
2 Copyright (C) 2000 Aaron Lehmann
5077
d372b17f63ce clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents: 2500
diff changeset
3 Copyright (C) 2010 Ben Wing.
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
4
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
5 This file is part of XEmacs.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
6
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5178
diff changeset
7 XEmacs is free software: you can redistribute it and/or modify it
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5178
diff changeset
9 Free Software Foundation, either version 3 of the License, or (at your
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5178
diff changeset
10 option) any later version.
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
11
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
15 for more details.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
16
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5178
diff changeset
18 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
19
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
20 /* Synched up with: Not in FSF. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
21
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
22 #include <config.h>
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
23 #include "lisp.h"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
24
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
25 #include "console-gtk.h"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
26 #include "glyphs-gtk.h"
5176
8b2f75cecb89 rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents: 2500
diff changeset
27 #include "fontcolor-gtk.h"
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
28
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
29 #include "faces.h"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
30 #include "frame.h"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
31 #include "toolbar.h"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
32 #include "window.h"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
33
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
34 static void
5077
d372b17f63ce clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents: 2500
diff changeset
35 gtk_clear_toolbar (struct frame *f, enum edge_pos pos);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
36
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
37 static void
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 793
diff changeset
38 gtk_toolbar_callback (GtkWidget *UNUSED (w), gpointer user_data)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
39 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
40 struct toolbar_button *tb = (struct toolbar_button *) user_data;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
41
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
42 call0 (tb->callback);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
43 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
44
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
45
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
46 static void
5077
d372b17f63ce clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents: 2500
diff changeset
47 gtk_output_toolbar (struct frame *f, enum edge_pos pos)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
48 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
49 GtkWidget *toolbar;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
50 Lisp_Object button, window, glyph, instance;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
51 unsigned int checksum = 0;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
52 struct window *w;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
53 int x, y, bar_width, bar_height, vert;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
54 int cur_x, cur_y;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
55
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
56 window = FRAME_LAST_NONMINIBUF_WINDOW (f);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
57 w = XWINDOW (window);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
58
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
59 get_toolbar_coords (f, pos, &x, &y, &bar_width, &bar_height, &vert, 0);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
60
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
61 /* Get the toolbar and delete the old widgets in it */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
62 button = FRAME_TOOLBAR_BUTTONS (f, pos);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
63
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
64 /* First loop over all of the buttons to determine how many there
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
65 are. This loop will also make sure that all instances are
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
66 instantiated so when we actually output them they will come up
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
67 immediately. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
68 while (!NILP (button))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
69 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
70 struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
71 checksum = HASH4 (checksum,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
72 internal_hash (get_toolbar_button_glyph(w, tb), 0),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
73 internal_hash (tb->callback, 0),
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
74 0 /* width */);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
75 button = tb->next;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
76 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
77
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
78 /* Only do updates if the toolbar has changed, or this is the first
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
79 time we have drawn it in this position
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
80 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
81 if (FRAME_GTK_TOOLBAR_WIDGET (f)[pos] &&
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
82 FRAME_GTK_TOOLBAR_CHECKSUM (f, pos) == checksum)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
83 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
84 return;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
85 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
86
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
87 /* Loop through buttons and add them to our toolbar.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
88 This code ignores the button dimensions as we let GTK handle that :)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
89 Attach the toolbar_button struct to the toolbar button so we know what
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
90 function to use as a callback. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
91
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
92 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
93 gtk_clear_toolbar (f, pos);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
94 FRAME_GTK_TOOLBAR_WIDGET (f)[pos] = toolbar =
5077
d372b17f63ce clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents: 2500
diff changeset
95 gtk_toolbar_new (((pos == TOP_EDGE) || (pos == BOTTOM_EDGE)) ?
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
96 GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
97 GTK_TOOLBAR_BOTH);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
98 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
99
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
100 if (NILP (w->toolbar_buttons_captioned_p))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
101 gtk_toolbar_set_style (toolbar, GTK_TOOLBAR_ICONS);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
102 else
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
103 gtk_toolbar_set_style (toolbar, GTK_TOOLBAR_BOTH);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
104
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
105 FRAME_GTK_TOOLBAR_CHECKSUM(f, pos) = checksum;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
106 button = FRAME_TOOLBAR_BUTTONS (f, pos);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
107
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
108 cur_x = 0;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
109 cur_y = 0;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
110
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
111 while (!NILP (button))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
112 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
113 struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
114
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
115 if (tb->blank)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
116 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
117 /* It is a blank space... we do not pay attention to the
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
118 size, because the GTK toolbar does not allow us to
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
119 specify different spacings. *sigh*
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
120 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
121 gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
122 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
123 else
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
124 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
125 /* It actually has a glyph associated with it! What WILL
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
126 they think of next?
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
127 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
128 glyph = tb->up_glyph;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
129
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
130 /* #### It is currently possible for users to trash us by directly
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
131 changing the toolbar glyphs. Avoid crashing in that case. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
132 if (GLYPHP (glyph))
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 462
diff changeset
133 instance = glyph_image_instance (glyph, window,
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 462
diff changeset
134 ERROR_ME_DEBUG_WARN, 1);
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
135 else
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
136 instance = Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
137
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
138 if (IMAGE_INSTANCEP(instance))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
139 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
140 GtkWidget *pixmapwid;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
141 GdkPixmap *pixmap;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
142 GdkBitmap *mask;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
143 char *tooltip = NULL;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
144
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
145 if (STRINGP (tb->help_string))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
146 tooltip = XSTRING_DATA (tb->help_string);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
147
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
148 pixmap = XIMAGE_INSTANCE_GTK_PIXMAP(instance);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
149 mask = XIMAGE_INSTANCE_GTK_MASK(instance);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
150 pixmapwid = gtk_pixmap_new (pixmap, mask);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
151
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
152 gtk_widget_set_usize (pixmapwid, tb->width, tb->height);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
153
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
154 gtk_toolbar_append_item (GTK_TOOLBAR(toolbar), NULL, tooltip, NULL,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
155 pixmapwid, gtk_toolbar_callback, (gpointer) tb);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
156 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
157 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
158 cur_x += vert ? 0 : tb->width;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
159 cur_y += vert ? tb->height : 0;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
160 /* Who's idea was it to use a linked list for toolbar buttons? */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
161 button = tb->next;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
162 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
163
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
164 SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 1);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
165
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
166 x -= vert ? 3 : 2;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
167 y -= vert ? 2 : 3;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
168
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
169 gtk_fixed_put (GTK_FIXED (FRAME_GTK_TEXT_WIDGET (f)), FRAME_GTK_TOOLBAR_WIDGET (f)[pos],x, y);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
170 gtk_widget_show_all (FRAME_GTK_TOOLBAR_WIDGET (f)[pos]);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
171 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
172
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
173 static void
5077
d372b17f63ce clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents: 2500
diff changeset
174 gtk_clear_toolbar (struct frame *f, enum edge_pos pos)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
175 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
176 FRAME_GTK_TOOLBAR_CHECKSUM (f, pos) = 0;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
177 SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 0);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
178 if (FRAME_GTK_TOOLBAR_WIDGET(f)[pos])
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
179 gtk_widget_destroy (FRAME_GTK_TOOLBAR_WIDGET(f)[pos]);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
180 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
181
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
182 static void
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
183 gtk_output_frame_toolbars (struct frame *f)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
184 {
5077
d372b17f63ce clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents: 2500
diff changeset
185 enum edge_pos pos;
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
186
5077
d372b17f63ce clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents: 2500
diff changeset
187 EDGE_POS_LOOP (pos)
d372b17f63ce clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents: 2500
diff changeset
188 {
d372b17f63ce clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents: 2500
diff changeset
189 if (FRAME_REAL_TOOLBAR_VISIBLE (f, pos))
d372b17f63ce clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents: 2500
diff changeset
190 gtk_output_toolbar (f, pos);
d372b17f63ce clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents: 2500
diff changeset
191 else if (f->toolbar_was_visible[pos])
d372b17f63ce clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents: 2500
diff changeset
192 gtk_clear_toolbar (f, pos);
d372b17f63ce clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents: 2500
diff changeset
193 }
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
194 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
195
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
196 static void
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 793
diff changeset
197 gtk_initialize_frame_toolbars (struct frame *UNUSED (f))
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
198 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
199 stderr_out ("We should draw toolbars\n");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
200 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
201
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
202
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
203 /************************************************************************/
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
204 /* initialization */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
205 /************************************************************************/
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
206
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
207 void
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
208 console_type_create_toolbar_gtk (void)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
209 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
210 CONSOLE_HAS_METHOD (gtk, output_frame_toolbars);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
211 CONSOLE_HAS_METHOD (gtk, initialize_frame_toolbars);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
212 }