Commit f5ecc53f authored by Michael Natterer's avatar Michael Natterer

Fix a lot of warnings all over the place

Deprecated stuff, unused variables. Includes parts of a patch from
Shlomi Fish from bug #768855.
parent 44aedebb
...@@ -1243,6 +1243,7 @@ void ...@@ -1243,6 +1243,7 @@ void
context_actions_update (GimpActionGroup *group, context_actions_update (GimpActionGroup *group,
gpointer data) gpointer data)
{ {
#if 0
GimpContext *context = action_data_get_context (data); GimpContext *context = action_data_get_context (data);
gboolean generated = FALSE; gboolean generated = FALSE;
gdouble radius = 0.0; gdouble radius = 0.0;
...@@ -1272,7 +1273,6 @@ context_actions_update (GimpActionGroup *group, ...@@ -1272,7 +1273,6 @@ context_actions_update (GimpActionGroup *group,
#define SET_SENSITIVE(action,condition) \ #define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, "context-" action, (condition) != 0) 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-minimum", generated && radius > 1.0);
SET_SENSITIVE ("brush-radius-decrease", generated && radius > 1.0); SET_SENSITIVE ("brush-radius-decrease", generated && radius > 1.0);
SET_SENSITIVE ("brush-radius-decrease-skip", generated && radius > 1.0); SET_SENSITIVE ("brush-radius-decrease-skip", generated && radius > 1.0);
...@@ -1288,7 +1288,7 @@ context_actions_update (GimpActionGroup *group, ...@@ -1288,7 +1288,7 @@ context_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("brush-angle-maximum", generated); SET_SENSITIVE ("brush-angle-maximum", generated);
SET_SENSITIVE ("brush-angle-increase", generated); SET_SENSITIVE ("brush-angle-increase", generated);
SET_SENSITIVE ("brush-angle-increase-skip", generated); SET_SENSITIVE ("brush-angle-increase-skip", generated);
#endif
#undef SET_SENSITIVE #undef SET_SENSITIVE
#endif
} }
...@@ -82,8 +82,6 @@ G_DEFINE_TYPE (GimpMotionBuffer, gimp_motion_buffer, GIMP_TYPE_OBJECT) ...@@ -82,8 +82,6 @@ G_DEFINE_TYPE (GimpMotionBuffer, gimp_motion_buffer, GIMP_TYPE_OBJECT)
static guint motion_buffer_signals[LAST_SIGNAL] = { 0 }; static guint motion_buffer_signals[LAST_SIGNAL] = { 0 };
static const GimpCoords default_coords = GIMP_COORDS_DEFAULT_VALUES;
static void static void
gimp_motion_buffer_class_init (GimpMotionBufferClass *klass) gimp_motion_buffer_class_init (GimpMotionBufferClass *klass)
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
#include <gegl.h> #include <gegl.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
/* we use our own deprecated API here */
#define GIMP_DISABLE_DEPRECATION_WARNINGS
#include "libgimpwidgets/gimpwidgets.h" #include "libgimpwidgets/gimpwidgets.h"
#include "gimpuitypes.h" #include "gimpuitypes.h"
......
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
#include <gegl.h> #include <gegl.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
/* we use our own deprecated API here */
#define GIMP_DISABLE_DEPRECATION_WARNINGS
#include "libgimpwidgets/gimpwidgets.h" #include "libgimpwidgets/gimpwidgets.h"
#include "gimpuitypes.h" #include "gimpuitypes.h"
......
...@@ -48,13 +48,17 @@ ...@@ -48,13 +48,17 @@
/*************************/ /*************************/
static const GimpVector2 gimp_vector2_zero = { 0.0, 0.0 }; 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_x = { 1.0, 0.0 };
static const GimpVector2 gimp_vector2_unit_y = { 0.0, 1.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 }; 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_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_y = { 0.0, 1.0, 0.0 };
static const GimpVector3 gimp_vector3_unit_z = { 0.0, 0.0, 1.0 }; static const GimpVector3 gimp_vector3_unit_z = { 0.0, 0.0, 1.0 };
#endif
/**************************************/ /**************************************/
/* Two dimensional vector functions */ /* Two dimensional vector functions */
......
...@@ -132,30 +132,32 @@ static void cdisplay_colorblind_set_deficiency (CdisplayColorblind *c ...@@ -132,30 +132,32 @@ static void cdisplay_colorblind_set_deficiency (CdisplayColorblind *c
ColorblindDeficiency value); ColorblindDeficiency value);
/* The RGB<->LMS transforms above are computed from the human cone /* The RGB<->LMS transforms above are computed from the human cone
* photo-pigment absorption spectra and the monitor phosphor * photo-pigment absorption spectra and the monitor phosphor
* emission spectra. These parameters are fairly constant for most * emission spectra. These parameters are fairly constant for most
* humans and most monitors (at least for modern CRTs). However, * humans and most monitors (at least for modern CRTs). However,
* gamma will vary quite a bit, as it is a property of the monitor * gamma will vary quite a bit, as it is a property of the monitor
* (eg. amplifier gain), the video card, and even the * (eg. amplifier gain), the video card, and even the
* software. Further, users can adjust their gammas (either via * software. Further, users can adjust their gammas (either via
* adjusting the monitor amp gains or in software). That said, the * adjusting the monitor amp gains or in software). That said, the
* following are the gamma estimates that we have used in the * following are the gamma estimates that we have used in the
* Vischeck code. Many colorblind users have viewed our simulations * Vischeck code. Many colorblind users have viewed our simulations
* and told us that they "work" (simulated and original images are * and told us that they "work" (simulated and original images are
* indistinguishable). * indistinguishable).
*/ */
#if 0
/* Gamma conversion is now handled by simply asking for a linear buffer */
static const gfloat gammaRGB = 2.1; static const gfloat gammaRGB = 2.1;
#endif
/* For most modern Cathode-Ray Tube monitors (CRTs), the following /* For most modern Cathode-Ray Tube monitors (CRTs), the following
* are good estimates of the RGB->LMS and LMS->RGB transform * are good estimates of the RGB->LMS and LMS->RGB transform
* matrices. They are based on spectra measured on a typical CRT * matrices. They are based on spectra measured on a typical CRT
* with a PhotoResearch PR650 spectral photometer and the Stockman * with a PhotoResearch PR650 spectral photometer and the Stockman
* human cone fundamentals. NOTE: these estimates will NOT work well * human cone fundamentals. NOTE: these estimates will NOT work well
* for LCDs! * for LCDs!
*/ */
static const gfloat rgb2lms[9] = static const gfloat rgb2lms[9] =
{ {
0.05059983, 0.05059983,
......
...@@ -381,7 +381,7 @@ load_image (const gchar *filename, ...@@ -381,7 +381,7 @@ load_image (const gchar *filename,
guint16 ctx_us; guint16 ctx_us;
guint8 *value; guint8 *value;
guint32 tag; guint32 tag;
gboolean do_toggle_endian = FALSE; gboolean __attribute__((unused))do_toggle_endian = FALSE;
gboolean implicit_encoding = FALSE; gboolean implicit_encoding = FALSE;
if (fread (&group_word, 1, 2, DICOM) == 0) if (fread (&group_word, 1, 2, DICOM) == 0)
......
...@@ -824,9 +824,9 @@ mng_save_image (const gchar *filename, ...@@ -824,9 +824,9 @@ mng_save_image (const gchar *filename,
const Babl *layer_format; const Babl *layer_format;
volatile gint layer_bpp; volatile gint layer_bpp;
guint8 layer_mng_colortype; guint8 __attribute__((unused))layer_mng_colortype;
guint8 layer_mng_compression_type; guint8 __attribute__((unused))layer_mng_compression_type;
guint8 layer_mng_interlace_type; guint8 __attribute__((unused))layer_mng_interlace_type;
gboolean layer_has_unique_palette; gboolean layer_has_unique_palette;
gchar frame_mode; gchar frame_mode;
......
...@@ -854,7 +854,10 @@ read_creator_block (FILE *f, ...@@ -854,7 +854,10 @@ read_creator_block (FILE *f,
gchar *string; gchar *string;
gchar *title = NULL, *artist = NULL, *copyright = NULL, *description = NULL; gchar *title = NULL, *artist = NULL, *copyright = NULL, *description = NULL;
guint32 dword; 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; GString *comment;
GimpParasite *comment_parasite; GimpParasite *comment_parasite;
......
...@@ -450,7 +450,7 @@ load_image (const gchar *filename, ...@@ -450,7 +450,7 @@ load_image (const gchar *filename,
return -1; 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, g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
"%s", "%s",
...@@ -459,7 +459,7 @@ load_image (const gchar *filename, ...@@ -459,7 +459,7 @@ load_image (const gchar *filename,
return -1; 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."); g_message ("Map lengths greater than 256 entries are unsupported by GIMP.");
gimp_quit (); gimp_quit ();
......
...@@ -22,10 +22,7 @@ ...@@ -22,10 +22,7 @@
#include "config.h" #include "config.h"
#include <gtk/gtk.h> #include <libgimp/gimp.h>
#include "libgimp/gimp.h"
#include <libgimp/gimpui.h> #include <libgimp/gimpui.h>
#include "imap_commands.h" #include "imap_commands.h"
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
#include "config.h" #include "config.h"
#include <gtk/gtk.h> #include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "imap_table.h" #include "imap_table.h"
......
...@@ -90,6 +90,15 @@ static void apply_settings (GtkWidget *widget, ...@@ -90,6 +90,15 @@ static void apply_settings (GtkWidget *widget,
static void isolate_selected_light (GtkWidget *widget, static void isolate_selected_light (GtkWidget *widget,
gpointer data); 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 */ /* Std. toggle update */
...@@ -282,12 +291,12 @@ envmap_combo_callback (GtkWidget *widget, ...@@ -282,12 +291,12 @@ envmap_combo_callback (GtkWidget *widget,
static GtkWidget * static GtkWidget *
create_options_page (void) create_options_page (void)
{ {
GtkWidget *page; GtkWidget *page;
GtkWidget *frame; GtkWidget *frame;
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *toggle; GtkWidget *toggle;
GtkWidget *table; GtkWidget *table;
GtkObject *adj; GtkAdjustment *adj;
page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (page), 12); gtk_container_set_border_width (GTK_CONTAINER (page), 12);
...@@ -343,7 +352,8 @@ create_options_page (void) ...@@ -343,7 +352,8 @@ create_options_page (void)
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 12); gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 12);
gtk_widget_show (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,
_("Distance:"), 100, 6, _("Distance:"), 100, 6,
mapvals.viewpoint.z, mapvals.viewpoint.z,
0.0, 2.0, 0.01, 0.05, 0.0, 2.0, 0.01, 0.05,
...@@ -366,13 +376,13 @@ create_options_page (void) ...@@ -366,13 +376,13 @@ create_options_page (void)
static GtkWidget * static GtkWidget *
create_light_page (void) create_light_page (void)
{ {
GtkWidget *page; GtkWidget *page;
GtkWidget *frame; GtkWidget *frame;
GtkWidget *table; GtkWidget *table;
GtkWidget *button; GtkWidget *button;
GtkObject *adj; GtkAdjustment *adj;
GtkWidget *label; GtkWidget *label;
gint k = mapvals.light_selected; gint k = mapvals.light_selected;
page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (page), 12); gtk_container_set_border_width (GTK_CONTAINER (page), 12);
...@@ -450,10 +460,10 @@ create_light_page (void) ...@@ -450,10 +460,10 @@ create_light_page (void)
_("Set light source color"), NULL); _("Set light source color"), NULL);
spin_intensity = gimp_spin_button_new (&adj, spin_intensity = spin_button_new (&adj,
mapvals.lightsource[k].intensity, mapvals.lightsource[k].intensity,
0.0, 100.0, 0.0, 100.0,
0.01, 0.1, 0.0, 0.0, 2); 0.01, 0.1, 0.0, 0.0, 2);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3, gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
_("_Intensity:"), 0.0, 0.5, _("_Intensity:"), 0.0, 0.5,
spin_intensity, 1, TRUE); spin_intensity, 1, TRUE);
...@@ -471,10 +481,10 @@ create_light_page (void) ...@@ -471,10 +481,10 @@ create_light_page (void)
gtk_table_attach_defaults (GTK_TABLE (table), label, 3, 4, 0, 1); gtk_table_attach_defaults (GTK_TABLE (table), label, 3, 4, 0, 1);
gtk_widget_show (label); gtk_widget_show (label);
spin_pos_x = gimp_spin_button_new (&adj, spin_pos_x = spin_button_new (&adj,
mapvals.lightsource[k].position.x, mapvals.lightsource[k].position.x,
-100.0, 100.0, -100.0, 100.0,
0.1, 1.0, 0.0, 0.0, 2); 0.1, 1.0, 0.0, 0.0, 2);
gimp_table_attach_aligned (GTK_TABLE (table), 2, 1, gimp_table_attach_aligned (GTK_TABLE (table), 2, 1,
_("_X:"), 0.0, 0.5, _("_X:"), 0.0, 0.5,
spin_pos_x, 1, TRUE); spin_pos_x, 1, TRUE);
...@@ -486,10 +496,10 @@ create_light_page (void) ...@@ -486,10 +496,10 @@ create_light_page (void)
gimp_help_set_help_data (spin_pos_x, gimp_help_set_help_data (spin_pos_x,
_("Light source X position in XYZ space"), NULL); _("Light source X position in XYZ space"), NULL);
spin_pos_y = gimp_spin_button_new (&adj, spin_pos_y = spin_button_new (&adj,
mapvals.lightsource[k].position.y, mapvals.lightsource[k].position.y,
-100.0, 100.0, -100.0, 100.0,
0.1, 1.0, 0.0, 0.0, 2); 0.1, 1.0, 0.0, 0.0, 2);
gimp_table_attach_aligned (GTK_TABLE (table), 2, 2, gimp_table_attach_aligned (GTK_TABLE (table), 2, 2,
_("_Y:"), 0.0, 0.5, _("_Y:"), 0.0, 0.5,
spin_pos_y, 1, TRUE); spin_pos_y, 1, TRUE);
...@@ -501,10 +511,10 @@ create_light_page (void) ...@@ -501,10 +511,10 @@ create_light_page (void)
gimp_help_set_help_data (spin_pos_y, gimp_help_set_help_data (spin_pos_y,
_("Light source Y position in XYZ space"), NULL); _("Light source Y position in XYZ space"), NULL);
spin_pos_z = gimp_spin_button_new (&adj, spin_pos_z = spin_button_new (&adj,
mapvals.lightsource[k].position.z, mapvals.lightsource[k].position.z,
-100.0, 100.0, -100.0, 100.0,
0.1, 1.0, 0.0, 0.0, 2); 0.1, 1.0, 0.0, 0.0, 2);
gimp_table_attach_aligned (GTK_TABLE (table), 2, 3, gimp_table_attach_aligned (GTK_TABLE (table), 2, 3,
_("_Z:"), 0.0, 0.5, _("_Z:"), 0.0, 0.5,
spin_pos_z, 1, TRUE); spin_pos_z, 1, TRUE);
...@@ -522,9 +532,9 @@ create_light_page (void) ...@@ -522,9 +532,9 @@ create_light_page (void)
gtk_table_attach_defaults (GTK_TABLE (table), label, 5, 6, 0, 1); gtk_table_attach_defaults (GTK_TABLE (table), label, 5, 6, 0, 1);
gtk_widget_show (label); gtk_widget_show (label);
spin_dir_x = gimp_spin_button_new (&adj, spin_dir_x = spin_button_new (&adj,
mapvals.lightsource[k].direction.x, mapvals.lightsource[k].direction.x,
-100.0, 100.0, 0.1, 1.0, 0.0, 0.0, 2); -100.0, 100.0, 0.1, 1.0, 0.0, 0.0, 2);
gimp_table_attach_aligned (GTK_TABLE (table), 4, 1, gimp_table_attach_aligned (GTK_TABLE (table), 4, 1,
_("X:"), 0.0, 0.5, _("X:"), 0.0, 0.5,
spin_dir_x, 1, TRUE); spin_dir_x, 1, TRUE);
...@@ -536,9 +546,9 @@ create_light_page (void) ...@@ -536,9 +546,9 @@ create_light_page (void)
gimp_help_set_help_data (spin_dir_x, gimp_help_set_help_data (spin_dir_x,
_("Light source X direction in XYZ space"), NULL); _("Light source X direction in XYZ space"), NULL);
spin_dir_y = gimp_spin_button_new (&adj, spin_dir_y = spin_button_new (&adj,
mapvals.lightsource[k].direction.y, mapvals.lightsource[k].direction.y,
-100.0, 100.0, 0.1, 1.0, 0.0, 0.0, 2); -100.0, 100.0, 0.1, 1.0, 0.0, 0.0, 2);
gimp_table_attach_aligned (GTK_TABLE (table), 4, 2, gimp_table_attach_aligned (GTK_TABLE (table), 4, 2,
_("Y:"), 0.0, 0.5, _("Y:"), 0.0, 0.5,
spin_dir_y, 1, TRUE); spin_dir_y, 1, TRUE);
...@@ -550,9 +560,9 @@ create_light_page (void) ...@@ -550,9 +560,9 @@ create_light_page (void)
gimp_help_set_help_data (spin_dir_y, gimp_help_set_help_data (spin_dir_y,
_("Light source Y direction in XYZ space"), NULL); _("Light source Y direction in XYZ space"), NULL);
spin_dir_z = gimp_spin_button_new (&adj, spin_dir_z = spin_button_new (&adj,
mapvals.lightsource[k].direction.z, mapvals.lightsource[k].direction.z,
-100.0, 100.0, 0.1, 1.0, 0.0, 0.0, 2); -100.0, 100.0, 0.1, 1.0, 0.0, 0.0, 2);
gimp_table_attach_aligned (GTK_TABLE (table), 4, 3, gimp_table_attach_aligned (GTK_TABLE (table), 4, 3,
_("Z:"), 0.0, 0.5, _("Z:"), 0.0, 0.5,
spin_dir_z, 1, TRUE); spin_dir_z, 1, TRUE);
...@@ -606,16 +616,16 @@ create_light_page (void) ...@@ -606,16 +616,16 @@ create_light_page (void)
static GtkWidget * static GtkWidget *
create_material_page (void) create_material_page (void)
{ {
GtkSizeGroup *group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); GtkSizeGroup *group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
GtkWidget *page; GtkWidget *page;
GtkWidget *frame; GtkWidget *frame;
GtkWidget *table; GtkWidget *table;
GtkWidget *label; GtkWidget *label;
GtkWidget *hbox; GtkWidget *hbox;
GtkWidget *spinbutton; GtkWidget *spinbutton;
GtkWidget *image; GtkWidget *image;
GtkWidget *button; GtkWidget *button;
GtkObject *adj; GtkAdjustment *adj;
page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (page), 12); gtk_container_set_border_width (GTK_CONTAINER (page), 12);
...@@ -642,8 +652,8 @@ create_material_page (void) ...@@ -642,8 +652,8 @@ create_material_page (void)
image, 1, FALSE); image, 1, FALSE);
gtk_size_group_add_widget (group, label); gtk_size_group_add_widget (group, label);
spinbutton = gimp_spin_button_new (&adj, mapvals.material.ambient_int, spinbutton = spin_button_new (&adj, mapvals.material.ambient_int,
0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2); 0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 0, 1, gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 0, 1,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (spinbutton); gtk_widget_show (spinbutton);
...@@ -675,8 +685,8 @@ create_material_page (void) ...@@ -675,8 +685,8 @@ create_material_page (void)
image, 1, FALSE); image, 1, FALSE);
gtk_size_group_add_widget (group, label); gtk_size_group_add_widget (group, label);
spinbutton = gimp_spin_button_new (&adj, mapvals.material.diffuse_int, spinbutton = spin_button_new (&adj, mapvals.material.diffuse_int,
0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2); 0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 1, 2, gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 1, 2,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (spinbutton); gtk_widget_show (spinbutton);
...@@ -708,8 +718,8 @@ create_material_page (void) ...@@ -708,8 +718,8 @@ create_material_page (void)
image, 1, FALSE); image, 1, FALSE);
gtk_size_group_add_widget (group, label); gtk_size_group_add_widget (group, label);
spinbutton = gimp_spin_button_new (&adj, mapvals.material.specular_ref, spinbutton = spin_button_new (&adj, mapvals.material.specular_ref,
0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2); 0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 2, 3, gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 2, 3,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (spinbutton); gtk_widget_show (spinbutton);
...@@ -740,8 +750,8 @@ create_material_page (void) ...@@ -740,8 +750,8 @@ create_material_page (void)
image, 1, FALSE); image, 1, FALSE);
gtk_size_group_add_widget (group, label); gtk_size_group_add_widget (group, label);
spinbutton = gimp_spin_button_new (&adj, mapvals.material.highlight, spinbutton = spin_button_new (&adj, mapvals.material.highlight,
0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2); 0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 3, 4, gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 3, 4,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0); GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (spinbutton); gtk_widget_show (spinbutton);
...@@ -787,13 +797,13 @@ create_material_page (void) ...@@ -787,13 +797,13 @@ create_material_page (void)
static GtkWidget * static GtkWidget *
create_bump_page (void) create_bump_page (void)
{ {
GtkWidget *page; GtkWidget *page;
GtkWidget *toggle; GtkWidget *toggle;
GtkWidget *frame; GtkWidget *frame;
GtkWidget *table; GtkWidget *table;
GtkWidget *combo; GtkWidget *combo;
GtkWidget *spinbutton; GtkWidget *spinbutton;
GtkObject *adj; GtkAdjustment *adj;
page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (page), 12); gtk_container_set_border_width (GTK_CONTAINER (page), 12);
...@@ -857,8 +867,8 @@ create_bump_page (void) ...@@ -857,8 +867,8 @@ create_bump_page (void)
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Cu_rve:"), 0.0, 0.5, combo, 1, FALSE); _("Cu_rve:"), 0.0, 0.5, combo, 1, FALSE);
spinbutton = gimp_spin_button_new (&adj, mapvals.bumpmax, spinbutton = spin_button_new (&adj, mapvals.bumpmax,
0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2); 0, G_MAXFLOAT, 0.01, 0.1, 0.0, 0.0, 2);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2, gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("Ma_ximum height:"), 0.0, 0.5, _("Ma_ximum height:"), 0.0, 0.5,
spinbutton, 1, TRUE); spinbutton, 1, TRUE);
...@@ -1520,3 +1530,28 @@ isolate_selected_light (GtkWidget *widget, ...@@ -1520,3 +1530,28 @@ isolate_selected_light (GtkWidget *widget,
interactive_preview_callback (NULL); 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;
}
...@@ -26,7 +26,7 @@ static GtkNotebook *options_note_book = NULL; ...@@ -26,7 +26,7 @@ static GtkNotebook *options_note_book = NULL;
static GtkWidget *pointlightwid; static GtkWidget *pointlightwid;
static GtkWidget *dirlightwid; static GtkWidget *dirlightwid;
static GtkObject *xadj, *yadj, *zadj; static GtkAdjustment *xadj, *yadj, *zadj;
static GtkWidget *box_page = NULL; static GtkWidget *box_page = NULL;
static GtkWidget *cylinder_page = NULL; static GtkWidget *cylinder_page = NULL;
...@@ -299,7 +299,7 @@ static gint ...@@ -299,7 +299,7 @@ static gint
preview_events (GtkWidget *area, preview_events (GtkWidget *area,
GdkEvent *event) GdkEvent *event)
{ {
HVect pos; HVect __attribute__((unused))pos;
/* HMatrix RotMat; /* HMatrix RotMat;
gdouble a,b,c; */ gdouble a,b,c; */
...@@ -358,7 +358,7 @@ preview_events (GtkWidget *area, ...@@ -358,7 +358,7 @@ preview_events (GtkWidget *area,
} }
else else
{ {
pos.x = -(2.0 * (gdouble) event->motion.x / pos.x = -(2.0 * (gdouble) event->motion.x /
(gdouble) PREVIEW_WIDTH - 1.0); (gdouble) PREVIEW_WIDTH - 1.0);
pos.y = (2.0 * (gdouble) event->motion.y / pos.y = (2.0 * (gdouble) event->motion.y /
(gdouble) PREVIEW_HEIGHT - 1.0); (gdouble) PREVIEW_HEIGHT - 1.0);
...@@ -386,6 +386,32 @@ preview_events (GtkWidget *area, ...@@ -386,6 +386,32 @@ preview_events (GtkWidget *area,
return FALSE; 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;