]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkprintoperation-private.h
texthandles: Keep state internally to avoid X overhead
[~andy/gtk] / gtk / gtkprintoperation-private.h
index 7edfc0cdce0c7077225d01c4f033fc7c97257821..6a7b509978e6e0b55ad8cfa453c33de27a15ef44 100644 (file)
@@ -13,9 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef __GTK_PRINT_OPERATION_PRIVATE_H__
 
 G_BEGIN_DECLS
 
+/* Page drawing states */
+typedef enum
+{
+  GTK_PAGE_DRAWING_STATE_READY,
+  GTK_PAGE_DRAWING_STATE_DRAWING,
+  GTK_PAGE_DRAWING_STATE_DEFERRED_DRAWING
+} GtkPageDrawingState;
+
 struct _GtkPrintOperationPrivate
 {
+  GtkPrintOperationAction action;
   GtkPrintStatus status;
+  GError *error;
   gchar *status_string;
   GtkPageSetup *default_page_setup;
   GtkPrintSettings *print_settings;
   gchar *job_name;
   gint nr_of_pages;
+  gint nr_of_pages_to_print;
+  gint page_position;
   gint current_page;
   GtkUnit unit;
-  gchar *pdf_target;
+  gchar *export_filename;
   guint use_full_page      : 1;
-  guint show_dialog        : 1;
   guint track_print_status : 1;
   guint show_progress      : 1;
   guint cancelled          : 1;
+  guint allow_async        : 1;
   guint is_sync            : 1;
+  guint support_selection  : 1;
+  guint has_selection      : 1;
+  guint embed_page_setup   : 1;
+
+  GtkPageDrawingState      page_drawing_state;
 
   guint print_pages_idle_id;
   guint show_progress_timeout_id;
 
   GtkPrintContext *print_context;
   
-  /* Data for the print job: */
-  /* cairo_surface_t *surface; */
-  /*  gdouble dpi_x, dpi_y; */
-
   GtkPrintPages print_pages;
   GtkPageRange *page_ranges;
   gint num_page_ranges;
@@ -62,6 +73,9 @@ struct _GtkPrintOperationPrivate
   guint manual_orientation : 1;
   double manual_scale;
   GtkPageSet manual_page_set;
+  guint manual_number_up;
+  GtkNumberUpLayout manual_number_up_layout;
+
   GtkWidget *custom_widget;
   gchar *custom_tab_label;
   
@@ -81,28 +95,37 @@ struct _GtkPrintOperationPrivate
 };
 
 
-typedef void (* GtkPrintOperationPrintFunc) (GtkPrintOperation *op,
-                                            GtkWindow         *parent,
-                                            gboolean           is_preview);
+typedef void (* GtkPrintOperationPrintFunc) (GtkPrintOperation      *op,
+                                            GtkWindow              *parent,
+                                            gboolean                do_print,
+                                            GtkPrintOperationResult result);
 
 GtkPrintOperationResult _gtk_print_operation_platform_backend_run_dialog             (GtkPrintOperation           *operation,
+                                                                                     gboolean                     show_dialog,
                                                                                      GtkWindow                   *parent,
-                                                                                     gboolean                    *do_print,
-                                                                                     GError                     **error);
+                                                                                     gboolean                    *do_print);
 void                    _gtk_print_operation_platform_backend_run_dialog_async       (GtkPrintOperation           *op,
+                                                                                     gboolean                     show_dialog,
                                                                                      GtkWindow                   *parent,
                                                                                      GtkPrintOperationPrintFunc   print_cb);
 void                    _gtk_print_operation_platform_backend_launch_preview         (GtkPrintOperation           *op,
+                                                                                     cairo_surface_t             *surface,
                                                                                      GtkWindow                   *parent,
                                                                                      const char                  *filename);
 cairo_surface_t *       _gtk_print_operation_platform_backend_create_preview_surface (GtkPrintOperation           *op,
                                                                                      GtkPageSetup                *page_setup,
                                                                                      gdouble                     *dpi_x,
                                                                                      gdouble                     *dpi_y,
-                                                                                     const gchar                 *target);
+                                                                                     gchar                       **target);
 void                    _gtk_print_operation_platform_backend_resize_preview_surface (GtkPrintOperation           *op,
                                                                                      GtkPageSetup                *page_setup,
                                                                                      cairo_surface_t             *surface);
+void                    _gtk_print_operation_platform_backend_preview_start_page     (GtkPrintOperation *op,
+                                                                                     cairo_surface_t *surface,
+                                                                                     cairo_t *cr);
+void                    _gtk_print_operation_platform_backend_preview_end_page       (GtkPrintOperation *op,
+                                                                                     cairo_surface_t *surface,
+                                                                                     cairo_t *cr);
 
 void _gtk_print_operation_set_status (GtkPrintOperation *op,
                                      GtkPrintStatus     status,
@@ -115,6 +138,12 @@ void             _gtk_print_context_set_page_setup                  (GtkPrintCon
                                                                     GtkPageSetup      *page_setup);
 void             _gtk_print_context_translate_into_margin           (GtkPrintContext   *context);
 void             _gtk_print_context_rotate_according_to_orientation (GtkPrintContext   *context);
+void             _gtk_print_context_reverse_according_to_orientation (GtkPrintContext *context);
+void             _gtk_print_context_set_hard_margins                (GtkPrintContext   *context,
+                                                                    gdouble            top,
+                                                                    gdouble            bottom,
+                                                                    gdouble            left,
+                                                                    gdouble            right);
 
 G_END_DECLS