mirror of https://github.com/GNOME/gimp.git
added shortcut for contributions from Marcus Heese.
2008-04-02 Sven Neumann <sven@gimp.org> * tools/pdbgen/stddefs.pdb: added shortcut for contributions from Marcus Heese. * tools/pdbgen/pdb/drawable.pdb: added gimp_drawable_is_text_layer(), taken from the patch attached to bug #164539. * app/pdb/internal_procs.c * app/pdb/drawable_cmds.c * libgimp/gimpdrawable_pdb.[ch]: regenerated. * libgimp/gimp.def: updated. svn path=/trunk/; revision=25337
This commit is contained in:
parent
842d68b491
commit
52c09fcfeb
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
2008-04-02 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* tools/pdbgen/stddefs.pdb: added shortcut for contributions from
|
||||
Marcus Heese.
|
||||
|
||||
* tools/pdbgen/pdb/drawable.pdb: added gimp_drawable_is_text_layer(),
|
||||
taken from the patch attached to bug #164539.
|
||||
|
||||
* app/pdb/internal_procs.c
|
||||
* app/pdb/drawable_cmds.c
|
||||
* libgimp/gimpdrawable_pdb.[ch]: regenerated.
|
||||
|
||||
* libgimp/gimp.def: updated.
|
||||
|
||||
2008-04-02 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/tools/gimpperspectiveclonetool.c: removed frame around the
|
||||
|
|
|
@ -99,6 +99,34 @@ drawable_is_layer_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
drawable_is_text_layer_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpDrawable *drawable;
|
||||
gboolean text_layer = FALSE;
|
||||
|
||||
drawable = gimp_value_get_drawable (&args->values[0], gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
text_layer = gimp_drawable_is_text_layer (drawable);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||
|
||||
if (success)
|
||||
g_value_set_boolean (&return_vals->values[1], text_layer);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
drawable_is_layer_mask_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -1270,7 +1298,35 @@ register_drawable_procs (GimpPDB *pdb)
|
|||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("layer",
|
||||
"layer",
|
||||
"TRUE if the drawable is a layer",
|
||||
"TRUE if the drawable is a layer, FALSE otherwise",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-drawable-is-text-layer
|
||||
*/
|
||||
procedure = gimp_procedure_new (drawable_is_text_layer_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-is-text-layer");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-drawable-is-text-layer",
|
||||
"Returns whether the drawable is a text layer.",
|
||||
"This procedure returns TRUE if the specified drawable is a text layer.",
|
||||
"Marcus Heese <heese@cip.ifi.lmu.de>",
|
||||
"Marcus Heese",
|
||||
"",
|
||||
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 ("text-layer",
|
||||
"text layer",
|
||||
"TRUE if the drawable is a text layer, FALSE otherwise.",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
|
@ -1298,7 +1354,7 @@ register_drawable_procs (GimpPDB *pdb)
|
|||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("layer-mask",
|
||||
"layer mask",
|
||||
"TRUE if the drawable is a layer mask",
|
||||
"TRUE if the drawable is a layer mask, FALSE otherwise",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
|
@ -1326,7 +1382,7 @@ register_drawable_procs (GimpPDB *pdb)
|
|||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("channel",
|
||||
"channel",
|
||||
"TRUE if the drawable is a channel",
|
||||
"TRUE if the drawable is a channel, FALSE otherwise",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "internal_procs.h"
|
||||
|
||||
|
||||
/* 554 procedures registered total */
|
||||
/* 555 procedures registered total */
|
||||
|
||||
void
|
||||
internal_procs_init (GimpPDB *pdb)
|
||||
|
|
|
@ -142,6 +142,7 @@ EXPORTS
|
|||
gimp_drawable_is_layer
|
||||
gimp_drawable_is_layer_mask
|
||||
gimp_drawable_is_rgb
|
||||
gimp_drawable_is_text_layer
|
||||
gimp_drawable_is_valid
|
||||
gimp_drawable_mask_bounds
|
||||
gimp_drawable_mask_intersect
|
||||
|
|
|
@ -71,7 +71,7 @@ gimp_drawable_is_valid (gint32 drawable_ID)
|
|||
*
|
||||
* This procedure returns TRUE if the specified drawable is a layer.
|
||||
*
|
||||
* Returns: TRUE if the drawable is a layer.
|
||||
* Returns: TRUE if the drawable is a layer, FALSE otherwise.
|
||||
*/
|
||||
gboolean
|
||||
gimp_drawable_is_layer (gint32 drawable_ID)
|
||||
|
@ -93,6 +93,39 @@ gimp_drawable_is_layer (gint32 drawable_ID)
|
|||
return layer;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_is_text_layer:
|
||||
* @drawable_ID: The drawable.
|
||||
*
|
||||
* Returns whether the drawable is a text layer.
|
||||
*
|
||||
* This procedure returns TRUE if the specified drawable is a text
|
||||
* layer.
|
||||
*
|
||||
* Returns: TRUE if the drawable is a text layer, FALSE otherwise.
|
||||
*
|
||||
* Since: GIMP 2008
|
||||
*/
|
||||
gboolean
|
||||
gimp_drawable_is_text_layer (gint32 drawable_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean text_layer = FALSE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-is-text-layer",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
text_layer = return_vals[1].data.d_int32;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return text_layer;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_is_layer_mask:
|
||||
* @drawable_ID: The drawable.
|
||||
|
@ -102,7 +135,7 @@ gimp_drawable_is_layer (gint32 drawable_ID)
|
|||
* This procedure returns TRUE if the specified drawable is a layer
|
||||
* mask.
|
||||
*
|
||||
* Returns: TRUE if the drawable is a layer mask.
|
||||
* Returns: TRUE if the drawable is a layer mask, FALSE otherwise.
|
||||
*/
|
||||
gboolean
|
||||
gimp_drawable_is_layer_mask (gint32 drawable_ID)
|
||||
|
@ -132,7 +165,7 @@ gimp_drawable_is_layer_mask (gint32 drawable_ID)
|
|||
*
|
||||
* This procedure returns TRUE if the specified drawable is a channel.
|
||||
*
|
||||
* Returns: TRUE if the drawable is a channel.
|
||||
* Returns: TRUE if the drawable is a channel, FALSE otherwise.
|
||||
*/
|
||||
gboolean
|
||||
gimp_drawable_is_channel (gint32 drawable_ID)
|
||||
|
|
|
@ -31,6 +31,7 @@ G_BEGIN_DECLS
|
|||
|
||||
gboolean gimp_drawable_is_valid (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_layer (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_text_layer (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_layer_mask (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_channel (gint32 drawable_ID);
|
||||
GimpImageType gimp_drawable_type (gint32 drawable_ID);
|
||||
|
|
|
@ -578,7 +578,7 @@ HELP
|
|||
|
||||
@outargs = (
|
||||
{ name => 'layer', type => 'boolean',
|
||||
desc => 'TRUE if the drawable is a layer' }
|
||||
desc => 'TRUE if the drawable is a layer, FALSE otherwise' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
|
@ -590,6 +590,34 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub drawable_is_text_layer {
|
||||
$blurb = 'Returns whether the drawable is a text layer.';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure returns TRUE if the specified drawable is a text layer.
|
||||
HELP
|
||||
|
||||
&marcus_pdb_misc('2008', '2.6');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'text_layer', type => 'boolean',
|
||||
desc => 'TRUE if the drawable is a text layer, FALSE otherwise.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
text_layer = gimp_drawable_is_text_layer (drawable);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub drawable_is_layer_mask {
|
||||
$blurb = 'Returns whether the drawable is a layer mask.';
|
||||
|
||||
|
@ -606,7 +634,7 @@ HELP
|
|||
|
||||
@outargs = (
|
||||
{ name => 'layer_mask', type => 'boolean',
|
||||
desc => 'TRUE if the drawable is a layer mask' }
|
||||
desc => 'TRUE if the drawable is a layer mask, FALSE otherwise' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
|
@ -634,7 +662,7 @@ HELP
|
|||
|
||||
@outargs = (
|
||||
{ name => 'channel', type => 'boolean',
|
||||
desc => 'TRUE if the drawable is a channel' }
|
||||
desc => 'TRUE if the drawable is a channel, FALSE otherwise' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
|
@ -1276,7 +1304,8 @@ CODE
|
|||
"gimp-intl.h");
|
||||
|
||||
@procs = qw(drawable_is_valid
|
||||
drawable_is_layer drawable_is_layer_mask drawable_is_channel
|
||||
drawable_is_layer drawable_is_text_layer
|
||||
drawable_is_layer_mask drawable_is_channel
|
||||
drawable_type drawable_type_with_alpha drawable_has_alpha
|
||||
drawable_is_rgb drawable_is_gray drawable_is_indexed
|
||||
drawable_bpp
|
||||
|
|
|
@ -94,6 +94,10 @@ sub marc_pdb_misc {
|
|||
contrib_pdb_misc('Marc Lehmann', '', @_);
|
||||
}
|
||||
|
||||
sub marcus_pdb_misc {
|
||||
contrib_pdb_misc('Marcus Heese', 'heese@cip.ifi.lmu.de', '', @_);
|
||||
}
|
||||
|
||||
sub martin_pdb_misc {
|
||||
contrib_pdb_misc('Martin Nordholts', '', @_);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue