From 31e16bd8f386dc292e60489d4a17227804bdc2e6 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Fri, 28 Dec 2007 18:13:32 +0000 Subject: Plugin system for backends. Fixes bug #351348. 2007-12-28 Carlos Garcia Campos * configure.ac: * Makefile.am: * po/POTFILES.in: * backend/comics/Makefile.am: * backend/comics/comics-document.[ch]: * backend/comics/comicsdocument.evince-backend.in: * backend/djvu/Makefile.am: * backend/djvu/djvu-document.[ch]: * backend/djvu/djvudocument.evince-backend.in: * backend/dvi/Makefile.am: * backend/dvi/dvi-document.[c]: * backend/dvi/dvidocument.evince-backend.in: * backend/impress/Makefile.am: * backend/impress/impress-document.[ch]: * backend/impress/impressdocument.evince-backend.in: * backend/pdf/Makefile.am: * backend/pdf/ev-poppler.cc: * backend/pdf/ev-poppler.h: * backend/pdf/pdfdocument.evince-backend.in: * backend/pixbuf/Makefile.am: * backend/pixbuf/pixbuf-document.[ch]: * backend/pixbuf/pixbufdocument.evince-backend.in: * backend/ps/Makefile.am: * backend/ps/ev-spectre.[ch]: * backend/ps/ps-document.[ch]: * backend/ps/psdocument.evince-backend.in: * backend/tiff/Makefile.am: * backend/tiff/tiff-document.[ch]: * backend/tiff/tiffdocument.evince-backend.in: * libdocument/Makefile.am: * libdocument/ev-backends-manager.[ch]: * libdocument/ev-module.[ch]: * libdocument/ev-document.h: * libdocument/ev-document-factory.[ch]: (gdk_pixbuf_mime_type_list), (mime_type_supported_by_gdk_pixbuf), (get_compression_from_mime_type), (get_document_from_uri), (ev_document_factory_get_document), (file_filter_add_mime_types), (ev_document_factory_add_filters): * shell/Makefile.am: * shell/ev-window-title.c: (get_filename_from_uri): * shell/main.c: (main): * thumbnailer/Makefile.am: * thumbnailer/evince-thumbnailer.c: (main): Plugin system for backends. Fixes bug #351348. svn path=/trunk/; revision=2786 --- (limited to 'backend/pdf') diff --git a/backend/pdf/Makefile.am b/backend/pdf/Makefile.am index 38d0831..4d2e549 100644 --- a/backend/pdf/Makefile.am +++ b/backend/pdf/Makefile.am @@ -1,13 +1,34 @@ +backenddir = $(libdir)/evince/backends + INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/libdocument \ + -DGNOMELOCALEDIR=\"$(datadir)/locale\" \ $(BACKEND_CFLAGS) \ $(POPPLER_CFLAGS) \ $(WARN_CXXFLAGS) \ $(DISABLE_DEPRECATED) -noinst_LTLIBRARIES = libpdfdocument.la +backend_LTLIBRARIES = libpdfdocument.la libpdfdocument_la_SOURCES = \ ev-poppler.cc \ ev-poppler.h + +libpdfdocument_la_LDFLAGS = $(BACKEND_LIBTOOL_FLAGS) +libpdfdocument_la_LIBADD = \ + $(top_builddir)/libdocument/libevbackend.la \ + $(BACKEND_LIBS) \ + $(POPPLER_LIBS) \ + $(CAIRO_PDF_LIBS) \ + $(CAIRO_PS_LIBS) + +backend_in_files = pdfdocument.evince-backend.in + +%.evince-backend: %.evince-backend.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache + +backend_DATA = $(backend_in_files:.evince-backend.in=.evince-backend) + +EXTRA_DIST = $(backend_DATA) + +CLEANFILES = $(backend_DATA) \ No newline at end of file diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc index 690c908..5b03980 100644 --- a/backend/pdf/ev-poppler.cc +++ b/backend/pdf/ev-poppler.cc @@ -123,10 +123,8 @@ static EvLink *ev_link_from_action (PdfDocument *pdf_document, static void pdf_document_search_free (PdfDocumentSearch *search); static void pdf_print_context_free (PdfPrintContext *ctx); -G_DEFINE_TYPE_WITH_CODE (PdfDocument, pdf_document, G_TYPE_OBJECT, - { - G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT, - pdf_document_document_iface_init); +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, @@ -1975,12 +1973,6 @@ pdf_document_page_transition_iface_init (EvDocumentTransitionIface *iface) iface->get_page_duration = pdf_document_get_page_duration; } -PdfDocument * -pdf_document_new (void) -{ - return PDF_DOCUMENT (g_object_new (PDF_TYPE_DOCUMENT, NULL)); -} - /* Forms */ static void pdf_document_get_crop_box (EvDocument *document, diff --git a/backend/pdf/ev-poppler.h b/backend/pdf/ev-poppler.h index 8cc65d1..8f9dcb6 100644 --- a/backend/pdf/ev-poppler.h +++ b/backend/pdf/ev-poppler.h @@ -30,8 +30,9 @@ G_BEGIN_DECLS typedef struct _PdfDocument PdfDocument; typedef struct _PdfDocumentClass PdfDocumentClass; -PdfDocument *pdf_document_new (void); -GType pdf_document_get_type (void) G_GNUC_CONST; +GType pdf_document_get_type (void) G_GNUC_CONST; + +G_MODULE_EXPORT GType register_evince_backend (GTypeModule *module); G_END_DECLS diff --git a/backend/pdf/pdfdocument.evince-backend.in b/backend/pdf/pdfdocument.evince-backend.in new file mode 100644 index 0000000..476afe3 --- /dev/null +++ b/backend/pdf/pdfdocument.evince-backend.in @@ -0,0 +1,5 @@ +[Evince Backend] +Module=pdfdocument +_TypeDescription=PDF Documents +MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf + -- cgit v0.9.1