Commit 8ff5d4ff authored by Marek Kasik's avatar Marek Kasik Committed by Marek Kašík

Bug 339318 - Allow page rendering to (optionally) happen in a thread

2008-12-19  Marek Kasik  <mkasik@redhat.com>

	Bug 339318 - Allow page rendering to (optionally) happen in a thread

	* gtk/gtk.symbols: API change
	* doc/reference/gtk/gtk-sections.txt: API change
	* gtk/gtkprintoperation-private.h
	* gtk/gtkprintoperation.h
	* gtk/gtkprintoperation.c: Adds 2 new functions
	   gtk_print_operation_set_defer_drawing()
	     - Sets up the GtkPrintOperation to wait for calling of
	       gtk_print_operation_draw_page_finish() from application. It can
	       be used for drawing page in another thread.
	       This function must be called in the callback of "draw-page"
	       signal.
	   gtk_print_operation_draw_page_finish()
	     - Signalize that drawing of particular page is complete.
	       It is called after completion of page drawing (e.g. drawing
	       in another thread).
	       If gtk_print_operation_set_defer_drawing() was called before,
	       then this function has to be called by application. In another
	       case it is called by the library itself.

svn path=/trunk/; revision=21913
parent 1b62d9eb
2008-12-19 Marek Kasik <mkasik@redhat.com>
Bug 339318 - Allow page rendering to (optionally) happen in a thread
* gtk/gtk.symbols: API change
* doc/reference/gtk/gtk-sections.txt: API change
* gtk/gtkprintoperation-private.h
* gtk/gtkprintoperation.h
* gtk/gtkprintoperation.c: Adds 2 new functions
gtk_print_operation_set_defer_drawing()
- Sets up the GtkPrintOperation to wait for calling of
gtk_print_operation_draw_page_finish() from application. It can
be used for drawing page in another thread.
This function must be called in the callback of "draw-page"
signal.
gtk_print_operation_draw_page_finish()
- Signalize that drawing of particular page is complete.
It is called after completion of page drawing (e.g. drawing
in another thread).
If gtk_print_operation_set_defer_drawing() was called before,
then this function has to be called by application. In another
case it is called by the library itself.
2008-12-15 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprintunixdialog.c: Don't export emit_ok_response
......
......@@ -6454,6 +6454,8 @@ gtk_print_operation_set_track_print_status
gtk_print_operation_set_custom_tab_label
gtk_print_operation_run
gtk_print_operation_cancel
gtk_print_operation_draw_page_finish
gtk_print_operation_set_defer_drawing
gtk_print_operation_get_status
gtk_print_operation_get_status_string
gtk_print_operation_is_finished
......
......@@ -2909,6 +2909,8 @@ gtk_print_operation_get_status
gtk_print_operation_get_status_string
gtk_print_operation_is_finished
gtk_print_operation_cancel
gtk_print_operation_draw_page_finish
gtk_print_operation_set_defer_drawing
#endif
#endif
......
......@@ -25,6 +25,14 @@
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;
......@@ -45,6 +53,8 @@ struct _GtkPrintOperationPrivate
guint allow_async : 1;
guint is_sync : 1;
GtkPageDrawingState page_drawing_state;
guint print_pages_idle_id;
guint show_progress_timeout_id;
......
This diff is collapsed.
......@@ -172,6 +172,8 @@ GtkPrintStatus gtk_print_operation_get_status (GtkPrintOper
G_CONST_RETURN gchar * gtk_print_operation_get_status_string (GtkPrintOperation *op);
gboolean gtk_print_operation_is_finished (GtkPrintOperation *op);
void gtk_print_operation_cancel (GtkPrintOperation *op);
void gtk_print_operation_draw_page_finish (GtkPrintOperation *op);
void gtk_print_operation_set_defer_drawing (GtkPrintOperation *op);
GtkPageSetup *gtk_print_run_page_setup_dialog (GtkWindow *parent,
GtkPageSetup *page_setup,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment