]> www.fi.muni.cz Git - evince.git/commitdiff
Use g_type_module_add_interface instead of g_type_add_interface_static.
authorCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 3 Mar 2008 15:01:17 +0000 (15:01 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Mon, 3 Mar 2008 15:01:17 +0000 (15:01 +0000)
2008-03-03  Carlos Garcia Campos  <carlosgc@gnome.org>

* backend/comics/comics-document.c:
* backend/djvu/djvu-document.c:
* backend/impress/impress-document.c:
* backend/pdf/ev-poppler.cc:
* backend/pixbuf/pixbuf-document.c:
* backend/ps/ev-spectre.c:
* backend/ps/ps-document.c:
* backend/tiff/tiff-document.c:
* libdocument/ev-document.h:
* properties/ev-properties-main.c:

Use g_type_module_add_interface instead of
g_type_add_interface_static. Fixes bug #519679.

svn path=/trunk/; revision=2942

ChangeLog
backend/comics/comics-document.c
backend/djvu/djvu-document.c
backend/impress/impress-document.c
backend/pdf/ev-poppler.cc
backend/pixbuf/pixbuf-document.c
backend/ps/ev-spectre.c
backend/ps/ps-document.c
backend/tiff/tiff-document.c
libdocument/ev-document.h
properties/ev-properties-main.c

index 8cd1d17c93624bd078207b5ee7e186468476e3c8..ecd577e7def5cbf87e8ad5ee4a8f0d077be982de 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2008-03-03  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * backend/comics/comics-document.c:
+       * backend/djvu/djvu-document.c:
+       * backend/impress/impress-document.c:
+       * backend/pdf/ev-poppler.cc:
+       * backend/pixbuf/pixbuf-document.c:
+       * backend/ps/ev-spectre.c:
+       * backend/ps/ps-document.c:
+       * backend/tiff/tiff-document.c:
+       * libdocument/ev-document.h:
+       * properties/ev-properties-main.c:
+
+       Use g_type_module_add_interface instead of
+       g_type_add_interface_static. Fixes bug #519679.
+       
 2008-02-29  Carlos Garnacho  <carlosg@gnome.org>
 
        * shell/ev-transition-animation.[ch] (ev_transition_animation_ready):
index b0d99ca64069cc74eeb75858c389edf35a2ed297..127943d135353b51558b51be5510a3e3e72a5a58 100644 (file)
@@ -64,8 +64,8 @@ static char**     extract_argv                   (EvDocument *document,
 
 EV_BACKEND_REGISTER_WITH_CODE (ComicsDocument, comics_document,
        {
-               G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
-                                      comics_document_document_thumbnails_iface_init);
+               EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
+                                               comics_document_document_thumbnails_iface_init);
        } );
 
 static char *
index 6e1c5f3c378287d4eb9524acb4d6a9643f0e9c16..f4caa7f0f36bdc8c594a0dfa5b3c4883468420da 100644 (file)
@@ -60,11 +60,11 @@ static void djvu_selection_iface_init (EvSelectionIface *iface);
 
 EV_BACKEND_REGISTER_WITH_CODE (DjvuDocument, djvu_document,
     {
-      G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS, djvu_document_document_thumbnails_iface_init);
-      G_IMPLEMENT_INTERFACE (EV_TYPE_FILE_EXPORTER, djvu_document_file_exporter_iface_init);
-      G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_FIND, djvu_document_find_iface_init);
-      G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_LINKS, djvu_document_document_links_iface_init);
-      G_IMPLEMENT_INTERFACE (EV_TYPE_SELECTION, djvu_selection_iface_init);
+      EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS, djvu_document_document_thumbnails_iface_init);
+      EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_FILE_EXPORTER, djvu_document_file_exporter_iface_init);
+      EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_FIND, djvu_document_find_iface_init);
+      EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_LINKS, djvu_document_document_links_iface_init);
+      EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_SELECTION, djvu_selection_iface_init);
      });
 
 
index 7fa0fbe0ad93ad44d99456766c0d87c4f208c556..8ceabd43d967419d6d1155e6f6a812a4e1891b28 100644 (file)
@@ -63,8 +63,8 @@ static void impress_document_document_thumbnails_iface_init (EvDocumentThumbnail
 
 EV_BACKEND_REGISTER_WITH_CODE (ImpressDocument, impress_document,
                         {
-                          G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
-                                                 impress_document_document_thumbnails_iface_init);
+                          EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
+                                                          impress_document_document_thumbnails_iface_init);
                         });
 
 /* Renderer */
index 52eb49286517052323c21804279cdd7608748ce4..a3ff1529fa47753398498d639068fc7c99818eb5 100644 (file)
@@ -126,26 +126,26 @@ static void        pdf_print_context_free   (PdfPrintContext   *ctx);
 
 EV_BACKEND_REGISTER_WITH_CODE (PdfDocument, pdf_document,
                         {
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_SECURITY,
-                                                       pdf_document_security_iface_init);
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
-                                                       pdf_document_document_thumbnails_iface_init);
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_LINKS,
-                                                       pdf_document_document_links_iface_init);
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_IMAGES,
-                                                       pdf_document_document_images_iface_init);
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_FORMS,
-                                                       pdf_document_document_forms_iface_init);
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_FONTS,
-                                                       pdf_document_document_fonts_iface_init);
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_FIND,
-                                                       pdf_document_find_iface_init);
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_FILE_EXPORTER,
-                                                       pdf_document_file_exporter_iface_init);
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_SELECTION,
-                                                       pdf_selection_iface_init);
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_TRANSITION,
-                                                       pdf_document_page_transition_iface_init);
+                                EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_SECURITY,
+                                                                pdf_document_security_iface_init);
+                                EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
+                                                                pdf_document_document_thumbnails_iface_init);
+                                EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_LINKS,
+                                                                pdf_document_document_links_iface_init);
+                                EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_IMAGES,
+                                                                pdf_document_document_images_iface_init);
+                                EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_FORMS,
+                                                                pdf_document_document_forms_iface_init);
+                                EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_FONTS,
+                                                                pdf_document_document_fonts_iface_init);
+                                EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_FIND,
+                                                                pdf_document_find_iface_init);
+                                EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_FILE_EXPORTER,
+                                                                pdf_document_file_exporter_iface_init);
+                                EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_SELECTION,
+                                                                pdf_selection_iface_init);
+                                EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_TRANSITION,
+                                                                pdf_document_page_transition_iface_init);
                         });
 
 static void
index 21c6bb936e9454bf1425eace7b24e73461a545df..ed7034bed287aa2f7a410bc3974eaf76f4999d3f 100644 (file)
@@ -46,8 +46,8 @@ static void pixbuf_document_document_thumbnails_iface_init (EvDocumentThumbnails
 
 EV_BACKEND_REGISTER_WITH_CODE (PixbufDocument, pixbuf_document,
                    {
-                        G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
-                                               pixbuf_document_document_thumbnails_iface_init)                            
+                        EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
+                                                        pixbuf_document_document_thumbnails_iface_init)                                   
                   });
 
 static gboolean
index 1252b8d2faa18c07b7dc9c51b747d4ad4d0d44f5..7e8d27bb4e5f23e3131b529cadce09aa6828cc19 100644 (file)
@@ -47,10 +47,10 @@ static void ps_document_document_thumbnails_iface_init (EvDocumentThumbnailsIfac
 
 EV_BACKEND_REGISTER_WITH_CODE (PSDocument, ps_document,
                          {
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
-                                                       ps_document_document_thumbnails_iface_init);
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_FILE_EXPORTER,
-                                                       ps_document_file_exporter_iface_init);
+                                EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
+                                                                ps_document_document_thumbnails_iface_init);
+                                EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_FILE_EXPORTER,
+                                                                ps_document_file_exporter_iface_init);
                         });
 
 /* PSDocument */
index abe819250c42dc13fa8a0b8b26140e9202aa10c4..b65b2aa71d7cdeaa5c444f10491d171bac6d8551 100644 (file)
@@ -76,12 +76,12 @@ static void     ps_interpreter_page_rendered               (PSInterpreter
 
 EV_BACKEND_REGISTER_WITH_CODE (PSDocument, ps_document,
                          {
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
-                                                       ps_document_document_thumbnails_iface_init);
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_FILE_EXPORTER,
-                                                       ps_document_file_exporter_iface_init);
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_ASYNC_RENDERER,
-                                                       ps_async_renderer_iface_init);
+                                EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
+                                                                ps_document_document_thumbnails_iface_init);
+                                EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_FILE_EXPORTER,
+                                                                ps_document_file_exporter_iface_init);
+                                EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_ASYNC_RENDERER,
+                                                                ps_async_renderer_iface_init);
                         });
 
 /* PSDocument */
index 86170e270b7f290d728cf9ba237086d52977ca8f..146e45539e78b3eec6c65749844c6e54b5d592a7 100644 (file)
@@ -59,10 +59,10 @@ static void tiff_document_document_file_exporter_iface_init (EvFileExporterIface
 
 EV_BACKEND_REGISTER_WITH_CODE (TiffDocument, tiff_document,
                         {
-                          G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
-                                                 tiff_document_document_thumbnails_iface_init);
-                          G_IMPLEMENT_INTERFACE (EV_TYPE_FILE_EXPORTER,
-                                                 tiff_document_document_file_exporter_iface_init);
+                          EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
+                                                          tiff_document_document_thumbnails_iface_init);
+                          EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_FILE_EXPORTER,
+                                                          tiff_document_document_file_exporter_iface_init);
                         });
 
 static TIFFErrorHandler orig_error_handler = NULL;
index 6e7232bb0d7686036cec931f476364ee76ace5d2..bc040d14fa93913d8004d31576405c2b7e1f396e 100644 (file)
@@ -126,6 +126,24 @@ cairo_surface_t *ev_document_render           (EvDocument      *document,
 gint            ev_rect_cmp                   (EvRectangle     *a,
                                                EvRectangle     *b);
 
+/* convenience macro to ease interface addition in the CODE
+ * section of EV_BACKEND_REGISTER_WITH_CODE (this macro relies on
+ * the g_define_type_id present within EV_BACKEND_REGISTER_WITH_CODE()).
+ * usage example:
+ * EV_BACKEND_REGISTER_WITH_CODE (PdfDocument, pdf_document,
+ *                          EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
+ *                                                 pdf_document_document_thumbnails_iface_init));
+ */
+#define EV_BACKEND_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init) {                \
+       const GInterfaceInfo g_implement_interface_info = {                     \
+               (GInterfaceInitFunc) iface_init, NULL, NULL                     \
+       };                                                                      \
+       g_type_module_add_interface (module,                                    \
+                                    g_define_type_id,                          \
+                                    TYPE_IFACE,                                \
+                                    &g_implement_interface_info);              \
+}
+
 /*
  * Utility macro used to register backends
  *
@@ -174,8 +192,8 @@ register_evince_backend (GTypeModule *module)                                       \
                                            #BackendName,                       \
                                            &our_info,                          \
                                           (GTypeFlags)0);                      \
-                                                                               \
-       G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT,                                \
+                                                                               \
+       EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT,                       \
                                backend_name##_document_iface_init);             \
                                                                                \
        CODE                                                                    \
index 15988cfc6166e15ad4308f516c9b4e71212f2fb3..c20abed73ed83ef2d35e3d97481bb0f98a0a806b 100644 (file)
@@ -90,7 +90,7 @@ ev_properties_get_pages (NautilusPropertyPageProvider *provider,
        char *uri = NULL;
        GtkWidget *page, *label;
        NautilusPropertyPage *property_page;
-       
+
        /* only add properties page if a single file is selected */
        if (files == NULL || files->next != NULL)
                goto end;
@@ -141,6 +141,7 @@ nautilus_module_initialize (GTypeModule *module)
 void
 nautilus_module_shutdown (void)
 {
+       ev_backends_manager_shutdown ();
 }
 
 void