[pango] pango/pangoatsui-fontmap.c: Use G_DEFINE_TYPE
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango] pango/pangoatsui-fontmap.c: Use G_DEFINE_TYPE
- Date: Sat, 30 Apr 2011 12:04:23 +0000 (UTC)
commit 02f80c9acdec53f58fef0e12f41363c3c4ea1efe
Author: Javier Jardón <jjardon gnome org>
Date: Sat Apr 30 12:03:36 2011 +0100
pango/pangoatsui-fontmap.c: Use G_DEFINE_TYPE
pango/pangoatsui-fontmap.c | 39 +++------------------------------------
1 files changed, 3 insertions(+), 36 deletions(-)
---
diff --git a/pango/pangoatsui-fontmap.c b/pango/pangoatsui-fontmap.c
index 12b86bb..8eb123a 100644
--- a/pango/pangoatsui-fontmap.c
+++ b/pango/pangoatsui-fontmap.c
@@ -70,9 +70,6 @@ struct _PangoATSUIFace
static GType pango_atsui_family_get_type (void);
static GType pango_atsui_face_get_type (void);
-static gpointer pango_atsui_family_parent_class;
-static gpointer pango_atsui_face_parent_class;
-
static const char *
get_real_family (const char *family_name)
{
@@ -222,14 +219,14 @@ pango_atsui_family_finalize (GObject *object)
G_OBJECT_CLASS (pango_atsui_family_parent_class)->finalize (object);
}
+G_DEFINE_TYPE (PangoATSUIFamilyClass, pango_atsui_family, PANGO_TYPE_FONT_FAMILY);
+
static void
-pango_atsui_family_class_init (PangoFontFamilyClass *class)
+pango_atsui_family_class_init (PangoATSUIFamilyClass *class)
{
GObjectClass *object_class = (GObjectClass *)class;
int i;
- pango_atsui_family_parent_class = g_type_class_peek_parent (class);
-
object_class->finalize = pango_atsui_family_finalize;
class->list_faces = pango_atsui_family_list_faces;
@@ -246,34 +243,6 @@ pango_atsui_family_init (PangoATSUIFamily *family)
family->n_faces = -1;
}
-static GType
-pango_atsui_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_atsui_family_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (PangoATSUIFamily),
- 0, /* n_preallocs */
- (GInstanceInitFunc) pango_atsui_family_init,
- };
-
- object_type = g_type_register_static (PANGO_TYPE_FONT_FAMILY,
- I_("PangoATSUIFamily"),
- &object_info, 0);
- }
-
- return object_type;
-}
-
static PangoFontDescription *
pango_atsui_face_describe (PangoFontFace *face)
{
@@ -368,8 +337,6 @@ pango_atsui_face_class_init (PangoFontFaceClass *class)
{
GObjectClass *object_class = (GObjectClass *)class;
- pango_atsui_face_parent_class = g_type_class_peek_parent (class);
-
object_class->finalize = pango_atsui_face_finalize;
class->describe = pango_atsui_face_describe;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]