From 8f8d62167d12e3a8d4af23c7587e2ca3e06a207d Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 15 Oct 2010 14:26:48 +0200 Subject: [PATCH] app: port to GtkWidget::draw() --- app/widgets/gimphandlebar.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/app/widgets/gimphandlebar.c b/app/widgets/gimphandlebar.c index adedcdd508..078c498a43 100644 --- a/app/widgets/gimphandlebar.c +++ b/app/widgets/gimphandlebar.c @@ -44,8 +44,8 @@ static void gimp_handle_bar_get_property (GObject *object, GValue *value, GParamSpec *pspec); -static gboolean gimp_handle_bar_expose (GtkWidget *widget, - GdkEventExpose *eevent); +static gboolean gimp_handle_bar_draw (GtkWidget *widget, + cairo_t *cr); static gboolean gimp_handle_bar_button_press (GtkWidget *widget, GdkEventButton *bevent); static gboolean gimp_handle_bar_button_release (GtkWidget *widget, @@ -71,7 +71,7 @@ gimp_handle_bar_class_init (GimpHandleBarClass *klass) object_class->set_property = gimp_handle_bar_set_property; object_class->get_property = gimp_handle_bar_get_property; - widget_class->expose_event = gimp_handle_bar_expose; + widget_class->draw = gimp_handle_bar_draw; widget_class->button_press_event = gimp_handle_bar_button_press; widget_class->button_release_event = gimp_handle_bar_button_release; widget_class->motion_notify_event = gimp_handle_bar_motion_notify; @@ -141,12 +141,11 @@ gimp_handle_bar_get_property (GObject *object, } static gboolean -gimp_handle_bar_expose (GtkWidget *widget, - GdkEventExpose *eevent) +gimp_handle_bar_draw (GtkWidget *widget, + cairo_t *cr) { GimpHandleBar *bar = GIMP_HANDLE_BAR (widget); GtkAllocation allocation; - cairo_t *cr; gint x, y; gint width, height; gint i; @@ -158,16 +157,6 @@ gimp_handle_bar_expose (GtkWidget *widget, width = allocation.width - 2 * x; height = allocation.height - 2 * y; - if (! gtk_widget_get_has_window (widget)) - { - x += allocation.x; - y += allocation.y; - } - - cr = gdk_cairo_create (gtk_widget_get_window (widget)); - gdk_cairo_region (cr, eevent->region); - cairo_clip (cr); - cairo_set_line_width (cr, 1.0); cairo_translate (cr, 0.5, 0.5); @@ -210,8 +199,6 @@ gimp_handle_bar_expose (GtkWidget *widget, } } - cairo_destroy (cr); - return FALSE; }