2011-8-1 20:01:05
GObjectClass 和 GObject 的区别
struct _GObjectClass
{
GTypeClass g_type_class;
/*< private >*/
GSList *construct_properties;
/*< public >*/
/* seldomly overidden */
GObject* (*constructor) (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties);
/* overridable methods */
void (*set_property) (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
void (*get_property) (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
void (*dispose) (GObject *object);
void (*finalize) (GObject *object);
/* seldomly overidden */
void (*dispatch_properties_changed) (GObject *object,
guint n_pspecs,
GParamSpec **pspecs);
/* signals */
void (*notify) (GObject *object,
GParamSpec *pspec);
/* called when done constructing */
void (*constructed) (GObject *object);
/*< private >*/
/* padding */
gpointer pdummy[7];
};
struct _GObject
{
GTypeInstance g_type_instance;
/*< private >*/
volatile guint ref_count;
GData *qdata;
};
struct _HildonDesktopBackgroundPrivate
{
GdkColor *color;
HildonDesktopBackgroundMode mode;
gchar *filename;
gchar *cache;
};
背景有自己的私有数据
看看这个宏做了什么事情
G_DEFINE_TYPE (HDHomeBackground, hd_home_background, HILDON_DESKTOP_TYPE_BACKGROUND);