GObject继承类使用到的几个宏定义的展开内容

GOBJECT 继承类的声明部分

G_DECLARE_FINAL_TYPE (MainScreen, main_screen, MAIN, SCREEN, GtkApplicationWindow)

GType main_screen_get_type (void);
 __pragma (warning (push)) 
 __pragma (warning (disable : 4996)) 
 typedef struct _MainScreen MainScreen; 
 typedef struct { 
    GtkApplicationWindowClass parent_class; 
    } MainScreenClass; 
static inline MainScreen * MAIN_SCREEN (gpointer ptr) {
     return (((MainScreen*) (void *) g_type_check_instance_cast ((GTypeInstance*) (ptr), (main_screen_get_type ()))));
      } 
static inline gboolean MAIN_IS_SCREEN (gpointer ptr) { 
    return ((g_type_check_instance_is_a ((GTypeInstance*) (ptr), (main_screen_get_type ()))));
 }
 __pragma (warning (pop))

G_DECLARE_DERIVABLE_TYPE (MainScreen, main_screen, MAIN, SCREEN, GtkApplicationWindow)

GType main_screen_get_type (void); 
__pragma (warning (push)) 
__pragma (warning (disable : 4996)) 
typedef struct _MainScreen MainScreen; 
typedef struct _MainScreenClass MainScreenClass; 
struct _MainScreen { 
    GtkApplicationWindow parent_instance; 
}; 
static inline MainScreen * MAIN_SCREEN (gpointer ptr) {
     return (((MainScreen*) (void *) g_type_check_instance_cast ((GTypeInstance*) (ptr), (main_screen_get_type ())))); 
     }
static inline MainScreenClass * MAIN_SCREEN_CLASS (gpointer ptr) { 
    return (((MainScreenClass*) (void *) g_type_check_class_cast ((GTypeClass*) (ptr), (main_screen_get_type ())))); 
} 
static inline gboolean MAIN_IS_SCREEN (gpointer ptr) { 
    return ((g_type_check_instance_is_a ((GTypeInstance*) (ptr), (main_screen_get_type ()))));
} 
static inline gboolean MAIN_IS_SCREEN_CLASS (gpointer ptr) {
     return ((g_type_check_class_is_a ((GTypeClass*) (ptr), (main_screen_get_type ()))));
 } 
 static inline MainScreenClass * MAIN_SCREEN_GET_CLASS (gpointer ptr) { 
    return (((MainScreenClass*) (((GTypeInstance*) (ptr))->g_class))); 
    } 
__pragma (warning (pop))

G_DECLARE_INTERFACE (MainScreen, main_screen, MAIN, SCREEN, GtkApplicationWindow)

GType main_screen_get_type (void);
__pragma (warning (push)) 
__pragma (warning (disable : 4996)) 
typedef struct _MainScreen MainScreen; 
typedef struct _MainScreenInterface MainScreenInterface; 
static inline MainScreen * MAIN_SCREEN (gpointer ptr) { 
    return (((MainScreen*) (void *) g_type_check_instance_cast ((GTypeInstance*) (ptr), (main_screen_get_type ())))); 
} 
static inline gboolean MAIN_IS_SCREEN (gpointer ptr) { 
    return ((g_type_check_instance_is_a ((GTypeInstance*) (ptr), (main_screen_get_type ())))); 
} 
static inline MainScreenInterface * MAIN_SCREEN_GET_IFACE (gpointer ptr) { 
    return (((MainScreenInterface*) g_type_interface_peek (((GTypeInstance*) (ptr))->g_class, (main_screen_get_type ())))); 
    }
 __pragma (warning (pop))
*/

GOBJECT 继承类的实现部分:

G_DEFINE_TYPE(MainScreen, main_screen, GTK_TYPE_APPLICATION_WINDOW);

static void main_screen_init (MainScreen *self); 
static void main_screen_class_init (MainScreenClass *klass); 
static GType main_screen_get_type_once (void); 
static gpointer main_screen_parent_class = 0; 
static gint MainScreen_private_offset; 
static void main_screen_class_intern_init (gpointer klass) {
     main_screen_parent_class = g_type_class_peek_parent (klass); if (MainScreen_private_offset != 0) g_type_class_adjust_private_offset (klass, &MainScreen_private_offset); main_screen_class_init ((MainScreenClass*) klass); 
} 
static inline gpointer main_screen_get_instance_private (MainScreen *self) { 
    return (((gpointer) ((guint8*) (self) + (glong) (MainScreen_private_offset)))); 
} 
GType main_screen_get_type (void) { 
    static gsize static_g_define_type_id = 0; if ((g_once_init_enter((&static_g_define_type_id)))) {   GType g_define_type_id = main_screen_get_type_once (); (g_once_init_leave((&static_g_define_type_id), (gsize) (g_define_type_id))); } 
    return static_g_define_type_id; 
}
 __declspec (noinline)  static GType main_screen_get_type_once (void) {
     GType g_define_type_id = g_type_register_static_simple ((gtk_application_window_get_type ()), g_intern_static_string ("MainScreen"), sizeof (MainScreenClass), (GClassInitFunc)(void (*)(void)) main_screen_class_intern_init, sizeof (MainScreen), (GInstanceInitFunc)(void (*)(void)) main_screen_init, (GTypeFlags) 0); { {{};} } 
     return g_define_type_id;
}

G_DEFINE_TYPE_WITH_CODE(MainScreen, main_screen, GTK_TYPE_APPLICATION_WINDOW XXXXXXX);

static void main_screen_init (MainScreen *self); 
static void main_screen_class_init (MainScreenClass *klass); 
static GType main_screen_get_type_once (void); 
static gpointer main_screen_parent_class = 0; 
static gint MainScreen_private_offset; 
static void main_screen_class_intern_init (gpointer klass) {
     main_screen_parent_class = g_type_class_peek_parent (klass); if (MainScreen_private_offset != 0) g_type_class_adjust_private_offset (klass, &MainScreen_private_offset); main_screen_class_init ((MainScreenClass*) klass); 
     } 
static inline gpointer main_screen_get_instance_private (MainScreen *self) {
     return (((gpointer) ((guint8*) (self) + (glong) (MainScreen_private_offset))));
      }
 GType main_screen_get_type (void) { 
    static gsize static_g_define_type_id = 0; if ((g_once_init_enter((&static_g_define_type_id)))) { GType g_define_type_id = main_screen_get_type_once (); (g_once_init_leave((&static_g_define_type_id), (gsize) (g_define_type_id))); } return static_g_define_type_id; 
    } 
    __declspec (noinline) static GType main_screen_get_type_once (void) { 
        GType g_define_type_id = g_type_register_static_simple (
            (gtk_application_window_get_type ()) XXXXXXX, 
            g_intern_static_string ("MainScreen"),
             sizeof (MainScreenClass), 
             (GClassInitFunc)(void (*)(void)) main_screen_class_intern_init, 
             sizeof (MainScreen), 
             (GInstanceInitFunc)(void (*)(void)) main_screen_init, 
             (GTypeFlags) 0);
              { {;} } 
        return g_define_type_id; 
}

G_DEFINE_TYPE_WITH_PRIVATE(MainScreen, main_screen, GTK_TYPE_APPLICATION_WINDOW);

static void main_screen_init (MainScreen *self); 
static void main_screen_class_init (MainScreenClass *klass); 
static GType main_screen_get_type_once (void); 
static gpointer main_screen_parent_class = 0; 
static gint MainScreen_private_offset; 
static void main_screen_class_intern_init (gpointer klass) { 
    main_screen_parent_class = g_type_class_peek_parent (klass); if (MainScreen_private_offset != 0) g_type_class_adjust_private_offset (klass, &MainScreen_private_offset); main_screen_class_init ((MainScreenClass*) klass); 
    }
static inline gpointer main_screen_get_instance_private (MainScreen *self) {
     return (((gpointer) ((guint8*) (self) + (glong) (MainScreen_private_offset)))); 
     } 
GType main_screen_get_type (void) { 
    static gsize static_g_define_type_id = 0; if ((g_once_init_enter((&static_g_define_type_id)))) { GType g_define_type_id = main_screen_get_type_once (); (g_once_init_leave((&static_g_define_type_id), (gsize) (g_define_type_id))); } return static_g_define_type_id; 
    }
 __declspec (noinline) static GType main_screen_get_type_once (void) { 
    GType g_define_type_id = g_type_register_static_simple ((gtk_application_window_get_type ()), g_intern_static_string ("MainScreen"), sizeof (MainScreenClass), (GClassInitFunc)(void (*)(void)) main_screen_class_intern_init, sizeof (MainScreen), (GInstanceInitFunc)(void (*)(void)) main_screen_init, (GTypeFlags) 0); { {{ MainScreen_private_offset = g_type_add_instance_private (g_define_type_id, sizeof (MainScreenPrivate)); };} } return g_define_type_id; 
    }

G_DEFINE_INTERFACE(MainScreen, main_screen, GTK_TYPE_APPLICATION_WINDOW)

static void main_screen_default_init (MainScreenInterface *klass); 
GType main_screen_get_type (void) { 
    static gsize static_g_define_type_id = 0; 
    if ((g_once_init_enter((&static_g_define_type_id)))) { 
        GType g_define_type_id = g_type_register_static_simple (((GType) ((2) << (2))), g_intern_static_string ("MainScreen"), sizeof (MainScreenInterface), (GClassInitFunc)(void (*)(void)) main_screen_default_init, 0, (GInstanceInitFunc)0, (GTypeFlags) 0); if ((gtk_application_window_get_type ()) != ((GType) ((0) << (2)))) g_type_interface_add_prerequisite (g_define_type_id, (gtk_application_window_get_type ())); { {;;} } (g_once_init_leave((&static_g_define_type_id), (gsize) (g_define_type_id))); 
        } 
        return static_g_define_type_id; 
}

G_DEFINE_ABSTRACT_TYPE(MainScreen, main_screen, GTK_TYPE_APPLICATION_WINDOW)

static void main_screen_init (MainScreen *self); 
static void main_screen_class_init (MainScreenClass *klass); 
static GType main_screen_get_type_once (void); 
static gpointer main_screen_parent_class = 0; 
static gint MainScreen_private_offset; 
static void main_screen_class_intern_init (gpointer klass) {
     main_screen_parent_class = g_type_class_peek_parent (klass); 
     if (MainScreen_private_offset != 0) 
     g_type_class_adjust_private_offset (klass, &MainScreen_private_offset); 
     main_screen_class_init ((MainScreenClass*) klass);
} 
static inline gpointer main_screen_get_instance_private (MainScreen *self) { 
    return (((gpointer) ((guint8*) (self) + (glong) (MainScreen_private_offset)))); 
    } 
GType main_screen_get_type (void) {
     static gsize static_g_define_type_id = 0;
      if ((g_once_init_enter((&static_g_define_type_id)))) { GType g_define_type_id = main_screen_get_type_once (); (g_once_init_leave((&static_g_define_type_id), (gsize) (g_define_type_id))); 
      } 
      return static_g_define_type_id;
} 
__declspec (noinline) static GType main_screen_get_type_once (void) { 
    GType g_define_type_id = g_type_register_static_simple ((gtk_application_window_get_type ()), g_intern_static_string ("MainScreen"), sizeof (MainScreenClass), (GClassInitFunc)(void (*)(void)) main_screen_class_intern_init, sizeof (MainScreen), (GInstanceInitFunc)(void (*)(void)) main_screen_init, (GTypeFlags) G_TYPE_FLAG_ABSTRACT); { {{};} } return g_define_type_id;
      }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Kalong

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值