]> www.fi.muni.cz Git - evince.git/commitdiff
Make printing support optional. Patch from Eduardo de Barros Lima
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Fri, 10 Feb 2006 04:36:12 +0000 (04:36 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Fri, 10 Feb 2006 04:36:12 +0000 (04:36 +0000)
* configure.ac:
* shell/Makefile.am:
* shell/ev-sidebar-links.c: (print_section_cb):
* shell/ev-utils.c:
* shell/ev-utils.h:
* shell/ev-window.c: (update_action_sensitivity),
(ev_window_close_dialogs), (ev_window_print):
* shell/ev-window.h:

Make printing support optional. Patch from Eduardo de Barros Lima
<eduardo.lima@indt.org.br> for the bug #330546.

ChangeLog
configure.ac
shell/Makefile.am
shell/ev-sidebar-links.c
shell/ev-utils.c
shell/ev-utils.h
shell/ev-window.c
shell/ev-window.h

index ec1efdd8e6ef2b35c867966bd2aa533ce84e1c69..61b2f1e879b34df99a864da555aeafd7b784b58b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2006-02-10  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * configure.ac:
+       * shell/Makefile.am:
+       * shell/ev-sidebar-links.c: (print_section_cb):
+       * shell/ev-utils.c:
+       * shell/ev-utils.h:
+       * shell/ev-window.c: (update_action_sensitivity),
+       (ev_window_close_dialogs), (ev_window_print):
+       * shell/ev-window.h:
+       
+       Make printing support optional. Patch from Eduardo de Barros Lima
+       <eduardo.lima@indt.org.br> for the bug #330546.
+
 2006-02-07  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * shell/ev-view-private.h:
index 97669dad812eb3c44a5f950a8c5a116f3c2b41ca..3035de75d85c454853ec19186c584264b132f581 100644 (file)
@@ -48,16 +48,40 @@ DBUS_GLIB_REQUIRED=0.33
 GTK_REQUIRED=2.6.0
 LIBGNOMEUI_REQUIRED=2.6.0
 KEYRING_REQUIRED=0.4.0
+LIBGNOMEPRINTUI_REQUIRED=2.5.1
 
 PKG_CHECK_MODULES(LIB, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED)
 PKG_CHECK_MODULES(BACKEND, gtk+-2.0 >= $GTK_REQUIRED gnome-vfs-2.0)
 PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED libglade-2.0 poppler-glib >= $POPPLER_REQUIRED)
 PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_REQUIRED)
-PKG_CHECK_MODULES(SHELL_CORE, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED gnome-vfs-2.0 libgnomeprint-2.2 >= 2.5.1 libgnomeprintui-2.2 libglade-2.0 gconf-2.0 poppler-glib >= $POPPLER_REQUIRED gnome-keyring-1 >= $KEYRING_REQUIRED)
+PKG_CHECK_MODULES(SHELL_CORE, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED gnome-vfs-2.0 libglade-2.0 gconf-2.0 poppler-glib >= $POPPLER_REQUIRED gnome-keyring-1 >= $KEYRING_REQUIRED)
 
 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`  
 AC_SUBST(GLIB_GENMARSHAL)
 
+
+dnl ========= Check for libgnomeprintui
+AC_ARG_ENABLE(gnome-print,
+       [AC_HELP_STRING([--disable-gnome-print], [Compile without print support])],
+       enable_gnome_print="$enableval",
+       enable_gnome_print=yes)
+
+if test x$enable_gnome_print = xyes; then
+       PKG_CHECK_MODULES(GNOME_PRINT, 
+               libgnomeprintui-2.2 >= $LIBGNOMEPRINTUI_REQUIRED,
+               enable_gnome_print=yes, enable_gnome_print=no)
+fi
+
+AC_SUBST(GNOME_PRINT_CFLAGS)
+AC_SUBST(GNOME_PRINT_LIBS)
+
+if test x$enable_gnome_print = xyes; then
+       AC_DEFINE([WITH_GNOME_PRINT],[1],[Enable Print Support.])
+fi 
+
+AM_CONDITIONAL(WITH_GNOME_PRINT, test x$enable_gnome_print = xyes)
+
+dnl ========= Check for DBUS
 PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED],
        [enable_dbus=yes],[enable_dbus=no])
 AC_SUBST([DBUS_CFLAGS])
@@ -339,3 +363,17 @@ help/Makefile
 ])
 
 AC_OUTPUT
+
+echo "
+Configure summary:
+       Print Support......:  $enable_gnome_print
+       DBUS Support.......:  $enable_dbus
+       Nautilus Plugin....:  $HAVE_NAUTILUS
+
+       PostScript Backend.:  $enable_ps
+       TIFF Backend.......:  $enable_tiff
+       DJVU Backend.......:  $enable_djvu
+       DVI Backend........:  $enable_dvi
+       Pixbuf Backend.....:  $enable_pixbuf
+       Comics Backend.....:  $enable_comics
+"
index 0fed805e35d7204f5462744419284e15f6783107..26b195e7c54fcc9f3aae44dea067844c881ad452 100644 (file)
@@ -10,7 +10,8 @@ INCLUDES=                                             \
        -DGNOMELOCALEDIR=\"$(datadir)/locale\"          \
        -DGNOMEICONDIR=\""$(datadir)/pixmaps"\"         \
        $(SHELL_CFLAGS)                                 \
-       $(WARN_CFLAGS)                                  
+       $(WARN_CFLAGS)                                  \
+       $(GNOME_PRINT_CFLAGS)
 
 bin_PROGRAMS=evince
 
@@ -41,8 +42,6 @@ evince_SOURCES=                               \
        ev-password-view.c              \
        ev-pixbuf-cache.c               \
        ev-pixbuf-cache.h               \
-       ev-print-job.c                  \
-       ev-print-job.h                  \
        ev-properties-dialog.c          \
        ev-properties-dialog.h          \
        ev-properties-fonts.c           \
@@ -70,13 +69,21 @@ evince_SOURCES=                             \
        ev-stock-icons.h                \
        main.c
 
+if WITH_GNOME_PRINT
+evince_SOURCES+=                       \
+       ev-print-job.c                  \
+       ev-print-job.h
+endif
+
+
 evince_LDADD=                                                          \
        $(top_builddir)/cut-n-paste/recent-files/librecent.la           \
        $(top_builddir)/cut-n-paste/zoom-control/libephyzoom.la         \
        $(top_builddir)/cut-n-paste/toolbar-editor/libtoolbareditor.la  \
        $(top_builddir)/properties/libevproperties.la                   \
-       $(top_builddir)/lib/libev.la    \
-       $(SHELL_LIBS)
+       $(top_builddir)/lib/libev.la                                    \
+       $(SHELL_LIBS)                                                   \
+       $(GNOME_PRINT_LIBS)
 
 BUILT_SOURCES = ev-marshal.h ev-marshal.c
 
index ac728ed6b15fec191331000360653187cca8cf26..386cdd5f141798941f1bb40b9e42154455d746ef 100644 (file)
@@ -299,8 +299,10 @@ print_section_cb (GtkWidget *menuitem, EvSidebarLinks *sidebar)
        
                window = gtk_widget_get_toplevel (GTK_WIDGET (sidebar));
                if (EV_IS_WINDOW (window)) {
+#ifdef WITH_GNOME_PRINT
                        ev_window_print_range (EV_WINDOW (window),
                                               first_page, last_page);
+#endif
                }
        }
 }
index 75087869b0d26f9f3a95b1d5eafe44131b07796a..3dc849c733a030c32ee6d76620238c2cba8ed46e 100644 (file)
@@ -420,6 +420,7 @@ ev_file_set_contents (const gchar *filename,
 
 #endif /* HAVE_G_FILE_SET_CONTENTS */
 
+#ifdef WITH_GNOME_PRINT
 gboolean
 using_pdf_printer (GnomePrintConfig *config)
 {
@@ -511,5 +512,6 @@ save_print_config_to_file (GnomePrintConfig *config)
        g_free (file_name);
        g_free (str);
 }
+#endif /* WITH_GNOME_PRINT */
 
 
index fbacb0fd21a07503d85bc6abaa2c319399a4f5b7..1d7e882f5fec2e59e248297ff11fb2ce111370fc 100644 (file)
@@ -23,7 +23,9 @@
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <gtk/gtk.h>
+#ifdef WITH_GNOME_PRINT
 #include <libgnomeprintui/gnome-print-dialog.h>
+#endif
 
 G_BEGIN_DECLS
 
@@ -32,11 +34,12 @@ GdkPixbuf*          ev_pixbuf_add_shadow (GdkPixbuf *src, int size,
 
 void                   ev_print_region_contents (GdkRegion *region);
 
-
+#ifdef WITH_GNOME_PRINT
 GnomePrintConfig*      load_print_config_from_file (void);
 void                   save_print_config_to_file (GnomePrintConfig *config);
 gboolean               using_postscript_printer (GnomePrintConfig *config);
 gboolean               using_pdf_printer (GnomePrintConfig *config);
+#endif
 
 G_END_DECLS
 
index 5424c6a2e01a5b96c6b98088b7ca4af9d69191bc..60479ba74a2ed085aac93ec61437d81bb9dffc5f 100644 (file)
@@ -37,7 +37,6 @@
 #include "ev-view.h"
 #include "ev-password.h"
 #include "ev-password-view.h"
-#include "ev-print-job.h"
 #include "ev-properties-dialog.h"
 #include "ev-ps-exporter.h"
 #include "ev-document-thumbnails.h"
 #include "ev-utils.h"
 #include "ev-debug.h"
 
+#ifdef WITH_GNOME_PRINT
+#include "ev-print-job.h"
+#include <libgnomeprintui/gnome-print-dialog.h>
+#endif
+
 #include <poppler.h>
 
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <gnome.h>
-#include <libgnomeprintui/gnome-print-dialog.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
 #include <gconf/gconf-client.h>
 
@@ -108,7 +111,9 @@ struct _EvWindowPrivate {
 
        /* Dialogs */
        GtkWidget *properties;
+#ifdef WITH_GNOME_PRINT
        GtkWidget *print_dialog;
+#endif
        GtkWidget *password_dialog;
 
        /* UI Builders */
@@ -139,7 +144,9 @@ struct _EvWindowPrivate {
        /* Job used to load document */
        EvJob *xfer_job;
        EvJob *load_job;
+#ifdef WITH_GNOME_PRINT
        GnomePrintJob *print_job;
+#endif
 };
 
 static const GtkTargetEntry ev_drop_types[] = {
@@ -275,6 +282,10 @@ update_action_sensitivity (EvWindow *ev_window)
                ok_to_copy_text = ev_view_get_has_selection (view);
        }
        
+#ifndef WITH_GNOME_PRINT
+       ok_to_print = FALSE;
+#endif
+
        /* File menu */
        /* "FileOpen": always sensitive */
        set_action_sensitive (ev_window, "FileSaveAs", has_document && ok_to_copy);
@@ -1047,12 +1058,14 @@ ev_window_close_dialogs (EvWindow *ev_window)
                gtk_widget_destroy (ev_window->priv->password_dialog);
        ev_window->priv->password_dialog = NULL;
 
+#ifdef WITH_GNOME_PRINT
        if (ev_window->priv->print_dialog) {
                gtk_widget_destroy (ev_window->priv->print_dialog);
                g_object_unref (ev_window->priv->print_job);
        }
        ev_window->priv->print_dialog = NULL;
        ev_window->priv->print_job = NULL;
+#endif
 
        if (ev_window->priv->properties)
                gtk_widget_destroy (ev_window->priv->properties);
@@ -1261,10 +1274,13 @@ ev_window_print (EvWindow *window)
        page_cache = ev_page_cache_get (window->priv->document);
        last_page = ev_page_cache_get_n_pages (page_cache);
 
+#ifdef WITH_GNOME_PRINT
        ev_window_print_range (window, 1, last_page);
+#endif
 }
 
 
+#ifdef WITH_GNOME_PRINT
 static gboolean
 ev_window_print_dialog_response_cb (GtkDialog *print_dialog, gint response, gpointer data)
 {
@@ -1368,6 +1384,7 @@ ev_window_print_range (EvWindow *ev_window, int first_page, int last_page)
        gtk_widget_show (ev_window->priv->print_dialog);
        return;
 }
+#endif /* WITH_GNOME_PRINT */
        
 static void
 ev_window_cmd_file_print (GtkAction *action, EvWindow *ev_window)
index 0368f8069a1be8d2434605e7cc5ae511be75af09..fb6234de17bae4d0a7263f0d243e4d50739f3b77 100644 (file)
@@ -59,9 +59,11 @@ void         ev_window_open_uri        (EvWindow       *ev_window,
 void           ev_window_open_page_label (EvWindow       *ev_window,
                                           const char     *label);
 gboolean       ev_window_is_empty        (const EvWindow *ev_window);
+#ifdef WITH_GNOME_PRINT
 void           ev_window_print_range     (EvWindow       *ev_window,
                                           int             first_page,
                                           int             last_page);
+#endif
 G_END_DECLS
 
 #endif /* !EV_WINDOW_H */