[gimp/gtk3-port: 89/234] plug-ins: port lighting to GTK+ 3.0



commit 67cea0e53f356c93e52b487402c96a14d4ba5355
Author: Michael Natterer <mitch gimp org>
Date:   Tue Nov 2 21:49:54 2010 +0100

    plug-ins: port lighting to GTK+ 3.0

 plug-ins/lighting/lighting-preview.c |   11 ++---------
 plug-ins/lighting/lighting-preview.h |    4 ++--
 plug-ins/lighting/lighting-ui.c      |    4 ++--
 3 files changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/plug-ins/lighting/lighting-preview.c b/plug-ins/lighting/lighting-preview.c
index e1319de..b53ba5e 100644
--- a/plug-ins/lighting/lighting-preview.c
+++ b/plug-ins/lighting/lighting-preview.c
@@ -387,7 +387,6 @@ preview_compute (void)
   compute_preview_rectangle (&startx, &starty, &pw, &ph);
 
   cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
-
   gdk_window_set_cursor (gtk_widget_get_window (previewarea), cursor);
   gdk_cursor_unref (cursor);
 
@@ -438,13 +437,9 @@ preview_events (GtkWidget *area,
 }
 
 gboolean
-preview_expose (GtkWidget *area,
-                GdkEventExpose *eevent)
+preview_draw (GtkWidget *area,
+              cairo_t   *cr)
 {
-  cairo_t *cr;
-
-  cr = gdk_cairo_create (eevent->window);
-
   cairo_set_source_surface (cr, preview_surface, 0.0, 0.0);
 
   cairo_paint (cr);
@@ -455,8 +450,6 @@ preview_expose (GtkWidget *area,
       draw_handles ();
     }
 
-  cairo_destroy (cr);
-
   return FALSE;
 }
 
diff --git a/plug-ins/lighting/lighting-preview.h b/plug-ins/lighting/lighting-preview.h
index f96edb0..2e15d2f 100644
--- a/plug-ins/lighting/lighting-preview.h
+++ b/plug-ins/lighting/lighting-preview.h
@@ -30,8 +30,8 @@ void     preview_compute              (void);
 void     interactive_preview_callback (GtkWidget *widget);
 gboolean preview_events               (GtkWidget *area,
                                        GdkEvent  *event);
-gboolean preview_expose               (GtkWidget *area,
-                                       GdkEventExpose *eevent);
+gboolean preview_draw                 (GtkWidget *area,
+                                       cairo_t   *cr);
 void     update_light                 (gint       xpos,
                                        gint       ypos);
 
diff --git a/plug-ins/lighting/lighting-ui.c b/plug-ins/lighting/lighting-ui.c
index 8cfa45b..70c1fca 100644
--- a/plug-ins/lighting/lighting-ui.c
+++ b/plug-ins/lighting/lighting-ui.c
@@ -1078,8 +1078,8 @@ main_dialog (GimpDrawable *drawable)
   g_signal_connect (previewarea, "event",
                     G_CALLBACK (preview_events),
                     previewarea);
-  g_signal_connect (previewarea, "expose-event",
-                    G_CALLBACK (preview_expose),
+  g_signal_connect (previewarea, "draw",
+                    G_CALLBACK (preview_draw),
                     previewarea);
   gtk_container_add (GTK_CONTAINER (frame), previewarea);
   gtk_widget_show (previewarea);


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