Re: PATCH: G_DEFINE_INTERFACE_TYPE macro
- From: Tiago Cogumbreiro <cogumbreiro linus uac pt>
- To: Gtk+ Devel <gtk-devel-list gnome org>
- Cc: timj gtk org
- Subject: Re: PATCH: G_DEFINE_INTERFACE_TYPE macro
- Date: Wed, 25 Aug 2004 15:42:53 +0000
After some suggestions on #gtk+ I've made some changes to the macro
definition, hope it's better now :)
On Wed, 2004-08-25 at 15:26, Tiago Cogumbreiro wrote:
> I've implemented a macro that i find it to be missing to the
> G_DEFINE_*_TYPE: G_DEFINE_INTERFACE_TYPE
>
> As the name infers it's supposed to define the get_type function which
> defines an interface.
>
>
> ______________________________________________________________________
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list
--- gtype.h 2004-08-25 15:41:00.457885176 +0000
+++ /home/tiago/Downloads/gtype.h 2004-08-25 14:49:54.201027072 +0000
@@ -344,27 +344,6 @@ gpointer g_type_instance_get_private
}; \
g_type_add_interface_static (g_define_type_id, TYPE_IFACE, &g_implement_interface_info); \
}
-/*
- * Convenience macro to ease the interface definition. Works like G_DEFINE_TYPE.
- */
-#define G_DEFINE_INTERFACE_TYPE(TypeName, type_name, CODE) \
-\
-GType \
-type_name##_get_type (void) \
-{ \
- static GType g_define_type_id = 0; \
- if (G_UNLIKELY (g_define_type_id == 0)) \
- { \
- static const GTypeInfo g_define_type_info = { \
- sizeof (TypeName##Class), \
- (GBaseInitFunc) NULL, \
- (GBaseFinalizeFunc) NULL, \
- }; \
- g_define_type_id = g_type_register_static (G_TYPE_INTERFACE, #TypeName, &g_define_type_info, 0); \
- } \
- { CODE ;} \
- return g_define_type_id; \
-}
#define G_DEFINE_TYPE_EXTENDED(TypeName, type_name, TYPE_PARENT, flags, CODE) \
\
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]