mirror of https://github.com/GNOME/gimp.git
pdb: remove drawable's and vector's "lock-content" API
because it's new in 2.8 and doesn't need to be deprecated.
This commit is contained in:
parent
1bca2d8eb0
commit
20c3dc0df9
|
@ -724,62 +724,6 @@ drawable_set_linked_invoker (GimpProcedure *procedure,
|
|||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
drawable_get_lock_content_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpDrawable *drawable;
|
||||
gboolean lock_content = FALSE;
|
||||
|
||||
drawable = gimp_value_get_drawable (&args->values[0], gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
lock_content = gimp_item_get_lock_content (GIMP_ITEM (drawable));
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
g_value_set_boolean (&return_vals->values[1], lock_content);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
drawable_set_lock_content_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpDrawable *drawable;
|
||||
gboolean lock_content;
|
||||
|
||||
drawable = gimp_value_get_drawable (&args->values[0], gimp);
|
||||
lock_content = g_value_get_boolean (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_item_can_lock_content (GIMP_ITEM (drawable)))
|
||||
gimp_item_set_lock_content (GIMP_ITEM (drawable), lock_content, TRUE);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
drawable_get_tattoo_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -2089,64 +2033,6 @@ register_drawable_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-drawable-get-lock-content
|
||||
*/
|
||||
procedure = gimp_procedure_new (drawable_get_lock_content_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-drawable-get-lock-content");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-drawable-get-lock-content",
|
||||
"Get the 'lock content' state of the specified drawable.",
|
||||
"This procedure returns the specified drawable's lock content state.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2009",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("lock-content",
|
||||
"lock content",
|
||||
"Whether the drawable's pixels are locked",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-drawable-set-lock-content
|
||||
*/
|
||||
procedure = gimp_procedure_new (drawable_set_lock_content_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-drawable-set-lock-content");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-drawable-set-lock-content",
|
||||
"Set the 'lock content' state of the specified drawable.",
|
||||
"This procedure sets the specified drawable's lock content state.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2009",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("lock-content",
|
||||
"lock content",
|
||||
"The new drawable 'lock content' state",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-drawable-get-tattoo
|
||||
*/
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "internal-procs.h"
|
||||
|
||||
|
||||
/* 621 procedures registered total */
|
||||
/* 617 procedures registered total */
|
||||
|
||||
void
|
||||
internal_procs_init (GimpPDB *pdb)
|
||||
|
|
|
@ -367,62 +367,6 @@ vectors_set_linked_invoker (GimpProcedure *procedure,
|
|||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
vectors_get_lock_content_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpVectors *vectors;
|
||||
gboolean lock_content = FALSE;
|
||||
|
||||
vectors = gimp_value_get_vectors (&args->values[0], gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
lock_content = gimp_item_get_lock_content (GIMP_ITEM (vectors));
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
g_value_set_boolean (&return_vals->values[1], lock_content);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
vectors_set_lock_content_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpVectors *vectors;
|
||||
gboolean lock_content;
|
||||
|
||||
vectors = gimp_value_get_vectors (&args->values[0], gimp);
|
||||
lock_content = g_value_get_boolean (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_item_can_lock_content (GIMP_ITEM (vectors)))
|
||||
gimp_item_set_lock_content (GIMP_ITEM (vectors), lock_content, TRUE);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
vectors_get_tattoo_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -1942,64 +1886,6 @@ register_vectors_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-vectors-get-lock-content
|
||||
*/
|
||||
procedure = gimp_procedure_new (vectors_get_lock_content_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-vectors-get-lock-content");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-vectors-get-lock-content",
|
||||
"Gets the 'lock content' state of the vectors object.",
|
||||
"Gets the 'lock content' state of the vectors object.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2009",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_vectors_id ("vectors",
|
||||
"vectors",
|
||||
"The vectors object",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("lock-content",
|
||||
"lock content",
|
||||
"Whether the path's strokes are locked",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-vectors-set-lock-content
|
||||
*/
|
||||
procedure = gimp_procedure_new (vectors_set_lock_content_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-vectors-set-lock-content");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-vectors-set-lock-content",
|
||||
"Sets the 'lock content' state of the vectors object.",
|
||||
"Sets the 'lock content' state of the vectors object.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2009",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_vectors_id ("vectors",
|
||||
"vectors",
|
||||
"The vectors object",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("lock-content",
|
||||
"lock content",
|
||||
"Whether the path's strokes are locked",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-vectors-get-tattoo
|
||||
*/
|
||||
|
|
|
@ -798,72 +798,6 @@ gimp_drawable_set_linked (gint32 drawable_ID,
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_get_lock_content:
|
||||
* @drawable_ID: The drawable.
|
||||
*
|
||||
* Get the 'lock content' state of the specified drawable.
|
||||
*
|
||||
* This procedure returns the specified drawable's lock content state.
|
||||
*
|
||||
* Returns: Whether the drawable's pixels are locked.
|
||||
*
|
||||
* Since: GIMP 2.8
|
||||
*/
|
||||
gboolean
|
||||
gimp_drawable_get_lock_content (gint32 drawable_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean lock_content = FALSE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-get-lock-content",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
lock_content = return_vals[1].data.d_int32;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return lock_content;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_set_lock_content:
|
||||
* @drawable_ID: The drawable.
|
||||
* @lock_content: The new drawable 'lock content' state.
|
||||
*
|
||||
* Set the 'lock content' state of the specified drawable.
|
||||
*
|
||||
* This procedure sets the specified drawable's lock content state.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: GIMP 2.8
|
||||
*/
|
||||
gboolean
|
||||
gimp_drawable_set_lock_content (gint32 drawable_ID,
|
||||
gboolean lock_content)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-set-lock-content",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, lock_content,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_get_tattoo:
|
||||
* @drawable_ID: The drawable.
|
||||
|
|
|
@ -60,9 +60,6 @@ gboolean gimp_drawable_set_visible (gint32
|
|||
gboolean gimp_drawable_get_linked (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_set_linked (gint32 drawable_ID,
|
||||
gboolean linked);
|
||||
gboolean gimp_drawable_get_lock_content (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_set_lock_content (gint32 drawable_ID,
|
||||
gboolean lock_content);
|
||||
gint gimp_drawable_get_tattoo (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_set_tattoo (gint32 drawable_ID,
|
||||
gint tattoo);
|
||||
|
|
|
@ -404,72 +404,6 @@ gimp_vectors_set_linked (gint32 vectors_ID,
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_vectors_get_lock_content:
|
||||
* @vectors_ID: The vectors object.
|
||||
*
|
||||
* Gets the 'lock content' state of the vectors object.
|
||||
*
|
||||
* Gets the 'lock content' state of the vectors object.
|
||||
*
|
||||
* Returns: Whether the path's strokes are locked.
|
||||
*
|
||||
* Since: GIMP 2.8
|
||||
*/
|
||||
gboolean
|
||||
gimp_vectors_get_lock_content (gint32 vectors_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean lock_content = FALSE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-vectors-get-lock-content",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_VECTORS, vectors_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
lock_content = return_vals[1].data.d_int32;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return lock_content;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_vectors_set_lock_content:
|
||||
* @vectors_ID: The vectors object.
|
||||
* @lock_content: Whether the path's strokes are locked.
|
||||
*
|
||||
* Sets the 'lock content' state of the vectors object.
|
||||
*
|
||||
* Sets the 'lock content' state of the vectors object.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: GIMP 2.8
|
||||
*/
|
||||
gboolean
|
||||
gimp_vectors_set_lock_content (gint32 vectors_ID,
|
||||
gboolean lock_content)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-vectors-set-lock-content",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_VECTORS, vectors_ID,
|
||||
GIMP_PDB_INT32, lock_content,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_vectors_get_tattoo:
|
||||
* @vectors_ID: The vectors object.
|
||||
|
|
|
@ -44,9 +44,6 @@ gboolean gimp_vectors_set_visible (gint32
|
|||
gboolean gimp_vectors_get_linked (gint32 vectors_ID);
|
||||
gboolean gimp_vectors_set_linked (gint32 vectors_ID,
|
||||
gboolean linked);
|
||||
gboolean gimp_vectors_get_lock_content (gint32 vectors_ID);
|
||||
gboolean gimp_vectors_set_lock_content (gint32 vectors_ID,
|
||||
gboolean lock_content);
|
||||
gint gimp_vectors_get_tattoo (gint32 vectors_ID);
|
||||
gboolean gimp_vectors_set_tattoo (gint32 vectors_ID,
|
||||
gint tattoo);
|
||||
|
|
|
@ -865,58 +865,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub drawable_get_lock_content {
|
||||
$blurb = "Get the 'lock content' state of the specified drawable.";
|
||||
|
||||
$help = "This procedure returns the specified drawable's lock content state.";
|
||||
|
||||
&mitch_pdb_misc('2009', '2.8');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'lock_content', type => 'boolean',
|
||||
desc => "Whether the drawable's pixels are locked" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
lock_content = gimp_item_get_lock_content (GIMP_ITEM (drawable));
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub drawable_set_lock_content {
|
||||
$blurb = "Set the 'lock content' state of the specified drawable.";
|
||||
|
||||
$help = "This procedure sets the specified drawable's lock content state.";
|
||||
|
||||
&mitch_pdb_misc('2009', '2.8');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' },
|
||||
{ name => 'lock_content', type => 'boolean',
|
||||
desc => "The new drawable 'lock content' state" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_item_can_lock_content (GIMP_ITEM (drawable)))
|
||||
gimp_item_set_lock_content (GIMP_ITEM (drawable), lock_content, TRUE);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub drawable_get_tattoo {
|
||||
$blurb = "Get the tattoo of the specified drawable.";
|
||||
|
||||
|
@ -1417,7 +1365,6 @@ CODE
|
|||
drawable_get_name drawable_set_name
|
||||
drawable_get_visible drawable_set_visible
|
||||
drawable_get_linked drawable_set_linked
|
||||
drawable_get_lock_content drawable_set_lock_content
|
||||
drawable_get_tattoo drawable_set_tattoo
|
||||
drawable_mask_bounds
|
||||
drawable_mask_intersect
|
||||
|
|
|
@ -322,56 +322,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub vectors_get_lock_content {
|
||||
$blurb = "Gets the 'lock content' state of the vectors object.";
|
||||
$help = "Gets the 'lock content' state of the vectors object.";
|
||||
|
||||
&mitch_pdb_misc('2009', '2.8');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'vectors', type => 'vectors',
|
||||
desc => 'The vectors object' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'lock_content', type => 'boolean',
|
||||
desc => "Whether the path's strokes are locked" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<"CODE"
|
||||
{
|
||||
lock_content = gimp_item_get_lock_content (GIMP_ITEM (vectors));
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub vectors_set_lock_content {
|
||||
$blurb = "Sets the 'lock content' state of the vectors object.";
|
||||
$help = "Sets the 'lock content' state of the vectors object.";
|
||||
|
||||
&mitch_pdb_misc('2009', '2.8');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'vectors', type => 'vectors',
|
||||
desc => 'The vectors object' },
|
||||
{ name => 'lock_content', type => 'boolean',
|
||||
desc => "Whether the path's strokes are locked" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<"CODE"
|
||||
{
|
||||
if (gimp_item_can_lock_content (GIMP_ITEM (vectors)))
|
||||
gimp_item_set_lock_content (GIMP_ITEM (vectors), lock_content, TRUE);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub vectors_get_tattoo {
|
||||
$blurb = 'Get the tattoo of the vectors object.';
|
||||
$help = 'Get the tattoo state of the vectors object.';
|
||||
|
@ -1594,7 +1544,6 @@ CODE
|
|||
vectors_get_name vectors_set_name
|
||||
vectors_get_visible vectors_set_visible
|
||||
vectors_get_linked vectors_set_linked
|
||||
vectors_get_lock_content vectors_set_lock_content
|
||||
vectors_get_tattoo vectors_set_tattoo
|
||||
vectors_get_strokes
|
||||
vectors_stroke_get_length
|
||||
|
|
Loading…
Reference in New Issue