From 02bf96bfab6724ada52175741b5a3592dd6b0be6 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 16 Apr 2006 04:23:28 +0000 Subject: [PATCH] Add an example --- docs/reference/ChangeLog | 4 + .../reference/gtk/tmpl/gtkprintoperation.sgml | 80 +++++++++++++++++-- 2 files changed, 79 insertions(+), 5 deletions(-) diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 1664dc9110..ea1a03c880 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,7 @@ +2006-04-16 Matthias Clasen + + * gtk/tmpl/gtkprintoperation.sgml: Add an example + 2006-04-13 Matthias Clasen * gtk/tmpl/gtkpapersize.sgml: diff --git a/docs/reference/gtk/tmpl/gtkprintoperation.sgml b/docs/reference/gtk/tmpl/gtkprintoperation.sgml index c93d6e9141..bae7468054 100644 --- a/docs/reference/gtk/tmpl/gtkprintoperation.sgml +++ b/docs/reference/gtk/tmpl/gtkprintoperation.sgml @@ -29,18 +29,47 @@ When the user finished the dialog various signals will be emitted on the to catch and render the page on the provided #GtkPrintContext using Cairo. - + +static GtkPrintSettings *settings = NULL; + +static void +do_print (void) +{ + GtkPrintOperation *print; + GtkPrintOperationResult res; + + print = gtk_print_operation_new (); + + if (settings != NULL) + gtk_print_operation_set_print_settings (print, settings); + + g_signal_connect (print, "begin_print", G_CALLBACK (begin_print), NULL); + g_signal_connect (print, "draw_page", G_CALLBACK (draw_page), NULL); + + res = gtk_print_operation_run (print, GTK_WINDOW (main_window), NULL); + + if (res == GTK_PRINT_OPERATION_RESULT_APPLY) + { + if (settings != NULL) + g_object_unref (settings); + settings = g_object_ref (gtk_print_operation_get_print_settings (print)); + } + + g_object_unref (print); +} + + Printing support was added in GTK+ 2.10. + #GtkPrintContext, #GtkPrintUnixDialog - @@ -49,8 +78,48 @@ Printing support was added in GTK+ 2.10. -@parent_instance: -@priv: + + + + + + +@printoperation: the object which received the signal. +@arg1: + + + + + + +@printoperation: the object which received the signal. +@arg1: +@arg2: + + + + + + +@printoperation: the object which received the signal. +@arg1: + + + + + + +@printoperation: the object which received the signal. +@arg1: +@arg2: +@arg3: + + + + + + +@printoperation: the object which received the signal. @@ -62,7 +131,8 @@ Printing support was added in GTK+ 2.10. @GTK_PRINT_STATUS_GENERATING_DATA: @GTK_PRINT_STATUS_SENDING_DATA: @GTK_PRINT_STATUS_PENDING: -@GTK_PRINT_STATUS_PROCESSING: +@GTK_PRINT_STATUS_PENDING_ISSUE: +@GTK_PRINT_STATUS_PRINTING: @GTK_PRINT_STATUS_FINISHED: @GTK_PRINT_STATUS_FINISHED_ABORTED: