[gimp/gtk3-port: 57/234] app: port to GtkWidget::draw()



commit 71221c1c52309f1599203c605edce1db346dc4d9
Author: Michael Natterer <mitch gimp org>
Date:   Tue Oct 19 20:26:16 2010 +0200

    app: port to GtkWidget::draw()

 app/display/gimpstatusbar.c |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c
index 0bb8ea3..2e607ff 100644
--- a/app/display/gimpstatusbar.c
+++ b/app/display/gimpstatusbar.c
@@ -102,8 +102,8 @@ static gboolean gimp_statusbar_progress_message   (GimpProgress      *progress,
 static void     gimp_statusbar_progress_canceled  (GtkWidget         *button,
                                                    GimpStatusbar     *statusbar);
 
-static gboolean gimp_statusbar_label_expose       (GtkWidget         *widget,
-                                                   GdkEventExpose    *event,
+static gboolean gimp_statusbar_label_draw         (GtkWidget         *widget,
+                                                   cairo_t           *cr,
                                                    GimpStatusbar     *statusbar);
 
 static void     gimp_statusbar_update             (GimpStatusbar     *statusbar);
@@ -241,8 +241,8 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
 
   g_object_unref (statusbar->label);
 
-  g_signal_connect_after (statusbar->label, "expose-event",
-                          G_CALLBACK (gimp_statusbar_label_expose),
+  g_signal_connect_after (statusbar->label, "draw",
+                          G_CALLBACK (gimp_statusbar_label_draw),
                           statusbar);
 
   statusbar->progressbar = g_object_new (GTK_TYPE_PROGRESS_BAR,
@@ -1386,21 +1386,15 @@ gimp_statusbar_clear_cursor (GimpStatusbar *statusbar)
 /*  private functions  */
 
 static gboolean
-gimp_statusbar_label_expose (GtkWidget      *widget,
-                             GdkEventExpose *event,
-                             GimpStatusbar  *statusbar)
+gimp_statusbar_label_draw (GtkWidget     *widget,
+                           cairo_t       *cr,
+                           GimpStatusbar *statusbar)
 {
   if (statusbar->icon)
     {
-      cairo_t        *cr;
       PangoRectangle  rect;
       gint            x, y;
 
-      cr = gdk_cairo_create (event->window);
-
-      gdk_cairo_region (cr, event->region);
-      cairo_clip (cr);
-
       gtk_label_get_layout_offsets (GTK_LABEL (widget), &x, &y);
 
       pango_layout_index_to_pos (gtk_label_get_layout (GTK_LABEL (widget)), 0,
@@ -1413,8 +1407,6 @@ gimp_statusbar_label_expose (GtkWidget      *widget,
 
       gdk_cairo_set_source_pixbuf (cr, statusbar->icon, x, y);
       cairo_paint (cr);
-
-      cairo_destroy (cr);
     }
 
   return FALSE;


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