annotate src/toolbar-x.c @ 282:c42ec1d1cded r21-0b39

Import from CVS: tag r21-0b39
author cvs
date Mon, 13 Aug 2007 10:33:18 +0200
parents c5d627a313b1
children 57709be46d1b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* toolbar implementation -- X interface.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1995 Board of Trustees, University of Illinois.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 Copyright (C) 1995 Sun Microsystems, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 Copyright (C) 1995, 1996 Ben Wing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 Copyright (C) 1996 Chuck Thompson.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 /* Synched up with: Not in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 #include <config.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 #include "lisp.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 #include "console-x.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 #include "glyphs-x.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #include "objects-x.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #include "xgccache.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #include "EmacsFrame.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 #include "EmacsFrameP.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 #include "EmacsManager.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 #include "faces.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 #include "frame.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 #include "toolbar.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 #include "window.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 x_draw_blank_toolbar_button (struct frame *f, int x, int y, int width,
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
44 int height, int threed, int border_width,
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
45 int vertical)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 struct device *d = XDEVICE (f->device);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 EmacsFrame ef = (EmacsFrame) FRAME_X_TEXT_WIDGET (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 int shadow_thickness = ef->emacs_frame.toolbar_shadow_thickness;
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
50 int sx = x, sy = y, swidth = width, sheight = height;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 Display *dpy = DEVICE_X_DISPLAY (d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 GC top_shadow_gc, bottom_shadow_gc, background_gc;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 background_gc = FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 if (threed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 top_shadow_gc = FRAME_X_TOOLBAR_TOP_SHADOW_GC (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 bottom_shadow_gc = FRAME_X_TOOLBAR_BOTTOM_SHADOW_GC (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 top_shadow_gc = background_gc;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 bottom_shadow_gc = background_gc;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
69 if (vertical)
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
70 {
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
71 sx += border_width;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
72 swidth -= 2 * border_width;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
73 }
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
74 else
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
75 {
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
76 sy += border_width;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
77 sheight -= 2 * border_width;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
78 }
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
79
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 /* Draw the outline. */
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
81 x_output_shadows (f, sx, sy, swidth, sheight, top_shadow_gc,
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 bottom_shadow_gc, background_gc, shadow_thickness);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 /* Blank the middle. */
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
85 XFillRectangle (dpy, x_win, background_gc, sx + shadow_thickness,
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
86 sy + shadow_thickness, swidth - shadow_thickness * 2,
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
87 sheight - shadow_thickness * 2);
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
88
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
89 /* Do the border */
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
90 XFillRectangle (dpy, x_win, background_gc, x, y,
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
91 (vertical ? border_width : width),
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
92 (vertical ? height : border_width));
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
93 XFillRectangle (dpy, x_win, background_gc,
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
94 (vertical ? sx + swidth : x),
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
95 (vertical ? y : sy + sheight),
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
96 (vertical ? border_width : width),
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
97 (vertical ? height : border_width));
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 x_output_toolbar_button (struct frame *f, Lisp_Object button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 struct device *d = XDEVICE (f->device);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 EmacsFrame ef = (EmacsFrame) FRAME_X_TEXT_WIDGET (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 int shadow_thickness = ef->emacs_frame.toolbar_shadow_thickness;
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
106 int x_adj, y_adj, width_adj, height_adj;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 Display *dpy = DEVICE_X_DISPLAY (d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 GC top_shadow_gc, bottom_shadow_gc, background_gc;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 Lisp_Object instance, frame, window, glyph;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 struct Lisp_Image_Instance *p;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 struct window *w;
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
115 int vertical = tb->vertical;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
116 int border_width = tb->border_width;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
117
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
118 if (vertical)
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
119 {
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
120 x_adj = border_width;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
121 width_adj = - 2 * border_width;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
122 y_adj = 0;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
123 height_adj = 0;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
124 }
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
125 else
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
126 {
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
127 x_adj = 0;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
128 width_adj = 0;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
129 y_adj = border_width;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
130 height_adj = - 2 * border_width;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
131 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 XSETFRAME (frame, f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 window = FRAME_LAST_NONMINIBUF_WINDOW (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 w = XWINDOW (window);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 glyph = get_toolbar_button_glyph (w, tb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 if (tb->enabled)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 if (tb->down)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 top_shadow_gc = FRAME_X_TOOLBAR_BOTTOM_SHADOW_GC (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 bottom_shadow_gc = FRAME_X_TOOLBAR_TOP_SHADOW_GC (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 top_shadow_gc = FRAME_X_TOOLBAR_TOP_SHADOW_GC (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 bottom_shadow_gc = FRAME_X_TOOLBAR_BOTTOM_SHADOW_GC (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 top_shadow_gc = FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 bottom_shadow_gc = FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 background_gc = FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 /* Draw the outline. */
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
160 x_output_shadows (f, tb->x + x_adj, tb->y + y_adj,
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
161 tb->width + width_adj, tb->height + height_adj,
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
162 top_shadow_gc,
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 bottom_shadow_gc, background_gc, shadow_thickness);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 /* Clear the pixmap area. */
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
166 XFillRectangle (dpy, x_win, background_gc, tb->x + x_adj + shadow_thickness,
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
167 tb->y + y_adj + shadow_thickness,
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
168 tb->width + width_adj - shadow_thickness * 2,
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
169 tb->height + height_adj - shadow_thickness * 2);
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
170
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
171 /* Do the border. */
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
172 XFillRectangle (dpy, x_win, background_gc, tb->x, tb->y,
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
173 (vertical ? border_width : tb->width),
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
174 (vertical ? tb->height : border_width));
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
175
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
176 XFillRectangle (dpy, x_win, background_gc,
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
177 (vertical ? tb->x + tb->width - border_width : tb->x),
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
178 (vertical ? tb->y : tb->y + tb->height - border_width),
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
179 (vertical ? border_width : tb->width),
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
180 (vertical ? tb->height : border_width));
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 background_gc = FRAME_X_TOOLBAR_PIXMAP_BACKGROUND_GC (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 /* #### It is currently possible for users to trash us by directly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 changing the toolbar glyphs. Avoid crashing in that case. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 if (GLYPHP (glyph))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 instance = glyph_image_instance (glyph, window, ERROR_ME_NOT, 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 instance = Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 if (IMAGE_INSTANCEP (instance))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 {
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
193 int width = tb->width + width_adj - shadow_thickness * 2;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
194 int height = tb->height + height_adj - shadow_thickness * 2;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
195 int x_offset = x_adj + shadow_thickness;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
196 int y_offset = y_adj + shadow_thickness;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 p = XIMAGE_INSTANCE (instance);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 if (IMAGE_INSTANCE_PIXMAP_TYPE_P (p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 if (width > (int) IMAGE_INSTANCE_PIXMAP_WIDTH (p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 x_offset += ((int) (width - IMAGE_INSTANCE_PIXMAP_WIDTH (p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 / 2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 width = IMAGE_INSTANCE_PIXMAP_WIDTH (p);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 if (height > (int) IMAGE_INSTANCE_PIXMAP_HEIGHT (p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 y_offset += ((int) (height - IMAGE_INSTANCE_PIXMAP_HEIGHT (p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 / 2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 height = IMAGE_INSTANCE_PIXMAP_HEIGHT (p);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 x_output_x_pixmap (f, XIMAGE_INSTANCE (instance), tb->x + x_offset,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 tb->y + y_offset, 0, 0, 0, 0, width, height,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 0, 0, 0, background_gc);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 else if (IMAGE_INSTANCE_TYPE (p) == IMAGE_TEXT)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 /* #### We need to make the face used configurable. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 struct face_cachel *cachel =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 WINDOW_FACE_CACHEL (w, DEFAULT_INDEX);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 struct display_line dl;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 Lisp_Object string = IMAGE_INSTANCE_TEXT_STRING (p);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 unsigned char charsets[NUM_LEADING_BYTES];
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 165
diff changeset
227 Emchar_dynarr *buf;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 struct font_metric_info fm;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 /* This could be true if we were called via the Expose event
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 handler. Mark the button as dirty and return
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 immediately. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 if (f->window_face_cache_reset)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 tb->dirty = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 MARK_TOOLBAR_CHANGED;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 buf = Dynarr_new (Emchar);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 convert_bufbyte_string_into_emchar_dynarr
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
241 (XSTRING_DATA (string), XSTRING_LENGTH (string), buf);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 find_charsets_in_emchar_string (charsets, Dynarr_atp (buf, 0),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 Dynarr_length (buf));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ensure_face_cachel_complete (cachel, window, charsets);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 face_cachel_charset_font_metric_info (cachel, charsets, &fm);
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 165
diff changeset
246
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 dl.ascent = fm.ascent;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 dl.descent = fm.descent;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 dl.ypos = tb->y + y_offset + fm.ascent;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 if (fm.ascent + fm.descent <= height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 dl.ypos += (height - fm.ascent - fm.descent) / 2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 dl.clip = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 dl.clip = fm.ascent + fm.descent - height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 x_output_string (w, &dl, buf, tb->x + x_offset, 0, 0, width,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 DEFAULT_INDEX, 0, 0, 0, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 Dynarr_free (buf);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 /* We silently ignore the image if it isn't a pixmap or text. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 tb->dirty = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 static int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 x_get_button_size (struct frame *f, Lisp_Object window,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 struct toolbar_button *tb, int vert, int pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 EmacsFrame ef = (EmacsFrame) FRAME_X_TEXT_WIDGET (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 int shadow_thickness = ef->emacs_frame.toolbar_shadow_thickness;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 int size;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 if (tb->blank)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 if (!NILP (tb->down_glyph))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 size = XINT (tb->down_glyph);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 size = DEFAULT_TOOLBAR_BLANK_SIZE;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 struct window *w = XWINDOW (window);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 Lisp_Object glyph = get_toolbar_button_glyph (w, tb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 /* Unless, of course, the user has done something stupid like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 change the glyph out from under us. Use a blank placeholder
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 in that case. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 if (NILP (glyph))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 return XINT (f->toolbar_size[pos]);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 if (vert)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 size = glyph_height (glyph, Vdefault_face, 0, window);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 size = glyph_width (glyph, Vdefault_face, 0, window);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 if (!size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 /* If the glyph doesn't have a size we'll insert a blank
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 placeholder instead. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 return XINT (f->toolbar_size[pos]);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 size += shadow_thickness * 2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 return (size);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 #define X_OUTPUT_BUTTONS_LOOP(left) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 do { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 while (!NILP (button)) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 struct toolbar_button *tb = XTOOLBAR_BUTTON (button); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 int size, height, width; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 if (left && tb->pushright) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 break; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 size = x_get_button_size (f, window, tb, vert, pos); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 if (vert) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 width = bar_width; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 if (y + size > max_pixpos) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 height = max_pixpos - y; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 else \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 height = size; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 } \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 else \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 if (x + size > max_pixpos) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 width = max_pixpos - x; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 else \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 width = size; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 height = bar_height; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 } \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 if (tb->x != x \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 || tb->y != y \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 || tb->width != width \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 || tb->height != height \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 || tb->dirty) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 if (width && height) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 tb->x = x; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 tb->y = y; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 tb->width = width; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 tb->height = height; \
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
357 tb->border_width = border_width; \
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
358 tb->vertical = vert; \
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 if (tb->blank || NILP (tb->up_glyph)) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 int threed = (EQ (Qt, tb->up_glyph) ? 1 : 0); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 x_draw_blank_toolbar_button (f, x, y, width, \
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
364 height, threed, \
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
365 border_width, vert); \
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 } \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 else \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 x_output_toolbar_button (f, button); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 } \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 } \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 if (vert) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 y += height; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 else \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 x += width; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 if ((vert && y == max_pixpos) || (!vert && x == max_pixpos)) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 button = Qnil; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 else \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 button = tb->next; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 } \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 } while (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 #define SET_TOOLBAR_WAS_VISIBLE_FLAG(frame, pos, flag) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 do { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 switch (pos) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 case TOP_TOOLBAR: \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (frame)->top_toolbar_was_visible = flag; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 break; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 case BOTTOM_TOOLBAR: \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (frame)->bottom_toolbar_was_visible = flag; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 break; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 case LEFT_TOOLBAR: \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (frame)->left_toolbar_was_visible = flag; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 break; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 case RIGHT_TOOLBAR: \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (frame)->right_toolbar_was_visible = flag; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 break; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 default: \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 abort (); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 } \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 } while (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 x_output_toolbar (struct frame *f, enum toolbar_pos pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 struct device *d = XDEVICE (f->device);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 int x, y, bar_width, bar_height, vert;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 int max_pixpos, right_size, right_start, blank_size;
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
411 int border_width = FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, pos);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 Lisp_Object button, window;
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
413 Display *dpy = DEVICE_X_DISPLAY (d);
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
414 Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
415 GC background_gc = FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC (f);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 get_toolbar_coords (f, pos, &x, &y, &bar_width, &bar_height, &vert, 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 window = FRAME_LAST_NONMINIBUF_WINDOW (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
420 /* Do the border */
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
421 XFillRectangle (dpy, x_win, background_gc, x, y,
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
422 (vert ? bar_width : border_width),
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
423 (vert ? border_width : bar_height));
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
424 XFillRectangle (dpy, x_win, background_gc,
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
425 (vert ? x : x + bar_width - border_width),
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
426 (vert ? y + bar_height - border_width : y),
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
427 (vert ? bar_width : border_width),
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
428 (vert ? border_width : bar_height));
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
429
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 if (vert)
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
431 {
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
432 max_pixpos = y + bar_height - border_width;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
433 y += border_width;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
434 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 else
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
436 {
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
437 max_pixpos = x + bar_width - border_width;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
438 x += border_width;
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
439 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 button = FRAME_TOOLBAR_DATA (f, pos)->toolbar_buttons;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 right_size = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 /* First loop over all of the buttons to determine how much room we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 need for left hand and right hand buttons. This loop will also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 make sure that all instances are instantiated so when we actually
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 output them they will come up immediately. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 while (!NILP (button))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 int size = x_get_button_size (f, window, tb, vert, pos);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 if (tb->pushright)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 right_size += size;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 button = tb->next;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 button = FRAME_TOOLBAR_DATA (f, pos)->toolbar_buttons;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 /* Loop over the left buttons, updating and outputting them. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 X_OUTPUT_BUTTONS_LOOP (1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 /* Now determine where the right buttons start. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 right_start = max_pixpos - right_size;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 if (right_start < (vert ? y : x))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 right_start = (vert ? y : x);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 /* Output the blank which goes from the end of the left buttons to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 the start of the right. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 blank_size = right_start - (vert ? y : x);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 if (blank_size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 int height, width;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 if (vert)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 width = bar_width;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 height = blank_size;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 width = blank_size;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 height = bar_height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
487 /*
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
488 * Use a 3D pushright separator only if there isn't a toolbar
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
489 * border. A flat separator meshes with the border and looks
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
490 * better.
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
491 */
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
492 x_draw_blank_toolbar_button (f, x, y, width, height, !border_width,
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
493 border_width, vert);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 if (vert)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 y += height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 x += width;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 /* Loop over the right buttons, updating and outputting them. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 X_OUTPUT_BUTTONS_LOOP (0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 if (!vert)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 Lisp_Object frame;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 XSETFRAME (frame, f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 DEVMETH (d, clear_region, (frame,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 DEFAULT_INDEX, FRAME_PIXWIDTH (f) - 1, y, 1,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 bar_height));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 XFlush (DEVICE_X_DISPLAY (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 x_clear_toolbar (struct frame *f, enum toolbar_pos pos, int thickness_change)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 {
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
522 Lisp_Object frame;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 struct device *d = XDEVICE (f->device);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 int x, y, width, height, vert;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 get_toolbar_coords (f, pos, &x, &y, &width, &height, &vert, 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 XSETFRAME (frame, f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 /* The thickness_change parameter is used by the toolbar resize routines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 to clear any excess toolbar if the size shrinks. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 if (thickness_change < 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 if (pos == LEFT_TOOLBAR || pos == RIGHT_TOOLBAR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 x = x + width + thickness_change;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 width = -thickness_change;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 y = y + height + thickness_change;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 height = -thickness_change;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 }
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 165
diff changeset
544
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 DEVMETH (d, clear_region, (frame, DEFAULT_INDEX, x, y, width, height));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 XFlush (DEVICE_X_DISPLAY (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 x_output_frame_toolbars (struct frame *f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 assert (FRAME_X_P (f));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 x_output_toolbar (f, TOP_TOOLBAR);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 else if (f->top_toolbar_was_visible)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 x_clear_toolbar (f, TOP_TOOLBAR, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 x_output_toolbar (f, BOTTOM_TOOLBAR);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 else if (f->bottom_toolbar_was_visible)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 x_clear_toolbar (f, BOTTOM_TOOLBAR, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 x_output_toolbar (f, LEFT_TOOLBAR);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 else if (f->left_toolbar_was_visible)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 x_clear_toolbar (f, LEFT_TOOLBAR, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 x_output_toolbar (f, RIGHT_TOOLBAR);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 else if (f->right_toolbar_was_visible)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 x_clear_toolbar (f, RIGHT_TOOLBAR, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 x_redraw_exposed_toolbar (struct frame *f, enum toolbar_pos pos, int x, int y,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 int width, int height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 int bar_x, bar_y, bar_width, bar_height, vert;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 Lisp_Object button = FRAME_TOOLBAR_DATA (f, pos)->toolbar_buttons;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 get_toolbar_coords (f, pos, &bar_x, &bar_y, &bar_width, &bar_height,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 &vert, 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 if (((y + height) < bar_y) || (y > (bar_y + bar_height)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 if (((x + width) < bar_x) || (x > (bar_x + bar_width)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 while (!NILP (button))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 if (vert)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 if (((tb->y + tb->height) > y) && (tb->y < (y + height)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 tb->dirty = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 /* If this is true we have gone past the exposed region. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 if (tb->y > (y + height))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 if (((tb->x + tb->width) > x) && (tb->x < (x + width)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 tb->dirty = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 /* If this is true we have gone past the exposed region. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 if (tb->x > (x + width))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 button = tb->next;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 /* Even if none of the buttons is in the area, the blank region at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 the very least must be because the first thing we did is verify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 that some portion of the toolbar is in the exposed region. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 x_output_toolbar (f, pos);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 x_redraw_exposed_toolbars (struct frame *f, int x, int y, int width,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 int height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 assert (FRAME_X_P (f));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 x_redraw_exposed_toolbar (f, TOP_TOOLBAR, x, y, width, height);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 x_redraw_exposed_toolbar (f, BOTTOM_TOOLBAR, x, y, width, height);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 x_redraw_exposed_toolbar (f, LEFT_TOOLBAR, x, y, width, height);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 x_redraw_exposed_toolbar (f, RIGHT_TOOLBAR, x, y, width, height);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 x_redraw_frame_toolbars (struct frame *f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 /* There are certain startup paths that lead to update_EmacsFrame in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 faces.c being called before a new frame is fully initialized. In
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 particular before we have actually mapped it. That routine can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 call this one. So, we need to make sure that the frame is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 actually ready before we try and draw all over it. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 if (XtIsRealized (FRAME_X_SHELL_WIDGET (f)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 x_redraw_exposed_toolbars (f, 0, 0, FRAME_PIXWIDTH (f),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 FRAME_PIXHEIGHT (f));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 x_initialize_frame_toolbar_gcs (struct frame *f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 EmacsFrame ef = (EmacsFrame) FRAME_X_TEXT_WIDGET (f);
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
662 EmacsFramePart *efp = &(ef->emacs_frame);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 XGCValues gcv;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 unsigned long flags = (GCForeground | GCBackground | GCGraphicsExposures);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
666 /*
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 215
diff changeset
667 * If backgroundToolBarColor is specified, use it.
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 215
diff changeset
668 * Otherwise use the background resource.
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
669 */
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
670 if (efp->background_toolbar_pixel == (Pixel) (-1))
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
671 efp->background_toolbar_pixel = efp->background_pixel;
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 185
diff changeset
672
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 215
diff changeset
673 /*
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 215
diff changeset
674 * ####
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 215
diff changeset
675 * If foregroundToolBarColor is specified, use it.
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 215
diff changeset
676 * Otherwise use the foreground resource.
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 215
diff changeset
677 *
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 215
diff changeset
678 * The foreground pixel is currently unused, but will likely be
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 215
diff changeset
679 * used when toolbar captions are generated by the toolbar code
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 215
diff changeset
680 * instead being incorporated into the icon image.
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 215
diff changeset
681 */
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
682 if (efp->foreground_toolbar_pixel == (Pixel) (-1))
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
683 efp->foreground_toolbar_pixel = efp->foreground_pixel;
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 215
diff changeset
684
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
685 gcv.foreground = efp->background_toolbar_pixel;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 gcv.background = ef->core.background_pixel;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 gcv.graphics_exposures = False;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC (f) =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 XtGetGC ((Widget) ef, flags, &gcv);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
691 if (efp->top_toolbar_shadow_pixel == efp->bottom_toolbar_shadow_pixel)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 {
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
693 efp->top_toolbar_shadow_pixel = efp->background_toolbar_pixel;
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
694 efp->bottom_toolbar_shadow_pixel = efp->background_toolbar_pixel;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
697 x_generate_shadow_pixels (f, &efp->top_toolbar_shadow_pixel,
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
698 &efp->bottom_toolbar_shadow_pixel,
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
699 efp->background_toolbar_pixel,
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 ef->core.background_pixel);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
702 gcv.foreground = efp->top_toolbar_shadow_pixel;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 gcv.background = ef->core.background_pixel;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 gcv.graphics_exposures = False;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 flags = GCForeground | GCBackground | GCGraphicsExposures;
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
706 if (efp->top_toolbar_shadow_pixmap)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 gcv.fill_style = FillOpaqueStippled;
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
709 gcv.stipple = efp->top_toolbar_shadow_pixmap;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 flags |= GCStipple | GCFillStyle;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 FRAME_X_TOOLBAR_TOP_SHADOW_GC (f) = XtGetGC ((Widget) ef, flags, &gcv);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
714 gcv.foreground = efp->bottom_toolbar_shadow_pixel;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 gcv.background = ef->core.background_pixel;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 gcv.graphics_exposures = False;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 flags = GCForeground | GCBackground | GCGraphicsExposures;
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
718 if (efp->bottom_toolbar_shadow_pixmap)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 gcv.fill_style = FillOpaqueStippled;
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
721 gcv.stipple = efp->bottom_toolbar_shadow_pixmap;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 flags |= GCStipple | GCFillStyle;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 FRAME_X_TOOLBAR_BOTTOM_SHADOW_GC (f) = XtGetGC ((Widget) ef, flags, &gcv);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 #ifdef HAVE_XPM
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 FRAME_X_TOOLBAR_PIXMAP_BACKGROUND_GC (f) =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 struct device *d = XDEVICE (f->device);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 Display *dpy = DEVICE_X_DISPLAY (d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 gcv.background = WhitePixelOfScreen (DefaultScreenOfDisplay (dpy));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 gcv.foreground = BlackPixelOfScreen (DefaultScreenOfDisplay (dpy));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 gcv.graphics_exposures = False;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 flags = GCForeground | GCBackground | GCGraphicsExposures;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 FRAME_X_TOOLBAR_PIXMAP_BACKGROUND_GC (f) =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 XtGetGC ((Widget) ef, flags, &gcv);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 x_release_frame_toolbar_gcs (struct frame *f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 Widget ew = (Widget) FRAME_X_TEXT_WIDGET (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 XtReleaseGC (ew, FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC (f));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 /* If compiled with XPM support, this is a pointer to the same GC as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 FRAME_X_BLANK_BACKGROUND_GC so we need to make sure we don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 release it twice. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 #ifndef HAVE_XPM
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 XtReleaseGC (ew, FRAME_X_TOOLBAR_PIXMAP_BACKGROUND_GC (f));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 XtReleaseGC (ew, FRAME_X_TOOLBAR_TOP_SHADOW_GC (f));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 XtReleaseGC (ew, FRAME_X_TOOLBAR_BOTTOM_SHADOW_GC (f));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 /* Seg fault if we try and use these again. */
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
759 FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC (f) = (GC) - 1;
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 110
diff changeset
760 FRAME_X_TOOLBAR_PIXMAP_BACKGROUND_GC (f) = (GC) - 1;
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
761 FRAME_X_TOOLBAR_TOP_SHADOW_GC (f) = (GC) - 1;
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
762 FRAME_X_TOOLBAR_BOTTOM_SHADOW_GC (f) = (GC) - 1;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 x_initialize_frame_toolbars (struct frame *f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 EmacsFrame ef = (EmacsFrame) FRAME_X_TEXT_WIDGET (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 if (ef->emacs_frame.toolbar_shadow_thickness < MINIMUM_SHADOW_THICKNESS)
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
771 Xt_SET_VALUE (FRAME_X_TEXT_WIDGET (f),
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 227
diff changeset
772 XtNtoolBarShadowThickness, MINIMUM_SHADOW_THICKNESS);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 x_initialize_frame_toolbar_gcs (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 /* This only calls one function but we go ahead and create this in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 case we ever do decide that we need to do more work. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 x_free_frame_toolbars (struct frame *f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 x_release_frame_toolbar_gcs (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 /************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 /* initialization */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 /************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 console_type_create_toolbar_x (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 CONSOLE_HAS_METHOD (x, output_frame_toolbars);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 CONSOLE_HAS_METHOD (x, initialize_frame_toolbars);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 CONSOLE_HAS_METHOD (x, free_frame_toolbars);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 CONSOLE_HAS_METHOD (x, output_toolbar_button);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 CONSOLE_HAS_METHOD (x, redraw_exposed_toolbars);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 CONSOLE_HAS_METHOD (x, redraw_frame_toolbars);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 }