From: Javier Jardón Date: Sat, 30 Apr 2011 10:01:48 +0000 (+0100) Subject: pango/pangofc-fontmap.c: Use G_DEFINE_TYPE instead custom macro X-Git-Tag: 1.29.1~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b428d5ef171375b7aa1101aaef56ef7a2ceb544e;p=platform%2Fupstream%2Fpango.git pango/pangofc-fontmap.c: Use G_DEFINE_TYPE instead custom macro --- diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c index 5211361..0553502 100644 --- a/pango/pangofc-fontmap.c +++ b/pango/pangofc-fontmap.c @@ -814,8 +814,7 @@ struct _PangoFcFontset }; typedef PangoFontsetClass PangoFcFontsetClass; - -static PangoFontsetClass *fc_fontset_parent_class; /* Parent class structure for PangoFcFontset */ +G_DEFINE_TYPE (PangoFcFontset, pango_fc_fontset, PANGO_TYPE_FONTSET); static PangoFcFontset * pango_fc_fontset_new (PangoFcFontsetKey *key, @@ -892,9 +891,8 @@ pango_fc_fontset_class_init (PangoFcFontsetClass *class) GObjectClass *object_class = G_OBJECT_CLASS (class); PangoFontsetClass *fontset_class = PANGO_FONTSET_CLASS (class); - fc_fontset_parent_class = g_type_class_peek_parent (class); - object_class->finalize = pango_fc_fontset_finalize; + fontset_class->get_font = pango_fc_fontset_get_font; fontset_class->get_language = pango_fc_fontset_get_language; fontset_class->foreach = pango_fc_fontset_foreach; @@ -935,7 +933,7 @@ pango_fc_fontset_finalize (GObject *object) if (fontset->patterns) pango_fc_patterns_unref (fontset->patterns); - G_OBJECT_CLASS (fc_fontset_parent_class)->finalize (object); + G_OBJECT_CLASS (pango_fc_fontset_parent_class)->finalize (object); } static PangoLanguage * @@ -1008,9 +1006,6 @@ pango_fc_fontset_foreach (PangoFontset *fontset, } } -static PANGO_DEFINE_TYPE (PangoFcFontset, pango_fc_fontset, - pango_fc_fontset_class_init, pango_fc_fontset_init, - PANGO_TYPE_FONTSET) /* * PangoFcFontMap @@ -2180,7 +2175,8 @@ pango_fc_font_description_from_pattern (FcPattern *pattern, gboolean include_siz * PangoFcFace */ -static GObjectClass *pango_fc_face_parent_class = NULL; +typedef PangoFontFaceClass PangoFcFaceClass; +G_DEFINE_TYPE (PangoFcFace, pango_fc_face, PANGO_TYPE_FONT_FACE); static PangoFontDescription * make_alias_description (PangoFcFamily *fcfamily, @@ -2359,17 +2355,19 @@ pango_fc_face_finalize (GObject *object) g_free (fcface->style); - pango_fc_face_parent_class->finalize (object); + G_OBJECT_CLASS (pango_fc_face_parent_class)->finalize (object); } -typedef PangoFontFaceClass PangoFcFaceClass; +static void +pango_fc_face_init (PangoFcFace *self) +{ +} static void pango_fc_face_class_init (PangoFcFaceClass *class) { GObjectClass *object_class = G_OBJECT_CLASS (class); - pango_fc_face_parent_class = g_type_class_peek_parent (class); object_class->finalize = pango_fc_face_finalize; class->describe = pango_fc_face_describe; @@ -2378,15 +2376,13 @@ pango_fc_face_class_init (PangoFcFaceClass *class) class->is_synthesized = pango_fc_face_is_synthesized; } -static PANGO_DEFINE_TYPE (PangoFcFace, pango_fc_face, - pango_fc_face_class_init, NULL, - PANGO_TYPE_FONT_FACE) /* * PangoFcFamily */ -static GObjectClass *pango_fc_family_parent_class = NULL; +typedef PangoFontFamilyClass PangoFcFamilyClass; +G_DEFINE_TYPE (PangoFcFamily, pango_fc_family, PANGO_TYPE_FONT_FAMILY); static PangoFcFace * create_face (PangoFcFamily *fcfamily, @@ -2567,17 +2563,14 @@ pango_fc_family_finalize (GObject *object) } g_free (fcfamily->faces); - pango_fc_family_parent_class->finalize (object); + G_OBJECT_CLASS (pango_fc_family_parent_class)->finalize (object); } -typedef PangoFontFamilyClass PangoFcFamilyClass; - static void pango_fc_family_class_init (PangoFcFamilyClass *class) { GObjectClass *object_class = G_OBJECT_CLASS (class); - pango_fc_family_parent_class = g_type_class_peek_parent (class); object_class->finalize = pango_fc_family_finalize; class->list_faces = pango_fc_family_list_faces; @@ -2590,7 +2583,3 @@ pango_fc_family_init (PangoFcFamily *fcfamily) { fcfamily->n_faces = -1; } - -static PANGO_DEFINE_TYPE (PangoFcFamily, pango_fc_family, - pango_fc_family_class_init, pango_fc_family_init, - PANGO_TYPE_FONT_FAMILY)