static gboolean
draw_simple_image(GtkStyle *style,
- GdkWindow *window,
- GdkRectangle *area,
+ cairo_t *cr,
GtkWidget *widget,
ThemeMatchData *match_data,
gboolean draw_center,
gint width,
gint height)
{
+
ThemeImage *image;
- if ((width == -1) && (height == -1))
- gdk_drawable_get_size(window, &width, &height);
- else if (width == -1)
- gdk_drawable_get_size(window, &width, NULL);
- else if (height == -1)
- gdk_drawable_get_size(window, NULL, &height);
-
if (!(match_data->flags & THEME_MATCH_ORIENTATION))
{
match_data->flags |= THEME_MATCH_ORIENTATION;
{
if (image->background)
{
- theme_pixbuf_render_no_cairo (image->background,
- window, area,
+ theme_pixbuf_render (image->background, cr,
draw_center ? COMPONENT_ALL : COMPONENT_ALL | COMPONENT_CENTER,
FALSE,
x, y, width, height);
}
if (image->overlay && draw_center)
- theme_pixbuf_render_no_cairo (image->overlay,
- window, area, COMPONENT_ALL,
+ theme_pixbuf_render (image->overlay, cr, COMPONENT_ALL,
TRUE,
x, y, width, height);
return FALSE;
}
+static gboolean
+draw_simple_image_no_cairo(GtkStyle *style,
+ GdkWindow *window,
+ GdkRectangle *area,
+ GtkWidget *widget,
+ ThemeMatchData *match_data,
+ gboolean draw_center,
+ gboolean allow_setbg,
+ gint x,
+ gint y,
+ gint width,
+ gint height)
+{
+ gboolean result;
+ cairo_t *cr;
+
+ if ((width == -1) && (height == -1))
+ gdk_drawable_get_size(window, &width, &height);
+ else if (width == -1)
+ gdk_drawable_get_size(window, &width, NULL);
+ else if (height == -1)
+ gdk_drawable_get_size(window, NULL, &height);
+
+ cr = gdk_cairo_create (window);
+ if (area)
+ {
+ gdk_cairo_rectangle (cr, area);
+ cairo_clip (cr);
+ }
+
+ result = draw_simple_image (style, cr, widget, match_data,
+ draw_center, allow_setbg,
+ x, y, width, height);
+
+ cairo_destroy (cr);
+
+ return result;
+}
+
static gboolean
draw_gap_image(GtkStyle *style,
GdkWindow *window,
match_data.shadow = shadow;
match_data.state = state;
- if (!draw_simple_image (style, window, area, widget, &match_data, FALSE, FALSE,
+ if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, FALSE, FALSE,
x, y, width, height))
parent_class->draw_shadow (style, window, state, shadow, area, widget, detail,
x, y, width, height);
match_data.state = state;
match_data.arrow_direction = arrow_direction;
- if (draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
+ if (draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
box_x, box_y, box_width, box_height))
{
/* The theme included stepper images, we're done */
match_data.shadow = shadow;
match_data.state = state;
- if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
+ if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
box_x, box_y, box_width, box_height))
parent_class->draw_box (style, window, state, shadow, area, widget, detail,
box_x, box_y, box_width, box_height);
match_data.state = state;
match_data.arrow_direction = arrow_direction;
- if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
+ if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
x, y, width, height))
parent_class->draw_arrow (style, window, state, shadow, area, widget, detail,
arrow_direction, fill, x, y, width, height);
match_data.shadow = shadow;
match_data.state = state;
- if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
+ if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
x, y, width, height))
parent_class->draw_diamond (style, window, state, shadow, area, widget, detail,
x, y, width, height);
match_data.shadow = shadow;
match_data.state = state;
- if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
+ if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
x, y, width, height)) {
parent_class->draw_box (style, window, state, shadow, area, widget, detail,
x, y, width, height);
match_data.shadow = shadow;
match_data.state = state;
- if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
+ if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
x, y, width, height))
parent_class->draw_flat_box (style, window, state, shadow, area, widget, detail,
x, y, width, height);
match_data.shadow = shadow;
match_data.state = state;
- if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
+ if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
x, y, width, height))
parent_class->draw_check (style, window, state, shadow, area, widget, detail,
x, y, width, height);
match_data.shadow = shadow;
match_data.state = state;
- if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
+ if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
x, y, width, height))
parent_class->draw_option (style, window, state, shadow, area, widget, detail,
x, y, width, height);
match_data.shadow = shadow;
match_data.state = state;
- if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
+ if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
x, y, width, height))
parent_class->draw_tab (style, window, state, shadow, area, widget, detail,
x, y, width, height);
match_data.state = state;
match_data.gap_side = gap_side;
- if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
+ if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
x, y, width, height))
parent_class->draw_extension (style, window, state, shadow, area, widget, detail,
x, y, width, height, gap_side);
match_data.detail = (gchar *)detail;
match_data.flags = 0;
- if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, FALSE,
+ if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, FALSE,
x, y, width, height))
parent_class->draw_focus (style, window, state_type, area, widget, detail,
x, y, width, height);
match_data.state = state;
match_data.orientation = orientation;
- if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
+ if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
x, y, width, height))
parent_class->draw_slider (style, window, state, shadow, area, widget, detail,
x, y, width, height, orientation);
match_data.state = state;
match_data.orientation = orientation;
- if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
+ if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
x, y, width, height))
parent_class->draw_handle (style, window, state, shadow, area, widget, detail,
x, y, width, height, orientation);
match_data.state = state;
match_data.expander_style = expander_style;
- if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
+ if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
x - radius, y - radius, expander_size, expander_size))
parent_class->draw_expander (style, window, state, area, widget, detail,
x, y, expander_style);
match_data.state = state;
match_data.window_edge = edge;
- if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
+ if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
x, y, width, height))
parent_class->draw_resize_grip (style, window, state, area, widget, detail,
edge, x, y, width, height);