Fix a lot of warnings all over the place

Deprecated stuff, unused variables. Includes parts of a patch from
Shlomi Fish from bug #768855.
This commit is contained in:
Michael Natterer 2016-10-31 01:08:38 +01:00
parent 44aedebb53
commit f5ecc53f3e
14 changed files with 273 additions and 189 deletions

View file

@ -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
}

View file

@ -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)

View file

@ -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"

View file

@ -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"

View file

@ -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 */

View file

@ -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;
#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!
*/
/* 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,

View file

@ -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)

View file

@ -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;

View file

@ -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;

View file

@ -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 ();

View file

@ -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"

View file

@ -22,7 +22,8 @@
#include "config.h"
#include <gtk/gtk.h>
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "imap_table.h"

View file

@ -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;
}

View file

@ -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,