libgimpwidgets: add GDestroyNotify to gimp_int_combo_box_connect()

This commit is contained in:
Michael Natterer 2019-08-08 00:22:15 +02:00
parent e1276e2eda
commit 169f98f915
30 changed files with 58 additions and 51 deletions

View File

@ -298,7 +298,7 @@ color_profile_dialog_new (ColorProfileDialogType dialog_type,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
private->intent,
G_CALLBACK (gimp_int_combo_box_get_active),
&private->intent);
&private->intent, NULL);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);

View File

@ -261,7 +261,7 @@ convert_indexed_dialog_new (GimpImage *image,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
private->dither_type,
G_CALLBACK (gimp_int_combo_box_get_active),
&private->dither_type);
&private->dither_type, NULL);
toggle =
gtk_check_button_new_with_mnemonic (_("Enable dithering of _transparency"));

View File

@ -239,7 +239,7 @@ convert_precision_dialog_new (GimpImage *image,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
private->layer_dither_method,
G_CALLBACK (gimp_int_combo_box_get_active),
&private->layer_dither_method);
&private->layer_dither_method, NULL);
/* text layers */
@ -261,7 +261,7 @@ convert_precision_dialog_new (GimpImage *image,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
private->text_layer_dither_method,
G_CALLBACK (gimp_int_combo_box_get_active),
&private->text_layer_dither_method);
&private->text_layer_dither_method, NULL);
gimp_help_set_help_data (combo,
_("Dithering text layers will make them "
@ -288,7 +288,7 @@ convert_precision_dialog_new (GimpImage *image,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
private->channel_dither_method,
G_CALLBACK (gimp_int_combo_box_get_active),
&private->channel_dither_method);
&private->channel_dither_method, NULL);
g_object_unref (size_group);
}

View File

@ -206,7 +206,7 @@ layer_options_dialog_new (GimpImage *image,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
private->blend_space,
G_CALLBACK (gimp_int_combo_box_get_active),
&private->blend_space);
&private->blend_space, NULL);
private->composite_space_combo = combo =
gimp_enum_combo_box_new_with_model (GIMP_ENUM_STORE (space_model));
@ -216,7 +216,7 @@ layer_options_dialog_new (GimpImage *image,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
private->composite_space,
G_CALLBACK (gimp_int_combo_box_get_active),
&private->composite_space);
&private->composite_space, NULL);
g_object_unref (space_model);
@ -228,7 +228,7 @@ layer_options_dialog_new (GimpImage *image,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
private->composite_mode,
G_CALLBACK (gimp_int_combo_box_get_active),
&private->composite_mode);
&private->composite_mode, NULL);
/* set the sensitivity of above 3 menus */
layer_options_dialog_update_mode_sensitivity (private);
@ -379,7 +379,7 @@ layer_options_dialog_new (GimpImage *image,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
private->fill_type,
G_CALLBACK (gimp_int_combo_box_get_active),
&private->fill_type);
&private->fill_type, NULL);
}
if (layer)

View File

@ -335,7 +335,7 @@ resize_dialog_new (GimpViewable *viewable,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
private->layer_set,
G_CALLBACK (gimp_int_combo_box_get_active),
&private->layer_set);
&private->layer_set, NULL);
}
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
@ -350,7 +350,7 @@ resize_dialog_new (GimpViewable *viewable,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
private->fill_type,
G_CALLBACK (gimp_int_combo_box_get_active),
&private->fill_type);
&private->fill_type, NULL);
if (GIMP_IS_IMAGE (viewable))
{

View File

@ -672,7 +672,7 @@ gimp_curves_tool_dialog (GimpFilterTool *filter_tool)
"gimp-curve");
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), 0,
G_CALLBACK (curves_curve_type_callback),
tool);
tool, NULL);
gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
gtk_widget_show (combo);

View File

@ -275,7 +275,7 @@ gimp_browser_add_search_types (GimpBrowser *browser,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
priv->search_type,
G_CALLBACK (gimp_int_combo_box_get_active),
&priv->search_type);
&priv->search_type, NULL);
g_signal_connect (combo, "changed",
G_CALLBACK (gimp_browser_combo_changed),

View File

@ -572,10 +572,11 @@ gimp_int_combo_box_get_active_user_data (GimpIntComboBox *combo_box,
/**
* gimp_int_combo_box_connect:
* @combo_box: a #GimpIntComboBox
* @value: the value to set
* @callback: a callback to connect to the @combo_box's "changed" signal
* @data: a pointer passed as data to g_signal_connect()
* @combo_box: a #GimpIntComboBox
* @value: the value to set
* @callback: a callback to connect to the @combo_box's "changed" signal
* @data: a pointer passed as data to g_signal_connect()
* @data_destroy: Destroy function for @data.
*
* A convenience function that sets the initial @value of a
* #GimpIntComboBox and connects @callback to the "changed"
@ -595,7 +596,8 @@ gulong
gimp_int_combo_box_connect (GimpIntComboBox *combo_box,
gint value,
GCallback callback,
gpointer data)
gpointer data,
GDestroyNotify data_destroy)
{
gulong handler = 0;
@ -604,6 +606,10 @@ gimp_int_combo_box_connect (GimpIntComboBox *combo_box,
if (callback)
handler = g_signal_connect (combo_box, "changed", callback, data);
if (data_destroy)
g_object_weak_ref (G_OBJECT (combo_box), (GWeakNotify) data_destroy,
data);
if (! gimp_int_combo_box_set_active (combo_box, value))
g_signal_emit_by_name (combo_box, "changed", NULL);

View File

@ -100,7 +100,8 @@ gboolean
gulong gimp_int_combo_box_connect (GimpIntComboBox *combo_box,
gint value,
GCallback callback,
gpointer data);
gpointer data,
GDestroyNotify data_destroy);
void gimp_int_combo_box_set_label (GimpIntComboBox *combo_box,
const gchar *label);

View File

@ -1227,7 +1227,7 @@ compose_dialog (const gchar *compose_type,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
composeint.selected[j].comp.ID,
G_CALLBACK (combo_callback),
GINT_TO_POINTER (j));
GINT_TO_POINTER (j), NULL);
}
g_free (layer_list);
@ -1236,7 +1236,7 @@ compose_dialog (const gchar *compose_type,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
composeint.compose_idx,
G_CALLBACK (type_combo_callback),
NULL);
NULL, NULL);
gtk_widget_show (dialog);

View File

@ -322,7 +322,7 @@ retinex_dialog (gint32 drawable_ID)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), rvals.scales_mode,
G_CALLBACK (gimp_int_combo_box_get_active),
&rvals.scales_mode);
&rvals.scales_mode, NULL);
g_signal_connect_swapped (combo, "changed",
G_CALLBACK (gimp_preview_invalidate),
preview);

View File

@ -882,7 +882,7 @@ decompose_dialog (void)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
extract_idx,
G_CALLBACK (gimp_int_combo_box_get_active),
&extract_idx);
&extract_idx, NULL);
toggle = gtk_check_button_new_with_mnemonic (_("_Decompose to layers"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),

View File

@ -672,7 +672,7 @@ DepthMerge_dialog (DepthMerge *dm)
combo = gimp_drawable_combo_box_new (dm_constraint, dm, NULL);
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), dm->params.source1,
G_CALLBACK (dialogSource1ChangedCallback),
dm);
dm, NULL);
gtk_grid_attach (GTK_GRID (grid), combo, 1, 0, 2, 1);
gtk_widget_show (combo);
@ -687,7 +687,7 @@ DepthMerge_dialog (DepthMerge *dm)
gtk_widget_set_margin_bottom (combo, 6);
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), dm->params.depthMap1,
G_CALLBACK (dialogDepthMap1ChangedCallback),
dm);
dm, NULL);
gtk_grid_attach (GTK_GRID (grid), combo, 1, 1, 2, 1);
gtk_widget_show (combo);
@ -700,7 +700,7 @@ DepthMerge_dialog (DepthMerge *dm)
combo = gimp_drawable_combo_box_new (dm_constraint, dm, NULL);
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), dm->params.source2,
G_CALLBACK (dialogSource2ChangedCallback),
dm);
dm, NULL);
gtk_grid_attach (GTK_GRID (grid), combo, 1, 2, 2, 1);
gtk_widget_show (combo);
@ -715,7 +715,7 @@ DepthMerge_dialog (DepthMerge *dm)
gtk_widget_set_margin_bottom (combo, 6);
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), dm->params.depthMap2,
G_CALLBACK (dialogDepthMap2ChangedCallback),
dm);
dm, NULL);
gtk_grid_attach (GTK_GRID (grid), combo, 1, 3, 2, 1);
gtk_widget_show (combo);

View File

@ -399,7 +399,7 @@ aa_dialog (gint selected)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), selected,
G_CALLBACK (gimp_int_combo_box_get_active),
&selected);
&selected, NULL);
gtk_widget_show (dialog);

View File

@ -1452,7 +1452,7 @@ save_dialog (void)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
tsvals.origin,
G_CALLBACK (gimp_int_combo_box_get_active),
&tsvals.origin);
&tsvals.origin, NULL);
gtk_widget_show (dialog);

View File

@ -1167,7 +1167,7 @@ save_dialog (const gint32 image_ID,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (tmpwidget),
32,
G_CALLBACK (gimp_int_combo_box_get_active),
&xmcvals.size);
&xmcvals.size, NULL);
gtk_widget_show (tmpwidget);
/* tooltip */
gimp_help_set_help_data (tmpwidget,

View File

@ -1359,7 +1359,7 @@ smp_dialog (void)
combo = gimp_layer_combo_box_new (smp_constrain, NULL, NULL);
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), g_values.dst_id,
G_CALLBACK (smp_dest_combo_callback),
NULL);
NULL, NULL);
gtk_grid_attach (GTK_GRID (grid), combo, 1, ty, 1, 1);
gtk_widget_show (combo);
@ -1385,7 +1385,7 @@ smp_dialog (void)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), g_values.sample_id,
G_CALLBACK (smp_sample_combo_callback),
NULL);
NULL, NULL);
gtk_grid_attach (GTK_GRID (grid), combo, 4, ty, 1, 1);
gtk_widget_show (combo);

View File

@ -2697,7 +2697,7 @@ makewindow (void)
NULL);
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (typemenu), 0,
G_CALLBACK (selecttype),
NULL);
NULL, NULL);
gimp_grid_attach_aligned (GTK_GRID (grid), 0, 0,
_("Type:"), 0.0, 0.5,
@ -2716,7 +2716,7 @@ makewindow (void)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (texturemenu), 0,
G_CALLBACK (selecttexture),
NULL);
NULL, NULL);
gimp_grid_attach_aligned (GTK_GRID (grid), 0, 1,
_("Texture:"), 0.0, 0.5,

View File

@ -716,7 +716,7 @@ create_main_dialog (void)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
licvals.effect_image_id,
G_CALLBACK (gimp_int_combo_box_get_active),
&licvals.effect_image_id);
&licvals.effect_image_id, NULL);
gimp_grid_attach_aligned (GTK_GRID (grid), 0, 0,
_("_Effect image:"), 0.0, 0.5, combo, 2);

View File

@ -465,7 +465,7 @@ warp_dialog (gint32 drawable_id)
gtk_widget_set_margin_start (combo, 12);
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), dvals.warp_map,
G_CALLBACK (gimp_int_combo_box_get_active),
&dvals.warp_map);
&dvals.warp_map, NULL);
gtk_grid_attach (GTK_GRID (grid), combo, 2, 1, 1, 1);
// GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
@ -614,7 +614,7 @@ warp_dialog (gint32 drawable_id)
gtk_widget_set_margin_start (combo, 12);
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), dvals.mag_map,
G_CALLBACK (gimp_int_combo_box_get_active),
&dvals.mag_map);
&dvals.mag_map, NULL);
gtk_grid_attach (GTK_GRID (grid), combo, 2, 1, 1, 1);
// GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
@ -677,7 +677,7 @@ warp_dialog (gint32 drawable_id)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), dvals.grad_map,
G_CALLBACK (gimp_int_combo_box_get_active),
&dvals.grad_map);
&dvals.grad_map, NULL);
gimp_help_set_help_data (combo, _("Gradient map selection menu"), NULL);
@ -723,7 +723,7 @@ warp_dialog (gint32 drawable_id)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), dvals.vector_map,
G_CALLBACK (gimp_int_combo_box_get_active),
&dvals.vector_map);
&dvals.vector_map, NULL);
gimp_help_set_help_data (combo,
_("Fixed-direction-vector map selection menu"),

View File

@ -1194,7 +1194,7 @@ save_dialog (void)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
jsvals.subsmp,
G_CALLBACK (subsampling_changed),
entry);
entry, NULL);
g_signal_connect (pg.subsmp, "changed",
G_CALLBACK (subsampling_changed2),
pg.use_orig_quality);

View File

@ -197,7 +197,7 @@ save_dialog (WebPSaveParams *params,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
params->preset,
G_CALLBACK (gimp_int_combo_box_get_active),
&params->preset);
&params->preset, NULL);
if (animation_supported)
{

View File

@ -1218,7 +1218,7 @@ flame_dialog (void)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
config.cmap_drawable,
G_CALLBACK (cmap_callback),
NULL);
NULL, NULL);
gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
gtk_widget_show (combo);

View File

@ -600,7 +600,7 @@ create_brushpage (GtkNotebook *notebook)
combo = gimp_drawable_combo_box_new (validdrawable, NULL, NULL);
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), -1,
G_CALLBACK (brushdmenuselect),
NULL);
NULL, NULL);
gtk_box_pack_start (GTK_BOX (box3), combo, TRUE, TRUE, 0);
gtk_widget_show (combo);

View File

@ -4036,7 +4036,7 @@ ed_mode_menu_new (GFlareMode *mode_var)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), *mode_var,
G_CALLBACK (ed_mode_menu_callback),
mode_var);
mode_var, NULL);
return combo;
}

View File

@ -842,7 +842,7 @@ create_bump_page (void)
combo = gimp_drawable_combo_box_new (bumpmap_constrain, NULL, NULL);
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), mapvals.bumpmap_id,
G_CALLBACK (gimp_int_combo_box_get_active),
&mapvals.bumpmap_id);
&mapvals.bumpmap_id, NULL);
g_signal_connect (combo, "changed",
G_CALLBACK (mapmenu2_callback),
@ -935,7 +935,7 @@ create_environment_page (void)
combo = gimp_drawable_combo_box_new (envmap_constrain, NULL, NULL);
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), mapvals.envmap_id,
G_CALLBACK (envmap_combo_callback),
NULL);
NULL, NULL);
gimp_grid_attach_aligned (GTK_GRID (grid), 0, 0,
_("En_vironment image:"), 0.0, 0.5,
combo, 1);

View File

@ -1098,7 +1098,7 @@ create_box_page (void)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
mapvals.boxmap_id[i],
G_CALLBACK (gimp_int_combo_box_get_active),
&mapvals.boxmap_id[i]);
&mapvals.boxmap_id[i], NULL);
gimp_grid_attach_aligned (GTK_GRID (grid), 0, i,
gettext (labels[i]), 0.0, 0.5,
@ -1190,7 +1190,7 @@ create_cylinder_page (void)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
mapvals.cylindermap_id[i],
G_CALLBACK (gimp_int_combo_box_get_active),
&mapvals.cylindermap_id[i]);
&mapvals.cylindermap_id[i], NULL);
label = gimp_grid_attach_aligned (GTK_GRID (grid), 0, i,
gettext (labels[i]), 0.0, 0.5,

View File

@ -681,7 +681,7 @@ dialog (void)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
curl.colors,
G_CALLBACK (gimp_int_combo_box_get_active),
&curl.colors);
&curl.colors, NULL);
grid = gtk_grid_new ();
gtk_grid_set_column_spacing (GTK_GRID (grid), 6);

View File

@ -506,7 +506,7 @@ print_offset_frame (PrintData *data,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
data->center,
G_CALLBACK (print_size_info_center_changed),
NULL);
NULL, NULL);
info.center_combo = combo;

View File

@ -332,7 +332,7 @@ script_fu_interface (SFScript *script,
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (widget), *ID_ptr,
G_CALLBACK (gimp_int_combo_box_get_active),
ID_ptr);
ID_ptr, NULL);
break;
case SF_COLOR: