libgimp, plug-ins: following up the renaming of GIMP_PDB_PROC_TYPE_EXTENSION…

… to GIMP_PDB_PROC_TYPE_PERSISTENT, let's rename some procedures.

s/gimp_plug_in_extension_enable/gimp_plug_in_persistent_enable/
s/gimp_plug_in_extension_process/gimp_plug_in_persistent_process/
s/gimp_procedure_extension_ready/gimp_procedure_persistent_ready/
This commit is contained in:
Jehan 2024-09-29 18:43:49 +02:00
parent a9bc4c6c1b
commit 596ce11b5c
12 changed files with 63 additions and 63 deletions

View file

@ -759,12 +759,12 @@ EXPORTS
gimp_plug_in_add_menu_branch gimp_plug_in_add_menu_branch
gimp_plug_in_add_temp_procedure gimp_plug_in_add_temp_procedure
gimp_plug_in_error_quark gimp_plug_in_error_quark
gimp_plug_in_extension_enable
gimp_plug_in_extension_process
gimp_plug_in_get_pdb_error_handler gimp_plug_in_get_pdb_error_handler
gimp_plug_in_get_temp_procedure gimp_plug_in_get_temp_procedure
gimp_plug_in_get_temp_procedures gimp_plug_in_get_temp_procedures
gimp_plug_in_get_type gimp_plug_in_get_type
gimp_plug_in_persistent_enable
gimp_plug_in_persistent_process
gimp_plug_in_remove_temp_procedure gimp_plug_in_remove_temp_procedure
gimp_plug_in_set_help_domain gimp_plug_in_set_help_domain
gimp_plug_in_set_pdb_error_handler gimp_plug_in_set_pdb_error_handler
@ -882,7 +882,6 @@ EXPORTS
gimp_procedure_config_save_default gimp_procedure_config_save_default
gimp_procedure_config_save_metadata gimp_procedure_config_save_metadata
gimp_procedure_create_config gimp_procedure_create_config
gimp_procedure_extension_ready
gimp_procedure_find_argument gimp_procedure_find_argument
gimp_procedure_find_aux_argument gimp_procedure_find_aux_argument
gimp_procedure_find_return_value gimp_procedure_find_return_value
@ -910,6 +909,7 @@ EXPORTS
gimp_procedure_get_type gimp_procedure_get_type
gimp_procedure_new gimp_procedure_new
gimp_procedure_new_return_values gimp_procedure_new_return_values
gimp_procedure_persistent_ready
gimp_procedure_run gimp_procedure_run
gimp_procedure_run_config gimp_procedure_run_config
gimp_procedure_run_valist gimp_procedure_run_valist

View file

@ -528,7 +528,7 @@ gimp_drawable_chooser_clicked (GimpDrawableChooser *chooser)
g_type_name (chooser->drawable_type), chooser->drawable, handle)) g_type_name (chooser->drawable_type), chooser->drawable, handle))
{ {
/* Allow callbacks to be watched */ /* Allow callbacks to be watched */
gimp_plug_in_extension_enable (plug_in); gimp_plug_in_persistent_enable (plug_in);
chooser->callback = g_strdup (gimp_procedure_get_name (callback_procedure)); chooser->callback = g_strdup (gimp_procedure_get_name (callback_procedure));
} }

View file

@ -138,7 +138,7 @@ typedef struct _GimpPlugInPrivate
gchar write_buffer[WRITE_BUFFER_SIZE]; gchar write_buffer[WRITE_BUFFER_SIZE];
gulong write_buffer_index; gulong write_buffer_index;
guint extension_source_id; guint persistent_source_id;
gchar *translation_domain_name; gchar *translation_domain_name;
GFile *translation_domain_path; GFile *translation_domain_path;
@ -204,7 +204,7 @@ static void gimp_plug_in_proc_run_internal (GimpPlugIn *plug_in,
GPProcRun *proc_run, GPProcRun *proc_run,
GimpProcedure *procedure, GimpProcedure *procedure,
GPProcReturn *proc_return); GPProcReturn *proc_return);
static gboolean gimp_plug_in_extension_read (GIOChannel *channel, static gboolean gimp_plug_in_persistent_read (GIOChannel *channel,
GIOCondition condition, GIOCondition condition,
gpointer data); gpointer data);
@ -329,10 +329,10 @@ gimp_plug_in_dispose (GObject *object)
priv = gimp_plug_in_get_instance_private (plug_in); priv = gimp_plug_in_get_instance_private (plug_in);
if (priv->extension_source_id) if (priv->persistent_source_id)
{ {
g_source_remove (priv->extension_source_id); g_source_remove (priv->persistent_source_id);
priv->extension_source_id = 0; priv->persistent_source_id = 0;
} }
if (priv->temp_procedures) if (priv->temp_procedures)
@ -554,9 +554,9 @@ gimp_plug_in_add_menu_branch (GimpPlugIn *plug_in,
* NOTE: Normally, plug-in communication is triggered by the plug-in * NOTE: Normally, plug-in communication is triggered by the plug-in
* and the GIMP core only responds to the plug-in's requests. You must * and the GIMP core only responds to the plug-in's requests. You must
* explicitly enable receiving of temporary procedure run requests * explicitly enable receiving of temporary procedure run requests
* using either [method@PlugIn.extension_enable] or * using either [method@PlugIn.persistent_enable] or
* [method@PlugIn.extension_process]. See their respective documentation * [method@PlugIn.persistent_process]. See their respective
* for details. * documentation for details.
* *
* Since: 3.0 * Since: 3.0
**/ **/
@ -675,7 +675,7 @@ gimp_plug_in_get_temp_procedure (GimpPlugIn *plug_in,
} }
/** /**
* gimp_plug_in_extension_enable: * gimp_plug_in_persistent_enable:
* @plug_in: A plug-in * @plug_in: A plug-in
* *
* Enables asynchronous processing of messages from the main GIMP * Enables asynchronous processing of messages from the main GIMP
@ -689,11 +689,11 @@ gimp_plug_in_get_temp_procedure (GimpPlugIn *plug_in,
* If the plug-in however registered temporary procedures using * If the plug-in however registered temporary procedures using
* [method@PlugIn.add_temp_procedure], it needs to be able to receive * [method@PlugIn.add_temp_procedure], it needs to be able to receive
* requests to execute them. Usually this will be done by running * requests to execute them. Usually this will be done by running
* [method@PlugIn.extension_process] in an endless loop. * [method@PlugIn.persistent_process] in an endless loop.
* *
* If the plug-in cannot use [method@PlugIn.extension_process], i.e. if * If the plug-in cannot use [method@PlugIn.persistent_process], i.e. if
* it has a GUI and is hanging around in a [struct@GLib.MainLoop], it * it has a GUI and is hanging around in a [struct@GLib.MainLoop], it
* must call [method@PlugIn.extension_enable]. * must call [method@PlugIn.persistent_enable].
* *
* Note that the plug-in does not need to be a * Note that the plug-in does not need to be a
* [enum@Gimp.PDBProcType.PERSISTENT] to register temporary procedures. * [enum@Gimp.PDBProcType.PERSISTENT] to register temporary procedures.
@ -703,7 +703,7 @@ gimp_plug_in_get_temp_procedure (GimpPlugIn *plug_in,
* Since: 3.0 * Since: 3.0
**/ **/
void void
gimp_plug_in_extension_enable (GimpPlugIn *plug_in) gimp_plug_in_persistent_enable (GimpPlugIn *plug_in)
{ {
GimpPlugInPrivate *priv; GimpPlugInPrivate *priv;
@ -711,27 +711,27 @@ gimp_plug_in_extension_enable (GimpPlugIn *plug_in)
priv = gimp_plug_in_get_instance_private (plug_in); priv = gimp_plug_in_get_instance_private (plug_in);
if (! priv->extension_source_id) if (! priv->persistent_source_id)
{ {
priv->extension_source_id = priv->persistent_source_id =
g_io_add_watch (priv->read_channel, G_IO_IN | G_IO_PRI, g_io_add_watch (priv->read_channel, G_IO_IN | G_IO_PRI,
gimp_plug_in_extension_read, gimp_plug_in_persistent_read,
plug_in); plug_in);
} }
} }
/** /**
* gimp_plug_in_extension_process: * gimp_plug_in_persistent_process:
* @plug_in: A plug-in. * @plug_in: A plug-in.
* @timeout: The timeout (in ms) to use for the select() call. * @timeout: The timeout (in ms) to use for the select() call.
* *
* Processes one message sent by GIMP and returns. * Processes one message sent by GIMP and returns.
* *
* Call this function in an endless loop after calling * Call this function in an endless loop after calling
* gimp_procedure_extension_ready() to process requests for running * [method@Gimp.Procedure.persistent_ready] to process requests for
* temporary procedures. * running temporary procedures.
* *
* See [method@PlugIn.extension_enable] for an asynchronous way of * See [method@PlugIn.persistent_enable] for an asynchronous way of
* doing the same if running an endless loop is not an option. * doing the same if running an endless loop is not an option.
* *
* See also: [method@PlugIn.add_temp_procedure]. * See also: [method@PlugIn.add_temp_procedure].
@ -739,8 +739,8 @@ gimp_plug_in_extension_enable (GimpPlugIn *plug_in)
* Since: 3.0 * Since: 3.0
**/ **/
void void
gimp_plug_in_extension_process (GimpPlugIn *plug_in, gimp_plug_in_persistent_process (GimpPlugIn *plug_in,
guint timeout) guint timeout)
{ {
GimpPlugInPrivate *priv; GimpPlugInPrivate *priv;
#ifndef G_OS_WIN32 #ifndef G_OS_WIN32
@ -783,7 +783,7 @@ gimp_plug_in_extension_process (GimpPlugIn *plug_in,
} }
else if (select_val == -1 && errno != EINTR) else if (select_val == -1 && errno != EINTR)
{ {
perror ("gimp_plug_in_extension_process"); perror ("gimp_plug_in_persistent_process");
gimp_quit (); gimp_quit ();
} }
} }
@ -1546,9 +1546,9 @@ gimp_plug_in_proc_run_internal (GimpPlugIn *plug_in,
} }
static gboolean static gboolean
gimp_plug_in_extension_read (GIOChannel *channel, gimp_plug_in_persistent_read (GIOChannel *channel,
GIOCondition condition, GIOCondition condition,
gpointer data) gpointer data)
{ {
GimpPlugIn *plug_in = data; GimpPlugIn *plug_in = data;
@ -1619,28 +1619,28 @@ gimp_plug_in_main_run_cleanup (GimpPlugIn *plug_in)
/* After a run of a temp proc, cleanup. /* After a run of a temp proc, cleanup.
* We are about to return to another calling proc. * We are about to return to another calling proc.
* *
* When the just-run temp proc is returning to top proc on stack and it is an extension, * When the just-run temp proc is returning to top proc on stack and it
* cleanup is destroy the plugin's proxies. * is a persistent plug-in, cleanup is destroy the plugin's proxies.
* The proc stack is never empty for an extension: the top is e.g. extension-script-fu, * The proc stack is never empty for a persistent plug-in: the top is
* which must not reference proxies. * e.g. extension-script-fu, which must not reference proxies.
*/ */
static void static void
gimp_plug_in_temp_run_cleanup (GimpPlugIn *plug_in) gimp_plug_in_temp_run_cleanup (GimpPlugIn *plug_in)
{ {
GimpPlugInPrivate *priv = gimp_plug_in_get_instance_private (plug_in); GimpPlugInPrivate *priv = gimp_plug_in_get_instance_private (plug_in);
/* When at top of proc stack and top is an extension, destroy proxies. */ /* When at top of proc stack and top is a persistent plug-in, destroy proxies. */
if ((g_list_length (priv->procedure_stack) == 1) && if ((g_list_length (priv->procedure_stack) == 1) &&
(gimp_procedure_get_proc_type (priv->procedure_stack->data) == GIMP_PDB_PROC_TYPE_PERSISTENT)) (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); g_debug ("%s top of proc stack is a persistent plug-in, destroy proxies.", G_STRFUNC);
gimp_plug_in_destroy_all_proxies (plug_in); gimp_plug_in_destroy_all_proxies (plug_in);
gimp_plug_in_destroy_hashes (plug_in); gimp_plug_in_destroy_hashes (plug_in);
} }
else else
{ {
/* Normal. The temp proc just run was called by a calling proc /* Normal. The temp proc just run was called by a calling proc
* which is not a main proc of an extension plugin. * which is not a main proc of a persistent plug-in.
* We can't destroy proxies because the calling proc may retain a reference. * We can't destroy proxies because the calling proc may retain a reference.
*/ */
g_debug ("%s Not destroy proxies for temp proc.", G_STRFUNC); g_debug ("%s Not destroy proxies for temp proc.", G_STRFUNC);

View file

@ -203,8 +203,8 @@ GList * gimp_plug_in_get_temp_procedures (GimpPlugIn *plug_in);
GimpProcedure * gimp_plug_in_get_temp_procedure (GimpPlugIn *plug_in, GimpProcedure * gimp_plug_in_get_temp_procedure (GimpPlugIn *plug_in,
const gchar *procedure_name); const gchar *procedure_name);
void gimp_plug_in_extension_enable (GimpPlugIn *plug_in); void gimp_plug_in_persistent_enable (GimpPlugIn *plug_in);
void gimp_plug_in_extension_process (GimpPlugIn *plug_in, void gimp_plug_in_persistent_process (GimpPlugIn *plug_in,
guint timeout); guint timeout);
void gimp_plug_in_set_pdb_error_handler (GimpPlugIn *plug_in, void gimp_plug_in_set_pdb_error_handler (GimpPlugIn *plug_in,

View file

@ -616,16 +616,16 @@ gimp_procedure_create_config_with_prefix (GimpProcedure *procedure,
* overwrite an already existing procedure (overwrite procedures only * overwrite an already existing procedure (overwrite procedures only
* if you know what you're doing). * if you know what you're doing).
* *
* @proc_type should be %GIMP_PDB_PROC_TYPE_PLUGIN for "normal" plug-ins. * @proc_type should be [enum@Gimp.PDBProcType.PLUGIN] for "normal" plug-ins.
* *
* Using %GIMP_PDB_PROC_TYPE_PERSISTENT means that the plug-in will add * Using [enum@Gimp.PDBProcType.PERSISTENT] means that the plug-in will
* temporary procedures. Therefore, the GIMP core will wait until the * add temporary procedures. Therefore, the GIMP core will wait until
* %GIMP_PDB_PROC_TYPE_PERSISTENT procedure has called * the %GIMP_PDB_PROC_TYPE_PERSISTENT procedure has called
* [method@Procedure.extension_ready], which means that the procedure * [method@Procedure.persistent_ready], which means that the procedure
* has done its initialization, installed its temporary procedures and * has done its initialization, installed its temporary procedures and
* is ready to run. * is ready to run.
* *
* *Not calling [method@Procedure.extension_ready] from a * *Not calling [method@Procedure.persistent_ready] from a
* %GIMP_PDB_PROC_TYPE_PERSISTENT procedure will cause the GIMP core to * %GIMP_PDB_PROC_TYPE_PERSISTENT procedure will cause the GIMP core to
* lock up.* * lock up.*
* *
@ -633,7 +633,7 @@ gimp_procedure_create_config_with_prefix (GimpProcedure *procedure,
* arguments added is an "automatic" extension that will be * arguments added is an "automatic" extension that will be
* automatically started on each GIMP startup. * automatically started on each GIMP startup.
* *
* %GIMP_PDB_PROC_TYPE_TEMPORARY must be used for temporary procedures * [enum@Gimp.PDBProcType.TEMPORARY] must be used for temporary procedures
* that are created during a plug-ins lifetime. They must be added to * that are created during a plug-ins lifetime. They must be added to
* the #GimpPlugIn using [method@PlugIn.add_temp_procedure]. * the #GimpPlugIn using [method@PlugIn.add_temp_procedure].
* *
@ -2167,25 +2167,25 @@ _gimp_procedure_run_array (GimpProcedure *procedure,
} }
/** /**
* gimp_procedure_extension_ready: * gimp_procedure_persistent_ready:
* @procedure: A #GimpProcedure * @procedure: A #GimpProcedure
* *
* Notify the main GIMP application that the extension has been * Notify the main GIMP application that the persistent procedure has
* properly initialized and is ready to run. * been properly initialized and is ready to run.
* *
* This function _must_ be called from every procedure's [callback@RunFunc] * This function _must_ be called from every procedure's [callback@RunFunc]
* that was created as #GIMP_PDB_PROC_TYPE_PERSISTENT. * that was created as [enum@Gimp.PDBProcType.PERSISTENT].
* *
* Subsequently, extensions can process temporary procedure run * Subsequently, extensions can process temporary procedure run
* requests using either [method@PlugIn.extension_enable] or * requests using either [method@PlugIn.persistent_enable] or
* [method@PlugIn.extension_process]. * [method@PlugIn.persistent_process].
* *
* See also: [ctor@Procedure.new]. * See also: [ctor@Procedure.new].
* *
* Since: 3.0 * Since: 3.0
**/ **/
void void
gimp_procedure_extension_ready (GimpProcedure *procedure) gimp_procedure_persistent_ready (GimpProcedure *procedure)
{ {
GimpProcedurePrivate *priv; GimpProcedurePrivate *priv;
GimpPlugIn *plug_in; GimpPlugIn *plug_in;

View file

@ -205,7 +205,7 @@ GimpValueArray * gimp_procedure_run_valist (GimpProcedure *proced
GimpValueArray * gimp_procedure_run_config (GimpProcedure *procedure, GimpValueArray * gimp_procedure_run_config (GimpProcedure *procedure,
GimpProcedureConfig *config); GimpProcedureConfig *config);
void gimp_procedure_extension_ready (GimpProcedure *procedure); void gimp_procedure_persistent_ready (GimpProcedure *procedure);
GimpProcedureConfig * GimpProcedureConfig *
gimp_procedure_create_config (GimpProcedure *procedure); gimp_procedure_create_config (GimpProcedure *procedure);

View file

@ -138,7 +138,7 @@ gimp_progress_install_vtable (const GimpProgressVtable *vtable,
if (_gimp_progress_install (progress_callback)) if (_gimp_progress_install (progress_callback))
{ {
/* Allow callbacks to be watched */ /* Allow callbacks to be watched */
gimp_plug_in_extension_enable (plug_in); gimp_plug_in_persistent_enable (plug_in);
return progress_callback; return progress_callback;
} }

View file

@ -305,7 +305,7 @@ _gimp_resource_select_new (const gchar *title,
if (popup_remote_chooser (title, parent_handle, resource, gimp_procedure_get_name (procedure), resource_type)) if (popup_remote_chooser (title, parent_handle, resource, gimp_procedure_get_name (procedure), resource_type))
{ {
/* Allow callbacks to be watched */ /* Allow callbacks to be watched */
gimp_plug_in_extension_enable (plug_in); gimp_plug_in_persistent_enable (plug_in);
return gimp_procedure_get_name (procedure); return gimp_procedure_get_name (procedure);
} }

View file

@ -182,8 +182,8 @@ help_browser_run (GimpProcedure *procedure,
temp_proc_install (gimp_procedure_get_plug_in (procedure)); temp_proc_install (gimp_procedure_get_plug_in (procedure));
gimp_procedure_extension_ready (procedure); gimp_procedure_persistent_ready (procedure);
gimp_plug_in_extension_enable (gimp_procedure_get_plug_in (procedure)); gimp_plug_in_persistent_enable (gimp_procedure_get_plug_in (procedure));
#if GLIB_CHECK_VERSION(2,74,0) #if GLIB_CHECK_VERSION(2,74,0)
browser->app = gtk_application_new (NULL, G_APPLICATION_DEFAULT_FLAGS); browser->app = gtk_application_new (NULL, G_APPLICATION_DEFAULT_FLAGS);

View file

@ -179,8 +179,8 @@ help_run (GimpProcedure *procedure,
help_temp_proc_install (plug_in); help_temp_proc_install (plug_in);
gimp_procedure_extension_ready (procedure); gimp_procedure_persistent_ready (procedure);
gimp_plug_in_extension_enable (plug_in); gimp_plug_in_persistent_enable (plug_in);
g_main_loop_run (main_loop); g_main_loop_run (main_loop);

View file

@ -309,7 +309,7 @@ print_image (GimpImage *image,
#ifndef EMBED_PAGE_SETUP #ifndef EMBED_PAGE_SETUP
print_operation = operation; print_operation = operation;
temp_proc = print_temp_proc_install (image); temp_proc = print_temp_proc_install (image);
gimp_plug_in_extension_enable (gimp_get_plug_in ()); gimp_plug_in_persistent_enable (gimp_get_plug_in ());
#endif #endif
if (interactive) if (interactive)

View file

@ -207,11 +207,11 @@ script_fu_run (GimpProcedure *procedure,
*/ */
/* Acknowledge that the extension is properly initialized */ /* Acknowledge that the extension is properly initialized */
gimp_procedure_extension_ready (procedure); gimp_procedure_persistent_ready (procedure);
/* Go into an endless loop */ /* Go into an endless loop */
while (TRUE) while (TRUE)
gimp_plug_in_extension_process (plug_in, 0); gimp_plug_in_persistent_process (plug_in, 0);
} }
else if (strcmp (name, "plug-in-script-fu-text-console") == 0) else if (strcmp (name, "plug-in-script-fu-text-console") == 0)
{ {