summaryrefslogtreecommitdiff
path: root/gcr
diff options
context:
space:
mode:
authorCorentin Noël <corentin.noel@collabora.com>2021-12-10 09:10:40 +0100
committerCorentin Noël <tintou@noel.tf>2022-04-09 00:44:24 +0200
commitbae98bd429f1527d69e1ed30ba0de94f311f47dd (patch)
tree3b55e76b267d6c564a58c924fa44652c13aff035 /gcr
parent964f3a3eaccfeee980e008958611195724bc0696 (diff)
downloadgcr-bae98bd429f1527d69e1ed30ba0de94f311f47dd.tar.gz
gcr-import-interaction: Use G_DECLARE_INTERFACE to define the interface
This means that GcrImportInteractionIface becomes GcrImportInteractionInterface and GCR_IMPORT_INTERACTION_GET_INTERFACE becomes GCR_IMPORT_INTERACTION_GET_IFACE. Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Diffstat (limited to 'gcr')
-rw-r--r--gcr/gcr-import-interaction.c27
-rw-r--r--gcr/gcr-import-interaction.h13
2 files changed, 13 insertions, 27 deletions
diff --git a/gcr/gcr-import-interaction.c b/gcr/gcr-import-interaction.c
index b8da073..edf0675 100644
--- a/gcr/gcr-import-interaction.c
+++ b/gcr/gcr-import-interaction.c
@@ -33,7 +33,7 @@
*/
/**
- * GcrImportInteractionIface:
+ * GcrImportInteractionInterface:
* @parent: parent interface
* @supplement_prep: method which prepares for supplementing the given attributes before import
* @supplement: method which synchronously supplements attributes before import
@@ -43,18 +43,11 @@
* Interface implemented by implementations of [iface@ImportInteraction].
*/
-typedef GcrImportInteractionIface GcrImportInteractionInterface;
-
G_DEFINE_INTERFACE (GcrImportInteraction, gcr_import_interaction, G_TYPE_TLS_INTERACTION);
static void
-gcr_import_interaction_default_init (GcrImportInteractionIface *iface)
+gcr_import_interaction_default_init (GcrImportInteractionInterface *iface)
{
- static size_t initialized = 0;
-
- if (g_once_init_enter (&initialized)) {
- g_once_init_leave (&initialized, 1);
- }
}
/**
@@ -74,12 +67,12 @@ void
gcr_import_interaction_supplement_prep (GcrImportInteraction *interaction,
GckBuilder *builder)
{
- GcrImportInteractionIface *iface;
+ GcrImportInteractionInterface *iface;
g_return_if_fail (GCR_IS_IMPORT_INTERACTION (interaction));
g_return_if_fail (builder != NULL);
- iface = GCR_IMPORT_INTERACTION_GET_INTERFACE (interaction);
+ iface = GCR_IMPORT_INTERACTION_GET_IFACE (interaction);
if (iface->supplement != NULL)
(iface->supplement_prep) (interaction, builder);
}
@@ -106,14 +99,14 @@ gcr_import_interaction_supplement (GcrImportInteraction *interaction,
GCancellable *cancellable,
GError **error)
{
- GcrImportInteractionIface *iface;
+ GcrImportInteractionInterface *iface;
g_return_val_if_fail (GCR_IS_IMPORT_INTERACTION (interaction), G_TLS_INTERACTION_UNHANDLED);
g_return_val_if_fail (builder != NULL, G_TLS_INTERACTION_UNHANDLED);
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), G_TLS_INTERACTION_UNHANDLED);
g_return_val_if_fail (error == NULL || *error == NULL, G_TLS_INTERACTION_UNHANDLED);
- iface = GCR_IMPORT_INTERACTION_GET_INTERFACE (interaction);
+ iface = GCR_IMPORT_INTERACTION_GET_IFACE (interaction);
g_return_val_if_fail (iface->supplement != NULL, G_TLS_INTERACTION_UNHANDLED);
return (iface->supplement) (interaction, builder, cancellable, error);
@@ -141,13 +134,13 @@ gcr_import_interaction_supplement_async (GcrImportInteraction *interaction,
GAsyncReadyCallback callback,
gpointer user_data)
{
- GcrImportInteractionIface *iface;
+ GcrImportInteractionInterface *iface;
g_return_if_fail (GCR_IS_IMPORT_INTERACTION (interaction));
g_return_if_fail (builder != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- iface = GCR_IMPORT_INTERACTION_GET_INTERFACE (interaction);
+ iface = GCR_IMPORT_INTERACTION_GET_IFACE (interaction);
g_return_if_fail (iface->supplement != NULL);
(iface->supplement_async) (interaction, builder, cancellable, callback, user_data);
@@ -171,13 +164,13 @@ gcr_import_interaction_supplement_finish (GcrImportInteraction *interaction,
GAsyncResult *result,
GError **error)
{
- GcrImportInteractionIface *iface;
+ GcrImportInteractionInterface *iface;
g_return_val_if_fail (GCR_IS_IMPORT_INTERACTION (interaction), G_TLS_INTERACTION_UNHANDLED);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), G_TLS_INTERACTION_UNHANDLED);
g_return_val_if_fail (error == NULL || *error == NULL, G_TLS_INTERACTION_UNHANDLED);
- iface = GCR_IMPORT_INTERACTION_GET_INTERFACE (interaction);
+ iface = GCR_IMPORT_INTERACTION_GET_IFACE (interaction);
g_return_val_if_fail (iface->supplement != NULL, G_TLS_INTERACTION_UNHANDLED);
return (iface->supplement_finish) (interaction, result, error);
diff --git a/gcr/gcr-import-interaction.h b/gcr/gcr-import-interaction.h
index 79d615b..a0af10e 100644
--- a/gcr/gcr-import-interaction.h
+++ b/gcr/gcr-import-interaction.h
@@ -34,15 +34,10 @@
G_BEGIN_DECLS
-#define GCR_TYPE_IMPORT_INTERACTION (gcr_import_interaction_get_type ())
-#define GCR_IMPORT_INTERACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_IMPORT_INTERACTION, GcrImportInteraction))
-#define GCR_IS_IMPORT_INTERACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCR_TYPE_IMPORT_INTERACTION))
-#define GCR_IMPORT_INTERACTION_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GCR_TYPE_IMPORT_INTERACTION, GcrImportInteractionIface))
+#define GCR_TYPE_IMPORT_INTERACTION gcr_import_interaction_get_type ()
+G_DECLARE_INTERFACE(GcrImportInteraction, gcr_import_interaction, GCR, IMPORT_INTERACTION, GTlsInteraction)
-typedef struct _GcrImportInteraction GcrImportInteraction;
-typedef struct _GcrImportInteractionIface GcrImportInteractionIface;
-
-struct _GcrImportInteractionIface {
+struct _GcrImportInteractionInterface {
GTypeInterface parent;
void (*supplement_prep) (GcrImportInteraction *interaction,
@@ -67,8 +62,6 @@ struct _GcrImportInteractionIface {
gpointer reserved[6];
};
-GType gcr_import_interaction_get_type (void);
-
void gcr_import_interaction_supplement_prep (GcrImportInteraction *interaction,
GckBuilder *builder);