annotate src/toolbar-x.c @ 384:bbff43aa5eb7 r21-2-7

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