2000-05-31 21:24:14 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2003-07-03 08:47:26 +08:00
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
2000-05-31 21:24:14 +08:00
|
|
|
*
|
2019-08-06 18:50:08 +08:00
|
|
|
* gimppdb_pdb.c
|
2000-05-31 21:24:14 +08:00
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2000-05-31 21:24:14 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2000-05-31 21:24:14 +08:00
|
|
|
*
|
|
|
|
* 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
|
2000-06-02 01:34:56 +08:00
|
|
|
* Lesser General Public License for more details.
|
2000-05-31 21:24:14 +08:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
2018-07-12 05:27:07 +08:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
2000-05-31 21:24:14 +08:00
|
|
|
*/
|
|
|
|
|
2007-01-09 18:52:47 +08:00
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl */
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2002-05-14 07:30:23 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2022-03-28 21:13:17 +08:00
|
|
|
#include "stamp-pdbgen.h"
|
|
|
|
|
2000-05-31 21:24:14 +08:00
|
|
|
#include "gimp.h"
|
2019-08-09 03:52:36 +08:00
|
|
|
#include "gimppdb_pdb.h"
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2003-12-19 08:00:49 +08:00
|
|
|
/**
|
2019-08-07 06:19:38 +08:00
|
|
|
* _gimp_pdb_temp_name:
|
2003-12-19 08:00:49 +08:00
|
|
|
*
|
|
|
|
* Generates a unique temporary PDB name.
|
|
|
|
*
|
|
|
|
* This procedure generates a temporary PDB entry name that is
|
2007-01-09 18:52:47 +08:00
|
|
|
* guaranteed to be unique.
|
2003-12-19 08:00:49 +08:00
|
|
|
*
|
2019-08-05 04:09:04 +08:00
|
|
|
* Returns: (transfer full): A unique temporary name for a temporary PDB entry.
|
|
|
|
* The returned value must be freed with g_free().
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2003-12-19 08:00:49 +08:00
|
|
|
gchar *
|
2019-08-07 06:19:38 +08:00
|
|
|
_gimp_pdb_temp_name (void)
|
2003-12-19 08:00:49 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2003-12-19 08:00:49 +08:00
|
|
|
gchar *temp_name = NULL;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-temp-name",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2003-12-19 08:00:49 +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
|
|
|
temp_name = GIMP_VALUES_DUP_STRING (return_vals, 1);
|
2003-12-19 08:00:49 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2003-12-19 08:00:49 +08:00
|
|
|
|
|
|
|
return temp_name;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-08-08 07:14:35 +08:00
|
|
|
* _gimp_pdb_dump:
|
2019-09-12 04:37:40 +08:00
|
|
|
* @file: The dump filename.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Dumps the current contents of the procedural database
|
|
|
|
*
|
|
|
|
* This procedure dumps the contents of the procedural database to the
|
|
|
|
* specified file. The file will contain all of the information
|
2007-11-23 22:38:37 +08:00
|
|
|
* provided for each registered procedure.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2019-09-12 04:37:40 +08:00
|
|
|
_gimp_pdb_dump (GFile *file)
|
2000-05-31 21:24:14 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-12 04:37:40 +08:00
|
|
|
G_TYPE_FILE, file,
|
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-pdb-dump",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-05-31 21:24:14 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-08-08 07:14:35 +08:00
|
|
|
* _gimp_pdb_query:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @name: The regex for procedure name.
|
|
|
|
* @blurb: The regex for procedure blurb.
|
|
|
|
* @help: The regex for procedure help.
|
2019-08-11 23:03:03 +08:00
|
|
|
* @authors: The regex for procedure authors.
|
2000-08-25 07:06:53 +08:00
|
|
|
* @copyright: The regex for procedure copyright.
|
|
|
|
* @date: The regex for procedure date.
|
2017-03-22 00:45:50 +08:00
|
|
|
* @proc_type: The regex for procedure type: { 'Internal GIMP procedure', 'GIMP Plug-in', 'GIMP Extension', 'Temporary Procedure' }.
|
2021-12-02 05:35:25 +08:00
|
|
|
* @procedure_names: (out) (array zero-terminated=1) (transfer full): The list of procedure names.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Queries the procedural database for its contents using regular
|
|
|
|
* expression matching.
|
|
|
|
*
|
|
|
|
* This procedure queries the contents of the procedural database. It
|
|
|
|
* is supplied with seven arguments matching procedures on { name,
|
2019-08-11 23:03:03 +08:00
|
|
|
* blurb, help, authors, copyright, date, procedure type}. This is
|
2000-08-25 07:06:53 +08:00
|
|
|
* accomplished using regular expression matching. For instance, to
|
|
|
|
* find all procedures with \"jpeg\" listed in the blurb, all seven
|
|
|
|
* arguments can be supplied as \".*\", except for the second, which
|
|
|
|
* can be supplied as \".*jpeg.*\". There are two return arguments for
|
|
|
|
* this procedure. The first is the number of procedures matching the
|
|
|
|
* query. The second is a concatenated list of procedure names
|
|
|
|
* corresponding to those matching the query. If no matching entries
|
|
|
|
* are found, then the returned string is NULL and the number of
|
|
|
|
* entries is 0.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2019-08-08 07:14:35 +08:00
|
|
|
_gimp_pdb_query (const gchar *name,
|
|
|
|
const gchar *blurb,
|
|
|
|
const gchar *help,
|
2019-08-11 23:03:03 +08:00
|
|
|
const gchar *authors,
|
2019-08-08 07:14:35 +08:00
|
|
|
const gchar *copyright,
|
|
|
|
const gchar *date,
|
|
|
|
const gchar *proc_type,
|
|
|
|
gchar ***procedure_names)
|
2000-05-31 21:24:14 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2019-07-30 16:51:16 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, name,
|
|
|
|
G_TYPE_STRING, blurb,
|
|
|
|
G_TYPE_STRING, help,
|
2019-08-11 23:03:03 +08:00
|
|
|
G_TYPE_STRING, authors,
|
2019-08-08 19:01:50 +08:00
|
|
|
G_TYPE_STRING, copyright,
|
|
|
|
G_TYPE_STRING, date,
|
|
|
|
G_TYPE_STRING, proc_type,
|
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-pdb-query",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2000-08-22 05:23:31 +08:00
|
|
|
*procedure_names = NULL;
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
if (success)
|
2021-12-02 05:35:25 +08:00
|
|
|
*procedure_names = GIMP_VALUES_DUP_STRV (return_vals, 1);
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-05-31 21:24:14 +08:00
|
|
|
}
|
|
|
|
|
2008-04-07 04:30:59 +08:00
|
|
|
/**
|
2019-08-07 00:29:55 +08:00
|
|
|
* _gimp_pdb_proc_exists:
|
2008-04-07 04:30:59 +08:00
|
|
|
* @procedure_name: The procedure name.
|
|
|
|
*
|
|
|
|
* Checks if the specified procedure exists in the procedural database
|
|
|
|
*
|
|
|
|
* This procedure checks if the specified procedure is registered in
|
|
|
|
* the procedural database.
|
|
|
|
*
|
|
|
|
* Returns: Whether a procedure of that name is registered.
|
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-07 04:30:59 +08:00
|
|
|
gboolean
|
2019-08-07 00:29:55 +08:00
|
|
|
_gimp_pdb_proc_exists (const gchar *procedure_name)
|
2008-04-07 04:30:59 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-07 04:30:59 +08:00
|
|
|
gboolean exists = FALSE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_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-pdb-proc-exists",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-07 04:30:59 +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
|
|
|
exists = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2008-04-07 04:30:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-07 04:30:59 +08:00
|
|
|
|
|
|
|
return exists;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-08 21:07:24 +08:00
|
|
|
* _gimp_pdb_get_proc_info:
|
2006-04-01 01:42:13 +08:00
|
|
|
* @procedure_name: The procedure name.
|
2019-08-01 04:51:35 +08:00
|
|
|
* @proc_type: (out): The procedure type.
|
|
|
|
* @num_args: (out): The number of input arguments.
|
|
|
|
* @num_values: (out): The number of return values.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Queries the procedural database for information on the specified
|
|
|
|
* procedure.
|
|
|
|
*
|
2019-09-04 07:38:31 +08:00
|
|
|
* This procedure returns information on the specified procedure. The
|
2000-08-25 07:06:53 +08:00
|
|
|
* procedure type, number of input, and number of return values are
|
|
|
|
* returned. For specific information on each input argument and return
|
2019-08-12 04:31:15 +08:00
|
|
|
* value, use the gimp_pdb_db_proc_argument() and
|
|
|
|
* gimp_pdb_db_proc_return_value() procedures.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2019-09-08 21:07:24 +08:00
|
|
|
_gimp_pdb_get_proc_info (const gchar *procedure_name,
|
|
|
|
GimpPDBProcType *proc_type,
|
|
|
|
gint *num_args,
|
|
|
|
gint *num_values)
|
2000-05-31 21:24:14 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_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-pdb-get-proc-info",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2000-08-22 05:23:31 +08:00
|
|
|
*proc_type = 0;
|
|
|
|
*num_args = 0;
|
|
|
|
*num_values = 0;
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-09-04 07:38:31 +08:00
|
|
|
if (success)
|
|
|
|
{
|
2019-09-04 08:49:33 +08:00
|
|
|
*proc_type = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
|
|
|
*num_args = GIMP_VALUES_GET_INT (return_vals, 2);
|
|
|
|
*num_values = GIMP_VALUES_GET_INT (return_vals, 3);
|
2019-09-04 07:38:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2019-09-11 02:23:19 +08:00
|
|
|
/**
|
|
|
|
* _gimp_pdb_get_proc_argument:
|
|
|
|
* @procedure_name: The procedure name.
|
|
|
|
* @arg_num: The argument number.
|
|
|
|
*
|
|
|
|
* Queries the procedural database for information on the specified
|
|
|
|
* procedure's argument.
|
|
|
|
*
|
|
|
|
* This procedure returns the #GParamSpec of procedure_name's argument.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): The GParamSpec of the argument.
|
|
|
|
* The returned value must be freed with g_param_spec_unref().
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
GParamSpec *
|
|
|
|
_gimp_pdb_get_proc_argument (const gchar *procedure_name,
|
|
|
|
gint arg_num)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
GParamSpec *param_spec = NULL;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_INT, arg_num,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-get-proc-argument",
|
|
|
|
args);
|
2019-09-11 02:23:19 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
param_spec = GIMP_VALUES_DUP_PARAM (return_vals, 1);
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return param_spec;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* _gimp_pdb_get_proc_return_value:
|
|
|
|
* @procedure_name: The procedure name.
|
|
|
|
* @val_num: The return value number.
|
|
|
|
*
|
|
|
|
* Queries the procedural database for information on the specified
|
|
|
|
* procedure's return value.
|
|
|
|
*
|
|
|
|
* This procedure returns the #GParamSpec of procedure_name's return
|
|
|
|
* value.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): The GParamSpec of the return value.
|
|
|
|
* The returned value must be freed with g_param_spec_unref().
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
GParamSpec *
|
|
|
|
_gimp_pdb_get_proc_return_value (const gchar *procedure_name,
|
|
|
|
gint val_num)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
GParamSpec *param_spec = NULL;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_INT, val_num,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-get-proc-return-value",
|
|
|
|
args);
|
2019-09-11 02:23:19 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
param_spec = GIMP_VALUES_DUP_PARAM (return_vals, 1);
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return param_spec;
|
|
|
|
}
|
|
|
|
|
2019-09-08 22:54:08 +08:00
|
|
|
/**
|
|
|
|
* _gimp_pdb_set_proc_image_types:
|
|
|
|
* @procedure_name: The procedure for which to install the menu path.
|
|
|
|
* @image_types: The procedure's supported image types.
|
|
|
|
*
|
|
|
|
* Set the supported image types for a plug-in procedure.
|
|
|
|
*
|
|
|
|
* This procedure sets the supported images types for the given
|
|
|
|
* procedure.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
_gimp_pdb_set_proc_image_types (const gchar *procedure_name,
|
|
|
|
const gchar *image_types)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_STRING, image_types,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-set-proc-image-types",
|
|
|
|
args);
|
2019-09-08 22:54:08 +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-09-08 03:08:13 +08:00
|
|
|
/**
|
2019-09-08 21:07:24 +08:00
|
|
|
* _gimp_pdb_get_proc_image_types:
|
2019-09-08 03:08:13 +08:00
|
|
|
* @procedure_name: The procedure name.
|
|
|
|
*
|
|
|
|
* Queries the procedural database for the image types supported by the
|
|
|
|
* specified procedure.
|
|
|
|
*
|
|
|
|
* This procedure returns the image types supported by the specified
|
|
|
|
* procedure.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): The image types.
|
|
|
|
* The returned value must be freed with g_free().
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gchar *
|
2019-09-08 21:07:24 +08:00
|
|
|
_gimp_pdb_get_proc_image_types (const gchar *procedure_name)
|
2019-09-08 03:08:13 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gchar *image_types = NULL;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-get-proc-image-types",
|
|
|
|
args);
|
2019-09-08 03:08:13 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
image_types = GIMP_VALUES_DUP_STRING (return_vals, 1);
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return image_types;
|
|
|
|
}
|
|
|
|
|
2021-04-02 05:49:11 +08:00
|
|
|
/**
|
|
|
|
* _gimp_pdb_set_proc_sensitivity_mask:
|
|
|
|
* @procedure_name: The procedure.
|
|
|
|
* @mask: The procedure's sensitivity mask.
|
|
|
|
*
|
|
|
|
* Set the sensitivity mask for a plug-in procedure.
|
|
|
|
*
|
|
|
|
* This procedure sets the sensitivity mask for the given procedure.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
_gimp_pdb_set_proc_sensitivity_mask (const gchar *procedure_name,
|
|
|
|
gint mask)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_INT, mask,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-set-proc-sensitivity-mask",
|
|
|
|
args);
|
2021-04-02 05:49:11 +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-09-08 23:30:54 +08:00
|
|
|
/**
|
|
|
|
* _gimp_pdb_set_proc_menu_label:
|
|
|
|
* @procedure_name: The procedure for which to install the menu path.
|
|
|
|
* @menu_label: The procedure's menu label.
|
|
|
|
*
|
|
|
|
* Set the menu label for a plug-in procedure.
|
|
|
|
*
|
|
|
|
* This procedure sets the menu label for the given procedure.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
_gimp_pdb_set_proc_menu_label (const gchar *procedure_name,
|
|
|
|
const gchar *menu_label)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_STRING, menu_label,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-set-proc-menu-label",
|
|
|
|
args);
|
2019-09-08 23:30:54 +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-09-08 03:08:13 +08:00
|
|
|
/**
|
2019-09-08 21:07:24 +08:00
|
|
|
* _gimp_pdb_get_proc_menu_label:
|
2019-09-08 03:08:13 +08:00
|
|
|
* @procedure_name: The procedure name.
|
|
|
|
*
|
|
|
|
* Queries the procedural database for the procedure's menu label.
|
|
|
|
*
|
|
|
|
* This procedure returns the menu label of the specified procedure.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): The menu_label.
|
|
|
|
* The returned value must be freed with g_free().
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gchar *
|
2019-09-08 21:07:24 +08:00
|
|
|
_gimp_pdb_get_proc_menu_label (const gchar *procedure_name)
|
2019-09-08 03:08:13 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gchar *menu_label = NULL;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-get-proc-menu-label",
|
|
|
|
args);
|
2019-09-08 03:08:13 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
menu_label = GIMP_VALUES_DUP_STRING (return_vals, 1);
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return menu_label;
|
|
|
|
}
|
|
|
|
|
2019-09-08 21:53:37 +08:00
|
|
|
/**
|
|
|
|
* _gimp_pdb_add_proc_menu_path:
|
|
|
|
* @procedure_name: The procedure for which to install the menu path.
|
|
|
|
* @menu_path: The procedure's additional menu path.
|
|
|
|
*
|
|
|
|
* Register an additional menu path for a plug-in procedure.
|
|
|
|
*
|
|
|
|
* This procedure installs an additional menu entry for the given
|
|
|
|
* procedure.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
_gimp_pdb_add_proc_menu_path (const gchar *procedure_name,
|
|
|
|
const gchar *menu_path)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_STRING, menu_path,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-add-proc-menu-path",
|
|
|
|
args);
|
2019-09-08 21:53:37 +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-09-08 03:08:13 +08:00
|
|
|
/**
|
2019-09-08 21:07:24 +08:00
|
|
|
* _gimp_pdb_get_proc_menu_paths:
|
2019-09-08 03:08:13 +08:00
|
|
|
* @procedure_name: The procedure name.
|
|
|
|
*
|
|
|
|
* Queries the procedural database for the procedure's menu paths.
|
|
|
|
*
|
|
|
|
* This procedure returns the menu paths of the specified procedure.
|
|
|
|
*
|
2021-12-02 05:35:25 +08:00
|
|
|
* Returns: (array zero-terminated=1) (transfer full):
|
2019-09-08 03:08:13 +08:00
|
|
|
* The menu paths of the plug-in.
|
|
|
|
* The returned value must be freed with g_strfreev().
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gchar **
|
2021-12-02 05:35:25 +08:00
|
|
|
_gimp_pdb_get_proc_menu_paths (const gchar *procedure_name)
|
2019-09-08 03:08:13 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gchar **menu_paths = NULL;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-get-proc-menu-paths",
|
|
|
|
args);
|
2019-09-08 03:08:13 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2021-12-02 05:35:25 +08:00
|
|
|
menu_paths = GIMP_VALUES_DUP_STRV (return_vals, 1);
|
2019-09-08 03:08:13 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return menu_paths;
|
|
|
|
}
|
|
|
|
|
2019-09-08 22:22:32 +08:00
|
|
|
/**
|
|
|
|
* _gimp_pdb_set_proc_icon:
|
|
|
|
* @procedure_name: The procedure for which to install the icon.
|
|
|
|
* @icon_type: The type of the icon.
|
2023-05-24 05:37:46 +08:00
|
|
|
* @icon_data: The procedure's icon. The format depends on the 'icon_type' parameter.
|
2019-09-08 22:22:32 +08:00
|
|
|
*
|
|
|
|
* Register an icon for a plug-in procedure.
|
|
|
|
*
|
|
|
|
* This procedure installs an icon for the given procedure.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
_gimp_pdb_set_proc_icon (const gchar *procedure_name,
|
|
|
|
GimpIconType icon_type,
|
2023-05-24 05:37:46 +08:00
|
|
|
GBytes *icon_data)
|
2019-09-08 22:22:32 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
GIMP_TYPE_ICON_TYPE, icon_type,
|
2023-05-24 05:37:46 +08:00
|
|
|
G_TYPE_BYTES, icon_data,
|
2019-09-08 22:22:32 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-set-proc-icon",
|
|
|
|
args);
|
2019-09-08 22:22:32 +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-09-09 06:36:24 +08:00
|
|
|
/**
|
|
|
|
* _gimp_pdb_set_proc_documentation:
|
|
|
|
* @procedure_name: The procedure for which to install the menu path.
|
|
|
|
* @blurb: A short blurb.
|
|
|
|
* @help: Detailed procedure help.
|
|
|
|
* @help_id: The procedure help_id.
|
|
|
|
*
|
|
|
|
* Set the documentation for a plug-in procedure.
|
|
|
|
*
|
|
|
|
* This procedure sets the documentation for the given procedure.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
_gimp_pdb_set_proc_documentation (const gchar *procedure_name,
|
|
|
|
const gchar *blurb,
|
|
|
|
const gchar *help,
|
|
|
|
const gchar *help_id)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_STRING, blurb,
|
|
|
|
G_TYPE_STRING, help,
|
|
|
|
G_TYPE_STRING, help_id,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-set-proc-documentation",
|
|
|
|
args);
|
2019-09-09 06:36:24 +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-09-04 07:38:31 +08:00
|
|
|
/**
|
2019-09-08 21:07:24 +08:00
|
|
|
* _gimp_pdb_get_proc_documentation:
|
2019-09-04 07:38:31 +08:00
|
|
|
* @procedure_name: The procedure name.
|
|
|
|
* @blurb: (out) (transfer full): A short blurb.
|
|
|
|
* @help: (out) (transfer full): Detailed procedure help.
|
|
|
|
* @help_id: (out) (transfer full): The procedure help_id.
|
|
|
|
*
|
|
|
|
* Queries the procedural database for documentation on the specified
|
|
|
|
* procedure.
|
|
|
|
*
|
|
|
|
* This procedure returns documentation on the specified procedure. A
|
|
|
|
* short blurb, detailed help and help_id.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-08 21:07:24 +08:00
|
|
|
_gimp_pdb_get_proc_documentation (const gchar *procedure_name,
|
|
|
|
gchar **blurb,
|
|
|
|
gchar **help,
|
|
|
|
gchar **help_id)
|
2019-09-04 07:38:31 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-get-proc-documentation",
|
|
|
|
args);
|
2019-09-04 07:38:31 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
*blurb = NULL;
|
|
|
|
*help = NULL;
|
|
|
|
*help_id = NULL;
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-09-04 07:38:31 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
if (success)
|
2000-05-31 21:24:14 +08:00
|
|
|
{
|
2019-09-04 08:49:33 +08:00
|
|
|
*blurb = GIMP_VALUES_DUP_STRING (return_vals, 1);
|
|
|
|
*help = GIMP_VALUES_DUP_STRING (return_vals, 2);
|
|
|
|
*help_id = GIMP_VALUES_DUP_STRING (return_vals, 3);
|
2019-09-04 07:38:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2019-09-09 06:36:24 +08:00
|
|
|
/**
|
|
|
|
* _gimp_pdb_set_proc_attribution:
|
|
|
|
* @procedure_name: The procedure for which to install the menu path.
|
|
|
|
* @authors: Authors of the procedure.
|
|
|
|
* @copyright: The copyright.
|
|
|
|
* @date: Copyright date.
|
|
|
|
*
|
|
|
|
* Set the attribution for a plug-in procedure.
|
|
|
|
*
|
|
|
|
* This procedure sets the attribution for the given procedure.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
_gimp_pdb_set_proc_attribution (const gchar *procedure_name,
|
|
|
|
const gchar *authors,
|
|
|
|
const gchar *copyright,
|
|
|
|
const gchar *date)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_STRING, authors,
|
|
|
|
G_TYPE_STRING, copyright,
|
|
|
|
G_TYPE_STRING, date,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-set-proc-attribution",
|
|
|
|
args);
|
2019-09-09 06:36:24 +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-09-04 07:38:31 +08:00
|
|
|
/**
|
2019-09-08 21:07:24 +08:00
|
|
|
* _gimp_pdb_get_proc_attribution:
|
2019-09-04 07:38:31 +08:00
|
|
|
* @procedure_name: The procedure name.
|
|
|
|
* @authors: (out) (transfer full): Authors of the procedure.
|
|
|
|
* @copyright: (out) (transfer full): The copyright.
|
|
|
|
* @date: (out) (transfer full): Copyright date.
|
|
|
|
*
|
|
|
|
* Queries the procedural database for attribution information on the
|
|
|
|
* specified procedure.
|
|
|
|
*
|
|
|
|
* This procedure returns attribution information on the specified
|
|
|
|
* procedure. The authors, copyright information and date are returned.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-08 21:07:24 +08:00
|
|
|
_gimp_pdb_get_proc_attribution (const gchar *procedure_name,
|
|
|
|
gchar **authors,
|
|
|
|
gchar **copyright,
|
|
|
|
gchar **date)
|
2019-09-04 07:38:31 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-get-proc-attribution",
|
|
|
|
args);
|
2019-09-04 07:38:31 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
*authors = NULL;
|
|
|
|
*copyright = NULL;
|
|
|
|
*date = NULL;
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-09-04 07:38:31 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2019-09-04 08:49:33 +08:00
|
|
|
*authors = GIMP_VALUES_DUP_STRING (return_vals, 1);
|
|
|
|
*copyright = GIMP_VALUES_DUP_STRING (return_vals, 2);
|
|
|
|
*date = GIMP_VALUES_DUP_STRING (return_vals, 3);
|
2000-05-31 21:24:14 +08:00
|
|
|
}
|
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-05-31 21:24:14 +08:00
|
|
|
}
|
|
|
|
|
2019-09-11 03:24:09 +08:00
|
|
|
/**
|
|
|
|
* _gimp_pdb_set_file_proc_load_handler:
|
|
|
|
* @procedure_name: The name of the procedure to be used for loading.
|
|
|
|
* @extensions: comma separated list of extensions this handler can load (i.e. \"jpg,jpeg\").
|
|
|
|
* @prefixes: comma separated list of prefixes this handler can load (i.e. \"http:,ftp:\").
|
|
|
|
* @magics: comma separated list of magic file information this handler can load (i.e. \"0,string,GIF\").
|
|
|
|
*
|
|
|
|
* Registers a file load handler procedure.
|
|
|
|
*
|
|
|
|
* Registers a procedural database procedure to be called to load files
|
|
|
|
* of a particular file format using magic file information.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
_gimp_pdb_set_file_proc_load_handler (const gchar *procedure_name,
|
|
|
|
const gchar *extensions,
|
|
|
|
const gchar *prefixes,
|
|
|
|
const gchar *magics)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_STRING, extensions,
|
|
|
|
G_TYPE_STRING, prefixes,
|
|
|
|
G_TYPE_STRING, magics,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-set-file-proc-load-handler",
|
|
|
|
args);
|
2019-09-11 03:24:09 +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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* _gimp_pdb_set_file_proc_save_handler:
|
|
|
|
* @procedure_name: The name of the procedure to be used for saving.
|
|
|
|
* @extensions: comma separated list of extensions this handler can save (i.e. \"jpg,jpeg\").
|
|
|
|
* @prefixes: comma separated list of prefixes this handler can save (i.e. \"http:,ftp:\").
|
|
|
|
*
|
|
|
|
* Registers a file save handler procedure.
|
|
|
|
*
|
|
|
|
* Registers a procedural database procedure to be called to save files
|
|
|
|
* in a particular file format.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
_gimp_pdb_set_file_proc_save_handler (const gchar *procedure_name,
|
|
|
|
const gchar *extensions,
|
|
|
|
const gchar *prefixes)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_STRING, extensions,
|
|
|
|
G_TYPE_STRING, prefixes,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-set-file-proc-save-handler",
|
|
|
|
args);
|
2019-09-11 03:24:09 +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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* _gimp_pdb_set_file_proc_priority:
|
|
|
|
* @procedure_name: The name of the procedure to set the priority of.
|
|
|
|
* @priority: The procedure priority.
|
|
|
|
*
|
|
|
|
* Sets the priority of a file handler procedure.
|
|
|
|
*
|
|
|
|
* Sets the priority of a file handler procedure. When more than one
|
|
|
|
* procedure matches a given file, the procedure with the lowest
|
|
|
|
* priority is used; if more than one procedure has the lowest
|
|
|
|
* priority, it is unspecified which one of them is used. The default
|
|
|
|
* priority for file handler procedures is 0.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10.6
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
_gimp_pdb_set_file_proc_priority (const gchar *procedure_name,
|
|
|
|
gint priority)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_INT, priority,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-set-file-proc-priority",
|
|
|
|
args);
|
2019-09-11 03:24:09 +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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* _gimp_pdb_set_file_proc_mime_types:
|
|
|
|
* @procedure_name: The name of the procedure to associate a MIME type with.
|
|
|
|
* @mime_types: A comma-separated list of MIME types, such as \"image/jpeg\".
|
|
|
|
*
|
|
|
|
* Associates MIME types with a file handler procedure.
|
|
|
|
*
|
|
|
|
* Registers MIME types for a file handler procedure. This allows GIMP
|
|
|
|
* to determine the MIME type of the file opened or saved using this
|
|
|
|
* procedure. It is recommended that only one MIME type is registered
|
|
|
|
* per file procedure; when registering more than one MIME type, GIMP
|
|
|
|
* will associate the first one with files opened or saved with this
|
|
|
|
* procedure.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.2
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
_gimp_pdb_set_file_proc_mime_types (const gchar *procedure_name,
|
|
|
|
const gchar *mime_types)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_STRING, mime_types,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-set-file-proc-mime-types",
|
|
|
|
args);
|
2019-09-11 03:24:09 +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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* _gimp_pdb_set_file_proc_handles_remote:
|
|
|
|
* @procedure_name: The name of the procedure to enable remote URIs for.
|
|
|
|
*
|
|
|
|
* Registers a file handler procedure as capable of handling remote
|
|
|
|
* URIs.
|
|
|
|
*
|
|
|
|
* Registers a file handler procedure as capable of handling remote
|
|
|
|
* URIs. This allows GIMP to call the procedure directly for all kinds
|
|
|
|
* of URIs, not only on local file:// URIs.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
_gimp_pdb_set_file_proc_handles_remote (const gchar *procedure_name)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-set-file-proc-handles-remote",
|
|
|
|
args);
|
2019-09-11 03:24:09 +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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* _gimp_pdb_set_file_proc_handles_raw:
|
|
|
|
* @procedure_name: The name of the procedure to enable raw handling for.
|
|
|
|
*
|
|
|
|
* Registers a file handler procedure as capable of handling raw camera
|
|
|
|
* files.
|
|
|
|
*
|
|
|
|
* Registers a file handler procedure as capable of handling raw
|
|
|
|
* digital camera files. Use this procedure only to register raw load
|
|
|
|
* handlers, calling it on a save handler will generate an error.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
_gimp_pdb_set_file_proc_handles_raw (const gchar *procedure_name)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-set-file-proc-handles-raw",
|
|
|
|
args);
|
2019-09-11 03:24:09 +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;
|
|
|
|
}
|
|
|
|
|
app, libgimp, pdb: new GimpVectorLoadProcedure class.
It's still basic but will help to share code for support of various vector-able
formats, such as the logic for dimensioning them, but also the generated GUI.
Not only this, but we are paving the way for the link layers (though it'll be
after GIMP 3, we want plug-in procedures' API to stay stable) by giving a way
for a plug-in procedure to advertize a vector format support. This way, the core
will know when a source file is vector and can be directly reloaded at any
target size (right now, in my MR for link layers, the list of "vector" formats
is hardcoded, which is not reliable).
2024-04-23 05:11:37 +08:00
|
|
|
/**
|
|
|
|
* _gimp_pdb_set_file_proc_handles_vector:
|
|
|
|
* @procedure_name: The name of the vector load procedure.
|
|
|
|
*
|
|
|
|
* Registers a load handler procedure as handling vector formats.
|
|
|
|
*
|
|
|
|
* Registers a file handler procedure as handling vector image formats.
|
|
|
|
* Use this procedure only to register a GimpVectorLoadProcedure,
|
|
|
|
* calling it on any other handler will generate an error.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
_gimp_pdb_set_file_proc_handles_vector (const gchar *procedure_name)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-set-file-proc-handles-vector",
|
|
|
|
args);
|
|
|
|
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-09-11 03:24:09 +08:00
|
|
|
/**
|
|
|
|
* _gimp_pdb_set_file_proc_thumbnail_loader:
|
2022-02-10 04:23:33 +08:00
|
|
|
* @load_proc: The name of the file load procedure.
|
2019-09-11 03:24:09 +08:00
|
|
|
* @thumb_proc: The name of the thumbnail load procedure.
|
|
|
|
*
|
|
|
|
* Associates a thumbnail loader with a file load procedure.
|
|
|
|
*
|
|
|
|
* Some file formats allow for embedded thumbnails, other file formats
|
|
|
|
* contain a scalable image or provide the image data in different
|
|
|
|
* resolutions. A file plug-in for such a format may register a special
|
|
|
|
* procedure that allows GIMP to load a thumbnail preview of the image.
|
|
|
|
* This procedure is then associated with the standard load procedure
|
|
|
|
* using this function.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.2
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
_gimp_pdb_set_file_proc_thumbnail_loader (const gchar *load_proc,
|
|
|
|
const gchar *thumb_proc)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, load_proc,
|
|
|
|
G_TYPE_STRING, thumb_proc,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-set-file-proc-thumbnail-loader",
|
|
|
|
args);
|
2019-09-11 03:24:09 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2022-04-16 23:09:21 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* _gimp_pdb_set_batch_interpreter:
|
|
|
|
* @procedure_name: The name of the procedure to be used for running batch commands.
|
2022-04-17 05:13:50 +08:00
|
|
|
* @interpreter_name: A public-facing name for the interpreter, such as \"Python 3\".
|
2022-04-16 23:09:21 +08:00
|
|
|
*
|
|
|
|
* Registers a batch interpreter procedure.
|
|
|
|
*
|
|
|
|
* Registers a procedural database procedure to be called with the
|
|
|
|
* command line interface options --batch-interpreter and --batch.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
2022-04-17 05:13:50 +08:00
|
|
|
_gimp_pdb_set_batch_interpreter (const gchar *procedure_name,
|
|
|
|
const gchar *interpreter_name)
|
2022-04-16 23:09:21 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, procedure_name,
|
2022-04-17 05:13:50 +08:00
|
|
|
G_TYPE_STRING, interpreter_name,
|
2022-04-16 23:09:21 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-pdb-set-batch-interpreter",
|
|
|
|
args);
|
2022-04-16 23:09:21 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-09-11 03:24:09 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-08-06 18:50:08 +08:00
|
|
|
* _gimp_pdb_get_data:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @identifier: The identifier associated with data.
|
2023-05-24 05:37:46 +08:00
|
|
|
* @data: (out) (transfer full): A byte array containing data.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns data associated with the specified identifier.
|
|
|
|
*
|
|
|
|
* This procedure returns any data which may have been associated with
|
|
|
|
* the specified identifier. The data is a variable length array of
|
|
|
|
* bytes. If no data has been associated with the identifier, an error
|
|
|
|
* is returned.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2019-08-06 18:50:08 +08:00
|
|
|
_gimp_pdb_get_data (const gchar *identifier,
|
2023-05-24 05:37:46 +08:00
|
|
|
GBytes **data)
|
2000-05-31 21:24:14 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, identifier,
|
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-pdb-get-data",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2000-06-02 01:34:56 +08:00
|
|
|
*data = NULL;
|
2000-08-22 05:23:31 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
if (success)
|
2023-05-24 05:37:46 +08:00
|
|
|
*data = GIMP_VALUES_DUP_BYTES (return_vals, 1);
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-02 01:34:56 +08:00
|
|
|
}
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-08-06 18:50:08 +08:00
|
|
|
* _gimp_pdb_set_data:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @identifier: The identifier associated with data.
|
2023-05-24 05:37:46 +08:00
|
|
|
* @data: A byte array containing data.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Associates the specified identifier with the supplied data.
|
|
|
|
*
|
|
|
|
* This procedure associates the supplied data with the provided
|
|
|
|
* identifier. The data may be subsequently retrieved by a call to
|
|
|
|
* 'procedural-db-get-data'.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2023-05-24 05:37:46 +08:00
|
|
|
_gimp_pdb_set_data (const gchar *identifier,
|
|
|
|
GBytes *data)
|
2000-06-02 01:34:56 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-02 01:34:56 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, identifier,
|
2023-05-24 05:37:46 +08:00
|
|
|
G_TYPE_BYTES, data,
|
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-pdb-set-data",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2000-06-02 01:34:56 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-05-31 21:24:14 +08:00
|
|
|
}
|