Commit 610b26c2 authored by William Skaggs's avatar William Skaggs

Bill Skaggs <weskaggs@primate.ucdavis.edu>

	* tools/pdbgen/pdb/brush.pdb: added api for changing properties
	of generated brushes.

	* tools/pdbgen/pdb/palette.pdb: added palette_is_editable().

	* app/pdb/brush_cmds.c
	* app/pdb/internal_procs.c
	* app/pdb/palette_cmds.c
	* libgimp/gimpbrush_pdb.c
	* libgimp/gimpbrush_pdb.h
	* libgimp/gimppalette_pdb.c
	* libgimp/gimppalette_pdb.h: autogenerated.
parent 610ea309
2004-12-30 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* tools/pdbgen/pdb/brush.pdb: added api for changing properties
of generated brushes.
* tools/pdbgen/pdb/palette.pdb: added palette_is_editable().
* app/pdb/brush_cmds.c
* app/pdb/internal_procs.c
* app/pdb/palette_cmds.c
* libgimp/gimpbrush_pdb.c
* libgimp/gimpbrush_pdb.h
* libgimp/gimppalette_pdb.c
* libgimp/gimppalette_pdb.h: autogenerated.
2004-12-29 Sven Neumann <sven@gimp.org>
* configure.in: bumped version to 2.3.0.
......
This diff is collapsed.
......@@ -74,7 +74,7 @@ void register_transform_tools_procs (Gimp *gimp);
void register_undo_procs (Gimp *gimp);
void register_unit_procs (Gimp *gimp);
/* 433 procedures registered total */
/* 448 procedures registered total */
void
internal_procs_init (Gimp *gimp,
......@@ -86,130 +86,130 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (_("Internal Procedures"), _("Brush"), 0.0);
register_brush_procs (gimp);
(* status_callback) (NULL, _("Brush UI"), 0.018);
(* status_callback) (NULL, _("Brush UI"), 0.049);
register_brush_select_procs (gimp);
(* status_callback) (NULL, _("Brushes"), 0.025);
(* status_callback) (NULL, _("Brushes"), 0.056);
register_brushes_procs (gimp);
(* status_callback) (NULL, _("Channel"), 0.039);
(* status_callback) (NULL, _("Channel"), 0.069);
register_channel_procs (gimp);
(* status_callback) (NULL, _("Color"), 0.06);
(* status_callback) (NULL, _("Color"), 0.089);
register_color_procs (gimp);
(* status_callback) (NULL, _("Context"), 0.095);
(* status_callback) (NULL, _("Context"), 0.123);
register_context_procs (gimp);
(* status_callback) (NULL, _("Convert"), 0.145);
(* status_callback) (NULL, _("Convert"), 0.172);
register_convert_procs (gimp);
(* status_callback) (NULL, _("Display procedures"), 0.152);
(* status_callback) (NULL, _("Display procedures"), 0.179);
register_display_procs (gimp);
(* status_callback) (NULL, _("Drawable procedures"), 0.162);
(* status_callback) (NULL, _("Drawable procedures"), 0.188);
register_drawable_procs (gimp);
(* status_callback) (NULL, _("Transformation procedures"), 0.24);
(* status_callback) (NULL, _("Transformation procedures"), 0.263);
register_drawable_transform_procs (gimp);
(* status_callback) (NULL, _("Edit procedures"), 0.277);
(* status_callback) (NULL, _("Edit procedures"), 0.299);
register_edit_procs (gimp);
(* status_callback) (NULL, _("File Operations"), 0.298);
(* status_callback) (NULL, _("File Operations"), 0.319);
register_fileops_procs (gimp);
(* status_callback) (NULL, _("Floating selections"), 0.321);
(* status_callback) (NULL, _("Floating selections"), 0.342);
register_floating_sel_procs (gimp);
(* status_callback) (NULL, _("Font UI"), 0.335);
(* status_callback) (NULL, _("Font UI"), 0.355);
register_font_select_procs (gimp);
(* status_callback) (NULL, _("Fonts"), 0.342);
(* status_callback) (NULL, _("Fonts"), 0.362);
register_fonts_procs (gimp);
(* status_callback) (NULL, _("Gimprc procedures"), 0.346);
(* status_callback) (NULL, _("Gimprc procedures"), 0.366);
register_gimprc_procs (gimp);
(* status_callback) (NULL, _("Gradient"), 0.36);
(* status_callback) (NULL, _("Gradient"), 0.379);
register_gradient_procs (gimp);
(* status_callback) (NULL, _("Gradient UI"), 0.427);
(* status_callback) (NULL, _("Gradient UI"), 0.444);
register_gradient_select_procs (gimp);
(* status_callback) (NULL, _("Gradients"), 0.434);
(* status_callback) (NULL, _("Gradients"), 0.451);
register_gradients_procs (gimp);
(* status_callback) (NULL, _("Guide procedures"), 0.446);
(* status_callback) (NULL, _("Guide procedures"), 0.462);
register_guides_procs (gimp);
(* status_callback) (NULL, _("Help procedures"), 0.46);
(* status_callback) (NULL, _("Help procedures"), 0.475);
register_help_procs (gimp);
(* status_callback) (NULL, _("Image"), 0.462);
(* status_callback) (NULL, _("Image"), 0.478);
register_image_procs (gimp);
(* status_callback) (NULL, _("Layer"), 0.605);
(* status_callback) (NULL, _("Layer"), 0.616);
register_layer_procs (gimp);
(* status_callback) (NULL, _("Message procedures"), 0.667);
(* status_callback) (NULL, _("Message procedures"), 0.676);
register_message_procs (gimp);
(* status_callback) (NULL, _("Miscellaneous"), 0.674);
(* status_callback) (NULL, _("Miscellaneous"), 0.683);
register_misc_procs (gimp);
(* status_callback) (NULL, _("Paint Tool procedures"), 0.679);
(* status_callback) (NULL, _("Paint Tool procedures"), 0.688);
register_paint_tools_procs (gimp);
(* status_callback) (NULL, _("Palette"), 0.714);
(* status_callback) (NULL, _("Palette"), 0.721);
register_palette_procs (gimp);
(* status_callback) (NULL, _("Palette UI"), 0.739);
(* status_callback) (NULL, _("Palette UI"), 0.748);
register_palette_select_procs (gimp);
(* status_callback) (NULL, _("Palettes"), 0.746);
(* status_callback) (NULL, _("Palettes"), 0.754);
register_palettes_procs (gimp);
(* status_callback) (NULL, _("Parasite procedures"), 0.755);
(* status_callback) (NULL, _("Parasite procedures"), 0.763);
register_parasite_procs (gimp);
(* status_callback) (NULL, _("Paths"), 0.783);
(* status_callback) (NULL, _("Paths"), 0.79);
register_paths_procs (gimp);
(* status_callback) (NULL, _("Pattern"), 0.818);
(* status_callback) (NULL, _("Pattern"), 0.824);
register_pattern_procs (gimp);
(* status_callback) (NULL, _("Pattern UI"), 0.822);
(* status_callback) (NULL, _("Pattern UI"), 0.828);
register_pattern_select_procs (gimp);
(* status_callback) (NULL, _("Patterns"), 0.829);
(* status_callback) (NULL, _("Patterns"), 0.835);
register_patterns_procs (gimp);
(* status_callback) (NULL, _("Plug-in"), 0.838);
(* status_callback) (NULL, _("Plug-in"), 0.844);
register_plug_in_procs (gimp);
(* status_callback) (NULL, _("Procedural database"), 0.85);
(* status_callback) (NULL, _("Procedural database"), 0.855);
register_procedural_db_procs (gimp);
(* status_callback) (NULL, _("Progress"), 0.871);
(* status_callback) (NULL, _("Progress"), 0.875);
register_progress_procs (gimp);
(* status_callback) (NULL, _("Image mask"), 0.882);
(* status_callback) (NULL, _("Image mask"), 0.886);
register_selection_procs (gimp);
(* status_callback) (NULL, _("Selection Tool procedures"), 0.921);
(* status_callback) (NULL, _("Selection Tool procedures"), 0.924);
register_selection_tools_procs (gimp);
(* status_callback) (NULL, _("Text procedures"), 0.933);
(* status_callback) (NULL, _("Text procedures"), 0.935);
register_text_tool_procs (gimp);
(* status_callback) (NULL, _("Transform Tool procedures"), 0.942);
(* status_callback) (NULL, _("Transform Tool procedures"), 0.944);
register_transform_tools_procs (gimp);
(* status_callback) (NULL, _("Undo"), 0.956);
(* status_callback) (NULL, _("Undo"), 0.958);
register_undo_procs (gimp);
(* status_callback) (NULL, _("Units"), 0.972);
(* status_callback) (NULL, _("Units"), 0.973);
register_unit_procs (gimp);
}
......@@ -39,6 +39,7 @@ static ProcRecord palette_new_proc;
static ProcRecord palette_duplicate_proc;
static ProcRecord palette_rename_proc;
static ProcRecord palette_delete_proc;
static ProcRecord palette_is_editable_proc;
static ProcRecord palette_get_info_proc;
static ProcRecord palette_add_entry_proc;
static ProcRecord palette_delete_entry_proc;
......@@ -54,6 +55,7 @@ register_palette_procs (Gimp *gimp)
procedural_db_register (gimp, &palette_duplicate_proc);
procedural_db_register (gimp, &palette_rename_proc);
procedural_db_register (gimp, &palette_delete_proc);
procedural_db_register (gimp, &palette_is_editable_proc);
procedural_db_register (gimp, &palette_get_info_proc);
procedural_db_register (gimp, &palette_add_entry_proc);
procedural_db_register (gimp, &palette_delete_entry_proc);
......@@ -350,6 +352,75 @@ static ProcRecord palette_delete_proc =
{ { palette_delete_invoker } }
};
static Argument *
palette_is_editable_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
gchar *name;
GimpPalette *palette = NULL;
name = (gchar *) args[0].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL))
success = FALSE;
if (success)
{
palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette)
success = TRUE;
else
success = FALSE;
}
return_args = procedural_db_return_args (&palette_is_editable_proc, success);
if (success)
return_args[1].value.pdb_int = GIMP_DATA (palette)->writable;
return return_args;
}
static ProcArg palette_is_editable_inargs[] =
{
{
GIMP_PDB_STRING,
"name",
"The palette name."
}
};
static ProcArg palette_is_editable_outargs[] =
{
{
GIMP_PDB_INT32,
"editable",
"True if the palette can be edited"
}
};
static ProcRecord palette_is_editable_proc =
{
"gimp_palette_is_editable",
"Tests if palette can be edited",
"Returns True if you have permission to change the palette",
"Michael Natterer <mitch@gimp.org>",
"Michael Natterer",
"2004",
NULL,
GIMP_INTERNAL,
1,
palette_is_editable_inargs,
1,
palette_is_editable_outargs,
{ { palette_is_editable_invoker } }
};
static Argument *
palette_get_info_invoker (Gimp *gimp,
GimpContext *context,
......
......@@ -91,6 +91,38 @@ gimp_brush_duplicate (const gchar *name)
return ret_name;
}
/**
* gimp_brush_is_generated:
* @name: The brush name.
*
* Tests if generated
*
* Returns True if this brush is parametric, False for other types
*
* Returns: True if the brush is generated.
*
* Since: GIMP 2.2
*/
gboolean
gimp_brush_is_generated (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean generated = FALSE;
return_vals = gimp_run_procedure ("gimp_brush_is_generated",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
generated = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return generated;
}
/**
* gimp_brush_rename:
* @name: The brush name.
......@@ -157,6 +189,38 @@ gimp_brush_delete (const gchar *name)
return success;
}
/**
* gimp_brush_is_editable:
* @name: The brush name.
*
* Tests if brush can be edited
*
* Returns True if you have permission to change the brush
*
* Returns: True if the brush can be edited.
*
* Since: GIMP 2.2
*/
gboolean
gimp_brush_is_editable (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean editable = FALSE;
return_vals = gimp_run_procedure ("gimp_brush_is_editable",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
editable = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return editable;
}
/**
* gimp_brush_get_info:
* @name: The brush name.
......@@ -357,3 +421,426 @@ gimp_brush_set_spacing (const gchar *name,
return success;
}
/**
* gimp_brush_get_shape:
* @name: The brush name.
*
* Get the shape of a generated brush.
*
* This procedure gets the shape value for a generated brush. If called
* for any other type of brush, it does not succeed. The current
* possibilities are Circle (GIMP_BRUSH_GENERATED_CIRCLE), Square
* (GIMP_BRUSH_GENERATED_SQUARE), and Diamond
* (GIMP_BRUSH_GENERATED_DIAMOND). Other shapes are likely to be added
* in the future.
*
* Returns: An enumerated value representing the brush shape.
*
* Since: GIMP 2.2
*/
gint
gimp_brush_get_shape (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gint shape = 0;
return_vals = gimp_run_procedure ("gimp_brush_get_shape",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
shape = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return shape;
}
/**
* gimp_brush_get_radius:
* @name: The brush name.
*
* Get the radius of a generated brush.
*
* This procedure gets the radius value for a generated brush. If
* called for any other type of brush, it does not succeed.
*
* Returns: The radius of the brush in pixels.
*
* Since: GIMP 2.2
*/
gdouble
gimp_brush_get_radius (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gdouble radius = 0;
return_vals = gimp_run_procedure ("gimp_brush_get_radius",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
radius = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
return radius;
}
/**
* gimp_brush_get_spikes:
* @name: The brush name.
*
* Get the number of spikes for a generated brush.
*
* This procedure gets the number of spikes for a generated brush. If
* called for any other type of brush, it does not succeed.
*
* Returns: The number of spikes on the brush.
*
* Since: GIMP 2.2
*/
gint
gimp_brush_get_spikes (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gint spikes = 0;
return_vals = gimp_run_procedure ("gimp_brush_get_spikes",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
spikes = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return spikes;
}
/**
* gimp_brush_get_hardness:
* @name: The brush name.
*
* Get the hardness of a generated brush.
*
* This procedure gets the hardness of a generated brush. The hardness
* of a brush is the amount its intensity fades at the outside edge. If
* called for any other type of brush, the function does not succeed.
*
* Returns: The hardness of the brush.
*
* Since: GIMP 2.2
*/
gdouble
gimp_brush_get_hardness (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gdouble hardness = 0;
return_vals = gimp_run_procedure ("gimp_brush_get_hardness",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
hardness = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
return hardness;
}
/**
* gimp_brush_get_aspect_ratio:
* @name: The brush name.
*
* Get the aspect ratio of a generated brush.
*
* This procedure gets the aspect ratio of a generated brush. If called
* for any other type of brush, it does not succeed.
*
* Returns: The aspect ratio of the brush.
*
* Since: GIMP 2.2
*/
gdouble
gimp_brush_get_aspect_ratio (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gdouble aspect_ratio = 0;
return_vals = gimp_run_procedure ("gimp_brush_get_aspect_ratio",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
aspect_ratio = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
return aspect_ratio;
}
/**
* gimp_brush_get_angle:
* @name: The brush name.
*
* Get the rotation angle of a generated brush.
*
* This procedure gets the angle of rotation for a generated brush. If
* called for any other type of brush, it does not succeed.
*
* Returns: The rotation angle of the brush.
*
* Since: GIMP 2.2
*/
gdouble
gimp_brush_get_angle (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gdouble angle = 0;
return_vals = gimp_run_procedure ("gimp_brush_get_angle",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
angle = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
return angle;
}
/**
* gimp_brush_set_shape:
* @name: The brush name.
* @shape_in: An enumerated value representing the desired brush shape.
*
* Set the shape of a generated brush.
*
* This procedure sets the shape value for a generated brush. If called
* for any other type of brush, it does not succeed. The current
* possibilities are Circle (GIMP_BRUSH_GENERATED_CIRCLE), Square
* (GIMP_BRUSH_GENERATED_SQUARE), and Diamond
* (GIMP_BRUSH_GENERATED_DIAMOND). Other shapes are likely to be added
* in the future.
*
* Returns: The brush shape actually assigned.
*
* Since: GIMP 2.2
*/
gint
gimp_brush_set_shape (const gchar *name,
gint shape_in)
{
GimpParam *return_vals;
gint nreturn_vals;
gint shape_out = 0;
return_vals = gimp_run_procedure ("gimp_brush_set_shape",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_INT32, shape_in,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
shape_out = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return shape_out;
}
/**
* gimp_brush_set_radius:
* @name: The brush name.
* @radius_in: The desired brush radius.
*
* Set the radius of a generated brush.
*
* This procedure sets the radius for a generated brush. If called for
* any other type of brush, it does not succeed.
*
* Returns: The brush radius actually assigned.
*
* Since: GIMP 2.2
*/
gdouble
gimp_brush_set_radius (const gchar *name,
gdouble radius_in)
{
GimpParam *return_vals;
gint nreturn_vals;
gdouble radius_out = 0;
return_vals = gimp_run_procedure ("gimp_brush_set_radius",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_FLOAT, radius_in,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
radius_out = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
return radius_out;
}
/**
* gimp_brush_set_spikes:
* @name: The brush name.
* @spikes_in: The desired number of spikes.
*
* Set the number of spikes for a generated brush.
*
* This procedure sets the number of spikes for a generated brush. If
* called for any other type of brush, it does not succeed.
*
* Returns: The number of spikes actually assigned.
*
* Since: GIMP 2.2
*/
gint
gimp_brush_set_spikes (const gchar *name,
gint spikes_in)
{
GimpParam *return_vals;
gint nreturn_vals;
gint spikes_out = 0;
return_vals = gimp_run_procedure ("gimp_brush_set_spikes",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_INT32, spikes_in,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
spikes_out = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return spikes_out;
}
/**
* gimp_brush_set_hardness:
* @name: The brush name.
* @hardness_in: The desired brush hardness.
*
* Set the hardness of a generated brush.
*
* This procedure sets the hardness for a generated brush. If called
* for any other type of brush, it does not succeed.
*
* Returns: The brush hardness actually assigned.
*
* Since: GIMP 2.2
*/
gdouble
gimp_brush_set_hardness (const gchar *name,
gdouble hardness_in)
{
GimpParam *return_vals;
gint nreturn_vals;
gdouble hardness_out = 0;
return_vals = gimp_run_procedure ("gimp_brush_set_hardness",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_FLOAT, hardness_in,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
hardness_out = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
return hardness_out;
}
/**
* gimp_brush_set_aspect_ratio:
* @name: The brush name.
* @aspect_ratio_in: The desired brush aspect ratio.
*
* Set the aspect ratio of a generated brush.
*
* This procedure sets the aspect ratio for a generated brush. If
* called for any other type of brush, it does not succeed.
*
* Returns: The brush aspect ratio actually assigned.
*