[gimp] Fix a lot of warnings all over the place



commit f5ecc53f3e1720f75acd69c75d67a540527ae215
Author: Michael Natterer <mitch gimp org>
Date:   Mon Oct 31 01:08:38 2016 +0100

    Fix a lot of warnings all over the place
    
    Deprecated stuff, unused variables. Includes parts of a patch from
    Shlomi Fish from bug #768855.

 app/actions/context-actions.c        |    6 +-
 app/display/gimpmotionbuffer.c       |    2 -
 libgimp/gimpdrawablepreview.c        |    3 +
 libgimp/gimpzoompreview.c            |    3 +
 libgimpmath/gimpvector.c             |    4 +
 modules/display-filter-color-blind.c |   46 ++++----
 plug-ins/common/file-dicom.c         |    2 +-
 plug-ins/common/file-mng.c           |    6 +-
 plug-ins/common/file-psp.c           |    5 +-
 plug-ins/common/file-sunras.c        |    4 +-
 plug-ins/imagemap/imap_preview.c     |    5 +-
 plug-ins/imagemap/imap_table.c       |    3 +-
 plug-ins/lighting/lighting-ui.c      |  167 ++++++++++++++++-----------
 plug-ins/map-object/map-object-ui.c  |  208 ++++++++++++++++++++--------------
 14 files changed, 274 insertions(+), 190 deletions(-)
---
diff --git a/app/actions/context-actions.c b/app/actions/context-actions.c
index 8c900c6..c4ab779 100644
--- a/app/actions/context-actions.c
+++ b/app/actions/context-actions.c
@@ -1243,6 +1243,7 @@ void
 context_actions_update (GimpActionGroup *group,
                         gpointer         data)
 {
+#if 0
   GimpContext *context   = action_data_get_context (data);
   gboolean     generated = FALSE;
   gdouble      radius    = 0.0;
@@ -1272,7 +1273,6 @@ context_actions_update (GimpActionGroup *group,
 #define SET_SENSITIVE(action,condition) \
         gimp_action_group_set_action_sensitive (group, "context-" action, (condition) != 0)
 
-#if 0
   SET_SENSITIVE ("brush-radius-minimum",       generated && radius > 1.0);
   SET_SENSITIVE ("brush-radius-decrease",      generated && radius > 1.0);
   SET_SENSITIVE ("brush-radius-decrease-skip", generated && radius > 1.0);
@@ -1288,7 +1288,7 @@ context_actions_update (GimpActionGroup *group,
   SET_SENSITIVE ("brush-angle-maximum",       generated);
   SET_SENSITIVE ("brush-angle-increase",      generated);
   SET_SENSITIVE ("brush-angle-increase-skip", generated);
-#endif
-
 #undef SET_SENSITIVE
+
+#endif
 }
diff --git a/app/display/gimpmotionbuffer.c b/app/display/gimpmotionbuffer.c
index ac59f5b..eea3f19 100644
--- a/app/display/gimpmotionbuffer.c
+++ b/app/display/gimpmotionbuffer.c
@@ -82,8 +82,6 @@ G_DEFINE_TYPE (GimpMotionBuffer, gimp_motion_buffer, GIMP_TYPE_OBJECT)
 
 static guint motion_buffer_signals[LAST_SIGNAL] = { 0 };
 
-static const GimpCoords default_coords = GIMP_COORDS_DEFAULT_VALUES;
-
 
 static void
 gimp_motion_buffer_class_init (GimpMotionBufferClass *klass)
diff --git a/libgimp/gimpdrawablepreview.c b/libgimp/gimpdrawablepreview.c
index a95f5d9..e8b8de6 100644
--- a/libgimp/gimpdrawablepreview.c
+++ b/libgimp/gimpdrawablepreview.c
@@ -23,6 +23,9 @@
 #include <gegl.h>
 #include <gtk/gtk.h>
 
+/* we use our own deprecated API here */
+#define GIMP_DISABLE_DEPRECATION_WARNINGS
+
 #include "libgimpwidgets/gimpwidgets.h"
 
 #include "gimpuitypes.h"
diff --git a/libgimp/gimpzoompreview.c b/libgimp/gimpzoompreview.c
index 8b68287..95e84fa 100644
--- a/libgimp/gimpzoompreview.c
+++ b/libgimp/gimpzoompreview.c
@@ -24,6 +24,9 @@
 #include <gegl.h>
 #include <gtk/gtk.h>
 
+/* we use our own deprecated API here */
+#define GIMP_DISABLE_DEPRECATION_WARNINGS
+
 #include "libgimpwidgets/gimpwidgets.h"
 
 #include "gimpuitypes.h"
diff --git a/libgimpmath/gimpvector.c b/libgimpmath/gimpvector.c
index fc65c96..d212a7c 100644
--- a/libgimpmath/gimpvector.c
+++ b/libgimpmath/gimpvector.c
@@ -48,13 +48,17 @@
 /*************************/
 
 static const GimpVector2 gimp_vector2_zero =   { 0.0, 0.0 };
+#if 0
 static const GimpVector2 gimp_vector2_unit_x = { 1.0, 0.0 };
 static const GimpVector2 gimp_vector2_unit_y = { 0.0, 1.0 };
+#endif
 
 static const GimpVector3 gimp_vector3_zero =   { 0.0, 0.0, 0.0 };
+#if 0
 static const GimpVector3 gimp_vector3_unit_x = { 1.0, 0.0, 0.0 };
 static const GimpVector3 gimp_vector3_unit_y = { 0.0, 1.0, 0.0 };
 static const GimpVector3 gimp_vector3_unit_z = { 0.0, 0.0, 1.0 };
+#endif
 
 /**************************************/
 /* Two   dimensional vector functions */
diff --git a/modules/display-filter-color-blind.c b/modules/display-filter-color-blind.c
index 5c73511..d66e8b4 100644
--- a/modules/display-filter-color-blind.c
+++ b/modules/display-filter-color-blind.c
@@ -132,30 +132,32 @@ static void        cdisplay_colorblind_set_deficiency  (CdisplayColorblind    *c
                                                         ColorblindDeficiency   value);
 
 
-  /* The RGB<->LMS transforms above are computed from the human cone
-   * photo-pigment absorption spectra and the monitor phosphor
-   * emission spectra. These parameters are fairly constant for most
-   * humans and most monitors (at least for modern CRTs). However,
-   * gamma will vary quite a bit, as it is a property of the monitor
-   * (eg. amplifier gain), the video card, and even the
-   * software. Further, users can adjust their gammas (either via
-   * adjusting the monitor amp gains or in software). That said, the
-   * following are the gamma estimates that we have used in the
-   * Vischeck code. Many colorblind users have viewed our simulations
-   * and told us that they "work" (simulated and original images are
-   * indistinguishable).
-   */
+/* The RGB<->LMS transforms above are computed from the human cone
+ * photo-pigment absorption spectra and the monitor phosphor
+ * emission spectra. These parameters are fairly constant for most
+ * humans and most monitors (at least for modern CRTs). However,
+ * gamma will vary quite a bit, as it is a property of the monitor
+ * (eg. amplifier gain), the video card, and even the
+ * software. Further, users can adjust their gammas (either via
+ * adjusting the monitor amp gains or in software). That said, the
+ * following are the gamma estimates that we have used in the
+ * Vischeck code. Many colorblind users have viewed our simulations
+ * and told us that they "work" (simulated and original images are
+ * indistinguishable).
+ */
 
+#if 0
+/* Gamma conversion is now handled by simply asking for a linear buffer */
 static const gfloat gammaRGB = 2.1;
-
-
-  /* For most modern Cathode-Ray Tube monitors (CRTs), the following
-   * are good estimates of the RGB->LMS and LMS->RGB transform
-   * matrices.  They are based on spectra measured on a typical CRT
-   * with a PhotoResearch PR650 spectral photometer and the Stockman
-   * human cone fundamentals. NOTE: these estimates will NOT work well
-   * for LCDs!
-   */
+#endif
+
+/* For most modern Cathode-Ray Tube monitors (CRTs), the following
+* are good estimates of the RGB->LMS and LMS->RGB transform
+* matrices.  They are based on spectra measured on a typical CRT
+* with a PhotoResearch PR650 spectral photometer and the Stockman
+* human cone fundamentals. NOTE: these estimates will NOT work well
+* for LCDs!
+*/
 static const gfloat rgb2lms[9] =
 {
   0.05059983,
diff --git a/plug-ins/common/file-dicom.c b/plug-ins/common/file-dicom.c
index 90cea8d..49c501f 100644
--- a/plug-ins/common/file-dicom.c
+++ b/plug-ins/common/file-dicom.c
@@ -381,7 +381,7 @@ load_image (const gchar  *filename,
       guint16  ctx_us;
       guint8  *value;
       guint32  tag;
-      gboolean do_toggle_endian = FALSE;
+      gboolean __attribute__((unused))do_toggle_endian = FALSE;
       gboolean implicit_encoding = FALSE;
 
       if (fread (&group_word, 1, 2, DICOM) == 0)
diff --git a/plug-ins/common/file-mng.c b/plug-ins/common/file-mng.c
index 5387427..21eb46b 100644
--- a/plug-ins/common/file-mng.c
+++ b/plug-ins/common/file-mng.c
@@ -824,9 +824,9 @@ mng_save_image (const gchar  *filename,
       const Babl     *layer_format;
       volatile gint   layer_bpp;
 
-      guint8          layer_mng_colortype;
-      guint8          layer_mng_compression_type;
-      guint8          layer_mng_interlace_type;
+      guint8          __attribute__((unused))layer_mng_colortype;
+      guint8          __attribute__((unused))layer_mng_compression_type;
+      guint8          __attribute__((unused))layer_mng_interlace_type;
       gboolean        layer_has_unique_palette;
 
       gchar           frame_mode;
diff --git a/plug-ins/common/file-psp.c b/plug-ins/common/file-psp.c
index 3c6168b..87a9762 100644
--- a/plug-ins/common/file-psp.c
+++ b/plug-ins/common/file-psp.c
@@ -854,7 +854,10 @@ read_creator_block (FILE     *f,
   gchar        *string;
   gchar        *title = NULL, *artist = NULL, *copyright = NULL, *description = NULL;
   guint32       dword;
-  guint32       cdate = 0, mdate = 0, appid, appver;
+  guint32       __attribute__((unused))cdate = 0;
+  guint32       __attribute__((unused))mdate = 0;
+  guint32       __attribute__((unused))appid;
+  guint32       __attribute__((unused))appver;
   GString      *comment;
   GimpParasite *comment_parasite;
 
diff --git a/plug-ins/common/file-sunras.c b/plug-ins/common/file-sunras.c
index 535d2db..c7f8cd8 100644
--- a/plug-ins/common/file-sunras.c
+++ b/plug-ins/common/file-sunras.c
@@ -450,7 +450,7 @@ load_image (const gchar  *filename,
       return -1;
     }
 
-  if ((sunhdr.l_ras_type < 0) || (sunhdr.l_ras_type > 5))
+  if (sunhdr.l_ras_type > 5)
     {
       g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                    "%s",
@@ -459,7 +459,7 @@ load_image (const gchar  *filename,
       return -1;
     }
 
-  if ((sunhdr.l_ras_maplength < 0) || (sunhdr.l_ras_maplength > (256 * 3)))
+  if (sunhdr.l_ras_maplength > (256 * 3))
     {
       g_message ("Map lengths greater than 256 entries are unsupported by GIMP.");
       gimp_quit ();
diff --git a/plug-ins/imagemap/imap_preview.c b/plug-ins/imagemap/imap_preview.c
index bb2e5b2..b0dafe8 100644
--- a/plug-ins/imagemap/imap_preview.c
+++ b/plug-ins/imagemap/imap_preview.c
@@ -22,10 +22,7 @@
 
 #include "config.h"
 
-#include <gtk/gtk.h>
-
-#include "libgimp/gimp.h"
-
+#include <libgimp/gimp.h>
 #include <libgimp/gimpui.h>
 
 #include "imap_commands.h"
diff --git a/plug-ins/imagemap/imap_table.c b/plug-ins/imagemap/imap_table.c
index 25dc182..f564926 100644
--- a/plug-ins/imagemap/imap_table.c
+++ b/plug-ins/imagemap/imap_table.c
@@ -22,7 +22,8 @@
 
 #include "config.h"
 
-#include <gtk/gtk.h>
+#include <libgimp/gimp.h>
+#include <libgimp/gimpui.h>
 
 #include "imap_table.h"
 
diff --git a/plug-ins/lighting/lighting-ui.c b/plug-ins/lighting/lighting-ui.c
index b75b176..8cfa45b 100644
--- a/plug-ins/lighting/lighting-ui.c
+++ b/plug-ins/lighting/lighting-ui.c
@@ -90,6 +90,15 @@ static void     apply_settings        (GtkWidget       *widget,
 static void     isolate_selected_light (GtkWidget      *widget,
                                         gpointer        data);
 
+static GtkWidget * spin_button_new     (GtkAdjustment **adjustment,  /* return value */
+                                        gdouble         value,
+                                        gdouble         lower,
+                                        gdouble         upper,
+                                        gdouble         step_increment,
+                                        gdouble         page_increment,
+                                        gdouble         page_size,
+                                        gdouble         climb_rate,
+                                        guint           digits);
 
 /**********************/
 /* Std. toggle update */
@@ -282,12 +291,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);
@@ -343,7 +352,8 @@ create_options_page (void)
   gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 12);
   gtk_widget_show (table);
 
-  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
+  adj = (GtkAdjustment *)
+        gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
                               _("Distance:"), 100, 6,
                               mapvals.viewpoint.z,
                               0.0, 2.0, 0.01, 0.05,
@@ -366,13 +376,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);
@@ -450,10 +460,10 @@ create_light_page (void)
                            _("Set light source color"), NULL);
 
 
-  spin_intensity = gimp_spin_button_new (&adj,
-                                         mapvals.lightsource[k].intensity,
-                                         0.0, 100.0,
-                                         0.01, 0.1, 0.0, 0.0, 2);
+  spin_intensity = spin_button_new (&adj,
+                                    mapvals.lightsource[k].intensity,
+                                    0.0, 100.0,
+                                    0.01, 0.1, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
                                  _("_Intensity:"), 0.0, 0.5,
                                  spin_intensity, 1, TRUE);
@@ -471,10 +481,10 @@ create_light_page (void)
   gtk_table_attach_defaults (GTK_TABLE (table), label, 3, 4, 0, 1);
   gtk_widget_show (label);
 
-  spin_pos_x = gimp_spin_button_new (&adj,
-                                     mapvals.lightsource[k].position.x,
-                                     -100.0, 100.0,
-                                     0.1, 1.0, 0.0, 0.0, 2);
+  spin_pos_x = spin_button_new (&adj,
+                                mapvals.lightsource[k].position.x,
+                                -100.0, 100.0,
+                                0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 2, 1,
                                  _("_X:"), 0.0, 0.5,
                                  spin_pos_x, 1, TRUE);
@@ -486,10 +496,10 @@ create_light_page (void)
   gimp_help_set_help_data (spin_pos_x,
                            _("Light source X position in XYZ space"), NULL);
 
-  spin_pos_y = gimp_spin_button_new (&adj,
-                                     mapvals.lightsource[k].position.y,
-                                     -100.0, 100.0,
-                                     0.1, 1.0, 0.0, 0.0, 2);
+  spin_pos_y = spin_button_new (&adj,
+                                mapvals.lightsource[k].position.y,
+                                -100.0, 100.0,
+                                0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 2, 2,
                              _("_Y:"), 0.0, 0.5,
                              spin_pos_y, 1, TRUE);
@@ -501,10 +511,10 @@ create_light_page (void)
   gimp_help_set_help_data (spin_pos_y,
                            _("Light source Y position in XYZ space"), NULL);
 
-  spin_pos_z = gimp_spin_button_new (&adj,
-                                     mapvals.lightsource[k].position.z,
-                                     -100.0, 100.0,
-                                     0.1, 1.0, 0.0, 0.0, 2);
+  spin_pos_z = spin_button_new (&adj,
+                                mapvals.lightsource[k].position.z,
+                                -100.0, 100.0,
+                                0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 2, 3,
                              _("_Z:"), 0.0, 0.5,
                              spin_pos_z, 1, TRUE);
@@ -522,9 +532,9 @@ create_light_page (void)
   gtk_table_attach_defaults (GTK_TABLE (table), label, 5, 6, 0, 1);
   gtk_widget_show (label);
 
-  spin_dir_x = gimp_spin_button_new (&adj,
-                                     mapvals.lightsource[k].direction.x,
-                                     -100.0, 100.0, 0.1, 1.0, 0.0, 0.0, 2);
+  spin_dir_x = spin_button_new (&adj,
+                                mapvals.lightsource[k].direction.x,
+                                -100.0, 100.0, 0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 4, 1,
                              _("X:"), 0.0, 0.5,
                              spin_dir_x, 1, TRUE);
@@ -536,9 +546,9 @@ create_light_page (void)
   gimp_help_set_help_data (spin_dir_x,
                            _("Light source X direction in XYZ space"), NULL);
 
-  spin_dir_y = gimp_spin_button_new (&adj,
-                                     mapvals.lightsource[k].direction.y,
-                                     -100.0, 100.0, 0.1, 1.0, 0.0, 0.0, 2);
+  spin_dir_y = spin_button_new (&adj,
+                                mapvals.lightsource[k].direction.y,
+                                -100.0, 100.0, 0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 4, 2,
                              _("Y:"), 0.0, 0.5,
                                  spin_dir_y, 1, TRUE);
@@ -550,9 +560,9 @@ create_light_page (void)
   gimp_help_set_help_data (spin_dir_y,
                            _("Light source Y direction in XYZ space"), NULL);
 
-  spin_dir_z = gimp_spin_button_new (&adj,
-                                     mapvals.lightsource[k].direction.z,
-                                     -100.0, 100.0, 0.1, 1.0, 0.0, 0.0, 2);
+  spin_dir_z = spin_button_new (&adj,
+                                mapvals.lightsource[k].direction.z,
+                                -100.0, 100.0, 0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 4, 3,
                              _("Z:"), 0.0, 0.5,
                              spin_dir_z, 1, TRUE);
@@ -606,16 +616,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);
@@ -642,8 +652,8 @@ create_material_page (void)
                                      image, 1, FALSE);
   gtk_size_group_add_widget (group, label);
 
-  spinbutton = gimp_spin_button_new (&adj, mapvals.material.ambient_int,
-                                     0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&adj, mapvals.material.ambient_int,
+                                0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 0, 1,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -675,8 +685,8 @@ create_material_page (void)
                                      image, 1, FALSE);
   gtk_size_group_add_widget (group, label);
 
-  spinbutton = gimp_spin_button_new (&adj, mapvals.material.diffuse_int,
-                                     0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&adj, mapvals.material.diffuse_int,
+                                0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 1, 2,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -708,8 +718,8 @@ create_material_page (void)
                                      image, 1, FALSE);
   gtk_size_group_add_widget (group, label);
 
-  spinbutton = gimp_spin_button_new (&adj, mapvals.material.specular_ref,
-                                     0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&adj, mapvals.material.specular_ref,
+                                0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 2, 3,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -740,8 +750,8 @@ create_material_page (void)
                                      image, 1, FALSE);
   gtk_size_group_add_widget (group, label);
 
-  spinbutton = gimp_spin_button_new (&adj, mapvals.material.highlight,
-                                     0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&adj, mapvals.material.highlight,
+                                0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 3, 4,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -787,13 +797,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);
@@ -857,8 +867,8 @@ create_bump_page (void)
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
                              _("Cu_rve:"), 0.0, 0.5, combo, 1, FALSE);
 
-  spinbutton = gimp_spin_button_new (&adj, mapvals.bumpmax,
-                                     0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&adj, mapvals.bumpmax,
+                                0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
                              _("Ma_ximum height:"), 0.0, 0.5,
                              spinbutton, 1, TRUE);
@@ -1520,3 +1530,28 @@ isolate_selected_light (GtkWidget *widget,
 
   interactive_preview_callback (NULL);
 }
+
+static GtkWidget *
+spin_button_new (GtkAdjustment **adjustment,  /* return value */
+                 gdouble         value,
+                 gdouble         lower,
+                 gdouble         upper,
+                 gdouble         step_increment,
+                 gdouble         page_increment,
+                 gdouble         page_size,
+                 gdouble         climb_rate,
+                 guint           digits)
+{
+  GtkWidget *spinbutton;
+
+  *adjustment = (GtkAdjustment *)
+                gtk_adjustment_new (value, lower, upper,
+                                    step_increment, page_increment, 0);
+
+  spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (*adjustment),
+                                    climb_rate, digits);
+
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
+
+  return spinbutton;
+}
diff --git a/plug-ins/map-object/map-object-ui.c b/plug-ins/map-object/map-object-ui.c
index 14db832..38a6920 100644
--- a/plug-ins/map-object/map-object-ui.c
+++ b/plug-ins/map-object/map-object-ui.c
@@ -26,7 +26,7 @@ static GtkNotebook *options_note_book = NULL;
 static GtkWidget *pointlightwid;
 static GtkWidget *dirlightwid;
 
-static GtkObject *xadj, *yadj, *zadj;
+static GtkAdjustment *xadj, *yadj, *zadj;
 
 static GtkWidget *box_page      = NULL;
 static GtkWidget *cylinder_page = NULL;
@@ -299,7 +299,7 @@ static gint
 preview_events (GtkWidget *area,
                 GdkEvent  *event)
 {
-  HVect pos;
+  HVect __attribute__((unused))pos;
 /*  HMatrix RotMat;
   gdouble a,b,c; */
 
@@ -358,7 +358,7 @@ preview_events (GtkWidget *area,
               }
             else
               {
-                    pos.x = -(2.0 * (gdouble) event->motion.x /
+                pos.x = -(2.0 * (gdouble) event->motion.x /
                           (gdouble) PREVIEW_WIDTH - 1.0);
                 pos.y = (2.0 * (gdouble) event->motion.y /
                          (gdouble) PREVIEW_HEIGHT - 1.0);
@@ -386,6 +386,32 @@ preview_events (GtkWidget *area,
   return FALSE;
 }
 
+
+static GtkWidget *
+spin_button_new (GtkAdjustment **adjustment,  /* return value */
+                 gdouble         value,
+                 gdouble         lower,
+                 gdouble         upper,
+                 gdouble         step_increment,
+                 gdouble         page_increment,
+                 gdouble         page_size,
+                 gdouble         climb_rate,
+                 guint           digits)
+{
+  GtkWidget *spinbutton;
+
+  *adjustment = (GtkAdjustment *)
+                gtk_adjustment_new (value, lower, upper,
+                                    step_increment, page_increment, 0);
+
+  spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (*adjustment),
+                                    climb_rate, digits);
+
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
+
+  return spinbutton;
+}
+
 /*******************************/
 /* Create general options page */
 /*******************************/
@@ -393,16 +419,16 @@ preview_events (GtkWidget *area,
 static GtkWidget *
 create_options_page (void)
 {
-  GtkWidget *page;
-  GtkWidget *frame;
-  GtkWidget *vbox;
-  GtkWidget *hbox;
-  GtkWidget *label;
-  GtkWidget *combo;
-  GtkWidget *toggle;
-  GtkWidget *table;
-  GtkWidget *spinbutton;
-  GtkObject *adj;
+  GtkWidget     *page;
+  GtkWidget     *frame;
+  GtkWidget     *vbox;
+  GtkWidget     *hbox;
+  GtkWidget     *label;
+  GtkWidget     *combo;
+  GtkWidget     *toggle;
+  GtkWidget     *table;
+  GtkWidget     *spinbutton;
+  GtkAdjustment *adj;
 
   page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
   gtk_container_set_border_width (GTK_CONTAINER (page), 12);
@@ -523,7 +549,8 @@ create_options_page (void)
                           table,  "sensitive",
                           G_BINDING_SYNC_CREATE);
 
-  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
+  adj = (GtkAdjustment *)
+        gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
                               _("_Depth:"), 0, 0,
                               mapvals.maxdepth, 1.0, 5.0, 0.1, 1.0,
                               1, TRUE, 0, 0,
@@ -533,8 +560,8 @@ create_options_page (void)
                     G_CALLBACK (gimp_double_adjustment_update),
                     &mapvals.maxdepth);
 
-  spinbutton = gimp_spin_button_new (&adj, mapvals.pixeltreshold,
-                                     0.001, 1000, 0.1, 1, 0, 0, 3);
+  spinbutton = spin_button_new (&adj, mapvals.pixeltreshold,
+                                0.001, 1000, 0.1, 1, 0, 0, 3);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
                              _("_Threshold:"), 0.0, 0.5,
                              spinbutton, 1, TRUE);
@@ -559,13 +586,13 @@ create_options_page (void)
 static GtkWidget *
 create_light_page (void)
 {
-  GtkWidget *page;
-  GtkWidget *frame;
-  GtkWidget *table;
-  GtkWidget *combo;
-  GtkWidget *colorbutton;
-  GtkWidget *spinbutton;
-  GtkObject *adj;
+  GtkWidget     *page;
+  GtkWidget     *frame;
+  GtkWidget     *table;
+  GtkWidget     *combo;
+  GtkWidget     *colorbutton;
+  GtkWidget     *spinbutton;
+  GtkAdjustment *adj;
 
   page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
   gtk_container_set_border_width (GTK_CONTAINER (page), 12);
@@ -622,9 +649,9 @@ create_light_page (void)
   gtk_container_add (GTK_CONTAINER (pointlightwid), table);
   gtk_widget_show (table);
 
-  spinbutton = gimp_spin_button_new (&xadj, mapvals.lightsource.position.x,
-                                     -G_MAXFLOAT, G_MAXFLOAT,
-                                     0.1, 1.0, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&xadj, mapvals.lightsource.position.x,
+                                -G_MAXFLOAT, G_MAXFLOAT,
+                                0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
                              _("X:"), 0.0, 0.5,
                              spinbutton, 1, TRUE);
@@ -636,9 +663,9 @@ create_light_page (void)
   gimp_help_set_help_data (spinbutton,
                            _("Light source X position in XYZ space"), NULL);
 
-  spinbutton = gimp_spin_button_new (&yadj, mapvals.lightsource.position.y,
-                                     -G_MAXFLOAT, G_MAXFLOAT,
-                                     0.1, 1.0, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&yadj, mapvals.lightsource.position.y,
+                                -G_MAXFLOAT, G_MAXFLOAT,
+                                0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
                              _("Y:"), 0.0, 0.5,
                              spinbutton, 1, TRUE);
@@ -650,9 +677,9 @@ create_light_page (void)
   gimp_help_set_help_data (spinbutton,
                            _("Light source Y position in XYZ space"), NULL);
 
-  spinbutton = gimp_spin_button_new (&zadj, mapvals.lightsource.position.z,
-                                     -G_MAXFLOAT, G_MAXFLOAT,
-                                     0.1, 1.0, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&zadj, mapvals.lightsource.position.z,
+                                -G_MAXFLOAT, G_MAXFLOAT,
+                                0.1, 1.0, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
                              _("Z:"), 0.0, 0.5,
                              spinbutton, 1, TRUE);
@@ -677,8 +704,8 @@ create_light_page (void)
   gtk_container_add (GTK_CONTAINER (dirlightwid), table);
   gtk_widget_show (table);
 
-  spinbutton = gimp_spin_button_new (&adj, mapvals.lightsource.direction.x,
-                                     -1.0, 1.0, 0.01, 0.1, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&adj, mapvals.lightsource.direction.x,
+                                -1.0, 1.0, 0.01, 0.1, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
                              _("X:"), 0.0, 0.5,
                              spinbutton, 1, TRUE);
@@ -690,8 +717,8 @@ create_light_page (void)
   gimp_help_set_help_data (spinbutton,
                            _("Light source X direction in XYZ space"), NULL);
 
-  spinbutton = gimp_spin_button_new (&adj, mapvals.lightsource.direction.y,
-                                     -1.0, 1.0, 0.01, 0.1, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&adj, mapvals.lightsource.direction.y,
+                                -1.0, 1.0, 0.01, 0.1, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
                              _("Y:"), 0.0, 0.5,
                              spinbutton, 1, TRUE);
@@ -703,8 +730,8 @@ create_light_page (void)
   gimp_help_set_help_data (spinbutton,
                            _("Light source Y direction in XYZ space"), NULL);
 
-  spinbutton = gimp_spin_button_new (&adj, mapvals.lightsource.direction.z,
-                                     -1.0, 1.0, 0.01, 0.1, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&adj, mapvals.lightsource.direction.z,
+                                -1.0, 1.0, 0.01, 0.1, 0.0, 0.0, 2);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
                              _("Z:"), 0.0, 0.5,
                              spinbutton, 1, TRUE);
@@ -728,15 +755,15 @@ 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;
-  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;
+  GtkAdjustment *adj;
 
   page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
   gtk_container_set_border_width (GTK_CONTAINER (page), 12);
@@ -764,8 +791,8 @@ create_material_page (void)
                                      image, 1, FALSE);
   gtk_size_group_add_widget (group, label);
 
-  spinbutton = gimp_spin_button_new (&adj, mapvals.material.ambient_int,
-                                     0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&adj, mapvals.material.ambient_int,
+                                0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 0, 1,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -793,8 +820,8 @@ create_material_page (void)
                                      image, 1, FALSE);
   gtk_size_group_add_widget (group, label);
 
-  spinbutton = gimp_spin_button_new (&adj, mapvals.material.diffuse_int,
-                                     0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&adj, mapvals.material.diffuse_int,
+                                0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 1, 2,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -836,8 +863,8 @@ create_material_page (void)
                                      image, 1, FALSE);
   gtk_size_group_add_widget (group, label);
 
-  spinbutton = gimp_spin_button_new (&adj, mapvals.material.diffuse_ref,
-                                     0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&adj, mapvals.material.diffuse_ref,
+                                0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 0, 1,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -865,8 +892,8 @@ create_material_page (void)
                                      image, 1, FALSE);
   gtk_size_group_add_widget (group, label);
 
-  spinbutton = gimp_spin_button_new (&adj, mapvals.material.specular_ref,
-                                     0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&adj, mapvals.material.specular_ref,
+                                0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 1, 2,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -894,8 +921,8 @@ create_material_page (void)
                                      image, 1, FALSE);
   gtk_size_group_add_widget (group, label);
 
-  spinbutton = gimp_spin_button_new (&adj, mapvals.material.highlight,
-                                     0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
+  spinbutton = spin_button_new (&adj, mapvals.material.highlight,
+                                0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 2, 3,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (spinbutton);
@@ -928,11 +955,11 @@ create_material_page (void)
 static GtkWidget *
 create_orientation_page (void)
 {
-  GtkSizeGroup *group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-  GtkWidget    *page;
-  GtkWidget    *frame;
-  GtkWidget    *table;
-  GtkObject    *adj;
+  GtkSizeGroup  *group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+  GtkWidget     *page;
+  GtkWidget     *frame;
+  GtkWidget     *table;
+  GtkAdjustment *adj;
 
   page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
   gtk_container_set_border_width (GTK_CONTAINER (page), 12);
@@ -947,7 +974,8 @@ create_orientation_page (void)
   gtk_container_add (GTK_CONTAINER (frame), table);
   gtk_widget_show (table);
 
-  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
+  adj = (GtkAdjustment *)
+        gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
                               _("X:"), 0, 0,
                               mapvals.position.x, -1.0, 2.0, 0.01, 0.1, 5,
                               TRUE, 0, 0,
@@ -960,7 +988,8 @@ create_orientation_page (void)
                     G_CALLBACK (double_adjustment_update),
                     &mapvals.position.x);
 
-  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
+  adj = (GtkAdjustment *)
+        gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
                               _("Y:"), 0, 0,
                               mapvals.position.y, -1.0, 2.0, 0.01, 0.1, 5,
                               TRUE, 0, 0,
@@ -973,7 +1002,8 @@ create_orientation_page (void)
                     G_CALLBACK (double_adjustment_update),
                     &mapvals.position.y);
 
-  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
+  adj = (GtkAdjustment *)
+        gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
                               _("Z:"), 0, 0,
                               mapvals.position.z, -1.0, 2.0, 0.01, 0.1, 5,
                               TRUE, 0, 0,
@@ -996,7 +1026,8 @@ create_orientation_page (void)
   gtk_container_add (GTK_CONTAINER (frame), table);
   gtk_widget_show (table);
 
-  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
+  adj = (GtkAdjustment *)
+        gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
                               _("X:"), 0, 0,
                               mapvals.alpha, -180.0, 180.0, 1.0, 15.0, 1,
                               TRUE, 0, 0,
@@ -1007,7 +1038,8 @@ create_orientation_page (void)
                     G_CALLBACK (double_adjustment_update),
                     &mapvals.alpha);
 
-  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
+  adj = (GtkAdjustment *)
+        gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
                               _("Y:"), 0, 0,
                               mapvals.beta, -180.0, 180.0, 1.0, 15.0, 1,
                               TRUE, 0, 0,
@@ -1018,7 +1050,8 @@ create_orientation_page (void)
                     G_CALLBACK (double_adjustment_update),
                     &mapvals.beta);
 
-  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
+  adj = (GtkAdjustment *)
+        gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
                               _("Z:"), 0, 0,
                               mapvals.gamma, -180.0, 180.0, 1.0, 15.0, 1,
                               TRUE, 0, 0,
@@ -1039,12 +1072,12 @@ create_orientation_page (void)
 static GtkWidget *
 create_box_page (void)
 {
-  GtkWidget *page;
-  GtkWidget *frame;
-  GtkWidget *vbox;
-  GtkWidget *table;
-  GtkObject *adj;
-  gint       i;
+  GtkWidget     *page;
+  GtkWidget     *frame;
+  GtkWidget     *vbox;
+  GtkWidget     *table;
+  GtkAdjustment *adj;
+  gint           i;
 
   static gchar *labels[] =
   {
@@ -1093,7 +1126,8 @@ create_box_page (void)
   gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
   gtk_widget_show (table);
 
-  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
+  adj = (GtkAdjustment *)
+        gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
                               _("Scale X:"), 0, 0,
                               mapvals.scale.x, 0.0, 5.0, 0.01, 0.1, 2,
                               TRUE, 0, 0,
@@ -1105,7 +1139,8 @@ create_box_page (void)
                     G_CALLBACK (double_adjustment_update),
                     &mapvals.scale.x);
 
-  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
+  adj = (GtkAdjustment *)
+        gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
                               _("Y:"), 0, 0,
                               mapvals.scale.y, 0.0, 5.0, 0.01, 0.1, 2,
                               TRUE, 0, 0,
@@ -1117,7 +1152,8 @@ create_box_page (void)
                     G_CALLBACK (double_adjustment_update),
                     &mapvals.scale.y);
 
-  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
+  adj = (GtkAdjustment *)
+        gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
                               _("Z:"), 0, 0,
                               mapvals.scale.z, 0.0, 5.0, 0.01, 0.1, 2,
                               TRUE, 0, 0,
@@ -1137,12 +1173,12 @@ create_box_page (void)
 static GtkWidget *
 create_cylinder_page (void)
 {
-  GtkSizeGroup *group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-  GtkWidget    *page;
-  GtkWidget    *frame;
-  GtkWidget    *table;
-  GtkObject    *adj;
-  gint          i;
+  GtkSizeGroup  *group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+  GtkWidget     *page;
+  GtkWidget     *frame;
+  GtkWidget     *table;
+  GtkAdjustment *adj;
+  gint           i;
 
   static const gchar *labels[] = { N_("_Top:"), N_("_Bottom:") };
 
@@ -1188,7 +1224,8 @@ create_cylinder_page (void)
   gtk_container_add (GTK_CONTAINER (frame), table);
   gtk_widget_show (table);
 
-  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
+  adj = (GtkAdjustment *)
+        gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
                               _("R_adius:"), 0, 0,
                               mapvals.cylinder_radius,
                               0.0, 2.0, 0.01, 0.1, 2,
@@ -1202,7 +1239,8 @@ create_cylinder_page (void)
                     G_CALLBACK (double_adjustment_update),
                     &mapvals.cylinder_radius);
 
-  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
+  adj = (GtkAdjustment *)
+        gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
                               _("L_ength:"), 0, 0,
                               mapvals.cylinder_length,
                               0.0, 2.0, 0.01, 0.1, 2,



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