]> Pileus Git - ~andy/gtk/blob - gtk/gtkprintoperation-private.h
Add gtkprintoperationpreview.[ch] Set default preview command. Hardcoded
[~andy/gtk] / gtk / gtkprintoperation-private.h
1 /* GTK - The GIMP Toolkit
2  * gtkprintoperation.h: Print Operation
3  * Copyright (C) 2006, Red Hat, Inc.
4  *
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.
9  *
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.
14  *
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.
19  */
20
21 #ifndef __GTK_PRINT_OPERATION_PRIVATE_H__
22 #define __GTK_PRINT_OPERATION_PRIVATE_H__
23
24 #include "gtkprintoperation.h"
25
26 G_BEGIN_DECLS
27
28 struct _GtkPrintOperationPrivate
29 {
30   GtkPrintStatus status;
31   gchar *status_string;
32   GtkPageSetup *default_page_setup;
33   GtkPrintSettings *print_settings;
34   gchar *job_name;
35   gint nr_of_pages;
36   gint current_page;
37   GtkUnit unit;
38   gchar *pdf_target;
39   guint use_full_page      : 1;
40   guint show_dialog        : 1;
41   guint track_print_status : 1;
42   guint show_progress      : 1;
43   guint cancelled          : 1;
44   guint is_sync            : 1;
45
46   guint print_pages_idle_id;
47   guint show_progress_timeout_id;
48
49   GtkPrintContext *print_context;
50   
51   /* Data for the print job: */
52   /* cairo_surface_t *surface; */
53   /*  gdouble dpi_x, dpi_y; */
54
55   GtkPrintPages print_pages;
56   GtkPageRange *page_ranges;
57   gint num_page_ranges;
58   
59   gint manual_num_copies;
60   guint manual_collation   : 1;
61   guint manual_reverse     : 1;
62   guint manual_orientation : 1;
63   double manual_scale;
64   GtkPageSet manual_page_set;
65   GtkWidget *custom_widget;
66   gchar *custom_tab_label;
67   
68   gpointer platform_data;
69   GDestroyNotify free_platform_data;
70
71   GMainLoop *rloop; /* recursive mainloop */
72
73   void (*start_page) (GtkPrintOperation *operation,
74                       GtkPrintContext   *print_context,
75                       GtkPageSetup      *page_setup);
76   void (*end_page)   (GtkPrintOperation *operation,
77                       GtkPrintContext   *print_context);
78   void (*end_run)    (GtkPrintOperation *operation,
79                       gboolean           wait,
80                       gboolean           cancelled);
81 };
82
83
84 typedef void (* GtkPrintOperationPrintFunc) (GtkPrintOperation *op,
85                                              GtkWindow         *parent,
86                                              gboolean           is_preview);
87
88 GtkPrintOperationResult _gtk_print_operation_platform_backend_run_dialog             (GtkPrintOperation           *operation,
89                                                                                       GtkWindow                   *parent,
90                                                                                       gboolean                    *do_print,
91                                                                                       GError                     **error);
92 void                    _gtk_print_operation_platform_backend_run_dialog_async       (GtkPrintOperation           *op,
93                                                                                       GtkWindow                   *parent,
94                                                                                       GtkPrintOperationPrintFunc   print_cb);
95 void                    _gtk_print_operation_platform_backend_launch_preview         (GtkPrintOperation           *op,
96                                                                                       GtkWindow                   *parent,
97                                                                                       const char                  *filename);
98 cairo_surface_t *       _gtk_print_operation_platform_backend_create_preview_surface (GtkPrintOperation           *op,
99                                                                                       GtkPageSetup                *page_setup,
100                                                                                       gdouble                     *dpi_x,
101                                                                                       gdouble                     *dpi_y,
102                                                                                       const gchar                 *target);
103 void                    _gtk_print_operation_platform_backend_resize_preview_surface (GtkPrintOperation           *op,
104                                                                                       GtkPageSetup                *page_setup,
105                                                                                       cairo_surface_t             *surface);
106
107 void _gtk_print_operation_set_status (GtkPrintOperation *op,
108                                       GtkPrintStatus     status,
109                                       const gchar       *string);
110
111 /* GtkPrintContext private functions: */
112
113 GtkPrintContext *_gtk_print_context_new                             (GtkPrintOperation *op);
114 void             _gtk_print_context_set_page_setup                  (GtkPrintContext   *context,
115                                                                      GtkPageSetup      *page_setup);
116 void             _gtk_print_context_translate_into_margin           (GtkPrintContext   *context);
117 void             _gtk_print_context_rotate_according_to_orientation (GtkPrintContext   *context);
118
119 G_END_DECLS
120
121 #endif /* __GTK_PRINT_OPERATION_PRIVATE_H__ */