summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2011-04-30 12:07:16 +0100
committerJavier Jardón <jjardon@gnome.org>2011-04-30 12:59:14 +0100
commit6b5a1af54ba73c7406effd361840f530d440b4af (patch)
treee1c3243ff587a8cf880eaac77854d16344f3b69c
parent02f80c9acdec53f58fef0e12f41363c3c4ea1efe (diff)
downloadpango-6b5a1af54ba73c7406effd361840f530d440b4af.tar.gz
pango/pangocoretext-fontmap.c: Use G_DEFINE_TYPE
-rw-r--r--pango/pangocoretext-fontmap.c37
1 files changed, 2 insertions, 35 deletions
diff --git a/pango/pangocoretext-fontmap.c b/pango/pangocoretext-fontmap.c
index a507307a..96281da3 100644
--- a/pango/pangocoretext-fontmap.c
+++ b/pango/pangocoretext-fontmap.c
@@ -71,9 +71,6 @@ struct _PangoCoreTextFace
static GType pango_core_text_family_get_type (void);
static GType pango_core_text_face_get_type (void);
-static gpointer pango_core_text_family_parent_class;
-static gpointer pango_core_text_face_parent_class;
-
static const char *
get_real_family (const char *family_name)
{
@@ -370,14 +367,14 @@ pango_core_text_family_finalize (GObject *object)
G_OBJECT_CLASS (pango_core_text_family_parent_class)->finalize (object);
}
+G_DEFINE_TYPE (PangoCoreTextFamily, pango_core_text_family, PANGO_TYPE_FONT_FAMILY);
+
static void
pango_core_text_family_class_init (PangoFontFamilyClass *class)
{
GObjectClass *object_class = (GObjectClass *)class;
int i;
- pango_core_text_family_parent_class = g_type_class_peek_parent (class);
-
object_class->finalize = pango_core_text_family_finalize;
class->list_faces = pango_core_text_family_list_faces;
@@ -394,34 +391,6 @@ pango_core_text_family_init (PangoCoreTextFamily *family)
family->n_faces = -1;
}
-static GType
-pango_core_text_family_get_type (void)
-{
- static GType object_type = 0;
-
- if (G_UNLIKELY (!object_type))
- {
- const GTypeInfo object_info =
- {
- sizeof (PangoFontFamilyClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) pango_core_text_family_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (PangoCoreTextFamily),
- 0, /* n_preallocs */
- (GInstanceInitFunc) pango_core_text_family_init,
- };
-
- object_type = g_type_register_static (PANGO_TYPE_FONT_FAMILY,
- I_("PangoCoreTextFamily"),
- &object_info, 0);
- }
-
- return object_type;
-}
-
static PangoFontDescription *
pango_core_text_face_describe (PangoFontFace *face)
{
@@ -545,8 +514,6 @@ pango_core_text_face_class_init (PangoFontFaceClass *class)
{
GObjectClass *object_class = (GObjectClass *)class;
- pango_core_text_face_parent_class = g_type_class_peek_parent (class);
-
object_class->finalize = pango_core_text_face_finalize;
class->describe = pango_core_text_face_describe;