[gimp] plug-ins: some gimp_spin_button_new() -> gtk_spin_button_new()



commit 08ffad9086c1db3fa636e87320a19e0524090cbd
Author: Michael Natterer <mitch gimp org>
Date:   Sun Jun 22 00:26:59 2014 +0200

    plug-ins: some gimp_spin_button_new() -> gtk_spin_button_new()

 plug-ins/file-fli/fli-gimp.c             |   44 ++++++++++++++-----------
 plug-ins/file-jpeg/jpeg-save.c           |   13 ++++---
 plug-ins/ifs-compose/ifs-compose.c       |   12 ++++---
 plug-ins/print/print-page-layout.c       |   52 ++++++++++++++++++-----------
 plug-ins/script-fu/script-fu-interface.c |   22 ++++++------
 5 files changed, 81 insertions(+), 62 deletions(-)
---
diff --git a/plug-ins/file-fli/fli-gimp.c b/plug-ins/file-fli/fli-gimp.c
index 626b78b..1971600 100644
--- a/plug-ins/file-fli/fli-gimp.c
+++ b/plug-ins/file-fli/fli-gimp.c
@@ -847,12 +847,12 @@ save_image (const gchar  *filename,
 static gboolean
 load_dialog (const gchar *filename)
 {
-  GtkWidget *dialog;
-  GtkWidget *table;
-  GtkWidget *spinbutton;
-  GtkObject *adj;
-  gint32     width, height, nframes;
-  gboolean   run;
+  GtkWidget     *dialog;
+  GtkWidget     *table;
+  GtkWidget     *spinbutton;
+  GtkAdjustment *adj;
+  gint32         width, height, nframes;
+  gboolean       run;
 
   get_info (filename, &width, &height, &nframes, NULL);
 
@@ -887,8 +887,9 @@ load_dialog (const gchar *filename)
    * Maybe I add on-the-fly RGB conversion, to keep palettechanges...
    * But for now you can set a start- and a end-frame:
    */
-  spinbutton = gimp_spin_button_new (&adj,
-                                    from_frame, 1, nframes, 1, 10, 0, 1, 0);
+  adj = (GtkAdjustment *) gtk_adjustment_new (from_frame, 1, nframes, 1, 10, 0);
+  spinbutton = gtk_spin_button_new (adj, 1, 0);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
                             C_("frame-range", "From:"), 0.0, 0.5,
                             spinbutton, 1, TRUE);
@@ -896,8 +897,9 @@ load_dialog (const gchar *filename)
                     G_CALLBACK (gimp_int_adjustment_update),
                     &from_frame);
 
-  spinbutton = gimp_spin_button_new (&adj,
-                                    to_frame, 1, nframes, 1, 10, 0, 1, 0);
+  adj = (GtkAdjustment *) gtk_adjustment_new (to_frame, 1, nframes, 1, 10, 0);
+  spinbutton = gtk_spin_button_new (adj, 1, 0);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
                             C_("frame-range", "To:"), 0.0, 0.5,
                             spinbutton, 1, TRUE);
@@ -917,12 +919,12 @@ load_dialog (const gchar *filename)
 static gboolean
 save_dialog (gint32 image_id)
 {
-  GtkWidget *dialog;
-  GtkWidget *table;
-  GtkWidget *spinbutton;
-  GtkObject *adj;
-  gint       nframes;
-  gboolean   run;
+  GtkWidget     *dialog;
+  GtkWidget     *table;
+  GtkWidget     *spinbutton;
+  GtkAdjustment *adj;
+  gint           nframes;
+  gboolean       run;
 
   g_free (gimp_image_get_layers (image_id, &nframes));
 
@@ -943,8 +945,9 @@ save_dialog (gint32 image_id)
    * Maybe I add on-the-fly RGB conversion, to keep palettechanges...
    * But for now you can set a start- and a end-frame:
    */
-  spinbutton = gimp_spin_button_new (&adj,
-                                    from_frame, 1, nframes, 1, 10, 0, 1, 0);
+  adj = (GtkAdjustment *) gtk_adjustment_new (from_frame, 1, nframes, 1, 10, 0);
+  spinbutton = gtk_spin_button_new (adj, 1, 0);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
                             C_("frame-range", "From:"), 0.0, 0.5,
                             spinbutton, 1, TRUE);
@@ -952,8 +955,9 @@ save_dialog (gint32 image_id)
                     G_CALLBACK (gimp_int_adjustment_update),
                     &from_frame);
 
-  spinbutton = gimp_spin_button_new (&adj,
-                                    to_frame, 1, nframes, 1, 10, 0, 1, 0);
+  adj = (GtkAdjustment *) gtk_adjustment_new (to_frame, 1, nframes, 1, 10, 0);
+  spinbutton = gtk_spin_button_new (adj, 1, 0);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
                             C_("frame-range", "To:"), 0.0, 0.5,
                             spinbutton, 1, TRUE);
diff --git a/plug-ins/file-jpeg/jpeg-save.c b/plug-ins/file-jpeg/jpeg-save.c
index 61fffc5..0864cc9 100644
--- a/plug-ins/file-jpeg/jpeg-save.c
+++ b/plug-ins/file-jpeg/jpeg-save.c
@@ -96,7 +96,7 @@ typedef struct
   gboolean       run;
   GtkWidget     *use_restart_markers;   /*checkbox setting use restart markers*/
   GtkTextBuffer *text_buffer;
-  GtkObject     *scale_data;            /*for restart markers*/
+  GtkAdjustment *scale_data;            /*for restart markers*/
   gulong         handler_id_restart;
 
   GtkObject     *quality;               /*quality slidebar*/
@@ -849,12 +849,13 @@ save_dialog (void)
                     GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
   gtk_widget_show (restart_markers_label);
 
-  /*pg.scale_data = scale_data;*/
+  pg.scale_data = (GtkAdjustment *)
+    gtk_adjustment_new (((jsvals.restart == 0) ?
+                         DEFAULT_RESTART_MCU_ROWS : jsvals.restart),
+                        1.0, 64.0, 1.0, 1.0, 0);
   pg.restart = restart_markers_scale = spinbutton =
-    gimp_spin_button_new (&pg.scale_data,
-                          ((jsvals.restart == 0) ?
-                           DEFAULT_RESTART_MCU_ROWS : jsvals.restart),
-                          1.0, 64.0, 1.0, 1.0, 0, 1.0, 0);
+    gtk_spin_button_new (pg.scale_data, 1.0, 0);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 5, 6, 1, 2,
                     GTK_FILL, GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
diff --git a/plug-ins/ifs-compose/ifs-compose.c b/plug-ins/ifs-compose/ifs-compose.c
index 2a8ff0a..cf9e102 100644
--- a/plug-ins/ifs-compose/ifs-compose.c
+++ b/plug-ins/ifs-compose/ifs-compose.c
@@ -2103,11 +2103,13 @@ value_pair_create (gpointer      data,
   value_pair->type   = type;
   value_pair->timeout_id = 0;
 
-  value_pair->spin = gimp_spin_button_new ((GtkObject **) &value_pair->adjustment,
-                                           1.0, lower, upper,
-                                           (upper - lower) / 100,
-                                           (upper - lower) / 10,
-                                           0.0, 1.0, 3);
+  value_pair->adjustment = (GtkAdjustment *)
+    gtk_adjustment_new (1.0, lower, upper,
+                        (upper - lower) / 100,
+                        (upper - lower) / 10,
+                        0.0);
+  value_pair->spin = gtk_spin_button_new (value_pair->adjustment, 1.0, 3);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (value_pair->spin), TRUE);
   gtk_widget_set_size_request (value_pair->spin, 72, -1);
 
   g_signal_connect (value_pair->adjustment, "value-changed",
diff --git a/plug-ins/print/print-page-layout.c b/plug-ins/print/print-page-layout.c
index 191ff75..acc29db 100644
--- a/plug-ins/print/print-page-layout.c
+++ b/plug-ins/print/print-page-layout.c
@@ -40,10 +40,10 @@ typedef struct
   GtkWidget       *center_combo;
   GtkWidget       *area_label;
   GtkWidget       *preview;
-  GtkObject       *left_adj;
-  GtkObject       *right_adj;
-  GtkObject       *top_adj;
-  GtkObject       *bottom_adj;
+  GtkAdjustment   *left_adj;
+  GtkAdjustment   *right_adj;
+  GtkAdjustment   *top_adj;
+  GtkAdjustment   *bottom_adj;
 } PrintSizeInfo;
 
 enum
@@ -228,16 +228,16 @@ print_size_frame (PrintData    *data,
                   GtkSizeGroup *label_group,
                   GtkSizeGroup *entry_group)
 {
-  GtkWidget *entry;
-  GtkWidget *height;
-  GtkWidget *vbox;
-  GtkWidget *hbox;
-  GtkWidget *chain;
-  GtkWidget *frame;
-  GtkWidget *label;
-  GtkObject *adj;
-  gdouble    image_width;
-  gdouble    image_height;
+  GtkWidget     *entry;
+  GtkWidget     *height;
+  GtkWidget     *vbox;
+  GtkWidget     *hbox;
+  GtkWidget     *chain;
+  GtkWidget     *frame;
+  GtkWidget     *label;
+  GtkAdjustment *adj;
+  gdouble        image_width;
+  gdouble        image_height;
 
   image_width  = (info.image_width *
                   gimp_unit_get_factor (data->unit) / data->xres);
@@ -268,7 +268,9 @@ print_size_frame (PrintData    *data,
   gtk_table_set_col_spacing (GTK_TABLE (entry), 0, 6);
   gtk_table_set_col_spacing (GTK_TABLE (entry), 2, 6);
 
-  height = gimp_spin_button_new (&adj, 1, 1, 1, 1, 10, 0, 1, 2);
+  adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
+  height = gtk_spin_button_new (adj, 1, 2);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height), TRUE);
   gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry),
                              GTK_SPIN_BUTTON (height), NULL);
   gtk_table_attach_defaults (GTK_TABLE (entry), height, 1, 2, 0, 1);
@@ -310,7 +312,9 @@ print_size_frame (PrintData    *data,
   gtk_table_set_col_spacing (GTK_TABLE (entry), 0, 6);
   gtk_table_set_col_spacing (GTK_TABLE (entry), 2, 6);
 
-  height = gimp_spin_button_new (&adj, 1, 1, 1, 1, 10, 0, 1, 2);
+  adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
+  height = gtk_spin_button_new (adj, 1, 2);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height), TRUE);
   gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry),
                              GTK_SPIN_BUTTON (height), NULL);
   gtk_table_attach_defaults (GTK_TABLE (entry), height, 1, 2, 0, 1);
@@ -388,7 +392,9 @@ print_offset_frame (PrintData    *data,
   gtk_widget_show (table);
 
   /* left */
-  spinner = gimp_spin_button_new (&info.left_adj, 1, 1, 1, 1, 10, 0, 1, 2);
+  info.left_adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
+  spinner = gtk_spin_button_new (info.left_adj, 1, 2);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE);
 
   gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry),
                              GTK_SPIN_BUTTON (spinner), NULL);
@@ -403,7 +409,9 @@ print_offset_frame (PrintData    *data,
   gtk_widget_show (label);
 
   /* right */
-  spinner = gimp_spin_button_new (&info.right_adj, 1, 1, 1, 1, 10, 0, 1, 2);
+  info.right_adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
+  spinner = gtk_spin_button_new (info.right_adj, 1, 2);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE);
 
   g_signal_connect (info.right_adj, "value-changed",
                     G_CALLBACK (print_size_info_offset_max_changed),
@@ -421,7 +429,9 @@ print_offset_frame (PrintData    *data,
   gtk_widget_show (label);
 
   /* top */
-  spinner = gimp_spin_button_new (&info.top_adj, 1, 1, 1, 1, 10, 0, 1, 2);
+  info.top_adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
+  spinner = gtk_spin_button_new (info.top_adj, 1, 2);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE);
 
   gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry),
                              GTK_SPIN_BUTTON (spinner), NULL);
@@ -436,7 +446,9 @@ print_offset_frame (PrintData    *data,
   gtk_widget_show (label);
 
   /* bottom */
-  spinner = gimp_spin_button_new (&info.bottom_adj, 1, 1, 1, 1, 10, 0, 1, 2);
+  info.bottom_adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
+  spinner = gtk_spin_button_new (info.bottom_adj, 1, 2);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE);
 
   g_signal_connect (info.bottom_adj, "value-changed",
                     G_CALLBACK (print_size_info_offset_max_changed),
diff --git a/plug-ins/script-fu/script-fu-interface.c b/plug-ins/script-fu/script-fu-interface.c
index 5bb40d7..5a7ae7f 100644
--- a/plug-ins/script-fu/script-fu-interface.c
+++ b/plug-ins/script-fu/script-fu-interface.c
@@ -274,7 +274,6 @@ script_fu_interface (SFScript  *script,
   for (i = start_arg; i < script->n_args; i++)
     {
       GtkWidget *widget       = NULL;
-      GtkObject *adj;
       gchar     *label_text;
       gfloat     label_yalign = 0.5;
       gint      *ID_ptr       = NULL;
@@ -420,17 +419,18 @@ script_fu_interface (SFScript  *script,
 
             case SF_SPINNER:
               left_align = TRUE;
-              widget =
-                gimp_spin_button_new (&adj,
-                                      arg->value.sfa_adjustment.value,
-                                      arg->default_value.sfa_adjustment.lower,
-                                      arg->default_value.sfa_adjustment.upper,
-                                      arg->default_value.sfa_adjustment.step,
-                                      arg->default_value.sfa_adjustment.page,
-                                      0, 0,
-                                      arg->default_value.sfa_adjustment.digits);
+              arg->value.sfa_adjustment.adj = (GtkAdjustment *)
+                gtk_adjustment_new (arg->value.sfa_adjustment.value,
+                                    arg->default_value.sfa_adjustment.lower,
+                                    arg->default_value.sfa_adjustment.upper,
+                                    arg->default_value.sfa_adjustment.step,
+                                    arg->default_value.sfa_adjustment.page,
+                                    0);
+              widget = gtk_spin_button_new (arg->value.sfa_adjustment.adj,
+                                            arg->default_value.sfa_adjustment.step,
+                                            arg->default_value.sfa_adjustment.digits);
+              gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (widget), TRUE);
               gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE);
-              arg->value.sfa_adjustment.adj = GTK_ADJUSTMENT (adj);
               break;
             }
 


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