gimp-ux#93: GIMP_PDB_PROC_TYPE_EXTENSION renamed GIMP_PDB_PROC_TYPE_PERSISTENT.

Even though it's not public yet (and won't really be for GIMP 3.0), I
created a new concept of "GIMP Extension" (.gex files) which bundles
various types of data for GIMP, such as plug-ins but also brushes and
other resources, themes, icons, etc.

Having 2 different concepts named the same is confusing, especially
since one of them is not really self-explaining IMO (why are "always-ON"
plug-ins called "extensions"?). So even though this is the older
concept, and since we are anyway massively breaking the API for GIMP
3.0, let's rename this older concept. "Persistent Plug-Ins" is much more
self-defining.
This commit is contained in:
Jehan 2024-09-29 17:45:45 +02:00
parent 4a41b76411
commit a9bc4c6c1b
21 changed files with 36 additions and 36 deletions

View File

@ -84,7 +84,7 @@ plug_in_run_cmd_callback (GimpAction *action,
switch (procedure->proc_type)
{
case GIMP_PDB_PROC_TYPE_EXTENSION:
case GIMP_PDB_PROC_TYPE_PERSISTENT:
args = procedure_commands_get_run_mode_arg (procedure);
break;

View File

@ -535,7 +535,7 @@ app_activate_callback (GimpCoreApp *app,
{
/* In console version or GUI version with no interface, we keep
* running when --quit was not set. For instance, there could be
* an always-ON plug-in (GIMP_PDB_PROC_TYPE_EXTENSION) which is
* an always-ON plug-in (GIMP_PDB_PROC_TYPE_PERSISTENT) which is
* set up to receive commands for GIMP.
*/
#ifdef G_OS_WIN32

View File

@ -810,7 +810,7 @@ gimp_plug_in_handle_proc_install (GimpPlugIn *plug_in,
switch (proc_install->type)
{
case GIMP_PDB_PROC_TYPE_PLUGIN:
case GIMP_PDB_PROC_TYPE_EXTENSION:
case GIMP_PDB_PROC_TYPE_PERSISTENT:
procedure = gimp_plug_in_procedure_new (proc_install->type,
plug_in->file);
break;
@ -850,7 +850,7 @@ gimp_plug_in_handle_proc_install (GimpPlugIn *plug_in,
switch (proc_install->type)
{
case GIMP_PDB_PROC_TYPE_PLUGIN:
case GIMP_PDB_PROC_TYPE_EXTENSION:
case GIMP_PDB_PROC_TYPE_PERSISTENT:
gimp_plug_in_def_add_procedure (plug_in->plug_in_def, proc);
break;

View File

@ -291,7 +291,7 @@ gimp_plug_in_manager_call_run (GimpPlugInManager *manager,
/* If this is an extension,
* wait for an installation-confirmation message
*/
if (GIMP_PROCEDURE (procedure)->proc_type == GIMP_PDB_PROC_TYPE_EXTENSION)
if (GIMP_PROCEDURE (procedure)->proc_type == GIMP_PDB_PROC_TYPE_PERSISTENT)
{
plug_in->ext_main_loop = g_main_loop_new (NULL, FALSE);

View File

@ -556,7 +556,7 @@ gimp_plug_in_manager_run_extensions (GimpPlugInManager *manager,
GimpPlugInProcedure *proc = list->data;
if (proc->file &&
GIMP_PROCEDURE (proc)->proc_type == GIMP_PDB_PROC_TYPE_EXTENSION &&
GIMP_PROCEDURE (proc)->proc_type == GIMP_PDB_PROC_TYPE_PERSISTENT &&
GIMP_PROCEDURE (proc)->num_args == 0)
{
extensions = g_list_prepend (extensions, proc);

View File

@ -517,7 +517,7 @@ gimp_plug_in_procedure_new (GimpPDBProcType proc_type,
GimpPlugInProcedure *proc;
g_return_val_if_fail (proc_type == GIMP_PDB_PROC_TYPE_PLUGIN ||
proc_type == GIMP_PDB_PROC_TYPE_EXTENSION, NULL);
proc_type == GIMP_PDB_PROC_TYPE_PERSISTENT, NULL);
g_return_val_if_fail (G_IS_FILE (file), NULL);
proc = g_object_new (GIMP_TYPE_PLUG_IN_PROCEDURE, NULL);

View File

@ -405,7 +405,7 @@ plug_in_procedure_deserialize (GScanner *scanner,
}
if (proc_type != GIMP_PDB_PROC_TYPE_PLUGIN &&
proc_type != GIMP_PDB_PROC_TYPE_EXTENSION)
proc_type != GIMP_PDB_PROC_TYPE_PERSISTENT)
{
g_free (str);
g_scanner_error (scanner, "procedure type %d is out of range",

View File

@ -250,7 +250,7 @@ gimp_batch_procedure_new (GimpPlugIn *plug_in,
g_return_val_if_fail (gimp_is_canonical_identifier (name), NULL);
g_return_val_if_fail (interpreter_name != NULL && g_utf8_validate (interpreter_name, -1, NULL), NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_INTERNAL, NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_EXTENSION, NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_PERSISTENT, NULL);
g_return_val_if_fail (run_func != NULL, NULL);
procedure = g_object_new (GIMP_TYPE_BATCH_PROCEDURE,

View File

@ -645,7 +645,7 @@ gimp_export_procedure_new (GimpPlugIn *plug_in,
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), NULL);
g_return_val_if_fail (gimp_is_canonical_identifier (name), NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_INTERNAL, NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_EXTENSION, NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_PERSISTENT, NULL);
g_return_val_if_fail (run_func != NULL, NULL);
procedure = g_object_new (GIMP_TYPE_EXPORT_PROCEDURE,

View File

@ -276,7 +276,7 @@ gimp_image_procedure_new (GimpPlugIn *plug_in,
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), NULL);
g_return_val_if_fail (gimp_is_canonical_identifier (name), NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_INTERNAL, NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_EXTENSION, NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_PERSISTENT, NULL);
g_return_val_if_fail (run_func != NULL, NULL);
procedure = g_object_new (GIMP_TYPE_IMAGE_PROCEDURE,

View File

@ -354,7 +354,7 @@ gimp_load_procedure_new (GimpPlugIn *plug_in,
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), NULL);
g_return_val_if_fail (gimp_is_canonical_identifier (name), NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_INTERNAL, NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_EXTENSION, NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_PERSISTENT, NULL);
g_return_val_if_fail (run_func != NULL, NULL);
procedure = g_object_new (GIMP_TYPE_LOAD_PROCEDURE,

View File

@ -542,7 +542,7 @@ gimp_plug_in_add_menu_branch (GimpPlugIn *plug_in,
* @procedure: A #GimpProcedure of type %GIMP_PDB_PROC_TYPE_TEMPORARY.
*
* This function adds a temporary procedure to @plug_in. It is usually
* called from a %GIMP_PDB_PROC_TYPE_EXTENSION procedure's
* called from a %GIMP_PDB_PROC_TYPE_PERSISTENT procedure's
* [vfunc@Procedure.run].
*
* A temporary procedure is a procedure which is only available while
@ -696,7 +696,7 @@ gimp_plug_in_get_temp_procedure (GimpPlugIn *plug_in,
* must call [method@PlugIn.extension_enable].
*
* Note that the plug-in does not need to be a
* [enum@Gimp.PDBProcType.EXTENSION] to register temporary procedures.
* [enum@Gimp.PDBProcType.PERSISTENT] to register temporary procedures.
*
* See also: [method@PlugIn.add_temp_procedure].
*
@ -1631,7 +1631,7 @@ gimp_plug_in_temp_run_cleanup (GimpPlugIn *plug_in)
/* When at top of proc stack and top is an extension, destroy proxies. */
if ((g_list_length (priv->procedure_stack) == 1) &&
(gimp_procedure_get_proc_type (priv->procedure_stack->data) == GIMP_PDB_PROC_TYPE_EXTENSION))
(gimp_procedure_get_proc_type (priv->procedure_stack->data) == GIMP_PDB_PROC_TYPE_PERSISTENT))
{
g_debug ("%s top of proc stack is extension, destroy proxies.", G_STRFUNC);
gimp_plug_in_destroy_all_proxies (plug_in);

View File

@ -618,18 +618,18 @@ gimp_procedure_create_config_with_prefix (GimpProcedure *procedure,
*
* @proc_type should be %GIMP_PDB_PROC_TYPE_PLUGIN for "normal" plug-ins.
*
* Using %GIMP_PDB_PROC_TYPE_EXTENSION means that the plug-in will add
* Using %GIMP_PDB_PROC_TYPE_PERSISTENT means that the plug-in will add
* temporary procedures. Therefore, the GIMP core will wait until the
* %GIMP_PDB_PROC_TYPE_EXTENSION procedure has called
* %GIMP_PDB_PROC_TYPE_PERSISTENT procedure has called
* [method@Procedure.extension_ready], which means that the procedure
* has done its initialization, installed its temporary procedures and
* is ready to run.
*
* *Not calling [method@Procedure.extension_ready] from a
* %GIMP_PDB_PROC_TYPE_EXTENSION procedure will cause the GIMP core to
* %GIMP_PDB_PROC_TYPE_PERSISTENT procedure will cause the GIMP core to
* lock up.*
*
* Additionally, a %GIMP_PDB_PROC_TYPE_EXTENSION procedure with no
* Additionally, a %GIMP_PDB_PROC_TYPE_PERSISTENT procedure with no
* arguments added is an "automatic" extension that will be
* automatically started on each GIMP startup.
*
@ -639,7 +639,7 @@ gimp_procedure_create_config_with_prefix (GimpProcedure *procedure,
*
* @run_func is called via [method@Procedure.run].
*
* For %GIMP_PDB_PROC_TYPE_PLUGIN and %GIMP_PDB_PROC_TYPE_EXTENSION
* For %GIMP_PDB_PROC_TYPE_PLUGIN and %GIMP_PDB_PROC_TYPE_PERSISTENT
* procedures the call of @run_func is basically the lifetime of the
* plug-in.
*
@ -2174,7 +2174,7 @@ _gimp_procedure_run_array (GimpProcedure *procedure,
* properly initialized and is ready to run.
*
* This function _must_ be called from every procedure's [callback@RunFunc]
* that was created as #GIMP_PDB_PROC_TYPE_EXTENSION.
* that was created as #GIMP_PDB_PROC_TYPE_PERSISTENT.
*
* Subsequently, extensions can process temporary procedure run
* requests using either [method@PlugIn.extension_enable] or
@ -2194,7 +2194,7 @@ gimp_procedure_extension_ready (GimpProcedure *procedure)
priv = gimp_procedure_get_instance_private (procedure);
g_return_if_fail (priv->proc_type == GIMP_PDB_PROC_TYPE_EXTENSION);
g_return_if_fail (priv->proc_type == GIMP_PDB_PROC_TYPE_PERSISTENT);
plug_in = gimp_procedure_get_plug_in (procedure);

View File

@ -268,7 +268,7 @@ gimp_thumbnail_procedure_new (GimpPlugIn *plug_in,
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), NULL);
g_return_val_if_fail (gimp_is_canonical_identifier (name), NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_INTERNAL, NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_EXTENSION, NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_PERSISTENT, NULL);
g_return_val_if_fail (run_func != NULL, NULL);
procedure = g_object_new (GIMP_TYPE_THUMBNAIL_PROCEDURE,

View File

@ -509,7 +509,7 @@ gimp_vector_load_procedure_new (GimpPlugIn *plug_in,
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), NULL);
g_return_val_if_fail (gimp_is_canonical_identifier (name), NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_INTERNAL, NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_EXTENSION, NULL);
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_PERSISTENT, NULL);
g_return_val_if_fail (run_func != NULL, NULL);
procedure = g_object_new (GIMP_TYPE_VECTOR_LOAD_PROCEDURE,

View File

@ -1246,7 +1246,7 @@ gimp_pdb_proc_type_get_type (void)
{
{ GIMP_PDB_PROC_TYPE_INTERNAL, "GIMP_PDB_PROC_TYPE_INTERNAL", "internal" },
{ GIMP_PDB_PROC_TYPE_PLUGIN, "GIMP_PDB_PROC_TYPE_PLUGIN", "plugin" },
{ GIMP_PDB_PROC_TYPE_EXTENSION, "GIMP_PDB_PROC_TYPE_EXTENSION", "extension" },
{ GIMP_PDB_PROC_TYPE_PERSISTENT, "GIMP_PDB_PROC_TYPE_PERSISTENT", "persistent" },
{ GIMP_PDB_PROC_TYPE_TEMPORARY, "GIMP_PDB_PROC_TYPE_TEMPORARY", "temporary" },
{ 0, NULL, NULL }
};
@ -1255,7 +1255,7 @@ gimp_pdb_proc_type_get_type (void)
{
{ GIMP_PDB_PROC_TYPE_INTERNAL, NC_("pdb-proc-type", "Internal GIMP procedure"), NULL },
{ GIMP_PDB_PROC_TYPE_PLUGIN, NC_("pdb-proc-type", "GIMP Plug-In"), NULL },
{ GIMP_PDB_PROC_TYPE_EXTENSION, NC_("pdb-proc-type", "GIMP Extension"), NULL },
{ GIMP_PDB_PROC_TYPE_PERSISTENT, NC_("pdb-proc-type", "GIMP Persistent Plug-In"), NULL },
{ GIMP_PDB_PROC_TYPE_TEMPORARY, NC_("pdb-proc-type", "Temporary Procedure"), NULL },
{ 0, NULL, NULL }
};

View File

@ -826,10 +826,10 @@ typedef enum
/**
* GimpPDBProcType:
* @GIMP_PDB_PROC_TYPE_INTERNAL: Internal GIMP procedure
* @GIMP_PDB_PROC_TYPE_PLUGIN: GIMP Plug-In
* @GIMP_PDB_PROC_TYPE_EXTENSION: GIMP Extension
* @GIMP_PDB_PROC_TYPE_TEMPORARY: Temporary Procedure
* @GIMP_PDB_PROC_TYPE_INTERNAL: Internal GIMP procedure
* @GIMP_PDB_PROC_TYPE_PLUGIN: GIMP Plug-In
* @GIMP_PDB_PROC_TYPE_PERSISTENT: GIMP Persistent Plug-in
* @GIMP_PDB_PROC_TYPE_TEMPORARY: Temporary Procedure
*
* Types of PDB procedures.
**/
@ -841,7 +841,7 @@ typedef enum
{
GIMP_PDB_PROC_TYPE_INTERNAL, /*< desc="Internal GIMP procedure" >*/
GIMP_PDB_PROC_TYPE_PLUGIN, /*< desc="GIMP Plug-In" >*/
GIMP_PDB_PROC_TYPE_EXTENSION, /*< desc="GIMP Extension" >*/
GIMP_PDB_PROC_TYPE_PERSISTENT, /*< desc="GIMP Persistent Plug-In" >*/
GIMP_PDB_PROC_TYPE_TEMPORARY /*< desc="Temporary Procedure" >*/
} GimpPDBProcType;

View File

@ -391,11 +391,11 @@ package Gimp::CodeGen::enums;
header => 'libgimpbase/gimpbaseenums.h',
symbols => [ qw(GIMP_PDB_PROC_TYPE_INTERNAL
GIMP_PDB_PROC_TYPE_PLUGIN
GIMP_PDB_PROC_TYPE_EXTENSION
GIMP_PDB_PROC_TYPE_PERSISTENT
GIMP_PDB_PROC_TYPE_TEMPORARY) ],
mapping => { GIMP_PDB_PROC_TYPE_INTERNAL => '0',
GIMP_PDB_PROC_TYPE_PLUGIN => '1',
GIMP_PDB_PROC_TYPE_EXTENSION => '2',
GIMP_PDB_PROC_TYPE_PERSISTENT => '2',
GIMP_PDB_PROC_TYPE_TEMPORARY => '3' }
},
GimpPDBStatusType =>

View File

@ -87,7 +87,7 @@ help_browser_create_procedure (GimpPlugIn *plug_in,
if (! strcmp (name, GIMP_HELP_BROWSER_EXT_PROC))
{
procedure = gimp_procedure_new (plug_in, name,
GIMP_PDB_PROC_TYPE_EXTENSION,
GIMP_PDB_PROC_TYPE_PERSISTENT,
help_browser_run, plug_in, NULL);
gimp_procedure_set_documentation (procedure,

View File

@ -127,7 +127,7 @@ help_create_procedure (GimpPlugIn *plug_in,
if (! strcmp (name, GIMP_HELP_EXT_PROC))
{
procedure = gimp_procedure_new (plug_in, name,
GIMP_PDB_PROC_TYPE_EXTENSION,
GIMP_PDB_PROC_TYPE_PERSISTENT,
help_run, NULL, NULL);
gimp_procedure_set_attribution (procedure,

View File

@ -97,7 +97,7 @@ script_fu_create_procedure (GimpPlugIn *plug_in,
if (! strcmp (name, "extension-script-fu"))
{
procedure = gimp_procedure_new (plug_in, name,
GIMP_PDB_PROC_TYPE_EXTENSION,
GIMP_PDB_PROC_TYPE_PERSISTENT,
script_fu_run, NULL, NULL);
gimp_procedure_set_documentation (procedure,