From 13c49bea656a4f495e2c4baedab130eab367ae4f Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 11 Jul 2005 17:38:35 +0000 Subject: Allow to enable/disable the pixbuf backend. Default to off for now. If we 2005-07-11 Marco Pesenti Gritti * Makefile.am: * backend/Makefile.am: * backend/ev-document-factory.c: (ev_document_type_get_from_mime): * configure.ac: * shell/ev-document-types.c: (ev_document_types_add_filters): Allow to enable/disable the pixbuf backend. Default to off for now. If we want it enabled we should really put mime types in the desktop, implement properties etc. * properties/evince-properties.c: Initialize error to NULL. Check error is not NULL before freeing. --- diff --git a/ChangeLog b/ChangeLog index b1ab898..404ed2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,22 @@ 2005-07-11 Marco Pesenti Gritti + * Makefile.am: + * backend/Makefile.am: + * backend/ev-document-factory.c: (ev_document_type_get_from_mime): + * configure.ac: + * shell/ev-document-types.c: (ev_document_types_add_filters): + + Allow to enable/disable the pixbuf backend. + Default to off for now. If we want it enabled we should + really put mime types in the desktop, implement properties etc. + + * properties/evince-properties.c: + + Initialize error to NULL. + Check error is not NULL before freeing. + +2005-07-11 Marco Pesenti Gritti + * shell/ev-window.c: Use F5 as presentation accell diff --git a/Makefile.am b/Makefile.am index 67de018..ac59141 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,18 +2,22 @@ SUBDIRS = cut-n-paste po help data # Backends -SUBDIRS += pdf ps pixbuf +SUBDIRS += pdf ps + +if ENABLE_PIXBUF +SUBDIRS += pixbuf +endif if ENABLE_DJVU - SUBDIRS += djvu +SUBDIRS += djvu endif if ENABLE_TIFF - SUBDIRS += tiff +SUBDIRS += tiff endif if ENABLE_DVI - SUBDIRS += dvi +SUBDIRS += dvi endif SUBDIRS += backend diff --git a/backend/Makefile.am b/backend/Makefile.am index 30318d8..917215a 100644 --- a/backend/Makefile.am +++ b/backend/Makefile.am @@ -45,9 +45,13 @@ libevbackend_la_SOURCES= \ libevbackend_la_LIBADD = \ $(top_builddir)/pdf/libpdfdocument.la \ - $(top_builddir)/pixbuf/libpixbufdocument.la \ $(top_builddir)/ps/libpsdocument.la +if ENABLE_PIXBUF +libevbackend_la_LIBADD += \ + $(top_builddir)/pixbuf/libpixbufdocument.la +endif + if ENABLE_DJVU libevbackend_la_LIBADD += \ $(top_builddir)/djvu/libgtkdjvu.la diff --git a/backend/ev-document-factory.c b/backend/ev-document-factory.c index e73344a..7071f84 100644 --- a/backend/ev-document-factory.c +++ b/backend/ev-document-factory.c @@ -123,10 +123,11 @@ ev_document_type_get_from_mime (const char *mime_type) return document_types[i].document_type_factory_callback(); } } - +#ifdef ENABLE_PIXBUF if (mime_type_supported_by_gdk_pixbuf (mime_type)) { return pixbuf_document_get_type (); } +#endif return G_TYPE_INVALID; } diff --git a/configure.ac b/configure.ac index ddb7b23..50cbfc6 100644 --- a/configure.ac +++ b/configure.ac @@ -248,6 +248,17 @@ AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes) dnl ================== End of dvi checks =================================================== +dnl ================== pixbuf checks =================================================== + +AC_ARG_ENABLE(pixbuf, + [AC_HELP_STRING([--enable-pixbuf], [Compile with support of pixbuf])],enable_pixbuf="$enableval",enable_pixbuf=no) +if test "x$enable_pixbuf" = "xyes"; then + AC_DEFINE([ENABLE_PIXBUF], [1], [Enable pixbuf support.]) +fi +AM_CONDITIONAL(ENABLE_PIXBUF, test x$enable_pixbuf = xyes) + +dnl ================== End of dvi checks =================================================== + dnl =================== Mime types list ==================================================== EVINCE_MIME_TYPES="application/pdf;application/postscript;application/x-gzpostscript" diff --git a/properties/ev-properties-main.c b/properties/ev-properties-main.c index c92a804..2e566d5 100644 --- a/properties/ev-properties-main.c +++ b/properties/ev-properties-main.c @@ -82,7 +82,7 @@ static GList * ev_properties_get_pages (NautilusPropertyPageProvider *provider, GList *files) { - GError *error; + GError *error = NULL; char *mime; EvDocument *document; GList *pages = NULL; @@ -106,7 +106,9 @@ ev_properties_get_pages (NautilusPropertyPageProvider *provider, uri = nautilus_file_info_get_uri (file); if (!ev_document_load (document, uri, &error)) { - g_error_free (error); + if (error) { + g_error_free (error); + } goto end; } label = gtk_label_new (_("Document")); diff --git a/shell/ev-document-types.c b/shell/ev-document-types.c index cbe6c24..f1bf9c9 100644 --- a/shell/ev-document-types.c +++ b/shell/ev-document-types.c @@ -152,12 +152,14 @@ ev_document_types_add_filters (GtkWidget *chooser, EvDocument *document) gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter); } +#ifdef ENABLE_PIXBUF if (document == NULL || backend == EV_BACKEND_PIXBUF) { default_filter = filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, _("Images")); gtk_file_filter_add_pixbuf_formats (filter); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter); } +#endif #ifdef ENABLE_DVI if (document == NULL || backend == EV_BACKEND_DVI) { -- cgit v0.9.1