From: Carlos Garcia Campos Date: Mon, 3 Mar 2008 15:01:17 +0000 (+0000) Subject: Use g_type_module_add_interface instead of g_type_add_interface_static. X-Git-Tag: EVINCE_2_22_0~20 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=0c06dc4d1656051c9613973e8bef9c7dbfaa151d;p=evince.git Use g_type_module_add_interface instead of g_type_add_interface_static. 2008-03-03 Carlos Garcia Campos * 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 --- diff --git a/ChangeLog b/ChangeLog index 8cd1d17c..ecd577e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2008-03-03 Carlos Garcia Campos + + * 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 * shell/ev-transition-animation.[ch] (ev_transition_animation_ready): diff --git a/backend/comics/comics-document.c b/backend/comics/comics-document.c index b0d99ca6..127943d1 100644 --- a/backend/comics/comics-document.c +++ b/backend/comics/comics-document.c @@ -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 * diff --git a/backend/djvu/djvu-document.c b/backend/djvu/djvu-document.c index 6e1c5f3c..f4caa7f0 100644 --- a/backend/djvu/djvu-document.c +++ b/backend/djvu/djvu-document.c @@ -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); }); diff --git a/backend/impress/impress-document.c b/backend/impress/impress-document.c index 7fa0fbe0..8ceabd43 100644 --- a/backend/impress/impress-document.c +++ b/backend/impress/impress-document.c @@ -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 */ diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc index 52eb4928..a3ff1529 100644 --- a/backend/pdf/ev-poppler.cc +++ b/backend/pdf/ev-poppler.cc @@ -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 diff --git a/backend/pixbuf/pixbuf-document.c b/backend/pixbuf/pixbuf-document.c index 21c6bb93..ed7034be 100644 --- a/backend/pixbuf/pixbuf-document.c +++ b/backend/pixbuf/pixbuf-document.c @@ -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 diff --git a/backend/ps/ev-spectre.c b/backend/ps/ev-spectre.c index 1252b8d2..7e8d27bb 100644 --- a/backend/ps/ev-spectre.c +++ b/backend/ps/ev-spectre.c @@ -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 */ diff --git a/backend/ps/ps-document.c b/backend/ps/ps-document.c index abe81925..b65b2aa7 100644 --- a/backend/ps/ps-document.c +++ b/backend/ps/ps-document.c @@ -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 */ diff --git a/backend/tiff/tiff-document.c b/backend/tiff/tiff-document.c index 86170e27..146e4553 100644 --- a/backend/tiff/tiff-document.c +++ b/backend/tiff/tiff-document.c @@ -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; diff --git a/libdocument/ev-document.h b/libdocument/ev-document.h index 6e7232bb..bc040d14 100644 --- a/libdocument/ev-document.h +++ b/libdocument/ev-document.h @@ -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 \ diff --git a/properties/ev-properties-main.c b/properties/ev-properties-main.c index 15988cfc..c20abed7 100644 --- a/properties/ev-properties-main.c +++ b/properties/ev-properties-main.c @@ -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