summaryrefslogtreecommitdiff
path: root/gcr
diff options
context:
space:
mode:
authorCorentin Noël <corentin.noel@collabora.com>2021-12-10 09:15:13 +0100
committerCorentin Noël <tintou@noel.tf>2022-04-09 00:44:24 +0200
commitd64103c19d06c455d5e738ac24dfcb54d2101824 (patch)
tree383f780acda14a7e03c4d80ab24d4047bd6a66e3 /gcr
parentbae98bd429f1527d69e1ed30ba0de94f311f47dd (diff)
downloadgcr-d64103c19d06c455d5e738ac24dfcb54d2101824.tar.gz
gcr-importer: Use G_DECLARE_INTERFACE to define the interface
This means that GcrImporterIface becomes GcrImporterInterface and GCR_IMPORTER_GET_INTERFACE becomes GCR_IMPORTER_GET_IFACE. Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Diffstat (limited to 'gcr')
-rw-r--r--gcr/gcr-gnupg-importer.c4
-rw-r--r--gcr/gcr-importer.c24
-rw-r--r--gcr/gcr-importer.h13
-rw-r--r--gcr/gcr-pkcs11-importer.c4
4 files changed, 18 insertions, 27 deletions
diff --git a/gcr/gcr-gnupg-importer.c b/gcr/gcr-gnupg-importer.c
index 79fa043..63b7b58 100644
--- a/gcr/gcr-gnupg-importer.c
+++ b/gcr/gcr-gnupg-importer.c
@@ -45,7 +45,7 @@ struct _GcrGnupgImporterPrivate {
GArray *imported;
};
-static void gcr_gnupg_importer_iface (GcrImporterIface *iface);
+static void gcr_gnupg_importer_iface (GcrImporterInterface *iface);
G_DEFINE_TYPE_WITH_CODE (GcrGnupgImporter, _gcr_gnupg_importer, G_TYPE_OBJECT,
G_ADD_PRIVATE (GcrGnupgImporter);
@@ -348,7 +348,7 @@ _gcr_gnupg_importer_import_finish (GcrImporter *importer,
}
static void
-gcr_gnupg_importer_iface (GcrImporterIface *iface)
+gcr_gnupg_importer_iface (GcrImporterInterface *iface)
{
iface->create_for_parsed = _gcr_gnupg_importer_create_for_parsed;
iface->queue_for_parsed = _gcr_gnupg_importer_queue_for_parsed;
diff --git a/gcr/gcr-importer.c b/gcr/gcr-importer.c
index 516e97a..5e41ab3 100644
--- a/gcr/gcr-importer.c
+++ b/gcr/gcr-importer.c
@@ -52,7 +52,7 @@
*/
/**
- * GcrImporterIface:
+ * GcrImporterInterface:
* @parent: parent interface
* @create_for_parsed: implementation of gcr_importer_create_for_parsed(), required
* @queue_for_parsed: implementation of gcr_importer_queue_for_parsed(), required
@@ -63,8 +63,6 @@
* Interface implemented for a #GcrImporter.
*/
-typedef GcrImporterIface GcrImporterInterface;
-
G_DEFINE_INTERFACE (GcrImporter, gcr_importer, G_TYPE_OBJECT);
typedef struct _GcrRegistered {
@@ -76,7 +74,7 @@ static GArray *registered_importers = NULL;
static gboolean registered_sorted = FALSE;
static void
-gcr_importer_default_init (GcrImporterIface *iface)
+gcr_importer_default_init (GcrImporterInterface *iface)
{
static size_t initialized = 0;
@@ -196,7 +194,7 @@ GList *
gcr_importer_create_for_parsed (GcrParsed *parsed)
{
GcrRegistered *registered;
- GcrImporterIface *iface;
+ GcrImporterInterface *iface;
gpointer instance_class;
GckAttributes *attrs;
gboolean matched;
@@ -285,12 +283,12 @@ gboolean
gcr_importer_queue_for_parsed (GcrImporter *importer,
GcrParsed *parsed)
{
- GcrImporterIface *iface;
+ GcrImporterInterface *iface;
g_return_val_if_fail (GCR_IS_IMPORTER (importer), FALSE);
g_return_val_if_fail (parsed != NULL, FALSE);
- iface = GCR_IMPORTER_GET_INTERFACE (importer);
+ iface = GCR_IMPORTER_GET_IFACE (importer);
g_return_val_if_fail (iface != NULL, FALSE);
g_return_val_if_fail (iface->queue_for_parsed != NULL, FALSE);
@@ -377,13 +375,13 @@ gcr_importer_import (GcrImporter *importer,
{
gboolean result;
ImportClosure *closure;
- GcrImporterIface *iface;
+ GcrImporterInterface *iface;
g_return_val_if_fail (GCR_IS_IMPORTER (importer), FALSE);
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- iface = GCR_IMPORTER_GET_INTERFACE (importer);
+ iface = GCR_IMPORTER_GET_IFACE (importer);
if (iface->import_sync)
return (iface->import_sync) (importer, cancellable, error);
@@ -454,12 +452,12 @@ gcr_importer_import_async (GcrImporter *importer,
GAsyncReadyCallback callback,
gpointer user_data)
{
- GcrImporterIface *iface;
+ GcrImporterInterface *iface;
g_return_if_fail (GCR_IS_IMPORTER (importer));
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- iface = GCR_IMPORTER_GET_INTERFACE (importer);
+ iface = GCR_IMPORTER_GET_IFACE (importer);
g_return_if_fail (iface != NULL);
g_return_if_fail (iface->import_async != NULL);
@@ -481,13 +479,13 @@ gcr_importer_import_finish (GcrImporter *importer,
GAsyncResult *result,
GError **error)
{
- GcrImporterIface *iface;
+ GcrImporterInterface *iface;
g_return_val_if_fail (GCR_IS_IMPORTER (importer), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- iface = GCR_IMPORTER_GET_INTERFACE (importer);
+ iface = GCR_IMPORTER_GET_IFACE (importer);
g_return_val_if_fail (iface != NULL, FALSE);
g_return_val_if_fail (iface->import_finish != NULL, FALSE);
diff --git a/gcr/gcr-importer.h b/gcr/gcr-importer.h
index 7a1bcc1..721b214 100644
--- a/gcr/gcr-importer.h
+++ b/gcr/gcr-importer.h
@@ -34,15 +34,10 @@
G_BEGIN_DECLS
-#define GCR_TYPE_IMPORTER (gcr_importer_get_type ())
-#define GCR_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_IMPORTER, GcrImporter))
-#define GCR_IS_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCR_TYPE_IMPORTER))
-#define GCR_IMPORTER_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GCR_TYPE_IMPORTER, GcrImporterIface))
+#define GCR_TYPE_IMPORTER gcr_importer_get_type ()
+G_DECLARE_INTERFACE (GcrImporter, gcr_importer, GCR, IMPORTER, GObject)
-typedef struct _GcrImporter GcrImporter;
-typedef struct _GcrImporterIface GcrImporterIface;
-
-struct _GcrImporterIface {
+struct _GcrImporterInterface {
GTypeInterface parent;
GList * (*create_for_parsed) (GcrParsed *parsed);
@@ -67,8 +62,6 @@ struct _GcrImporterIface {
gpointer reserved[14];
};
-GType gcr_importer_get_type (void);
-
GList * gcr_importer_create_for_parsed (GcrParsed *parsed);
gboolean gcr_importer_queue_for_parsed (GcrImporter *importer,
diff --git a/gcr/gcr-pkcs11-importer.c b/gcr/gcr-pkcs11-importer.c
index 302eb72..b2aa9ae 100644
--- a/gcr/gcr-pkcs11-importer.c
+++ b/gcr/gcr-pkcs11-importer.c
@@ -72,7 +72,7 @@ static void state_cancelled (GTask *task,
gboolean async);
static void state_create_object (GTask *task,
gboolean async);
-static void _gcr_pkcs11_importer_init_iface (GcrImporterIface *iface);
+static void _gcr_pkcs11_importer_init_iface (GcrImporterInterface *iface);
G_DEFINE_TYPE_WITH_CODE (GcrPkcs11Importer, _gcr_pkcs11_importer, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GCR_TYPE_IMPORTER, _gcr_pkcs11_importer_init_iface);
@@ -851,7 +851,7 @@ _gcr_pkcs11_importer_import_finish (GcrImporter *importer,
}
static void
-_gcr_pkcs11_importer_init_iface (GcrImporterIface *iface)
+_gcr_pkcs11_importer_init_iface (GcrImporterInterface *iface)
{
iface->create_for_parsed = _gcr_pkcs11_importer_create_for_parsed;
iface->queue_for_parsed = _gcr_pkcs11_importer_queue_for_parsed;