Commit 1848b84b authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

use boolean values to indicate whether a path is linked ("locked").

2005-03-03  Sven Neumann  <sven@gimp.org>

	* tools/pdbgen/pdb/paths.pdb: use boolean values to indicate
	whether a path is linked ("locked").

	* app/pdb/drawable_cmds.c
	* app/pdb/paths_cmds.c
	* libgimp/gimpdrawable_pdb.c
	* libgimp/gimppaths_pdb.[ch]: regenerated.
parent 8e0fe5f3
2005-03-03 Sven Neumann <sven@gimp.org>
* tools/pdbgen/pdb/paths.pdb: use boolean values to indicate
whether a path is linked ("locked").
* app/pdb/drawable_cmds.c
* app/pdb/paths_cmds.c
* libgimp/gimpdrawable_pdb.c
* libgimp/gimppaths_pdb.[ch]: regenerated.
2005-03-03 Sven Neumann <sven@gimp.org>
* tools/pdbgen/pdb/paths.pdb: added new PDB function
......
......@@ -2013,7 +2013,7 @@ static ProcRecord drawable_set_pixel_proc =
{
"gimp_drawable_set_pixel",
"Sets the value of the pixel at the specified coordinates.",
"This procedure sets the pixel value at the specified coordinates. The 'num_channels' argument must always be equal to the bytes-per-pixel value for the spec ified drawable. Note that this function is not undoable, you should use it only on drawables you just created yourself.",
"This procedure sets the pixel value at the specified coordinates. The 'num_channels' argument must always be equal to the bytes-per-pixel value for the specified drawable. Note that this function is not undoable, you should use it only on drawables you just created yourself.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1997",
......
......@@ -1027,7 +1027,7 @@ path_get_locked_invoker (Gimp *gimp,
Argument *return_args;
GimpImage *gimage;
gchar *name;
gint32 lockstatus = 0;
gboolean locked = FALSE;
GimpVectors *vectors;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
......@@ -1043,7 +1043,7 @@ path_get_locked_invoker (Gimp *gimp,
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
lockstatus = gimp_item_get_linked (GIMP_ITEM (vectors));
locked = gimp_item_get_linked (GIMP_ITEM (vectors));
else
success = FALSE;
}
......@@ -1051,7 +1051,7 @@ path_get_locked_invoker (Gimp *gimp,
return_args = procedural_db_return_args (&path_get_locked_proc, success);
if (success)
return_args[1].value.pdb_int = lockstatus;
return_args[1].value.pdb_int = locked;
return return_args;
}
......@@ -1074,8 +1074,8 @@ static ProcArg path_get_locked_outargs[] =
{
{
GIMP_PDB_INT32,
"lockstatus",
"The lock status associated with the name path. 0 is returned if the path is not locked. 1 is returned if the path is locked."
"locked",
"TRUE if the path is locked, FALSE otherwise"
}
};
......@@ -1105,7 +1105,7 @@ path_set_locked_invoker (Gimp *gimp,
gboolean success = TRUE;
GimpImage *gimage;
gchar *name;
gint32 lockstatus = 0;
gboolean locked = FALSE;
GimpVectors *vectors;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
......@@ -1116,14 +1116,14 @@ path_set_locked_invoker (Gimp *gimp,
if (name == NULL || !g_utf8_validate (name, -1, NULL))
success = FALSE;
lockstatus = args[2].value.pdb_int;
locked = args[2].value.pdb_int ? TRUE : FALSE;
if (success)
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
gimp_item_set_linked (GIMP_ITEM (vectors), lockstatus, TRUE);
gimp_item_set_linked (GIMP_ITEM (vectors), locked, TRUE);
else
success = FALSE;
}
......@@ -1145,8 +1145,8 @@ static ProcArg path_set_locked_inargs[] =
},
{
GIMP_PDB_INT32,
"lockstatus",
"The lock status associated with the name path. 0 if the path is not locked. 1 if the path is to be locked"
"locked",
"Whether the path is locked"
}
};
......@@ -1416,7 +1416,7 @@ static ProcRecord path_import_string_proc =
{
"gimp_path_import_string",
"Import paths from an SVG string.",
"This procedure works like gimp_path_import() but takes a string rather than a filename. This allows you to write scripts that generate SVG and feed it to GIMP.",
"This procedure works like gimp_path_import() but takes a string rather than reading the SVG from a file. This allows you to write scripts that generate SVG and feed it to GIMP.",
"Sven Neumann",
"Sven Neumann",
"2005",
......
......@@ -1035,7 +1035,7 @@ gimp_drawable_get_pixel (gint32 drawable_ID,
*
* This procedure sets the pixel value at the specified coordinates.
* The 'num_channels' argument must always be equal to the
* bytes-per-pixel value for the spec ified drawable. Note that this
* bytes-per-pixel value for the specified drawable. Note that this
* function is not undoable, you should use it only on drawables you
* just created yourself.
*
......
......@@ -448,15 +448,15 @@ gimp_get_path_by_tattoo (gint32 image_ID,
* path. A path can be \"locked\" which means that the transformation
* tool operations will also apply to the path.
*
* Returns: The lock status associated with the name path. 0 is returned if the path is not locked. 1 is returned if the path is locked.
* Returns: TRUE if the path is locked, FALSE otherwise.
*/
gint
gboolean
gimp_path_get_locked (gint32 image_ID,
const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gint lockstatus = 0;
gboolean locked = FALSE;
return_vals = gimp_run_procedure ("gimp_path_get_locked",
&nreturn_vals,
......@@ -465,18 +465,18 @@ gimp_path_get_locked (gint32 image_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
lockstatus = return_vals[1].data.d_int32;
locked = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return lockstatus;
return locked;
}
/**
* gimp_path_set_locked:
* @image_ID: The image.
* @name: the name of the path whose locked status should be set.
* @lockstatus: The lock status associated with the name path. 0 if the path is not locked. 1 if the path is to be locked.
* @locked: Whether the path is locked.
*
* Set the locked status associated with the named path.
*
......@@ -489,7 +489,7 @@ gimp_path_get_locked (gint32 image_ID,
gboolean
gimp_path_set_locked (gint32 image_ID,
const gchar *name,
gint lockstatus)
gboolean locked)
{
GimpParam *return_vals;
gint nreturn_vals;
......@@ -499,7 +499,7 @@ gimp_path_set_locked (gint32 image_ID,
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_STRING, name,
GIMP_PDB_INT32, lockstatus,
GIMP_PDB_INT32, locked,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
......@@ -606,8 +606,8 @@ gimp_path_import (gint32 image_ID,
* Import paths from an SVG string.
*
* This procedure works like gimp_path_import() but takes a string
* rather than a filename. This allows you to write scripts that
* generate SVG and feed it to GIMP.
* rather than reading the SVG from a file. This allows you to write
* scripts that generate SVG and feed it to GIMP.
*
* Returns: TRUE on success.
*
......
......@@ -58,11 +58,11 @@ gboolean gimp_path_set_tattoo (gint32 image_ID,
gint tattovalue);
gchar* gimp_get_path_by_tattoo (gint32 image_ID,
gint tattoo);
gint gimp_path_get_locked (gint32 image_ID,
gboolean gimp_path_get_locked (gint32 image_ID,
const gchar *name);
gboolean gimp_path_set_locked (gint32 image_ID,
const gchar *name,
gint lockstatus);
gboolean locked);
gboolean gimp_path_to_selection (gint32 image_ID,
const gchar *name,
GimpChannelOps op,
......
......@@ -572,10 +572,8 @@ HELP
);
@outargs = (
{ name => 'lockstatus', type => 'int32',
desc => 'The lock status associated with the name path. 0 is
returned if the path is not locked. 1 is returned if the
path is locked.', init => 1 }
{ name => 'locked', type => 'boolean',
desc => 'TRUE if the path is locked, FALSE otherwise', init => 1 }
);
%invoke = (
......@@ -585,7 +583,7 @@ HELP
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
lockstatus = gimp_item_get_linked (GIMP_ITEM (vectors));
locked = gimp_item_get_linked (GIMP_ITEM (vectors));
else
success = FALSE;
}
......@@ -608,10 +606,8 @@ HELP
&std_image_arg,
{ name => 'name', type => 'string',
desc => 'the name of the path whose locked status should be set' },
{ name => 'lockstatus', type => 'int32',
desc => 'The lock status associated with the name path. 0 if the
path is not locked. 1 if the path is to be locked',
init => 1 }
{ name => 'locked', type => 'boolean',
desc => 'Whether the path is locked', init => 1 }
);
%invoke = (
......@@ -621,7 +617,7 @@ HELP
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
gimp_item_set_linked (GIMP_ITEM (vectors), lockstatus, TRUE);
gimp_item_set_linked (GIMP_ITEM (vectors), locked, TRUE);
else
success = FALSE;
}
......
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