2010-07-09 15:34:44 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
|
|
|
*
|
|
|
|
* gimpitem_pdb.c
|
|
|
|
*
|
|
|
|
* This library is free software: you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see
|
2018-07-12 05:27:07 +08:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
2010-07-09 15:34:44 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl */
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2022-03-28 21:13:17 +08:00
|
|
|
#include "stamp-pdbgen.h"
|
|
|
|
|
2010-07-09 15:34:44 +08:00
|
|
|
#include "gimp.h"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-31 16:04:43 +08:00
|
|
|
* SECTION: gimpitem
|
2010-07-09 15:34:44 +08:00
|
|
|
* @title: gimpitem
|
|
|
|
* @short_description: Functions to manipulate items.
|
|
|
|
*
|
|
|
|
* Functions to manipulate items.
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2019-08-29 17:25:35 +08:00
|
|
|
* gimp_item_id_is_valid:
|
|
|
|
* @item_id: The item ID to check.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2024-08-26 20:52:08 +08:00
|
|
|
* Returns %TRUE if the item ID is valid.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* This procedure checks if the given item ID is valid and refers to an
|
|
|
|
* existing item.
|
2024-08-26 21:14:48 +08:00
|
|
|
*
|
|
|
|
* *Note*: in most use cases, you should not use this function. If you
|
2024-08-26 20:52:08 +08:00
|
|
|
* got a [class@Gimp.Item] from the API, you should trust it is valid.
|
|
|
|
* This function is mostly for internal usage.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Returns: Whether the item ID is valid.
|
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Since: 3.0
|
2019-08-13 19:59:33 +08:00
|
|
|
**/
|
|
|
|
gboolean
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_item_id_is_valid (gint item_id)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean valid = FALSE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
G_TYPE_INT, item_id,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-id-is-valid",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
valid = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return valid;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-08-29 17:25:35 +08:00
|
|
|
* gimp_item_id_is_drawable:
|
|
|
|
* @item_id: The item ID.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns whether the item ID is a drawable.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2024-08-26 20:52:08 +08:00
|
|
|
* This procedure returns %TRUE if the specified item ID is a drawable.
|
2024-08-26 21:14:48 +08:00
|
|
|
*
|
|
|
|
* *Note*: in most use cases, you should not use this function. See
|
2024-08-27 06:24:26 +08:00
|
|
|
* [func@Gimp.Item.id_is_layer] for a discussion on alternatives.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns: TRUE if the item ID is a drawable, FALSE otherwise.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Since: 3.0
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2010-07-09 15:34:44 +08:00
|
|
|
gboolean
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_item_id_is_drawable (gint item_id)
|
2010-07-09 15:34:44 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-13 19:59:33 +08:00
|
|
|
gboolean drawable = FALSE;
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
G_TYPE_INT, item_id,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-id-is-drawable",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
drawable = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-08-13 19:59:33 +08:00
|
|
|
return drawable;
|
2010-07-09 15:34:44 +08:00
|
|
|
}
|
|
|
|
|
2010-09-16 03:51:53 +08:00
|
|
|
/**
|
2019-08-29 17:25:35 +08:00
|
|
|
* gimp_item_id_is_layer:
|
|
|
|
* @item_id: The item ID.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns whether the item ID is a layer.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2024-08-26 20:52:08 +08:00
|
|
|
* This procedure returns %TRUE if the specified item ID is a layer.
|
2024-08-26 21:14:48 +08:00
|
|
|
*
|
|
|
|
* *Note*: in most use cases, you should not use this function. If the
|
2024-08-27 06:24:26 +08:00
|
|
|
* goal is to verify the accurate type for a [class@Gimp.Item], you
|
|
|
|
* should either use [method@Gimp.Item.is_layer] or the specific
|
|
|
|
* type-checking methods for the used language.
|
app, libgimp, pdb: support triple-backticks unformatted desc sections.
The previous PDB generation was losing pre-formatting inside
triple-backticked blocks. In particular we were losing indentation
(which was already ugly in C, but even syntactically wrong when
displaying Python code samples). And it was also making us add
double-newlines between every code lines, which was annoying.
This updated code now leaves triple-backticked sections as-is.
Unfortunately I was completely unable to do this by modifying the
existing functions, which were modifying the input arg in-place. So I
made them into functions returning the result. But then there is another
part of code (niceargs()) where changing array contents doesn't work
properly, and worse it seems to corrupt the array somehow (because I
have generation breakage in completely-different pieces of the PDB
generation code). I believe there is some passing-by reference/value
concepts in perl which I don't quite get (they use `&`, `\` and other
symbols and even searching for these, I don't quite understand how to
use them the right way) but I've spent already too much time on this. So
since I've got something working now by having duplicate functions, I'll
let someone else from the future, who knows better perl, re-merge these
functions if they know how.
2024-08-27 17:39:31 +08:00
|
|
|
*
|
2024-08-26 20:52:08 +08:00
|
|
|
* For instance, in C:
|
app, libgimp, pdb: support triple-backticks unformatted desc sections.
The previous PDB generation was losing pre-formatting inside
triple-backticked blocks. In particular we were losing indentation
(which was already ugly in C, but even syntactically wrong when
displaying Python code samples). And it was also making us add
double-newlines between every code lines, which was annoying.
This updated code now leaves triple-backticked sections as-is.
Unfortunately I was completely unable to do this by modifying the
existing functions, which were modifying the input arg in-place. So I
made them into functions returning the result. But then there is another
part of code (niceargs()) where changing array contents doesn't work
properly, and worse it seems to corrupt the array somehow (because I
have generation breakage in completely-different pieces of the PDB
generation code). I believe there is some passing-by reference/value
concepts in perl which I don't quite get (they use `&`, `\` and other
symbols and even searching for these, I don't quite understand how to
use them the right way) but I've spent already too much time on this. So
since I've got something working now by having duplicate functions, I'll
let someone else from the future, who knows better perl, re-merge these
functions if they know how.
2024-08-27 17:39:31 +08:00
|
|
|
*
|
2024-08-26 20:52:08 +08:00
|
|
|
* ```C
|
|
|
|
* if (GIMP_IS_LAYER (item))
|
app, libgimp, pdb: support triple-backticks unformatted desc sections.
The previous PDB generation was losing pre-formatting inside
triple-backticked blocks. In particular we were losing indentation
(which was already ugly in C, but even syntactically wrong when
displaying Python code samples). And it was also making us add
double-newlines between every code lines, which was annoying.
This updated code now leaves triple-backticked sections as-is.
Unfortunately I was completely unable to do this by modifying the
existing functions, which were modifying the input arg in-place. So I
made them into functions returning the result. But then there is another
part of code (niceargs()) where changing array contents doesn't work
properly, and worse it seems to corrupt the array somehow (because I
have generation breakage in completely-different pieces of the PDB
generation code). I believe there is some passing-by reference/value
concepts in perl which I don't quite get (they use `&`, `\` and other
symbols and even searching for these, I don't quite understand how to
use them the right way) but I've spent already too much time on this. So
since I've got something working now by having duplicate functions, I'll
let someone else from the future, who knows better perl, re-merge these
functions if they know how.
2024-08-27 17:39:31 +08:00
|
|
|
* do_something ();
|
2024-08-26 20:52:08 +08:00
|
|
|
* ```
|
app, libgimp, pdb: support triple-backticks unformatted desc sections.
The previous PDB generation was losing pre-formatting inside
triple-backticked blocks. In particular we were losing indentation
(which was already ugly in C, but even syntactically wrong when
displaying Python code samples). And it was also making us add
double-newlines between every code lines, which was annoying.
This updated code now leaves triple-backticked sections as-is.
Unfortunately I was completely unable to do this by modifying the
existing functions, which were modifying the input arg in-place. So I
made them into functions returning the result. But then there is another
part of code (niceargs()) where changing array contents doesn't work
properly, and worse it seems to corrupt the array somehow (because I
have generation breakage in completely-different pieces of the PDB
generation code). I believe there is some passing-by reference/value
concepts in perl which I don't quite get (they use `&`, `\` and other
symbols and even searching for these, I don't quite understand how to
use them the right way) but I've spent already too much time on this. So
since I've got something working now by having duplicate functions, I'll
let someone else from the future, who knows better perl, re-merge these
functions if they know how.
2024-08-27 17:39:31 +08:00
|
|
|
*
|
2024-08-26 20:52:08 +08:00
|
|
|
* Or in the Python binding, you could run:
|
app, libgimp, pdb: support triple-backticks unformatted desc sections.
The previous PDB generation was losing pre-formatting inside
triple-backticked blocks. In particular we were losing indentation
(which was already ugly in C, but even syntactically wrong when
displaying Python code samples). And it was also making us add
double-newlines between every code lines, which was annoying.
This updated code now leaves triple-backticked sections as-is.
Unfortunately I was completely unable to do this by modifying the
existing functions, which were modifying the input arg in-place. So I
made them into functions returning the result. But then there is another
part of code (niceargs()) where changing array contents doesn't work
properly, and worse it seems to corrupt the array somehow (because I
have generation breakage in completely-different pieces of the PDB
generation code). I believe there is some passing-by reference/value
concepts in perl which I don't quite get (they use `&`, `\` and other
symbols and even searching for these, I don't quite understand how to
use them the right way) but I've spent already too much time on this. So
since I've got something working now by having duplicate functions, I'll
let someone else from the future, who knows better perl, re-merge these
functions if they know how.
2024-08-27 17:39:31 +08:00
|
|
|
*
|
2024-08-26 20:52:08 +08:00
|
|
|
* ```py3
|
|
|
|
* if isinstance(item, Gimp.Layer):
|
app, libgimp, pdb: support triple-backticks unformatted desc sections.
The previous PDB generation was losing pre-formatting inside
triple-backticked blocks. In particular we were losing indentation
(which was already ugly in C, but even syntactically wrong when
displaying Python code samples). And it was also making us add
double-newlines between every code lines, which was annoying.
This updated code now leaves triple-backticked sections as-is.
Unfortunately I was completely unable to do this by modifying the
existing functions, which were modifying the input arg in-place. So I
made them into functions returning the result. But then there is another
part of code (niceargs()) where changing array contents doesn't work
properly, and worse it seems to corrupt the array somehow (because I
have generation breakage in completely-different pieces of the PDB
generation code). I believe there is some passing-by reference/value
concepts in perl which I don't quite get (they use `&`, `\` and other
symbols and even searching for these, I don't quite understand how to
use them the right way) but I've spent already too much time on this. So
since I've got something working now by having duplicate functions, I'll
let someone else from the future, who knows better perl, re-merge these
functions if they know how.
2024-08-27 17:39:31 +08:00
|
|
|
* do_something()
|
2024-08-26 20:52:08 +08:00
|
|
|
* ```
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2019-08-13 19:59:33 +08:00
|
|
|
* Returns: TRUE if the item is a layer, FALSE otherwise.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Since: 3.0
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2010-07-09 15:34:44 +08:00
|
|
|
gboolean
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_item_id_is_layer (gint item_id)
|
2010-07-09 15:34:44 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-13 19:59:33 +08:00
|
|
|
gboolean layer = FALSE;
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
G_TYPE_INT, item_id,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-id-is-layer",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
layer = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-08-13 19:59:33 +08:00
|
|
|
return layer;
|
2010-07-09 15:34:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-08-29 17:25:35 +08:00
|
|
|
* gimp_item_id_is_text_layer:
|
|
|
|
* @item_id: The item ID.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns whether the item ID is a text layer.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2024-08-26 20:52:08 +08:00
|
|
|
* This procedure returns %TRUE if the specified item ID is a text
|
2019-08-29 17:25:35 +08:00
|
|
|
* layer.
|
2024-08-26 21:14:48 +08:00
|
|
|
*
|
|
|
|
* *Note*: in most use cases, you should not use this function. See
|
2024-08-26 20:52:08 +08:00
|
|
|
* [func@Gimp.Item.id_is_layer] for a discussion on alternatives.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2019-08-13 19:59:33 +08:00
|
|
|
* Returns: TRUE if the item is a text layer, FALSE otherwise.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Since: 3.0
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2010-07-09 15:34:44 +08:00
|
|
|
gboolean
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_item_id_is_text_layer (gint item_id)
|
2010-07-09 15:34:44 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-13 19:59:33 +08:00
|
|
|
gboolean text_layer = FALSE;
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
G_TYPE_INT, item_id,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-id-is-text-layer",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
text_layer = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-08-13 19:59:33 +08:00
|
|
|
return text_layer;
|
2010-07-09 15:34:44 +08:00
|
|
|
}
|
|
|
|
|
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 23:24:11 +08:00
|
|
|
/**
|
|
|
|
* gimp_item_id_is_group_layer:
|
|
|
|
* @item_id: The item ID.
|
|
|
|
*
|
|
|
|
* Returns whether the item ID is a group layer.
|
|
|
|
*
|
2024-08-26 20:52:08 +08:00
|
|
|
* This procedure returns %TRUE if the specified item ID is a 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 23:24:11 +08:00
|
|
|
* layer.
|
2024-08-26 21:14:48 +08:00
|
|
|
*
|
|
|
|
* *Note*: in most use cases, you should not use this function. See
|
2024-08-26 20:52:08 +08:00
|
|
|
* [func@Gimp.Item.id_is_layer] for a discussion on alternatives.
|
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 23:24:11 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE if the item is a group layer, FALSE otherwise.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_item_id_is_group_layer (gint item_id)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean group_layer = FALSE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_INT, item_id,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-id-is-group-layer",
|
|
|
|
args);
|
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
group_layer = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return group_layer;
|
|
|
|
}
|
|
|
|
|
2010-07-09 15:34:44 +08:00
|
|
|
/**
|
2019-08-29 17:25:35 +08:00
|
|
|
* gimp_item_id_is_channel:
|
|
|
|
* @item_id: The item ID.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns whether the item ID is a channel.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2024-08-26 20:52:08 +08:00
|
|
|
* This procedure returns %TRUE if the specified item ID is a channel.
|
2024-08-26 21:14:48 +08:00
|
|
|
*
|
|
|
|
* *Note*: in most use cases, you should not use this function. See
|
2024-08-27 06:24:26 +08:00
|
|
|
* [func@Gimp.Item.id_is_layer] for a discussion on alternatives.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns: TRUE if the item ID is a channel, FALSE otherwise.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Since: 3.0
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2010-07-09 15:34:44 +08:00
|
|
|
gboolean
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_item_id_is_channel (gint item_id)
|
2010-07-09 15:34:44 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-13 19:59:33 +08:00
|
|
|
gboolean channel = FALSE;
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
G_TYPE_INT, item_id,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-id-is-channel",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
channel = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-08-13 19:59:33 +08:00
|
|
|
return channel;
|
2010-07-09 15:34:44 +08:00
|
|
|
}
|
|
|
|
|
2010-08-29 00:49:15 +08:00
|
|
|
/**
|
2019-08-29 17:25:35 +08:00
|
|
|
* gimp_item_id_is_layer_mask:
|
|
|
|
* @item_id: The item.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns whether the item ID is a layer mask.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2024-08-26 20:52:08 +08:00
|
|
|
* This procedure returns %TRUE if the specified item ID is a layer
|
2019-08-29 17:25:35 +08:00
|
|
|
* mask.
|
2024-08-26 21:14:48 +08:00
|
|
|
*
|
|
|
|
* *Note*: in most use cases, you should not use this function. See
|
2024-08-27 06:24:26 +08:00
|
|
|
* [func@Gimp.Item.id_is_layer] for a discussion on alternatives.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns: TRUE if the item ID is a layer mask, FALSE otherwise.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Since: 3.0
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2010-08-29 00:49:15 +08:00
|
|
|
gboolean
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_item_id_is_layer_mask (gint item_id)
|
2010-08-29 00:49:15 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-29 17:25:35 +08:00
|
|
|
gboolean layer_mask = FALSE;
|
2010-08-29 00:49:15 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
G_TYPE_INT, item_id,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2010-08-29 00:49:15 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-id-is-layer-mask",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-08-29 00:49:15 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
layer_mask = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2010-08-29 00:49:15 +08:00
|
|
|
|
2019-08-29 17:25:35 +08:00
|
|
|
return layer_mask;
|
2010-08-29 00:49:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-07-09 07:39:51 +08:00
|
|
|
* gimp_item_id_is_path:
|
2019-08-29 17:25:35 +08:00
|
|
|
* @item_id: The item ID.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2024-07-09 07:39:51 +08:00
|
|
|
* Returns whether the item ID is a path.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2024-08-26 20:52:08 +08:00
|
|
|
* This procedure returns %TRUE if the specified item ID is a path.
|
2024-08-26 21:14:48 +08:00
|
|
|
*
|
|
|
|
* *Note*: in most use cases, you should not use this function. See
|
2024-08-27 06:24:26 +08:00
|
|
|
* [func@Gimp.Item.id_is_layer] for a discussion on alternatives.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2024-07-09 07:39:51 +08:00
|
|
|
* Returns: TRUE if the item ID is a path, FALSE otherwise.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2019-10-28 01:56:53 +08:00
|
|
|
* Since: 3.0
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-08-13 19:59:33 +08:00
|
|
|
gboolean
|
2024-07-09 07:39:51 +08:00
|
|
|
gimp_item_id_is_path (gint item_id)
|
2010-08-29 00:49:15 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2024-07-09 07:39:51 +08:00
|
|
|
gboolean path = FALSE;
|
2010-08-29 00:49:15 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
G_TYPE_INT, item_id,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
2024-07-09 07:39:51 +08:00
|
|
|
"gimp-item-id-is-path",
|
2023-10-17 04:07:55 +08:00
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-08-29 00:49:15 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2024-07-09 07:39:51 +08:00
|
|
|
path = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2010-08-29 00:49:15 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-08-29 00:49:15 +08:00
|
|
|
|
2024-07-09 07:39:51 +08:00
|
|
|
return path;
|
2010-08-29 00:49:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-07-09 07:39:51 +08:00
|
|
|
* gimp_item_id_is_selection:
|
2019-08-29 17:25:35 +08:00
|
|
|
* @item_id: The item ID.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2024-07-09 07:39:51 +08:00
|
|
|
* Returns whether the item ID is a selection.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2024-08-26 20:52:08 +08:00
|
|
|
* This procedure returns %TRUE if the specified item ID is a
|
|
|
|
* selection.
|
2024-08-26 21:14:48 +08:00
|
|
|
*
|
|
|
|
* *Note*: in most use cases, you should not use this function. See
|
2024-08-27 06:24:26 +08:00
|
|
|
* [func@Gimp.Item.id_is_layer] for a discussion on alternatives.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2024-07-09 07:39:51 +08:00
|
|
|
* Returns: TRUE if the item ID is a selection, FALSE otherwise.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Since: 3.0
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-08-13 19:59:33 +08:00
|
|
|
gboolean
|
2024-07-09 07:39:51 +08:00
|
|
|
gimp_item_id_is_selection (gint item_id)
|
2010-08-29 00:49:15 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2024-07-09 07:39:51 +08:00
|
|
|
gboolean selection = FALSE;
|
2010-08-29 00:49:15 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
G_TYPE_INT, item_id,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
2024-07-09 07:39:51 +08:00
|
|
|
"gimp-item-id-is-selection",
|
2023-10-17 04:07:55 +08:00
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-08-29 00:49:15 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2024-07-09 07:39:51 +08:00
|
|
|
selection = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2024-07-09 07:39:51 +08:00
|
|
|
return selection;
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-08-29 17:25:35 +08:00
|
|
|
* gimp_item_get_image:
|
2019-08-13 19:59:33 +08:00
|
|
|
* @item: The item.
|
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns the item's image.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* This procedure returns the item's image.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns: (transfer none): The item's image.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
2019-08-29 17:25:35 +08:00
|
|
|
GimpImage *
|
|
|
|
gimp_item_get_image (GimpItem *item)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-29 17:25:35 +08:00
|
|
|
GimpImage *image = NULL;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-get-image",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
image = GIMP_VALUES_GET_IMAGE (return_vals, 1);
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-08-29 17:25:35 +08:00
|
|
|
return image;
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-08-29 17:25:35 +08:00
|
|
|
* gimp_item_delete:
|
|
|
|
* @item: The item to delete.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Delete a item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* This procedure deletes the specified item. This must not be done if
|
|
|
|
* the image containing this item was already deleted or if the item
|
|
|
|
* was already removed from the image. The only case in which this
|
|
|
|
* procedure is useful is if you want to get rid of a item which has
|
|
|
|
* not yet been added to an image.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns: TRUE on success.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
gboolean
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_item_delete (GimpItem *item)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-29 17:25:35 +08:00
|
|
|
gboolean success = TRUE;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-delete",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-08-29 17:25:35 +08:00
|
|
|
return success;
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_item_is_group:
|
|
|
|
* @item: The item.
|
|
|
|
*
|
|
|
|
* Returns whether the item is a group item.
|
|
|
|
*
|
2024-08-26 20:52:08 +08:00
|
|
|
* This procedure returns %TRUE if the specified item is a group item
|
2019-08-13 19:59:33 +08:00
|
|
|
* which can have children.
|
|
|
|
*
|
|
|
|
* Returns: TRUE if the item is a group, FALSE otherwise.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_item_is_group (GimpItem *item)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean group = FALSE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-is-group",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
group = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return group;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_item_get_parent:
|
|
|
|
* @item: The item.
|
|
|
|
*
|
|
|
|
* Returns the item's parent item.
|
|
|
|
*
|
|
|
|
* This procedure returns the item's parent item, if any.
|
|
|
|
*
|
2019-08-15 18:12:25 +08:00
|
|
|
* Returns: (transfer none): The item's parent item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
GimpItem *
|
|
|
|
gimp_item_get_parent (GimpItem *item)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
GimpItem *parent = NULL;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-get-parent",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
parent = GIMP_VALUES_GET_ITEM (return_vals, 1);
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return parent;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-07-06 20:18:36 +08:00
|
|
|
* gimp_item_get_children:
|
2019-08-13 19:59:33 +08:00
|
|
|
* @item: The item.
|
|
|
|
* @num_children: (out): The item's number of children.
|
|
|
|
*
|
|
|
|
* Returns the item's list of children.
|
|
|
|
*
|
|
|
|
* This procedure returns the list of items which are children of the
|
|
|
|
* specified item. The order is topmost to bottommost.
|
|
|
|
*
|
2019-09-05 18:57:43 +08:00
|
|
|
* Returns: (array length=num_children) (element-type GimpItem) (transfer container):
|
2019-08-13 19:59:33 +08:00
|
|
|
* The item's list of children.
|
|
|
|
* The returned value must be freed with g_free().
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
2019-09-05 18:57:43 +08:00
|
|
|
GimpItem **
|
|
|
|
gimp_item_get_children (GimpItem *item,
|
|
|
|
gint *num_children)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-05 18:57:43 +08:00
|
|
|
GimpItem **children = NULL;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-get-children",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
*num_children = 0;
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
2019-09-04 08:49:33 +08:00
|
|
|
*num_children = GIMP_VALUES_GET_INT (return_vals, 1);
|
2021-08-26 23:18:32 +08:00
|
|
|
{ GimpObjectArray *a = g_value_get_boxed (gimp_value_array_index (return_vals, 2)); if (a) children = g_memdup2 (a->data, a->length * sizeof (gpointer)); };
|
2010-08-29 00:49:15 +08:00
|
|
|
}
|
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-08-29 00:49:15 +08:00
|
|
|
|
2019-09-05 18:57:43 +08:00
|
|
|
return children;
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_item_get_expanded:
|
|
|
|
* @item: The item.
|
|
|
|
*
|
|
|
|
* Returns whether the item is expanded.
|
|
|
|
*
|
2024-08-26 20:52:08 +08:00
|
|
|
* This procedure returns %TRUE if the specified item is expanded.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE if the item is expanded, FALSE otherwise.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_item_get_expanded (GimpItem *item)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean expanded = FALSE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-get-expanded",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
expanded = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return expanded;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_item_set_expanded:
|
|
|
|
* @item: The item.
|
|
|
|
* @expanded: TRUE to expand the item, FALSE to collapse the item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Sets the expanded state of the item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure expands or collapses the item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: TRUE on success.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_item_set_expanded (GimpItem *item,
|
|
|
|
gboolean expanded)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean success = TRUE;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
|
|
|
G_TYPE_BOOLEAN, expanded,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-set-expanded",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return success;
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_item_get_name:
|
2019-08-13 19:59:33 +08:00
|
|
|
* @item: The item.
|
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Get the name of the specified item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the specified item's name.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: (transfer full): The item name.
|
|
|
|
* The returned value must be freed with g_free().
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Since: 2.8
|
2019-08-13 19:59:33 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gchar *
|
|
|
|
gimp_item_get_name (GimpItem *item)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gchar *name = NULL;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-get-name",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
name = GIMP_VALUES_DUP_STRING (return_vals, 1);
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return name;
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_item_set_name:
|
|
|
|
* @item: The item.
|
|
|
|
* @name: The new item name.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Set the name of the specified item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure sets the specified item's name.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Since: 2.8
|
2019-08-13 19:59:33 +08:00
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_item_set_name (GimpItem *item,
|
|
|
|
const gchar *name)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
|
|
|
G_TYPE_STRING, name,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-set-name",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_item_get_visible:
|
2019-08-13 19:59:33 +08:00
|
|
|
* @item: The item.
|
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Get the visibility of the specified item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the specified item's visibility.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: The item visibility.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean
|
|
|
|
gimp_item_get_visible (GimpItem *item)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean visible = FALSE;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-get-visible",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
visible = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return visible;
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_item_set_visible:
|
|
|
|
* @item: The item.
|
|
|
|
* @visible: The new item visibility.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Set the visibility of the specified item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure sets the specified item's visibility.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: TRUE on success.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean
|
|
|
|
gimp_item_set_visible (GimpItem *item,
|
|
|
|
gboolean visible)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean success = TRUE;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
|
|
|
G_TYPE_BOOLEAN, visible,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-set-visible",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return success;
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_item_get_lock_content:
|
2019-08-13 19:59:33 +08:00
|
|
|
* @item: The item.
|
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Get the 'lock content' state of the specified item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the specified item's lock content state.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: Whether the item's contents are locked.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_item_get_lock_content (GimpItem *item)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean lock_content = FALSE;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-get-lock-content",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
lock_content = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return lock_content;
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_item_set_lock_content:
|
|
|
|
* @item: The item.
|
|
|
|
* @lock_content: The new item 'lock content' state.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Set the 'lock content' state of the specified item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure sets the specified item's lock content state.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: TRUE on success.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_item_set_lock_content (GimpItem *item,
|
|
|
|
gboolean lock_content)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean success = TRUE;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
|
|
|
G_TYPE_BOOLEAN, lock_content,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-set-lock-content",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return success;
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_item_get_lock_position:
|
2019-08-13 19:59:33 +08:00
|
|
|
* @item: The item.
|
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Get the 'lock position' state of the specified item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the specified item's lock position state.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: Whether the item's position is locked.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Since: 2.10
|
2019-08-13 19:59:33 +08:00
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_item_get_lock_position (GimpItem *item)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean lock_position = FALSE;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-get-lock-position",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
lock_position = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return lock_position;
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_item_set_lock_position:
|
|
|
|
* @item: The item.
|
|
|
|
* @lock_position: The new item 'lock position' state.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Set the 'lock position' state of the specified item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure sets the specified item's lock position state.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Since: 2.10
|
2019-08-13 19:59:33 +08:00
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_item_set_lock_position (GimpItem *item,
|
|
|
|
gboolean lock_position)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
|
|
|
G_TYPE_BOOLEAN, lock_position,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-set-lock-position",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2021-04-23 23:01:19 +08:00
|
|
|
/**
|
|
|
|
* gimp_item_get_lock_visibility:
|
|
|
|
* @item: The item.
|
|
|
|
*
|
|
|
|
* Get the 'lock visibility' state of the specified item.
|
|
|
|
*
|
|
|
|
* This procedure returns the specified item's lock visibility state.
|
|
|
|
*
|
|
|
|
* Returns: Whether the item's visibility is locked.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_item_get_lock_visibility (GimpItem *item)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean lock_visibility = FALSE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_ITEM, item,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-get-lock-visibility",
|
|
|
|
args);
|
2021-04-23 23:01:19 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
lock_visibility = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return lock_visibility;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_item_set_lock_visibility:
|
|
|
|
* @item: The item.
|
|
|
|
* @lock_visibility: The new item 'lock visibility' state.
|
|
|
|
*
|
|
|
|
* Set the 'lock visibility' state of the specified item.
|
|
|
|
*
|
|
|
|
* This procedure sets the specified item's lock visibility state.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_item_set_lock_visibility (GimpItem *item,
|
|
|
|
gboolean lock_visibility)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_ITEM, item,
|
|
|
|
G_TYPE_BOOLEAN, lock_visibility,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-set-lock-visibility",
|
|
|
|
args);
|
2021-04-23 23:01:19 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2019-08-13 19:59:33 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_item_get_color_tag:
|
2019-08-13 19:59:33 +08:00
|
|
|
* @item: The item.
|
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Get the color tag of the specified item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the specified item's color tag.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: The item's color tag.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Since: 2.10
|
2019-08-13 19:59:33 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpColorTag
|
|
|
|
gimp_item_get_color_tag (GimpItem *item)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpColorTag color_tag = 0;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-get-color-tag",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
color_tag = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return color_tag;
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_item_set_color_tag:
|
|
|
|
* @item: The item.
|
|
|
|
* @color_tag: The new item color tag.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Set the color tag of the specified item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure sets the specified item's color tag.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: TRUE on success.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Since: 2.10
|
2019-08-13 19:59:33 +08:00
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_item_set_color_tag (GimpItem *item,
|
|
|
|
GimpColorTag color_tag)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean success = TRUE;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
|
|
|
GIMP_TYPE_COLOR_TAG, color_tag,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-set-color-tag",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return success;
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_item_get_tattoo:
|
2019-08-13 19:59:33 +08:00
|
|
|
* @item: The item.
|
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Get the tattoo of the specified item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the specified item's tattoo. A tattoo is a
|
|
|
|
* unique and permanent identifier attached to a item that can be used
|
|
|
|
* to uniquely identify a item within an image even between sessions.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: The item tattoo.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
guint
|
|
|
|
gimp_item_get_tattoo (GimpItem *item)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
guint tattoo = 0;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-get-tattoo",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
tattoo = GIMP_VALUES_GET_UINT (return_vals, 1);
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return tattoo;
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_item_set_tattoo:
|
|
|
|
* @item: The item.
|
|
|
|
* @tattoo: The new item tattoo.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Set the tattoo of the specified item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure sets the specified item's tattoo. A tattoo is a
|
|
|
|
* unique and permanent identifier attached to a item that can be used
|
|
|
|
* to uniquely identify a item within an image even between sessions.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_item_set_tattoo (GimpItem *item,
|
|
|
|
guint tattoo)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
|
|
|
G_TYPE_UINT, tattoo,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-set-tattoo",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_item_attach_parasite:
|
2019-08-13 19:59:33 +08:00
|
|
|
* @item: The item.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @parasite: The parasite to attach to the item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Add a parasite to an item.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure attaches a parasite to an item. It has no return
|
|
|
|
* values.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: TRUE on success.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_item_attach_parasite (GimpItem *item,
|
|
|
|
const GimpParasite *parasite)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean success = TRUE;
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_PARASITE, parasite,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-attach-parasite",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-08-13 19:59:33 +08:00
|
|
|
return success;
|
2010-07-09 15:34:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-08-13 19:59:33 +08:00
|
|
|
* gimp_item_detach_parasite:
|
|
|
|
* @item: The item.
|
|
|
|
* @name: The name of the parasite to detach from the item.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2019-08-13 19:59:33 +08:00
|
|
|
* Removes a parasite from an item.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
2019-08-13 19:59:33 +08:00
|
|
|
* This procedure detaches a parasite from an item. It has no return
|
|
|
|
* values.
|
2010-07-09 15:34:44 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.8
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2010-07-09 15:34:44 +08:00
|
|
|
gboolean
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_item_detach_parasite (GimpItem *item,
|
|
|
|
const gchar *name)
|
2010-07-09 15:34:44 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-07-09 15:34:44 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_STRING, name,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-detach-parasite",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2010-07-09 15:34:44 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-07-09 15:34:44 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
2011-02-14 00:28:30 +08:00
|
|
|
|
|
|
|
/**
|
2019-08-13 19:59:33 +08:00
|
|
|
* gimp_item_get_parasite:
|
|
|
|
* @item: The item.
|
|
|
|
* @name: The name of the parasite to find.
|
2011-02-14 00:28:30 +08:00
|
|
|
*
|
2019-08-13 19:59:33 +08:00
|
|
|
* Look up a parasite in an item
|
2011-02-14 00:28:30 +08:00
|
|
|
*
|
2019-08-13 19:59:33 +08:00
|
|
|
* Finds and returns the parasite that is attached to an item.
|
2011-02-14 00:28:30 +08:00
|
|
|
*
|
2019-08-13 19:59:33 +08:00
|
|
|
* Returns: (transfer full): The found parasite.
|
2011-02-14 00:28:30 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.8
|
2011-02-14 00:28:30 +08:00
|
|
|
**/
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpParasite *
|
|
|
|
gimp_item_get_parasite (GimpItem *item,
|
|
|
|
const gchar *name)
|
2011-02-14 00:28:30 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpParasite *parasite = NULL;
|
2011-02-14 00:28:30 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-08 19:01:50 +08:00
|
|
|
G_TYPE_STRING, name,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-get-parasite",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2011-02-14 00:28:30 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
parasite = GIMP_VALUES_DUP_PARASITE (return_vals, 1);
|
2011-02-14 00:28:30 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2011-02-14 00:28:30 +08:00
|
|
|
|
2019-08-13 19:59:33 +08:00
|
|
|
return parasite;
|
2011-02-14 00:28:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2011-03-02 05:19:48 +08:00
|
|
|
* gimp_item_get_parasite_list:
|
2019-08-13 19:59:33 +08:00
|
|
|
* @item: The item.
|
2011-02-14 00:28:30 +08:00
|
|
|
*
|
|
|
|
* List all parasites.
|
|
|
|
*
|
|
|
|
* Returns a list of all parasites currently attached the an item.
|
|
|
|
*
|
2021-12-02 05:35:25 +08:00
|
|
|
* Returns: (array zero-terminated=1) (transfer full):
|
2019-08-05 04:09:04 +08:00
|
|
|
* The names of currently attached parasites.
|
|
|
|
* The returned value must be freed with g_strfreev().
|
2011-02-14 00:28:30 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.8
|
2011-02-14 00:28:30 +08:00
|
|
|
**/
|
2011-03-02 05:19:48 +08:00
|
|
|
gchar **
|
2021-12-02 05:35:25 +08:00
|
|
|
gimp_item_get_parasite_list (GimpItem *item)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gchar **parasites = NULL;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-get-parasite-list",
|
|
|
|
args);
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2021-12-02 05:35:25 +08:00
|
|
|
parasites = GIMP_VALUES_DUP_STRV (return_vals, 1);
|
2019-08-13 19:59:33 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return parasites;
|
|
|
|
}
|