pdb: rename the "procedural_db" PDB group to just "pdb"

This commit is contained in:
Michael Natterer 2019-08-06 12:50:08 +02:00
parent 450a9f90b4
commit 05baadcd1d
32 changed files with 565 additions and 630 deletions

View File

@ -77,9 +77,9 @@ libappinternal_procs_a_SOURCES = \
pattern-cmds.c \ pattern-cmds.c \
pattern-select-cmds.c \ pattern-select-cmds.c \
patterns-cmds.c \ patterns-cmds.c \
pdb-cmds.c \
plug-in-cmds.c \ plug-in-cmds.c \
plug-in-compat-cmds.c \ plug-in-compat-cmds.c \
procedural-db-cmds.c \
progress-cmds.c \ progress-cmds.c \
selection-cmds.c \ selection-cmds.c \
text-layer-cmds.c \ text-layer-cmds.c \

View File

@ -78,9 +78,9 @@ internal_procs_init (GimpPDB *pdb)
register_pattern_procs (pdb); register_pattern_procs (pdb);
register_pattern_select_procs (pdb); register_pattern_select_procs (pdb);
register_patterns_procs (pdb); register_patterns_procs (pdb);
register_pdb_procs (pdb);
register_plug_in_procs (pdb); register_plug_in_procs (pdb);
register_plug_in_compat_procs (pdb); register_plug_in_compat_procs (pdb);
register_procedural_db_procs (pdb);
register_progress_procs (pdb); register_progress_procs (pdb);
register_selection_procs (pdb); register_selection_procs (pdb);
register_text_layer_procs (pdb); register_text_layer_procs (pdb);

View File

@ -67,9 +67,9 @@ void register_palettes_procs (GimpPDB *pdb);
void register_pattern_procs (GimpPDB *pdb); void register_pattern_procs (GimpPDB *pdb);
void register_pattern_select_procs (GimpPDB *pdb); void register_pattern_select_procs (GimpPDB *pdb);
void register_patterns_procs (GimpPDB *pdb); void register_patterns_procs (GimpPDB *pdb);
void register_pdb_procs (GimpPDB *pdb);
void register_plug_in_procs (GimpPDB *pdb); void register_plug_in_procs (GimpPDB *pdb);
void register_plug_in_compat_procs (GimpPDB *pdb); void register_plug_in_compat_procs (GimpPDB *pdb);
void register_procedural_db_procs (GimpPDB *pdb);
void register_progress_procs (GimpPDB *pdb); void register_progress_procs (GimpPDB *pdb);
void register_selection_procs (GimpPDB *pdb); void register_selection_procs (GimpPDB *pdb);
void register_text_layer_procs (GimpPDB *pdb); void register_text_layer_procs (GimpPDB *pdb);

View File

@ -42,12 +42,12 @@
static GimpValueArray * static GimpValueArray *
procedural_db_temp_name_invoker (GimpProcedure *procedure, pdb_temp_name_invoker (GimpProcedure *procedure,
Gimp *gimp, Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
const GimpValueArray *args, const GimpValueArray *args,
GError **error) GError **error)
{ {
GimpValueArray *return_vals; GimpValueArray *return_vals;
gchar *temp_name = NULL; gchar *temp_name = NULL;
@ -63,12 +63,12 @@ procedural_db_temp_name_invoker (GimpProcedure *procedure,
} }
static GimpValueArray * static GimpValueArray *
procedural_db_dump_invoker (GimpProcedure *procedure, pdb_dump_invoker (GimpProcedure *procedure,
Gimp *gimp, Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
const GimpValueArray *args, const GimpValueArray *args,
GError **error) GError **error)
{ {
gboolean success = TRUE; gboolean success = TRUE;
const gchar *filename; const gchar *filename;
@ -89,12 +89,12 @@ procedural_db_dump_invoker (GimpProcedure *procedure,
} }
static GimpValueArray * static GimpValueArray *
procedural_db_query_invoker (GimpProcedure *procedure, pdb_query_invoker (GimpProcedure *procedure,
Gimp *gimp, Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
const GimpValueArray *args, const GimpValueArray *args,
GError **error) GError **error)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -138,12 +138,12 @@ procedural_db_query_invoker (GimpProcedure *procedure,
} }
static GimpValueArray * static GimpValueArray *
procedural_db_proc_exists_invoker (GimpProcedure *procedure, pdb_proc_exists_invoker (GimpProcedure *procedure,
Gimp *gimp, Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
const GimpValueArray *args, const GimpValueArray *args,
GError **error) GError **error)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -184,12 +184,12 @@ procedural_db_proc_exists_invoker (GimpProcedure *procedure,
} }
static GimpValueArray * static GimpValueArray *
procedural_db_proc_info_invoker (GimpProcedure *procedure, pdb_proc_info_invoker (GimpProcedure *procedure,
Gimp *gimp, Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
const GimpValueArray *args, const GimpValueArray *args,
GError **error) GError **error)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -241,12 +241,12 @@ procedural_db_proc_info_invoker (GimpProcedure *procedure,
} }
static GimpValueArray * static GimpValueArray *
procedural_db_proc_arg_invoker (GimpProcedure *procedure, pdb_proc_arg_invoker (GimpProcedure *procedure,
Gimp *gimp, Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
const GimpValueArray *args, const GimpValueArray *args,
GError **error) GError **error)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -306,12 +306,12 @@ procedural_db_proc_arg_invoker (GimpProcedure *procedure,
} }
static GimpValueArray * static GimpValueArray *
procedural_db_proc_val_invoker (GimpProcedure *procedure, pdb_proc_val_invoker (GimpProcedure *procedure,
Gimp *gimp, Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
const GimpValueArray *args, const GimpValueArray *args,
GError **error) GError **error)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -371,12 +371,12 @@ procedural_db_proc_val_invoker (GimpProcedure *procedure,
} }
static GimpValueArray * static GimpValueArray *
procedural_db_proc_argument_invoker (GimpProcedure *procedure, pdb_proc_argument_invoker (GimpProcedure *procedure,
Gimp *gimp, Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
const GimpValueArray *args, const GimpValueArray *args,
GError **error) GError **error)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -426,12 +426,12 @@ procedural_db_proc_argument_invoker (GimpProcedure *procedure,
} }
static GimpValueArray * static GimpValueArray *
procedural_db_proc_return_value_invoker (GimpProcedure *procedure, pdb_proc_return_value_invoker (GimpProcedure *procedure,
Gimp *gimp, Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
const GimpValueArray *args, const GimpValueArray *args,
GError **error) GError **error)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -481,12 +481,12 @@ procedural_db_proc_return_value_invoker (GimpProcedure *procedure,
} }
static GimpValueArray * static GimpValueArray *
procedural_db_get_data_invoker (GimpProcedure *procedure, pdb_get_data_invoker (GimpProcedure *procedure,
Gimp *gimp, Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
const GimpValueArray *args, const GimpValueArray *args,
GError **error) GError **error)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -525,12 +525,12 @@ procedural_db_get_data_invoker (GimpProcedure *procedure,
} }
static GimpValueArray * static GimpValueArray *
procedural_db_get_data_size_invoker (GimpProcedure *procedure, pdb_get_data_size_invoker (GimpProcedure *procedure,
Gimp *gimp, Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
const GimpValueArray *args, const GimpValueArray *args,
GError **error) GError **error)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -560,12 +560,12 @@ procedural_db_get_data_size_invoker (GimpProcedure *procedure,
} }
static GimpValueArray * static GimpValueArray *
procedural_db_set_data_invoker (GimpProcedure *procedure, pdb_set_data_invoker (GimpProcedure *procedure,
Gimp *gimp, Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
const GimpValueArray *args, const GimpValueArray *args,
GError **error) GError **error)
{ {
gboolean success = TRUE; gboolean success = TRUE;
const gchar *identifier; const gchar *identifier;
@ -591,18 +591,18 @@ procedural_db_set_data_invoker (GimpProcedure *procedure,
} }
void void
register_procedural_db_procs (GimpPDB *pdb) register_pdb_procs (GimpPDB *pdb)
{ {
GimpProcedure *procedure; GimpProcedure *procedure;
/* /*
* gimp-procedural-db-temp-name * gimp-pdb-temp-name
*/ */
procedure = gimp_procedure_new (procedural_db_temp_name_invoker); procedure = gimp_procedure_new (pdb_temp_name_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-procedural-db-temp-name"); "gimp-pdb-temp-name");
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-procedural-db-temp-name", "gimp-pdb-temp-name",
"Generates a unique temporary PDB name.", "Generates a unique temporary PDB name.",
"This procedure generates a temporary PDB entry name that is guaranteed to be unique.", "This procedure generates a temporary PDB entry name that is guaranteed to be unique.",
"Andy Thomas", "Andy Thomas",
@ -620,13 +620,13 @@ register_procedural_db_procs (GimpPDB *pdb)
g_object_unref (procedure); g_object_unref (procedure);
/* /*
* gimp-procedural-db-dump * gimp-pdb-dump
*/ */
procedure = gimp_procedure_new (procedural_db_dump_invoker); procedure = gimp_procedure_new (pdb_dump_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-procedural-db-dump"); "gimp-pdb-dump");
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-procedural-db-dump", "gimp-pdb-dump",
"Dumps the current contents of the procedural database", "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 provided for each registered procedure.", "This procedure dumps the contents of the procedural database to the specified file. The file will contain all of the information provided for each registered procedure.",
"Spencer Kimball & Josh MacDonald", "Spencer Kimball & Josh MacDonald",
@ -644,13 +644,13 @@ register_procedural_db_procs (GimpPDB *pdb)
g_object_unref (procedure); g_object_unref (procedure);
/* /*
* gimp-procedural-db-query * gimp-pdb-query
*/ */
procedure = gimp_procedure_new (procedural_db_query_invoker); procedure = gimp_procedure_new (pdb_query_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-procedural-db-query"); "gimp-pdb-query");
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-procedural-db-query", "gimp-pdb-query",
"Queries the procedural database for its contents using regular expression matching.", "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, blurb, help, author, copyright, date, procedure type}. This is 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.", "This procedure queries the contents of the procedural database. It is supplied with seven arguments matching procedures on { name, blurb, help, author, copyright, date, procedure type}. This is 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.",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
@ -721,13 +721,13 @@ register_procedural_db_procs (GimpPDB *pdb)
g_object_unref (procedure); g_object_unref (procedure);
/* /*
* gimp-procedural-db-proc-exists * gimp-pdb-proc-exists
*/ */
procedure = gimp_procedure_new (procedural_db_proc_exists_invoker); procedure = gimp_procedure_new (pdb_proc_exists_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-procedural-db-proc-exists"); "gimp-pdb-proc-exists");
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-procedural-db-proc-exists", "gimp-pdb-proc-exists",
"Checks if the specified procedure exists in the procedural database", "Checks if the specified procedure exists in the procedural database",
"This procedure checks if the specified procedure is registered in the procedural database.", "This procedure checks if the specified procedure is registered in the procedural database.",
"Sven Neumann <sven@gimp.org>", "Sven Neumann <sven@gimp.org>",
@ -751,13 +751,13 @@ register_procedural_db_procs (GimpPDB *pdb)
g_object_unref (procedure); g_object_unref (procedure);
/* /*
* gimp-procedural-db-proc-info * gimp-pdb-proc-info
*/ */
procedure = gimp_procedure_new (procedural_db_proc_info_invoker); procedure = gimp_procedure_new (pdb_proc_info_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-procedural-db-proc-info"); "gimp-pdb-proc-info");
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-procedural-db-proc-info", "gimp-pdb-proc-info",
"Queries the procedural database for information on the specified procedure.", "Queries the procedural database for information on the specified procedure.",
"This procedure returns information on the specified procedure. A short blurb, detailed help, author(s), copyright information, procedure type, number of input, and number of return values are returned. For specific information on each input argument and return value, use the 'gimp-procedural-db-proc-arg' and 'gimp-procedural-db-proc-val' procedures.", "This procedure returns information on the specified procedure. A short blurb, detailed help, author(s), copyright information, procedure type, number of input, and number of return values are returned. For specific information on each input argument and return value, use the 'gimp-procedural-db-proc-arg' and 'gimp-procedural-db-proc-val' procedures.",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
@ -829,13 +829,13 @@ register_procedural_db_procs (GimpPDB *pdb)
g_object_unref (procedure); g_object_unref (procedure);
/* /*
* gimp-procedural-db-proc-arg * gimp-pdb-proc-arg
*/ */
procedure = gimp_procedure_new (procedural_db_proc_arg_invoker); procedure = gimp_procedure_new (pdb_proc_arg_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-procedural-db-proc-arg"); "gimp-pdb-proc-arg");
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-procedural-db-proc-arg", "gimp-pdb-proc-arg",
"Queries the procedural database for information on the specified procedure's argument.", "Queries the procedural database for information on the specified procedure's argument.",
"This procedure returns information on the specified procedure's argument. The argument type, name, and a description are retrieved.", "This procedure returns information on the specified procedure's argument. The argument type, name, and a description are retrieved.",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
@ -882,13 +882,13 @@ register_procedural_db_procs (GimpPDB *pdb)
g_object_unref (procedure); g_object_unref (procedure);
/* /*
* gimp-procedural-db-proc-val * gimp-pdb-proc-val
*/ */
procedure = gimp_procedure_new (procedural_db_proc_val_invoker); procedure = gimp_procedure_new (pdb_proc_val_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-procedural-db-proc-val"); "gimp-pdb-proc-val");
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-procedural-db-proc-val", "gimp-pdb-proc-val",
"Queries the procedural database for information on the specified procedure's return value.", "Queries the procedural database for information on the specified procedure's return value.",
"This procedure returns information on the specified procedure's return value. The return value type, name, and a description are retrieved.", "This procedure returns information on the specified procedure's return value. The return value type, name, and a description are retrieved.",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
@ -935,13 +935,13 @@ register_procedural_db_procs (GimpPDB *pdb)
g_object_unref (procedure); g_object_unref (procedure);
/* /*
* gimp-procedural-db-proc-argument * gimp-pdb-proc-argument
*/ */
procedure = gimp_procedure_new (procedural_db_proc_argument_invoker); procedure = gimp_procedure_new (pdb_proc_argument_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-procedural-db-proc-argument"); "gimp-pdb-proc-argument");
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-procedural-db-proc-argument", "gimp-pdb-proc-argument",
"Queries the procedural database for information on the specified procedure's argument.", "Queries the procedural database for information on the specified procedure's argument.",
"This procedure returns the #GParamSpec of procedure_name's argument.", "This procedure returns the #GParamSpec of procedure_name's argument.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
@ -971,13 +971,13 @@ register_procedural_db_procs (GimpPDB *pdb)
g_object_unref (procedure); g_object_unref (procedure);
/* /*
* gimp-procedural-db-proc-return-value * gimp-pdb-proc-return-value
*/ */
procedure = gimp_procedure_new (procedural_db_proc_return_value_invoker); procedure = gimp_procedure_new (pdb_proc_return_value_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-procedural-db-proc-return-value"); "gimp-pdb-proc-return-value");
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-procedural-db-proc-return-value", "gimp-pdb-proc-return-value",
"Queries the procedural database for information on the specified procedure's return value.", "Queries the procedural database for information on the specified procedure's return value.",
"This procedure returns the #GParamSpec of procedure_name's return value.", "This procedure returns the #GParamSpec of procedure_name's return value.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
@ -1007,13 +1007,13 @@ register_procedural_db_procs (GimpPDB *pdb)
g_object_unref (procedure); g_object_unref (procedure);
/* /*
* gimp-procedural-db-get-data * gimp-pdb-get-data
*/ */
procedure = gimp_procedure_new (procedural_db_get_data_invoker); procedure = gimp_procedure_new (pdb_get_data_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-procedural-db-get-data"); "gimp-pdb-get-data");
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-procedural-db-get-data", "gimp-pdb-get-data",
"Returns data associated with the specified identifier.", "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.", "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.",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
@ -1042,13 +1042,13 @@ register_procedural_db_procs (GimpPDB *pdb)
g_object_unref (procedure); g_object_unref (procedure);
/* /*
* gimp-procedural-db-get-data-size * gimp-pdb-get-data-size
*/ */
procedure = gimp_procedure_new (procedural_db_get_data_size_invoker); procedure = gimp_procedure_new (pdb_get_data_size_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-procedural-db-get-data-size"); "gimp-pdb-get-data-size");
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-procedural-db-get-data-size", "gimp-pdb-get-data-size",
"Returns size of data associated with the specified identifier.", "Returns size of data associated with the specified identifier.",
"This procedure returns the size of any data which may have been associated with the specified identifier. If no data has been associated with the identifier, an error is returned.", "This procedure returns the size of any data which may have been associated with the specified identifier. If no data has been associated with the identifier, an error is returned.",
"Nick Lamb", "Nick Lamb",
@ -1072,13 +1072,13 @@ register_procedural_db_procs (GimpPDB *pdb)
g_object_unref (procedure); g_object_unref (procedure);
/* /*
* gimp-procedural-db-set-data * gimp-pdb-set-data
*/ */
procedure = gimp_procedure_new (procedural_db_set_data_invoker); procedure = gimp_procedure_new (pdb_set_data_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-procedural-db-set-data"); "gimp-pdb-set-data");
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-procedural-db-set-data", "gimp-pdb-set-data",
"Associates the specified identifier with the supplied data.", "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'.", "This procedure associates the supplied data with the provided identifier. The data may be subsequently retrieved by a call to 'procedural-db-get-data'.",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",

View File

@ -167,7 +167,6 @@ gimpinclude_HEADERS = \
gimpparamspecs.h \ gimpparamspecs.h \
gimppatternselect.h \ gimppatternselect.h \
gimpplugin.h \ gimpplugin.h \
gimpproceduraldb.h \
gimpprogress.h \ gimpprogress.h \
gimpselection.h \ gimpselection.h \
\ \

View File

@ -44,8 +44,8 @@ PDB_WRAPPERS_C = \
$(top_srcdir)/libgimp/gimppattern_pdb.c \ $(top_srcdir)/libgimp/gimppattern_pdb.c \
$(top_srcdir)/libgimp/gimppatterns_pdb.c \ $(top_srcdir)/libgimp/gimppatterns_pdb.c \
$(top_srcdir)/libgimp/gimppatternselect_pdb.c \ $(top_srcdir)/libgimp/gimppatternselect_pdb.c \
$(top_srcdir)/libgimp/gimppdb_pdb.c \
$(top_srcdir)/libgimp/gimpplugin_pdb.c \ $(top_srcdir)/libgimp/gimpplugin_pdb.c \
$(top_srcdir)/libgimp/gimpproceduraldb_pdb.c \
$(top_srcdir)/libgimp/gimpprogress_pdb.c \ $(top_srcdir)/libgimp/gimpprogress_pdb.c \
$(top_srcdir)/libgimp/gimpselection_pdb.c \ $(top_srcdir)/libgimp/gimpselection_pdb.c \
$(top_srcdir)/libgimp/gimptextlayer_pdb.c \ $(top_srcdir)/libgimp/gimptextlayer_pdb.c \
@ -98,8 +98,8 @@ PDB_WRAPPERS_H = \
$(top_srcdir)/libgimp/gimppattern_pdb.h \ $(top_srcdir)/libgimp/gimppattern_pdb.h \
$(top_srcdir)/libgimp/gimppatterns_pdb.h \ $(top_srcdir)/libgimp/gimppatterns_pdb.h \
$(top_srcdir)/libgimp/gimppatternselect_pdb.h \ $(top_srcdir)/libgimp/gimppatternselect_pdb.h \
$(top_srcdir)/libgimp/gimppdb_pdb.h \
$(top_srcdir)/libgimp/gimpplugin_pdb.h \ $(top_srcdir)/libgimp/gimpplugin_pdb.h \
$(top_srcdir)/libgimp/gimpproceduraldb_pdb.h \
$(top_srcdir)/libgimp/gimpprogress_pdb.h \ $(top_srcdir)/libgimp/gimpprogress_pdb.h \
$(top_srcdir)/libgimp/gimpselection_pdb.h \ $(top_srcdir)/libgimp/gimpselection_pdb.h \
$(top_srcdir)/libgimp/gimptextlayer_pdb.h \ $(top_srcdir)/libgimp/gimptextlayer_pdb.h \
@ -144,8 +144,6 @@ libgimp_introspectable = \
$(top_srcdir)/libgimp/gimppixbuf.h \ $(top_srcdir)/libgimp/gimppixbuf.h \
$(top_srcdir)/libgimp/gimpplugin.c \ $(top_srcdir)/libgimp/gimpplugin.c \
$(top_srcdir)/libgimp/gimpplugin.h \ $(top_srcdir)/libgimp/gimpplugin.h \
$(top_srcdir)/libgimp/gimpproceduraldb.c \
$(top_srcdir)/libgimp/gimpproceduraldb.h \
$(top_srcdir)/libgimp/gimpprocedure.c \ $(top_srcdir)/libgimp/gimpprocedure.c \
$(top_srcdir)/libgimp/gimpprocedure.h \ $(top_srcdir)/libgimp/gimpprocedure.h \
$(top_srcdir)/libgimp/gimpprogress.c \ $(top_srcdir)/libgimp/gimpprogress.c \

View File

@ -612,7 +612,19 @@ EXPORTS
gimp_patterns_refresh gimp_patterns_refresh
gimp_patterns_set_popup gimp_patterns_set_popup
gimp_pdb_get_type gimp_pdb_get_type
gimp_pdb_dump
gimp_pdb_get_data
gimp_pdb_get_data_size
gimp_pdb_lookup gimp_pdb_lookup
gimp_pdb_proc_arg
gimp_pdb_proc_argument
gimp_pdb_proc_exists
gimp_pdb_proc_info
gimp_pdb_proc_return_value
gimp_pdb_proc_val
gimp_pdb_query
gimp_pdb_set_data
gimp_pdb_temp_name
gimp_pencil gimp_pencil
gimp_plug_in_add_menu_branch gimp_plug_in_add_menu_branch
gimp_plug_in_add_temp_procedure gimp_plug_in_add_temp_procedure
@ -632,18 +644,6 @@ EXPORTS
gimp_plugin_menu_branch_register gimp_plugin_menu_branch_register
gimp_plugin_menu_register gimp_plugin_menu_register
gimp_plugin_set_pdb_error_handler gimp_plugin_set_pdb_error_handler
gimp_procedural_db_dump
gimp_procedural_db_get_data
gimp_procedural_db_get_data_size
gimp_procedural_db_proc_arg
gimp_procedural_db_proc_argument
gimp_procedural_db_proc_exists
gimp_procedural_db_proc_info
gimp_procedural_db_proc_return_value
gimp_procedural_db_proc_val
gimp_procedural_db_query
gimp_procedural_db_set_data
gimp_procedural_db_temp_name
gimp_procedure_add_argument gimp_procedure_add_argument
gimp_procedure_add_argument_from_property gimp_procedure_add_argument_from_property
gimp_procedure_add_menu_path gimp_procedure_add_menu_path

View File

@ -51,7 +51,6 @@
#include <libgimp/gimppdb.h> #include <libgimp/gimppdb.h>
#include <libgimp/gimppixbuf.h> #include <libgimp/gimppixbuf.h>
#include <libgimp/gimpplugin.h> #include <libgimp/gimpplugin.h>
#include <libgimp/gimpproceduraldb.h>
#include <libgimp/gimpprocedure.h> #include <libgimp/gimpprocedure.h>
#include <libgimp/gimpprogress.h> #include <libgimp/gimpprogress.h>
#include <libgimp/gimpselection.h> #include <libgimp/gimpselection.h>
@ -67,9 +66,9 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define gimp_get_data gimp_procedural_db_get_data #define gimp_get_data gimp_pdb_get_data
#define gimp_get_data_size gimp_procedural_db_get_data_size #define gimp_get_data_size gimp_pdb_get_data_size
#define gimp_set_data gimp_procedural_db_set_data #define gimp_set_data gimp_pdb_set_data
/** /**

View File

@ -70,8 +70,8 @@
#include <libgimp/gimppattern_pdb.h> #include <libgimp/gimppattern_pdb.h>
#include <libgimp/gimppatterns_pdb.h> #include <libgimp/gimppatterns_pdb.h>
#include <libgimp/gimppatternselect_pdb.h> #include <libgimp/gimppatternselect_pdb.h>
#include <libgimp/gimppdb_pdb.h>
#include <libgimp/gimpplugin_pdb.h> #include <libgimp/gimpplugin_pdb.h>
#include <libgimp/gimpproceduraldb_pdb.h>
#include <libgimp/gimpprogress_pdb.h> #include <libgimp/gimpprogress_pdb.h>
#include <libgimp/gimpselection_pdb.h> #include <libgimp/gimpselection_pdb.h>
#include <libgimp/gimptextlayer_pdb.h> #include <libgimp/gimptextlayer_pdb.h>

View File

@ -75,7 +75,7 @@ gimp_brush_select_new (const gchar *title,
GDestroyNotify data_destroy) GDestroyNotify data_destroy)
{ {
GimpPlugIn *plug_in = gimp_get_plug_in (); GimpPlugIn *plug_in = gimp_get_plug_in ();
gchar *brush_callback = gimp_procedural_db_temp_name (); gchar *brush_callback = gimp_pdb_temp_name ();
GimpBrushData *brush_data; GimpBrushData *brush_data;
brush_data = g_slice_new0 (GimpBrushData); brush_data = g_slice_new0 (GimpBrushData);

View File

@ -66,7 +66,7 @@ gimp_font_select_new (const gchar *title,
GDestroyNotify data_destroy) GDestroyNotify data_destroy)
{ {
GimpPlugIn *plug_in = gimp_get_plug_in (); GimpPlugIn *plug_in = gimp_get_plug_in ();
gchar *font_callback = gimp_procedural_db_temp_name (); gchar *font_callback = gimp_pdb_temp_name ();
GimpFontData *font_data; GimpFontData *font_data;
font_data = g_slice_new0 (GimpFontData); font_data = g_slice_new0 (GimpFontData);

View File

@ -69,7 +69,7 @@ gimp_gradient_select_new (const gchar *title,
GDestroyNotify data_destroy) GDestroyNotify data_destroy)
{ {
GimpPlugIn *plug_in = gimp_get_plug_in (); GimpPlugIn *plug_in = gimp_get_plug_in ();
gchar *gradient_callback = gimp_procedural_db_temp_name (); gchar *gradient_callback = gimp_pdb_temp_name ();
GimpGradientData *gradient_data; GimpGradientData *gradient_data;
gradient_data = g_slice_new0 (GimpGradientData); gradient_data = g_slice_new0 (GimpGradientData);

View File

@ -67,7 +67,7 @@ gimp_palette_select_new (const gchar *title,
GDestroyNotify data_destroy) GDestroyNotify data_destroy)
{ {
GimpPlugIn *plug_in = gimp_get_plug_in (); GimpPlugIn *plug_in = gimp_get_plug_in ();
gchar *palette_callback = gimp_procedural_db_temp_name (); gchar *palette_callback = gimp_pdb_temp_name ();
GimpPaletteData *palette_data; GimpPaletteData *palette_data;
palette_data = g_slice_new0 (GimpPaletteData); palette_data = g_slice_new0 (GimpPaletteData);

View File

@ -70,7 +70,7 @@ gimp_pattern_select_new (const gchar *title,
GDestroyNotify data_destroy) GDestroyNotify data_destroy)
{ {
GimpPlugIn *plug_in = gimp_get_plug_in (); GimpPlugIn *plug_in = gimp_get_plug_in ();
gchar *pattern_callback = gimp_procedural_db_temp_name (); gchar *pattern_callback = gimp_pdb_temp_name ();
GimpPatternData *pattern_data; GimpPatternData *pattern_data;
pattern_data = g_slice_new0 (GimpPatternData); pattern_data = g_slice_new0 (GimpPatternData);

View File

@ -25,6 +25,17 @@
#include "gimppdbprocedure.h" #include "gimppdbprocedure.h"
/**
* SECTION: gimppdb
* @title: GimpPDB
* @short_description: Functions for querying and changing procedural
* database (PDB) entries.
*
* Functions for querying and changing procedural database (PDB)
* entries.
**/
struct _GimpPDBPrivate struct _GimpPDBPrivate
{ {
GimpPlugIn *plug_in; GimpPlugIn *plug_in;
@ -119,3 +130,149 @@ _gimp_pdb_error_quark (void)
{ {
return g_quark_from_static_string ("gimp-pdb-error-quark"); return g_quark_from_static_string ("gimp-pdb-error-quark");
} }
/* Cruft API */
/**
* gimp_pdb_proc_info:
* @procedure: The procedure name.
* @blurb: A short blurb.
* @help: Detailed procedure help.
* @author: Author(s) of the procedure.
* @copyright: The copyright.
* @date: Copyright date.
* @proc_type: The procedure type.
* @num_args: The number of input arguments.
* @num_values: The number of return values.
* @args: The input arguments.
* @return_vals: The return values.
*
* Queries the procedural database for information on the specified
* procedure.
*
* This procedure returns information on the specified procedure. A
* short blurb, detailed help, author(s), copyright information,
* procedure type, number of input, and number of return values are
* returned. Additionally this function returns specific information
* about each input argument and return value.
*
* Returns: TRUE on success.
*/
gboolean
gimp_pdb_proc_info (const gchar *procedure,
gchar **blurb,
gchar **help,
gchar **author,
gchar **copyright,
gchar **date,
GimpPDBProcType *proc_type,
gint *num_args,
gint *num_values,
GimpParamDef **args,
GimpParamDef **return_vals)
{
gint i;
gboolean success = TRUE;
success = _gimp_pdb_proc_info (procedure,
blurb,
help,
author,
copyright,
date,
proc_type,
num_args,
num_values);
if (success)
{
*args = g_new (GimpParamDef, *num_args);
*return_vals = g_new (GimpParamDef, *num_values);
for (i = 0; i < *num_args; i++)
{
if (! gimp_pdb_proc_arg (procedure, i,
&(*args)[i].type,
&(*args)[i].name,
&(*args)[i].description))
{
g_free (*args);
g_free (*return_vals);
return FALSE;
}
}
for (i = 0; i < *num_values; i++)
{
if (! gimp_pdb_proc_val (procedure, i,
&(*return_vals)[i].type,
&(*return_vals)[i].name,
&(*return_vals)[i].description))
{
g_free (*args);
g_free (*return_vals);
return FALSE;
}
}
}
return success;
}
/**
* gimp_pdb_get_data:
* @identifier: The identifier associated with data.
* @data: A byte array containing data.
*
* Returns data associated with the specified identifier.
*
* This procedure returns any data which may have been associated with
* the specified identifier. The data is copied into the given memory
* location.
*
* Returns: TRUE on success, FALSE if no data has been associated with
* the identifier
*/
gboolean
gimp_pdb_get_data (const gchar *identifier,
gpointer data)
{
gint size;
guint8 *hack;
gboolean success;
success = _gimp_pdb_get_data (identifier, &size, &hack);
if (hack)
{
memcpy (data, (gconstpointer) hack, size * sizeof (guint8));
g_free (hack);
}
return success;
}
/**
* gimp_pdb_set_data:
* @identifier: The identifier associated with data.
* @data: A byte array containing data.
* @bytes: The number of bytes in the data
*
* 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.
*/
gboolean
gimp_pdb_set_data (const gchar *identifier,
gconstpointer data,
guint32 bytes)
{
return _gimp_pdb_set_data (identifier, bytes, data);
}

View File

@ -71,6 +71,27 @@ GimpProcedure * gimp_pdb_lookup (GimpPDB *pdb,
const gchar *name); const gchar *name);
/* Cruft API */
gboolean gimp_pdb_proc_info (const gchar *procedure,
gchar **blurb,
gchar **help,
gchar **author,
gchar **copyright,
gchar **date,
GimpPDBProcType *proc_type,
gint *num_args,
gint *num_values,
GimpParamDef **args,
GimpParamDef **return_vals);
gboolean gimp_pdb_get_data (const gchar *identifier,
gpointer data);
gboolean gimp_pdb_set_data (const gchar *identifier,
gconstpointer data,
guint32 bytes);
G_END_DECLS G_END_DECLS
#endif /* __GIMP_PDB_H__ */ #endif /* __GIMP_PDB_H__ */

View File

@ -1,7 +1,7 @@
/* LIBGIMP - The GIMP Library /* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
* *
* gimpproceduraldb_pdb.c * gimppdb_pdb.c
* *
* This library is free software: you can redistribute it and/or * This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -24,19 +24,8 @@
#include "gimp.h" #include "gimp.h"
/** /**
* SECTION: gimpproceduraldb * gimp_pdb_temp_name:
* @title: gimpproceduraldb
* @short_description: Functions for querying and changing procedural database (PDB) entries.
*
* Functions for querying and changing procedural database (PDB)
* entries.
**/
/**
* gimp_procedural_db_temp_name:
* *
* Generates a unique temporary PDB name. * Generates a unique temporary PDB name.
* *
@ -47,7 +36,7 @@
* The returned value must be freed with g_free(). * The returned value must be freed with g_free().
**/ **/
gchar * gchar *
gimp_procedural_db_temp_name (void) gimp_pdb_temp_name (void)
{ {
GimpValueArray *args; GimpValueArray *args;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -55,7 +44,7 @@ gimp_procedural_db_temp_name (void)
args = gimp_value_array_new_from_types (G_TYPE_NONE); args = gimp_value_array_new_from_types (G_TYPE_NONE);
return_vals = gimp_run_procedure_with_array ("gimp-procedural-db-temp-name", return_vals = gimp_run_procedure_with_array ("gimp-pdb-temp-name",
args); args);
gimp_value_array_unref (args); gimp_value_array_unref (args);
@ -68,7 +57,7 @@ gimp_procedural_db_temp_name (void)
} }
/** /**
* gimp_procedural_db_dump: * gimp_pdb_dump:
* @filename: The dump filename. * @filename: The dump filename.
* *
* Dumps the current contents of the procedural database * Dumps the current contents of the procedural database
@ -80,7 +69,7 @@ gimp_procedural_db_temp_name (void)
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/
gboolean gboolean
gimp_procedural_db_dump (const gchar *filename) gimp_pdb_dump (const gchar *filename)
{ {
GimpValueArray *args; GimpValueArray *args;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -90,7 +79,7 @@ gimp_procedural_db_dump (const gchar *filename)
G_TYPE_NONE); G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), filename); g_value_set_string (gimp_value_array_index (args, 0), filename);
return_vals = gimp_run_procedure_with_array ("gimp-procedural-db-dump", return_vals = gimp_run_procedure_with_array ("gimp-pdb-dump",
args); args);
gimp_value_array_unref (args); gimp_value_array_unref (args);
@ -102,7 +91,7 @@ gimp_procedural_db_dump (const gchar *filename)
} }
/** /**
* gimp_procedural_db_query: * gimp_pdb_query:
* @name: The regex for procedure name. * @name: The regex for procedure name.
* @blurb: The regex for procedure blurb. * @blurb: The regex for procedure blurb.
* @help: The regex for procedure help. * @help: The regex for procedure help.
@ -132,15 +121,15 @@ gimp_procedural_db_dump (const gchar *filename)
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/
gboolean gboolean
gimp_procedural_db_query (const gchar *name, gimp_pdb_query (const gchar *name,
const gchar *blurb, const gchar *blurb,
const gchar *help, const gchar *help,
const gchar *author, const gchar *author,
const gchar *copyright, const gchar *copyright,
const gchar *date, const gchar *date,
const gchar *proc_type, const gchar *proc_type,
gint *num_matches, gint *num_matches,
gchar ***procedure_names) gchar ***procedure_names)
{ {
GimpValueArray *args; GimpValueArray *args;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -162,7 +151,7 @@ gimp_procedural_db_query (const gchar *name,
g_value_set_string (gimp_value_array_index (args, 5), date); g_value_set_string (gimp_value_array_index (args, 5), date);
g_value_set_string (gimp_value_array_index (args, 6), proc_type); g_value_set_string (gimp_value_array_index (args, 6), proc_type);
return_vals = gimp_run_procedure_with_array ("gimp-procedural-db-query", return_vals = gimp_run_procedure_with_array ("gimp-pdb-query",
args); args);
gimp_value_array_unref (args); gimp_value_array_unref (args);
@ -183,7 +172,7 @@ gimp_procedural_db_query (const gchar *name,
} }
/** /**
* gimp_procedural_db_proc_exists: * gimp_pdb_proc_exists:
* @procedure_name: The procedure name. * @procedure_name: The procedure name.
* *
* Checks if the specified procedure exists in the procedural database * Checks if the specified procedure exists in the procedural database
@ -196,7 +185,7 @@ gimp_procedural_db_query (const gchar *name,
* Since: 2.6 * Since: 2.6
**/ **/
gboolean gboolean
gimp_procedural_db_proc_exists (const gchar *procedure_name) gimp_pdb_proc_exists (const gchar *procedure_name)
{ {
GimpValueArray *args; GimpValueArray *args;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -206,7 +195,7 @@ gimp_procedural_db_proc_exists (const gchar *procedure_name)
G_TYPE_NONE); G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), procedure_name); g_value_set_string (gimp_value_array_index (args, 0), procedure_name);
return_vals = gimp_run_procedure_with_array ("gimp-procedural-db-proc-exists", return_vals = gimp_run_procedure_with_array ("gimp-pdb-proc-exists",
args); args);
gimp_value_array_unref (args); gimp_value_array_unref (args);
@ -219,7 +208,7 @@ gimp_procedural_db_proc_exists (const gchar *procedure_name)
} }
/** /**
* _gimp_procedural_db_proc_info: * _gimp_pdb_proc_info:
* @procedure_name: The procedure name. * @procedure_name: The procedure name.
* @blurb: (out) (transfer full): A short blurb. * @blurb: (out) (transfer full): A short blurb.
* @help: (out) (transfer full): Detailed procedure help. * @help: (out) (transfer full): Detailed procedure help.
@ -243,15 +232,15 @@ gimp_procedural_db_proc_exists (const gchar *procedure_name)
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/
gboolean gboolean
_gimp_procedural_db_proc_info (const gchar *procedure_name, _gimp_pdb_proc_info (const gchar *procedure_name,
gchar **blurb, gchar **blurb,
gchar **help, gchar **help,
gchar **author, gchar **author,
gchar **copyright, gchar **copyright,
gchar **date, gchar **date,
GimpPDBProcType *proc_type, GimpPDBProcType *proc_type,
gint *num_args, gint *num_args,
gint *num_values) gint *num_values)
{ {
GimpValueArray *args; GimpValueArray *args;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -261,7 +250,7 @@ _gimp_procedural_db_proc_info (const gchar *procedure_name,
G_TYPE_NONE); G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), procedure_name); g_value_set_string (gimp_value_array_index (args, 0), procedure_name);
return_vals = gimp_run_procedure_with_array ("gimp-procedural-db-proc-info", return_vals = gimp_run_procedure_with_array ("gimp-pdb-proc-info",
args); args);
gimp_value_array_unref (args); gimp_value_array_unref (args);
@ -294,7 +283,7 @@ _gimp_procedural_db_proc_info (const gchar *procedure_name,
} }
/** /**
* gimp_procedural_db_proc_arg: * gimp_pdb_proc_arg:
* @procedure_name: The procedure name. * @procedure_name: The procedure name.
* @arg_num: The argument number. * @arg_num: The argument number.
* @arg_type: (out): The type of argument. * @arg_type: (out): The type of argument.
@ -310,11 +299,11 @@ _gimp_procedural_db_proc_info (const gchar *procedure_name,
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/
gboolean gboolean
gimp_procedural_db_proc_arg (const gchar *procedure_name, gimp_pdb_proc_arg (const gchar *procedure_name,
gint arg_num, gint arg_num,
GimpPDBArgType *arg_type, GimpPDBArgType *arg_type,
gchar **arg_name, gchar **arg_name,
gchar **arg_desc) gchar **arg_desc)
{ {
GimpValueArray *args; GimpValueArray *args;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -326,7 +315,7 @@ gimp_procedural_db_proc_arg (const gchar *procedure_name,
g_value_set_string (gimp_value_array_index (args, 0), procedure_name); g_value_set_string (gimp_value_array_index (args, 0), procedure_name);
g_value_set_int (gimp_value_array_index (args, 1), arg_num); g_value_set_int (gimp_value_array_index (args, 1), arg_num);
return_vals = gimp_run_procedure_with_array ("gimp-procedural-db-proc-arg", return_vals = gimp_run_procedure_with_array ("gimp-pdb-proc-arg",
args); args);
gimp_value_array_unref (args); gimp_value_array_unref (args);
@ -349,7 +338,7 @@ gimp_procedural_db_proc_arg (const gchar *procedure_name,
} }
/** /**
* gimp_procedural_db_proc_val: * gimp_pdb_proc_val:
* @procedure_name: The procedure name. * @procedure_name: The procedure name.
* @val_num: The return value number. * @val_num: The return value number.
* @val_type: (out): The type of return value. * @val_type: (out): The type of return value.
@ -366,11 +355,11 @@ gimp_procedural_db_proc_arg (const gchar *procedure_name,
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/
gboolean gboolean
gimp_procedural_db_proc_val (const gchar *procedure_name, gimp_pdb_proc_val (const gchar *procedure_name,
gint val_num, gint val_num,
GimpPDBArgType *val_type, GimpPDBArgType *val_type,
gchar **val_name, gchar **val_name,
gchar **val_desc) gchar **val_desc)
{ {
GimpValueArray *args; GimpValueArray *args;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -382,7 +371,7 @@ gimp_procedural_db_proc_val (const gchar *procedure_name,
g_value_set_string (gimp_value_array_index (args, 0), procedure_name); g_value_set_string (gimp_value_array_index (args, 0), procedure_name);
g_value_set_int (gimp_value_array_index (args, 1), val_num); g_value_set_int (gimp_value_array_index (args, 1), val_num);
return_vals = gimp_run_procedure_with_array ("gimp-procedural-db-proc-val", return_vals = gimp_run_procedure_with_array ("gimp-pdb-proc-val",
args); args);
gimp_value_array_unref (args); gimp_value_array_unref (args);
@ -405,7 +394,7 @@ gimp_procedural_db_proc_val (const gchar *procedure_name,
} }
/** /**
* gimp_procedural_db_proc_argument: * gimp_pdb_proc_argument:
* @procedure_name: The procedure name. * @procedure_name: The procedure name.
* @arg_num: The argument number. * @arg_num: The argument number.
* *
@ -420,8 +409,8 @@ gimp_procedural_db_proc_val (const gchar *procedure_name,
* Since: 3.0 * Since: 3.0
**/ **/
GParamSpec * GParamSpec *
gimp_procedural_db_proc_argument (const gchar *procedure_name, gimp_pdb_proc_argument (const gchar *procedure_name,
gint arg_num) gint arg_num)
{ {
GimpValueArray *args; GimpValueArray *args;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -433,7 +422,7 @@ gimp_procedural_db_proc_argument (const gchar *procedure_name,
g_value_set_string (gimp_value_array_index (args, 0), procedure_name); g_value_set_string (gimp_value_array_index (args, 0), procedure_name);
g_value_set_int (gimp_value_array_index (args, 1), arg_num); g_value_set_int (gimp_value_array_index (args, 1), arg_num);
return_vals = gimp_run_procedure_with_array ("gimp-procedural-db-proc-argument", return_vals = gimp_run_procedure_with_array ("gimp-pdb-proc-argument",
args); args);
gimp_value_array_unref (args); gimp_value_array_unref (args);
@ -446,7 +435,7 @@ gimp_procedural_db_proc_argument (const gchar *procedure_name,
} }
/** /**
* gimp_procedural_db_proc_return_value: * gimp_pdb_proc_return_value:
* @procedure_name: The procedure name. * @procedure_name: The procedure name.
* @val_num: The return value number. * @val_num: The return value number.
* *
@ -462,8 +451,8 @@ gimp_procedural_db_proc_argument (const gchar *procedure_name,
* Since: 3.0 * Since: 3.0
**/ **/
GParamSpec * GParamSpec *
gimp_procedural_db_proc_return_value (const gchar *procedure_name, gimp_pdb_proc_return_value (const gchar *procedure_name,
gint val_num) gint val_num)
{ {
GimpValueArray *args; GimpValueArray *args;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -475,7 +464,7 @@ gimp_procedural_db_proc_return_value (const gchar *procedure_name,
g_value_set_string (gimp_value_array_index (args, 0), procedure_name); g_value_set_string (gimp_value_array_index (args, 0), procedure_name);
g_value_set_int (gimp_value_array_index (args, 1), val_num); g_value_set_int (gimp_value_array_index (args, 1), val_num);
return_vals = gimp_run_procedure_with_array ("gimp-procedural-db-proc-return-value", return_vals = gimp_run_procedure_with_array ("gimp-pdb-proc-return-value",
args); args);
gimp_value_array_unref (args); gimp_value_array_unref (args);
@ -488,7 +477,7 @@ gimp_procedural_db_proc_return_value (const gchar *procedure_name,
} }
/** /**
* _gimp_procedural_db_get_data: * _gimp_pdb_get_data:
* @identifier: The identifier associated with data. * @identifier: The identifier associated with data.
* @bytes: (out): The number of bytes in the data. * @bytes: (out): The number of bytes in the data.
* @data: (out) (array length=bytes) (element-type guint8) (transfer full): A byte array containing data. * @data: (out) (array length=bytes) (element-type guint8) (transfer full): A byte array containing data.
@ -503,9 +492,9 @@ gimp_procedural_db_proc_return_value (const gchar *procedure_name,
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/
gboolean gboolean
_gimp_procedural_db_get_data (const gchar *identifier, _gimp_pdb_get_data (const gchar *identifier,
gint *bytes, gint *bytes,
guint8 **data) guint8 **data)
{ {
GimpValueArray *args; GimpValueArray *args;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -515,7 +504,7 @@ _gimp_procedural_db_get_data (const gchar *identifier,
G_TYPE_NONE); G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), identifier); g_value_set_string (gimp_value_array_index (args, 0), identifier);
return_vals = gimp_run_procedure_with_array ("gimp-procedural-db-get-data", return_vals = gimp_run_procedure_with_array ("gimp-pdb-get-data",
args); args);
gimp_value_array_unref (args); gimp_value_array_unref (args);
@ -536,7 +525,7 @@ _gimp_procedural_db_get_data (const gchar *identifier,
} }
/** /**
* gimp_procedural_db_get_data_size: * gimp_pdb_get_data_size:
* @identifier: The identifier associated with data. * @identifier: The identifier associated with data.
* *
* Returns size of data associated with the specified identifier. * Returns size of data associated with the specified identifier.
@ -548,7 +537,7 @@ _gimp_procedural_db_get_data (const gchar *identifier,
* Returns: The number of bytes in the data. * Returns: The number of bytes in the data.
**/ **/
gint gint
gimp_procedural_db_get_data_size (const gchar *identifier) gimp_pdb_get_data_size (const gchar *identifier)
{ {
GimpValueArray *args; GimpValueArray *args;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -558,7 +547,7 @@ gimp_procedural_db_get_data_size (const gchar *identifier)
G_TYPE_NONE); G_TYPE_NONE);
g_value_set_string (gimp_value_array_index (args, 0), identifier); g_value_set_string (gimp_value_array_index (args, 0), identifier);
return_vals = gimp_run_procedure_with_array ("gimp-procedural-db-get-data-size", return_vals = gimp_run_procedure_with_array ("gimp-pdb-get-data-size",
args); args);
gimp_value_array_unref (args); gimp_value_array_unref (args);
@ -571,7 +560,7 @@ gimp_procedural_db_get_data_size (const gchar *identifier)
} }
/** /**
* _gimp_procedural_db_set_data: * _gimp_pdb_set_data:
* @identifier: The identifier associated with data. * @identifier: The identifier associated with data.
* @bytes: The number of bytes in the data. * @bytes: The number of bytes in the data.
* @data: (array length=bytes) (element-type guint8): A byte array containing data. * @data: (array length=bytes) (element-type guint8): A byte array containing data.
@ -585,9 +574,9 @@ gimp_procedural_db_get_data_size (const gchar *identifier)
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/
gboolean gboolean
_gimp_procedural_db_set_data (const gchar *identifier, _gimp_pdb_set_data (const gchar *identifier,
gint bytes, gint bytes,
const guint8 *data) const guint8 *data)
{ {
GimpValueArray *args; GimpValueArray *args;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -601,7 +590,7 @@ _gimp_procedural_db_set_data (const gchar *identifier,
g_value_set_int (gimp_value_array_index (args, 1), bytes); g_value_set_int (gimp_value_array_index (args, 1), bytes);
gimp_value_set_int8_array (gimp_value_array_index (args, 2), data, bytes); gimp_value_set_int8_array (gimp_value_array_index (args, 2), data, bytes);
return_vals = gimp_run_procedure_with_array ("gimp-procedural-db-set-data", return_vals = gimp_run_procedure_with_array ("gimp-pdb-set-data",
args); args);
gimp_value_array_unref (args); gimp_value_array_unref (args);

81
libgimp/gimppdb_pdb.h Normal file
View File

@ -0,0 +1,81 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
*
* gimppdb_pdb.h
*
* 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
* <https://www.gnu.org/licenses/>.
*/
/* NOTE: This file is auto-generated by pdbgen.pl */
#if !defined (__GIMP_H_INSIDE__) && !defined (GIMP_COMPILATION)
#error "Only <libgimp/gimp.h> can be included directly."
#endif
#ifndef __GIMP_PDB_PDB_H__
#define __GIMP_PDB_PDB_H__
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gchar* gimp_pdb_temp_name (void);
gboolean gimp_pdb_dump (const gchar *filename);
gboolean gimp_pdb_query (const gchar *name,
const gchar *blurb,
const gchar *help,
const gchar *author,
const gchar *copyright,
const gchar *date,
const gchar *proc_type,
gint *num_matches,
gchar ***procedure_names);
gboolean gimp_pdb_proc_exists (const gchar *procedure_name);
G_GNUC_INTERNAL gboolean _gimp_pdb_proc_info (const gchar *procedure_name,
gchar **blurb,
gchar **help,
gchar **author,
gchar **copyright,
gchar **date,
GimpPDBProcType *proc_type,
gint *num_args,
gint *num_values);
gboolean gimp_pdb_proc_arg (const gchar *procedure_name,
gint arg_num,
GimpPDBArgType *arg_type,
gchar **arg_name,
gchar **arg_desc);
gboolean gimp_pdb_proc_val (const gchar *procedure_name,
gint val_num,
GimpPDBArgType *val_type,
gchar **val_name,
gchar **val_desc);
GParamSpec* gimp_pdb_proc_argument (const gchar *procedure_name,
gint arg_num);
GParamSpec* gimp_pdb_proc_return_value (const gchar *procedure_name,
gint val_num);
G_GNUC_INTERNAL gboolean _gimp_pdb_get_data (const gchar *identifier,
gint *bytes,
guint8 **data);
gint gimp_pdb_get_data_size (const gchar *identifier);
G_GNUC_INTERNAL gboolean _gimp_pdb_set_data (const gchar *identifier,
gint bytes,
const guint8 *data);
G_END_DECLS
#endif /* __GIMP_PDB_PDB_H__ */

View File

@ -84,15 +84,15 @@ _gimp_pdb_procedure_new (GimpPDB *pdb,
g_return_val_if_fail (GIMP_IS_PDB (pdb), NULL); g_return_val_if_fail (GIMP_IS_PDB (pdb), NULL);
g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (name != NULL, NULL);
_gimp_procedural_db_proc_info (name, _gimp_pdb_proc_info (name,
&blurb, &blurb,
&help, &help,
&authors, &authors,
&copyright, &copyright,
&date, &date,
&type, &type,
&n_params, &n_params,
&n_return_vals); &n_return_vals);
procedure = g_object_new (GIMP_TYPE_PDB_PROCEDURE, procedure = g_object_new (GIMP_TYPE_PDB_PROCEDURE,
"plug-in", _gimp_pdb_get_plug_in (pdb), "plug-in", _gimp_pdb_get_plug_in (pdb),
@ -113,7 +113,7 @@ _gimp_pdb_procedure_new (GimpPDB *pdb,
for (i = 0; i < n_params; i++) for (i = 0; i < n_params; i++)
{ {
GParamSpec *pspec = gimp_procedural_db_proc_argument (name, i); GParamSpec *pspec = gimp_pdb_proc_argument (name, i);
gimp_procedure_add_argument (procedure, pspec); gimp_procedure_add_argument (procedure, pspec);
g_param_spec_unref (pspec); g_param_spec_unref (pspec);
@ -121,7 +121,7 @@ _gimp_pdb_procedure_new (GimpPDB *pdb,
for (i = 0; i < n_return_vals; i++) for (i = 0; i < n_return_vals; i++)
{ {
GParamSpec *pspec = gimp_procedural_db_proc_return_value (name, i); GParamSpec *pspec = gimp_pdb_proc_return_value (name, i);
gimp_procedure_add_return_value (procedure, pspec); gimp_procedure_add_return_value (procedure, pspec);
g_param_spec_unref (pspec); g_param_spec_unref (pspec);

View File

@ -380,8 +380,8 @@ browser_search (GimpBrowser *browser,
case SEARCH_TYPE_ALL: case SEARCH_TYPE_ALL:
gimp_browser_show_message (browser, _("Searching")); gimp_browser_show_message (browser, _("Searching"));
gimp_procedural_db_query (".*", ".*", ".*", ".*", ".*", ".*", ".*", gimp_pdb_query (".*", ".*", ".*", ".*", ".*", ".*", ".*",
&num_procs, &proc_list); &num_procs, &proc_list);
break; break;
case SEARCH_TYPE_NAME: case SEARCH_TYPE_NAME:
@ -401,9 +401,9 @@ browser_search (GimpBrowser *browser,
q++; q++;
} }
gimp_procedural_db_query (query->str, gimp_pdb_query (query->str,
".*", ".*", ".*", ".*", ".*", ".*", ".*", ".*", ".*", ".*", ".*", ".*",
&num_procs, &proc_list); &num_procs, &proc_list);
g_string_free (query, TRUE); g_string_free (query, TRUE);
} }
@ -412,43 +412,43 @@ browser_search (GimpBrowser *browser,
case SEARCH_TYPE_BLURB: case SEARCH_TYPE_BLURB:
gimp_browser_show_message (browser, _("Searching by description")); gimp_browser_show_message (browser, _("Searching by description"));
gimp_procedural_db_query (".*", query_text, ".*", ".*", ".*", ".*", ".*", gimp_pdb_query (".*", query_text, ".*", ".*", ".*", ".*", ".*",
&num_procs, &proc_list); &num_procs, &proc_list);
break; break;
case SEARCH_TYPE_HELP: case SEARCH_TYPE_HELP:
gimp_browser_show_message (browser, _("Searching by help")); gimp_browser_show_message (browser, _("Searching by help"));
gimp_procedural_db_query (".*", ".*", query_text, ".*", ".*", ".*", ".*", gimp_pdb_query (".*", ".*", query_text, ".*", ".*", ".*", ".*",
&num_procs, &proc_list); &num_procs, &proc_list);
break; break;
case SEARCH_TYPE_AUTHOR: case SEARCH_TYPE_AUTHOR:
gimp_browser_show_message (browser, _("Searching by author")); gimp_browser_show_message (browser, _("Searching by author"));
gimp_procedural_db_query (".*", ".*", ".*", query_text, ".*", ".*", ".*", gimp_pdb_query (".*", ".*", ".*", query_text, ".*", ".*", ".*",
&num_procs, &proc_list); &num_procs, &proc_list);
break; break;
case SEARCH_TYPE_COPYRIGHT: case SEARCH_TYPE_COPYRIGHT:
gimp_browser_show_message (browser, _("Searching by copyright")); gimp_browser_show_message (browser, _("Searching by copyright"));
gimp_procedural_db_query (".*", ".*", ".*", ".*", query_text, ".*", ".*", gimp_pdb_query (".*", ".*", ".*", ".*", query_text, ".*", ".*",
&num_procs, &proc_list); &num_procs, &proc_list);
break; break;
case SEARCH_TYPE_DATE: case SEARCH_TYPE_DATE:
gimp_browser_show_message (browser, _("Searching by date")); gimp_browser_show_message (browser, _("Searching by date"));
gimp_procedural_db_query (".*", ".*", ".*", ".*", ".*", query_text, ".*", gimp_pdb_query (".*", ".*", ".*", ".*", ".*", query_text, ".*",
&num_procs, &proc_list); &num_procs, &proc_list);
break; break;
case SEARCH_TYPE_PROC_TYPE: case SEARCH_TYPE_PROC_TYPE:
gimp_browser_show_message (browser, _("Searching by type")); gimp_browser_show_message (browser, _("Searching by type"));
gimp_procedural_db_query (".*", ".*", ".*", ".*", ".*", ".*", query_text, gimp_pdb_query (".*", ".*", ".*", ".*", ".*", ".*", query_text,
&num_procs, &proc_list); &num_procs, &proc_list);
break; break;
} }

View File

@ -1,173 +0,0 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpproceduraldb.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
* <https://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <string.h> /* memcmp */
#include "gimp.h"
/**
* gimp_procedural_db_proc_info:
* @procedure: The procedure name.
* @blurb: A short blurb.
* @help: Detailed procedure help.
* @author: Author(s) of the procedure.
* @copyright: The copyright.
* @date: Copyright date.
* @proc_type: The procedure type.
* @num_args: The number of input arguments.
* @num_values: The number of return values.
* @args: The input arguments.
* @return_vals: The return values.
*
* Queries the procedural database for information on the specified
* procedure.
*
* This procedure returns information on the specified procedure. A
* short blurb, detailed help, author(s), copyright information,
* procedure type, number of input, and number of return values are
* returned. Additionally this function returns specific information
* about each input argument and return value.
*
* Returns: TRUE on success.
*/
gboolean
gimp_procedural_db_proc_info (const gchar *procedure,
gchar **blurb,
gchar **help,
gchar **author,
gchar **copyright,
gchar **date,
GimpPDBProcType *proc_type,
gint *num_args,
gint *num_values,
GimpParamDef **args,
GimpParamDef **return_vals)
{
gint i;
gboolean success = TRUE;
success = _gimp_procedural_db_proc_info (procedure,
blurb,
help,
author,
copyright,
date,
proc_type,
num_args,
num_values);
if (success)
{
*args = g_new (GimpParamDef, *num_args);
*return_vals = g_new (GimpParamDef, *num_values);
for (i = 0; i < *num_args; i++)
{
if (! gimp_procedural_db_proc_arg (procedure,
i,
&(*args)[i].type,
&(*args)[i].name,
&(*args)[i].description))
{
g_free (*args);
g_free (*return_vals);
return FALSE;
}
}
for (i = 0; i < *num_values; i++)
{
if (! gimp_procedural_db_proc_val (procedure,
i,
&(*return_vals)[i].type,
&(*return_vals)[i].name,
&(*return_vals)[i].description))
{
g_free (*args);
g_free (*return_vals);
return FALSE;
}
}
}
return success;
}
/**
* gimp_procedural_db_get_data:
* @identifier: The identifier associated with data.
* @data: A byte array containing data.
*
* Returns data associated with the specified identifier.
*
* This procedure returns any data which may have been associated with
* the specified identifier. The data is copied into the given memory
* location.
*
* Returns: TRUE on success, FALSE if no data has been associated with
* the identifier
*/
gboolean
gimp_procedural_db_get_data (const gchar *identifier,
gpointer data)
{
gint size;
guint8 *hack;
gboolean success;
success = _gimp_procedural_db_get_data (identifier,
&size,
&hack);
if (hack)
{
memcpy (data, (gconstpointer) hack, size * sizeof (guint8));
g_free (hack);
}
return success;
}
/**
* gimp_procedural_db_set_data:
* @identifier: The identifier associated with data.
* @data: A byte array containing data.
* @bytes: The number of bytes in the data
*
* 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.
*/
gboolean
gimp_procedural_db_set_data (const gchar *identifier,
gconstpointer data,
guint32 bytes)
{
return _gimp_procedural_db_set_data (identifier,
bytes,
data);
}

View File

@ -1,53 +0,0 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpproceduraldb.h
*
* 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
* <https://www.gnu.org/licenses/>.
*/
#if !defined (__GIMP_H_INSIDE__) && !defined (GIMP_COMPILATION)
#error "Only <libgimp/gimp.h> can be included directly."
#endif
#ifndef __GIMP_PROCEDURAL_DB_H__
#define __GIMP_PROCEDURAL_DB_H__
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_procedural_db_proc_info (const gchar *procedure,
gchar **blurb,
gchar **help,
gchar **author,
gchar **copyright,
gchar **date,
GimpPDBProcType *proc_type,
gint *num_args,
gint *num_values,
GimpParamDef **args,
GimpParamDef **return_vals);
gboolean gimp_procedural_db_get_data (const gchar *identifier,
gpointer data);
gboolean gimp_procedural_db_set_data (const gchar *identifier,
gconstpointer data,
guint32 bytes);
G_END_DECLS
#endif /* __GIMP_PROCEDURAL_DB_H__ */

View File

@ -1,81 +0,0 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
*
* gimpproceduraldb_pdb.h
*
* 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
* <https://www.gnu.org/licenses/>.
*/
/* NOTE: This file is auto-generated by pdbgen.pl */
#if !defined (__GIMP_H_INSIDE__) && !defined (GIMP_COMPILATION)
#error "Only <libgimp/gimp.h> can be included directly."
#endif
#ifndef __GIMP_PROCEDURAL_DB_PDB_H__
#define __GIMP_PROCEDURAL_DB_PDB_H__
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gchar* gimp_procedural_db_temp_name (void);
gboolean gimp_procedural_db_dump (const gchar *filename);
gboolean gimp_procedural_db_query (const gchar *name,
const gchar *blurb,
const gchar *help,
const gchar *author,
const gchar *copyright,
const gchar *date,
const gchar *proc_type,
gint *num_matches,
gchar ***procedure_names);
gboolean gimp_procedural_db_proc_exists (const gchar *procedure_name);
G_GNUC_INTERNAL gboolean _gimp_procedural_db_proc_info (const gchar *procedure_name,
gchar **blurb,
gchar **help,
gchar **author,
gchar **copyright,
gchar **date,
GimpPDBProcType *proc_type,
gint *num_args,
gint *num_values);
gboolean gimp_procedural_db_proc_arg (const gchar *procedure_name,
gint arg_num,
GimpPDBArgType *arg_type,
gchar **arg_name,
gchar **arg_desc);
gboolean gimp_procedural_db_proc_val (const gchar *procedure_name,
gint val_num,
GimpPDBArgType *val_type,
gchar **val_name,
gchar **val_desc);
GParamSpec* gimp_procedural_db_proc_argument (const gchar *procedure_name,
gint arg_num);
GParamSpec* gimp_procedural_db_proc_return_value (const gchar *procedure_name,
gint val_num);
G_GNUC_INTERNAL gboolean _gimp_procedural_db_get_data (const gchar *identifier,
gint *bytes,
guint8 **data);
gint gimp_procedural_db_get_data_size (const gchar *identifier);
G_GNUC_INTERNAL gboolean _gimp_procedural_db_set_data (const gchar *identifier,
gint bytes,
const guint8 *data);
G_END_DECLS
#endif /* __GIMP_PROCEDURAL_DB_PDB_H__ */

View File

@ -108,17 +108,17 @@ gimp_proc_view_new (const gchar *procedure_name,
g_return_val_if_fail (procedure_name != NULL, NULL); g_return_val_if_fail (procedure_name != NULL, NULL);
gimp_procedural_db_proc_info (procedure_name, gimp_pdb_proc_info (procedure_name,
&blurb, &blurb,
&help, &help,
&author, &author,
&copyright, &copyright,
&date, &date,
&type, &type,
&n_params, &n_params,
&n_return_vals, &n_return_vals,
&params, &params,
&return_vals); &return_vals);
if (blurb && strlen (blurb) < 2) g_clear_pointer (&blurb, g_free); if (blurb && strlen (blurb) < 2) g_clear_pointer (&blurb, g_free);
if (help && strlen (help) < 2) g_clear_pointer (&help, g_free); if (help && strlen (help) < 2) g_clear_pointer (&help, g_free);
@ -446,9 +446,9 @@ gimp_proc_view_create_args (const gchar *procedure_name,
GtkWidget *label; GtkWidget *label;
if (return_values) if (return_values)
pspec = gimp_procedural_db_proc_return_value (procedure_name, i); pspec = gimp_pdb_proc_return_value (procedure_name, i);
else else
pspec = gimp_procedural_db_proc_argument (procedure_name, i); pspec = gimp_pdb_proc_argument (procedure_name, i);
/* name */ /* name */
label = gtk_label_new (g_param_spec_get_name (pspec)); label = gtk_label_new (g_param_spec_get_name (pspec));

View File

@ -88,7 +88,7 @@ gimp_progress_install_vtable (const GimpProgressVtable *vtable,
plug_in = gimp_get_plug_in (); plug_in = gimp_get_plug_in ();
progress_callback = gimp_procedural_db_temp_name (); progress_callback = gimp_pdb_temp_name ();
progress_data = g_slice_new0 (GimpProgressData); progress_data = g_slice_new0 (GimpProgressData);

View File

@ -45,9 +45,9 @@ pdb_groups = \
groups/pattern.pdb \ groups/pattern.pdb \
groups/pattern_select.pdb \ groups/pattern_select.pdb \
groups/patterns.pdb \ groups/patterns.pdb \
groups/pdb.pdb \
groups/plug_in.pdb \ groups/plug_in.pdb \
groups/plug_in_compat.pdb \ groups/plug_in_compat.pdb \
groups/procedural_db.pdb \
groups/progress.pdb \ groups/progress.pdb \
groups/selection.pdb \ groups/selection.pdb \
groups/text_layer.pdb \ groups/text_layer.pdb \

View File

@ -43,9 +43,9 @@
pattern pattern
pattern_select pattern_select
patterns patterns
pdb
plug_in plug_in
plug_in_compat plug_in_compat
procedural_db
progress progress
selection selection
text_layer text_layer

View File

@ -16,7 +16,7 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub procedural_db_temp_name { sub pdb_temp_name {
$blurb = 'Generates a unique temporary PDB name.'; $blurb = 'Generates a unique temporary PDB name.';
$help = <<'HELP'; $help = <<'HELP';
@ -42,7 +42,7 @@ CODE
); );
} }
sub procedural_db_dump { sub pdb_dump {
$blurb = 'Dumps the current contents of the procedural database'; $blurb = 'Dumps the current contents of the procedural database';
$help = <<'HELP'; $help = <<'HELP';
@ -74,7 +74,7 @@ CODE
); );
} }
sub procedural_db_query { sub pdb_query {
$blurb = <<'BLURB'; $blurb = <<'BLURB';
Queries the procedural database for its contents using regular expression Queries the procedural database for its contents using regular expression
matching. matching.
@ -134,7 +134,7 @@ CODE
); );
} }
sub procedural_db_proc_exists { sub pdb_proc_exists {
$blurb = <<'BLURB'; $blurb = <<'BLURB';
Checks if the specified procedure exists in the procedural database Checks if the specified procedure exists in the procedural database
BLURB BLURB
@ -182,7 +182,7 @@ CODE
); );
} }
sub procedural_db_proc_info { sub pdb_proc_info {
$blurb = <<'BLURB'; $blurb = <<'BLURB';
Queries the procedural database for information on the specified procedure. Queries the procedural database for information on the specified procedure.
BLURB BLURB
@ -244,7 +244,7 @@ CODE
); );
} }
sub procedural_db_proc_argument { sub pdb_proc_argument {
$blurb = <<BLURB; $blurb = <<BLURB;
Queries the procedural database for information on the specified procedure's Queries the procedural database for information on the specified procedure's
argument. argument.
@ -303,7 +303,7 @@ CODE
); );
} }
sub procedural_db_proc_return_value { sub pdb_proc_return_value {
$blurb = <<BLURB; $blurb = <<BLURB;
Queries the procedural database for information on the specified procedure's Queries the procedural database for information on the specified procedure's
return value. return value.
@ -362,7 +362,7 @@ CODE
); );
} }
sub procedural_db_proc_arg { sub pdb_proc_arg {
$blurb = <<BLURB; $blurb = <<BLURB;
Queries the procedural database for information on the specified procedure's Queries the procedural database for information on the specified procedure's
argument. argument.
@ -430,7 +430,7 @@ CODE
); );
} }
sub procedural_db_proc_val { sub pdb_proc_val {
$blurb = <<BLURB; $blurb = <<BLURB;
Queries the procedural database for information on the specified procedure's Queries the procedural database for information on the specified procedure's
return value. return value.
@ -498,7 +498,7 @@ CODE
); );
} }
sub procedural_db_get_data { sub pdb_get_data {
$blurb = 'Returns data associated with the specified identifier.'; $blurb = 'Returns data associated with the specified identifier.';
$help = <<'HELP'; $help = <<'HELP';
@ -542,7 +542,7 @@ CODE
); );
} }
sub procedural_db_get_data_size { sub pdb_get_data_size {
$blurb = 'Returns size of data associated with the specified identifier.'; $blurb = 'Returns size of data associated with the specified identifier.';
$help = <<'HELP'; $help = <<'HELP';
@ -578,7 +578,7 @@ CODE
); );
} }
sub procedural_db_set_data { sub pdb_set_data {
$blurb = 'Associates the specified identifier with the supplied data.'; $blurb = 'Associates the specified identifier with the supplied data.';
$help = <<'HELP'; $help = <<'HELP';
@ -620,23 +620,21 @@ CODE
"gimppdb-query.h" "gimppdb-query.h"
"gimp-pdb-compat.h"); "gimp-pdb-compat.h");
@procs = qw(procedural_db_temp_name @procs = qw(pdb_temp_name
procedural_db_dump pdb_dump
procedural_db_query pdb_query
procedural_db_proc_exists pdb_proc_exists
procedural_db_proc_info pdb_proc_info
procedural_db_proc_arg pdb_proc_arg
procedural_db_proc_val pdb_proc_val
procedural_db_proc_argument pdb_proc_argument
procedural_db_proc_return_value pdb_proc_return_value
procedural_db_get_data procedural_db_get_data_size pdb_get_data
procedural_db_set_data); pdb_get_data_size
pdb_set_data);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Procedural database'; $desc = 'Procedural database';
$doc_title = 'gimpproceduraldb';
$doc_short_desc = 'Functions for querying and changing procedural database (PDB) entries.';
$doc_long_desc = 'Functions for querying and changing procedural database (PDB) entries.';
1; 1;

View File

@ -1654,7 +1654,7 @@ run (const gchar *name,
if (run_mode == GIMP_RUN_INTERACTIVE || if (run_mode == GIMP_RUN_INTERACTIVE ||
run_mode == GIMP_RUN_WITH_LAST_VALS) run_mode == GIMP_RUN_WITH_LAST_VALS)
{ {
gimp_procedural_db_get_data (SAVE_PROC, &mng_data); gimp_get_data (SAVE_PROC, &mng_data);
gimp_ui_init (PLUG_IN_BINARY, FALSE); gimp_ui_init (PLUG_IN_BINARY, FALSE);

View File

@ -448,8 +448,8 @@ ts_init_procedures (scheme *sc,
script_fu_marshal_procedure_call_permissive)); script_fu_marshal_procedure_call_permissive));
sc->vptr->setimmutable (symbol); sc->vptr->setimmutable (symbol);
gimp_procedural_db_query (".*", ".*", ".*", ".*", ".*", ".*", ".*", gimp_pdb_query (".*", ".*", ".*", ".*", ".*", ".*", ".*",
&num_procs, &proc_list); &num_procs, &proc_list);
/* Register each procedure as a scheme func */ /* Register each procedure as a scheme func */
for (i = 0; i < num_procs; i++) for (i = 0; i < num_procs; i++)
@ -576,15 +576,15 @@ script_fu_marshal_procedure_call (scheme *sc,
script_fu_interface_report_cc (proc_name); script_fu_interface_report_cc (proc_name);
/* Attempt to fetch the procedure from the database */ /* Attempt to fetch the procedure from the database */
if (! gimp_procedural_db_proc_info (proc_name, if (! gimp_pdb_proc_info (proc_name,
&proc_blurb, &proc_blurb,
&proc_help, &proc_help,
&proc_author, &proc_author,
&proc_copyright, &proc_copyright,
&proc_date, &proc_date,
&proc_type, &proc_type,
&nparams, &nreturn_vals, &nparams, &nreturn_vals,
&params, &return_vals)) &params, &return_vals))
{ {
#ifdef DEBUG_MARSHALL #ifdef DEBUG_MARSHALL
g_printerr (" Invalid procedure name\n"); g_printerr (" Invalid procedure name\n");

View File

@ -427,17 +427,17 @@ script_fu_browse_response (GtkWidget *widget,
if (proc_name == NULL) if (proc_name == NULL)
return; return;
gimp_procedural_db_proc_info (proc_name, gimp_pdb_proc_info (proc_name,
&proc_blurb, &proc_blurb,
&proc_help, &proc_help,
&proc_author, &proc_author,
&proc_copyright, &proc_copyright,
&proc_date, &proc_date,
&proc_type, &proc_type,
&n_params, &n_params,
&n_return_vals, &n_return_vals,
&params, &params,
&return_vals); &return_vals);
text = g_string_new ("("); text = g_string_new ("(");
text = g_string_append (text, proc_name); text = g_string_append (text, proc_name);

View File

@ -363,8 +363,8 @@ app/pdb/image-transform-cmds.c
app/pdb/image-undo-cmds.c app/pdb/image-undo-cmds.c
app/pdb/item-transform-cmds.c app/pdb/item-transform-cmds.c
app/pdb/layer-cmds.c app/pdb/layer-cmds.c
app/pdb/pdb-cmds.c
app/pdb/plug-in-compat-cmds.c app/pdb/plug-in-compat-cmds.c
app/pdb/procedural-db-cmds.c
app/pdb/selection-cmds.c app/pdb/selection-cmds.c
app/pdb/text-layer-cmds.c app/pdb/text-layer-cmds.c
app/pdb/vectors-cmds.c app/pdb/vectors-cmds.c