summaryrefslogtreecommitdiff
path: root/libpeas/peas-extension-set.h
diff options
context:
space:
mode:
authorChristian Hergert <chergert@redhat.com>2023-03-16 18:09:41 -0700
committerChristian Hergert <chergert@redhat.com>2023-03-22 16:44:35 -0700
commitd162dd3e0c416f9a9574bff94aa7048f924b30f4 (patch)
treeaf279f6bd1b3c998baecfecbb0784b13cf7fe551 /libpeas/peas-extension-set.h
parentc86039156c8afa90bd34425f0fe0d30a8a49b242 (diff)
downloadlibpeas-d162dd3e0c416f9a9574bff94aa7048f924b30f4.tar.gz
janitorial: modernize PeasExtensionSet definition
This should be a final type and therefore there is no need to have the class structure exposed or vtable entries for signals. Cleanup other bits of C style and Since macros too.
Diffstat (limited to 'libpeas/peas-extension-set.h')
-rw-r--r--libpeas/peas-extension-set.h97
1 files changed, 21 insertions, 76 deletions
diff --git a/libpeas/peas-extension-set.h b/libpeas/peas-extension-set.h
index 0a3f932..76538e8 100644
--- a/libpeas/peas-extension-set.h
+++ b/libpeas/peas-extension-set.h
@@ -34,57 +34,10 @@
G_BEGIN_DECLS
-/*
- * Type checking and casting macros
- */
-#define PEAS_TYPE_EXTENSION_SET (peas_extension_set_get_type())
-#define PEAS_EXTENSION_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PEAS_TYPE_EXTENSION_SET, PeasExtensionSet))
-#define PEAS_EXTENSION_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PEAS_TYPE_EXTENSION_SET, PeasExtensionSetClass))
-#define PEAS_IS_EXTENSION_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PEAS_TYPE_EXTENSION_SET))
-#define PEAS_IS_EXTENSION_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PEAS_TYPE_EXTENSION_SET))
-#define PEAS_EXTENSION_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PEAS_TYPE_EXTENSION_SET, PeasExtensionSetClass))
-
-typedef struct _PeasExtensionSet PeasExtensionSet;
-typedef struct _PeasExtensionSetClass PeasExtensionSetClass;
-typedef struct _PeasExtensionSetPrivate PeasExtensionSetPrivate;
-
-/**
- * PeasExtensionSet:
- *
- * The #PeasExtensionSet structure contains only private data and should only
- * be accessed using the provided API.
- */
-struct _PeasExtensionSet {
- GObject parent;
-
- PeasExtensionSetPrivate *priv;
-};
-
-/**
- * PeasExtensionSetClass:
- * @parent_class: The parent class.
- * @extension_added: Signal class handler for the
- * #PeasExtensionSet::extension-added signal.
- * @extension_removed: Signal class handler for the
- * #PeasExtensionSet::extension-removed signal.
- *
- * The class structure for #PeasExtensionSet.
- */
-struct _PeasExtensionSetClass {
- GObjectClass parent_class;
-
- /*< public >*/
- /* Signals */
- void (*extension_added) (PeasExtensionSet *set,
- PeasPluginInfo *info,
- PeasExtension *exten);
- void (*extension_removed) (PeasExtensionSet *set,
- PeasPluginInfo *info,
- PeasExtension *exten);
+#define PEAS_TYPE_EXTENSION_SET (peas_extension_set_get_type())
- /*< private >*/
- gpointer padding[8];
-};
+PEAS_AVAILABLE_IN_ALL
+G_DECLARE_FINAL_TYPE (PeasExtensionSet, peas_extension_set, PEAS, EXTENSION_SET, GObject)
/**
* PeasExtensionSetForeachFunc:
@@ -103,36 +56,28 @@ typedef void (*PeasExtensionSetForeachFunc) (PeasExtensionSet *set,
PeasExtension *exten,
gpointer data);
-/*
- * Public methods
- */
-PEAS_AVAILABLE_IN_ALL
-GType peas_extension_set_get_type (void) G_GNUC_CONST;
-
PEAS_AVAILABLE_IN_ALL
-void peas_extension_set_foreach (PeasExtensionSet *set,
- PeasExtensionSetForeachFunc func,
- gpointer data);
-
+void peas_extension_set_foreach (PeasExtensionSet *set,
+ PeasExtensionSetForeachFunc func,
+ gpointer data);
PEAS_AVAILABLE_IN_ALL
-PeasExtension *peas_extension_set_get_extension (PeasExtensionSet *set,
- PeasPluginInfo *info);
-
+PeasExtension *peas_extension_set_get_extension (PeasExtensionSet *set,
+ PeasPluginInfo *info);
PEAS_AVAILABLE_IN_ALL
-PeasExtensionSet *peas_extension_set_new_with_properties (PeasEngine *engine,
- GType exten_type,
- guint n_properties,
- const gchar **prop_names,
- const GValue *prop_values);
+PeasExtensionSet *peas_extension_set_new_with_properties (PeasEngine *engine,
+ GType exten_type,
+ guint n_properties,
+ const gchar **prop_names,
+ const GValue *prop_values);
PEAS_AVAILABLE_IN_ALL
-PeasExtensionSet *peas_extension_set_new_valist (PeasEngine *engine,
- GType exten_type,
- const gchar *first_property,
- va_list var_args);
+PeasExtensionSet *peas_extension_set_new_valist (PeasEngine *engine,
+ GType exten_type,
+ const gchar *first_property,
+ va_list var_args);
PEAS_AVAILABLE_IN_ALL
-PeasExtensionSet *peas_extension_set_new (PeasEngine *engine,
- GType exten_type,
- const gchar *first_property,
- ...);
+PeasExtensionSet *peas_extension_set_new (PeasEngine *engine,
+ GType exten_type,
+ const gchar *first_property,
+ ...);
G_END_DECLS