[gimp/gtk3-port: 81/233] plug-ins: port some more plug-ins to GTK+ 3.0



commit 1eb6fdf1f33c6066bcb73a7d7337920ba0f28f4d
Author: Michael Natterer <mitch gimp org>
Date:   Tue Oct 26 15:22:34 2010 +0200

    plug-ins: port some more plug-ins to GTK+ 3.0

 plug-ins/pagecurl/pagecurl.c                       |   18 +++++++++---------
 plug-ins/print/print-preview.c                     |   19 ++++++-------------
 .../selection-to-path/selection-to-path-dialog.c   |   16 ++++++++--------
 3 files changed, 23 insertions(+), 30 deletions(-)
---
diff --git a/plug-ins/pagecurl/pagecurl.c b/plug-ins/pagecurl/pagecurl.c
index bb7debc..86f227d 100644
--- a/plug-ins/pagecurl/pagecurl.c
+++ b/plug-ins/pagecurl/pagecurl.c
@@ -420,15 +420,15 @@ dialog (void)
   /* Missing options: Color-dialogs? / own curl layer ? / transparency
      to original drawable / Warp-curl (unsupported yet) */
 
-  GtkWidget *dialog;
-  GtkWidget *hbox;
-  GtkWidget *vbox;
-  GtkWidget *table;
-  GtkWidget *frame;
-  GtkWidget *button;
-  GtkWidget *combo;
-  GtkObject *adjustment;
-  gboolean   run;
+  GtkWidget     *dialog;
+  GtkWidget     *hbox;
+  GtkWidget     *vbox;
+  GtkWidget     *table;
+  GtkWidget     *frame;
+  GtkWidget     *button;
+  GtkWidget     *combo;
+  GtkAdjustment *adjustment;
+  gboolean       run;
 
   gimp_ui_init (PLUG_IN_BINARY, FALSE);
 
diff --git a/plug-ins/print/print-preview.c b/plug-ins/print/print-preview.c
index 3e58f55..028a9a9 100644
--- a/plug-ins/print/print-preview.c
+++ b/plug-ins/print/print-preview.c
@@ -80,8 +80,8 @@ static void      print_preview_size_request         (GtkWidget        *widget,
                                                      GtkRequisition   *requisition);
 static void      print_preview_size_allocate        (GtkWidget        *widget,
                                                      GtkAllocation    *allocation);
-static gboolean  print_preview_expose_event         (GtkWidget        *widget,
-                                                     GdkEventExpose   *event);
+static gboolean  print_preview_draw                 (GtkWidget        *widget,
+                                                     cairo_t          *cr);
 static gboolean  print_preview_button_press_event   (GtkWidget        *widget,
                                                      GdkEventButton   *event);
 static gboolean  print_preview_button_release_event (GtkWidget        *widget,
@@ -182,7 +182,7 @@ print_preview_class_init (PrintPreviewClass *klass)
   widget_class->unrealize            = print_preview_unrealize;
   widget_class->size_request         = print_preview_size_request;
   widget_class->size_allocate        = print_preview_size_allocate;
-  widget_class->expose_event         = print_preview_expose_event;
+  widget_class->draw                 = print_preview_draw;
   widget_class->button_press_event   = print_preview_button_press_event;
   widget_class->button_release_event = print_preview_button_release_event;
   widget_class->motion_notify_event  = print_preview_motion_notify_event;
@@ -398,13 +398,12 @@ print_preview_leave_notify_event (GtkWidget        *widget,
 }
 
 static gboolean
-print_preview_expose_event (GtkWidget      *widget,
-                            GdkEventExpose *event)
+print_preview_draw (GtkWidget *widget,
+                    cairo_t   *cr)
 {
   PrintPreview  *preview = PRINT_PREVIEW (widget);
   GtkStyle      *style   = gtk_widget_get_style (widget);
   GtkAllocation  allocation;
-  cairo_t       *cr;
   gdouble        paper_width;
   gdouble        paper_height;
   gdouble        left_margin;
@@ -425,11 +424,7 @@ print_preview_expose_event (GtkWidget      *widget,
 
   scale = print_preview_get_scale (preview);
 
-  cr = gdk_cairo_create (gtk_widget_get_window (widget));
-
-  cairo_translate (cr,
-                   allocation.x + border,
-                   allocation.y + border);
+  cairo_translate (cr, border, border);
 
   if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
     {
@@ -501,8 +496,6 @@ print_preview_expose_event (GtkWidget      *widget,
       cairo_fill (cr);
     }
 
-  cairo_destroy (cr);
-
   return FALSE;
 }
 
diff --git a/plug-ins/selection-to-path/selection-to-path-dialog.c 
b/plug-ins/selection-to-path/selection-to-path-dialog.c
index 1855480..93739d0 100644
--- a/plug-ins/selection-to-path/selection-to-path-dialog.c
+++ b/plug-ins/selection-to-path/selection-to-path-dialog.c
@@ -48,13 +48,13 @@ static GSList * adjust_widgets = NULL;
 void
 reset_adv_dialog (void)
 {
-  GSList    *list;
-  GtkObject *widget;
-  gdouble   *value;
+  GSList  *list;
+  GObject *widget;
+  gdouble *value;
 
   for (list = adjust_widgets; list; list = g_slist_next (list))
     {
-      widget = GTK_OBJECT (list->data);
+      widget = G_OBJECT (list->data);
       value  = (gdouble *) g_object_get_data (G_OBJECT (widget),
                                               "default_value");
 
@@ -84,10 +84,10 @@ def_val (gdouble default_value)
 GtkWidget *
 dialog_create_selection_area (SELVALS *sels)
 {
-  GtkWidget *table;
-  GtkWidget *check;
-  GtkObject *adj;
-  gint       row;
+  GtkWidget     *table;
+  GtkWidget     *check;
+  GtkAdjustment *adj;
+  gint           row;
 
   table = gtk_table_new (20, 3, FALSE);
   gtk_table_set_row_spacings (GTK_TABLE (table), 6);


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