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



commit a834604643c3be17a9694d5afd6d2e6545bbd622
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      |   64 +++++++++++++++++-----------------
 3 files changed, 36 insertions(+), 43 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 7044084..b2697bd 100644
--- a/plug-ins/lighting/lighting-ui.c
+++ b/plug-ins/lighting/lighting-ui.c
@@ -282,12 +282,12 @@ envmap_combo_callback (GtkWidget *widget,
 static GtkWidget *
 create_options_page (void)
 {
-  GtkWidget *page;
-  GtkWidget *frame;
-  GtkWidget *vbox;
-  GtkWidget *toggle;
-  GtkWidget *table;
-  GtkObject *adj;
+  GtkWidget     *page;
+  GtkWidget     *frame;
+  GtkWidget     *vbox;
+  GtkWidget     *toggle;
+  GtkWidget     *table;
+  GtkAdjustment *adj;
 
   page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
   gtk_container_set_border_width (GTK_CONTAINER (page), 12);
@@ -366,13 +366,13 @@ create_options_page (void)
 static GtkWidget *
 create_light_page (void)
 {
-  GtkWidget *page;
-  GtkWidget *frame;
-  GtkWidget *table;
-  GtkWidget *button;
-  GtkObject *adj;
-  GtkWidget *label;
-  gint       k = mapvals.light_selected;
+  GtkWidget     *page;
+  GtkWidget     *frame;
+  GtkWidget     *table;
+  GtkWidget     *button;
+  GtkAdjustment *adj;
+  GtkWidget     *label;
+  gint           k = mapvals.light_selected;
 
   page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
   gtk_container_set_border_width (GTK_CONTAINER (page), 12);
@@ -606,16 +606,16 @@ create_light_page (void)
 static GtkWidget *
 create_material_page (void)
 {
-  GtkSizeGroup *group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-  GtkWidget    *page;
-  GtkWidget    *frame;
-  GtkWidget    *table;
-  GtkWidget    *label;
-  GtkWidget    *hbox;
-  GtkWidget    *spinbutton;
-  GtkWidget    *image;
-  GtkWidget    *button;
-  GtkObject    *adj;
+  GtkSizeGroup  *group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+  GtkWidget     *page;
+  GtkWidget     *frame;
+  GtkWidget     *table;
+  GtkWidget     *label;
+  GtkWidget     *hbox;
+  GtkWidget     *spinbutton;
+  GtkWidget     *image;
+  GtkWidget     *button;
+  GtkAdjustment *adj;
 
   page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
   gtk_container_set_border_width (GTK_CONTAINER (page), 12);
@@ -787,13 +787,13 @@ create_material_page (void)
 static GtkWidget *
 create_bump_page (void)
 {
-  GtkWidget *page;
-  GtkWidget *toggle;
-  GtkWidget *frame;
-  GtkWidget *table;
-  GtkWidget *combo;
-  GtkWidget *spinbutton;
-  GtkObject *adj;
+  GtkWidget     *page;
+  GtkWidget     *toggle;
+  GtkWidget     *frame;
+  GtkWidget     *table;
+  GtkWidget     *combo;
+  GtkWidget     *spinbutton;
+  GtkAdjustment *adj;
 
   page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
   gtk_container_set_border_width (GTK_CONTAINER (page), 12);
@@ -1068,8 +1068,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]