summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2006-08-15 19:49:27 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-08-15 19:49:27 +0000
commit895e9b3584ea626798fc6ba8b20a9981b3dd477d (patch)
treee7161453bade4391b9d2fe2d9f7921a80fb8ae75
parentbede16e5865c961c1a8f2a54d56a32132cac4f37 (diff)
downloadgtk+-895e9b3584ea626798fc6ba8b20a9981b3dd477d.tar.gz
Some more printing docs
-rw-r--r--ChangeLog4
-rw-r--r--ChangeLog.pre-2-104
-rw-r--r--docs/reference/gtk/tmpl/gtkprintoperation.sgml10
-rw-r--r--gtk/gtkprintoperation.c17
-rw-r--r--gtk/gtkprintoperationpreview.c9
5 files changed, 40 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 1cd0fda482..917fa8fffc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2006-08-15 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkprintoperationpreview.c:
+ * gtk/gtkprintoperation.c (gtk_print_operation_class_init): Add
+ more docs.
+
* gtk/gtkaboutdialog.c (gtk_about_dialog_init): Set CAN_DEFAULT
on all buttons. (#168737, fix proposed by Benjamin Berg)
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 1cd0fda482..917fa8fffc 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,5 +1,9 @@
2006-08-15 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkprintoperationpreview.c:
+ * gtk/gtkprintoperation.c (gtk_print_operation_class_init): Add
+ more docs.
+
* gtk/gtkaboutdialog.c (gtk_about_dialog_init): Set CAN_DEFAULT
on all buttons. (#168737, fix proposed by Benjamin Berg)
diff --git a/docs/reference/gtk/tmpl/gtkprintoperation.sgml b/docs/reference/gtk/tmpl/gtkprintoperation.sgml
index e9772425f2..3884eaeafa 100644
--- a/docs/reference/gtk/tmpl/gtkprintoperation.sgml
+++ b/docs/reference/gtk/tmpl/gtkprintoperation.sgml
@@ -65,6 +65,16 @@ do_print (void)
</example>
<para>
+By default GtkPrintOperation uses an external application to do
+print preview. To implement a custom print preview, an application
+must connect to the preview signal. The functions
+gtk_print_operation_print_preview_render_page(),
+gtk_print_operation_preview_end_preview() and
+gtk_print_operation_preview_is_selected() are useful
+when implementing a print preview.
+</para>
+
+<para>
Printing support was added in GTK+ 2.10.
</para>
diff --git a/gtk/gtkprintoperation.c b/gtk/gtkprintoperation.c
index 1b403d0d92..c12d3aa46a 100644
--- a/gtk/gtkprintoperation.c
+++ b/gtk/gtkprintoperation.c
@@ -807,10 +807,21 @@ gtk_print_operation_class_init (GtkPrintOperationClass *class)
* @parent: the #GtkWindow to use as window parent, or %NULL
*
* Gets emitted when a preview is requested from the native dialog.
- * If you handle this you must set the cairo context on the printing context.
*
- * If you don't override this a default implementation using an external
- * viewer will be used.
+ * The default handler for this signal uses an external viewer
+ * application to preview.
+ *
+ * To implement a custom print preview, an application must return
+ * %TRUE from its handler for this signal. In order to use the
+ * provided @context for the preview implementation, it must be
+ * given a suitable cairo context with gtk_print_context_set_cairo_context().
+ *
+ * The custom preview implementation can use
+ * gtk_print_operation_preview_is_selected() and
+ * gtk_print_operation_preview_render_page() to find pages which
+ * are selected for print and render them. The preview must be
+ * finished by calling gtk_print_operation_preview_end_preview()
+ * (typically in response to the user clicking a close button).
*
* Returns: %TRUE if the listener wants to take over control of the preview
*
diff --git a/gtk/gtkprintoperationpreview.c b/gtk/gtkprintoperationpreview.c
index a3357cfaf6..1861d81ddf 100644
--- a/gtk/gtkprintoperationpreview.c
+++ b/gtk/gtkprintoperationpreview.c
@@ -93,7 +93,12 @@ gtk_print_operation_preview_base_init (gpointer g_iface)
* @preview: a #GtkPrintOperationPreview
* @page_nr: the page to render
*
- * Renders a page to the preview.
+ * Renders a page to the preview, using the print context that
+ * was passed to the GtkPrintOperation::preview handler together
+ * with @preview.
+ *
+ * Note that this function requires a suitable cairo context to
+ * be associated with the print context.
*
* Since: 2.10
*/
@@ -113,6 +118,8 @@ gtk_print_operation_preview_render_page (GtkPrintOperationPreview *preview,
*
* Ends a preview.
*
+ * This function must be called to finish a custom print preview.
+ *
* Since: 2.10
*/
void