[gimp/gtk3-port: 79/230] plug-ins: port jpeg-save to GTK+ 3.0



commit 50885ae6a420e2c1211df1314ac9fbb4d0a439a8
Author: Michael Natterer <mitch gimp org>
Date:   Sun Oct 24 00:02:52 2010 +0200

    plug-ins: port jpeg-save to GTK+ 3.0

 plug-ins/file-jpeg/jpeg-save.c |   38 ++++++++++++++++++--------------------
 1 files changed, 18 insertions(+), 20 deletions(-)
---
diff --git a/plug-ins/file-jpeg/jpeg-save.c b/plug-ins/file-jpeg/jpeg-save.c
index 61fffc5..24a4a44 100644
--- a/plug-ins/file-jpeg/jpeg-save.c
+++ b/plug-ins/file-jpeg/jpeg-save.c
@@ -96,12 +96,12 @@ 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*/
-  GtkObject     *smoothing;             /*smoothing slidebar*/
-  GtkWidget     *optimize;              /*optimize toggle*/
+  GtkAdjustment *quality;               /*quality slidebar*/
+  GtkAdjustment *smoothing;             /*smoothing slidebar*/
+  GtkWidget     *optimize;              /*optimize togle*/
   GtkWidget     *arithmetic_coding;     /*arithmetic coding toggle*/
   GtkWidget     *progressive;           /*progressive toggle*/
   GtkWidget     *subsmp;                /*subsampling side select*/
@@ -120,11 +120,11 @@ static void  make_preview           (void);
 static void  save_restart_update    (GtkAdjustment *adjustment,
                                      GtkWidget     *toggle);
 static void  subsampling_changed    (GtkWidget     *combo,
-                                     GtkObject     *entry);
-static void  quality_changed        (GtkObject     *scale_entry,
+                                     GtkAdjustment *entry);
+static void  quality_changed        (GtkAdjustment *scale_entry,
                                      GtkWidget     *toggle);
 static void  use_orig_qual_changed  (GtkWidget     *toggle,
-                                     GtkObject     *scale_entry);
+                                     GtkAdjustment *scale_entry);
 static void  use_orig_qual_changed2 (GtkWidget     *toggle,
                                      GtkWidget     *combo);
 
@@ -722,7 +722,7 @@ save_dialog (void)
   JpegSaveGui    pg;
   GtkWidget     *dialog;
   GtkWidget     *vbox;
-  GtkObject     *entry;
+  GtkAdjustment *entry;
   GtkWidget     *table;
   GtkWidget     *table2;
   GtkWidget     *tabledefaults;
@@ -1332,15 +1332,13 @@ load_gui_defaults (JpegSaveGui *pg)
   g_signal_handler_block (pg->use_restart_markers, pg->handler_id_restart);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pg->use_restart_markers),
                                 jsvals.restart);
-  restart_markers = GTK_ADJUSTMENT (pg->scale_data);
+  restart_markers = pg->scale_data;
   gtk_adjustment_set_value (restart_markers, jsvals.restart);
   g_signal_handler_unblock (pg->use_restart_markers, pg->handler_id_restart);
 
 
-  gtk_adjustment_set_value (GTK_ADJUSTMENT (pg->quality),
-                            jsvals.quality);
-  gtk_adjustment_set_value (GTK_ADJUSTMENT (pg->smoothing),
-                            jsvals.smoothing);
+  gtk_adjustment_set_value (pg->quality, jsvals.quality);
+  gtk_adjustment_set_value (pg->smoothing, jsvals.smoothing);
 
   if (gimp_drawable_is_rgb (drawable_ID_global))
     {
@@ -1368,8 +1366,8 @@ save_restart_update (GtkAdjustment *adjustment,
 }
 
 static void
-subsampling_changed (GtkWidget *combo,
-                     GtkObject *entry)
+subsampling_changed (GtkWidget     *combo,
+                     GtkAdjustment *entry)
 {
   gint value;
 
@@ -1386,8 +1384,8 @@ subsampling_changed (GtkWidget *combo,
 }
 
 static void
-quality_changed (GtkObject *scale_entry,
-                 GtkWidget *toggle)
+quality_changed (GtkAdjustment *scale_entry,
+                 GtkWidget     *toggle)
 {
   if (jsvals.use_orig_quality)
     {
@@ -1396,13 +1394,13 @@ quality_changed (GtkObject *scale_entry,
 }
 
 static void
-use_orig_qual_changed (GtkWidget *toggle,
-                       GtkObject *scale_entry)
+use_orig_qual_changed (GtkWidget     *toggle,
+                       GtkAdjustment *scale_entry)
 {
   if (jsvals.use_orig_quality && orig_quality > 0)
     {
       g_signal_handlers_block_by_func (scale_entry, quality_changed, toggle);
-      gtk_adjustment_set_value (GTK_ADJUSTMENT (scale_entry), orig_quality);
+      gtk_adjustment_set_value (scale_entry, orig_quality);
       g_signal_handlers_unblock_by_func (scale_entry, quality_changed, toggle);
     }
 }


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