comparison src/toolbar-x.c @ 412:697ef44129c6 r21-2-14

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