Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/libdocument
diff options
context:
space:
mode:
authorcarlosgc <carlosgc@e12069bd-dc25-0410-a696-d39a8afcd844>2008-03-03 15:01:17 (GMT)
committer carlosgc <carlosgc@e12069bd-dc25-0410-a696-d39a8afcd844>2008-03-03 15:01:17 (GMT)
commit0a758bb4102a8dfa5fdf4b372a5f35fb5583a289 (patch)
tree1868f30331d8c596718c24c17b9c52073ed8060b /libdocument
parent458a185e24e589120978103e46e4f33558663cf2 (diff)
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. git-svn-id: svn+ssh://svn.gnome.org/svn/evince/trunk@2942 e12069bd-dc25-0410-a696-d39a8afcd844
Diffstat (limited to 'libdocument')
-rw-r--r--libdocument/ev-document.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/libdocument/ev-document.h b/libdocument/ev-document.h
index 6e7232b..bc040d1 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 \