summaryrefslogtreecommitdiff
path: root/src/cairo-paginated-private.h
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2007-09-23 17:43:44 +0930
committerAdrian Johnson <ajohnson@redneon.com>2007-09-23 17:43:44 +0930
commit77f1aa78872aa108199afd41247cf21827f7e33a (patch)
treed8620620c1e274548298a7bf3c27fa84edc623b1 /src/cairo-paginated-private.h
parentbeefbdd63864d10924360f41b244de7edf7b5f5b (diff)
downloadcairo-77f1aa78872aa108199afd41247cf21827f7e33a.tar.gz
Add Encapsulated PostScript support
The analysis surface will calculated the tight bounding box for each page. A new paginated-surface backend function set_bounding_box() has been added for passing the page bounding box to the target surface at the end of the analysis phase. The changes to the PS file when EPS is enabled are: - Add EPS header - Use tight bounding box instead of page size - Use save/restore to ensure PS interpreter is left in the same state
Diffstat (limited to 'src/cairo-paginated-private.h')
-rw-r--r--src/cairo-paginated-private.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/cairo-paginated-private.h b/src/cairo-paginated-private.h
index fdcb8fa65..1ecb01420 100644
--- a/src/cairo-paginated-private.h
+++ b/src/cairo-paginated-private.h
@@ -59,6 +59,14 @@ struct _cairo_paginated_surface_backend {
void
(*set_paginated_mode) (void *surface,
cairo_paginated_mode_t mode);
+
+ /* Optional. Specifies the smallest box that encloses all objects
+ * on the page. Will be called at the end of the ANALYZE phase but
+ * before the mode is changed to RENDER.
+ */
+ cairo_warn cairo_int_status_t
+ (*set_bounding_box) (void *surface,
+ cairo_box_t *bbox);
};
/* A cairo_paginated_surface provides a very convenient wrapper that
@@ -95,11 +103,14 @@ struct _cairo_paginated_surface_backend {
* from each operation). This analysis stage is used to decide which
* operations will require fallbacks.
*
- * 4. Calls set_paginated_mode with an argument of CAIRO_PAGINATED_MODE_RENDER
+ * 4. Calls set_bounding_box to provide the target surface with the
+ * tight bounding box of the page.
+ *
+ * 5. Calls set_paginated_mode with an argument of CAIRO_PAGINATED_MODE_RENDER
*
- * 5. Replays a subset of the meta-surface operations to the target surface
+ * 6. Replays a subset of the meta-surface operations to the target surface
*
- * 6. Replays the remaining operations to an image surface, sets an
+ * 7. Replays the remaining operations to an image surface, sets an
* appropriate clip on the target, then paints the resulting image
* surface to the target.
*
@@ -114,7 +125,7 @@ struct _cairo_paginated_surface_backend {
*
* NOTE: The paginated surface layer assumes that the target surface
* is "blank" by default at the beginning of each page, without any
- * need for an explicit erasea operation, (as opposed to an image
+ * need for an explicit erase operation, (as opposed to an image
* surface, for example, which might have uninitialized content
* originally). As such, it optimizes away CLEAR operations that
* happen at the beginning of each page---the target surface will not