]> Pileus Git - ~andy/gtk/blob - gtk/gtkprintoperation-private.h
Revert name change
[~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   GtkPrintOperationAction action;
31   GtkPrintStatus status;
32   GError *error;
33   gchar *status_string;
34   GtkPageSetup *default_page_setup;
35   GtkPrintSettings *print_settings;
36   gchar *job_name;
37   gint nr_of_pages;
38   gint current_page;
39   GtkUnit unit;
40   gchar *export_filename;
41   guint use_full_page      : 1;
42   guint track_print_status : 1;
43   guint show_progress      : 1;
44   guint cancelled          : 1;
45   guint allow_async        : 1;
46   guint is_sync            : 1;
47
48   guint print_pages_idle_id;
49   guint show_progress_timeout_id;
50
51   GtkPrintContext *print_context;
52   
53   GtkPrintPages print_pages;
54   GtkPageRange *page_ranges;
55   gint num_page_ranges;
56   
57   gint manual_num_copies;
58   guint manual_collation   : 1;
59   guint manual_reverse     : 1;
60   guint manual_orientation : 1;
61   double manual_scale;
62   GtkPageSet manual_page_set;
63   GtkWidget *custom_widget;
64   gchar *custom_tab_label;
65   
66   gpointer platform_data;
67   GDestroyNotify free_platform_data;
68
69   GMainLoop *rloop; /* recursive mainloop */
70
71   void (*start_page) (GtkPrintOperation *operation,
72                       GtkPrintContext   *print_context,
73                       GtkPageSetup      *page_setup);
74   void (*end_page)   (GtkPrintOperation *operation,
75                       GtkPrintContext   *print_context);
76   void (*end_run)    (GtkPrintOperation *operation,
77                       gboolean           wait,
78                       gboolean           cancelled);
79 };
80
81
82 typedef void (* GtkPrintOperationPrintFunc) (GtkPrintOperation      *op,
83                                              GtkWindow              *parent,
84                                              gboolean                do_print,
85                                              GtkPrintOperationResult result);
86
87 GtkPrintOperationResult _gtk_print_operation_platform_backend_run_dialog             (GtkPrintOperation           *operation,
88                                                                                       gboolean                     show_dialog,
89                                                                                       GtkWindow                   *parent,
90                                                                                       gboolean                    *do_print);
91 void                    _gtk_print_operation_platform_backend_run_dialog_async       (GtkPrintOperation           *op,
92                                                                                       gboolean                     show_dialog,
93                                                                                       GtkWindow                   *parent,
94                                                                                       GtkPrintOperationPrintFunc   print_cb);
95 void                    _gtk_print_operation_platform_backend_launch_preview         (GtkPrintOperation           *op,
96                                                                                       cairo_surface_t             *surface,
97                                                                                       GtkWindow                   *parent,
98                                                                                       const char                  *filename);
99 cairo_surface_t *       _gtk_print_operation_platform_backend_create_preview_surface (GtkPrintOperation           *op,
100                                                                                       GtkPageSetup                *page_setup,
101                                                                                       gdouble                     *dpi_x,
102                                                                                       gdouble                     *dpi_y,
103                                                                                       gchar                       **target);
104 void                    _gtk_print_operation_platform_backend_resize_preview_surface (GtkPrintOperation           *op,
105                                                                                       GtkPageSetup                *page_setup,
106                                                                                       cairo_surface_t             *surface);
107 void                    _gtk_print_operation_platform_backend_preview_start_page     (GtkPrintOperation *op,
108                                                                                       cairo_surface_t *surface,
109                                                                                       cairo_t *cr);
110 void                    _gtk_print_operation_platform_backend_preview_end_page       (GtkPrintOperation *op,
111                                                                                       cairo_surface_t *surface,
112                                                                                       cairo_t *cr);
113
114 void _gtk_print_operation_set_status (GtkPrintOperation *op,
115                                       GtkPrintStatus     status,
116                                       const gchar       *string);
117
118 /* GtkPrintContext private functions: */
119
120 GtkPrintContext *_gtk_print_context_new                             (GtkPrintOperation *op);
121 void             _gtk_print_context_set_page_setup                  (GtkPrintContext   *context,
122                                                                      GtkPageSetup      *page_setup);
123 void             _gtk_print_context_translate_into_margin           (GtkPrintContext   *context);
124 void             _gtk_print_context_rotate_according_to_orientation (GtkPrintContext   *context);
125
126 G_END_DECLS
127
128 #endif /* __GTK_PRINT_OPERATION_PRIVATE_H__ */