[goocanvas] Added example code for printing, and fixed doc sections



commit f8f0b1c9b2ef4491107161b48ce53ca8b1eea67c
Author: Damon Chaplin <damon gnome org>
Date:   Sun Oct 9 19:20:51 2011 +0100

    Added example code for printing, and fixed doc sections

 docs/goocanvas2-sections.txt |    4 +++-
 src/goocanvas.c              |   18 ++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/docs/goocanvas2-sections.txt b/docs/goocanvas2-sections.txt
index d643b01..d1b924b 100644
--- a/docs/goocanvas2-sections.txt
+++ b/docs/goocanvas2-sections.txt
@@ -483,7 +483,7 @@ GOO_CANVAS_POLYLINE_GET_CLASS
 
 <SUBSECTION Private>
 GooCanvasPolylineData
-NUM_ARROW_POINTS
+GOO_CANVAS_POLYLINE_NUM_ARROW_POINTS
 GooCanvasPolylineArrowData
 GooCanvasPolylineClass
 </SECTION>
@@ -722,6 +722,8 @@ GooCanvasAnchorType
 <SUBSECTION>
 GooCanvasPoints
 goo_canvas_points_new
+goo_canvas_points_get_point
+goo_canvas_points_set_point
 goo_canvas_points_ref
 goo_canvas_points_unref
 
diff --git a/src/goocanvas.c b/src/goocanvas.c
index 8381e2b..3933b31 100644
--- a/src/goocanvas.c
+++ b/src/goocanvas.c
@@ -2850,6 +2850,24 @@ goo_canvas_draw (GtkWidget      *widget,
  * have their visibility set to %GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD.
  *
  * Renders all or part of a canvas to the given cairo context.
+ *
+ * This example code could be used in a #GtkPrintOperation
+ * #GtkPrintOperation::draw-page callback to print each page in a multi-page
+ * document (assuming the pages appear one after the other vertically in the
+ * canvas). Note the call to cairo_translate() to translate the output to
+ * the correct position on the printed page.
+ *
+ * <informalexample><programlisting>
+ *    GooCanvasBounds bounds;
+ *    bounds.x1 = 0;
+ *    bounds.x2 = A4_PAGE_WIDTH;
+ *    bounds.y1 = A4_PAGE_HEIGHT * page_num;
+ *    bounds.y2 = A4_PAGE_HEIGHT * (page_num + 1);
+ *
+ *    cr = gtk_print_context_get_cairo_context (print_context);
+ *    cairo_translate (cr, 0, -A4_PAGE_HEIGHT * page_num);
+ *    goo_canvas_render (GOO_CANVAS (canvas), cr, &bounds, 0.0);
+ * </programlisting></informalexample>
  **/
 void
 goo_canvas_render (GooCanvas             *canvas,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]