Commit 0c06dc4d authored by Carlos Garcia Campos's avatar Carlos Garcia Campos Committed by Carlos Garcia Campos

Use g_type_module_add_interface instead of g_type_add_interface_static.

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
parent a00ee873
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):
......
......@@ -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 *
......
......@@ -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);
});
......
......@@ -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 */
......
......@@ -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
......
......@@ -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
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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;
......
......@@ -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 \
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment