[gimp/gtk3-port: 34/239] app: port GimpNavigationView to GtkWidget::draw()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 34/239] app: port GimpNavigationView to GtkWidget::draw()
- Date: Fri, 30 Sep 2011 14:00:15 +0000 (UTC)
commit c2a4feb5e6fdbbbd0174281570e345786f016e66
Author: Michael Natterer <mitch gimp org>
Date: Fri Oct 15 14:35:13 2010 +0200
app: port GimpNavigationView to GtkWidget::draw()
app/widgets/gimpnavigationview.c | 26 +++++++-------------------
1 files changed, 7 insertions(+), 19 deletions(-)
---
diff --git a/app/widgets/gimpnavigationview.c b/app/widgets/gimpnavigationview.c
index 06bb08e..314947b 100644
--- a/app/widgets/gimpnavigationview.c
+++ b/app/widgets/gimpnavigationview.c
@@ -74,8 +74,8 @@ struct _GimpNavigationView
static void gimp_navigation_view_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
-static gboolean gimp_navigation_view_expose (GtkWidget *widget,
- GdkEventExpose *event);
+static gboolean gimp_navigation_view_draw (GtkWidget *widget,
+ cairo_t *cr);
static gboolean gimp_navigation_view_button_press (GtkWidget *widget,
GdkEventButton *bevent);
static gboolean gimp_navigation_view_button_release (GtkWidget *widget,
@@ -144,7 +144,7 @@ gimp_navigation_view_class_init (GimpNavigationViewClass *klass)
GDK_TYPE_SCROLL_DIRECTION);
widget_class->size_allocate = gimp_navigation_view_size_allocate;
- widget_class->expose_event = gimp_navigation_view_expose;
+ widget_class->draw = gimp_navigation_view_draw;
widget_class->button_press_event = gimp_navigation_view_button_press;
widget_class->button_release_event = gimp_navigation_view_button_release;
widget_class->scroll_event = gimp_navigation_view_scroll;
@@ -186,24 +186,12 @@ gimp_navigation_view_size_allocate (GtkWidget *widget,
}
static gboolean
-gimp_navigation_view_expose (GtkWidget *widget,
- GdkEventExpose *event)
+gimp_navigation_view_draw (GtkWidget *widget,
+ cairo_t *cr)
{
- if (gtk_widget_is_drawable (widget))
- {
- cairo_t *cr;
-
- GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
-
- cr = gdk_cairo_create (gtk_widget_get_window (widget));
+ GTK_WIDGET_CLASS (parent_class)->draw (widget, cr);
- gdk_cairo_region (cr, event->region);
- cairo_clip (cr);
-
- gimp_navigation_view_draw_marker (GIMP_NAVIGATION_VIEW (widget), cr);
-
- cairo_destroy (cr);
- }
+ gimp_navigation_view_draw_marker (GIMP_NAVIGATION_VIEW (widget), cr);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]