diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2024-06-18 06:31:42 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2024-06-18 06:31:58 (GMT) |
commit | 53edb30496d1065019406de16f9f9d96ba61cd3c (patch) | |
tree | 162cad07e27a01990d721f69f3270581417c31e7 /src/glibext/helpers.h | |
parent | 334126eb659bc310a72a9f7f9238b7cd205a0770 (diff) |
Rebuild hex views for large contents.
Diffstat (limited to 'src/glibext/helpers.h')
-rw-r--r-- | src/glibext/helpers.h | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/glibext/helpers.h b/src/glibext/helpers.h index 71a7269..04e51ad 100644 --- a/src/glibext/helpers.h +++ b/src/glibext/helpers.h @@ -90,6 +90,36 @@ /** + * Bis repetita pour les interfaces... + */ + +#define DECLARE_INTERFACE(TN, t_n, MOD, NAME) \ + \ + GType t_n##_get_type(void) G_GNUC_CONST; \ + \ + /* Coquille vide */ \ + typedef struct _##TN TN; \ + /* Interface */ \ + typedef struct _##TN##Interface TN##Interface; \ + \ + G_GNUC_UNUSED static inline TN *MOD##_##NAME(gconstpointer obj) \ + { \ + return G_TYPE_CHECK_INSTANCE_CAST(obj, MOD##_TYPE_##NAME, TN); \ + } \ + \ + G_GNUC_UNUSED static inline gboolean MOD##_IS_##NAME(gconstpointer obj) \ + { \ + return G_TYPE_CHECK_INSTANCE_TYPE(obj, MOD##_TYPE_##NAME); \ + } \ + \ + G_GNUC_UNUSED static inline TN##Interface *MOD##_##NAME##_GET_IFACE(gconstpointer obj) \ + { \ + return G_TYPE_INSTANCE_GET_INTERFACE(obj, MOD##_TYPE_##NAME, TN##Interface); \ + } + + + +/** * Les principales fonctions incrémentant ou réduisant le nombre de références * attachées à un objet acceptent de simples pointeurs génériques (cf. définitions * du fichier <glib-2.80>/gobject/gobject.h : @@ -143,7 +173,7 @@ assert(__inst != NULL); \ g_object_ref(ip); \ } \ - while (0); + while (0) # define unref_object(ip) \ do \ @@ -153,7 +183,7 @@ assert(__inst != NULL); \ g_object_unref(ip); \ } \ - while (0); + while (0) #else |