Use G_DEFINE_INTERFACE in PangoCairoFont
authorJavier Jardón <jjardon@gnome.org>
Sat, 30 Apr 2011 02:19:10 +0000 (03:19 +0100)
committerJavier Jardón <jjardon@gnome.org>
Sat, 30 Apr 2011 11:48:07 +0000 (12:48 +0100)
pango/pangocairo-font.c

index df0a777..8dc8df0 100644 (file)
     G_STRUCT_MEMBER_P (font,                   \
     PANGO_CAIRO_FONT_GET_IFACE(PANGO_CAIRO_FONT(font))->cf_priv_offset)))
 
-GType
-pango_cairo_font_get_type (void)
-{
-  static GType cairo_font_type = 0;
-
-  if (! cairo_font_type)
-    {
-      const GTypeInfo cairo_font_info =
-      {
-       sizeof (PangoCairoFontIface), /* class_size */
-       NULL,           /* base_init */
-       NULL,           /* base_finalize */
-       NULL,
-       NULL,           /* class_finalize */
-       NULL,           /* class_data */
-       0,
-       0,
-       NULL,
-       NULL
-      };
-
-      cairo_font_type =
-       g_type_register_static (G_TYPE_INTERFACE, I_("PangoCairoFont"),
-                               &cairo_font_info, 0);
-
-      g_type_interface_add_prerequisite (cairo_font_type, PANGO_TYPE_FONT);
-    }
+typedef PangoCairoFontIface PangoCairoFontInterface;
+G_DEFINE_INTERFACE (PangoCairoFont, pango_cairo_font, PANGO_TYPE_FONT)
 
-  return cairo_font_type;
+static void
+pango_cairo_font_default_init (PangoCairoFontIface *iface)
+{
 }
 
+
 static PangoCairoFontPrivateScaledFontData *
 _pango_cairo_font_private_scaled_font_data_create (void)
 {