]> www.fi.muni.cz Git - evince.git/commitdiff
Allow to enable/disable the pixbuf backend. Default to off for now. If we
authorMarco Pesenti Gritti <mpg@redhat.com>
Mon, 11 Jul 2005 17:38:35 +0000 (17:38 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Mon, 11 Jul 2005 17:38:35 +0000 (17:38 +0000)
2005-07-11  Marco Pesenti Gritti  <mpg@redhat.com>

        * 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.

ChangeLog
Makefile.am
backend/Makefile.am
backend/ev-document-factory.c
configure.ac
properties/ev-properties-main.c
shell/ev-document-types.c

index b1ab898ef44defa101e2441b7f5e87a8068acf73..404ed2f4c792b2a603105619fbde5323c078933b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2005-07-11  Marco Pesenti Gritti  <mpg@redhat.com>
+
+       * 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  <mpg@redhat.com>
 
        * shell/ev-window.c:
index 67de01832b9bfea22150d15c64ad15426bc96f2c..ac591419edbca23166f8c0846744ec32e7b2090e 100644 (file)
@@ -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
index 30318d88e5b569bbf1be69cc8c21719094b48ef7..917215a529df10313833584c3033eb8e97540ae2 100644 (file)
@@ -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
index e73344a062ff2b2db560165612db366c9e0a4f6d..7071f844ff62c0a23ce5937e42417e0ff28d0c4f 100644 (file)
@@ -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;
 }
index ddb7b23f9a71073bc8a69a517c22630023cfbfd4..50cbfc6cfcb060d231b22c13d55176c005b2c31a 100644 (file)
@@ -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"
index c92a8042e7ad17c2d6bab7e35f3a2c3d4a006818..2e566d5505763b5397f4641f27f95162088434b5 100644 (file)
@@ -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"));
index cbe6c2410751cdac823b57efd384e6e5be8ebeae..f1bf9c93fe366d8cbcf43dce98f3869e9ad78b66 100644 (file)
@@ -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) {