]> www.fi.muni.cz Git - evince.git/commitdiff
[libdocument] Use G_DEFINE_INTERFACE() macro to define EvAnnotationMarkup iface
authorCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 12 Jul 2010 18:00:48 +0000 (20:00 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 12 Jul 2010 18:00:48 +0000 (20:00 +0200)
libdocument/ev-annotation.c
libdocument/ev-annotation.h

index b38fd0a912366f0c10b01e96db7c9ff40747b290..21ffc0a138ea618783cb74281fd4d2cfc0d32117 100644 (file)
@@ -24,9 +24,9 @@
 #include "ev-annotation.h"
 
 
-static void ev_annotation_markup_iface_base_init       (EvAnnotationMarkupIface *iface);
-static void ev_annotation_text_markup_iface_init       (EvAnnotationMarkupIface *iface);
-static void ev_annotation_attachment_markup_iface_init (EvAnnotationMarkupIface *iface);
+static void ev_annotation_markup_default_init          (EvAnnotationMarkupInterface *iface);
+static void ev_annotation_text_markup_iface_init       (EvAnnotationMarkupInterface *iface);
+static void ev_annotation_attachment_markup_iface_init (EvAnnotationMarkupInterface *iface);
 
 enum {
        PROP_0,
@@ -38,30 +38,7 @@ enum {
 };
 
 G_DEFINE_ABSTRACT_TYPE (EvAnnotation, ev_annotation, G_TYPE_OBJECT)
-GType
-ev_annotation_markup_get_type (void)
-{
-       static volatile gsize g_define_type_id__volatile = 0;
-
-       if (g_once_init_enter (&g_define_type_id__volatile)) {
-               GType g_define_type_id;
-               const GTypeInfo our_info = {
-                       sizeof (EvAnnotationMarkupIface),
-                       (GBaseInitFunc) ev_annotation_markup_iface_base_init,
-                       NULL,
-               };
-
-               g_define_type_id = g_type_register_static (G_TYPE_INTERFACE,
-                                                          "EvAnnotationMarkup",
-                                                          &our_info, (GTypeFlags)0);
-               g_type_interface_add_prerequisite (g_define_type_id, EV_TYPE_ANNOTATION);
-
-               g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
-       }
-
-       return g_define_type_id__volatile;
-}
-
+G_DEFINE_INTERFACE (EvAnnotationMarkup, ev_annotation_markup, EV_TYPE_ANNOTATION)
 G_DEFINE_TYPE_WITH_CODE (EvAnnotationText, ev_annotation_text, EV_TYPE_ANNOTATION,
         {
                 G_IMPLEMENT_INTERFACE (EV_TYPE_ANNOTATION_MARKUP,
@@ -125,7 +102,7 @@ typedef struct {
 } EvAnnotationMarkupProps;
 
 static void
-ev_annotation_markup_iface_base_init (EvAnnotationMarkupIface *iface)
+ev_annotation_markup_default_init (EvAnnotationMarkupInterface *iface)
 {
        static gboolean initialized = FALSE;
 
@@ -378,7 +355,7 @@ ev_annotation_text_class_init (EvAnnotationTextClass *klass)
 }
 
 static void
-ev_annotation_text_markup_iface_init (EvAnnotationMarkupIface *iface)
+ev_annotation_text_markup_iface_init (EvAnnotationMarkupInterface *iface)
 {
 }
 
@@ -423,7 +400,7 @@ ev_annotation_attachment_class_init (EvAnnotationAttachmentClass *klass)
 }
 
 static void
-ev_annotation_attachment_markup_iface_init (EvAnnotationMarkupIface *iface)
+ev_annotation_attachment_markup_iface_init (EvAnnotationMarkupInterface *iface)
 {
 }
 
index 8436cce6393b008ea580c18717dabeb22682ba0a..de8736e200116da0ea43404dc173539c1f928f77 100644 (file)
@@ -44,10 +44,10 @@ G_BEGIN_DECLS
 /* EvAnnotationMarkup */
 #define EV_TYPE_ANNOTATION_MARKUP               (ev_annotation_markup_get_type ())
 #define EV_ANNOTATION_MARKUP(o)                 (G_TYPE_CHECK_INSTANCE_CAST ((o), EV_TYPE_ANNOTATION_MARKUP, EvAnnotationMarkup))
-#define EV_ANNOTATION_MARKUP_IFACE(k)           (G_TYPE_CHECK_CLASS_CAST((k), EV_TYPE_ANNOTATION_MARKUP, EvAnnotationMarkupIface))
+#define EV_ANNOTATION_MARKUP_IFACE(k)           (G_TYPE_CHECK_CLASS_CAST((k), EV_TYPE_ANNOTATION_MARKUP, EvAnnotationMarkupInterface))
 #define EV_IS_ANNOTATION_MARKUP(o)              (G_TYPE_CHECK_INSTANCE_TYPE ((o), EV_TYPE_ANNOTATION_MARKUP))
 #define EV_IS_ANNOTATION_MARKUP_IFACE(k)        (G_TYPE_CHECK_CLASS_TYPE ((k), EV_TYPE_ANNOTATION_MARKUP))
-#define EV_ANNOTATION_MARKUP_GET_IFACE(inst)    (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EV_TYPE_ANNOTATION_MARKUP, EvAnnotationMarkupIface))
+#define EV_ANNOTATION_MARKUP_GET_IFACE(inst)    (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EV_TYPE_ANNOTATION_MARKUP, EvAnnotationMarkupInterface))
 
 /* EvAnnotationText */
 #define EV_TYPE_ANNOTATION_TEXT                 (ev_annotation_text_get_type())
@@ -69,7 +69,7 @@ typedef struct _EvAnnotation                EvAnnotation;
 typedef struct _EvAnnotationClass           EvAnnotationClass;
 
 typedef struct _EvAnnotationMarkup          EvAnnotationMarkup;
-typedef struct _EvAnnotationMarkupIface     EvAnnotationMarkupIface;
+typedef struct _EvAnnotationMarkupInterface EvAnnotationMarkupInterface;
 
 typedef struct _EvAnnotationText            EvAnnotationText;
 typedef struct _EvAnnotationTextClass       EvAnnotationTextClass;
@@ -96,7 +96,7 @@ struct _EvAnnotationClass
        GObjectClass parent_class;
 };
 
-struct _EvAnnotationMarkupIface
+struct _EvAnnotationMarkupInterface
 {
        GTypeInterface base_iface;
 };