2006-12-09 21:33:38 +00:00
/* GIMP - The GNU Image Manipulation Program
2003-07-03 00:47:26 +00:00
* Copyright ( C ) 1995 - 2003 Spencer Kimball and Peter Mattis
1997-11-24 22:05:25 +00:00
*
2009-01-17 22:28:01 +00:00
* This program is free software : you can redistribute it and / or modify
1997-11-24 22:05:25 +00:00
* it under the terms of the GNU General Public License as published by
2009-01-17 22:28:01 +00:00
* the Free Software Foundation ; either version 3 of the License , or
1997-11-24 22:05:25 +00:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2009-01-17 22:28:01 +00:00
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
1997-11-24 22:05:25 +00:00
*/
2007-01-09 10:52:47 +00:00
/* NOTE: This file is auto-generated by pdbgen.pl. */
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-14 23:23:52 +00:00
2000-12-29 15:22:01 +00:00
# include "config.h"
2008-10-09 20:24:04 +00:00
# include <gegl.h>
2000-12-29 15:22:01 +00:00
2001-08-17 14:27:31 +00:00
# include "pdb-types.h"
1997-11-24 22:05:25 +00:00
2001-07-07 22:49:01 +00:00
# include "core/gimpdrawable.h"
2008-11-09 18:45:16 +00:00
# include "core/gimpimage.h"
2002-02-21 22:19:45 +00:00
# include "core/gimplayer-floating-sel.h"
2001-05-09 02:32:03 +00:00
# include "core/gimplayer.h"
2008-02-07 17:08:54 +00:00
# include "core/gimpparamspecs.h"
1997-11-24 22:05:25 +00:00
2008-02-07 17:08:54 +00:00
# include "gimppdb.h"
2008-04-02 20:50:16 +00:00
# include "gimppdberror.h"
2008-02-07 17:08:54 +00:00
# include "gimppdb-utils.h"
# include "gimpprocedure.h"
2008-04-04 11:15:55 +00:00
# include "internal-procs.h"
2006-10-31 19:02:56 +00:00
2008-02-07 17:08:54 +00:00
# include "gimp-intl.h"
1997-11-24 22:05:25 +00:00
2006-04-04 10:30:58 +00:00
static GValueArray *
2007-12-02 18:05:54 +00:00
floating_sel_remove_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
gboolean success = TRUE ;
GimpLayer * floating_sel ;
2006-04-04 10:30:58 +00:00
floating_sel = gimp_value_get_layer ( & args - > values [ 0 ] , gimp ) ;
1997-11-24 22:05:25 +00:00
if ( success )
{
2001-01-28 23:25:25 +00:00
if ( gimp_layer_is_floating_sel ( floating_sel ) )
2007-12-06 18:00:10 +00:00
{
2008-11-09 18:45:16 +00:00
gimp_image_remove_layer ( gimp_item_get_image ( GIMP_ITEM ( floating_sel ) ) ,
floating_sel , TRUE , NULL ) ;
2007-12-06 18:00:10 +00:00
}
1999-03-28 06:55:29 +00:00
else
2007-12-06 18:00:10 +00:00
{
2008-11-04 12:33:09 +00:00
g_set_error_literal ( error , GIMP_PDB_ERROR , GIMP_PDB_INVALID_ARGUMENT ,
_ ( " Cannot remove this layer because "
" it is not a floating selection. " ) ) ;
2007-12-06 18:00:10 +00:00
success = FALSE ;
}
1997-11-24 22:05:25 +00:00
}
2008-08-16 13:57:57 +00:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1997-11-24 22:05:25 +00:00
}
2006-04-04 10:30:58 +00:00
static GValueArray *
2007-12-02 18:05:54 +00:00
floating_sel_anchor_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
gboolean success = TRUE ;
GimpLayer * floating_sel ;
2006-04-04 10:30:58 +00:00
floating_sel = gimp_value_get_layer ( & args - > values [ 0 ] , gimp ) ;
1997-11-24 22:05:25 +00:00
if ( success )
{
2001-01-28 23:25:25 +00:00
if ( gimp_layer_is_floating_sel ( floating_sel ) )
2007-12-06 18:00:10 +00:00
{
floating_sel_anchor ( floating_sel ) ;
}
1999-03-28 06:55:29 +00:00
else
2007-12-06 18:00:10 +00:00
{
2008-11-04 12:33:09 +00:00
g_set_error_literal ( error , GIMP_PDB_ERROR , GIMP_PDB_INVALID_ARGUMENT ,
_ ( " Cannot anchor this layer because "
" it is not a floating selection. " ) ) ;
2007-12-06 18:00:10 +00:00
success = FALSE ;
}
1997-11-24 22:05:25 +00:00
}
2008-08-16 13:57:57 +00:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1997-11-24 22:05:25 +00:00
}
2006-04-04 10:30:58 +00:00
static GValueArray *
2007-12-02 18:05:54 +00:00
floating_sel_to_layer_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
gboolean success = TRUE ;
GimpLayer * floating_sel ;
2006-04-04 10:30:58 +00:00
floating_sel = gimp_value_get_layer ( & args - > values [ 0 ] , gimp ) ;
1997-11-24 22:05:25 +00:00
if ( success )
{
2001-01-28 23:25:25 +00:00
if ( gimp_layer_is_floating_sel ( floating_sel ) )
2007-12-06 18:00:10 +00:00
{
success = floating_sel_to_layer ( floating_sel , error ) ;
}
1999-03-28 06:55:29 +00:00
else
2007-12-06 18:00:10 +00:00
{
2008-11-04 12:33:09 +00:00
g_set_error_literal ( error , GIMP_PDB_ERROR , GIMP_PDB_INVALID_ARGUMENT ,
_ ( " Cannot convert this layer to a normal layer "
" because it is not a floating selection. " ) ) ;
2007-12-06 18:00:10 +00:00
success = FALSE ;
}
1997-11-24 22:05:25 +00:00
}
2008-08-16 13:57:57 +00:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1997-11-24 22:05:25 +00:00
}
2006-04-04 10:30:58 +00:00
static GValueArray *
2007-12-02 18:05:54 +00:00
floating_sel_attach_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1998-11-15 18:41:53 +00:00
{
1999-03-28 06:55:29 +00:00
gboolean success = TRUE ;
GimpLayer * layer ;
1998-11-15 18:41:53 +00:00
GimpDrawable * drawable ;
2006-04-04 10:30:58 +00:00
layer = gimp_value_get_layer ( & args - > values [ 0 ] , gimp ) ;
drawable = gimp_value_get_drawable ( & args - > values [ 1 ] , gimp ) ;
1998-11-15 18:41:53 +00:00
if ( success )
2004-01-26 15:34:47 +00:00
{
2009-08-29 07:16:35 +00:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , TRUE , error ) & &
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) )
2004-03-26 16:49:18 +00:00
floating_sel_attach ( layer , drawable ) ;
2006-03-14 21:35:50 +00:00
else
success = FALSE ;
2004-01-26 15:34:47 +00:00
}
1998-11-15 18:41:53 +00:00
2008-08-16 13:57:57 +00:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1998-11-15 18:41:53 +00:00
}
2006-04-04 10:30:58 +00:00
static GValueArray *
2007-12-02 18:05:54 +00:00
floating_sel_rigor_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1998-11-15 18:41:53 +00:00
{
1999-03-28 06:55:29 +00:00
gboolean success = TRUE ;
GimpLayer * floating_sel ;
gboolean undo ;
2006-04-04 10:30:58 +00:00
floating_sel = gimp_value_get_layer ( & args - > values [ 0 ] , gimp ) ;
undo = g_value_get_boolean ( & args - > values [ 1 ] ) ;
1998-11-15 18:41:53 +00:00
if ( success )
{
}
2008-08-16 13:57:57 +00:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1998-11-15 18:41:53 +00:00
}
2006-04-04 10:30:58 +00:00
static GValueArray *
2007-12-02 18:05:54 +00:00
floating_sel_relax_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1998-11-15 18:41:53 +00:00
{
1999-03-28 06:55:29 +00:00
gboolean success = TRUE ;
GimpLayer * floating_sel ;
gboolean undo ;
2006-04-04 10:30:58 +00:00
floating_sel = gimp_value_get_layer ( & args - > values [ 0 ] , gimp ) ;
undo = g_value_get_boolean ( & args - > values [ 1 ] ) ;
1998-11-15 18:41:53 +00:00
if ( success )
{
}
2008-08-16 13:57:57 +00:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1998-11-15 18:41:53 +00:00
}
2006-04-04 21:11:45 +00:00
void
2006-04-26 09:13:47 +00:00
register_floating_sel_procs ( GimpPDB * pdb )
1998-11-15 18:41:53 +00:00
{
2006-04-04 21:11:45 +00:00
GimpProcedure * procedure ;
/*
* gimp - floating - sel - remove
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( floating_sel_remove_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-floating-sel-remove " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-floating-sel-remove " ,
" Remove the specified floating selection from its associated drawable. " ,
" This procedure removes the floating selection completely, without any side effects. The associated drawable is then set to active. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_layer_id ( " floating-sel " ,
" floating sel " ,
" The floating selection " ,
2006-05-06 18:57:51 +00:00
pdb - > gimp , FALSE ,
2006-04-04 21:11:45 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2006-04-04 21:11:45 +00:00
/*
* gimp - floating - sel - anchor
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( floating_sel_anchor_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-floating-sel-anchor " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-floating-sel-anchor " ,
" Anchor the specified floating selection to its associated drawable. " ,
" This procedure anchors the floating selection to its associated drawable. This is similar to merging with a merge type of ClipToBottomLayer. The floating selection layer is no longer valid after this operation. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_layer_id ( " floating-sel " ,
" floating sel " ,
" The floating selection " ,
2006-05-06 18:57:51 +00:00
pdb - > gimp , FALSE ,
2006-04-04 21:11:45 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2006-04-04 21:11:45 +00:00
/*
* gimp - floating - sel - to - layer
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( floating_sel_to_layer_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-floating-sel-to-layer " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-floating-sel-to-layer " ,
" Transforms the specified floating selection into a layer. " ,
" This procedure transforms the specified floating selection into a layer with the same offsets and extents. The composited image will look precisely the same, but the floating selection layer will no longer be clipped to the extents of the drawable it was attached to. The floating selection will become the active layer. This procedure will not work if the floating selection has a different base type from the underlying image. This might be the case if the floating selection is above an auxillary channel or a layer mask. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_layer_id ( " floating-sel " ,
" floating sel " ,
" The floating selection " ,
2006-05-06 18:57:51 +00:00
pdb - > gimp , FALSE ,
2006-04-04 21:11:45 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2006-04-04 21:11:45 +00:00
/*
* gimp - floating - sel - attach
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( floating_sel_attach_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-floating-sel-attach " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-floating-sel-attach " ,
" Attach the specified layer as floating to the specified drawable. " ,
" This procedure attaches the layer as floating selection to the drawable. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_layer_id ( " layer " ,
" layer " ,
" The layer (is attached as floating selection) " ,
2006-05-06 18:57:51 +00:00
pdb - > gimp , FALSE ,
2006-04-04 21:11:45 +00:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable (where to attach the floating selection) " ,
2006-05-06 18:57:51 +00:00
pdb - > gimp , FALSE ,
2006-04-04 21:11:45 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2006-04-04 21:11:45 +00:00
/*
* gimp - floating - sel - rigor
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( floating_sel_rigor_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-floating-sel-rigor " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-floating-sel-rigor " ,
2008-11-09 16:49:37 +00:00
" This procedure is deprecated! " ,
" This procedure is deprecated! " ,
" " ,
" " ,
" " ,
" NONE " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_layer_id ( " floating-sel " ,
" floating sel " ,
" The floating selection " ,
2006-05-06 18:57:51 +00:00
pdb - > gimp , FALSE ,
2006-04-04 21:11:45 +00:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " undo " ,
" undo " ,
2006-05-18 17:25:15 +00:00
" " ,
2006-04-04 21:11:45 +00:00
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2006-04-04 21:11:45 +00:00
/*
* gimp - floating - sel - relax
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( floating_sel_relax_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-floating-sel-relax " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-floating-sel-relax " ,
2008-11-09 16:49:37 +00:00
" This procedure is deprecated! " ,
" This procedure is deprecated! " ,
" " ,
" " ,
" " ,
" NONE " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_layer_id ( " floating-sel " ,
" floating sel " ,
" The floating selection " ,
2006-05-06 18:57:51 +00:00
pdb - > gimp , FALSE ,
2006-04-04 21:11:45 +00:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " undo " ,
" undo " ,
2006-05-18 17:25:15 +00:00
" " ,
2006-04-04 21:11:45 +00:00
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2006-04-04 21:11:45 +00:00
}