[gimp/wip/nielsdg/vtable-typedefs] gir: Make use of typedefs for GimpProgressVtable vfuncs
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/nielsdg/vtable-typedefs] gir: Make use of typedefs for GimpProgressVtable vfuncs
- Date: Wed, 6 May 2020 10:40:33 +0000 (UTC)
commit ab47e5cdafc876731caa5a29a52255a7bc05f779
Author: Niels De Graef <nielsdegraef gmail com>
Date: Tue May 5 19:19:17 2020 +0200
gir: Make use of typedefs for GimpProgressVtable vfuncs
GObject introspection has issues handling random vfuncs (i.e. not part
of a GObject). Most of all, it needs to be able to give these a name
(so they can be used to cast in some higher level languages for
example). As such, give each vfunc in `GimpProgressVtable` a separate
typedef.
libgimp/gimpprogress.h | 73 ++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 62 insertions(+), 11 deletions(-)
---
diff --git a/libgimp/gimpprogress.h b/libgimp/gimpprogress.h
index fdbb2089ed..113193d754 100644
--- a/libgimp/gimpprogress.h
+++ b/libgimp/gimpprogress.h
@@ -27,6 +27,62 @@
G_BEGIN_DECLS
+/**
+ * GimpProgressVtableStartFunc:
+ * @message:
+ * @cancelable:
+ * @user_data: (closure):
+ *
+ * Starts the progress
+ */
+typedef void (* GimpProgressVtableStartFunc) (const gchar *message,
+ gboolean cancelable,
+ gpointer user_data);
+
+/**
+ * GimpProgressVtableEndFunc:
+ * @user_data: (closure):
+ *
+ * Ends the progress
+ */
+typedef void (* GimpProgressVtableEndFunc) (gpointer user_data);
+
+/**
+ * GimpProgressVtableSetTextFunc:
+ * @message:
+ * @user_data: (closure):
+ *
+ * Sets a new text on the progress.
+ */
+typedef void (* GimpProgressVtableSetTextFunc) (const gchar *message,
+ gpointer user_data);
+
+/**
+ * GimpProgressVtableSetValueFunc:
+ * @percentage:
+ * @user_data: (closure):
+ *
+ * Sets a new percentage on the progress.
+ */
+typedef void (* GimpProgressVtableSetValueFunc) (gdouble percentage,
+ gpointer user_data);
+
+/**
+ * GimpProgressVtablePulseFunc:
+ * @user_data: (closure):
+ *
+ * Makes the progress pulse
+ */
+typedef void (* GimpProgressVtablePulseFunc) (gpointer user_data);
+
+/**
+ * GimpProgressVtableGetWindowFunc:
+ * @user_data: (closure):
+ *
+ * Returns: the ID of the window where the progress is displayed.
+ */
+typedef guint32 (* GimpProgressVtableGetWindowFunc) (gpointer user_data);
+
typedef struct _GimpProgressVtable GimpProgressVtable;
@@ -49,17 +105,12 @@ typedef struct _GimpProgressVtable GimpProgressVtable;
**/
struct _GimpProgressVtable
{
- void (* start) (const gchar *message,
- gboolean cancelable,
- gpointer user_data);
- void (* end) (gpointer user_data);
- void (* set_text) (const gchar *message,
- gpointer user_data);
- void (* set_value) (gdouble percentage,
- gpointer user_data);
- void (* pulse) (gpointer user_data);
-
- guint32 (* get_window) (gpointer user_data);
+ GimpProgressVtableStartFunc start;
+ GimpProgressVtableEndFunc end;
+ GimpProgressVtableSetTextFunc set_text;
+ GimpProgressVtableSetValueFunc set_value;
+ GimpProgressVtablePulseFunc pulse;
+ GimpProgressVtableGetWindowFunc get_window;
/* Padding for future expansion. Must be initialized with NULL! */
void (* _gimp_reserved1) (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]