[gimp/gtk3-port: 26/235] app: port to GtkWidget::draw()



commit 0d6c9b4bf986bec9ca90e058aa6cb637924e75e8
Author: Michael Natterer <mitch gimp org>
Date:   Fri Oct 15 14:31:07 2010 +0200

    app: port to GtkWidget::draw()

 app/widgets/gimphistogramview.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)
---
diff --git a/app/widgets/gimphistogramview.c b/app/widgets/gimphistogramview.c
index e45b68c..769c8aa 100644
--- a/app/widgets/gimphistogramview.c
+++ b/app/widgets/gimphistogramview.c
@@ -63,8 +63,8 @@ static void     gimp_histogram_view_get_property   (GObject        *object,
 
 static void     gimp_histogram_view_size_request   (GtkWidget      *widget,
                                                     GtkRequisition *requisition);
-static gboolean gimp_histogram_view_expose         (GtkWidget      *widget,
-                                                    GdkEventExpose *event);
+static gboolean gimp_histogram_view_draw           (GtkWidget      *widget,
+                                                    cairo_t        *cr);
 static gboolean gimp_histogram_view_button_press   (GtkWidget      *widget,
                                                     GdkEventButton *bevent);
 static gboolean gimp_histogram_view_button_release (GtkWidget      *widget,
@@ -122,7 +122,7 @@ gimp_histogram_view_class_init (GimpHistogramViewClass *klass)
   object_class->set_property         = gimp_histogram_view_set_property;
 
   widget_class->size_request         = gimp_histogram_view_size_request;
-  widget_class->expose_event         = gimp_histogram_view_expose;
+  widget_class->draw                 = gimp_histogram_view_draw;
   widget_class->button_press_event   = gimp_histogram_view_button_press;
   widget_class->button_release_event = gimp_histogram_view_button_release;
   widget_class->motion_notify_event  = gimp_histogram_view_motion_notify;
@@ -276,13 +276,12 @@ gimp_histogram_view_get_maximum (GimpHistogramView    *view,
 }
 
 static gboolean
-gimp_histogram_view_expose (GtkWidget      *widget,
-                            GdkEventExpose *event)
+gimp_histogram_view_draw (GtkWidget *widget,
+                          cairo_t   *cr)
 {
   GimpHistogramView *view  = GIMP_HISTOGRAM_VIEW (widget);
   GtkStyle          *style = gtk_widget_get_style (widget);
   GtkAllocation      allocation;
-  cairo_t           *cr;
   gint               x;
   gint               x1, x2;
   gint               border;
@@ -296,11 +295,6 @@ gimp_histogram_view_expose (GtkWidget      *widget,
   GdkColor          *bg_color_out;
   GdkColor           rgb_color[3];
 
-  cr = gdk_cairo_create (gtk_widget_get_window (widget));
-
-  gdk_cairo_region (cr, event->region);
-  cairo_clip (cr);
-
   /*  Draw the background  */
   gdk_cairo_set_source_color (cr, &style->base[GTK_STATE_NORMAL]);
   cairo_paint (cr);
@@ -424,8 +418,6 @@ gimp_histogram_view_expose (GtkWidget      *widget,
         }
     }
 
-  cairo_destroy (cr);
-
   return FALSE;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]