Commit d1e6a1b1 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

plug-ins/common/video.c plug-ins/common/vinvert.c

2002-01-15  Michael Natterer  <mitch@gimp.org>

	* plug-ins/common/video.c
	* plug-ins/common/vinvert.c
	* plug-ins/common/vpropagate.c
	* plug-ins/common/warp.c
	* plug-ins/common/waves.c
	* plug-ins/common/whirlpinch.c
	* plug-ins/common/wind.c
	* plug-ins/common/wmf.c
	* plug-ins/common/xbm.c
	* plug-ins/common/xpm.c
	* plug-ins/common/xwd.c: compile with GTK_DISABLE_DEPRECATED.
parent 3739e368
2002-01-15 Michael Natterer <mitch@gimp.org>
* plug-ins/common/video.c
* plug-ins/common/vinvert.c
* plug-ins/common/vpropagate.c
* plug-ins/common/warp.c
* plug-ins/common/waves.c
* plug-ins/common/whirlpinch.c
* plug-ins/common/wind.c
* plug-ins/common/wmf.c
* plug-ins/common/xbm.c
* plug-ins/common/xpm.c
* plug-ins/common/xwd.c: compile with GTK_DISABLE_DEPRECATED.
2002-01-14 Rebecca Walter <bex@gimp.org>
* app/gui/palette-editor.c
......
......@@ -1775,10 +1775,10 @@ static VideoInterface vint =
/* Declare local functions.
*/
static void query (void);
static void run (gchar *name,
gint nparams,
static void run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
gint *nreturn_vals,
GimpParam **return_vals);
static void video (GimpDrawable *drawable);
......@@ -1840,23 +1840,23 @@ query (void)
}
static void
run (gchar *name,
gint nparams,
run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
GimpDrawable *drawable;
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
static GimpParam values[1];
GimpDrawable *drawable;
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
run_mode = param[0].data.d_int32;
*nreturn_vals = 1;
*return_vals = values;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
switch (run_mode)
......@@ -2158,9 +2158,9 @@ video_dialog (void)
NULL);
gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit),
NULL);
g_signal_connect (G_OBJECT (dlg), "destroy",
G_CALLBACK (gtk_main_quit),
NULL);
/* main parameter frame */
frame = gtk_frame_new (_("Parameter Settings"));
......@@ -2186,20 +2186,24 @@ video_dialog (void)
toggle = gtk_check_button_new_with_label (_("Additive"));
gtk_box_pack_start (GTK_BOX (vbox), toggle, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
(GtkSignalFunc) video_toggle_update,
&vvals.additive);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), vvals.additive);
gtk_widget_show (toggle);
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (video_toggle_update),
&vvals.additive);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), vvals.additive);
toggle = gtk_check_button_new_with_label ( _("Rotated"));
gtk_box_pack_start (GTK_BOX (vbox), toggle, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
(GtkSignalFunc) video_toggle_update,
&vvals.rotated);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), vvals.rotated);
gtk_widget_show (toggle);
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (video_toggle_update),
&vvals.rotated);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), vvals.rotated);
previewframe = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (previewframe), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (vbox), previewframe, FALSE, FALSE, 0);
......@@ -2223,15 +2227,19 @@ video_dialog (void)
{
toggle = gtk_radio_button_new_with_label (group,
gettext(pattern_name[y]));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (toggle));
gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
gtk_object_set_user_data (GTK_OBJECT (toggle), (gpointer) y);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
(GtkSignalFunc) video_radio_update,
&vvals.pattern_number);
gtk_widget_show (toggle);
g_object_set_data (G_OBJECT (toggle), "gimp-item-data",
GINT_TO_POINTER (y));
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (video_radio_update),
&vvals.pattern_number);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
vvals.pattern_number == y);
gtk_widget_show (toggle);
}
video_render_preview (FALSE);
......
......@@ -38,13 +38,13 @@
/* Declare local functions.
*/
static void query (void);
static void run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void vinvert (GimpDrawable *drawable);
static void vinvert (GimpDrawable *drawable);
static void indexed_vinvert (gint32 image_ID);
static void vinvert_render_row (const guchar *src_row,
guchar *dest_row,
......@@ -95,23 +95,23 @@ query ()
}
static void
run (char *name,
int nparams,
run (gchar *name,
gint nparams,
GimpParam *param,
int *nreturn_vals,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
GimpDrawable *drawable;
gint32 image_ID;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
static GimpParam values[1];
GimpDrawable *drawable;
gint32 image_ID;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
run_mode = param[0].data.d_int32;
*nreturn_vals = 1;
*return_vals = values;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
......
......@@ -81,7 +81,7 @@ static GtkWidget * gtk_table_add_toggle (GtkWidget *table,
gint x1,
gint x2,
gint y,
GtkSignalFunc update,
GCallback update,
gint *value);
static int value_difference_check (guchar *, guchar *, int);
......@@ -255,17 +255,17 @@ run (gchar *name,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpRunMode run_mode;
static GimpParam values[1];
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpRunMode run_mode;
run_mode = param[0].data.d_int32;
drawable_id = param[2].data.d_int32;
*nreturn_vals = 1;
*return_vals = values;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
switch (run_mode)
......@@ -1011,9 +1011,9 @@ vpropagate_dialog (GimpImageBaseType image_type)
NULL);
gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit),
NULL);
g_signal_connect (G_OBJECT (dlg), "destroy",
G_CALLBACK (gtk_main_quit),
NULL);
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
......@@ -1032,15 +1032,19 @@ vpropagate_dialog (GimpImageBaseType image_type)
{
button = gtk_radio_button_new_with_label (group,
gettext (modes[index].name));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button));
gtk_box_pack_start (GTK_BOX (toggle_vbox), button, FALSE, FALSE, 0);
gtk_object_set_user_data (GTK_OBJECT (button), (gpointer) index);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
GTK_SIGNAL_FUNC (gimp_radio_button_update),
&vpvals.propagate_mode);
gtk_widget_show (button);
g_object_set_data (G_OBJECT (button), "gimp-item-data",
GINT_TO_POINTER (index));
g_signal_connect (G_OBJECT (button), "toggled",
G_CALLBACK (gimp_radio_button_update),
&vpvals.propagate_mode);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
index == vpvals.propagate_mode);
gtk_widget_show (button);
}
gtk_widget_show (toggle_vbox);
......@@ -1061,43 +1065,43 @@ vpropagate_dialog (GimpImageBaseType image_type)
vpvals.lower_limit, 0, 255, 1, 8, 0,
TRUE, 0, 0,
NULL, NULL);
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
&vpvals.lower_limit);
g_signal_connect (G_OBJECT (adj), "value_changed",
G_CALLBACK (gimp_int_adjustment_update),
&vpvals.lower_limit);
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("Upper Threshold:"), SCALE_WIDTH, 0,
vpvals.upper_limit, 0, 255, 1, 8, 0,
TRUE, 0, 0,
NULL, NULL);
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
&vpvals.upper_limit);
g_signal_connect (G_OBJECT (adj), "value_changed",
G_CALLBACK (gimp_int_adjustment_update),
&vpvals.upper_limit);
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
_("Propagating Rate:"), SCALE_WIDTH, 0,
vpvals.propagating_rate, 0, 1, 0.01, 0.1, 2,
TRUE, 0, 0,
NULL, NULL);
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&vpvals.propagating_rate);
g_signal_connect (G_OBJECT (adj), "value_changed",
G_CALLBACK (gimp_double_adjustment_update),
&vpvals.propagating_rate);
sep = gtk_hseparator_new ();
gtk_table_attach (GTK_TABLE (table), sep, 0, 3, 3, 4, GTK_FILL, 0, 0, 0);
gtk_widget_show (sep);
gtk_table_add_toggle (table, _("To Left"), 0, 1, 5,
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
G_CALLBACK (gimp_toggle_button_update),
&direction_mask_vec[Right2Left]);
gtk_table_add_toggle (table, _("To Right"), 2, 3, 5,
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
G_CALLBACK (gimp_toggle_button_update),
&direction_mask_vec[Left2Right]);
gtk_table_add_toggle (table, _("To Top"), 1, 2, 4,
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
G_CALLBACK (gimp_toggle_button_update),
&direction_mask_vec[Bottom2Top]);
gtk_table_add_toggle (table, _("To Bottom"), 1, 2, 6,
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
G_CALLBACK (gimp_toggle_button_update),
&direction_mask_vec[Top2Bottom]);
if ((image_type == GIMP_RGBA_IMAGE) | (image_type == GIMP_GRAYA_IMAGE))
{
......@@ -1111,7 +1115,7 @@ vpropagate_dialog (GimpImageBaseType image_type)
toggle =
gtk_table_add_toggle (table, _("Propagating Alpha Channel"),
0, 3, 8,
(GtkSignalFunc) gimp_toggle_button_update,
G_CALLBACK (gimp_toggle_button_update),
&propagate_alpha);
if (gimp_layer_get_preserve_transparency (drawable_id))
{
......@@ -1120,7 +1124,7 @@ vpropagate_dialog (GimpImageBaseType image_type)
}
}
gtk_table_add_toggle (table, _("Propagating Value Channel"), 0, 3, 9,
(GtkSignalFunc) gimp_toggle_button_update,
G_CALLBACK (gimp_toggle_button_update),
&propagate_value);
}
gtk_widget_show (table);
......@@ -1153,24 +1157,26 @@ vpropagate_ok_callback (GtkWidget *widget,
}
static GtkWidget *
gtk_table_add_toggle (GtkWidget *table,
gchar *name,
gint x1,
gint x2,
gint y,
GtkSignalFunc update,
gint *value)
gtk_table_add_toggle (GtkWidget *table,
gchar *name,
gint x1,
gint x2,
gint y,
GCallback update,
gint *value)
{
GtkWidget *toggle;
toggle = gtk_check_button_new_with_label(name);
gtk_table_attach (GTK_TABLE (table), toggle, x1, x2, y, y+1,
GTK_FILL|GTK_EXPAND, 0, 0, 0);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
(GtkSignalFunc) update,
value);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), *value);
gtk_widget_show (toggle);
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (update),
value);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), *value);
return toggle;
}
......@@ -121,50 +121,50 @@ typedef struct
*/
static void query (void);
static void run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void blur16 (GimpDrawable *drawable);
static void diff (GimpDrawable *drawable,
gint32 *xl_id,
gint32 *yl_id);
gint32 *xl_id,
gint32 *yl_id);
static void diff_prepare_row (GimpPixelRgn *pixel_rgn,
guchar *data,
int x,
int y,
int w);
static void diff_prepare_row (GimpPixelRgn *pixel_rgn,
guchar *data,
int x,
int y,
int w);
static void warp_one (GimpDrawable *draw,
GimpDrawable *new,
GimpDrawable *map_x,
GimpDrawable *map_y,
GimpDrawable *mag_draw,
gint first_time,
gint step);
gint first_time,
gint step);
static void warp (GimpDrawable *drawable,
GimpDrawable **map_x_p,
GimpDrawable **map_y_p);
static gint warp_dialog (GimpDrawable *drawable);
static GimpTile * warp_pixel (GimpDrawable *drawable,
static GimpTile *warp_pixel (GimpDrawable *drawable,
GimpTile *tile,
gint width,
gint height,
gint x1,
gint y1,
gint x2,
gint y2,
gint x,
gint y,
gint *row,
gint *col,
guchar *pixel);
gint width,
gint height,
gint x1,
gint y1,
gint x2,
gint y2,
gint x,
gint y,
gint *row,
gint *col,
guchar *pixel);
static guchar bilinear (gdouble x,
gdouble y,
......@@ -282,10 +282,10 @@ query (void)
}
static void
run (gchar *name,
gint nparams,
run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
......@@ -296,12 +296,12 @@ run (gchar *name,
GimpRGB color;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gint pcnt; /* parameter counter for scanning input params. */
gint pcnt; /* parameter counter for scanning input params. */
run_mode = param[0].data.d_int32;
tile_width = gimp_tile_width(); /* initialize some globals */
tile_height = gimp_tile_height();
tile_width = gimp_tile_width (); /* initialize some globals */
tile_height = gimp_tile_height ();
/* get currently selected foreground pixel color */
gimp_palette_get_foreground (&color);
......@@ -315,6 +315,7 @@ run (gchar *name,
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
......@@ -432,9 +433,9 @@ warp_dialog (GimpDrawable *drawable)
NULL);
gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit),
NULL);
g_signal_connect (G_OBJECT (dlg), "destroy",
G_CALLBACK (gtk_main_quit),
NULL);
gimp_help_init ();
......@@ -460,18 +461,18 @@ warp_dialog (GimpDrawable *drawable)
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Step Size:"), 1.0, 0.5,
spinbutton, 1, TRUE);
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&dvals.amount);
g_signal_connect (G_OBJECT (adj), "value_changed",
G_CALLBACK (gimp_double_adjustment_update),
&dvals.amount);
spinbutton = gimp_spin_button_new (&adj, dvals.iter,
1, 100, 1, 5, 0, 1, 0);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Iterations:"), 1.0, 0.5,
spinbutton, 1, TRUE);
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
&dvals.iter);
g_signal_connect (G_OBJECT (adj), "value_changed",
G_CALLBACK (gimp_int_adjustment_update),
&dvals.iter);
/* Displacement map menu */
label = gtk_label_new (_("Displacement Map:"));
......@@ -501,48 +502,64 @@ warp_dialog (GimpDrawable *drawable)
GTK_FILL, GTK_FILL, 0, 0);
toggle = gtk_radio_button_new_with_label (group, _("Wrap"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (toggle));
gtk_box_pack_start (GTK_BOX (toggle_hbox), toggle, FALSE, FALSE, 0);
gtk_object_set_user_data (GTK_OBJECT (toggle), (gpointer) WRAP);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
(GtkSignalFunc) gimp_radio_button_update,
&dvals.wrap_type);
gtk_widget_show (toggle);
g_object_set_data (G_OBJECT (toggle), "gimp-item-data",
GINT_TO_POINTER (WRAP));
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (gimp_radio_button_update),
&dvals.wrap_type);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
dvals.wrap_type == WRAP);
gtk_widget_show (toggle);
toggle = gtk_radio_button_new_with_label (group, _("Smear"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (toggle));
gtk_box_pack_start (GTK_BOX (toggle_hbox), toggle, FALSE, FALSE, 0);
gtk_object_set_user_data (GTK_OBJECT (toggle), (gpointer) SMEAR);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
(GtkSignalFunc) gimp_radio_button_update,
&dvals.wrap_type);
gtk_widget_show (toggle);
g_object_set_data (G_OBJECT (toggle), "gimp-item-data",
GINT_TO_POINTER (SMEAR));
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (gimp_radio_button_update),
&dvals.wrap_type);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
dvals.wrap_type == SMEAR);
gtk_widget_show (toggle);
toggle = gtk_radio_button_new_with_label (group, _("Black"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (toggle));
gtk_box_pack_start (GTK_BOX (toggle_hbox), toggle, FALSE, FALSE, 0);
gtk_object_set_user_data (GTK_OBJECT (toggle), (gpointer) BLACK);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
(GtkSignalFunc) gimp_radio_button_update,
&dvals.wrap_type);
gtk_widget_show (toggle);
g_object_set_data (G_OBJECT (toggle), "gimp-item-data",
GINT_TO_POINTER (BLACK));
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (gimp_radio_button_update),
&dvals.wrap_type);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
dvals.wrap_type == BLACK);
gtk_widget_show (toggle);
toggle = gtk_radio_button_new_with_label (group, _("FG Color"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (toggle));
gtk_box_pack_start (GTK_BOX (toggle_hbox), toggle, FALSE, FALSE, 0);
gtk_object_set_user_data (GTK_OBJECT (toggle), (gpointer) COLOR);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
(GtkSignalFunc) gimp_radio_button_update,
&dvals.wrap_type);
gtk_widget_show (toggle);
g_object_set_data (G_OBJECT (toggle), "gimp-item-data",
GINT_TO_POINTER (COLOR));
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (gimp_radio_button_update),
&dvals.wrap_type);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
dvals.wrap_type == COLOR);
gtk_widget_show (toggle);
gtk_widget_show (toggle_hbox);
......@@ -567,27 +584,27 @@ warp_dialog (GimpDrawable *drawable)
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Dither Size:"), 1.0, 0.5,
spinbutton, 1, TRUE);
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",