Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2005-07-11 17:38:35 (GMT)
committer Marco Pesenti Gritti <marco@src.gnome.org>2005-07-11 17:38:35 (GMT)
commit13c49bea656a4f495e2c4baedab130eab367ae4f (patch)
treea987238e2e9b0bed2f6312df490d96c2641fb6c9
parent0202a575af908e78d0fd9c2a1730989f499d2fb3 (diff)
Allow to enable/disable the pixbuf backend. Default to off for now. If we
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.
-rw-r--r--ChangeLog17
-rw-r--r--Makefile.am12
-rw-r--r--backend/Makefile.am6
-rw-r--r--backend/ev-document-factory.c3
-rw-r--r--configure.ac11
-rw-r--r--properties/ev-properties-main.c6
-rw-r--r--shell/ev-document-types.c2
7 files changed, 49 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index b1ab898..404ed2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
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:
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) {