[gimp/gtk3-port: 58/226] app: port to GtkWidget::draw()



commit b28665ee80d0b9a695862bb5d36f063229a5cd48
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 10dba23..e941021 100644
--- a/app/display/gimpstatusbar.c
+++ b/app/display/gimpstatusbar.c
@@ -97,8 +97,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);
@@ -229,8 +229,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,
@@ -1339,21 +1339,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,
@@ -1366,8 +1360,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]