From d84c4d763b0df364e76875cad9567fa17546fc99 Mon Sep 17 00:00:00 2001 From: Jehan Date: Thu, 17 Aug 2023 01:30:59 +0200 Subject: [PATCH] =?UTF-8?q?app,=20libgimp,=20pdb:=20all=20gimp=5F*=5Fpopup?= =?UTF-8?q?()=20PDB=20calls=20now=20take=20a=20resource=20object=20as?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … argument (not a resource name). --- app/core/gimp-gui.c | 7 +++---- app/core/gimp-gui.h | 4 ++-- app/gui/gui-vtable.c | 7 ++----- app/pdb/brush-select-cmds.c | 20 +++++++++----------- app/pdb/font-select-cmds.c | 20 +++++++++----------- app/pdb/gradient-select-cmds.c | 20 +++++++++----------- app/pdb/palette-select-cmds.c | 20 +++++++++----------- app/pdb/pattern-select-cmds.c | 20 +++++++++----------- libgimp/gimpbrushselect_pdb.c | 6 +++--- libgimp/gimpbrushselect_pdb.h | 2 +- libgimp/gimpfontselect_pdb.c | 6 +++--- libgimp/gimpfontselect_pdb.h | 2 +- libgimp/gimpgradientselect_pdb.c | 12 ++++++------ libgimp/gimpgradientselect_pdb.h | 2 +- libgimp/gimppaletteselect_pdb.c | 6 +++--- libgimp/gimppaletteselect_pdb.h | 2 +- libgimp/gimppatternselect_pdb.c | 6 +++--- libgimp/gimppatternselect_pdb.h | 2 +- libgimp/gimpresourceselect.c | 14 +++++--------- pdb/groups/brush_select.pdb | 9 ++++----- pdb/groups/font_select.pdb | 7 +++---- pdb/groups/gradient_select.pdb | 9 ++++----- pdb/groups/palette_select.pdb | 9 ++++----- pdb/groups/pattern_select.pdb | 9 ++++----- 24 files changed, 99 insertions(+), 122 deletions(-) diff --git a/app/core/gimp-gui.c b/app/core/gimp-gui.c index 98d518aa6c..c08da6b67d 100644 --- a/app/core/gimp-gui.c +++ b/app/core/gimp-gui.c @@ -407,7 +407,7 @@ gimp_pdb_dialog_new (Gimp *gimp, GBytes *parent_handle, const gchar *title, const gchar *callback_name, - const gchar *object_name, + GimpObject *object, ...) { gboolean retval = FALSE; @@ -423,12 +423,11 @@ gimp_pdb_dialog_new (Gimp *gimp, { va_list args; - va_start (args, object_name); + va_start (args, object); retval = gimp->gui.pdb_dialog_new (gimp, context, progress, container, parent_handle, title, - callback_name, object_name, - args); + callback_name, object, args); va_end (args); } diff --git a/app/core/gimp-gui.h b/app/core/gimp-gui.h index 33c5a0f1b0..f11deca70d 100644 --- a/app/core/gimp-gui.h +++ b/app/core/gimp-gui.h @@ -77,7 +77,7 @@ struct _GimpGui GBytes *parent_handle, const gchar *title, const gchar *callback_name, - const gchar *object_name, + GimpObject *object, va_list args); gboolean (* pdb_dialog_set) (Gimp *gimp, GimpContainer *container, @@ -176,7 +176,7 @@ gboolean gimp_pdb_dialog_new (Gimp *gimp, GBytes *parent_handle, const gchar *title, const gchar *callback_name, - const gchar *object_name, + GimpObject *object, ...) G_GNUC_NULL_TERMINATED; gboolean gimp_pdb_dialog_set (Gimp *gimp, GimpContainer *container, diff --git a/app/gui/gui-vtable.c b/app/gui/gui-vtable.c index 3ba1bc8ad9..cc8c6e624b 100644 --- a/app/gui/gui-vtable.c +++ b/app/gui/gui-vtable.c @@ -156,7 +156,7 @@ static gboolean gui_pdb_dialog_new (Gimp *gimp, GBytes *parent_handle, const gchar *title, const gchar *callback_name, - const gchar *object_name, + GimpObject *object, va_list args); static gboolean gui_pdb_dialog_set (Gimp *gimp, GimpContainer *container, @@ -615,7 +615,7 @@ gui_pdb_dialog_new (Gimp *gimp, GBytes *parent_handle, const gchar *title, const gchar *callback_name, - const gchar *object_name, + GimpObject *object, va_list args) { GType dialog_type = G_TYPE_NONE; @@ -657,9 +657,6 @@ gui_pdb_dialog_new (Gimp *gimp, { GimpObject *object = NULL; - if (object_name && strlen (object_name)) - object = gimp_container_get_child_by_name (container, object_name); - if (! object) object = gimp_context_get_by_type (context, gimp_container_get_children_type (container)); diff --git a/app/pdb/brush-select-cmds.c b/app/pdb/brush-select-cmds.c index 0a7619946e..ebd5ed94ca 100644 --- a/app/pdb/brush-select-cmds.c +++ b/app/pdb/brush-select-cmds.c @@ -50,12 +50,12 @@ brushes_popup_invoker (GimpProcedure *procedure, gboolean success = TRUE; const gchar *brush_callback; const gchar *popup_title; - const gchar *initial_brush_name; + GimpBrush *initial_brush; GBytes *parent_window; brush_callback = g_value_get_string (gimp_value_array_index (args, 0)); popup_title = g_value_get_string (gimp_value_array_index (args, 1)); - initial_brush_name = g_value_get_string (gimp_value_array_index (args, 2)); + initial_brush = g_value_get_object (gimp_value_array_index (args, 2)); parent_window = g_value_get_boxed (gimp_value_array_index (args, 3)); if (success) @@ -64,9 +64,8 @@ brushes_popup_invoker (GimpProcedure *procedure, ! gimp_pdb_lookup_procedure (gimp->pdb, brush_callback) || ! gimp_pdb_dialog_new (gimp, context, progress, gimp_data_factory_get_container (gimp->brush_factory), - parent_window, - popup_title, brush_callback, initial_brush_name, - NULL)) + parent_window, popup_title, brush_callback, + GIMP_OBJECT (initial_brush), NULL)) success = FALSE; } @@ -162,12 +161,11 @@ register_brush_select_procs (GimpPDB *pdb) NULL, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, - gimp_param_spec_string ("initial-brush-name", - "initial brush name", - "The name of the brush to set as the initial choice", - FALSE, TRUE, FALSE, - NULL, - GIMP_PARAM_READWRITE)); + gimp_param_spec_brush ("initial-brush", + "initial brush", + "The brush to set as the initial choice", + FALSE, + GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, g_param_spec_boxed ("parent-window", "parent window", diff --git a/app/pdb/font-select-cmds.c b/app/pdb/font-select-cmds.c index 11617a8795..5b9b3a5479 100644 --- a/app/pdb/font-select-cmds.c +++ b/app/pdb/font-select-cmds.c @@ -50,12 +50,12 @@ fonts_popup_invoker (GimpProcedure *procedure, gboolean success = TRUE; const gchar *font_callback; const gchar *popup_title; - const gchar *initial_font_name; + GimpFont *initial_font; GBytes *parent_window; font_callback = g_value_get_string (gimp_value_array_index (args, 0)); popup_title = g_value_get_string (gimp_value_array_index (args, 1)); - initial_font_name = g_value_get_string (gimp_value_array_index (args, 2)); + initial_font = g_value_get_object (gimp_value_array_index (args, 2)); parent_window = g_value_get_boxed (gimp_value_array_index (args, 3)); if (success) @@ -65,9 +65,8 @@ fonts_popup_invoker (GimpProcedure *procedure, ! gimp_data_factory_data_wait (gimp->font_factory) || ! gimp_pdb_dialog_new (gimp, context, progress, gimp_data_factory_get_container (gimp->font_factory), - parent_window, - popup_title, font_callback, initial_font_name, - NULL)) + parent_window, popup_title, font_callback, + GIMP_OBJECT (initial_font), NULL)) success = FALSE; } @@ -165,12 +164,11 @@ register_font_select_procs (GimpPDB *pdb) NULL, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, - gimp_param_spec_string ("initial-font-name", - "initial font name", - "The name of the initial font choice.", - FALSE, TRUE, FALSE, - NULL, - GIMP_PARAM_READWRITE)); + gimp_param_spec_font ("initial-font", + "initial font", + "The name of the initial font choice.", + FALSE, + GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, g_param_spec_boxed ("parent-window", "parent window", diff --git a/app/pdb/gradient-select-cmds.c b/app/pdb/gradient-select-cmds.c index ebfeb6af17..65c4625ba8 100644 --- a/app/pdb/gradient-select-cmds.c +++ b/app/pdb/gradient-select-cmds.c @@ -50,12 +50,12 @@ gradients_popup_invoker (GimpProcedure *procedure, gboolean success = TRUE; const gchar *gradient_callback; const gchar *popup_title; - const gchar *initial_gradient_name; + GimpGradient *initial_gradient; GBytes *parent_window; gradient_callback = g_value_get_string (gimp_value_array_index (args, 0)); popup_title = g_value_get_string (gimp_value_array_index (args, 1)); - initial_gradient_name = g_value_get_string (gimp_value_array_index (args, 2)); + initial_gradient = g_value_get_object (gimp_value_array_index (args, 2)); parent_window = g_value_get_boxed (gimp_value_array_index (args, 3)); if (success) @@ -70,9 +70,8 @@ gradients_popup_invoker (GimpProcedure *procedure, ! gimp_pdb_lookup_procedure (gimp->pdb, gradient_callback) || ! gimp_pdb_dialog_new (gimp, context, progress, gimp_data_factory_get_container (gimp->gradient_factory), - parent_window, - popup_title, gradient_callback, initial_gradient_name, - NULL)) + parent_window, popup_title, gradient_callback, + GIMP_OBJECT (initial_gradient), NULL)) success = FALSE; } @@ -168,12 +167,11 @@ register_gradient_select_procs (GimpPDB *pdb) NULL, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, - gimp_param_spec_string ("initial-gradient-name", - "initial gradient name", - "The name of the initial gradient choice", - FALSE, TRUE, FALSE, - NULL, - GIMP_PARAM_READWRITE)); + gimp_param_spec_gradient ("initial-gradient", + "initial gradient", + "The initial gradient choice", + FALSE, + GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, g_param_spec_boxed ("parent-window", "parent window", diff --git a/app/pdb/palette-select-cmds.c b/app/pdb/palette-select-cmds.c index a2c870bb10..6f54a5dbcc 100644 --- a/app/pdb/palette-select-cmds.c +++ b/app/pdb/palette-select-cmds.c @@ -50,12 +50,12 @@ palettes_popup_invoker (GimpProcedure *procedure, gboolean success = TRUE; const gchar *palette_callback; const gchar *popup_title; - const gchar *initial_palette_name; + GimpPalette *initial_palette; GBytes *parent_window; palette_callback = g_value_get_string (gimp_value_array_index (args, 0)); popup_title = g_value_get_string (gimp_value_array_index (args, 1)); - initial_palette_name = g_value_get_string (gimp_value_array_index (args, 2)); + initial_palette = g_value_get_object (gimp_value_array_index (args, 2)); parent_window = g_value_get_boxed (gimp_value_array_index (args, 3)); if (success) @@ -64,9 +64,8 @@ palettes_popup_invoker (GimpProcedure *procedure, ! gimp_pdb_lookup_procedure (gimp->pdb, palette_callback) || ! gimp_pdb_dialog_new (gimp, context, progress, gimp_data_factory_get_container (gimp->palette_factory), - parent_window, - popup_title, palette_callback, initial_palette_name, - NULL)) + parent_window, popup_title, palette_callback, + GIMP_OBJECT (initial_palette), NULL)) success = FALSE; } @@ -162,12 +161,11 @@ register_palette_select_procs (GimpPDB *pdb) NULL, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, - gimp_param_spec_string ("initial-palette-name", - "initial palette name", - "The name of the palette to set as the initial choice.", - FALSE, TRUE, FALSE, - NULL, - GIMP_PARAM_READWRITE)); + gimp_param_spec_palette ("initial-palette", + "initial palette", + "The palette to set as the initial choice.", + FALSE, + GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, g_param_spec_boxed ("parent-window", "parent window", diff --git a/app/pdb/pattern-select-cmds.c b/app/pdb/pattern-select-cmds.c index adcb7f91c7..39c6205bf5 100644 --- a/app/pdb/pattern-select-cmds.c +++ b/app/pdb/pattern-select-cmds.c @@ -50,12 +50,12 @@ patterns_popup_invoker (GimpProcedure *procedure, gboolean success = TRUE; const gchar *pattern_callback; const gchar *popup_title; - const gchar *initial_pattern_name; + GimpPattern *initial_pattern; GBytes *parent_window; pattern_callback = g_value_get_string (gimp_value_array_index (args, 0)); popup_title = g_value_get_string (gimp_value_array_index (args, 1)); - initial_pattern_name = g_value_get_string (gimp_value_array_index (args, 2)); + initial_pattern = g_value_get_object (gimp_value_array_index (args, 2)); parent_window = g_value_get_boxed (gimp_value_array_index (args, 3)); if (success) @@ -64,9 +64,8 @@ patterns_popup_invoker (GimpProcedure *procedure, ! gimp_pdb_lookup_procedure (gimp->pdb, pattern_callback) || ! gimp_pdb_dialog_new (gimp, context, progress, gimp_data_factory_get_container (gimp->pattern_factory), - parent_window, - popup_title, pattern_callback, initial_pattern_name, - NULL)) + parent_window, popup_title, pattern_callback, + GIMP_OBJECT (initial_pattern), NULL)) success = FALSE; } @@ -162,12 +161,11 @@ register_pattern_select_procs (GimpPDB *pdb) NULL, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, - gimp_param_spec_string ("initial-pattern-name", - "initial pattern name", - "The name of the pattern to set as the initial choice", - FALSE, TRUE, FALSE, - NULL, - GIMP_PARAM_READWRITE)); + gimp_param_spec_pattern ("initial-pattern", + "initial pattern", + "The pattern to set as the initial choice", + FALSE, + GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, g_param_spec_boxed ("parent-window", "parent window", diff --git a/libgimp/gimpbrushselect_pdb.c b/libgimp/gimpbrushselect_pdb.c index 555701e219..41d713d911 100644 --- a/libgimp/gimpbrushselect_pdb.c +++ b/libgimp/gimpbrushselect_pdb.c @@ -41,7 +41,7 @@ * gimp_brushes_popup: * @brush_callback: The callback PDB proc to call when user chooses a brush. * @popup_title: Title of the brush selection dialog. - * @initial_brush_name: The name of the brush to set as the initial choice. + * @initial_brush: The brush to set as the initial choice. * @parent_window: An optional parent window handle for the popup to be set transient to. * * Invokes the GIMP brush selection dialog. @@ -53,7 +53,7 @@ gboolean gimp_brushes_popup (const gchar *brush_callback, const gchar *popup_title, - const gchar *initial_brush_name, + GimpBrush *initial_brush, GBytes *parent_window) { GimpValueArray *args; @@ -63,7 +63,7 @@ gimp_brushes_popup (const gchar *brush_callback, args = gimp_value_array_new_from_types (NULL, G_TYPE_STRING, brush_callback, G_TYPE_STRING, popup_title, - G_TYPE_STRING, initial_brush_name, + GIMP_TYPE_BRUSH, initial_brush, G_TYPE_BYTES, parent_window, G_TYPE_NONE); diff --git a/libgimp/gimpbrushselect_pdb.h b/libgimp/gimpbrushselect_pdb.h index 493eae63e3..ed7c607638 100644 --- a/libgimp/gimpbrushselect_pdb.h +++ b/libgimp/gimpbrushselect_pdb.h @@ -34,7 +34,7 @@ G_BEGIN_DECLS gboolean gimp_brushes_popup (const gchar *brush_callback, const gchar *popup_title, - const gchar *initial_brush_name, + GimpBrush *initial_brush, GBytes *parent_window); gboolean gimp_brushes_close_popup (const gchar *brush_callback); gboolean gimp_brushes_set_popup (const gchar *brush_callback, diff --git a/libgimp/gimpfontselect_pdb.c b/libgimp/gimpfontselect_pdb.c index b23554a4a7..ec468818e8 100644 --- a/libgimp/gimpfontselect_pdb.c +++ b/libgimp/gimpfontselect_pdb.c @@ -49,7 +49,7 @@ * gimp_fonts_popup: * @font_callback: The callback PDB proc to call when user chooses a font. * @popup_title: Title of the font selection dialog. - * @initial_font_name: The name of the initial font choice. + * @initial_font: The name of the initial font choice. * @parent_window: An optional parent window handle for the popup to be set transient to. * * Invokes the Gimp font selection dialog. @@ -61,7 +61,7 @@ gboolean gimp_fonts_popup (const gchar *font_callback, const gchar *popup_title, - const gchar *initial_font_name, + GimpFont *initial_font, GBytes *parent_window) { GimpValueArray *args; @@ -71,7 +71,7 @@ gimp_fonts_popup (const gchar *font_callback, args = gimp_value_array_new_from_types (NULL, G_TYPE_STRING, font_callback, G_TYPE_STRING, popup_title, - G_TYPE_STRING, initial_font_name, + GIMP_TYPE_FONT, initial_font, G_TYPE_BYTES, parent_window, G_TYPE_NONE); diff --git a/libgimp/gimpfontselect_pdb.h b/libgimp/gimpfontselect_pdb.h index ed1866fb10..3cb1d50992 100644 --- a/libgimp/gimpfontselect_pdb.h +++ b/libgimp/gimpfontselect_pdb.h @@ -34,7 +34,7 @@ G_BEGIN_DECLS gboolean gimp_fonts_popup (const gchar *font_callback, const gchar *popup_title, - const gchar *initial_font_name, + GimpFont *initial_font, GBytes *parent_window); gboolean gimp_fonts_close_popup (const gchar *font_callback); gboolean gimp_fonts_set_popup (const gchar *font_callback, diff --git a/libgimp/gimpgradientselect_pdb.c b/libgimp/gimpgradientselect_pdb.c index 507cd19f48..46f162cbfd 100644 --- a/libgimp/gimpgradientselect_pdb.c +++ b/libgimp/gimpgradientselect_pdb.c @@ -41,7 +41,7 @@ * gimp_gradients_popup: * @gradient_callback: The callback PDB proc to call when user chooses a gradient. * @popup_title: Title of the gradient selection dialog. - * @initial_gradient_name: The name of the initial gradient choice. + * @initial_gradient: The initial gradient choice. * @parent_window: An optional parent window handle for the popup to be set transient to. * * Invokes the Gimp gradients selection dialog. @@ -51,10 +51,10 @@ * Returns: TRUE on success. **/ gboolean -gimp_gradients_popup (const gchar *gradient_callback, - const gchar *popup_title, - const gchar *initial_gradient_name, - GBytes *parent_window) +gimp_gradients_popup (const gchar *gradient_callback, + const gchar *popup_title, + GimpGradient *initial_gradient, + GBytes *parent_window) { GimpValueArray *args; GimpValueArray *return_vals; @@ -63,7 +63,7 @@ gimp_gradients_popup (const gchar *gradient_callback, args = gimp_value_array_new_from_types (NULL, G_TYPE_STRING, gradient_callback, G_TYPE_STRING, popup_title, - G_TYPE_STRING, initial_gradient_name, + GIMP_TYPE_GRADIENT, initial_gradient, G_TYPE_BYTES, parent_window, G_TYPE_NONE); diff --git a/libgimp/gimpgradientselect_pdb.h b/libgimp/gimpgradientselect_pdb.h index d094a3bea1..ee9912cf4f 100644 --- a/libgimp/gimpgradientselect_pdb.h +++ b/libgimp/gimpgradientselect_pdb.h @@ -34,7 +34,7 @@ G_BEGIN_DECLS gboolean gimp_gradients_popup (const gchar *gradient_callback, const gchar *popup_title, - const gchar *initial_gradient_name, + GimpGradient *initial_gradient, GBytes *parent_window); gboolean gimp_gradients_close_popup (const gchar *gradient_callback); gboolean gimp_gradients_set_popup (const gchar *gradient_callback, diff --git a/libgimp/gimppaletteselect_pdb.c b/libgimp/gimppaletteselect_pdb.c index 9c41fbbc91..7a75a1b715 100644 --- a/libgimp/gimppaletteselect_pdb.c +++ b/libgimp/gimppaletteselect_pdb.c @@ -41,7 +41,7 @@ * gimp_palettes_popup: * @palette_callback: The callback PDB proc to call when user chooses a palette. * @popup_title: Title of the palette selection dialog. - * @initial_palette_name: The name of the palette to set as the initial choice. + * @initial_palette: The palette to set as the initial choice. * @parent_window: An optional parent window handle for the popup to be set transient to. * * Invokes the Gimp palette selection dialog. @@ -53,7 +53,7 @@ gboolean gimp_palettes_popup (const gchar *palette_callback, const gchar *popup_title, - const gchar *initial_palette_name, + GimpPalette *initial_palette, GBytes *parent_window) { GimpValueArray *args; @@ -63,7 +63,7 @@ gimp_palettes_popup (const gchar *palette_callback, args = gimp_value_array_new_from_types (NULL, G_TYPE_STRING, palette_callback, G_TYPE_STRING, popup_title, - G_TYPE_STRING, initial_palette_name, + GIMP_TYPE_PALETTE, initial_palette, G_TYPE_BYTES, parent_window, G_TYPE_NONE); diff --git a/libgimp/gimppaletteselect_pdb.h b/libgimp/gimppaletteselect_pdb.h index faf8e179f4..31f62dff45 100644 --- a/libgimp/gimppaletteselect_pdb.h +++ b/libgimp/gimppaletteselect_pdb.h @@ -34,7 +34,7 @@ G_BEGIN_DECLS gboolean gimp_palettes_popup (const gchar *palette_callback, const gchar *popup_title, - const gchar *initial_palette_name, + GimpPalette *initial_palette, GBytes *parent_window); gboolean gimp_palettes_close_popup (const gchar *palette_callback); gboolean gimp_palettes_set_popup (const gchar *palette_callback, diff --git a/libgimp/gimppatternselect_pdb.c b/libgimp/gimppatternselect_pdb.c index d4308e41f0..c59ff4a20c 100644 --- a/libgimp/gimppatternselect_pdb.c +++ b/libgimp/gimppatternselect_pdb.c @@ -41,7 +41,7 @@ * gimp_patterns_popup: * @pattern_callback: The callback PDB proc to call when the user chooses a pattern. * @popup_title: Title of the pattern selection dialog. - * @initial_pattern_name: The name of the pattern to set as the initial choice. + * @initial_pattern: The pattern to set as the initial choice. * @parent_window: An optional parent window handle for the popup to be set transient to. * * Invokes the Gimp pattern selection. @@ -53,7 +53,7 @@ gboolean gimp_patterns_popup (const gchar *pattern_callback, const gchar *popup_title, - const gchar *initial_pattern_name, + GimpPattern *initial_pattern, GBytes *parent_window) { GimpValueArray *args; @@ -63,7 +63,7 @@ gimp_patterns_popup (const gchar *pattern_callback, args = gimp_value_array_new_from_types (NULL, G_TYPE_STRING, pattern_callback, G_TYPE_STRING, popup_title, - G_TYPE_STRING, initial_pattern_name, + GIMP_TYPE_PATTERN, initial_pattern, G_TYPE_BYTES, parent_window, G_TYPE_NONE); diff --git a/libgimp/gimppatternselect_pdb.h b/libgimp/gimppatternselect_pdb.h index b2cc215846..6c29d5ee86 100644 --- a/libgimp/gimppatternselect_pdb.h +++ b/libgimp/gimppatternselect_pdb.h @@ -34,7 +34,7 @@ G_BEGIN_DECLS gboolean gimp_patterns_popup (const gchar *pattern_callback, const gchar *popup_title, - const gchar *initial_pattern_name, + GimpPattern *initial_pattern, GBytes *parent_window); gboolean gimp_patterns_close_popup (const gchar *pattern_callback); gboolean gimp_patterns_set_popup (const gchar *pattern_callback, diff --git a/libgimp/gimpresourceselect.c b/libgimp/gimpresourceselect.c index 97b791667e..c8e66e01fb 100644 --- a/libgimp/gimpresourceselect.c +++ b/libgimp/gimpresourceselect.c @@ -232,30 +232,26 @@ popup_remote_chooser (const gchar *title, GType resource_type) { gboolean result = FALSE; - gchar *resource_name; - - /* The PDB procedure still takes a name */ - resource_name = gimp_resource_get_name (resource); if (g_type_is_a (resource_type, GIMP_TYPE_BRUSH)) { - result = gimp_brushes_popup (temp_PDB_callback_name, title, resource_name, parent_handle); + result = gimp_brushes_popup (temp_PDB_callback_name, title, GIMP_BRUSH (resource), parent_handle); } else if (g_type_is_a (resource_type, GIMP_TYPE_FONT)) { - result = gimp_fonts_popup (temp_PDB_callback_name, title, resource_name, parent_handle); + result = gimp_fonts_popup (temp_PDB_callback_name, title, GIMP_FONT (resource), parent_handle); } else if (g_type_is_a (resource_type, GIMP_TYPE_GRADIENT)) { - result = gimp_gradients_popup (temp_PDB_callback_name, title, resource_name, parent_handle); + result = gimp_gradients_popup (temp_PDB_callback_name, title, GIMP_GRADIENT (resource), parent_handle); } else if (g_type_is_a (resource_type, GIMP_TYPE_PALETTE)) { - result = gimp_palettes_popup (temp_PDB_callback_name, title, resource_name, parent_handle); + result = gimp_palettes_popup (temp_PDB_callback_name, title, GIMP_PALETTE (resource), parent_handle); } else if (g_type_is_a (resource_type, GIMP_TYPE_PATTERN)) { - result = gimp_patterns_popup (temp_PDB_callback_name, title, resource_name, parent_handle); + result = gimp_patterns_popup (temp_PDB_callback_name, title, GIMP_PATTERN (resource), parent_handle); } else { diff --git a/pdb/groups/brush_select.pdb b/pdb/groups/brush_select.pdb index 6d5cbf3694..54a4b77dc3 100644 --- a/pdb/groups/brush_select.pdb +++ b/pdb/groups/brush_select.pdb @@ -27,8 +27,8 @@ sub brushes_popup { desc => 'The callback PDB proc to call when user chooses a brush' }, { name => 'popup_title', type => 'string', desc => 'Title of the brush selection dialog' }, - { name => 'initial_brush_name', type => 'string', null_ok => 1, - desc => 'The name of the brush to set as the initial choice' }, + { name => 'initial_brush', type => 'brush', null_ok => 1, + desc => 'The brush to set as the initial choice' }, { name => 'parent_window', type => 'bytes', null_ok => 1, desc => 'An optional parent window handle for the popup to be set transient to' } ); @@ -40,9 +40,8 @@ sub brushes_popup { ! gimp_pdb_lookup_procedure (gimp->pdb, brush_callback) || ! gimp_pdb_dialog_new (gimp, context, progress, gimp_data_factory_get_container (gimp->brush_factory), - parent_window, - popup_title, brush_callback, initial_brush_name, - NULL)) + parent_window, popup_title, brush_callback, + GIMP_OBJECT (initial_brush), NULL)) success = FALSE; } CODE diff --git a/pdb/groups/font_select.pdb b/pdb/groups/font_select.pdb index 41a0020276..0e9169d916 100644 --- a/pdb/groups/font_select.pdb +++ b/pdb/groups/font_select.pdb @@ -28,7 +28,7 @@ sub fonts_popup { desc => 'The callback PDB proc to call when user chooses a font' }, { name => 'popup_title', type => 'string', desc => 'Title of the font selection dialog' }, - { name => 'initial_font_name', type => 'string', null_ok => 1, + { name => 'initial_font', type => 'font', null_ok => 1, desc => 'The name of the initial font choice.' }, { name => 'parent_window', type => 'bytes', null_ok => 1, desc => 'An optional parent window handle for the popup to be set transient to' } @@ -42,9 +42,8 @@ sub fonts_popup { ! gimp_data_factory_data_wait (gimp->font_factory) || ! gimp_pdb_dialog_new (gimp, context, progress, gimp_data_factory_get_container (gimp->font_factory), - parent_window, - popup_title, font_callback, initial_font_name, - NULL)) + parent_window, popup_title, font_callback, + GIMP_OBJECT (initial_font), NULL)) success = FALSE; } CODE diff --git a/pdb/groups/gradient_select.pdb b/pdb/groups/gradient_select.pdb index fa9fd3ccaf..aab1a9f802 100644 --- a/pdb/groups/gradient_select.pdb +++ b/pdb/groups/gradient_select.pdb @@ -28,8 +28,8 @@ sub gradients_popup { desc => 'The callback PDB proc to call when user chooses a gradient' }, { name => 'popup_title', type => 'string', desc => 'Title of the gradient selection dialog' }, - { name => 'initial_gradient_name', type => 'string', null_ok => 1, - desc => 'The name of the initial gradient choice' }, + { name => 'initial_gradient', type => 'gradient', null_ok => 1, + desc => 'The initial gradient choice' }, { name => 'parent_window', type => 'bytes', null_ok => 1, desc => 'An optional parent window handle for the popup to be set transient to' } ); @@ -47,9 +47,8 @@ sub gradients_popup { ! gimp_pdb_lookup_procedure (gimp->pdb, gradient_callback) || ! gimp_pdb_dialog_new (gimp, context, progress, gimp_data_factory_get_container (gimp->gradient_factory), - parent_window, - popup_title, gradient_callback, initial_gradient_name, - NULL)) + parent_window, popup_title, gradient_callback, + GIMP_OBJECT (initial_gradient), NULL)) success = FALSE; } CODE diff --git a/pdb/groups/palette_select.pdb b/pdb/groups/palette_select.pdb index 41f55c240d..e8c4dda278 100644 --- a/pdb/groups/palette_select.pdb +++ b/pdb/groups/palette_select.pdb @@ -27,8 +27,8 @@ sub palettes_popup { desc => 'The callback PDB proc to call when user chooses a palette' }, { name => 'popup_title', type => 'string', desc => 'Title of the palette selection dialog' }, - { name => 'initial_palette_name', type => 'string', null_ok => 1, - desc => 'The name of the palette to set as the initial choice.' }, + { name => 'initial_palette', type => 'palette', null_ok => 1, + desc => 'The palette to set as the initial choice.' }, { name => 'parent_window', type => 'bytes', null_ok => 1, desc => 'An optional parent window handle for the popup to be set transient to' } ); @@ -40,9 +40,8 @@ sub palettes_popup { ! gimp_pdb_lookup_procedure (gimp->pdb, palette_callback) || ! gimp_pdb_dialog_new (gimp, context, progress, gimp_data_factory_get_container (gimp->palette_factory), - parent_window, - popup_title, palette_callback, initial_palette_name, - NULL)) + parent_window, popup_title, palette_callback, + GIMP_OBJECT (initial_palette), NULL)) success = FALSE; } CODE diff --git a/pdb/groups/pattern_select.pdb b/pdb/groups/pattern_select.pdb index e5d107352f..10403fdef2 100644 --- a/pdb/groups/pattern_select.pdb +++ b/pdb/groups/pattern_select.pdb @@ -27,8 +27,8 @@ sub patterns_popup { desc => 'The callback PDB proc to call when the user chooses a pattern' }, { name => 'popup_title', type => 'string', desc => 'Title of the pattern selection dialog' }, - { name => 'initial_pattern_name', type => 'string', null_ok => 1, - desc => 'The name of the pattern to set as the initial choice' }, + { name => 'initial_pattern', type => 'pattern', null_ok => 1, + desc => 'The pattern to set as the initial choice' }, { name => 'parent_window', type => 'bytes', null_ok => 1, desc => 'An optional parent window handle for the popup to be set transient to' } ); @@ -40,9 +40,8 @@ sub patterns_popup { ! gimp_pdb_lookup_procedure (gimp->pdb, pattern_callback) || ! gimp_pdb_dialog_new (gimp, context, progress, gimp_data_factory_get_container (gimp->pattern_factory), - parent_window, - popup_title, pattern_callback, initial_pattern_name, - NULL)) + parent_window, popup_title, pattern_callback, + GIMP_OBJECT (initial_pattern), NULL)) success = FALSE; } CODE