Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/backend/djvu
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2007-12-28 18:13:32 (GMT)
committer Carlos Garcia Campos <carlosgc@src.gnome.org>2007-12-28 18:13:32 (GMT)
commit31e16bd8f386dc292e60489d4a17227804bdc2e6 (patch)
tree84a81ef8fa45a24351f9e8f2c0e5f2eeb20064c2 /backend/djvu
parent8fd7569d7f146b1b21365d5afcfb7795756e544f (diff)
Plugin system for backends. Fixes bug #351348.
2007-12-28 Carlos Garcia Campos <carlosgc@gnome.org> * 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
Diffstat (limited to 'backend/djvu')
-rw-r--r--backend/djvu/Makefile.am44
-rw-r--r--backend/djvu/djvu-document.c9
-rw-r--r--backend/djvu/djvu-document.h4
-rw-r--r--backend/djvu/djvudocument.evince-backend.in4
4 files changed, 44 insertions, 17 deletions
diff --git a/backend/djvu/Makefile.am b/backend/djvu/Makefile.am
index fa44bbb..ea5f904 100644
--- a/backend/djvu/Makefile.am
+++ b/backend/djvu/Makefile.am
@@ -1,22 +1,44 @@
+backenddir = $(libdir)/evince/backends
+
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/libdocument \
-DGNOMEICONDIR=\""${prefix}/${DATADIRNAME}/pixmaps"\" \
- $(LIB_CFLAGS) \
- $(DJVU_CFLAGS)
+ -DGNOMELOCALEDIR=\"$(datadir)/locale\" \
+ $(BACKEND_CFLAGS) \
+ $(DJVU_CFLAGS) \
+ $(WARN_CFLAGS) \
+ $(DISABLE_DEPRECATED)
-noinst_LTLIBRARIES = libgtkdjvu.la
+backend_LTLIBRARIES = libdjvudocument.la
-libgtkdjvu_la_SOURCES = \
- djvu-document.c \
- djvu-document.h \
+libdjvudocument_la_SOURCES = \
+ djvu-document.c \
+ djvu-document.h \
djvu-document-private.h \
- djvu-links.c \
- djvu-links.h \
- djvu-text.c \
- djvu-text.h \
- djvu-text-page.c \
+ djvu-links.c \
+ djvu-links.h \
+ djvu-text.c \
+ djvu-text.h \
+ djvu-text-page.c \
djvu-text-page.h
+libdjvudocument_la_LDFLAGS = $(BACKEND_LIBTOOL_FLAGS)
+libdjvudocument_la_LIBADD = \
+ $(top_builddir)/libdocument/libevbackend.la \
+ $(BACKEND_LIBS) \
+ $(DJVU_LIBS)
+
+backend_in_files = djvudocument.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)
+
+
diff --git a/backend/djvu/djvu-document.c b/backend/djvu/djvu-document.c
index 2b9dee7..e16ec6a 100644
--- a/backend/djvu/djvu-document.c
+++ b/backend/djvu/djvu-document.c
@@ -17,6 +17,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include "config.h"
+
#include "djvu-document.h"
#include "djvu-text.h"
#include "djvu-links.h"
@@ -27,6 +29,7 @@
#include "ev-document-find.h"
#include "ev-document-links.h"
#include "ev-selection.h"
+#include "ev-file-helpers.h"
#include <gdk-pixbuf/gdk-pixbuf-core.h>
#include <glib/gi18n.h>
@@ -54,10 +57,8 @@ static void djvu_document_find_iface_init (EvDocumentFindIface *iface);
static void djvu_document_document_links_iface_init (EvDocumentLinksIface *iface);
static void djvu_selection_iface_init (EvSelectionIface *iface);
-G_DEFINE_TYPE_WITH_CODE
- (DjvuDocument, djvu_document, G_TYPE_OBJECT,
+EV_BACKEND_REGISTER_WITH_CODE (DjvuDocument, djvu_document,
{
- G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT, djvu_document_document_iface_init);
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);
@@ -262,7 +263,7 @@ djvu_document_render (EvDocument *document,
rowstride = page_width * 4;
pixels = (gchar *) g_malloc (page_height * rowstride);
- surface = cairo_image_surface_create_for_data (pixels,
+ surface = cairo_image_surface_create_for_data ((guchar *)pixels,
CAIRO_FORMAT_RGB24,
page_width,
page_height,
diff --git a/backend/djvu/djvu-document.h b/backend/djvu/djvu-document.h
index 402f476..3a5cd6f 100644
--- a/backend/djvu/djvu-document.h
+++ b/backend/djvu/djvu-document.h
@@ -29,9 +29,9 @@ G_BEGIN_DECLS
typedef struct _DjvuDocument DjvuDocument;
-DjvuDocument *djvu_document_new (void);
+GType djvu_document_get_type (void) G_GNUC_CONST;
-GType djvu_document_get_type (void) G_GNUC_CONST;
+G_MODULE_EXPORT GType register_evince_backend (GTypeModule *module);
G_END_DECLS
diff --git a/backend/djvu/djvudocument.evince-backend.in b/backend/djvu/djvudocument.evince-backend.in
new file mode 100644
index 0000000..716dabf
--- /dev/null
+++ b/backend/djvu/djvudocument.evince-backend.in
@@ -0,0 +1,4 @@
+[Evince Backend]
+Module=djvudocument
+_TypeDescription=Djvu Documents
+MimeType=image/vnd.djvu