Commit 6914bbc6 authored by Michael Natterer's avatar Michael Natterer 😴

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

parent ef79cfda
......@@ -767,12 +767,12 @@ save_image (GFile *file,
static gboolean
save_dialog (void)
{
GtkWidget *dialog;
GtkWidget *table;
GtkWidget *entry;
GtkWidget *spinbutton;
GtkObject *adj;
gboolean run;
GtkWidget *dialog;
GtkWidget *table;
GtkWidget *entry;
GtkWidget *spinbutton;
GtkAdjustment *adj;
gboolean run;
dialog = gimp_export_dialog_new (_("Brush"), PLUG_IN_BINARY, SAVE_PROC);
......@@ -785,8 +785,9 @@ save_dialog (void)
table, TRUE, TRUE, 0);
gtk_widget_show (table);
spinbutton = gimp_spin_button_new (&adj,
info.spacing, 1, 1000, 1, 10, 0, 1, 0);
adj = (GtkAdjustment *) gtk_adjustment_new (info.spacing, 1, 1000, 1, 10, 0);
spinbutton = gtk_spin_button_new (adj, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Spacing:"), 1.0, 0.5,
spinbutton, 1, TRUE);
......
......@@ -89,20 +89,20 @@ static GimpPixPipeParams gihparams;
typedef struct
{
GimpOrientationType orientation;
gint32 image;
gint32 toplayer;
gint nguides;
gint32 *guides;
gint *value;
GtkWidget *count_label; /* Corresponding count adjustment, */
gint *count; /* cols or rows */
gint *other_count; /* and the other one */
GtkObject *ncells;
GtkObject *rank0;
GtkWidget *warning_label;
GtkWidget *rank_entry[GIMP_PIXPIPE_MAXDIM];
GtkWidget *mode_entry[GIMP_PIXPIPE_MAXDIM];
GimpOrientationType orientation;
gint32 image;
gint32 toplayer;
gint nguides;
gint32 *guides;
gint *value;
GtkWidget *count_label; /* Corresponding count adjustment, */
gint *count; /* cols or rows */
gint *other_count; /* and the other one */
GtkAdjustment *ncells;
GtkAdjustment *rank0;
GtkWidget *warning_label;
GtkWidget *rank_entry[GIMP_PIXPIPE_MAXDIM];
GtkWidget *mode_entry[GIMP_PIXPIPE_MAXDIM];
} SizeAdjustmentData;
/* static gint32 *vguides, *hguides; */
......@@ -882,22 +882,22 @@ dim_callback (GtkAdjustment *adjustment,
static gboolean
gih_save_dialog (gint32 image_ID)
{
GtkWidget *dialog;
GtkWidget *table;
GtkWidget *dimtable;
GtkWidget *label;
GtkObject *adjustment;
GtkWidget *spinbutton;
GtkWidget *entry;
GtkWidget *box;
GtkWidget *cb;
gint i;
gchar buffer[100];
SizeAdjustmentData cellw_adjust;
SizeAdjustmentData cellh_adjust;
gint32 *layer_ID;
gint32 nlayers;
gboolean run;
GtkWidget *dialog;
GtkWidget *table;
GtkWidget *dimtable;
GtkWidget *label;
GtkAdjustment *adjustment;
GtkWidget *spinbutton;
GtkWidget *entry;
GtkWidget *box;
GtkWidget *cb;
gint i;
gchar buffer[100];
SizeAdjustmentData cellw_adjust;
SizeAdjustmentData cellh_adjust;
gint32 *layer_ID;
gint32 nlayers;
gboolean run;
dialog = gimp_export_dialog_new (_("Brush Pipe"), PLUG_IN_BINARY, SAVE_PROC);
......@@ -913,8 +913,10 @@ gih_save_dialog (gint32 image_ID)
/*
* Spacing: __
*/
spinbutton = gimp_spin_button_new (&adjustment, info.spacing,
1, 1000, 1, 10, 0, 1, 0);
adjustment = (GtkAdjustment *) gtk_adjustment_new (info.spacing,
1, 1000, 1, 10, 0);
spinbutton = gtk_spin_button_new (adjustment, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Spacing (percent):"), 0.0, 0.5,
spinbutton, 1, TRUE);
......@@ -942,10 +944,11 @@ gih_save_dialog (gint32 image_ID)
*/
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
spinbutton = gimp_spin_button_new (&adjustment,
gihparams.cellwidth,
2, gimp_image_width (image_ID), 1, 10, 0,
1, 0);
adjustment = (GtkAdjustment *)
gtk_adjustment_new (gihparams.cellwidth,
2, gimp_image_width (image_ID), 1, 10, 0);
spinbutton = gtk_spin_button_new (adjustment, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gtk_box_pack_start (GTK_BOX (box), spinbutton, FALSE, FALSE, 0);
gtk_widget_show (spinbutton);
......@@ -965,10 +968,11 @@ gih_save_dialog (gint32 image_ID)
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
gtk_widget_show (label);
spinbutton = gimp_spin_button_new (&adjustment,
gihparams.cellheight,
2, gimp_image_height (image_ID), 1, 10, 0,
1, 0);
adjustment = (GtkAdjustment *)
gtk_adjustment_new (gihparams.cellheight,
2, gimp_image_height (image_ID), 1, 10, 0);
spinbutton = gtk_spin_button_new (adjustment, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gtk_box_pack_start (GTK_BOX (box), spinbutton, FALSE, FALSE, 0);
gtk_widget_show (spinbutton);
......@@ -996,9 +1000,10 @@ gih_save_dialog (gint32 image_ID)
/*
* Number of cells: ___
*/
spinbutton = gimp_spin_button_new (&adjustment,
gihparams.ncells, 1, 1000, 1, 10, 0,
1, 0);
adjustment = (GtkAdjustment *)
gtk_adjustment_new (gihparams.ncells, 1, 1000, 1, 10, 0);
spinbutton = gtk_spin_button_new (adjustment, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
_("Number of cells:"), 0.0, 0.5,
spinbutton, 1, TRUE);
......@@ -1056,8 +1061,10 @@ gih_save_dialog (gint32 image_ID)
/*
* Dimension: ___
*/
spinbutton = gimp_spin_button_new (&adjustment, gihparams.dim,
1, GIMP_PIXPIPE_MAXDIM, 1, 1, 0, 1, 0);
adjustment = (GtkAdjustment *)
gtk_adjustment_new (gihparams.dim, 1, GIMP_PIXPIPE_MAXDIM, 1, 1, 0);
spinbutton = gtk_spin_button_new (adjustment, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 5,
_("Dimension:"), 0.0, 0.5,
spinbutton, 1, TRUE);
......@@ -1076,9 +1083,10 @@ gih_save_dialog (gint32 image_ID)
{
gint j;
spinbutton = gimp_spin_button_new (&adjustment,
gihparams.rank[i], 1, 100, 1, 1, 0,
1, 0);
adjustment = (GtkAdjustment *)
gtk_adjustment_new (gihparams.rank[i], 1, 100, 1, 1, 0);
spinbutton = gtk_spin_button_new (adjustment, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gtk_table_attach (GTK_TABLE (dimtable), spinbutton, 0, 1, i, i + 1,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
......
......@@ -397,16 +397,16 @@ save_image (const gchar *filename,
static gint
save_dialog (gint32 image_ID)
{
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *frame;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *spinbutton;
GtkObject *adj;
GtkWidget *entry;
GtkWidget *toggle;
gboolean run;
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *frame;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *spinbutton;
GtkAdjustment *adj;
GtkWidget *entry;
GtkWidget *toggle;
gboolean run;
gimp_ui_init (PLUG_IN_BINARY, FALSE);
......@@ -565,8 +565,10 @@ save_dialog (gint32 image_ID)
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_container_add (GTK_CONTAINER (frame), table);
spinbutton = gimp_spin_button_new (&adj, gtmvals.border,
0, 1000, 1, 10, 0, 1, 0);
adj = (GtkAdjustment *) gtk_adjustment_new (gtmvals.border,
0, 1000, 1, 10, 0);
spinbutton = gtk_spin_button_new (adj, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("_Border:"), 0.0, 0.5,
spinbutton, 1, TRUE);
......@@ -611,8 +613,10 @@ save_dialog (gint32 image_ID)
G_CALLBACK (gtm_clheight_callback),
NULL);
spinbutton = gimp_spin_button_new (&adj, gtmvals.cellpadding,
0, 1000, 1, 10, 0, 1, 0);
adj = (GtkAdjustment *) gtk_adjustment_new (gtmvals.cellpadding,
0, 1000, 1, 10, 0);
spinbutton = gtk_spin_button_new (adj, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
_("Cell-_padding:"), 0.0, 0.5,
spinbutton, 1, TRUE);
......@@ -624,8 +628,10 @@ save_dialog (gint32 image_ID)
G_CALLBACK (gimp_int_adjustment_update),
&gtmvals.cellpadding);
spinbutton = gimp_spin_button_new (&adj, gtmvals.cellspacing,
0, 1000, 1, 10, 0, 1, 0);
adj = (GtkAdjustment *) gtk_adjustment_new (gtmvals.cellspacing,
0, 1000, 1, 10, 0);
spinbutton = gtk_spin_button_new (adj, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 4,
_("Cell-_spacing:"), 0.0, 0.5,
spinbutton, 1, TRUE);
......
......@@ -1529,9 +1529,11 @@ mng_save_dialog (gint32 image_id)
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
spinbutton = gimp_spin_button_new ((GtkObject **) &spinbutton_adj,
mng_data.default_delay,
0, 65000, 10, 100, 0, 1, 0);
spinbutton_adj = (GtkAdjustment *)
gtk_adjustment_new (mng_data.default_delay,
0, 65000, 10, 100, 0);
spinbutton = gtk_spin_button_new (spinbutton_adj, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
g_signal_connect (spinbutton_adj, "value-changed",
G_CALLBACK (gimp_int_adjustment_update),
......
......@@ -132,7 +132,7 @@ struct _GimpResolutionEntryField
guint changed_signal;
GtkObject *adjustment;
GtkAdjustment *adjustment;
GtkWidget *spinbutton;
gdouble phy_size;
......@@ -1373,14 +1373,14 @@ gimp_resolution_entry_field_init (GimpResolutionEntry *gre,
digits = size ? 0 : MIN (gimp_unit_get_digits (initial_unit), 5) + 1;
gref->spinbutton = gimp_spin_button_new (&gref->adjustment,
gref->value,
gref->min_value,
gref->max_value,
1.0, 10.0, 0.0,
1.0,
digits);
gref->adjustment = (GtkAdjustment *)
gtk_adjustment_new (gref->value,
gref->min_value,
gref->max_value,
1.0, 10.0, 0.0);
gref->spinbutton = gtk_spin_button_new (gref->adjustment,
1.0, digits);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (gref->spinbutton), TRUE);
if (spinbutton_width > 0)
{
......@@ -1643,7 +1643,7 @@ gimp_resolution_entry_update_value (GimpResolutionEntryField *gref,
factor);
}
gtk_adjustment_set_value (GTK_ADJUSTMENT (gref->adjustment), value);
gtk_adjustment_set_value (gref->adjustment, value);
gref->stop_recursion--;
......
......@@ -266,8 +266,8 @@ static gboolean resolution_change_callback (GtkAdjustment *adjustment,
typedef struct
{
GtkObject *adjustment[4];
gint level;
GtkAdjustment *adjustment[4];
gint level;
} SaveDialogVals;
static gboolean save_dialog (void);
......@@ -3002,21 +3002,21 @@ static gboolean
load_dialog (const gchar *filename,
gboolean loadPDF)
{
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *hbox;
GtkWidget *frame;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *spinbutton;
GtkObject *adj;
GtkWidget *entry = NULL;
GtkWidget *target = NULL;
GtkWidget *toggle;
GtkWidget *selector = NULL;
gint32 page_count;
gchar *range = NULL;
gboolean run;
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *hbox;
GtkWidget *frame;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *spinbutton;
GtkAdjustment *adj;
GtkWidget *entry = NULL;
GtkWidget *target = NULL;
GtkWidget *toggle;
GtkWidget *selector = NULL;
gint32 page_count;
gchar *range = NULL;
gboolean run;
page_count = count_ps_pages (filename);
......@@ -3079,9 +3079,11 @@ load_dialog (const gchar *filename,
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
spinbutton = gimp_spin_button_new (&adj, plvals.resolution,
MIN_RESOLUTION, MAX_RESOLUTION,
1, 10, 0, 1, 0);
adj = (GtkAdjustment *) gtk_adjustment_new (plvals.resolution,
MIN_RESOLUTION, MAX_RESOLUTION,
1, 10, 0);
spinbutton = gtk_spin_button_new (adj, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Resolution:"), 0.0, 0.5,
spinbutton, 1, FALSE);
......@@ -3089,28 +3091,32 @@ load_dialog (const gchar *filename,
g_signal_connect (adj, "value-changed",
G_CALLBACK (resolution_change_callback),
&plvals.resolution);
g_signal_connect (adj, "value-changed",
G_CALLBACK (gimp_int_adjustment_update),
&plvals.resolution);
ps_width_spinbutton = gimp_spin_button_new (&adj, plvals.width,
adj = (GtkAdjustment *) gtk_adjustment_new (plvals.width,
1, GIMP_MAX_IMAGE_SIZE,
1, 10, 0, 1, 0);
1, 10, 0);
ps_width_spinbutton = gtk_spin_button_new (adj, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("_Width:"), 0.0, 0.5,
ps_width_spinbutton, 1, FALSE);
g_signal_connect (adj, "value-changed",
G_CALLBACK (gimp_int_adjustment_update),
&plvals.width);
ps_height_spinbutton = gimp_spin_button_new (&adj, plvals.height,
1, GIMP_MAX_IMAGE_SIZE,
1, 10, 0, 1, 0);
adj = (GtkAdjustment *) gtk_adjustment_new (plvals.height,
1, GIMP_MAX_IMAGE_SIZE,
1, 10, 0);
ps_height_spinbutton = gtk_spin_button_new (adj, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("_Height:"), 0.0, 0.5,
ps_height_spinbutton, 1, FALSE);
g_signal_connect (adj, "value-changed",
G_CALLBACK (gimp_int_adjustment_update),
&plvals.height);
......@@ -3250,16 +3256,16 @@ static gboolean
save_dialog (void)
{
SaveDialogVals *vals;
GtkWidget *dialog;
GtkWidget *toggle;
GtkWidget *frame, *uframe;
GtkWidget *hbox, *vbox;
GtkWidget *main_vbox[2];
GtkWidget *table;
GtkWidget *spinbutton;
GtkObject *adj;
gint j;
gboolean run;
GtkWidget *dialog;
GtkWidget *toggle;
GtkWidget *frame, *uframe;
GtkWidget *hbox, *vbox;
GtkWidget *main_vbox[2];
GtkWidget *table;
GtkWidget *spinbutton;
GtkAdjustment *adj;
gint j;
gboolean run;
vals = g_new (SaveDialogVals, 1);
vals->level = (psvals.level > 1);
......@@ -3294,8 +3300,11 @@ save_dialog (void)
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
spinbutton = gimp_spin_button_new (&vals->adjustment[0], psvals.width,
1e-5, GIMP_MAX_IMAGE_SIZE, 1, 10, 0, 1, 2);
vals->adjustment[0] = (GtkAdjustment *)
gtk_adjustment_new (psvals.width,
1e-5, GIMP_MAX_IMAGE_SIZE, 1, 10, 0);
spinbutton = gtk_spin_button_new (vals->adjustment[0], 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("_Width:"), 0.0, 0.5,
spinbutton, 1, FALSE);
......@@ -3303,8 +3312,11 @@ save_dialog (void)
G_CALLBACK (gimp_double_adjustment_update),
&psvals.width);
spinbutton = gimp_spin_button_new (&vals->adjustment[1], psvals.height,
1e-5, GIMP_MAX_IMAGE_SIZE, 1, 10, 0, 1, 2);
vals->adjustment[1] = (GtkAdjustment *)
gtk_adjustment_new (psvals.height,
1e-5, GIMP_MAX_IMAGE_SIZE, 1, 10, 0);
spinbutton = gtk_spin_button_new (vals->adjustment[1], 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("_Height:"), 0.0, 0.5,
spinbutton, 1, FALSE);
......@@ -3312,8 +3324,11 @@ save_dialog (void)
G_CALLBACK (gimp_double_adjustment_update),
&psvals.height);
spinbutton = gimp_spin_button_new (&vals->adjustment[2], psvals.x_offset,
0.0, GIMP_MAX_IMAGE_SIZE, 1, 10, 0, 1, 2);
vals->adjustment[2] = (GtkAdjustment *)
gtk_adjustment_new (psvals.x_offset,
0.0, GIMP_MAX_IMAGE_SIZE, 1, 10, 0);
spinbutton = gtk_spin_button_new (vals->adjustment[2], 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("_X offset:"), 0.0, 0.5,
spinbutton, 1, FALSE);
......@@ -3321,8 +3336,11 @@ save_dialog (void)
G_CALLBACK (gimp_double_adjustment_update),
&psvals.x_offset);
spinbutton = gimp_spin_button_new (&vals->adjustment[3], psvals.y_offset,
0.0, GIMP_MAX_IMAGE_SIZE, 1, 10, 0, 1, 2);
vals->adjustment[3] = (GtkAdjustment *)
gtk_adjustment_new (psvals.y_offset,
0.0, GIMP_MAX_IMAGE_SIZE, 1, 10, 0);
spinbutton = gtk_spin_button_new (vals->adjustment[3], 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
_("_Y offset:"), 0.0, 0.5,
spinbutton, 1, FALSE);
......@@ -3420,8 +3438,10 @@ save_dialog (void)
table, "sensitive",
G_BINDING_SYNC_CREATE);
spinbutton = gimp_spin_button_new (&adj, psvals.preview_size,
0, 1024, 1, 10, 0, 1, 0);
adj = (GtkAdjustment *) gtk_adjustment_new (psvals.preview_size,
0, 1024, 1, 10, 0);
spinbutton = gtk_spin_button_new (adj, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Preview _size:"), 1.0, 0.5,
spinbutton, 1, FALSE);
......@@ -3472,10 +3492,9 @@ save_unit_toggle_update (GtkWidget *widget,
for (i = 0; i < 4; i++)
{
value = gtk_adjustment_get_value (GTK_ADJUSTMENT (vals->adjustment[i])) * factor;
value = gtk_adjustment_get_value (vals->adjustment[i]) * factor;
gtk_adjustment_set_value (GTK_ADJUSTMENT (vals->adjustment[i]),
value);
gtk_adjustment_set_value (vals->adjustment[i], value);
}
}
}
......
......@@ -567,8 +567,8 @@ load_rsvg_size (const gchar *filename,
/* User interface */
static GimpSizeEntry *size = NULL;
static GtkObject *xadj = NULL;
static GtkObject *yadj = NULL;
static GtkAdjustment *xadj = NULL;
static GtkAdjustment *yadj = NULL;
static GtkWidget *constrain = NULL;
static gdouble ratio_x = 1.0;
static gdouble ratio_y = 1.0;
......@@ -603,8 +603,8 @@ static void
load_dialog_ratio_callback (GtkAdjustment *adj,
gpointer data)
{
gdouble x = gtk_adjustment_get_value (GTK_ADJUSTMENT (xadj));
gdouble y = gtk_adjustment_get_value (GTK_ADJUSTMENT (yadj));
gdouble x = gtk_adjustment_get_value (xadj);
gdouble y = gtk_adjustment_get_value (yadj);
if (gimp_chain_button_get_active (GIMP_CHAIN_BUTTON (constrain)))
{
......@@ -664,8 +664,8 @@ load_dialog_set_ratio (gdouble x,
g_signal_handlers_block_by_func (xadj, load_dialog_ratio_callback, NULL);
g_signal_handlers_block_by_func (yadj, load_dialog_ratio_callback, NULL);
gtk_adjustment_set_value (GTK_ADJUSTMENT (xadj), x);
gtk_adjustment_set_value (GTK_ADJUSTMENT (yadj), y);
gtk_adjustment_set_value (xadj, x);
gtk_adjustment_set_value (yadj, y);
g_signal_handlers_unblock_by_func (xadj, load_dialog_ratio_callback, NULL);
g_signal_handlers_unblock_by_func (yadj, load_dialog_ratio_callback, NULL);
......@@ -675,24 +675,24 @@ static GimpPDBStatusType
load_dialog (const gchar *filename,
GError **load_error)
{
GtkWidget *dialog;
GtkWidget *frame;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *image;
GdkPixbuf *preview;
GtkWidget *table;
GtkWidget *table2;
GtkWidget *abox;
GtkWidget *res;
GtkWidget *label;
GtkWidget *spinbutton;
GtkWidget *toggle;
GtkWidget *toggle2;
GtkObject *adj;
gboolean run;
GError *error = NULL;
SvgLoadVals vals =
GtkWidget *dialog;
GtkWidget *frame;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *image;
GdkPixbuf *preview;
GtkWidget *table;
GtkWidget *table2;
GtkWidget *abox;
GtkWidget *res;
GtkWidget *label;
GtkWidget *spinbutton;
GtkWidget *toggle;
GtkWidget *toggle2;
GtkAdjustment *adj;
gboolean run;
GError *error = NULL;
SvgLoadVals vals =
{
SVG_DEFAULT_RESOLUTION,
- SVG_PREVIEW_SIZE,
......@@ -800,7 +800,9 @@ load_dialog (const gchar *filename,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (hbox);
spinbutton = gimp_spin_button_new (&adj, 1, 1, 1, 1, 10, 0, 1, 2);
adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
spinbutton = gtk_spin_button_new (adj, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
gtk_widget_show (spinbutton);
......@@ -848,13 +850,13 @@ load_dialog (const gchar *filename,
gtk_table_set_row_spacing (GTK_TABLE (table2), 0, 4);
gtk_box_pack_start (GTK_BOX (hbox), table2, FALSE, FALSE, 0);
spinbutton =
gimp_spin_button_new (&xadj,
ratio_x,
(gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) svg_width,
(gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) svg_width,
0.01, 0.1, 0,
0.01, 4);
xadj = (GtkAdjustment *)
gtk_adjustment_new (ratio_x,
(gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) svg_width,
(gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) svg_width,
0.01, 0.1, 0);
spinbutton = gtk_spin_button_new (xadj, 0.01, 4);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
gtk_table_attach_defaults (GTK_TABLE (table2), spinbutton, 0, 1, 0, 1);
gtk_widget_show (spinbutton);
......@@ -870,13 +872,13 @@ load_dialog (const gchar *filename,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (label);
spinbutton =
gimp_spin_button_new (&yadj,
ratio_y,
(gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) svg_height,
(gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) svg_height,
0.01, 0.1, 0,
0.01, 4);
yadj = (GtkAdjustment *)
gtk_adjustment_new (ratio_y,
(gdouble) GIMP_MIN_IMAGE_SIZE / (gdouble) svg_height,
(gdouble) GIMP_MAX_IMAGE_SIZE / (gdouble) svg_height,
0.01, 0.1, 0);
spinbutton = gtk_spin_button_new (yadj, 0.01, 4);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
gtk_table_attach_defaults (GTK_TABLE (table2), spinbutton, 0, 1, 1, 2);
gtk_widget_show (spinbutton);
......
......@@ -373,8 +373,8 @@ load_wmf_size (const gchar *filename,
/* User interface */
static GimpSizeEntry *size = NULL;
static GtkObject *xadj = NULL;
static GtkObject *yadj = NULL;
static GtkAdjustment *xadj = NULL;
static GtkAdjustment *yadj = NULL;
static GtkWidget *constrain = NULL;
static gdouble ratio_x = 1.0;
static gdouble ratio_y = 1.0;
......@@ -409,8 +409,8 @@ static void
load_dialog_ratio_callback (GtkAdjustment *adj,
gpointer data)
{
gdouble x = gtk_adjustment_get_value (GTK_ADJUSTMENT (xadj));
gdouble y = gtk_adjustment_get_value (GTK_ADJUSTMENT (yadj));
gdouble x = gtk_adjustment_get_value (xadj);
gdouble y = gtk_adjustment_get_value (yadj);
if (gimp_chain_button_get_active (GIMP_CHAIN_BUTTON (constrain)))
{
......@@ -468,8 +468,8 @@ load_dialog_set_ratio (gdouble x,
g_signal_handlers_block_by_func (xadj, load_dialog_ratio_callback, NULL);
g_signal_handlers_block_by_func (yadj, load_dialog_ratio_callback, NULL);
gtk_adjustment_set_value (GTK_ADJUSTMENT (xadj), x);
gtk_adjustment_set_value (GTK_ADJUSTMENT (yadj), y);
gtk_adjustment_set_value (xadj, x);
gtk_adjustment_set_value (yadj, y);
g_signal_handlers_unblock_by_func (xadj, load_dialog_ratio_callback, NULL);
g_signal_handlers_unblock_by_func (yadj, load_dialog_ratio_callback, NULL);
......@@ -478,20 +478,20 @@ load_dialog_set_ratio (gdouble x,
static gboolean
load_dialog (const gchar *filename)
{
GtkWidget *dialog;
GtkWidget *frame;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *image;
GtkWidget *table;
GtkWidget *table2;
GtkWidget *abox;
GtkWidget *res;
GtkWidget *label;
GtkWidget *spinbutton;
GtkObject *adj;
guchar *pixels;
gboolean run = FALSE;
GtkWidget *dialog;
GtkWidget *frame;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *image;
GtkWidget *table;
GtkWidget *table2;
GtkWidget *abox;