+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:
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])
])
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
+"
-DGNOMELOCALEDIR=\"$(datadir)/locale\" \
-DGNOMEICONDIR=\""$(datadir)/pixmaps"\" \
$(SHELL_CFLAGS) \
- $(WARN_CFLAGS)
+ $(WARN_CFLAGS) \
+ $(GNOME_PRINT_CFLAGS)
bin_PROGRAMS=evince
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 \
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
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
}
}
}
#endif /* HAVE_G_FILE_SET_CONTENTS */
+#ifdef WITH_GNOME_PRINT
gboolean
using_pdf_printer (GnomePrintConfig *config)
{
g_free (file_name);
g_free (str);
}
+#endif /* WITH_GNOME_PRINT */
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>
+#ifdef WITH_GNOME_PRINT
#include <libgnomeprintui/gnome-print-dialog.h>
+#endif
G_BEGIN_DECLS
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
#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>
/* Dialogs */
GtkWidget *properties;
+#ifdef WITH_GNOME_PRINT
GtkWidget *print_dialog;
+#endif
GtkWidget *password_dialog;
/* UI Builders */
/* 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[] = {
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);
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);
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)
{
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)
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 */