[gtk+/rendering-cleanup-next: 41/153] toolpalette: Port to draw vfunc
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/rendering-cleanup-next: 41/153] toolpalette: Port to draw vfunc
- Date: Sat, 11 Sep 2010 04:54:52 +0000 (UTC)
commit 8ae249244690ea4e2b6a4e71faa2e75985aa684a
Author: Benjamin Otte <otte redhat com>
Date: Mon Sep 6 13:56:26 2010 +0200
toolpalette: Port to draw vfunc
gtk/gtktoolpalette.c | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c
index b917696..bfca28d 100644
--- a/gtk/gtktoolpalette.c
+++ b/gtk/gtktoolpalette.c
@@ -615,13 +615,14 @@ gtk_tool_palette_size_allocate (GtkWidget *widget,
}
static gboolean
-gtk_tool_palette_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
+gtk_tool_palette_draw (GtkWidget *widget,
+ cairo_t *cr,
+ int width,
+ int height)
{
GtkToolPalette *palette = GTK_TOOL_PALETTE (widget);
GdkDisplay *display;
GdkWindow *window;
- cairo_t *cr;
guint i;
window = gtk_widget_get_window (widget);
@@ -631,10 +632,6 @@ gtk_tool_palette_expose_event (GtkWidget *widget,
if (!gdk_display_supports_composite (display))
return FALSE;
- cr = gdk_cairo_create (window);
- gdk_cairo_region (cr, event->region);
- cairo_clip (cr);
-
cairo_push_group (cr);
for (i = 0; i < palette->priv->groups->len; ++i)
@@ -647,7 +644,6 @@ gtk_tool_palette_expose_event (GtkWidget *widget,
cairo_pop_group_to_source (cr);
cairo_paint (cr);
- cairo_destroy (cr);
return FALSE;
}
@@ -947,7 +943,7 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
wclass->size_request = gtk_tool_palette_size_request;
wclass->size_allocate = gtk_tool_palette_size_allocate;
- wclass->expose_event = gtk_tool_palette_expose_event;
+ wclass->draw = gtk_tool_palette_draw;
wclass->realize = gtk_tool_palette_realize;
cclass->add = gtk_tool_palette_add;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]