app, libgimp, pdb, plug-ins: new GimpGroupLayer class in libgimp.
Also:
- renaming gimp_layer_group_new() to gimp_group_layer_new() in order to keep the
same name as in core code (i.e. GimpGroupLayer, not GimpLayerGroup).
- renaming gimp_image_merge_layer_group() to gimp_group_layer_merge()
- new functions: gimp_procedure_add_group_layer_argument(),
gimp_procedure_add_group_layer_aux_argument() and
gimp_procedure_add_group_layer_return_value().
This can be tested, e.g. in Python with these calls:
```py
i = Gimp.get_images()[0]
g = Gimp.GroupLayer.new(i, "hello")
i.insert_layer(g, None, 1)
g2 = Gimp.GroupLayer.new(i, "world")
i.insert_layer(g2, g, 1)
g.merge()
```
This was work started long ago, stored in an old stash which I finally
finish now! :-)
2024-07-06 17:24:11 +02:00
/* GIMP - The GNU Image Manipulation Program
* Copyright ( C ) 1995 - 2003 Spencer Kimball and Peter Mattis
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( 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
* along with this program . If not , see < https : //www.gnu.org/licenses/>.
*/
/* NOTE: This file is auto-generated by pdbgen.pl. */
# include "config.h"
# include "stamp-pdbgen.h"
# include <cairo.h>
# include <gegl.h>
# include <gdk-pixbuf/gdk-pixbuf.h>
# include "libgimpbase/gimpbase.h"
# include "libgimpbase/gimpbase.h"
# include "pdb-types.h"
# include "core/gimp.h"
# include "core/gimpgrouplayer.h"
# include "core/gimpimage-merge.h"
# include "core/gimpimage.h"
# include "core/gimplayer.h"
# include "core/gimpparamspecs.h"
# include "gimppdb.h"
# include "gimppdb-utils.h"
# include "gimpprocedure.h"
# include "internal-procs.h"
# include "gimp-intl.h"
static GimpValueArray *
group_layer_new_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
{
gboolean success = TRUE ;
GimpValueArray * return_vals ;
GimpImage * image ;
2025-01-20 22:33:48 +01:00
const gchar * name ;
app, libgimp, pdb, plug-ins: new GimpGroupLayer class in libgimp.
Also:
- renaming gimp_layer_group_new() to gimp_group_layer_new() in order to keep the
same name as in core code (i.e. GimpGroupLayer, not GimpLayerGroup).
- renaming gimp_image_merge_layer_group() to gimp_group_layer_merge()
- new functions: gimp_procedure_add_group_layer_argument(),
gimp_procedure_add_group_layer_aux_argument() and
gimp_procedure_add_group_layer_return_value().
This can be tested, e.g. in Python with these calls:
```py
i = Gimp.get_images()[0]
g = Gimp.GroupLayer.new(i, "hello")
i.insert_layer(g, None, 1)
g2 = Gimp.GroupLayer.new(i, "world")
i.insert_layer(g2, g, 1)
g.merge()
```
This was work started long ago, stored in an old stash which I finally
finish now! :-)
2024-07-06 17:24:11 +02:00
GimpGroupLayer * group_layer = NULL ;
image = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2025-01-20 22:33:48 +01:00
name = g_value_get_string ( gimp_value_array_index ( args , 1 ) ) ;
app, libgimp, pdb, plug-ins: new GimpGroupLayer class in libgimp.
Also:
- renaming gimp_layer_group_new() to gimp_group_layer_new() in order to keep the
same name as in core code (i.e. GimpGroupLayer, not GimpLayerGroup).
- renaming gimp_image_merge_layer_group() to gimp_group_layer_merge()
- new functions: gimp_procedure_add_group_layer_argument(),
gimp_procedure_add_group_layer_aux_argument() and
gimp_procedure_add_group_layer_return_value().
This can be tested, e.g. in Python with these calls:
```py
i = Gimp.get_images()[0]
g = Gimp.GroupLayer.new(i, "hello")
i.insert_layer(g, None, 1)
g2 = Gimp.GroupLayer.new(i, "world")
i.insert_layer(g2, g, 1)
g.merge()
```
This was work started long ago, stored in an old stash which I finally
finish now! :-)
2024-07-06 17:24:11 +02:00
if ( success )
{
group_layer = GIMP_GROUP_LAYER ( gimp_group_layer_new ( image ) ) ;
if ( ! group_layer )
2025-01-20 22:33:48 +01:00
{
success = FALSE ;
}
else if ( name ! = NULL & & strlen ( name ) > 0 )
{
gimp_item_rename ( GIMP_ITEM ( group_layer ) , name , error ) ;
}
app, libgimp, pdb, plug-ins: new GimpGroupLayer class in libgimp.
Also:
- renaming gimp_layer_group_new() to gimp_group_layer_new() in order to keep the
same name as in core code (i.e. GimpGroupLayer, not GimpLayerGroup).
- renaming gimp_image_merge_layer_group() to gimp_group_layer_merge()
- new functions: gimp_procedure_add_group_layer_argument(),
gimp_procedure_add_group_layer_aux_argument() and
gimp_procedure_add_group_layer_return_value().
This can be tested, e.g. in Python with these calls:
```py
i = Gimp.get_images()[0]
g = Gimp.GroupLayer.new(i, "hello")
i.insert_layer(g, None, 1)
g2 = Gimp.GroupLayer.new(i, "world")
i.insert_layer(g2, g, 1)
g.merge()
```
This was work started long ago, stored in an old stash which I finally
finish now! :-)
2024-07-06 17:24:11 +02:00
}
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
if ( success )
g_value_set_object ( gimp_value_array_index ( return_vals , 1 ) , group_layer ) ;
return return_vals ;
}
static GimpValueArray *
group_layer_merge_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
{
gboolean success = TRUE ;
GimpValueArray * return_vals ;
GimpGroupLayer * group_layer ;
GimpLayer * layer = NULL ;
group_layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
if ( success )
{
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( group_layer ) , NULL , 0 , error ) & &
gimp_pdb_item_is_group ( GIMP_ITEM ( group_layer ) , error ) )
{
GimpImage * image = gimp_item_get_image ( GIMP_ITEM ( group_layer ) ) ;
layer = gimp_image_merge_group_layer ( image , group_layer ) ;
if ( ! layer )
success = FALSE ;
}
else
success = FALSE ;
}
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
if ( success )
g_value_set_object ( gimp_value_array_index ( return_vals , 1 ) , layer ) ;
return return_vals ;
}
void
register_group_layer_procs ( GimpPDB * pdb )
{
GimpProcedure * procedure ;
/*
* gimp - group - layer - new
*/
2025-02-25 19:34:00 +01:00
procedure = gimp_procedure_new ( group_layer_new_invoker , FALSE ) ;
app, libgimp, pdb, plug-ins: new GimpGroupLayer class in libgimp.
Also:
- renaming gimp_layer_group_new() to gimp_group_layer_new() in order to keep the
same name as in core code (i.e. GimpGroupLayer, not GimpLayerGroup).
- renaming gimp_image_merge_layer_group() to gimp_group_layer_merge()
- new functions: gimp_procedure_add_group_layer_argument(),
gimp_procedure_add_group_layer_aux_argument() and
gimp_procedure_add_group_layer_return_value().
This can be tested, e.g. in Python with these calls:
```py
i = Gimp.get_images()[0]
g = Gimp.GroupLayer.new(i, "hello")
i.insert_layer(g, None, 1)
g2 = Gimp.GroupLayer.new(i, "world")
i.insert_layer(g2, g, 1)
g.merge()
```
This was work started long ago, stored in an old stash which I finally
finish now! :-)
2024-07-06 17:24:11 +02:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-group-layer-new " ) ;
gimp_procedure_set_static_help ( procedure ,
" Create a new group layer. " ,
2025-01-20 22:33:48 +01:00
" This procedure creates a new group layer with a given @name. If @name is %NULL, GIMP will choose a name using its default layer name algorithm. \n "
" \n "
" The new group layer still needs to be added to the image, as this is not automatic. Add the new layer with the [method@Image.insert_layer] method. \n "
" Other attributes such as layer mask, modes and offsets should be set with explicit procedure calls. \n "
" \n "
2025-01-21 15:02:51 +01:00
" Other procedures useful with group layers: [method@Image.reorder_item], [method@Item.get_parent], [method@Item.get_children], [method@Item.is_group]. " ,
app, libgimp, pdb, plug-ins: new GimpGroupLayer class in libgimp.
Also:
- renaming gimp_layer_group_new() to gimp_group_layer_new() in order to keep the
same name as in core code (i.e. GimpGroupLayer, not GimpLayerGroup).
- renaming gimp_image_merge_layer_group() to gimp_group_layer_merge()
- new functions: gimp_procedure_add_group_layer_argument(),
gimp_procedure_add_group_layer_aux_argument() and
gimp_procedure_add_group_layer_return_value().
This can be tested, e.g. in Python with these calls:
```py
i = Gimp.get_images()[0]
g = Gimp.GroupLayer.new(i, "hello")
i.insert_layer(g, None, 1)
g2 = Gimp.GroupLayer.new(i, "world")
i.insert_layer(g2, g, 1)
g.merge()
```
This was work started long ago, stored in an old stash which I finally
finish now! :-)
2024-07-06 17:24:11 +02:00
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Barak Itkin <lightningismyname@gmail.com> " ,
" Barak Itkin " ,
" 2010 " ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image ( " image " ,
" image " ,
2024-07-07 10:43:51 +02:00
" The image to which to add the group layer " ,
app, libgimp, pdb, plug-ins: new GimpGroupLayer class in libgimp.
Also:
- renaming gimp_layer_group_new() to gimp_group_layer_new() in order to keep the
same name as in core code (i.e. GimpGroupLayer, not GimpLayerGroup).
- renaming gimp_image_merge_layer_group() to gimp_group_layer_merge()
- new functions: gimp_procedure_add_group_layer_argument(),
gimp_procedure_add_group_layer_aux_argument() and
gimp_procedure_add_group_layer_return_value().
This can be tested, e.g. in Python with these calls:
```py
i = Gimp.get_images()[0]
g = Gimp.GroupLayer.new(i, "hello")
i.insert_layer(g, None, 1)
g2 = Gimp.GroupLayer.new(i, "world")
i.insert_layer(g2, g, 1)
g.merge()
```
This was work started long ago, stored in an old stash which I finally
finish now! :-)
2024-07-06 17:24:11 +02:00
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2025-01-20 22:33:48 +01:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The group layer name " ,
FALSE , TRUE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
app, libgimp, pdb, plug-ins: new GimpGroupLayer class in libgimp.
Also:
- renaming gimp_layer_group_new() to gimp_group_layer_new() in order to keep the
same name as in core code (i.e. GimpGroupLayer, not GimpLayerGroup).
- renaming gimp_image_merge_layer_group() to gimp_group_layer_merge()
- new functions: gimp_procedure_add_group_layer_argument(),
gimp_procedure_add_group_layer_aux_argument() and
gimp_procedure_add_group_layer_return_value().
This can be tested, e.g. in Python with these calls:
```py
i = Gimp.get_images()[0]
g = Gimp.GroupLayer.new(i, "hello")
i.insert_layer(g, None, 1)
g2 = Gimp.GroupLayer.new(i, "world")
i.insert_layer(g2, g, 1)
g.merge()
```
This was work started long ago, stored in an old stash which I finally
finish now! :-)
2024-07-06 17:24:11 +02:00
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_group_layer ( " group-layer " ,
" group layer " ,
" The newly created group layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
/*
* gimp - group - layer - merge
*/
2025-02-25 19:34:00 +01:00
procedure = gimp_procedure_new ( group_layer_merge_invoker , FALSE ) ;
app, libgimp, pdb, plug-ins: new GimpGroupLayer class in libgimp.
Also:
- renaming gimp_layer_group_new() to gimp_group_layer_new() in order to keep the
same name as in core code (i.e. GimpGroupLayer, not GimpLayerGroup).
- renaming gimp_image_merge_layer_group() to gimp_group_layer_merge()
- new functions: gimp_procedure_add_group_layer_argument(),
gimp_procedure_add_group_layer_aux_argument() and
gimp_procedure_add_group_layer_return_value().
This can be tested, e.g. in Python with these calls:
```py
i = Gimp.get_images()[0]
g = Gimp.GroupLayer.new(i, "hello")
i.insert_layer(g, None, 1)
g2 = Gimp.GroupLayer.new(i, "world")
i.insert_layer(g2, g, 1)
g.merge()
```
This was work started long ago, stored in an old stash which I finally
finish now! :-)
2024-07-06 17:24:11 +02:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-group-layer-merge " ) ;
gimp_procedure_set_static_help ( procedure ,
" Merge the passed group layer's layers into one normal layer. " ,
" This procedure combines the layers of the passed group layer into a single normal layer, replacing the group. \n "
" The group layer is expected to be attached to an image. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Ell " ,
" Ell " ,
" 2019 " ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_group_layer ( " group-layer " ,
" group layer " ,
2024-07-07 10:43:51 +02:00
" The group layer to merge " ,
app, libgimp, pdb, plug-ins: new GimpGroupLayer class in libgimp.
Also:
- renaming gimp_layer_group_new() to gimp_group_layer_new() in order to keep the
same name as in core code (i.e. GimpGroupLayer, not GimpLayerGroup).
- renaming gimp_image_merge_layer_group() to gimp_group_layer_merge()
- new functions: gimp_procedure_add_group_layer_argument(),
gimp_procedure_add_group_layer_aux_argument() and
gimp_procedure_add_group_layer_return_value().
This can be tested, e.g. in Python with these calls:
```py
i = Gimp.get_images()[0]
g = Gimp.GroupLayer.new(i, "hello")
i.insert_layer(g, None, 1)
g2 = Gimp.GroupLayer.new(i, "world")
i.insert_layer(g2, g, 1)
g.merge()
```
This was work started long ago, stored in an old stash which I finally
finish now! :-)
2024-07-06 17:24:11 +02:00
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The resulting layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
}