app, libgimp, pdb: all gimp_*_popup() PDB calls now take a resource object as…

… argument (not a resource name).
This commit is contained in:
Jehan 2023-08-17 01:30:59 +02:00
parent b578fd8cf1
commit d84c4d763b
24 changed files with 99 additions and 122 deletions

View file

@ -407,7 +407,7 @@ gimp_pdb_dialog_new (Gimp *gimp,
GBytes *parent_handle, GBytes *parent_handle,
const gchar *title, const gchar *title,
const gchar *callback_name, const gchar *callback_name,
const gchar *object_name, GimpObject *object,
...) ...)
{ {
gboolean retval = FALSE; gboolean retval = FALSE;
@ -423,12 +423,11 @@ gimp_pdb_dialog_new (Gimp *gimp,
{ {
va_list args; va_list args;
va_start (args, object_name); va_start (args, object);
retval = gimp->gui.pdb_dialog_new (gimp, context, progress, retval = gimp->gui.pdb_dialog_new (gimp, context, progress,
container, parent_handle, title, container, parent_handle, title,
callback_name, object_name, callback_name, object, args);
args);
va_end (args); va_end (args);
} }

View file

@ -77,7 +77,7 @@ struct _GimpGui
GBytes *parent_handle, GBytes *parent_handle,
const gchar *title, const gchar *title,
const gchar *callback_name, const gchar *callback_name,
const gchar *object_name, GimpObject *object,
va_list args); va_list args);
gboolean (* pdb_dialog_set) (Gimp *gimp, gboolean (* pdb_dialog_set) (Gimp *gimp,
GimpContainer *container, GimpContainer *container,
@ -176,7 +176,7 @@ gboolean gimp_pdb_dialog_new (Gimp *gimp,
GBytes *parent_handle, GBytes *parent_handle,
const gchar *title, const gchar *title,
const gchar *callback_name, const gchar *callback_name,
const gchar *object_name, GimpObject *object,
...) G_GNUC_NULL_TERMINATED; ...) G_GNUC_NULL_TERMINATED;
gboolean gimp_pdb_dialog_set (Gimp *gimp, gboolean gimp_pdb_dialog_set (Gimp *gimp,
GimpContainer *container, GimpContainer *container,

View file

@ -156,7 +156,7 @@ static gboolean gui_pdb_dialog_new (Gimp *gimp,
GBytes *parent_handle, GBytes *parent_handle,
const gchar *title, const gchar *title,
const gchar *callback_name, const gchar *callback_name,
const gchar *object_name, GimpObject *object,
va_list args); va_list args);
static gboolean gui_pdb_dialog_set (Gimp *gimp, static gboolean gui_pdb_dialog_set (Gimp *gimp,
GimpContainer *container, GimpContainer *container,
@ -615,7 +615,7 @@ gui_pdb_dialog_new (Gimp *gimp,
GBytes *parent_handle, GBytes *parent_handle,
const gchar *title, const gchar *title,
const gchar *callback_name, const gchar *callback_name,
const gchar *object_name, GimpObject *object,
va_list args) va_list args)
{ {
GType dialog_type = G_TYPE_NONE; GType dialog_type = G_TYPE_NONE;
@ -657,9 +657,6 @@ gui_pdb_dialog_new (Gimp *gimp,
{ {
GimpObject *object = NULL; GimpObject *object = NULL;
if (object_name && strlen (object_name))
object = gimp_container_get_child_by_name (container, object_name);
if (! object) if (! object)
object = gimp_context_get_by_type (context, object = gimp_context_get_by_type (context,
gimp_container_get_children_type (container)); gimp_container_get_children_type (container));

View file

@ -50,12 +50,12 @@ brushes_popup_invoker (GimpProcedure *procedure,
gboolean success = TRUE; gboolean success = TRUE;
const gchar *brush_callback; const gchar *brush_callback;
const gchar *popup_title; const gchar *popup_title;
const gchar *initial_brush_name; GimpBrush *initial_brush;
GBytes *parent_window; GBytes *parent_window;
brush_callback = g_value_get_string (gimp_value_array_index (args, 0)); brush_callback = g_value_get_string (gimp_value_array_index (args, 0));
popup_title = g_value_get_string (gimp_value_array_index (args, 1)); 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)); parent_window = g_value_get_boxed (gimp_value_array_index (args, 3));
if (success) if (success)
@ -64,9 +64,8 @@ brushes_popup_invoker (GimpProcedure *procedure,
! gimp_pdb_lookup_procedure (gimp->pdb, brush_callback) || ! gimp_pdb_lookup_procedure (gimp->pdb, brush_callback) ||
! gimp_pdb_dialog_new (gimp, context, progress, ! gimp_pdb_dialog_new (gimp, context, progress,
gimp_data_factory_get_container (gimp->brush_factory), gimp_data_factory_get_container (gimp->brush_factory),
parent_window, parent_window, popup_title, brush_callback,
popup_title, brush_callback, initial_brush_name, GIMP_OBJECT (initial_brush), NULL))
NULL))
success = FALSE; success = FALSE;
} }
@ -162,12 +161,11 @@ register_brush_select_procs (GimpPDB *pdb)
NULL, NULL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("initial-brush-name", gimp_param_spec_brush ("initial-brush",
"initial brush name", "initial brush",
"The name of the brush to set as the initial choice", "The brush to set as the initial choice",
FALSE, TRUE, FALSE, FALSE,
NULL, GIMP_PARAM_READWRITE));
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
g_param_spec_boxed ("parent-window", g_param_spec_boxed ("parent-window",
"parent window", "parent window",

View file

@ -50,12 +50,12 @@ fonts_popup_invoker (GimpProcedure *procedure,
gboolean success = TRUE; gboolean success = TRUE;
const gchar *font_callback; const gchar *font_callback;
const gchar *popup_title; const gchar *popup_title;
const gchar *initial_font_name; GimpFont *initial_font;
GBytes *parent_window; GBytes *parent_window;
font_callback = g_value_get_string (gimp_value_array_index (args, 0)); font_callback = g_value_get_string (gimp_value_array_index (args, 0));
popup_title = g_value_get_string (gimp_value_array_index (args, 1)); 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)); parent_window = g_value_get_boxed (gimp_value_array_index (args, 3));
if (success) if (success)
@ -65,9 +65,8 @@ fonts_popup_invoker (GimpProcedure *procedure,
! gimp_data_factory_data_wait (gimp->font_factory) || ! gimp_data_factory_data_wait (gimp->font_factory) ||
! gimp_pdb_dialog_new (gimp, context, progress, ! gimp_pdb_dialog_new (gimp, context, progress,
gimp_data_factory_get_container (gimp->font_factory), gimp_data_factory_get_container (gimp->font_factory),
parent_window, parent_window, popup_title, font_callback,
popup_title, font_callback, initial_font_name, GIMP_OBJECT (initial_font), NULL))
NULL))
success = FALSE; success = FALSE;
} }
@ -165,12 +164,11 @@ register_font_select_procs (GimpPDB *pdb)
NULL, NULL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("initial-font-name", gimp_param_spec_font ("initial-font",
"initial font name", "initial font",
"The name of the initial font choice.", "The name of the initial font choice.",
FALSE, TRUE, FALSE, FALSE,
NULL, GIMP_PARAM_READWRITE));
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
g_param_spec_boxed ("parent-window", g_param_spec_boxed ("parent-window",
"parent window", "parent window",

View file

@ -50,12 +50,12 @@ gradients_popup_invoker (GimpProcedure *procedure,
gboolean success = TRUE; gboolean success = TRUE;
const gchar *gradient_callback; const gchar *gradient_callback;
const gchar *popup_title; const gchar *popup_title;
const gchar *initial_gradient_name; GimpGradient *initial_gradient;
GBytes *parent_window; GBytes *parent_window;
gradient_callback = g_value_get_string (gimp_value_array_index (args, 0)); gradient_callback = g_value_get_string (gimp_value_array_index (args, 0));
popup_title = g_value_get_string (gimp_value_array_index (args, 1)); 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)); parent_window = g_value_get_boxed (gimp_value_array_index (args, 3));
if (success) if (success)
@ -70,9 +70,8 @@ gradients_popup_invoker (GimpProcedure *procedure,
! gimp_pdb_lookup_procedure (gimp->pdb, gradient_callback) || ! gimp_pdb_lookup_procedure (gimp->pdb, gradient_callback) ||
! gimp_pdb_dialog_new (gimp, context, progress, ! gimp_pdb_dialog_new (gimp, context, progress,
gimp_data_factory_get_container (gimp->gradient_factory), gimp_data_factory_get_container (gimp->gradient_factory),
parent_window, parent_window, popup_title, gradient_callback,
popup_title, gradient_callback, initial_gradient_name, GIMP_OBJECT (initial_gradient), NULL))
NULL))
success = FALSE; success = FALSE;
} }
@ -168,12 +167,11 @@ register_gradient_select_procs (GimpPDB *pdb)
NULL, NULL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("initial-gradient-name", gimp_param_spec_gradient ("initial-gradient",
"initial gradient name", "initial gradient",
"The name of the initial gradient choice", "The initial gradient choice",
FALSE, TRUE, FALSE, FALSE,
NULL, GIMP_PARAM_READWRITE));
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
g_param_spec_boxed ("parent-window", g_param_spec_boxed ("parent-window",
"parent window", "parent window",

View file

@ -50,12 +50,12 @@ palettes_popup_invoker (GimpProcedure *procedure,
gboolean success = TRUE; gboolean success = TRUE;
const gchar *palette_callback; const gchar *palette_callback;
const gchar *popup_title; const gchar *popup_title;
const gchar *initial_palette_name; GimpPalette *initial_palette;
GBytes *parent_window; GBytes *parent_window;
palette_callback = g_value_get_string (gimp_value_array_index (args, 0)); palette_callback = g_value_get_string (gimp_value_array_index (args, 0));
popup_title = g_value_get_string (gimp_value_array_index (args, 1)); 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)); parent_window = g_value_get_boxed (gimp_value_array_index (args, 3));
if (success) if (success)
@ -64,9 +64,8 @@ palettes_popup_invoker (GimpProcedure *procedure,
! gimp_pdb_lookup_procedure (gimp->pdb, palette_callback) || ! gimp_pdb_lookup_procedure (gimp->pdb, palette_callback) ||
! gimp_pdb_dialog_new (gimp, context, progress, ! gimp_pdb_dialog_new (gimp, context, progress,
gimp_data_factory_get_container (gimp->palette_factory), gimp_data_factory_get_container (gimp->palette_factory),
parent_window, parent_window, popup_title, palette_callback,
popup_title, palette_callback, initial_palette_name, GIMP_OBJECT (initial_palette), NULL))
NULL))
success = FALSE; success = FALSE;
} }
@ -162,12 +161,11 @@ register_palette_select_procs (GimpPDB *pdb)
NULL, NULL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("initial-palette-name", gimp_param_spec_palette ("initial-palette",
"initial palette name", "initial palette",
"The name of the palette to set as the initial choice.", "The palette to set as the initial choice.",
FALSE, TRUE, FALSE, FALSE,
NULL, GIMP_PARAM_READWRITE));
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
g_param_spec_boxed ("parent-window", g_param_spec_boxed ("parent-window",
"parent window", "parent window",

View file

@ -50,12 +50,12 @@ patterns_popup_invoker (GimpProcedure *procedure,
gboolean success = TRUE; gboolean success = TRUE;
const gchar *pattern_callback; const gchar *pattern_callback;
const gchar *popup_title; const gchar *popup_title;
const gchar *initial_pattern_name; GimpPattern *initial_pattern;
GBytes *parent_window; GBytes *parent_window;
pattern_callback = g_value_get_string (gimp_value_array_index (args, 0)); pattern_callback = g_value_get_string (gimp_value_array_index (args, 0));
popup_title = g_value_get_string (gimp_value_array_index (args, 1)); 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)); parent_window = g_value_get_boxed (gimp_value_array_index (args, 3));
if (success) if (success)
@ -64,9 +64,8 @@ patterns_popup_invoker (GimpProcedure *procedure,
! gimp_pdb_lookup_procedure (gimp->pdb, pattern_callback) || ! gimp_pdb_lookup_procedure (gimp->pdb, pattern_callback) ||
! gimp_pdb_dialog_new (gimp, context, progress, ! gimp_pdb_dialog_new (gimp, context, progress,
gimp_data_factory_get_container (gimp->pattern_factory), gimp_data_factory_get_container (gimp->pattern_factory),
parent_window, parent_window, popup_title, pattern_callback,
popup_title, pattern_callback, initial_pattern_name, GIMP_OBJECT (initial_pattern), NULL))
NULL))
success = FALSE; success = FALSE;
} }
@ -162,12 +161,11 @@ register_pattern_select_procs (GimpPDB *pdb)
NULL, NULL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("initial-pattern-name", gimp_param_spec_pattern ("initial-pattern",
"initial pattern name", "initial pattern",
"The name of the pattern to set as the initial choice", "The pattern to set as the initial choice",
FALSE, TRUE, FALSE, FALSE,
NULL, GIMP_PARAM_READWRITE));
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
g_param_spec_boxed ("parent-window", g_param_spec_boxed ("parent-window",
"parent window", "parent window",

View file

@ -41,7 +41,7 @@
* gimp_brushes_popup: * gimp_brushes_popup:
* @brush_callback: The callback PDB proc to call when user chooses a brush. * @brush_callback: The callback PDB proc to call when user chooses a brush.
* @popup_title: Title of the brush selection dialog. * @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. * @parent_window: An optional parent window handle for the popup to be set transient to.
* *
* Invokes the GIMP brush selection dialog. * Invokes the GIMP brush selection dialog.
@ -53,7 +53,7 @@
gboolean gboolean
gimp_brushes_popup (const gchar *brush_callback, gimp_brushes_popup (const gchar *brush_callback,
const gchar *popup_title, const gchar *popup_title,
const gchar *initial_brush_name, GimpBrush *initial_brush,
GBytes *parent_window) GBytes *parent_window)
{ {
GimpValueArray *args; GimpValueArray *args;
@ -63,7 +63,7 @@ gimp_brushes_popup (const gchar *brush_callback,
args = gimp_value_array_new_from_types (NULL, args = gimp_value_array_new_from_types (NULL,
G_TYPE_STRING, brush_callback, G_TYPE_STRING, brush_callback,
G_TYPE_STRING, popup_title, G_TYPE_STRING, popup_title,
G_TYPE_STRING, initial_brush_name, GIMP_TYPE_BRUSH, initial_brush,
G_TYPE_BYTES, parent_window, G_TYPE_BYTES, parent_window,
G_TYPE_NONE); G_TYPE_NONE);

View file

@ -34,7 +34,7 @@ G_BEGIN_DECLS
gboolean gimp_brushes_popup (const gchar *brush_callback, gboolean gimp_brushes_popup (const gchar *brush_callback,
const gchar *popup_title, const gchar *popup_title,
const gchar *initial_brush_name, GimpBrush *initial_brush,
GBytes *parent_window); GBytes *parent_window);
gboolean gimp_brushes_close_popup (const gchar *brush_callback); gboolean gimp_brushes_close_popup (const gchar *brush_callback);
gboolean gimp_brushes_set_popup (const gchar *brush_callback, gboolean gimp_brushes_set_popup (const gchar *brush_callback,

View file

@ -49,7 +49,7 @@
* gimp_fonts_popup: * gimp_fonts_popup:
* @font_callback: The callback PDB proc to call when user chooses a font. * @font_callback: The callback PDB proc to call when user chooses a font.
* @popup_title: Title of the font selection dialog. * @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. * @parent_window: An optional parent window handle for the popup to be set transient to.
* *
* Invokes the Gimp font selection dialog. * Invokes the Gimp font selection dialog.
@ -61,7 +61,7 @@
gboolean gboolean
gimp_fonts_popup (const gchar *font_callback, gimp_fonts_popup (const gchar *font_callback,
const gchar *popup_title, const gchar *popup_title,
const gchar *initial_font_name, GimpFont *initial_font,
GBytes *parent_window) GBytes *parent_window)
{ {
GimpValueArray *args; GimpValueArray *args;
@ -71,7 +71,7 @@ gimp_fonts_popup (const gchar *font_callback,
args = gimp_value_array_new_from_types (NULL, args = gimp_value_array_new_from_types (NULL,
G_TYPE_STRING, font_callback, G_TYPE_STRING, font_callback,
G_TYPE_STRING, popup_title, G_TYPE_STRING, popup_title,
G_TYPE_STRING, initial_font_name, GIMP_TYPE_FONT, initial_font,
G_TYPE_BYTES, parent_window, G_TYPE_BYTES, parent_window,
G_TYPE_NONE); G_TYPE_NONE);

View file

@ -34,7 +34,7 @@ G_BEGIN_DECLS
gboolean gimp_fonts_popup (const gchar *font_callback, gboolean gimp_fonts_popup (const gchar *font_callback,
const gchar *popup_title, const gchar *popup_title,
const gchar *initial_font_name, GimpFont *initial_font,
GBytes *parent_window); GBytes *parent_window);
gboolean gimp_fonts_close_popup (const gchar *font_callback); gboolean gimp_fonts_close_popup (const gchar *font_callback);
gboolean gimp_fonts_set_popup (const gchar *font_callback, gboolean gimp_fonts_set_popup (const gchar *font_callback,

View file

@ -41,7 +41,7 @@
* gimp_gradients_popup: * gimp_gradients_popup:
* @gradient_callback: The callback PDB proc to call when user chooses a gradient. * @gradient_callback: The callback PDB proc to call when user chooses a gradient.
* @popup_title: Title of the gradient selection dialog. * @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. * @parent_window: An optional parent window handle for the popup to be set transient to.
* *
* Invokes the Gimp gradients selection dialog. * Invokes the Gimp gradients selection dialog.
@ -51,10 +51,10 @@
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/
gboolean gboolean
gimp_gradients_popup (const gchar *gradient_callback, gimp_gradients_popup (const gchar *gradient_callback,
const gchar *popup_title, const gchar *popup_title,
const gchar *initial_gradient_name, GimpGradient *initial_gradient,
GBytes *parent_window) GBytes *parent_window)
{ {
GimpValueArray *args; GimpValueArray *args;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -63,7 +63,7 @@ gimp_gradients_popup (const gchar *gradient_callback,
args = gimp_value_array_new_from_types (NULL, args = gimp_value_array_new_from_types (NULL,
G_TYPE_STRING, gradient_callback, G_TYPE_STRING, gradient_callback,
G_TYPE_STRING, popup_title, G_TYPE_STRING, popup_title,
G_TYPE_STRING, initial_gradient_name, GIMP_TYPE_GRADIENT, initial_gradient,
G_TYPE_BYTES, parent_window, G_TYPE_BYTES, parent_window,
G_TYPE_NONE); G_TYPE_NONE);

View file

@ -34,7 +34,7 @@ G_BEGIN_DECLS
gboolean gimp_gradients_popup (const gchar *gradient_callback, gboolean gimp_gradients_popup (const gchar *gradient_callback,
const gchar *popup_title, const gchar *popup_title,
const gchar *initial_gradient_name, GimpGradient *initial_gradient,
GBytes *parent_window); GBytes *parent_window);
gboolean gimp_gradients_close_popup (const gchar *gradient_callback); gboolean gimp_gradients_close_popup (const gchar *gradient_callback);
gboolean gimp_gradients_set_popup (const gchar *gradient_callback, gboolean gimp_gradients_set_popup (const gchar *gradient_callback,

View file

@ -41,7 +41,7 @@
* gimp_palettes_popup: * gimp_palettes_popup:
* @palette_callback: The callback PDB proc to call when user chooses a palette. * @palette_callback: The callback PDB proc to call when user chooses a palette.
* @popup_title: Title of the palette selection dialog. * @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. * @parent_window: An optional parent window handle for the popup to be set transient to.
* *
* Invokes the Gimp palette selection dialog. * Invokes the Gimp palette selection dialog.
@ -53,7 +53,7 @@
gboolean gboolean
gimp_palettes_popup (const gchar *palette_callback, gimp_palettes_popup (const gchar *palette_callback,
const gchar *popup_title, const gchar *popup_title,
const gchar *initial_palette_name, GimpPalette *initial_palette,
GBytes *parent_window) GBytes *parent_window)
{ {
GimpValueArray *args; GimpValueArray *args;
@ -63,7 +63,7 @@ gimp_palettes_popup (const gchar *palette_callback,
args = gimp_value_array_new_from_types (NULL, args = gimp_value_array_new_from_types (NULL,
G_TYPE_STRING, palette_callback, G_TYPE_STRING, palette_callback,
G_TYPE_STRING, popup_title, G_TYPE_STRING, popup_title,
G_TYPE_STRING, initial_palette_name, GIMP_TYPE_PALETTE, initial_palette,
G_TYPE_BYTES, parent_window, G_TYPE_BYTES, parent_window,
G_TYPE_NONE); G_TYPE_NONE);

View file

@ -34,7 +34,7 @@ G_BEGIN_DECLS
gboolean gimp_palettes_popup (const gchar *palette_callback, gboolean gimp_palettes_popup (const gchar *palette_callback,
const gchar *popup_title, const gchar *popup_title,
const gchar *initial_palette_name, GimpPalette *initial_palette,
GBytes *parent_window); GBytes *parent_window);
gboolean gimp_palettes_close_popup (const gchar *palette_callback); gboolean gimp_palettes_close_popup (const gchar *palette_callback);
gboolean gimp_palettes_set_popup (const gchar *palette_callback, gboolean gimp_palettes_set_popup (const gchar *palette_callback,

View file

@ -41,7 +41,7 @@
* gimp_patterns_popup: * gimp_patterns_popup:
* @pattern_callback: The callback PDB proc to call when the user chooses a pattern. * @pattern_callback: The callback PDB proc to call when the user chooses a pattern.
* @popup_title: Title of the pattern selection dialog. * @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. * @parent_window: An optional parent window handle for the popup to be set transient to.
* *
* Invokes the Gimp pattern selection. * Invokes the Gimp pattern selection.
@ -53,7 +53,7 @@
gboolean gboolean
gimp_patterns_popup (const gchar *pattern_callback, gimp_patterns_popup (const gchar *pattern_callback,
const gchar *popup_title, const gchar *popup_title,
const gchar *initial_pattern_name, GimpPattern *initial_pattern,
GBytes *parent_window) GBytes *parent_window)
{ {
GimpValueArray *args; GimpValueArray *args;
@ -63,7 +63,7 @@ gimp_patterns_popup (const gchar *pattern_callback,
args = gimp_value_array_new_from_types (NULL, args = gimp_value_array_new_from_types (NULL,
G_TYPE_STRING, pattern_callback, G_TYPE_STRING, pattern_callback,
G_TYPE_STRING, popup_title, G_TYPE_STRING, popup_title,
G_TYPE_STRING, initial_pattern_name, GIMP_TYPE_PATTERN, initial_pattern,
G_TYPE_BYTES, parent_window, G_TYPE_BYTES, parent_window,
G_TYPE_NONE); G_TYPE_NONE);

View file

@ -34,7 +34,7 @@ G_BEGIN_DECLS
gboolean gimp_patterns_popup (const gchar *pattern_callback, gboolean gimp_patterns_popup (const gchar *pattern_callback,
const gchar *popup_title, const gchar *popup_title,
const gchar *initial_pattern_name, GimpPattern *initial_pattern,
GBytes *parent_window); GBytes *parent_window);
gboolean gimp_patterns_close_popup (const gchar *pattern_callback); gboolean gimp_patterns_close_popup (const gchar *pattern_callback);
gboolean gimp_patterns_set_popup (const gchar *pattern_callback, gboolean gimp_patterns_set_popup (const gchar *pattern_callback,

View file

@ -232,30 +232,26 @@ popup_remote_chooser (const gchar *title,
GType resource_type) GType resource_type)
{ {
gboolean result = FALSE; 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)) 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)) 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)) 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)) 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)) 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 else
{ {

View file

@ -27,8 +27,8 @@ sub brushes_popup {
desc => 'The callback PDB proc to call when user chooses a brush' }, desc => 'The callback PDB proc to call when user chooses a brush' },
{ name => 'popup_title', type => 'string', { name => 'popup_title', type => 'string',
desc => 'Title of the brush selection dialog' }, desc => 'Title of the brush selection dialog' },
{ name => 'initial_brush_name', type => 'string', null_ok => 1, { name => 'initial_brush', type => 'brush', null_ok => 1,
desc => 'The name of the brush to set as the initial choice' }, desc => 'The brush to set as the initial choice' },
{ name => 'parent_window', type => 'bytes', null_ok => 1, { name => 'parent_window', type => 'bytes', null_ok => 1,
desc => 'An optional parent window handle for the popup to be set transient to' } 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_lookup_procedure (gimp->pdb, brush_callback) ||
! gimp_pdb_dialog_new (gimp, context, progress, ! gimp_pdb_dialog_new (gimp, context, progress,
gimp_data_factory_get_container (gimp->brush_factory), gimp_data_factory_get_container (gimp->brush_factory),
parent_window, parent_window, popup_title, brush_callback,
popup_title, brush_callback, initial_brush_name, GIMP_OBJECT (initial_brush), NULL))
NULL))
success = FALSE; success = FALSE;
} }
CODE CODE

View file

@ -28,7 +28,7 @@ sub fonts_popup {
desc => 'The callback PDB proc to call when user chooses a font' }, desc => 'The callback PDB proc to call when user chooses a font' },
{ name => 'popup_title', type => 'string', { name => 'popup_title', type => 'string',
desc => 'Title of the font selection dialog' }, 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.' }, desc => 'The name of the initial font choice.' },
{ name => 'parent_window', type => 'bytes', null_ok => 1, { name => 'parent_window', type => 'bytes', null_ok => 1,
desc => 'An optional parent window handle for the popup to be set transient to' } 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_data_factory_data_wait (gimp->font_factory) ||
! gimp_pdb_dialog_new (gimp, context, progress, ! gimp_pdb_dialog_new (gimp, context, progress,
gimp_data_factory_get_container (gimp->font_factory), gimp_data_factory_get_container (gimp->font_factory),
parent_window, parent_window, popup_title, font_callback,
popup_title, font_callback, initial_font_name, GIMP_OBJECT (initial_font), NULL))
NULL))
success = FALSE; success = FALSE;
} }
CODE CODE

View file

@ -28,8 +28,8 @@ sub gradients_popup {
desc => 'The callback PDB proc to call when user chooses a gradient' }, desc => 'The callback PDB proc to call when user chooses a gradient' },
{ name => 'popup_title', type => 'string', { name => 'popup_title', type => 'string',
desc => 'Title of the gradient selection dialog' }, desc => 'Title of the gradient selection dialog' },
{ name => 'initial_gradient_name', type => 'string', null_ok => 1, { name => 'initial_gradient', type => 'gradient', null_ok => 1,
desc => 'The name of the initial gradient choice' }, desc => 'The initial gradient choice' },
{ name => 'parent_window', type => 'bytes', null_ok => 1, { name => 'parent_window', type => 'bytes', null_ok => 1,
desc => 'An optional parent window handle for the popup to be set transient to' } 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_lookup_procedure (gimp->pdb, gradient_callback) ||
! gimp_pdb_dialog_new (gimp, context, progress, ! gimp_pdb_dialog_new (gimp, context, progress,
gimp_data_factory_get_container (gimp->gradient_factory), gimp_data_factory_get_container (gimp->gradient_factory),
parent_window, parent_window, popup_title, gradient_callback,
popup_title, gradient_callback, initial_gradient_name, GIMP_OBJECT (initial_gradient), NULL))
NULL))
success = FALSE; success = FALSE;
} }
CODE CODE

View file

@ -27,8 +27,8 @@ sub palettes_popup {
desc => 'The callback PDB proc to call when user chooses a palette' }, desc => 'The callback PDB proc to call when user chooses a palette' },
{ name => 'popup_title', type => 'string', { name => 'popup_title', type => 'string',
desc => 'Title of the palette selection dialog' }, desc => 'Title of the palette selection dialog' },
{ name => 'initial_palette_name', type => 'string', null_ok => 1, { name => 'initial_palette', type => 'palette', null_ok => 1,
desc => 'The name of the palette to set as the initial choice.' }, desc => 'The palette to set as the initial choice.' },
{ name => 'parent_window', type => 'bytes', null_ok => 1, { name => 'parent_window', type => 'bytes', null_ok => 1,
desc => 'An optional parent window handle for the popup to be set transient to' } 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_lookup_procedure (gimp->pdb, palette_callback) ||
! gimp_pdb_dialog_new (gimp, context, progress, ! gimp_pdb_dialog_new (gimp, context, progress,
gimp_data_factory_get_container (gimp->palette_factory), gimp_data_factory_get_container (gimp->palette_factory),
parent_window, parent_window, popup_title, palette_callback,
popup_title, palette_callback, initial_palette_name, GIMP_OBJECT (initial_palette), NULL))
NULL))
success = FALSE; success = FALSE;
} }
CODE CODE

View file

@ -27,8 +27,8 @@ sub patterns_popup {
desc => 'The callback PDB proc to call when the user chooses a pattern' }, desc => 'The callback PDB proc to call when the user chooses a pattern' },
{ name => 'popup_title', type => 'string', { name => 'popup_title', type => 'string',
desc => 'Title of the pattern selection dialog' }, desc => 'Title of the pattern selection dialog' },
{ name => 'initial_pattern_name', type => 'string', null_ok => 1, { name => 'initial_pattern', type => 'pattern', null_ok => 1,
desc => 'The name of the pattern to set as the initial choice' }, desc => 'The pattern to set as the initial choice' },
{ name => 'parent_window', type => 'bytes', null_ok => 1, { name => 'parent_window', type => 'bytes', null_ok => 1,
desc => 'An optional parent window handle for the popup to be set transient to' } 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_lookup_procedure (gimp->pdb, pattern_callback) ||
! gimp_pdb_dialog_new (gimp, context, progress, ! gimp_pdb_dialog_new (gimp, context, progress,
gimp_data_factory_get_container (gimp->pattern_factory), gimp_data_factory_get_container (gimp->pattern_factory),
parent_window, parent_window, popup_title, pattern_callback,
popup_title, pattern_callback, initial_pattern_name, GIMP_OBJECT (initial_pattern), NULL))
NULL))
success = FALSE; success = FALSE;
} }
CODE CODE