Add gtk_print_unix_dialog_set_manual_capabilities that controls what

2006-05-24  Alexander Larsson  <alexl@redhat.com>

	* gtk/gtk.symbols:
	* gtk/gtkprintunixdialog.[ch]:
	Add gtk_print_unix_dialog_set_manual_capabilities that controls
	what widgets to enable in the dialog depending on the apps
	capabilities.

	* gtk/gtkprintbackend.[ch]:
	* gtk/gtkprinter-private.h:
	* gtk/gtkprinter.c:
	* gtk/gtkprintjob.h:
	Add printer_get_capabilities to backend.
	Move some fallback calls to the printbackend base class.

	* gtk/gtkprintoperation-unix.c:
	Set manual capabilities

	* modules/printbackends/cups/gtkprintbackendcups.c:
	Implement get_capabilities

	* modules/printbackends/lpr/gtkprintbackendlpr.c:
	* modules/printbackends/pdf/gtkprintbackendpdf.c:
	Move some methods to baseclass.
This commit is contained in:
Alexander Larsson 2006-05-24 10:50:57 +00:00 committed by Alexander Larsson
parent 27f2b1d95a
commit 70376f280a
14 changed files with 246 additions and 126 deletions

View File

@ -1,3 +1,28 @@
2006-05-24 Alexander Larsson <alexl@redhat.com>
* gtk/gtk.symbols:
* gtk/gtkprintunixdialog.[ch]:
Add gtk_print_unix_dialog_set_manual_capabilities that controls
what widgets to enable in the dialog depending on the apps
capabilities.
* gtk/gtkprintbackend.[ch]:
* gtk/gtkprinter-private.h:
* gtk/gtkprinter.c:
* gtk/gtkprintjob.h:
Add printer_get_capabilities to backend.
Move some fallback calls to the printbackend base class.
* gtk/gtkprintoperation-unix.c:
Set manual capabilities
* modules/printbackends/cups/gtkprintbackendcups.c:
Implement get_capabilities
* modules/printbackends/lpr/gtkprintbackendlpr.c:
* modules/printbackends/pdf/gtkprintbackendpdf.c:
Move some methods to baseclass.
2006-05-23 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprintoperation.c (print_pages): Do the begin-print

View File

@ -1,3 +1,28 @@
2006-05-24 Alexander Larsson <alexl@redhat.com>
* gtk/gtk.symbols:
* gtk/gtkprintunixdialog.[ch]:
Add gtk_print_unix_dialog_set_manual_capabilities that controls
what widgets to enable in the dialog depending on the apps
capabilities.
* gtk/gtkprintbackend.[ch]:
* gtk/gtkprinter-private.h:
* gtk/gtkprinter.c:
* gtk/gtkprintjob.h:
Add printer_get_capabilities to backend.
Move some fallback calls to the printbackend base class.
* gtk/gtkprintoperation-unix.c:
Set manual capabilities
* modules/printbackends/cups/gtkprintbackendcups.c:
Implement get_capabilities
* modules/printbackends/lpr/gtkprintbackendlpr.c:
* modules/printbackends/pdf/gtkprintbackendpdf.c:
Move some methods to baseclass.
2006-05-23 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprintoperation.c (print_pages): Do the begin-print

View File

@ -2806,6 +2806,7 @@ gtk_print_unix_dialog_set_settings
gtk_print_unix_dialog_get_settings
gtk_print_unix_dialog_get_selected_printer
gtk_print_unix_dialog_add_custom_tab
gtk_print_unix_dialog_set_manual_capabilities
#endif
#endif
#endif

View File

@ -303,6 +303,17 @@ gtk_print_backend_load_modules ()
G_DEFINE_TYPE (GtkPrintBackend, gtk_print_backend, G_TYPE_OBJECT)
static void fallback_printer_request_details (GtkPrinter *printer);
static gboolean fallback_printer_mark_conflicts (GtkPrinter *printer,
GtkPrinterOptionSet *options);
static void fallback_printer_get_hard_margins (GtkPrinter *printer,
double *top,
double *bottom,
double *left,
double *right);
static GList * fallback_printer_list_papers (GtkPrinter *printer);
static GtkPrintCapabilities fallback_printer_get_capabilities (GtkPrinter *printer);
static void
gtk_print_backend_class_init (GtkPrintBackendClass *class)
{
@ -313,8 +324,13 @@ gtk_print_backend_class_init (GtkPrintBackendClass *class)
object_class->dispose = gtk_print_backend_dispose;
class->printer_request_details = fallback_printer_request_details;
class->printer_mark_conflicts = fallback_printer_mark_conflicts;
class->printer_get_hard_margins = fallback_printer_get_hard_margins;
class->printer_list_papers = fallback_printer_list_papers;
class->printer_get_capabilities = fallback_printer_get_capabilities;
g_type_class_add_private (class, sizeof (GtkPrintBackendPrivate));
signals[PRINTER_LIST_CHANGED] =
g_signal_new ("printer-list-changed",
@ -391,6 +407,44 @@ gtk_print_backend_dispose (GObject *object)
}
static void
fallback_printer_request_details (GtkPrinter *printer)
{
}
static gboolean
fallback_printer_mark_conflicts (GtkPrinter *printer,
GtkPrinterOptionSet *options)
{
return FALSE;
}
static void
fallback_printer_get_hard_margins (GtkPrinter *printer,
double *top,
double *bottom,
double *left,
double *right)
{
*top = 0;
*bottom = 0;
*left = 0;
*right = 0;
}
static GList *
fallback_printer_list_papers (GtkPrinter *printer)
{
return NULL;
}
static GtkPrintCapabilities
fallback_printer_get_capabilities (GtkPrinter *printer)
{
return 0;
}
static void
printer_hash_to_sorted_active_list (const gchar *key,
gpointer value,

View File

@ -103,6 +103,7 @@ struct _GtkPrintBackendClass
double *bottom,
double *left,
double *right);
GtkPrintCapabilities (*printer_get_capabilities) (GtkPrinter *printer);
/* Signals */
void (*printer_list_changed) (GtkPrintBackend *backend);

View File

@ -55,6 +55,7 @@ void _gtk_printer_get_hard_margins (GtkPrinter
gdouble *left,
gdouble *right);
GHashTable * _gtk_printer_get_custom_widgets (GtkPrinter *printer);
GtkPrintCapabilities _gtk_printer_get_capabilities (GtkPrinter *printer);
/* GtkPrintJob private methods: */

View File

@ -726,6 +726,14 @@ _gtk_printer_get_hard_margins (GtkPrinter *printer,
backend_class->printer_get_hard_margins (printer, top, bottom, left, right);
}
GtkPrintCapabilities
_gtk_printer_get_capabilities (GtkPrinter *printer)
{
GtkPrintBackendClass *backend_class = GTK_PRINT_BACKEND_GET_CLASS (printer->priv->backend);
return backend_class->printer_get_capabilities (printer);
}
gint
gtk_printer_compare (GtkPrinter *a, GtkPrinter *b)
{

View File

@ -34,6 +34,14 @@ G_BEGIN_DECLS
#define GTK_IS_PRINT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PRINT_JOB))
#define GTK_PRINT_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PRINT_JOB, GtkPrintJobClass))
typedef enum
{
GTK_PRINT_CAPABILITY_PAGE_SET = 1 << 0,
GTK_PRINT_CAPABILITY_COPIES = 1 << 1,
GTK_PRINT_CAPABILITY_COLLATE = 1 << 2,
GTK_PRINT_CAPABILITY_REVERSE = 1 << 3,
GTK_PRINT_CAPABILITY_SCALE = 1 << 4
} GtkPrintCapabilities;
typedef struct _GtkPrintJob GtkPrintJob;
typedef struct _GtkPrintJobClass GtkPrintJobClass;
@ -57,12 +65,13 @@ struct _GtkPrintJob
GtkPrintPages print_pages;
GtkPageRange *page_ranges;
int num_page_ranges;
gboolean rotate_to_orientation;
GtkPageSet page_set;
int num_copies;
gboolean collate;
gboolean reverse;
double scale;
gboolean rotate_to_orientation;
};
struct _GtkPrintJobClass

View File

@ -183,6 +183,13 @@ get_print_dialog (GtkPrintOperation *op,
pd = gtk_print_unix_dialog_new (NULL, parent);
gtk_print_unix_dialog_set_manual_capabilities (GTK_PRINT_UNIX_DIALOG (pd),
GTK_PRINT_CAPABILITY_PAGE_SET |
GTK_PRINT_CAPABILITY_COPIES |
GTK_PRINT_CAPABILITY_COLLATE |
GTK_PRINT_CAPABILITY_REVERSE |
GTK_PRINT_CAPABILITY_SCALE);
if (priv->print_settings)
gtk_print_unix_dialog_set_settings (GTK_PRINT_UNIX_DIALOG (pd),
priv->print_settings);

View File

@ -56,32 +56,36 @@
#define GTK_PRINT_UNIX_DIALOG_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_PRINT_UNIX_DIALOG, GtkPrintUnixDialogPrivate))
static void gtk_print_unix_dialog_destroy (GtkPrintUnixDialog *dialog);
static void gtk_print_unix_dialog_finalize (GObject *object);
static void gtk_print_unix_dialog_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gtk_print_unix_dialog_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void gtk_print_unix_dialog_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static void populate_dialog (GtkPrintUnixDialog *dialog);
static void unschedule_idle_mark_conflicts (GtkPrintUnixDialog *dialog);
static void selected_printer_changed (GtkTreeSelection *selection,
GtkPrintUnixDialog *dialog);
static void clear_per_printer_ui (GtkPrintUnixDialog *dialog);
static void printer_added_cb (GtkPrintBackend *backend,
GtkPrinter *printer,
GtkPrintUnixDialog *dialog);
static void printer_removed_cb (GtkPrintBackend *backend,
GtkPrinter *printer,
GtkPrintUnixDialog *dialog);
static void printer_status_cb (GtkPrintBackend *backend,
GtkPrinter *printer,
GtkPrintUnixDialog *dialog);
static void gtk_print_unix_dialog_destroy (GtkPrintUnixDialog *dialog);
static void gtk_print_unix_dialog_finalize (GObject *object);
static void gtk_print_unix_dialog_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gtk_print_unix_dialog_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void gtk_print_unix_dialog_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static void populate_dialog (GtkPrintUnixDialog *dialog);
static void unschedule_idle_mark_conflicts (GtkPrintUnixDialog *dialog);
static void selected_printer_changed (GtkTreeSelection *selection,
GtkPrintUnixDialog *dialog);
static void clear_per_printer_ui (GtkPrintUnixDialog *dialog);
static void printer_added_cb (GtkPrintBackend *backend,
GtkPrinter *printer,
GtkPrintUnixDialog *dialog);
static void printer_removed_cb (GtkPrintBackend *backend,
GtkPrinter *printer,
GtkPrintUnixDialog *dialog);
static void printer_status_cb (GtkPrintBackend *backend,
GtkPrinter *printer,
GtkPrintUnixDialog *dialog);
static void update_collate_icon (GtkToggleButton *toggle_button,
GtkPrintUnixDialog *dialog);
static gboolean dialog_get_collate (GtkPrintUnixDialog *dialog);
static gboolean dialog_get_reverse (GtkPrintUnixDialog *dialog);
enum {
PROP_0,
@ -108,6 +112,9 @@ struct GtkPrintUnixDialogPrivate
GtkWidget *notebook;
GtkWidget *printer_treeview;
GtkPrintCapabilities manual_capabilities;
GtkPrintCapabilities printer_capabilities;
GtkTreeModel *printer_list;
GtkTreeModelFilter *printer_list_filter;
@ -1003,6 +1010,28 @@ update_dialog_from_settings (GtkPrintUnixDialog *dialog)
g_list_free (groups);
}
static void
update_dialog_from_capabilities (GtkPrintUnixDialog *dialog)
{
GtkPrintCapabilities caps;
GtkPrintUnixDialogPrivate *priv = dialog->priv;
caps = priv->manual_capabilities | priv->printer_capabilities;
gtk_widget_set_sensitive (priv->page_set_combo,
caps & GTK_PRINT_CAPABILITY_PAGE_SET);
gtk_widget_set_sensitive (priv->copies_spin,
caps & GTK_PRINT_CAPABILITY_COPIES);
gtk_widget_set_sensitive (priv->collate_check,
caps & GTK_PRINT_CAPABILITY_COLLATE);
gtk_widget_set_sensitive (priv->reverse_check,
caps & GTK_PRINT_CAPABILITY_REVERSE);
gtk_widget_set_sensitive (priv->scale_spin,
caps & GTK_PRINT_CAPABILITY_PAGE_SET);
update_collate_icon (NULL, dialog);
}
static void
mark_conflicts (GtkPrintUnixDialog *dialog)
{
@ -1215,11 +1244,14 @@ selected_printer_changed (GtkTreeSelection *selection,
g_object_unref (priv->current_printer);
}
priv->printer_capabilities = 0;
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, TRUE);
priv->current_printer = printer;
if (printer != NULL)
{
priv->printer_capabilities = _gtk_printer_get_capabilities (printer);
priv->options = _gtk_printer_get_options (printer, priv->initial_settings,
priv->page_setup);
@ -1228,7 +1260,9 @@ selected_printer_changed (GtkTreeSelection *selection,
}
update_dialog_from_settings (dialog);
update_dialog_from_capabilities (dialog);
}
static void
update_collate_icon (GtkToggleButton *toggle_button,
GtkPrintUnixDialog *dialog)
@ -1281,7 +1315,6 @@ draw_collate_cb (GtkWidget *widget,
GdkEventExpose *event,
GtkPrintUnixDialog *dialog)
{
GtkPrintUnixDialogPrivate *priv = dialog->priv;
GtkSettings *settings;
cairo_t *cr;
gint size;
@ -1289,8 +1322,8 @@ draw_collate_cb (GtkWidget *widget,
gboolean collate, reverse, rtl;
gint text_x;
collate = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->collate_check));
reverse = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->reverse_check));
collate = dialog_get_collate (dialog);
reverse = dialog_get_reverse (dialog);
rtl = (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL);
settings = gtk_widget_get_settings (widget);
@ -1648,7 +1681,10 @@ dialog_set_print_pages (GtkPrintUnixDialog *dialog, GtkPrintPages pages)
static gdouble
dialog_get_scale (GtkPrintUnixDialog *dialog)
{
return gtk_spin_button_get_value (GTK_SPIN_BUTTON (dialog->priv->scale_spin));
if (GTK_WIDGET_IS_SENSITIVE (dialog->priv->scale_spin))
return gtk_spin_button_get_value (GTK_SPIN_BUTTON (dialog->priv->scale_spin));
else
return 100.0;
}
static void
@ -1661,7 +1697,10 @@ dialog_set_scale (GtkPrintUnixDialog *dialog,
static GtkPageSet
dialog_get_page_set (GtkPrintUnixDialog *dialog)
{
return (GtkPageSet)gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->page_set_combo));
if (GTK_WIDGET_IS_SENSITIVE (dialog->priv->page_set_combo))
return (GtkPageSet)gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->page_set_combo));
else
return GTK_PAGE_SET_ALL;
}
static void
@ -1675,7 +1714,9 @@ dialog_set_page_set (GtkPrintUnixDialog *dialog,
static gint
dialog_get_n_copies (GtkPrintUnixDialog *dialog)
{
return gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->copies_spin));
if (GTK_WIDGET_IS_SENSITIVE (dialog->priv->copies_spin))
return gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->priv->copies_spin));
return 1;
}
static void
@ -1689,7 +1730,9 @@ dialog_set_n_copies (GtkPrintUnixDialog *dialog,
static gboolean
dialog_get_collate (GtkPrintUnixDialog *dialog)
{
return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->collate_check));
if (GTK_WIDGET_IS_SENSITIVE (dialog->priv->collate_check))
return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->collate_check));
return FALSE;
}
static void
@ -1703,7 +1746,9 @@ dialog_set_collate (GtkPrintUnixDialog *dialog,
static gboolean
dialog_get_reverse (GtkPrintUnixDialog *dialog)
{
return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->reverse_check));
if (GTK_WIDGET_IS_SENSITIVE (dialog->priv->reverse_check))
return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->reverse_check));
return FALSE;
}
static void
@ -2648,6 +2693,26 @@ gtk_print_unix_dialog_add_custom_tab (GtkPrintUnixDialog *dialog,
gtk_widget_show (tab_label);
}
/**
* gtk_print_unix_dialog_set_manual_capabilities:
* @dialog: a #GtkPrintUnixDialog
* @capabilites: the printing capabilities of your application
*
* This lets you specify the printing capabilities your application
* supports. For instance, if you can handle scaling the output then
* you pass #GTK_PRINT_CAPABILITY_SCALE. If you don't pass that, then
* the dialog will only let you select the scale if the printing
* system automatically handles scaling.
*
* Since: 2.10
*/
void
gtk_print_unix_dialog_set_manual_capabilities (GtkPrintUnixDialog *dialog,
GtkPrintCapabilities capabilities)
{
dialog->priv->manual_capabilities = capabilities;
update_dialog_from_capabilities (dialog);
}
#define __GTK_PRINT_UNIX_DIALOG_C__
#include "gtkaliasdef.c"

View File

@ -21,6 +21,7 @@
#include <gtk/gtkdialog.h>
#include <gtk/gtkprinter.h>
#include <gtk/gtkprintjob.h>
#include <gtk/gtkprintsettings.h>
#include <gtk/gtkpagesetup.h>
@ -77,6 +78,8 @@ GtkPrinter * gtk_print_unix_dialog_get_selected_printer (GtkPrintUnixDialog
void gtk_print_unix_dialog_add_custom_tab (GtkPrintUnixDialog *dialog,
GtkWidget *child,
GtkWidget *tab_label);
void gtk_print_unix_dialog_set_manual_capabilities (GtkPrintUnixDialog *dialog,
GtkPrintCapabilities capabilities);
G_END_DECLS

View File

@ -137,6 +137,7 @@ static void cups_printer_get_hard_margins (GtkPrinter
double *bottom,
double *left,
double *right);
static GtkPrintCapabilities cups_printer_get_capabilities (GtkPrinter *printer);
static void set_option_from_settings (GtkPrinterOption *option,
GtkPrintSettings *setting);
static void cups_begin_polling_info (GtkPrintBackendCups *print_backend,
@ -241,6 +242,7 @@ gtk_print_backend_cups_class_init (GtkPrintBackendCupsClass *class)
backend_class->printer_prepare_for_print = cups_printer_prepare_for_print;
backend_class->printer_list_papers = cups_printer_list_papers;
backend_class->printer_get_hard_margins = cups_printer_get_hard_margins;
backend_class->printer_get_capabilities = cups_printer_get_capabilities;
}
static cairo_status_t
@ -2593,3 +2595,12 @@ cups_printer_get_hard_margins (GtkPrinter *printer,
*right = ppd_file->custom_margins[2];
*top = ppd_file->custom_margins[3];
}
static GtkPrintCapabilities
cups_printer_get_capabilities (GtkPrinter *printer)
{
return
GTK_PRINT_CAPABILITY_COPIES |
GTK_PRINT_CAPABILITY_COLLATE |
GTK_PRINT_CAPABILITY_REVERSE;
}

View File

@ -66,8 +66,6 @@ static void gtk_print_backend_lpr_init (GtkPrintBacke
static void lpr_printer_get_settings_from_options (GtkPrinter *printer,
GtkPrinterOptionSet *options,
GtkPrintSettings *settings);
static gboolean lpr_printer_mark_conflicts (GtkPrinter *printer,
GtkPrinterOptionSet *options);
static GtkPrinterOptionSet *lpr_printer_get_options (GtkPrinter *printer,
GtkPrintSettings *settings,
GtkPageSetup *page_setup);
@ -75,13 +73,6 @@ static void lpr_printer_prepare_for_print (GtkPrinter
GtkPrintJob *print_job,
GtkPrintSettings *settings,
GtkPageSetup *page_setup);
static void lpr_printer_get_hard_margins (GtkPrinter *printer,
double *top,
double *bottom,
double *left,
double *right);
static void lpr_printer_request_details (GtkPrinter *printer);
static GList * lpr_printer_list_papers (GtkPrinter *printer);
static cairo_surface_t * lpr_printer_create_cairo_surface (GtkPrinter *printer,
gdouble width,
gdouble height,
@ -165,14 +156,10 @@ gtk_print_backend_lpr_class_init (GtkPrintBackendLprClass *class)
backend_parent_class = g_type_class_peek_parent (class);
backend_class->print_stream = gtk_print_backend_lpr_print_stream;
backend_class->printer_request_details = lpr_printer_request_details;
backend_class->printer_create_cairo_surface = lpr_printer_create_cairo_surface;
backend_class->printer_get_options = lpr_printer_get_options;
backend_class->printer_mark_conflicts = lpr_printer_mark_conflicts;
backend_class->printer_get_settings_from_options = lpr_printer_get_settings_from_options;
backend_class->printer_prepare_for_print = lpr_printer_prepare_for_print;
backend_class->printer_list_papers = lpr_printer_list_papers;
backend_class->printer_get_hard_margins = lpr_printer_get_hard_margins;
}
static cairo_status_t
@ -394,11 +381,6 @@ gtk_print_backend_lpr_init (GtkPrintBackendLpr *backend)
g_object_unref (printer);
}
static void
lpr_printer_request_details (GtkPrinter *printer)
{
}
static GtkPrinterOptionSet *
lpr_printer_get_options (GtkPrinter *printer,
GtkPrintSettings *settings,
@ -430,14 +412,6 @@ lpr_printer_get_options (GtkPrinter *printer,
return set;
}
static gboolean
lpr_printer_mark_conflicts (GtkPrinter *printer,
GtkPrinterOptionSet *options)
{
return FALSE;
}
static void
lpr_printer_get_settings_from_options (GtkPrinter *printer,
GtkPrinterOptionSet *options,
@ -477,22 +451,3 @@ lpr_printer_prepare_for_print (GtkPrinter *printer,
print_job->page_set = gtk_print_settings_get_page_set (settings);
print_job->rotate_to_orientation = TRUE;
}
static void
lpr_printer_get_hard_margins (GtkPrinter *printer,
double *top,
double *bottom,
double *left,
double *right)
{
*top = 0;
*bottom = 0;
*left = 0;
*right = 0;
}
static GList *
lpr_printer_list_papers (GtkPrinter *printer)
{
return NULL;
}

View File

@ -67,8 +67,6 @@ static void gtk_print_backend_pdf_init (GtkPrintBacke
static void pdf_printer_get_settings_from_options (GtkPrinter *printer,
GtkPrinterOptionSet *options,
GtkPrintSettings *settings);
static gboolean pdf_printer_mark_conflicts (GtkPrinter *printer,
GtkPrinterOptionSet *options);
static GtkPrinterOptionSet *pdf_printer_get_options (GtkPrinter *printer,
GtkPrintSettings *settings,
GtkPageSetup *page_setup);
@ -76,13 +74,6 @@ static void pdf_printer_prepare_for_print (GtkPrinter
GtkPrintJob *print_job,
GtkPrintSettings *settings,
GtkPageSetup *page_setup);
static void pdf_printer_get_hard_margins (GtkPrinter *printer,
double *top,
double *bottom,
double *left,
double *right);
static void pdf_printer_request_details (GtkPrinter *printer);
static GList * pdf_printer_list_papers (GtkPrinter *printer);
static void gtk_print_backend_pdf_print_stream (GtkPrintBackend *print_backend,
GtkPrintJob *job,
gint data_fd,
@ -166,14 +157,10 @@ gtk_print_backend_pdf_class_init (GtkPrintBackendPdfClass *class)
backend_parent_class = g_type_class_peek_parent (class);
backend_class->print_stream = gtk_print_backend_pdf_print_stream;
backend_class->printer_request_details = pdf_printer_request_details;
backend_class->printer_create_cairo_surface = pdf_printer_create_cairo_surface;
backend_class->printer_get_options = pdf_printer_get_options;
backend_class->printer_mark_conflicts = pdf_printer_mark_conflicts;
backend_class->printer_get_settings_from_options = pdf_printer_get_settings_from_options;
backend_class->printer_prepare_for_print = pdf_printer_prepare_for_print;
backend_class->printer_list_papers = pdf_printer_list_papers;
backend_class->printer_get_hard_margins = pdf_printer_get_hard_margins;
}
static cairo_status_t
@ -364,11 +351,6 @@ gtk_print_backend_pdf_init (GtkPrintBackendPdf *backend)
gtk_print_backend_set_list_done (GTK_PRINT_BACKEND (backend));
}
static void
pdf_printer_request_details (GtkPrinter *printer)
{
}
static GtkPrinterOptionSet *
pdf_printer_get_options (GtkPrinter *printer,
GtkPrintSettings *settings,
@ -400,14 +382,6 @@ pdf_printer_get_options (GtkPrinter *printer,
return set;
}
static gboolean
pdf_printer_mark_conflicts (GtkPrinter *printer,
GtkPrinterOptionSet *options)
{
return FALSE;
}
static void
pdf_printer_get_settings_from_options (GtkPrinter *printer,
GtkPrinterOptionSet *options,
@ -447,22 +421,3 @@ pdf_printer_prepare_for_print (GtkPrinter *printer,
print_job->page_set = gtk_print_settings_get_page_set (settings);
print_job->rotate_to_orientation = TRUE;
}
static void
pdf_printer_get_hard_margins (GtkPrinter *printer,
double *top,
double *bottom,
double *left,
double *right)
{
*top = 0;
*bottom = 0;
*left = 0;
*right = 0;
}
static GList *
pdf_printer_list_papers (GtkPrinter *printer)
{
return NULL;
}