]> www.fi.muni.cz Git - evince.git/commitdiff
Use EV_DEFINE_INTERFACE to define EvSidebarPage interface. See bug
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sat, 24 Jan 2009 18:10:43 +0000 (18:10 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Sat, 24 Jan 2009 18:10:43 +0000 (18:10 +0000)
2009-01-24  Carlos Garcia Campos  <carlosgc@gnome.org>

* shell/ev-sidebar-page.c:

Use EV_DEFINE_INTERFACE to define EvSidebarPage interface. See bug
#568228.

svn path=/trunk/; revision=3380

ChangeLog
shell/ev-sidebar-page.c

index 6edefe1316f2d79fdb625ee4dce7583bbcd6170a..61e46ea3af303ec3a8a524ae23326939ee6d781b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-01-24  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-sidebar-page.c:
+
+       Use EV_DEFINE_INTERFACE to define EvSidebarPage interface. See bug
+       #568228.
+       
 2009-01-24  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * libdocument/ev-document.h:
index 6043ec5c04e3e92b9f3d736e95343b8f3d51e5e8..14bb847c2858f7d195e0b6821ab3731e3b4f22f4 100644 (file)
 
 #include "ev-sidebar-page.h"
 
-static void ev_sidebar_page_iface_init (gpointer iface);
-
-GType
-ev_sidebar_page_get_type (void)
-{
-       static GType type = 0;
-
-       if (G_UNLIKELY (type == 0))
-       {
-               const GTypeInfo sidebar_page_info =
-               {
-                       sizeof (EvSidebarPageIface),
-                       NULL,
-                       NULL,
-                       (GClassInitFunc)ev_sidebar_page_iface_init,
-               };
-
-               type = g_type_register_static (G_TYPE_INTERFACE,
-                                              "EvSidebarPage",
-                                              &sidebar_page_info, (GTypeFlags)0);
-       }
-
-       return type;
-}
-
+EV_DEFINE_INTERFACE (EvSidebarPage, ev_sidebar_page, 0)
 
 gboolean 
-ev_sidebar_page_support_document  (EvSidebarPage    *sidebar_page,
-                                  EvDocument *document)
+ev_sidebar_page_support_document (EvSidebarPage *sidebar_page,
+                                 EvDocument    *document)
 {
         EvSidebarPageIface *iface;
 
@@ -69,8 +45,8 @@ ev_sidebar_page_support_document  (EvSidebarPage    *sidebar_page,
 }
 
 void 
-ev_sidebar_page_set_document      (EvSidebarPage    *sidebar_page,
-                                  EvDocument *document)
+ev_sidebar_page_set_document (EvSidebarPage *sidebar_page,
+                             EvDocument    *document)
 {
        EvSidebarPageIface *iface;
 
@@ -79,15 +55,13 @@ ev_sidebar_page_set_document      (EvSidebarPage    *sidebar_page,
 
        iface = EV_SIDEBAR_PAGE_GET_IFACE (sidebar_page);
 
-       g_return_if_fail (iface->set_document);
+       g_assert (iface->set_document);
        
        iface->set_document (sidebar_page, document);
-       
-       return;
 }
 
-const gchar*
-ev_sidebar_page_get_label (EvSidebarPage    *sidebar_page)
+const gchar *
+ev_sidebar_page_get_label (EvSidebarPage *sidebar_page)
 {
        EvSidebarPageIface *iface;
 
@@ -95,18 +69,24 @@ ev_sidebar_page_get_label (EvSidebarPage    *sidebar_page)
 
        iface = EV_SIDEBAR_PAGE_GET_IFACE (sidebar_page);
 
-       g_return_val_if_fail (iface->get_label, NULL);
+       g_assert (iface->get_label);
        
        return iface->get_label (sidebar_page);
 }
 
 
-static void ev_sidebar_page_iface_init (gpointer         iface)
+static void
+ev_sidebar_page_class_init (EvSidebarPageIface *iface)
 {
-       g_object_interface_install_property (iface,
-                                            g_param_spec_object ("main-widget",
-                                                                 "Main Widget",
-                                                                 "Main page widget, used to handle focus",
-                                                                 GTK_TYPE_WIDGET,
-                                                                 G_PARAM_READABLE));
+       static gboolean initialized = FALSE;
+       if (!initialized) {
+               g_object_interface_install_property (iface,
+                                                    g_param_spec_object ("main-widget",
+                                                                         "Main Widget",
+                                                                         "Main page widget, used to handle focus",
+                                                                         GTK_TYPE_WIDGET,
+                                                                         G_PARAM_READABLE));
+               initialized = TRUE;
+       }
 }