comparison src/toolbar-x.c @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents bbff43aa5eb7
children 697ef44129c6
comparison
equal deleted inserted replaced
397:f4aeb21a5bad 398:74fd4e045ea6
75 sheight -= 2 * border_width; 75 sheight -= 2 * border_width;
76 } 76 }
77 77
78 /* Draw the outline. */ 78 /* Draw the outline. */
79 x_output_shadows (f, sx, sy, swidth, sheight, top_shadow_gc, 79 x_output_shadows (f, sx, sy, swidth, sheight, top_shadow_gc,
80 bottom_shadow_gc, background_gc, shadow_thickness); 80 bottom_shadow_gc, background_gc, shadow_thickness,
81 EDGE_ALL);
81 82
82 /* Blank the middle. */ 83 /* Blank the middle. */
83 XFillRectangle (dpy, x_win, background_gc, sx + shadow_thickness, 84 XFillRectangle (dpy, x_win, background_gc, sx + shadow_thickness,
84 sy + shadow_thickness, swidth - shadow_thickness * 2, 85 sy + shadow_thickness, swidth - shadow_thickness * 2,
85 sheight - shadow_thickness * 2); 86 sheight - shadow_thickness * 2);
106 Display *dpy = DEVICE_X_DISPLAY (d); 107 Display *dpy = DEVICE_X_DISPLAY (d);
107 Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f)); 108 Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
108 GC top_shadow_gc, bottom_shadow_gc, background_gc; 109 GC top_shadow_gc, bottom_shadow_gc, background_gc;
109 Lisp_Object instance, frame, window, glyph; 110 Lisp_Object instance, frame, window, glyph;
110 struct toolbar_button *tb = XTOOLBAR_BUTTON (button); 111 struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
111 struct Lisp_Image_Instance *p; 112 Lisp_Image_Instance *p;
112 struct window *w; 113 struct window *w;
113 int vertical = tb->vertical; 114 int vertical = tb->vertical;
114 int border_width = tb->border_width; 115 int border_width = tb->border_width;
115 116
116 if (vertical) 117 if (vertical)
156 157
157 /* Draw the outline. */ 158 /* Draw the outline. */
158 x_output_shadows (f, tb->x + x_adj, tb->y + y_adj, 159 x_output_shadows (f, tb->x + x_adj, tb->y + y_adj,
159 tb->width + width_adj, tb->height + height_adj, 160 tb->width + width_adj, tb->height + height_adj,
160 top_shadow_gc, 161 top_shadow_gc,
161 bottom_shadow_gc, background_gc, shadow_thickness); 162 bottom_shadow_gc, background_gc, shadow_thickness,
163 EDGE_ALL);
162 164
163 /* Clear the pixmap area. */ 165 /* Clear the pixmap area. */
164 XFillRectangle (dpy, x_win, background_gc, tb->x + x_adj + shadow_thickness, 166 XFillRectangle (dpy, x_win, background_gc, tb->x + x_adj + shadow_thickness,
165 tb->y + y_adj + shadow_thickness, 167 tb->y + y_adj + shadow_thickness,
166 tb->width + width_adj - shadow_thickness * 2, 168 tb->width + width_adj - shadow_thickness * 2,
209 / 2); 211 / 2);
210 height = IMAGE_INSTANCE_PIXMAP_HEIGHT (p); 212 height = IMAGE_INSTANCE_PIXMAP_HEIGHT (p);
211 } 213 }
212 214
213 x_output_x_pixmap (f, XIMAGE_INSTANCE (instance), tb->x + x_offset, 215 x_output_x_pixmap (f, XIMAGE_INSTANCE (instance), tb->x + x_offset,
214 tb->y + y_offset, 0, 0, 0, 0, width, height, 216 tb->y + y_offset, 0, 0, width, height,
215 0, 0, 0, background_gc); 217 0, 0, background_gc);
216 } 218 }
217 else if (IMAGE_INSTANCE_TYPE (p) == IMAGE_TEXT) 219 else if (IMAGE_INSTANCE_TYPE (p) == IMAGE_TEXT)
218 { 220 {
219 /* #### We need to make the face used configurable. */ 221 /* #### We need to make the face used configurable. */
220 struct face_cachel *cachel = 222 struct face_cachel *cachel =
292 in that case. */ 294 in that case. */
293 if (NILP (glyph)) 295 if (NILP (glyph))
294 return XINT (f->toolbar_size[pos]); 296 return XINT (f->toolbar_size[pos]);
295 297
296 if (vert) 298 if (vert)
297 size = glyph_height (glyph, Vdefault_face, 0, window); 299 size = glyph_height (glyph, window);
298 else 300 else
299 size = glyph_width (glyph, Vdefault_face, 0, window); 301 size = glyph_width (glyph, window);
300 } 302 }
301 303
302 if (!size) 304 if (!size)
303 { 305 {
304 /* If the glyph doesn't have a size we'll insert a blank 306 /* If the glyph doesn't have a size we'll insert a blank