Commit c314eef7 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

do actually add the new procedure gimp_gradient_is_editable().

2005-01-03  Sven Neumann  <neumann@jpk.com>

	* tools/pdbgen/pdb/gradient.pdb: do actually add the new procedure
	gimp_gradient_is_editable().

	* app/pdb/gradient_cmds.c
	* app/pdb/internal_procs.c
	* libgimp/gimpgradient_pdb.[ch]: regenerated.

	* libgimp/gimp.def: updated.
parent 4a0b9cb6
2005-01-03 Sven Neumann <neumann@jpk.com>
* tools/pdbgen/pdb/gradient.pdb: do actually add the new procedure
gimp_gradient_is_editable().
* app/pdb/gradient_cmds.c
* app/pdb/internal_procs.c
* libgimp/gimpgradient_pdb.[ch]: regenerated.
* libgimp/gimp.def: updated.
2005-01-03 Michael Natterer <mitch@gimp.org>
* app/actions/view-actions.c
......
......@@ -38,6 +38,7 @@
static ProcRecord gradient_new_proc;
static ProcRecord gradient_duplicate_proc;
static ProcRecord gradient_is_editable_proc;
static ProcRecord gradient_rename_proc;
static ProcRecord gradient_delete_proc;
static ProcRecord gradient_get_uniform_samples_proc;
......@@ -71,6 +72,7 @@ register_gradient_procs (Gimp *gimp)
{
procedural_db_register (gimp, &gradient_new_proc);
procedural_db_register (gimp, &gradient_duplicate_proc);
procedural_db_register (gimp, &gradient_is_editable_proc);
procedural_db_register (gimp, &gradient_rename_proc);
procedural_db_register (gimp, &gradient_delete_proc);
procedural_db_register (gimp, &gradient_get_uniform_samples_proc);
......@@ -242,6 +244,75 @@ static ProcRecord gradient_duplicate_proc =
{ { gradient_duplicate_invoker } }
};
static Argument *
gradient_is_editable_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
gchar *name;
GimpGradient *gradient = NULL;
name = (gchar *) args[0].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL))
success = FALSE;
if (success)
{
gradient = (GimpGradient *)
gimp_container_get_child_by_name (gimp->gradient_factory->container, name);
if (gradient)
success = TRUE;
else
success = FALSE;
}
return_args = procedural_db_return_args (&gradient_is_editable_proc, success);
if (success)
return_args[1].value.pdb_int = GIMP_DATA (gradient)->writable;
return return_args;
}
static ProcArg gradient_is_editable_inargs[] =
{
{
GIMP_PDB_STRING,
"name",
"The gradient name"
}
};
static ProcArg gradient_is_editable_outargs[] =
{
{
GIMP_PDB_INT32,
"editable",
"True if the gradient can be edited"
}
};
static ProcRecord gradient_is_editable_proc =
{
"gimp_gradient_is_editable",
"Tests if gradient can be edited",
"Returns True if you have permission to change the gradient",
"Bill Skaggs <weskaggs@primate.ucdavis.edu",
"Bill Skaggs",
"2004",
NULL,
GIMP_INTERNAL,
1,
gradient_is_editable_inargs,
1,
gradient_is_editable_outargs,
{ { gradient_is_editable_invoker } }
};
static Argument *
gradient_rename_invoker (Gimp *gimp,
GimpContext *context,
......
......@@ -74,7 +74,7 @@ void register_transform_tools_procs (Gimp *gimp);
void register_undo_procs (Gimp *gimp);
void register_unit_procs (Gimp *gimp);
/* 448 procedures registered total */
/* 449 procedures registered total */
void
internal_procs_init (Gimp *gimp,
......@@ -98,88 +98,88 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Color"), 0.089);
register_color_procs (gimp);
(* status_callback) (NULL, _("Context"), 0.123);
(* status_callback) (NULL, _("Context"), 0.122);
register_context_procs (gimp);
(* status_callback) (NULL, _("Convert"), 0.172);
(* status_callback) (NULL, _("Convert"), 0.171);
register_convert_procs (gimp);
(* status_callback) (NULL, _("Display procedures"), 0.179);
(* status_callback) (NULL, _("Display procedures"), 0.178);
register_display_procs (gimp);
(* status_callback) (NULL, _("Drawable procedures"), 0.188);
(* status_callback) (NULL, _("Drawable procedures"), 0.187);
register_drawable_procs (gimp);
(* status_callback) (NULL, _("Transformation procedures"), 0.263);
register_drawable_transform_procs (gimp);
(* status_callback) (NULL, _("Edit procedures"), 0.299);
(* status_callback) (NULL, _("Edit procedures"), 0.298);
register_edit_procs (gimp);
(* status_callback) (NULL, _("File Operations"), 0.319);
(* status_callback) (NULL, _("File Operations"), 0.318);
register_fileops_procs (gimp);
(* status_callback) (NULL, _("Floating selections"), 0.342);
(* status_callback) (NULL, _("Floating selections"), 0.341);
register_floating_sel_procs (gimp);
(* status_callback) (NULL, _("Font UI"), 0.355);
(* status_callback) (NULL, _("Font UI"), 0.354);
register_font_select_procs (gimp);
(* status_callback) (NULL, _("Fonts"), 0.362);
(* status_callback) (NULL, _("Fonts"), 0.361);
register_fonts_procs (gimp);
(* status_callback) (NULL, _("Gimprc procedures"), 0.366);
(* status_callback) (NULL, _("Gimprc procedures"), 0.365);
register_gimprc_procs (gimp);
(* status_callback) (NULL, _("Gradient"), 0.379);
register_gradient_procs (gimp);
(* status_callback) (NULL, _("Gradient UI"), 0.444);
(* status_callback) (NULL, _("Gradient UI"), 0.445);
register_gradient_select_procs (gimp);
(* status_callback) (NULL, _("Gradients"), 0.451);
(* status_callback) (NULL, _("Gradients"), 0.452);
register_gradients_procs (gimp);
(* status_callback) (NULL, _("Guide procedures"), 0.462);
(* status_callback) (NULL, _("Guide procedures"), 0.463);
register_guides_procs (gimp);
(* status_callback) (NULL, _("Help procedures"), 0.475);
(* status_callback) (NULL, _("Help procedures"), 0.477);
register_help_procs (gimp);
(* status_callback) (NULL, _("Image"), 0.478);
(* status_callback) (NULL, _("Image"), 0.479);
register_image_procs (gimp);
(* status_callback) (NULL, _("Layer"), 0.616);
(* status_callback) (NULL, _("Layer"), 0.617);
register_layer_procs (gimp);
(* status_callback) (NULL, _("Message procedures"), 0.676);
(* status_callback) (NULL, _("Message procedures"), 0.677);
register_message_procs (gimp);
(* status_callback) (NULL, _("Miscellaneous"), 0.683);
(* status_callback) (NULL, _("Miscellaneous"), 0.684);
register_misc_procs (gimp);
(* status_callback) (NULL, _("Paint Tool procedures"), 0.688);
register_paint_tools_procs (gimp);
(* status_callback) (NULL, _("Palette"), 0.721);
(* status_callback) (NULL, _("Palette"), 0.722);
register_palette_procs (gimp);
(* status_callback) (NULL, _("Palette UI"), 0.748);
register_palette_select_procs (gimp);
(* status_callback) (NULL, _("Palettes"), 0.754);
(* status_callback) (NULL, _("Palettes"), 0.755);
register_palettes_procs (gimp);
(* status_callback) (NULL, _("Parasite procedures"), 0.763);
(* status_callback) (NULL, _("Parasite procedures"), 0.764);
register_parasite_procs (gimp);
(* status_callback) (NULL, _("Paths"), 0.79);
(* status_callback) (NULL, _("Paths"), 0.791);
register_paths_procs (gimp);
(* status_callback) (NULL, _("Pattern"), 0.824);
register_pattern_procs (gimp);
(* status_callback) (NULL, _("Pattern UI"), 0.828);
(* status_callback) (NULL, _("Pattern UI"), 0.829);
register_pattern_select_procs (gimp);
(* status_callback) (NULL, _("Patterns"), 0.835);
......
......@@ -8,14 +8,28 @@ EXPORTS
gimp_brush_application_mode_get_type
gimp_brush_delete
gimp_brush_duplicate
gimp_brush_get_angle
gimp_brush_get_aspect_ratio
gimp_brush_get_hardness
gimp_brush_get_info
gimp_brush_get_pixels
gimp_brush_get_radius
gimp_brush_get_shape
gimp_brush_get_spacing
gimp_brush_get_spikes
gimp_brush_is_editable
gimp_brush_is_generated
gimp_brush_new
gimp_brush_rename
gimp_brush_select_destroy
gimp_brush_select_new
gimp_brush_set_angle
gimp_brush_set_aspect_ratio
gimp_brush_set_hardness
gimp_brush_set_radius
gimp_brush_set_shape
gimp_brush_set_spacing
gimp_brush_set_spikes
gimp_brushes_close_popup
gimp_brushes_get_brush
gimp_brushes_get_brush_data
......@@ -49,6 +63,7 @@ EXPORTS
gimp_clone_default
gimp_clone_type_get_type
gimp_color_balance
gimp_colorize
gimp_context_get_background
gimp_context_get_brush
gimp_context_get_font
......@@ -132,22 +147,22 @@ EXPORTS
gimp_drawable_set_pixel
gimp_drawable_set_tattoo
gimp_drawable_set_visible
gimp_drawable_transform_flip_simple
gimp_drawable_transform_2d
gimp_drawable_transform_2d_default
gimp_drawable_transform_flip
gimp_drawable_transform_flip_default
gimp_drawable_transform_flip_simple
gimp_drawable_transform_matrix
gimp_drawable_transform_matrix_default
gimp_drawable_transform_perspective
gimp_drawable_transform_perspective_default
gimp_drawable_transform_rotate_simple
gimp_drawable_transform_rotate
gimp_drawable_transform_rotate_default
gimp_drawable_transform_rotate_simple
gimp_drawable_transform_scale
gimp_drawable_transform_scale_default
gimp_drawable_transform_shear
gimp_drawable_transform_shear_default
gimp_drawable_transform_2d
gimp_drawable_transform_2d_default
gimp_drawable_transform_matrix
gimp_drawable_transform_matrix_default
gimp_drawable_type
gimp_drawable_type_with_alpha
gimp_drawable_update
......@@ -201,6 +216,7 @@ EXPORTS
gimp_gradient_duplicate
gimp_gradient_get_custom_samples
gimp_gradient_get_uniform_samples
gimp_gradient_is_editable
gimp_gradient_new
gimp_gradient_rename
gimp_gradient_segment_color_get_type
......@@ -333,6 +349,7 @@ EXPORTS
gimp_install_cmap
gimp_install_procedure
gimp_install_temp_proc
gimp_interpolation_type_get_type
gimp_invert
gimp_layer_add_alpha
gimp_layer_add_mask
......@@ -364,6 +381,7 @@ EXPORTS
gimp_layer_translate
gimp_levels
gimp_levels_auto
gimp_levels_stretch
gimp_main
gimp_mask_apply_mode_get_type
gimp_merge_type_get_type
......@@ -388,6 +406,7 @@ EXPORTS
gimp_palette_get_background
gimp_palette_get_foreground
gimp_palette_get_info
gimp_palette_is_editable
gimp_palette_new
gimp_palette_rename
gimp_palette_select_destroy
......@@ -538,6 +557,7 @@ EXPORTS
gimp_tile_width
gimp_transfer_mode_get_type
gimp_transform_2d
gimp_transform_direction_get_type
gimp_uninstall_temp_proc
gimp_version
gimp_wm_class
......@@ -91,6 +91,38 @@ gimp_gradient_duplicate (const gchar *name)
return ret_name;
}
/**
* gimp_gradient_is_editable:
* @name: The gradient name.
*
* Tests if gradient can be edited
*
* Returns True if you have permission to change the gradient
*
* Returns: True if the gradient can be edited.
*
* Since: GIMP 2.4
*/
gboolean
gimp_gradient_is_editable (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean editable = FALSE;
return_vals = gimp_run_procedure ("gimp_gradient_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_gradient_rename:
* @name: The gradient name.
......
......@@ -31,6 +31,7 @@ G_BEGIN_DECLS
gchar* gimp_gradient_new (const gchar *name);
gchar* gimp_gradient_duplicate (const gchar *name);
gboolean gimp_gradient_is_editable (const gchar *name);
gchar* gimp_gradient_rename (const gchar *name,
const gchar *new_name);
gboolean gimp_gradient_delete (const gchar *name);
......
......@@ -993,7 +993,8 @@ CODE
"core/gimpgradient.h" "core/gimpcontainer.h"
"core/gimpdatafactory.h" "core/gimplist.h");
@procs = qw(gradient_new gradient_duplicate gradient_rename gradient_delete
@procs = qw(gradient_new gradient_duplicate gradient_is_editable
gradient_rename gradient_delete
gradient_get_uniform_samples gradient_get_custom_samples
gradient_segment_get_left_color gradient_segment_set_left_color
gradient_segment_get_right_color gradient_segment_set_right_color
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment