From 4094f85bec2a1f27274e42411555fc1ede846775 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Sun, 03 Dec 2006 20:35:46 +0000 Subject: Allow printing to PDF when suppoted by the backend. 2006-12-03 Carlos Garcia Campos * configure.ac: * backend/Makefile.am: * backend/ev-file-exporter.[ch]: * pdf/ev-poppler.cc: (pdf_document_file_exporter_*): * ps/ps-document.c: (ps_document_file_exporter_*): * tiff/tiff-document.c: (tiff_document_document_file_exporter_*): * shell/ev-jobs.[ch]: (ev_job_print_new), (ev_job_print_run): * shell/ev-window.c: (ev_window_setup_action_sensitivity), (ev_window_print_dialog_response_cb), (ev_window_print_range): Allow printing to PDF when suppoted by the backend. --- (limited to 'tiff/tiff-document.c') diff --git a/tiff/tiff-document.c b/tiff/tiff-document.c index 4a532e1..24af05f 100644 --- a/tiff/tiff-document.c +++ b/tiff/tiff-document.c @@ -28,7 +28,7 @@ #include "tiff-document.h" #include "ev-document-misc.h" #include "ev-document-thumbnails.h" -#include "ev-ps-exporter.h" +#include "ev-file-exporter.h" struct _TiffDocumentClass { @@ -50,15 +50,15 @@ typedef struct _TiffDocumentClass TiffDocumentClass; static void tiff_document_document_iface_init (EvDocumentIface *iface); static void tiff_document_document_thumbnails_iface_init (EvDocumentThumbnailsIface *iface); -static void tiff_document_document_ps_exporter_iface_init (EvPSExporterIface *iface); +static void tiff_document_document_file_exporter_iface_init (EvFileExporterIface *iface); G_DEFINE_TYPE_WITH_CODE (TiffDocument, tiff_document, G_TYPE_OBJECT, { G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT, tiff_document_document_iface_init); G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS, tiff_document_document_thumbnails_iface_init); - G_IMPLEMENT_INTERFACE (EV_TYPE_PS_EXPORTER, - tiff_document_document_ps_exporter_iface_init); + G_IMPLEMENT_INTERFACE (EV_TYPE_FILE_EXPORTER, + tiff_document_document_file_exporter_iface_init); }); static TIFFErrorHandler orig_error_handler = NULL; @@ -376,10 +376,22 @@ tiff_document_document_thumbnails_iface_init (EvDocumentThumbnailsIface *iface) /* postscript exporter implementation */ +static gboolean +tiff_document_file_exporter_format_supported (EvFileExporter *exporter, + EvFileExporterFormat format) +{ + return (format == EV_FILE_FORMAT_PS); +} + static void -tiff_document_ps_export_begin (EvPSExporter *exporter, const char *filename, - int first_page, int last_page, - double width, double height, gboolean duplex) +tiff_document_file_exporter_begin (EvFileExporter *exporter, + EvFileExporterFormat format, + const char *filename, + int first_page, + int last_page, + double width, + double height, + gboolean duplex) { TiffDocument *document = TIFF_DOCUMENT (exporter); @@ -387,7 +399,7 @@ tiff_document_ps_export_begin (EvPSExporter *exporter, const char *filename, } static void -tiff_document_ps_export_do_page (EvPSExporter *exporter, EvRenderContext *rc) +tiff_document_file_exporter_do_page (EvFileExporter *exporter, EvRenderContext *rc) { TiffDocument *document = TIFF_DOCUMENT (exporter); @@ -400,7 +412,7 @@ tiff_document_ps_export_do_page (EvPSExporter *exporter, EvRenderContext *rc) } static void -tiff_document_ps_export_end (EvPSExporter *exporter) +tiff_document_file_exporter_end (EvFileExporter *exporter) { TiffDocument *document = TIFF_DOCUMENT (exporter); @@ -410,11 +422,12 @@ tiff_document_ps_export_end (EvPSExporter *exporter) } static void -tiff_document_document_ps_exporter_iface_init (EvPSExporterIface *iface) +tiff_document_document_file_exporter_iface_init (EvFileExporterIface *iface) { - iface->begin = tiff_document_ps_export_begin; - iface->do_page = tiff_document_ps_export_do_page; - iface->end = tiff_document_ps_export_end; + iface->format_supported = tiff_document_file_exporter_format_supported; + iface->begin = tiff_document_file_exporter_begin; + iface->do_page = tiff_document_file_exporter_do_page; + iface->end = tiff_document_file_exporter_end; } static void -- cgit v0.9.1