[gimp] libgmp: reorder GimpPlugIn's query(), init(), quit()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgmp: reorder GimpPlugIn's query(), init(), quit()
- Date: Fri, 2 Aug 2019 10:06:07 +0000 (UTC)
commit 1e2efcf95e3b470a878a06e12ebce739ffe9fc35
Author: Michael Natterer <mitch gimp org>
Date: Fri Aug 2 12:05:28 2019 +0200
libgmp: reorder GimpPlugIn's query(), init(), quit()
in plug-in lifecycle order.
libgimp/gimpplugin-private.c | 12 ++++++------
libgimp/gimpplugin-private.h | 2 +-
libgimp/gimpplugin.h | 46 ++++++++++++++++++++++----------------------
3 files changed, 30 insertions(+), 30 deletions(-)
---
diff --git a/libgimp/gimpplugin-private.c b/libgimp/gimpplugin-private.c
index 0142cacf36..76c4e2b144 100644
--- a/libgimp/gimpplugin-private.c
+++ b/libgimp/gimpplugin-private.c
@@ -44,25 +44,25 @@ static void gimp_plug_in_temp_proc_run (GimpPlugIn *plug_in,
/* public functions */
void
-_gimp_plug_in_init (GimpPlugIn *plug_in)
+_gimp_plug_in_query (GimpPlugIn *plug_in)
{
g_return_if_fail (GIMP_IS_PLUG_IN (plug_in));
- if (! GIMP_PLUG_IN_GET_CLASS (plug_in)->init_procedures)
+ if (! GIMP_PLUG_IN_GET_CLASS (plug_in)->query_procedures)
return;
- gimp_plug_in_register (plug_in, TRUE);
+ gimp_plug_in_register (plug_in, FALSE);
}
void
-_gimp_plug_in_query (GimpPlugIn *plug_in)
+_gimp_plug_in_init (GimpPlugIn *plug_in)
{
g_return_if_fail (GIMP_IS_PLUG_IN (plug_in));
- if (! GIMP_PLUG_IN_GET_CLASS (plug_in)->query_procedures)
+ if (! GIMP_PLUG_IN_GET_CLASS (plug_in)->init_procedures)
return;
- gimp_plug_in_register (plug_in, FALSE);
+ gimp_plug_in_register (plug_in, TRUE);
}
void
diff --git a/libgimp/gimpplugin-private.h b/libgimp/gimpplugin-private.h
index 910f0bc0d9..347e243b7e 100644
--- a/libgimp/gimpplugin-private.h
+++ b/libgimp/gimpplugin-private.h
@@ -49,8 +49,8 @@ struct _GimpPlugInPrivate
};
-void _gimp_plug_in_init (GimpPlugIn *plug_in);
void _gimp_plug_in_query (GimpPlugIn *plug_in);
+void _gimp_plug_in_init (GimpPlugIn *plug_in);
void _gimp_plug_in_quit (GimpPlugIn *plug_in);
gboolean _gimp_plug_in_extension_read (GIOChannel *channel,
diff --git a/libgimp/gimpplugin.h b/libgimp/gimpplugin.h
index 3ae9fb44d9..a82bda55c9 100644
--- a/libgimp/gimpplugin.h
+++ b/libgimp/gimpplugin.h
@@ -54,13 +54,23 @@ struct _GimpPlugInClass
GObjectClass parent_class;
/**
- * GimpPlugInClass::quit:
+ * GimpPlugInClass::query_procedures:
* @plug_in: a #GimpPlugIn.
+ * @n_procedures: (out): number of procedures.
*
- * This method can be overridden by a plug-in which needs to perform
- * some actions upon quitting.
+ * This method can be overridden by all plug-ins to return a newly
+ * allocated array of allocated strings naming the procedures
+ * registered by this plug-in.
+ * This array of strings must be NULL-terminated (i.e. freeable by
+ * g_strfreev()).
+ *
+ * See documentation of init_procedures() for differences.
+ *
+ * Returns: (array length=n_procedures) (transfer full):
+ * the names of the procedures registered by @plug_in.
*/
- void (* quit) (GimpPlugIn *plug_in);
+ gchar ** (* query_procedures) (GimpPlugIn *plug_in,
+ gint *n_procedures);
/**
* GimpPlugInClass::init_procedures:
@@ -87,25 +97,6 @@ struct _GimpPlugInClass
*/
gchar ** (* init_procedures) (GimpPlugIn *plug_in,
gint *n_procedures);
- /**
- * GimpPlugInClass::query_procedures:
- * @plug_in: a #GimpPlugIn.
- * @n_procedures: (out): number of procedures.
- *
- * This method can be overridden by all plug-ins to return a newly
- * allocated array of allocated strings naming the procedures
- * registered by this plug-in.
- * This array of strings must be NULL-terminated (i.e. freeable by
- * g_strfreev()).
- *
- * See documentation of init_procedures() for differences.
- *
- * Returns: (array length=n_procedures) (transfer full):
- * the names of the procedures registered by @plug_in.
- */
- gchar ** (* query_procedures) (GimpPlugIn *plug_in,
- gint *n_procedures);
-
/**
* GimpPlugInClass::create_procedure:
* @plug_in: a #GimpPlugIn.
@@ -122,6 +113,15 @@ struct _GimpPlugInClass
GimpProcedure * (* create_procedure) (GimpPlugIn *plug_in,
const gchar *name);
+ /**
+ * GimpPlugInClass::quit:
+ * @plug_in: a #GimpPlugIn.
+ *
+ * This method can be overridden by a plug-in which needs to perform
+ * some actions upon quitting.
+ */
+ void (* quit) (GimpPlugIn *plug_in);
+
/* Padding for future expansion */
void (* _gimp_reserved1) (void);
void (* _gimp_reserved2) (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]