From fd8edb23d11f7b80542f99034e827e2ecf36d5fa Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Sat, 21 Nov 2009 23:24:22 -0800 Subject: [PATCH] Automatically declare FooBarPrivate --- moo/mooutils/mootypedecl-macros.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/moo/mooutils/mootypedecl-macros.h b/moo/mooutils/mootypedecl-macros.h index f7554040..9e7ef5eb 100644 --- a/moo/mooutils/mootypedecl-macros.h +++ b/moo/mooutils/mootypedecl-macros.h @@ -18,10 +18,21 @@ #include -#define _MOO_DECLARE_GOBJECT_CLASS(PREFIX,Prefix,prefix,TYPE,Type,type) \ +#define _MOO_DECLARE_GOBJECT_CLASS(Parent, \ + PREFIX,Prefix,prefix, \ + TYPE,Type,type) \ \ typedef struct Prefix##Type Prefix##Type; \ typedef struct Prefix##Type##Class Prefix##Type##Class; \ +typedef struct Prefix##Type##Private Prefix##Type##Private; \ +typedef Parent Prefix##Type##_Base; \ +typedef Parent##Class Prefix##Type##_BaseClass; \ + \ +struct Prefix##Type \ +{ \ + Parent base; \ + Prefix##Type##Private *priv; \ +}; \ \ GType prefix##_##type##_get_type (void) G_GNUC_CONST; \ \ @@ -63,6 +74,8 @@ PREFIX##_##TYPE##_GET_CLASS(void *object) \ Prefix##Type##Class); \ } -#define MOO_DECLARE_GOBJECT_CLASS(TYPE,Type,type) _MOO_DECLARE_GOBJECT_CLASS(MOO, Moo, moo, TYPE, Type, type) +#define MOO_DECLARE_GOBJECT_CLASS(TYPE,Type,type,Parent) \ + _MOO_DECLARE_GOBJECT_CLASS(Parent, MOO, Moo, moo, TYPE, Type, type) #endif /* MOO_TYPE_DECL_MACROS_H */ +/* -%- strip:true -%- */