mirror of https://github.com/GNOME/gimp.git
libgimp: remove gimp_plug_in_create_procedure() from the API
no plug-in code ever needs to call it.
This commit is contained in:
parent
34489d1b13
commit
a20fb094d9
|
@ -666,7 +666,6 @@ EXPORTS
|
|||
gimp_pencil
|
||||
gimp_plug_in_add_menu_branch
|
||||
gimp_plug_in_add_temp_procedure
|
||||
gimp_plug_in_create_procedure
|
||||
gimp_plug_in_extension_enable
|
||||
gimp_plug_in_extension_process
|
||||
gimp_plug_in_get_pdb_error_handler
|
||||
|
|
|
@ -37,6 +37,9 @@ void _gimp_plug_in_read_expect_msg (GimpPlugIn *plug_in,
|
|||
GimpWireMessage *msg,
|
||||
gint type);
|
||||
|
||||
GimpProcedure * _gimp_plug_in_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *procedure_name);
|
||||
|
||||
GimpProcedure * _gimp_plug_in_get_procedure (GimpPlugIn *plug_in);
|
||||
|
||||
GimpDisplay * _gimp_plug_in_get_display (GimpPlugIn *plug_in,
|
||||
|
|
|
@ -466,35 +466,6 @@ gimp_plug_in_add_menu_branch (GimpPlugIn *plug_in,
|
|||
branch);
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_plug_in_create_procedure:
|
||||
* @plug_in: A #GimpPlugIn
|
||||
* @procedure_name: A procedure name.
|
||||
*
|
||||
* This function creates a new procedure and is called when a plug-in
|
||||
* instance is started by GIMP when one of the %GIMP_PDB_PROC_TYPE_PLUGIN or
|
||||
* %GIMP_PDB_PROC_TYPE_EXTENSION procedures it implements is invoked.
|
||||
*
|
||||
* This function will only ever be called with names returned by
|
||||
* implementations of #GimpPlugInClass.init_procedures() or
|
||||
* #GimpPlugInClass.query_procedures().
|
||||
*
|
||||
* Returns: (transfer full): The newly created #GimpProcedure.
|
||||
**/
|
||||
GimpProcedure *
|
||||
gimp_plug_in_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *procedure_name)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), NULL);
|
||||
g_return_val_if_fail (gimp_is_canonical_identifier (procedure_name), NULL);
|
||||
|
||||
if (GIMP_PLUG_IN_GET_CLASS (plug_in)->create_procedure)
|
||||
return GIMP_PLUG_IN_GET_CLASS (plug_in)->create_procedure (plug_in,
|
||||
procedure_name);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_plug_in_add_temp_procedure:
|
||||
* @plug_in: A #GimpPlugIn
|
||||
|
@ -898,6 +869,20 @@ _gimp_plug_in_read_expect_msg (GimpPlugIn *plug_in,
|
|||
}
|
||||
}
|
||||
|
||||
GimpProcedure *
|
||||
_gimp_plug_in_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *procedure_name)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), NULL);
|
||||
g_return_val_if_fail (gimp_is_canonical_identifier (procedure_name), NULL);
|
||||
|
||||
if (GIMP_PLUG_IN_GET_CLASS (plug_in)->create_procedure)
|
||||
return GIMP_PLUG_IN_GET_CLASS (plug_in)->create_procedure (plug_in,
|
||||
procedure_name);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
|
@ -912,7 +897,7 @@ gimp_plug_in_register (GimpPlugIn *plug_in,
|
|||
const gchar *name = list->data;
|
||||
GimpProcedure *procedure;
|
||||
|
||||
procedure = gimp_plug_in_create_procedure (plug_in, name);
|
||||
procedure = _gimp_plug_in_create_procedure (plug_in, name);
|
||||
if (procedure)
|
||||
{
|
||||
GIMP_PROCEDURE_GET_CLASS (procedure)->install (procedure);
|
||||
|
@ -1174,7 +1159,7 @@ gimp_plug_in_proc_run (GimpPlugIn *plug_in,
|
|||
GPProcReturn proc_return;
|
||||
GimpProcedure *procedure;
|
||||
|
||||
procedure = gimp_plug_in_create_procedure (plug_in, proc_run->name);
|
||||
procedure = _gimp_plug_in_create_procedure (plug_in, proc_run->name);
|
||||
|
||||
if (procedure)
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ struct _GimpPlugIn
|
|||
/**
|
||||
* GimpPlugInClass:
|
||||
* @query_procedures: This method can be overridden by all plug-ins to
|
||||
* return a newly allocated GList of allocated strings naming the
|
||||
* return a newly allocated #GList of allocated strings naming the
|
||||
* procedures registered by this plug-in. See documentation of
|
||||
* #GimpPlugInClass.init_procedures() for differences.
|
||||
* @init_procedures: This method can be overridden by all plug-ins to
|
||||
|
@ -64,12 +64,13 @@ struct _GimpPlugIn
|
|||
* #GimpPlugInClass.init_procedures() typically returns procedures
|
||||
* dependent to runtime conditions (such as the presence of a
|
||||
* third-party tool), whereas #GimpPlugInClass.query_procedures()
|
||||
* would usually return unconditional and always available procedures.
|
||||
* would usually return procedures that are always available
|
||||
* unconditionally.
|
||||
* Most of the time, you only want to override
|
||||
* #GimpPlugInClass.query_procedures() and leave
|
||||
* #GimpPlugInClass.init_procedures() untouched.
|
||||
* @create_procedure: This method should be overridden by all plug-ins
|
||||
* and return a newly allocated #GimpProcedure named @name. It will
|
||||
* @create_procedure: This method must be overridden by all plug-ins
|
||||
* and return a newly allocated #GimpProcedure named @name. It will
|
||||
* be called for every @name as returned by
|
||||
* #GimpPlugInClass.query_procedures() and
|
||||
* #GimpPlugInClass.init_procedures() so care must be taken to handle
|
||||
|
@ -116,9 +117,6 @@ void gimp_plug_in_add_menu_branch (GimpPlugIn *plug_in,
|
|||
const gchar *menu_path,
|
||||
const gchar *menu_label);
|
||||
|
||||
GimpProcedure * gimp_plug_in_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *procedure_name);
|
||||
|
||||
void gimp_plug_in_add_temp_procedure (GimpPlugIn *plug_in,
|
||||
GimpProcedure *procedure);
|
||||
void gimp_plug_in_remove_temp_procedure (GimpPlugIn *plug_in,
|
||||
|
|
Loading…
Reference in New Issue