1 /* GTK - The GIMP Toolkit
2 * gtkprintoperation.h: Print Operation
3 * Copyright (C) 2006, Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #ifndef __GTK_PRINT_OPERATION_PRIVATE_H__
22 #define __GTK_PRINT_OPERATION_PRIVATE_H__
24 #include "gtkprintoperation.h"
28 struct _GtkPrintOperationPrivate
30 GtkPrintOperationAction action;
31 GtkPrintStatus status;
34 GtkPageSetup *default_page_setup;
35 GtkPrintSettings *print_settings;
41 guint use_full_page : 1;
42 guint track_print_status : 1;
43 guint show_progress : 1;
45 guint allow_async : 1;
48 guint print_pages_idle_id;
49 guint show_progress_timeout_id;
51 GtkPrintContext *print_context;
53 /* Data for the print job: */
54 /* cairo_surface_t *surface; */
55 /* gdouble dpi_x, dpi_y; */
57 GtkPrintPages print_pages;
58 GtkPageRange *page_ranges;
61 gint manual_num_copies;
62 guint manual_collation : 1;
63 guint manual_reverse : 1;
64 guint manual_orientation : 1;
66 GtkPageSet manual_page_set;
67 GtkWidget *custom_widget;
68 gchar *custom_tab_label;
70 gpointer platform_data;
71 GDestroyNotify free_platform_data;
73 GMainLoop *rloop; /* recursive mainloop */
75 void (*start_page) (GtkPrintOperation *operation,
76 GtkPrintContext *print_context,
77 GtkPageSetup *page_setup);
78 void (*end_page) (GtkPrintOperation *operation,
79 GtkPrintContext *print_context);
80 void (*end_run) (GtkPrintOperation *operation,
86 typedef void (* GtkPrintOperationPrintFunc) (GtkPrintOperation *op,
89 GtkPrintOperationResult result);
91 GtkPrintOperationResult _gtk_print_operation_platform_backend_run_dialog (GtkPrintOperation *operation,
95 void _gtk_print_operation_platform_backend_run_dialog_async (GtkPrintOperation *op,
98 GtkPrintOperationPrintFunc print_cb);
99 void _gtk_print_operation_platform_backend_launch_preview (GtkPrintOperation *op,
101 const char *filename);
102 cairo_surface_t * _gtk_print_operation_platform_backend_create_preview_surface (GtkPrintOperation *op,
103 GtkPageSetup *page_setup,
106 const gchar *target);
107 void _gtk_print_operation_platform_backend_resize_preview_surface (GtkPrintOperation *op,
108 GtkPageSetup *page_setup,
109 cairo_surface_t *surface);
111 void _gtk_print_operation_set_status (GtkPrintOperation *op,
112 GtkPrintStatus status,
113 const gchar *string);
115 /* GtkPrintContext private functions: */
117 GtkPrintContext *_gtk_print_context_new (GtkPrintOperation *op);
118 void _gtk_print_context_set_page_setup (GtkPrintContext *context,
119 GtkPageSetup *page_setup);
120 void _gtk_print_context_translate_into_margin (GtkPrintContext *context);
121 void _gtk_print_context_rotate_according_to_orientation (GtkPrintContext *context);
125 #endif /* __GTK_PRINT_OPERATION_PRIVATE_H__ */