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"
|
|
|
|
|
|
|
|
#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
|
|
|
*
|
2019-08-29 17:25:35 +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.
|
|
|
|
*
|
|
|
|
* 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);
|
|
|
|
|
2019-09-04 05:55:49 +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
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* This procedure returns TRUE if the specified item ID is a drawable.
|
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
|
|
|
|
2019-09-04 05:55:49 +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
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* This procedure returns TRUE if the specified item ID is a layer.
|
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
|
|
|
|
2019-09-04 05:55:49 +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
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* This procedure returns TRUE if the specified item ID is a text
|
|
|
|
* layer.
|
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
|
|
|
|
2019-09-04 05:55:49 +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
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
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
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* This procedure returns TRUE if the specified item ID is a channel.
|
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);
|
|
|
|
|
2019-09-04 05:55:49 +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
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* This procedure returns TRUE if the specified item ID is a layer
|
|
|
|
* mask.
|
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
|
|
|
|
2019-09-04 05:55:49 +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
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-08-29 17:25:35 +08:00
|
|
|
* gimp_item_id_is_selection:
|
|
|
|
* @item_id: The item ID.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns whether the item ID is a selection.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* This procedure returns TRUE if the specified item ID is a selection.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns: TRUE if the item ID is a selection, 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
|
2019-08-29 17:25:35 +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;
|
2019-08-29 17:25:35 +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);
|
|
|
|
|
2019-09-04 05:55:49 +08:00
|
|
|
return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-id-is-selection",
|
|
|
|
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
|
|
|
selection = 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
|
|
|
|
2019-08-29 17:25:35 +08:00
|
|
|
return selection;
|
2010-08-29 00:49:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-08-29 17:25:35 +08:00
|
|
|
* gimp_item_id_is_vectors:
|
|
|
|
* @item_id: The item ID.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns whether the item ID is a vectors.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* This procedure returns TRUE if the specified item ID is a vectors.
|
2010-08-29 00:49:15 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns: TRUE if the item ID is a vectors, 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
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_item_id_is_vectors (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 vectors = 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);
|
|
|
|
|
2019-09-04 05:55:49 +08:00
|
|
|
return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-id-is-vectors",
|
|
|
|
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
|
|
|
vectors = GIMP_VALUES_GET_BOOLEAN (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 vectors;
|
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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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.
|
|
|
|
*
|
|
|
|
* This procedure returns TRUE if the specified item is a group item
|
|
|
|
* 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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-05 18:57:43 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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.
|
|
|
|
*
|
|
|
|
* This procedure returns TRUE if the specified item is expanded.
|
|
|
|
*
|
|
|
|
* 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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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_linked:
|
2019-08-13 19:59:33 +08:00
|
|
|
* @item: The item.
|
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Get the linked 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 linked state.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: The item linked state (for moves).
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_item_get_linked (GimpItem *item)
|
2019-08-13 19:59:33 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean linked = 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);
|
|
|
|
|
2019-09-04 05:55:49 +08:00
|
|
|
return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-get-linked",
|
|
|
|
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
|
|
|
linked = 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 linked;
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_item_set_linked:
|
|
|
|
* @item: The item.
|
|
|
|
* @linked: The new item linked state.
|
2019-08-13 19:59:33 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Set the linked 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 linked state.
|
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_linked (GimpItem *item,
|
|
|
|
gboolean linked)
|
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, linked,
|
2019-08-13 19:59:33 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2019-09-04 05:55:49 +08:00
|
|
|
return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-item-set-linked",
|
|
|
|
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_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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
2019-09-04 05:55:49 +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.
|
2019-08-01 04:51:35 +08:00
|
|
|
* @num_parasites: (out): The number of attached parasites.
|
2011-02-14 00:28:30 +08:00
|
|
|
*
|
|
|
|
* List all parasites.
|
|
|
|
*
|
|
|
|
* Returns a list of all parasites currently attached the an item.
|
|
|
|
*
|
2019-08-05 04:09:04 +08:00
|
|
|
* Returns: (array length=num_parasites) (element-type gchar*) (transfer full):
|
|
|
|
* 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 **
|
2019-08-13 19:59:33 +08:00
|
|
|
gimp_item_get_parasite_list (GimpItem *item,
|
|
|
|
gint *num_parasites)
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
|
2019-09-04 05:55:49 +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);
|
|
|
|
|
|
|
|
*num_parasites = 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_parasites = GIMP_VALUES_GET_INT (return_vals, 1);
|
|
|
|
parasites = GIMP_VALUES_DUP_STRING_ARRAY (return_vals, 2);
|
2019-08-13 19:59:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return parasites;
|
|
|
|
}
|