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

This commit is contained in:
Michael Natterer 2014-06-22 00:26:59 +02:00
parent b78d9c9f35
commit 08ffad9086
5 changed files with 81 additions and 62 deletions

View File

@ -847,12 +847,12 @@ save_image (const gchar *filename,
static gboolean
load_dialog (const gchar *filename)
{
GtkWidget *dialog;
GtkWidget *table;
GtkWidget *spinbutton;
GtkObject *adj;
gint32 width, height, nframes;
gboolean run;
GtkWidget *dialog;
GtkWidget *table;
GtkWidget *spinbutton;
GtkAdjustment *adj;
gint32 width, height, nframes;
gboolean run;
get_info (filename, &width, &height, &nframes, NULL);
@ -887,8 +887,9 @@ load_dialog (const gchar *filename)
* Maybe I add on-the-fly RGB conversion, to keep palettechanges...
* But for now you can set a start- and a end-frame:
*/
spinbutton = gimp_spin_button_new (&adj,
from_frame, 1, nframes, 1, 10, 0, 1, 0);
adj = (GtkAdjustment *) gtk_adjustment_new (from_frame, 1, nframes, 1, 10, 0);
spinbutton = gtk_spin_button_new (adj, 1, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
C_("frame-range", "From:"), 0.0, 0.5,
spinbutton, 1, TRUE);
@ -896,8 +897,9 @@ load_dialog (const gchar *filename)
G_CALLBACK (gimp_int_adjustment_update),
&from_frame);
spinbutton = gimp_spin_button_new (&adj,
to_frame, 1, nframes, 1, 10, 0, 1, 0);
adj = (GtkAdjustment *) gtk_adjustment_new (to_frame, 1, nframes, 1, 10, 0);
spinbutton = gtk_spin_button_new (adj, 1, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
C_("frame-range", "To:"), 0.0, 0.5,
spinbutton, 1, TRUE);
@ -917,12 +919,12 @@ load_dialog (const gchar *filename)
static gboolean
save_dialog (gint32 image_id)
{
GtkWidget *dialog;
GtkWidget *table;
GtkWidget *spinbutton;
GtkObject *adj;
gint nframes;
gboolean run;
GtkWidget *dialog;
GtkWidget *table;
GtkWidget *spinbutton;
GtkAdjustment *adj;
gint nframes;
gboolean run;
g_free (gimp_image_get_layers (image_id, &nframes));
@ -943,8 +945,9 @@ save_dialog (gint32 image_id)
* Maybe I add on-the-fly RGB conversion, to keep palettechanges...
* But for now you can set a start- and a end-frame:
*/
spinbutton = gimp_spin_button_new (&adj,
from_frame, 1, nframes, 1, 10, 0, 1, 0);
adj = (GtkAdjustment *) gtk_adjustment_new (from_frame, 1, nframes, 1, 10, 0);
spinbutton = gtk_spin_button_new (adj, 1, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
C_("frame-range", "From:"), 0.0, 0.5,
spinbutton, 1, TRUE);
@ -952,8 +955,9 @@ save_dialog (gint32 image_id)
G_CALLBACK (gimp_int_adjustment_update),
&from_frame);
spinbutton = gimp_spin_button_new (&adj,
to_frame, 1, nframes, 1, 10, 0, 1, 0);
adj = (GtkAdjustment *) gtk_adjustment_new (to_frame, 1, nframes, 1, 10, 0);
spinbutton = gtk_spin_button_new (adj, 1, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
C_("frame-range", "To:"), 0.0, 0.5,
spinbutton, 1, TRUE);

View File

@ -96,7 +96,7 @@ typedef struct
gboolean run;
GtkWidget *use_restart_markers; /*checkbox setting use restart markers*/
GtkTextBuffer *text_buffer;
GtkObject *scale_data; /*for restart markers*/
GtkAdjustment *scale_data; /*for restart markers*/
gulong handler_id_restart;
GtkObject *quality; /*quality slidebar*/
@ -849,12 +849,13 @@ save_dialog (void)
GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
gtk_widget_show (restart_markers_label);
/*pg.scale_data = scale_data;*/
pg.scale_data = (GtkAdjustment *)
gtk_adjustment_new (((jsvals.restart == 0) ?
DEFAULT_RESTART_MCU_ROWS : jsvals.restart),
1.0, 64.0, 1.0, 1.0, 0);
pg.restart = restart_markers_scale = spinbutton =
gimp_spin_button_new (&pg.scale_data,
((jsvals.restart == 0) ?
DEFAULT_RESTART_MCU_ROWS : jsvals.restart),
1.0, 64.0, 1.0, 1.0, 0, 1.0, 0);
gtk_spin_button_new (pg.scale_data, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gtk_table_attach (GTK_TABLE (table), spinbutton, 5, 6, 1, 2,
GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (spinbutton);

View File

@ -2103,11 +2103,13 @@ value_pair_create (gpointer data,
value_pair->type = type;
value_pair->timeout_id = 0;
value_pair->spin = gimp_spin_button_new ((GtkObject **) &value_pair->adjustment,
1.0, lower, upper,
(upper - lower) / 100,
(upper - lower) / 10,
0.0, 1.0, 3);
value_pair->adjustment = (GtkAdjustment *)
gtk_adjustment_new (1.0, lower, upper,
(upper - lower) / 100,
(upper - lower) / 10,
0.0);
value_pair->spin = gtk_spin_button_new (value_pair->adjustment, 1.0, 3);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (value_pair->spin), TRUE);
gtk_widget_set_size_request (value_pair->spin, 72, -1);
g_signal_connect (value_pair->adjustment, "value-changed",

View File

@ -40,10 +40,10 @@ typedef struct
GtkWidget *center_combo;
GtkWidget *area_label;
GtkWidget *preview;
GtkObject *left_adj;
GtkObject *right_adj;
GtkObject *top_adj;
GtkObject *bottom_adj;
GtkAdjustment *left_adj;
GtkAdjustment *right_adj;
GtkAdjustment *top_adj;
GtkAdjustment *bottom_adj;
} PrintSizeInfo;
enum
@ -228,16 +228,16 @@ print_size_frame (PrintData *data,
GtkSizeGroup *label_group,
GtkSizeGroup *entry_group)
{
GtkWidget *entry;
GtkWidget *height;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *chain;
GtkWidget *frame;
GtkWidget *label;
GtkObject *adj;
gdouble image_width;
gdouble image_height;
GtkWidget *entry;
GtkWidget *height;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *chain;
GtkWidget *frame;
GtkWidget *label;
GtkAdjustment *adj;
gdouble image_width;
gdouble image_height;
image_width = (info.image_width *
gimp_unit_get_factor (data->unit) / data->xres);
@ -268,7 +268,9 @@ print_size_frame (PrintData *data,
gtk_table_set_col_spacing (GTK_TABLE (entry), 0, 6);
gtk_table_set_col_spacing (GTK_TABLE (entry), 2, 6);
height = gimp_spin_button_new (&adj, 1, 1, 1, 1, 10, 0, 1, 2);
adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
height = gtk_spin_button_new (adj, 1, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height), TRUE);
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry),
GTK_SPIN_BUTTON (height), NULL);
gtk_table_attach_defaults (GTK_TABLE (entry), height, 1, 2, 0, 1);
@ -310,7 +312,9 @@ print_size_frame (PrintData *data,
gtk_table_set_col_spacing (GTK_TABLE (entry), 0, 6);
gtk_table_set_col_spacing (GTK_TABLE (entry), 2, 6);
height = gimp_spin_button_new (&adj, 1, 1, 1, 1, 10, 0, 1, 2);
adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
height = gtk_spin_button_new (adj, 1, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height), TRUE);
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry),
GTK_SPIN_BUTTON (height), NULL);
gtk_table_attach_defaults (GTK_TABLE (entry), height, 1, 2, 0, 1);
@ -388,7 +392,9 @@ print_offset_frame (PrintData *data,
gtk_widget_show (table);
/* left */
spinner = gimp_spin_button_new (&info.left_adj, 1, 1, 1, 1, 10, 0, 1, 2);
info.left_adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
spinner = gtk_spin_button_new (info.left_adj, 1, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE);
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry),
GTK_SPIN_BUTTON (spinner), NULL);
@ -403,7 +409,9 @@ print_offset_frame (PrintData *data,
gtk_widget_show (label);
/* right */
spinner = gimp_spin_button_new (&info.right_adj, 1, 1, 1, 1, 10, 0, 1, 2);
info.right_adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
spinner = gtk_spin_button_new (info.right_adj, 1, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE);
g_signal_connect (info.right_adj, "value-changed",
G_CALLBACK (print_size_info_offset_max_changed),
@ -421,7 +429,9 @@ print_offset_frame (PrintData *data,
gtk_widget_show (label);
/* top */
spinner = gimp_spin_button_new (&info.top_adj, 1, 1, 1, 1, 10, 0, 1, 2);
info.top_adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
spinner = gtk_spin_button_new (info.top_adj, 1, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE);
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (entry),
GTK_SPIN_BUTTON (spinner), NULL);
@ -436,7 +446,9 @@ print_offset_frame (PrintData *data,
gtk_widget_show (label);
/* bottom */
spinner = gimp_spin_button_new (&info.bottom_adj, 1, 1, 1, 1, 10, 0, 1, 2);
info.bottom_adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
spinner = gtk_spin_button_new (info.bottom_adj, 1, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE);
g_signal_connect (info.bottom_adj, "value-changed",
G_CALLBACK (print_size_info_offset_max_changed),

View File

@ -274,7 +274,6 @@ script_fu_interface (SFScript *script,
for (i = start_arg; i < script->n_args; i++)
{
GtkWidget *widget = NULL;
GtkObject *adj;
gchar *label_text;
gfloat label_yalign = 0.5;
gint *ID_ptr = NULL;
@ -420,17 +419,18 @@ script_fu_interface (SFScript *script,
case SF_SPINNER:
left_align = TRUE;
widget =
gimp_spin_button_new (&adj,
arg->value.sfa_adjustment.value,
arg->default_value.sfa_adjustment.lower,
arg->default_value.sfa_adjustment.upper,
arg->default_value.sfa_adjustment.step,
arg->default_value.sfa_adjustment.page,
0, 0,
arg->default_value.sfa_adjustment.digits);
arg->value.sfa_adjustment.adj = (GtkAdjustment *)
gtk_adjustment_new (arg->value.sfa_adjustment.value,
arg->default_value.sfa_adjustment.lower,
arg->default_value.sfa_adjustment.upper,
arg->default_value.sfa_adjustment.step,
arg->default_value.sfa_adjustment.page,
0);
widget = gtk_spin_button_new (arg->value.sfa_adjustment.adj,
arg->default_value.sfa_adjustment.step,
arg->default_value.sfa_adjustment.digits);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (widget), TRUE);
gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE);
arg->value.sfa_adjustment.adj = GTK_ADJUSTMENT (adj);
break;
}