Commit 95c13dad authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

tools/pdbgen/pdb/brushes.pdb tools/pdbgen/pdb/fonts.pdb

2003-12-08  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/pdb/brushes.pdb
	* tools/pdbgen/pdb/fonts.pdb
	* tools/pdbgen/pdb/gradients.pdb
	* tools/pdbgen/pdb/palettes.pdb
	* tools/pdbgen/pdb/patterns.pdb: removed comments that
	gimp_data_factory_data_init() should return a boolean indicating
	success, since it is highly unclear when to return FALSE. This
	function just always succeeds. Changed docs accordingly. Cleanup.

	* tools/pdbgen/pdb/brush_select.pdb
	* tools/pdbgen/pdb/font_select.pdb
	* tools/pdbgen/pdb/gradient_select.pdb
	* tools/pdbgen/pdb/palette_select.pdb
	* tools/pdbgen/pdb/pattern_select.pdb: minor cleanups.

	* app/pdb/brush_select_cmds.c
	* app/pdb/brushes_cmds.c
	* app/pdb/font_select_cmds.c
	* app/pdb/fonts_cmds.c
	* app/pdb/gradient_select_cmds.c
	* app/pdb/gradients_cmds.c
	* app/pdb/palette_select_cmds.c
	* app/pdb/palettes_cmds.c
	* app/pdb/pattern_select_cmds.c
	* app/pdb/patterns_cmds.c
	* libgimp/gimpbrushes_pdb.c
	* libgimp/gimpfonts_pdb.c
	* libgimp/gimpgradients_pdb.c
	* libgimp/gimppalettes_pdb.c
	* libgimp/gimppatterns_pdb.c: regenerated.
parent b4ef3516
2003-12-08 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/brushes.pdb
* tools/pdbgen/pdb/fonts.pdb
* tools/pdbgen/pdb/gradients.pdb
* tools/pdbgen/pdb/palettes.pdb
* tools/pdbgen/pdb/patterns.pdb: removed comments that
gimp_data_factory_data_init() should return a boolean indicating
success, since it is highly unclear when to return FALSE. This
function just always succeeds. Changed docs accordingly. Cleanup.
* tools/pdbgen/pdb/brush_select.pdb
* tools/pdbgen/pdb/font_select.pdb
* tools/pdbgen/pdb/gradient_select.pdb
* tools/pdbgen/pdb/palette_select.pdb
* tools/pdbgen/pdb/pattern_select.pdb: minor cleanups.
* app/pdb/brush_select_cmds.c
* app/pdb/brushes_cmds.c
* app/pdb/font_select_cmds.c
* app/pdb/fonts_cmds.c
* app/pdb/gradient_select_cmds.c
* app/pdb/gradients_cmds.c
* app/pdb/palette_select_cmds.c
* app/pdb/palettes_cmds.c
* app/pdb/pattern_select_cmds.c
* app/pdb/patterns_cmds.c
* libgimp/gimpbrushes_pdb.c
* libgimp/gimpfonts_pdb.c
* libgimp/gimpgradients_pdb.c
* libgimp/gimppalettes_pdb.c
* libgimp/gimppatterns_pdb.c: regenerated.
2003-12-08 Sven Neumann <sven@gimp.org>
* configure.in: bumped version number to 1.3.24.
......@@ -98,9 +98,7 @@ brushes_popup_invoker (Gimp *gimp,
brush_callback);
}
else
{
success = FALSE;
}
success = FALSE;
}
return procedural_db_return_args (&brushes_popup_proc, success);
......@@ -178,9 +176,7 @@ brushes_close_popup_invoker (Gimp *gimp,
brush_select_free (brush_select);
}
else
{
success = FALSE;
}
success = FALSE;
}
return procedural_db_return_args (&brushes_close_popup_proc, success);
......
......@@ -69,24 +69,15 @@ static Argument *
brushes_refresh_invoker (Gimp *gimp,
Argument *args)
{
/* FIXME: I've hardcoded success to be 1, because brushes_init() is a
* void function right now. It'd be nice if it returned a value at
* some future date, so we could tell if things blew up when reparsing
* the list (for whatever reason).
* - Seth "Yes, this is a kludge" Burgess
* <sjburges@gimp.org>
*/
gimp_data_factory_data_save (gimp->brush_factory);
gimp_data_factory_data_init (gimp->brush_factory, FALSE);
return procedural_db_return_args (&brushes_refresh_proc, TRUE);
}
static ProcRecord brushes_refresh_proc =
{
"gimp_brushes_refresh",
"Refresh current brushes.",
"Refresh current brushes. This function always succeeds.",
"This procedure retrieves all brushes currently in the user's brush path and updates the brush dialog accordingly.",
"Seth Burgess",
"Seth Burgess",
......@@ -246,10 +237,10 @@ brushes_set_brush_invoker (Gimp *gimp,
brush = (GimpBrush *)
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
success = (brush != NULL);
if (brush)
gimp_context_set_brush (gimp_get_current_context (gimp), brush);
else
success = FALSE;
}
return procedural_db_return_args (&brushes_set_brush_proc, success);
......@@ -544,13 +535,13 @@ brushes_get_brush_data_invoker (Gimp *gimp,
brush = gimp_context_get_brush (gimp_get_current_context (gimp));
}
success = (brush != NULL);
if (success)
if (brush)
{
length = brush->mask->height * brush->mask->width;
mask_data = g_memdup (temp_buf_data (brush->mask), length);
}
else
success = FALSE;
}
return_args = procedural_db_return_args (&brushes_get_brush_data_proc, success);
......@@ -575,7 +566,7 @@ static ProcArg brushes_get_brush_data_inargs[] =
{
GIMP_PDB_STRING,
"name",
"the brush name (\"\" means current active pattern)"
"The brush name (\"\" means current active brush)"
}
};
......
......@@ -76,9 +76,7 @@ fonts_popup_invoker (Gimp *gimp,
font_select_new (gimp, popup_title, initial_font, font_callback);
}
else
{
success = FALSE;
}
success = FALSE;
}
return procedural_db_return_args (&fonts_popup_proc, success);
......@@ -141,9 +139,7 @@ fonts_close_popup_invoker (Gimp *gimp,
font_select_free (font_select);
}
else
{
success = FALSE;
}
success = FALSE;
}
return procedural_db_return_args (&fonts_close_popup_proc, success);
......
......@@ -54,7 +54,7 @@ fonts_refresh_invoker (Gimp *gimp,
static ProcRecord fonts_refresh_proc =
{
"gimp_fonts_refresh",
"Refresh current fonts.",
"Refresh current fonts. This function always succeeds.",
"This procedure retrieves all fonts currently in the user's font path and updates the font dialogs accordingly.",
"Sven Neumann",
"Sven Neumann",
......
......@@ -86,9 +86,7 @@ gradients_popup_invoker (Gimp *gimp,
sample_size);
}
else
{
success = FALSE;
}
success = FALSE;
}
return procedural_db_return_args (&gradients_popup_proc, success);
......@@ -156,9 +154,7 @@ gradients_close_popup_invoker (Gimp *gimp,
gradient_select_free (gradient_select);
}
else
{
success = FALSE;
}
success = FALSE;
}
return procedural_db_return_args (&gradients_close_popup_proc, success);
......
......@@ -69,7 +69,7 @@ gradients_refresh_invoker (Gimp *gimp,
static ProcRecord gradients_refresh_proc =
{
"gimp_gradients_refresh",
"Refresh current gradients.",
"Refresh current gradients. This function always succeeds.",
"This procedure retrieves all gradients currently in the user's gradient path and updates the gradient dialogs accordingly.",
"Michael Natterer",
"Michael Natterer",
......@@ -206,16 +206,12 @@ gradients_set_gradient_invoker (Gimp *gimp,
if (success)
{
gradient = (GimpGradient *)
gimp_container_get_child_by_name (gimp->gradient_factory->container,
name);
success = FALSE;
gimp_container_get_child_by_name (gimp->gradient_factory->container, name);
if (gradient)
{
gimp_context_set_gradient (gimp_get_current_context (gimp), gradient);
success = TRUE;
}
gimp_context_set_gradient (gimp_get_current_context (gimp), gradient);
else
success = FALSE;
}
return procedural_db_return_args (&gradients_set_gradient_proc, success);
......@@ -476,21 +472,16 @@ gradients_get_gradient_data_invoker (Gimp *gimp,
{
if (strlen (name))
{
success = FALSE;
gradient = (GimpGradient *)
gimp_container_get_child_by_name (gimp->gradient_factory->container,
name);
}
else
{
gradient = gimp_context_get_gradient (gimp_get_current_context (gimp));;
gradient = gimp_context_get_gradient (gimp_get_current_context (gimp));;
}
if (gradient)
success = TRUE;
if (success)
{
gdouble *pv;
gdouble pos, delta;
......@@ -515,6 +506,8 @@ gradients_get_gradient_data_invoker (Gimp *gimp,
pos += delta;
}
}
else
success = FALSE;
}
return_args = procedural_db_return_args (&gradients_get_gradient_data_proc, success);
......
......@@ -79,9 +79,7 @@ palettes_popup_invoker (Gimp *gimp,
palette_callback);
}
else
{
success = FALSE;
}
success = FALSE;
}
return procedural_db_return_args (&palettes_popup_proc, success);
......@@ -129,7 +127,7 @@ palettes_close_popup_invoker (Gimp *gimp,
gboolean success = TRUE;
gchar *palette_callback;
ProcRecord *proc;
PaletteSelect *psp;
PaletteSelect *palette_select;
palette_callback = (gchar *) args[0].value.pdb_pointer;
if (palette_callback == NULL || !g_utf8_validate (palette_callback, -1, NULL))
......@@ -139,14 +137,12 @@ palettes_close_popup_invoker (Gimp *gimp,
{
if (! gimp->no_interface &&
(proc = procedural_db_lookup (gimp, palette_callback)) &&
(psp = palette_select_get_by_callback (palette_callback)))
(palette_select = palette_select_get_by_callback (palette_callback)))
{
palette_select_free (psp);
palette_select_free (palette_select);
}
else
{
success = FALSE;
}
success = FALSE;
}
return procedural_db_return_args (&palettes_close_popup_proc, success);
......@@ -185,7 +181,7 @@ palettes_set_popup_invoker (Gimp *gimp,
gchar *palette_callback;
gchar *palette_name;
ProcRecord *proc;
PaletteSelect *psp;
PaletteSelect *palette_select;
palette_callback = (gchar *) args[0].value.pdb_pointer;
if (palette_callback == NULL || !g_utf8_validate (palette_callback, -1, NULL))
......@@ -199,16 +195,20 @@ palettes_set_popup_invoker (Gimp *gimp,
{
if (! gimp->no_interface &&
(proc = procedural_db_lookup (gimp, palette_callback)) &&
(psp = palette_select_get_by_callback (palette_callback)))
(palette_select = palette_select_get_by_callback (palette_callback)))
{
GimpPalette *active = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container,
palette_name);
success = (active != NULL);
if (active)
{
gimp_context_set_palette (palette_select->context, active);
if (success)
gimp_context_set_palette (psp->context, active);
gtk_window_present (GTK_WINDOW (palette_select->shell));
}
else
success = FALSE;
}
else
success = FALSE;
......
......@@ -58,24 +58,15 @@ static Argument *
palettes_refresh_invoker (Gimp *gimp,
Argument *args)
{
/* FIXME: I've hardcoded success to be TRUE, because brushes_init() is a
* void function right now. It'd be nice if it returned a value at
* some future date, so we could tell if things blew up when reparsing
* the list (for whatever reason).
* - Seth "Yes, this is a kludge" Burgess
* <sjburges@ou.edu>
* -and shamelessly stolen by Adrian Likins for use here...
*/
gimp_data_factory_data_save (gimp->palette_factory);
gimp_data_factory_data_init (gimp->palette_factory, FALSE);
return procedural_db_return_args (&palettes_refresh_proc, TRUE);
}
static ProcRecord palettes_refresh_proc =
{
"gimp_palettes_refresh",
"Refreshes current palettes.",
"Refreshes current palettes. This function always succeeds.",
"This procedure incorporates all palettes currently in the users palette path.",
"Adrian Likins <adrian@gimp.org>",
"Adrian Likins",
......@@ -223,10 +214,10 @@ palettes_set_palette_invoker (Gimp *gimp,
palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name);
success = (palette != NULL);
if (success)
if (palette)
gimp_context_set_palette (gimp_get_current_context (gimp), palette);
else
success = FALSE;
}
return procedural_db_return_args (&palettes_set_palette_proc, success);
......@@ -287,9 +278,7 @@ palettes_get_palette_entry_invoker (Gimp *gimp,
palette = gimp_context_get_palette (gimp_get_current_context (gimp));
}
success = (palette != NULL);
if (success)
if (palette)
{
if (entry_num < 0 || entry_num >= palette->n_colors)
{
......@@ -305,6 +294,8 @@ palettes_get_palette_entry_invoker (Gimp *gimp,
color = entry->color;
}
}
else
success = FALSE;
}
return_args = procedural_db_return_args (&palettes_get_palette_entry_proc, success);
......
......@@ -79,9 +79,7 @@ patterns_popup_invoker (Gimp *gimp,
pattern_callback);
}
else
{
success = FALSE;
}
success = FALSE;
}
return procedural_db_return_args (&patterns_popup_proc, success);
......@@ -144,9 +142,7 @@ patterns_close_popup_invoker (Gimp *gimp,
pattern_select_free (pattern_select);
}
else
{
success = FALSE;
}
success = FALSE;
}
return procedural_db_return_args (&patterns_close_popup_proc, success);
......
......@@ -65,7 +65,7 @@ patterns_refresh_invoker (Gimp *gimp,
static ProcRecord patterns_refresh_proc =
{
"gimp_patterns_refresh",
"Refresh current patterns.",
"Refresh current patterns. This function always succeeds.",
"This procedure retrieves all patterns currently in the user's pattern path and updates the pattern dialogs accordingly.",
"Michael Natterer",
"Michael Natterer",
......@@ -219,10 +219,10 @@ patterns_set_pattern_invoker (Gimp *gimp,
pattern = (GimpPattern *)
gimp_container_get_child_by_name (gimp->pattern_factory->container, name);
success = (pattern != NULL);
if (success)
gimp_context_set_pattern (gimp_get_current_context (gimp), pattern);
else
success = FALSE;
}
return procedural_db_return_args (&patterns_set_pattern_proc, success);
......@@ -281,14 +281,14 @@ patterns_get_pattern_data_invoker (Gimp *gimp,
pattern = gimp_context_get_pattern (gimp_get_current_context (gimp));
}
success = (pattern != NULL);
if (success)
if (pattern)
{
length = pattern->mask->height * pattern->mask->width *
pattern->mask->bytes;
mask_data = g_memdup (temp_buf_data (pattern->mask), length);
}
else
success = FALSE;
}
return_args = procedural_db_return_args (&patterns_get_pattern_data_proc, success);
......@@ -311,7 +311,7 @@ static ProcArg patterns_get_pattern_data_inargs[] =
{
GIMP_PDB_STRING,
"name",
"the pattern name (\"\" means currently active pattern)"
"The pattern name (\"\" means currently active pattern)"
}
};
......
......@@ -30,7 +30,7 @@
/**
* gimp_brushes_refresh:
*
* Refresh current brushes.
* Refresh current brushes. This function always succeeds.
*
* This procedure retrieves all brushes currently in the user's brush
* path and updates the brush dialog accordingly.
......@@ -363,7 +363,7 @@ gimp_brushes_set_paint_mode (GimpLayerModeEffects paint_mode)
/**
* gimp_brushes_get_brush_data:
* @name: the brush name (\"\" means current active pattern).
* @name: The brush name (\"\" means current active brush).
* @opacity: The brush opacity.
* @spacing: The brush spacing.
* @paint_mode: The paint mode.
......
......@@ -28,7 +28,7 @@
/**
* gimp_fonts_refresh:
*
* Refresh current fonts.
* Refresh current fonts. This function always succeeds.
*
* This procedure retrieves all fonts currently in the user's font path
* and updates the font dialogs accordingly.
......
......@@ -30,7 +30,7 @@
/**
* gimp_gradients_refresh:
*
* Refresh current gradients.
* Refresh current gradients. This function always succeeds.
*
* This procedure retrieves all gradients currently in the user's
* gradient path and updates the gradient dialogs accordingly.
......
......@@ -28,7 +28,7 @@
/**
* gimp_palettes_refresh:
*
* Refreshes current palettes.
* Refreshes current palettes. This function always succeeds.
*
* This procedure incorporates all palettes currently in the users
* palette path.
......
......@@ -30,7 +30,7 @@
/**
* gimp_patterns_refresh:
*
* Refresh current patterns.
* Refresh current patterns. This function always succeeds.
*
* This procedure retrieves all patterns currently in the user's
* pattern path and updates the pattern dialogs accordingly.
......@@ -172,7 +172,7 @@ gimp_patterns_set_pattern (const gchar *name)
/**
* gimp_patterns_get_pattern_data:
* @name: the pattern name (\"\" means currently active pattern).
* @name: The pattern name (\"\" means currently active pattern).
* @width: The pattern width.
* @height: The pattern height.
* @mask_bpp: Pattern bytes per pixel.
......
......@@ -68,9 +68,7 @@ sub brushes_popup {
brush_callback);
}
else
{
success = FALSE;
}
success = FALSE;
}
CODE
);
......@@ -99,9 +97,7 @@ sub brushes_close_popup {
brush_select_free (brush_select);
}
else
{
success = FALSE;
}
success = FALSE;
}
CODE
);
......
......@@ -63,7 +63,7 @@ sub brush_outargs {
# The defs
sub brushes_refresh {
$blurb = 'Refresh current brushes.';
$blurb = 'Refresh current brushes. This function always succeeds.';
$help = <<'HELP';
This procedure retrieves all brushes currently in the user's brush path
......@@ -76,14 +76,6 @@ HELP
%invoke = (
code => <<'CODE'
{
/* FIXME: I've hardcoded success to be 1, because brushes_init() is a
* void function right now. It'd be nice if it returned a value at
* some future date, so we could tell if things blew up when reparsing
* the list (for whatever reason).
* - Seth "Yes, this is a kludge" Burgess
* <sjburges@gimp.org>
*/
gimp_data_factory_data_save (gimp->brush_factory);
gimp_data_factory_data_init (gimp->brush_factory, FALSE);
}
......@@ -169,10 +161,10 @@ HELP
brush = (GimpBrush *)
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
success = (brush != NULL);
if (brush)
gimp_context_set_brush (gimp_get_current_context (gimp), brush);
else
success = FALSE;
}
CODE
);
......@@ -293,7 +285,7 @@ HELP
$date = '1998';
@inargs = ( &brush_arg );
$inargs[0]->{desc} = 'the brush name ("" means current active pattern)';
$inargs[0]->{desc} = 'The brush name ("" means current active brush)';
@outargs = (
&brush_arg,
......@@ -328,13 +320,13 @@ HELP
brush = gimp_context_get_brush (gimp_get_current_context (gimp));
}
success = (brush != NULL);
if (success)
if (brush)
{
length = brush->mask->height * brush->mask->width;
mask_data = g_memdup (temp_buf_data (brush->mask), length);
}
else
success = FALSE;
}
CODE
);
......
......@@ -51,9 +51,7 @@ sub fonts_popup {
font_select_new (gimp, popup_title, initial_font, font_callback);
}
else
{
success = FALSE;
}
success = FALSE;
}
CODE
);
......@@ -82,9 +80,7 @@ sub fonts_close_popup {
font_select_free (font_select);
}
else
{
success = FALSE;
}
success = FALSE;
}
CODE
);
......
......@@ -25,7 +25,7 @@ sub pdb_misc {
# The defs
sub fonts_refresh {
$blurb = 'Refresh current fonts.';
$blurb = 'Refresh current fonts. This function always succeeds.';
$help = <<'HELP';
This procedure retrieves all fonts currently in the user's font path
......
......@@ -63,9 +63,7 @@ sub gradients_popup {
sample_size);
}
else
{
success = FALSE;
}
success = FALSE;
}
CODE
);
......@@ -94,9 +92,7 @@ sub gradients_close_popup {
gradient_select_free (gradient_select);
}
else
{
success = FALSE;
}
success = FALSE;
}
CODE
);
......
......@@ -25,7 +25,7 @@ sub pdb_misc {
# The defs
sub gradients_refresh {
$blurb = 'Refresh current gradients.';
$blurb = 'Refresh current gradients. This function always succeeds.';
$help = <<'HELP';
This procedure retrieves all gradients currently in the user's gradient path
......@@ -118,16 +118,12 @@ HELP
code => <<'CODE'
{
gradient = (GimpGradient *)
gimp_container_get_child_by_name (gimp->gradient_factory->container,
name);
success = FALSE;
gimp_container_get_child_by_name (gimp->gradient_factory->container, name);
if (gradient)
{
gimp_context_set_gradient (gimp_get_current_context (gimp), gradient);
success = TRUE;
}
gimp_context_set_gradient (gimp_get_current_context (gimp), gradient);
else
success = FALSE;
}
CODE
);
......@@ -298,21 +294,16 @@ HELP
{
if (strlen (name))
{
success = FALSE;
gradient = (GimpGradient *)
gimp_container_get_child_by_name (gimp->gradient_factory->container,
name);
}
else
{
gradient = gimp_context_get_gradient (gimp_get_current_context (gimp));;
gradient = gimp_context_get_gradient (gimp_get_current_context (gimp));;
}
if (gradient)
success = TRUE;
if (success)
{
gdouble *pv;
gdouble pos, delta;
......@@ -337,6 +328,8 @@ HELP
pos += delta;
}
}
else
success = FALSE;
}
CODE
);
......
......@@ -53,9 +53,7 @@ sub palettes_popup {
palette_callback);
}
else
{
success = FALSE;
}
success = FALSE;
}
CODE
);
......@@ -74,19 +72,17 @@ sub palettes_close_popup {
);
%invoke = (
vars => [ 'ProcRecord *proc', 'PaletteSelect *psp' ],
vars => [ 'ProcRecord *proc', 'PaletteSelect *palette_select' ],
code => <<'CODE'
{
if (! gimp->no_interface &&
(proc = procedural_db_lookup (gimp, palette_callback)) &&
(psp = palette_select_get_by_callback (palette_callback)))
(palette_select = palette_select_get_by_callback (palette_callback)))
{
palette_select_free (psp);
palette_select_free (palette_select);
}
else
{
success = FALSE;
}
success = FALSE;
}
CODE
);
......@@ -107,21 +103,25 @@ sub palettes_set_popup {
);
%invoke = (
vars => [ 'ProcRecord *proc', 'PaletteSelect *psp' ],
vars => [ 'ProcRecord *proc', 'PaletteSelect *palette_select' ],
code => <<'CODE'
{
if (! gimp->no_interface &&
(proc = procedural_db_lookup (gimp, palette_callback)) &&
(psp = palette_select_get_by_callback (palette_callback)))
(palette_select = palette_select_get_by_callback (palette_callback)))
{
GimpPalette *active = (GimpPalette *)