[pango] pango/pangox.c: Use G_DEFINE_TYPE
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango] pango/pangox.c: Use G_DEFINE_TYPE
- Date: Sat, 30 Apr 2011 12:04:03 +0000 (UTC)
commit cdf841adb0bddcd790a2230d04749a680d827015
Author: Javier Jardón <jjardon gnome org>
Date: Sat Apr 30 11:41:37 2011 +0100
pango/pangox.c: Use G_DEFINE_TYPE
pango/pangox.c | 37 +++----------------------------------
1 files changed, 3 insertions(+), 34 deletions(-)
---
diff --git a/pango/pangox.c b/pango/pangox.c
index c49024f..00a0964 100644
--- a/pango/pangox.c
+++ b/pango/pangox.c
@@ -69,8 +69,6 @@ struct _PangoXFontClass
PangoFontClass parent_class;
};
-static PangoFontClass *parent_class; /* Parent class structure for PangoXFont */
-
static void pango_x_font_class_init (PangoXFontClass *class);
static void pango_x_font_init (PangoXFont *xfont);
static void pango_x_font_dispose (GObject *object);
@@ -224,34 +222,7 @@ pango_x_context_set_funcs (PangoContext *context,
info->free_gc_func = free_gc_func;
}
-static GType
-pango_x_font_get_type (void)
-{
- static GType object_type = 0;
-
- if (G_UNLIKELY (!object_type))
- {
- const GTypeInfo object_info =
- {
- sizeof (PangoXFontClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) pango_x_font_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (PangoXFont),
- 0, /* n_preallocs */
- (GInstanceInitFunc) pango_x_font_init,
- NULL /* value_table */
- };
-
- object_type = g_type_register_static (PANGO_TYPE_FONT,
- I_("PangoXFont"),
- &object_info, 0);
- }
-
- return object_type;
-}
+G_DEFINE_TYPE (PangoXFont, pango_x_font, PANGO_TYPE_FONT);
static void
pango_x_font_init (PangoXFont *xfont)
@@ -275,8 +246,6 @@ pango_x_font_class_init (PangoXFontClass *class)
GObjectClass *object_class = G_OBJECT_CLASS (class);
PangoFontClass *font_class = PANGO_FONT_CLASS (class);
- parent_class = g_type_class_peek_parent (class);
-
object_class->finalize = pango_x_font_finalize;
object_class->dispose = pango_x_font_dispose;
@@ -1271,7 +1240,7 @@ pango_x_font_dispose (GObject *object)
if (!xfont->in_cache && xfont->fontmap)
pango_x_fontmap_cache_add (xfont->fontmap, xfont);
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (pango_x_font_parent_class)->dispose (object);
}
@@ -1326,7 +1295,7 @@ pango_x_font_finalize (GObject *object)
g_strfreev (xfont->fonts);
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ G_OBJECT_CLASS (pango_x_font_parent_class)->finalize (object);
}
static PangoFontDescription *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]