summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2006-02-13 16:47:01 -0800
committerCarl Worth <cworth@cworth.org>2006-02-13 16:47:01 -0800
commit6c38e238e5daab5df4c11027d28e48e62bbd4bc8 (patch)
tree150fc4b07ca1b92e8439bb722fde8bf63db7d009
parent0b5ac24b1522b3287903c04fb894bfae4fc67403 (diff)
parent980eff38e494223de00e7ded706f6beaca27fce1 (diff)
Remove pixman from SNAPSHOT_0_4_0SNAPSHOT_0_4_0
-rw-r--r--AUTHORS9
-rw-r--r--BUGS16
-rw-r--r--ChangeLog969
-rw-r--r--Makefile.am2
-rw-r--r--NEWS126
-rw-r--r--README2
-rw-r--r--RELEASING24
-rw-r--r--TODO203
-rw-r--r--acinclude.m453
-rwxr-xr-xautogen.sh3
-rw-r--r--cairo.pc.in2
-rw-r--r--configure.in148
-rw-r--r--doc/.cvsignore2
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/public/.cvsignore15
-rw-r--r--doc/public/Makefile.am46
-rw-r--r--doc/public/cairo-docs.xml31
-rw-r--r--doc/public/cairo-overrides.txt0
-rw-r--r--doc/public/cairo-sections.txt251
-rw-r--r--doc/public/cairo.types0
-rw-r--r--doc/public/tmpl/.cvsignore1
-rw-r--r--doc/public/tmpl/cairo-atsui.sgml25
-rw-r--r--doc/public/tmpl/cairo-ft.sgml63
-rw-r--r--doc/public/tmpl/cairo-glitz.sgml34
-rw-r--r--doc/public/tmpl/cairo-matrix.sgml193
-rw-r--r--doc/public/tmpl/cairo-pattern.sgml154
-rw-r--r--doc/public/tmpl/cairo-pdf.sgml42
-rw-r--r--doc/public/tmpl/cairo-png.sgml40
-rw-r--r--doc/public/tmpl/cairo-ps.sgml42
-rw-r--r--doc/public/tmpl/cairo-quartz.sgml38
-rw-r--r--doc/public/tmpl/cairo-surface.sgml112
-rw-r--r--doc/public/tmpl/cairo-xcb.sgml28
-rw-r--r--doc/public/tmpl/cairo-xlib.sgml39
-rw-r--r--doc/public/tmpl/cairo.sgml1019
-rw-r--r--doc/reference/.cvsignore20
-rw-r--r--doc/reference/ChangeLog16
-rw-r--r--doc/reference/README11
-rw-r--r--doc/reference/crossreference.rb30
-rw-r--r--doc/reference/doc.xml204
-rw-r--r--doc/reference/xml/cairo_arc.xml40
-rw-r--r--doc/reference/xml/cairo_arc_negative.xml40
-rw-r--r--doc/reference/xml/cairo_clip.xml35
-rw-r--r--doc/reference/xml/cairo_close_path.xml35
-rw-r--r--doc/reference/xml/cairo_copy.xml54
-rw-r--r--doc/reference/xml/cairo_create.xml34
-rw-r--r--doc/reference/xml/cairo_current_alpha.xml35
-rw-r--r--doc/reference/xml/cairo_current_fill_rule.xml35
-rw-r--r--doc/reference/xml/cairo_current_font.xml37
-rw-r--r--doc/reference/xml/cairo_current_font_extents.xml40
-rw-r--r--doc/reference/xml/cairo_current_line_cap.xml35
-rw-r--r--doc/reference/xml/cairo_current_line_join.xml35
-rw-r--r--doc/reference/xml/cairo_current_line_width.xml35
-rw-r--r--doc/reference/xml/cairo_current_matrix.xml41
-rw-r--r--doc/reference/xml/cairo_current_miter_limit.xml35
-rw-r--r--doc/reference/xml/cairo_current_operator.xml35
-rw-r--r--doc/reference/xml/cairo_current_point.xml47
-rw-r--r--doc/reference/xml/cairo_current_rgb_color.xml53
-rw-r--r--doc/reference/xml/cairo_current_target_surface.xml34
-rw-r--r--doc/reference/xml/cairo_current_tolerance.xml35
-rw-r--r--doc/reference/xml/cairo_curve_to.xml70
-rw-r--r--doc/reference/xml/cairo_default_matrix.xml35
-rw-r--r--doc/reference/xml/cairo_destroy.xml38
-rw-r--r--doc/reference/xml/cairo_fill.xml35
-rw-r--r--doc/reference/xml/cairo_fill_rule_t.xml40
-rw-r--r--doc/reference/xml/cairo_format_t.xml52
-rw-r--r--doc/reference/xml/cairo_hit.xml36
-rw-r--r--doc/reference/xml/cairo_identity_matrix.xml35
-rw-r--r--doc/reference/xml/cairo_in_fill.xml34
-rw-r--r--doc/reference/xml/cairo_in_stroke.xml34
-rw-r--r--doc/reference/xml/cairo_inverse_transform_distance.xml47
-rw-r--r--doc/reference/xml/cairo_inverse_transform_point.xml47
-rw-r--r--doc/reference/xml/cairo_line_cap_t.xml43
-rw-r--r--doc/reference/xml/cairo_line_to.xml47
-rw-r--r--doc/reference/xml/cairo_matrix_copy.xml41
-rw-r--r--doc/reference/xml/cairo_matrix_create.xml34
-rw-r--r--doc/reference/xml/cairo_matrix_destroy.xml35
-rw-r--r--doc/reference/xml/cairo_matrix_invert.xml35
-rw-r--r--doc/reference/xml/cairo_matrix_multiply.xml47
-rw-r--r--doc/reference/xml/cairo_matrix_rotate.xml41
-rw-r--r--doc/reference/xml/cairo_matrix_scale.xml47
-rw-r--r--doc/reference/xml/cairo_matrix_set_identity.xml35
-rw-r--r--doc/reference/xml/cairo_matrix_t.xml23
-rw-r--r--doc/reference/xml/cairo_matrix_transform_distance.xml47
-rw-r--r--doc/reference/xml/cairo_matrix_transform_point.xml47
-rw-r--r--doc/reference/xml/cairo_matrix_translate.xml47
-rw-r--r--doc/reference/xml/cairo_move_to.xml47
-rw-r--r--doc/reference/xml/cairo_new_path.xml35
-rw-r--r--doc/reference/xml/cairo_operator_t.xml47
-rw-r--r--doc/reference/xml/cairo_pop_group.xml35
-rw-r--r--doc/reference/xml/cairo_push_group.xml35
-rw-r--r--doc/reference/xml/cairo_rectangle.xml47
-rw-r--r--doc/reference/xml/cairo_reference.xml35
-rw-r--r--doc/reference/xml/cairo_rel_curve_to.xml70
-rw-r--r--doc/reference/xml/cairo_rel_line_to.xml47
-rw-r--r--doc/reference/xml/cairo_rel_move_to.xml47
-rw-r--r--doc/reference/xml/cairo_restore.xml36
-rw-r--r--doc/reference/xml/cairo_rotate.xml41
-rw-r--r--doc/reference/xml/cairo_save.xml36
-rw-r--r--doc/reference/xml/cairo_scale.xml47
-rw-r--r--doc/reference/xml/cairo_scale_font.xml41
-rw-r--r--doc/reference/xml/cairo_select_font.xml53
-rw-r--r--doc/reference/xml/cairo_set_alpha.xml42
-rw-r--r--doc/reference/xml/cairo_set_dash.xml53
-rw-r--r--doc/reference/xml/cairo_set_fill_rule.xml41
-rw-r--r--doc/reference/xml/cairo_set_font.xml40
-rw-r--r--doc/reference/xml/cairo_set_line_cap.xml41
-rw-r--r--doc/reference/xml/cairo_set_line_join.xml41
-rw-r--r--doc/reference/xml/cairo_set_line_width.xml41
-rw-r--r--doc/reference/xml/cairo_set_miter_limit.xml41
-rw-r--r--doc/reference/xml/cairo_set_operator.xml42
-rw-r--r--doc/reference/xml/cairo_set_pattern.xml41
-rw-r--r--doc/reference/xml/cairo_set_rgb_color.xml54
-rw-r--r--doc/reference/xml/cairo_set_target_drawable.xml45
-rw-r--r--doc/reference/xml/cairo_set_target_image.xml58
-rw-r--r--doc/reference/xml/cairo_set_target_png.xml51
-rw-r--r--doc/reference/xml/cairo_set_target_ps.xml52
-rw-r--r--doc/reference/xml/cairo_set_target_surface.xml41
-rw-r--r--doc/reference/xml/cairo_set_target_xcb.xml58
-rw-r--r--doc/reference/xml/cairo_set_tolerance.xml41
-rw-r--r--doc/reference/xml/cairo_show_glyphs.xml46
-rw-r--r--doc/reference/xml/cairo_show_text.xml41
-rw-r--r--doc/reference/xml/cairo_status.xml35
-rw-r--r--doc/reference/xml/cairo_status_string.xml35
-rw-r--r--doc/reference/xml/cairo_stroke.xml35
-rw-r--r--doc/reference/xml/cairo_stroke_path.xml35
-rw-r--r--doc/reference/xml/cairo_surface_clip_restore.xml35
-rw-r--r--doc/reference/xml/cairo_surface_destroy.xml35
-rw-r--r--doc/reference/xml/cairo_surface_get_matrix.xml41
-rw-r--r--doc/reference/xml/cairo_surface_reference.xml35
-rw-r--r--doc/reference/xml/cairo_surface_set_filter.xml41
-rw-r--r--doc/reference/xml/cairo_surface_set_matrix.xml41
-rw-r--r--doc/reference/xml/cairo_surface_set_repeat.xml41
-rw-r--r--doc/reference/xml/cairo_surface_t.xml17
-rw-r--r--doc/reference/xml/cairo_t.xml23
-rw-r--r--doc/reference/xml/cairo_text_extents.xml47
-rw-r--r--doc/reference/xml/cairo_text_extents_t.xml29
-rw-r--r--doc/reference/xml/cairo_transform_distance.xml47
-rw-r--r--doc/reference/xml/cairo_transform_font.xml41
-rw-r--r--doc/reference/xml/cairo_transform_point.xml47
-rw-r--r--doc/reference/xml/cairo_translate.xml47
-rw-r--r--doc/reference/xml/skeleton.xml30
-rw-r--r--gtk-doc.make163
-rw-r--r--src/Makefile.am81
-rw-r--r--src/cairo-atsui-font.c2
-rw-r--r--src/cairo-atsui.h11
-rw-r--r--src/cairo-cache.c104
-rw-r--r--src/cairo-color.c5
-rw-r--r--src/cairo-features.h.in6
-rw-r--r--src/cairo-fixed.c2
-rw-r--r--src/cairo-font.c479
-rw-r--r--src/cairo-ft-font.c1257
-rw-r--r--src/cairo-ft-private.h63
-rw-r--r--src/cairo-ft.h31
-rw-r--r--src/cairo-glitz-surface.c1484
-rw-r--r--src/cairo-glitz.h11
-rw-r--r--src/cairo-gstate.c1042
-rw-r--r--src/cairo-hash.c104
-rw-r--r--src/cairo-hull.c2
-rw-r--r--src/cairo-image-surface.c321
-rw-r--r--src/cairo-matrix.c170
-rw-r--r--src/cairo-path-bounds.c2
-rw-r--r--src/cairo-path-fill.c2
-rw-r--r--src/cairo-path-stroke.c2
-rw-r--r--src/cairo-path.c4
-rw-r--r--src/cairo-pattern.c1228
-rw-r--r--src/cairo-pdf-surface.c402
-rw-r--r--src/cairo-pdf.h11
-rw-r--r--src/cairo-pen.c2
-rw-r--r--src/cairo-png.h13
-rw-r--r--src/cairo-polygon.c2
-rw-r--r--src/cairo-ps-surface.c135
-rw-r--r--src/cairo-ps.h11
-rw-r--r--src/cairo-quartz-surface.c2
-rw-r--r--src/cairo-quartz.h11
-rw-r--r--src/cairo-slope.c2
-rw-r--r--src/cairo-spline.c2
-rw-r--r--src/cairo-surface.c540
-rw-r--r--src/cairo-traps.c269
-rw-r--r--src/cairo-unicode.c340
-rw-r--r--src/cairo-win32-font.c1252
-rw-r--r--src/cairo-win32-private.h87
-rw-r--r--src/cairo-win32-surface.c931
-rw-r--r--src/cairo-win32.h71
-rw-r--r--src/cairo-xcb-surface.c460
-rw-r--r--src/cairo-xcb.h11
-rw-r--r--src/cairo-xlib-surface.c619
-rw-r--r--src/cairo-xlib.h11
-rw-r--r--src/cairo.c225
-rw-r--r--src/cairo.h217
-rw-r--r--src/cairo_atsui_font.c2
-rw-r--r--src/cairo_cache.c104
-rw-r--r--src/cairo_color.c5
-rw-r--r--src/cairo_fixed.c2
-rw-r--r--src/cairo_font.c479
-rw-r--r--src/cairo_ft_font.c1257
-rw-r--r--src/cairo_gdip_font.cpp665
-rw-r--r--src/cairo_gdip_surface.cpp727
-rw-r--r--src/cairo_glitz_surface.c1484
-rw-r--r--src/cairo_gstate.c1042
-rw-r--r--src/cairo_hull.c2
-rw-r--r--src/cairo_image_surface.c321
-rw-r--r--src/cairo_matrix.c170
-rw-r--r--src/cairo_path.c4
-rw-r--r--src/cairo_path_bounds.c2
-rw-r--r--src/cairo_path_fill.c2
-rw-r--r--src/cairo_path_stroke.c2
-rw-r--r--src/cairo_pattern.c1228
-rw-r--r--src/cairo_pdf_surface.c402
-rw-r--r--src/cairo_pen.c2
-rw-r--r--src/cairo_png_surface.c118
-rw-r--r--src/cairo_polygon.c2
-rw-r--r--src/cairo_ps_surface.c135
-rw-r--r--src/cairo_quartz_surface.c2
-rw-r--r--src/cairo_slope.c2
-rw-r--r--src/cairo_spline.c2
-rw-r--r--src/cairo_surface.c540
-rw-r--r--src/cairo_traps.c269
-rw-r--r--src/cairo_unicode.c340
-rw-r--r--src/cairo_win32_font.c1252
-rw-r--r--src/cairo_win32_surface.c931
-rw-r--r--src/cairo_xcb_surface.c460
-rw-r--r--src/cairo_xlib_surface.c619
-rw-r--r--src/cairoint.h528
-rw-r--r--test/.cvsignore4
-rw-r--r--test/Makefile.am35
-rw-r--r--test/buffer-diff.c73
-rw-r--r--test/buffer-diff.h38
-rw-r--r--test/buffer_diff.c73
-rw-r--r--test/buffer_diff.h38
-rw-r--r--test/cairo-test.c162
-rw-r--r--test/cairo-test.h4
-rw-r--r--test/cairo_test.c162
-rw-r--r--test/cairo_test.h4
-rw-r--r--test/clip-twice-ref.pngbin0 -> 751 bytes
-rw-r--r--test/clip-twice.c72
-rw-r--r--test/clip_twice-ref.pngbin0 -> 751 bytes
-rw-r--r--test/clip_twice.c72
-rw-r--r--test/coverage-ref.pngbin0 -> 44324 bytes
-rw-r--r--test/coverage.c182
-rw-r--r--test/imagediff.c84
-rw-r--r--test/linear-gradient-ref.pngbin0 -> 12724 bytes
-rw-r--r--test/linear-gradient.c141
-rw-r--r--test/linear_gradient-ref.pngbin0 -> 12724 bytes
-rw-r--r--test/linear_gradient.c141
-rw-r--r--test/pixman-rotate-ref.pngbin0 -> 260 bytes
-rw-r--r--test/pixman-rotate.c78
-rw-r--r--test/pixman_rotate-ref.pngbin0 -> 260 bytes
-rw-r--r--test/pixman_rotate.c78
-rw-r--r--test/read-png.c6
-rw-r--r--test/read_png.c6
-rw-r--r--test/romedalen.pngbin0 -> 80944 bytes
-rwxr-xr-xtest/testsvg51
-rw-r--r--test/write-png.c17
-rw-r--r--test/write-png.h4
-rw-r--r--test/write_png.c17
-rw-r--r--test/write_png.h4
256 files changed, 21968 insertions, 13085 deletions
diff --git a/AUTHORS b/AUTHORS
index 43b265f79..73c98350e 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,6 +1,7 @@
+Shawn T. Amundson <amundson@gtk.org> Build fix
Olivier Andrieu <oliv__a@users.sourceforge.net> PNG backend
Peter Dennis Bartok <peter@novonyx.com> Bug fix for clipping
-Dave Beckett <dave.beckett@bristol.ac.uk> Track rename of libpixman, build fixes
+Dave Beckett <dajobe@debian.org> Build fixes, Debian packaging
Andrew Chant <andrew.chant@utoronto.ca> Adding const where needed
John Ellson <ellson@research.att.com> First font/glyph extents functions
Richard Henderson <rth@twiddle.net> "slim" macros for better shared libraries
@@ -10,11 +11,13 @@ Thomas Hunger <info@teh-web.de> Initial version of cairo_in_stroke/fill
Kristian Høgsberg <krh@redhat.com> PDF backend
Alexander Larsson <alexl@redhat.com> Profiling and performance fixes.
Jordi Mas <jordi@ximian.com> Bug fix for cairo_show_text
-Keith Packard <keithp@keithp.com> Original concept, polygon tessellation, dashing
+Keith Packard <keithp@keithp.com> Original concept, polygon tessellation, dashing, font metrics rewrite
Christof Petig <christof@petig-baender.de> Build fixes related to freetype
-David Reveman <davidr@freedesktop.org> New pattern API, OpenGL backend
+David Reveman <davidr@novell.com> New pattern API, glitz backend
+Calum Robinson <calumr@mac.com> Quartz backend
Jamey Sharp <jamey@minilop.net> Surface/font backend virtualization, XCB backend
Bill Spitzak <spitzak@d2.com> Build fix to find Xrender.h without xrender.pc
+Owen Taylor <otaylor@redhat.com> Font support rewrite
Sasha Vasko <sasha@aftercode.net> Build fix to compile without xlib backend
Vladimir Vukicevic <vladimir@pobox.com> Bug fix for clipping
Carl Worth <cworth@isi.edu> Original library, support for paths, images
diff --git a/BUGS b/BUGS
index fa754e98d..6ebf534a0 100644
--- a/BUGS
+++ b/BUGS
@@ -1,3 +1,19 @@
+cairo_show_surface fails when given a non-default CTM, see the
+show_surface.cairo snippet in:
+
+ From: Per Bjornsson <perbj@stanford.edu>
+ To: Cairo mailing list <cairo@cairographics.org>
+ Date: Wed, 09 Feb 2005 20:05:35 -0800
+ Message-Id: <1108008335.5349.46.camel@localhost.localdomain>
+ Subject: [cairo] How is cairo_show_surface supposed to work?
+
+--
+
+cairo_image_surface_create should return a blank image
+(eg. transparent black) instead of an image with random data in it.
+
+--
+
cairo_surface_create_for_image is claiming ownership of the user's data.
--
diff --git a/ChangeLog b/ChangeLog
index 48c0cb466..abf671a09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,972 @@
+2005-03-08 Carl Worth <cworth@cworth.org>
+
+ * gtk-doc.make (dist-check-gtkdoc): Commit workaround to prevent
+ make distcheck from making bogus complaints that gtk-doc is not
+ enabled.
+
+ * test/cairo_test.c (cairo_test_create_png_pattern): Look for png
+ images in ${srcdir}/filename as well, so that make distcheck can
+ still find them.
+
+ * test/Makefile.am (EXTRA_DIST): Add romedalen.png to EXTRA_DIST
+ so the tests can pass from the tar file.
+
+ * doc/public/cairo-sections.txt: Fix typo: cairo-win3 ->
+ cairo-win32.
+
+ * doc/public/cairo-docs.xml: Add cairo-win32.xml to the list, so
+ it gets generated as well.
+
+ * NEWS (http): Add pointer to new win32 documentation.
+
+ * configure.in: Increment CAIRO_VERSION to 0.4.0
+
+ * NEWS: Added notes for snapshot 0.4.0
+
+2005-03-08 Carl Worth <cworth@cworth.org>
+
+ * test/cairo_test.c (xunlink): Shared function for checking unlink
+ errrors.
+ (cairo_test): Move all error messages to test-specific log files
+ for quieter test output.
+
+ * test/Makefile.am (XFAIL_TESTS): Make pixman_rotate an expected
+ failure.
+
+ * configure.in: Require libpixman >= 0.1.4.
+
+2005-03-08 Kristian Høgsberg <krh@redhat.com>
+
+ * src/cairo_pdf_surface.c (_cairo_pdf_surface_composite): Return
+ CAIRO_STATUS_SUCCESS even if we don't implement masks yet, so we
+ don't set cr->status to CAIRO_INT_STATUS_UNSUPPORTED.
+
+2005-03-07 Carl Worth <cworth@cworth.org>
+
+ * src/cairo_traps.c: Disable the "new" intersection code so that
+ the incorrect fill problems (test/fill_rule) go away.
+
+ * configure.in: Make configure fail if no font backend is
+ available. Point the user at freetype and fontconfig.
+
+2005-03-06 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_pattern.c (_cairo_image_data_set_linear): Comment
+ and clean up the gradient computation.
+ (_cairo_linear_pattern_classify): Determine if a linear
+ gradient is horizontal or vertical.
+ (_cairo_pattern_acquire_surface_for_gradient): Optimize
+ horizontal/vertical gradients with a repeating surface.
+
+ * test/linear_gradient.c: Test case for linear gradients
+ at angles and with a rotated pattern matrix.
+
+2005-03-06 David Reveman <davidr@novell.com>
+
+ * src/cairo_glitz_surface.c (_cairo_glitz_pattern_acquire_surface):
+ Do not allow acceleration of gradients when color stops have different
+ alpha. Add note about the current state of glitz's gradient
+ acceleration. CAIRO_FILTER_GOOD and CAIRO_FILTER_BEST is ok.
+ (_cairo_glitz_surface_composite_trapezoids): Use unsigned short for
+ alpha.
+
+2005-03-04 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_win32_font.c src/cairo_win32_surface.c: Update
+ for recent backend interface changes.
+
+ * configure.in: Reenable win32 backend by default.
+
+2005-03-04 Carl Worth <cworth@cworth.org>
+
+ * src/cairo_glitz_surface.c
+ (_cairo_glitz_pattern_acquire_surface): Fix accidental reversal of
+ condition in previous patch.
+
+2005-03-04 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairoint.h src/cairo_pattern.c src/cairo_glitz_surface.c:
+ Add _cairo_pattern_is_opaque, use it rather than
+ pattern->alpha == 1.0.
+
+2005-03-04 David Reveman <davidr@novell.com>
+
+ * configure.in: Enable xcb backend.
+
+ * src/cairo_xcb_surface.c: Update xcb backend.
+
+ * configure.in: Fixed variable assignments.
+
+ * src/cairo_glitz_surface.c: Add overall alpha acceleration
+ to a few cases not covered by _cairo_pattern_acquire_surfaces but
+ possible to accelerate by glitz.
+
+ * src/cairo_pattern.c:
+ (_cairo_pattern_acquire_surfaces): Add overall alpha acceleration
+ using mask surface.
+
+ * src/cairoint.h:
+ Add convenience function _cairo_pattern_acquire_surfaces.
+
+ * src/cairo_xlib_surface.c:
+ * src/cairo_surface.c:
+ * src/cairo_ps_surface.c:
+ * src/cairo_png_surface.c:
+ * src/cairo_pdf_surface.c:
+ * src/cairo_pattern.c:
+ * src/cairo_image_surface.c:
+ * src/cairo_gstate.c:
+ * src/cairo_glitz_surface.c:
+ * src/cairo_ft_font.c (_cairo_ft_font_show_glyphs): Mask to composite
+ operation is now passed as a pattern.
+
+ * src/cairoint.h:
+ * src/cairo_xlib_surface.c:
+ (_cairo_xlib_surface_set_matrix): Setting identity transform should
+ always be successful.
+
+ * src/cairo_surface.c:
+ * src/cairo_ps_surface.c:
+ * src/cairo_png_surface.c:
+ * src/cairo_pdf_surface.c:
+ * src/cairo_image_surface.c:
+ * src/cairo_glitz_surface.c: Removed surface backend functions
+ set_matrix, set_filter, set_repeat.
+
+ * configure.in: Enabled glitz backend.
+
+ * src/cairo_glitz_surface.c: Major update to glitz backend. The output
+ quality should now be just as good as the image and xlib backends.
+
+ * configure.in: Disabled win32 and quartz backends as they are now
+ temporarily out of sync.
+
+ * src/cairoint.h: Replaced old cairo_pattern_t struct with new
+ cairo_surface_t like structure of cairo_pattern_t.
+ Added new function prototypes for acquiring a source surface from
+ a pattern.
+
+ * src/cairo_xlib_surface.c:
+ (_cairo_xlib_surface_composite): Removed fast path that used XCopyArea.
+
+ * src/cairo_ps_surface.c:
+ * src/cairo_pdf_surface.c:
+ * src/cairo_image_surface.c:
+ * src/cairo_gstate.c: Switched to cairo_surface_t like structure
+ of cairo_pattern_t and new interface for acquiring a source
+ surface from a pattern.
+
+ * src/cairo_pattern.c: New implementations of many functions. This was
+ necessary because of switch to cairo_surface_t like structure of
+ cairo_pattern_t. Includes new interface for acquiring a source
+ surface for a pattern. Things that didn't belong in cairoint.h have
+ been moved here.
+
+ * src/cairo_gstate.c (_cairo_gstate_show_surface): Inherit surface
+ attributes while surface attribute functions still exist.
+
+2005-03-01 Carl Worth <cworth@cworth.org>
+
+ * TODO: Note that cairo_output_stream_t patch has been reviewed.
+
+2005-03-01 Carl Worth <cworth@cworth.org>
+
+ * src/cairo_gstate.c (_cairo_gstate_show_surface): Fix
+ uninitialized value for status, (reported by Manish Singh).
+
+2005-02-27 Kristian Høgsberg <krh@redhat.com>
+
+ * src/cairo_gstate.c (_cairo_rectangle_intersect): Fix this
+ function again. Problem with signed/unsigned types reported by
+ Jeff Muizelaar <jrmuizel@nit.ca>.
+
+2005-02-27 Kristian Høgsberg <krh@redhat.com>
+
+ * src/cairo.h (cairo_fill_rule_t): Remove newline in comment which
+ was confusing gtk-doc.
+
+ * src/cairo_image_surface.c (cairo_image_surface_create_for_data)
+ (cairo_image_surface_create): Document these functions.
+
+2005-02-25 Carl Worth <cworth@cworth.org>
+
+ * TODO: Note that "user data" and "setters and getters" patches
+ have been reviewed. Remove a few more TODO notes:
+ cleanup cairo_snippets: DONE
+ cairo_surface_finish: Now in API Shakeup
+ snapping code: Decided against this
+
+2005-02-25 Carl Worth <cworth@cworth.org>
+
+ From David Reveman:
+
+ * src/cairo_matrix.c (_cairo_matrix_is_integer_translation):
+ Rewrite to use cairo_bool_t for legibility.
+
+2005-02-25 Carl Worth <cworth@cworth.org>
+
+ From David Reveman:
+
+ * src/cairo_gstate.c (_cairo_gstate_show_surface): Simplify code
+ to eliminate a goto.
+
+2005-02-25 Carl Worth <cworth@cworth.org>
+
+ From David Reveman:
+
+ * src/cairo_gstate.c (_cairo_gstate_pattern_init_copy):
+ (_cairo_gstate_clip_and_composite_trapezoids)
+ (_cairo_gstate_clip_and_composite_trapezoids)
+ (_cairo_gstate_show_surface, _cairo_gstate_show_glyphs)
+ (_cairo_gstate_show_glyphs): Clean up the mess that was
+ the misnamed _cairo_gstate_create_pattern.
+
+2005-02-25 Carl Worth <cworth@cworth.org>
+
+ * src/cairo_pattern.c (_cairo_pattern_shader_init): Don't put an
+ off-by-one n_stops into cairo_shader_op_t.
+ (_cairo_shader_op_find_color_stops): Put search for two color
+ stops containing a given offset into its own function. Handle the
+ case of before first and after last stop by returning the nearest
+ stop twice.
+ (_cairo_pattern_calc_color_at_pixel): Handle case of no color
+ stops by returning a transparent pixel.
+
+2005-02-24 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_win32_surface.c: Remove a left-over debug printf.
+
+2005-02-24 Carl Worth <cworth@cworth.org>
+
+ * src/cairo_pattern.c (cairo_pattern_add_color_stop): Fix memory
+ leak when realloc fails due to out-of-memory.
+
+2005-02-24 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_win32_surface.[ch]: Instead of counting
+ on ordering deletion to work (apparently it didn't on
+ older Windows), save the initial bitmap created
+ with the DC and reselect that into the DC. (Based
+ on a patch by Hans Breuer)
+
+2005-02-24 Carl Worth <cworth@cworth.org>
+
+ * test/.cvsignore: Add pixman_rotate to ignore list.
+
+2005-02-24 Carl Worth <cworth@cworth.org>
+
+ Fixes from David Reveman with minor cleanups by Carl Worth:
+
+ * src/cairo_gstate.c (_cairo_gstate_create): Handle new failure
+ possibility of _cairo_gstate_init.
+ (_cairo_gstate_init): Handle possible failure of
+ _cairo_pattern_create_solid.
+ (_cairo_gstate_set_pattern): Reference new pattern before
+ destroying existing pattern to handle the case where they are the
+ same.
+ (_cairo_gstate_set_rgb_color): Handle possible failure of
+ _cairo_pattern_create_solid.
+
+2005-02-24 Carl Worth <cworth@cworth.org>
+
+ * src/cairo.h: Fix typo (pointed out by Kristian Høgsberg).
+
+2005-02-24 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_win32_surface.c (_cairo_win32_surface_destroy):
+ When we created a DC/bitmap pair, delete the DC before
+ the Bitmap so that the Bitmap will be released from the
+ DC and can be destroyed. (Reported by Hans Breuer)
+
+ * configure.in cairo.pc.in: Only require fontconfig
+ if building FreeType font backend.
+
+ * configure.in: Fix output when reporting Win32 font backend.
+
+2005-02-24 Carl Worth c<worth@cworth.org>
+
+ * TODO: Remove many TODO items that have now been absorbed by the
+ API shakeup. Remove comparison with PostScript as there's nothing
+ interesting there left unimplemented, (and cairo is already
+ establishing its own conventions in naming and behavior that
+ deviate from PostScript).
+
+ * src/cairoint.h: Fix typo (pointed out by Mike Emmel)
+
+2005-02-23 Carl Worth <cworth@cworth.org>
+
+ * TODO: Add entries from API Shakeup.
+
+2005-02-22 Carl Worth <cworth@cworth.org>
+
+ * README:
+ * src/cairo-features.h.in:
+ * src/cairo-glitz.h:
+ * src/cairo-pdf.h:
+ * src/cairo-png.h:
+ * src/cairo-ps.h:
+ * src/cairo-quartz.h:
+ * src/cairo-xcb.h:
+ * src/cairo-xlib.h:
+ * src/cairo.c:
+ * src/cairo.h:
+ * src/cairo_color.c:
+ * src/cairo_fixed.c:
+ * src/cairo_font.c:
+ * src/cairo_gstate.c:
+ * src/cairo_hull.c:
+ * src/cairo_image_surface.c:
+ * src/cairo_matrix.c:
+ * src/cairo_path.c:
+ * src/cairo_path_bounds.c:
+ * src/cairo_path_fill.c:
+ * src/cairo_path_stroke.c:
+ * src/cairo_pen.c:
+ * src/cairo_png_surface.c:
+ * src/cairo_polygon.c:
+ * src/cairo_ps_surface.c:
+ * src/cairo_slope.c:
+ * src/cairo_spline.c:
+ * src/cairo_surface.c:
+ * src/cairo_traps.c:
+ * src/cairo_xcb_surface.c:
+ * src/cairo_xlib_surface.c:
+ * src/cairoint.h: Switch from broken cworth@isi.edu address to
+ canonical cworth@cworth.org address.
+
+2005-02-22 Carl Worth <cworth@cworth.org>
+
+ * test/write_png.c:
+ * src/cairo-atsui.h:
+ * src/cairo_atsui_font.c: Convert to utf-8 encoding.
+
+2005-02-22 Carl Worth <cworth@cworth.org>
+
+ * configure.in: Temporarily disable XCB backend by default.
+
+2005-02-21 Carl Worth <cworth@cworth.org>
+
+ * src/cairo_pattern.c (cairo_pattern_reference):
+ * src/cairo.h: Revert accidental commit.
+
+2005-02-21 Carl Worth <cworth@cworth.org>
+
+ * src/cairo_surface.c (_fallback_composite_trapezoids): Fix y
+ offset to use dst_y instead of dst_x, (caught by David Reveman).
+
+2005-02-20 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo-win32.h: Fix line endings (reported by
+ Hans Breuer)
+
+2005-02-16 Kristian Høgsberg <krh@redhat.com>
+
+ Patches from Mike Owens <etc@filespanker.com>:
+
+ * src/cairo_png_surface.c (_cairo_png_surface_copy_page): Free
+ rows if we fail early in this function.
+
+ * src/cairo_path.c (_cairo_path_init_copy): Clean up path if we
+ run out of memory.
+
+2005-02-13 Kristian Høgsberg <krh@redhat.com>
+
+ * src/cairo_pdf_surface.c
+ (_cairo_pdf_surface_create_for_document): Initialize array element
+ size correctly.
+
+2005-02-10 Kristian Høgsberg <krh@redhat.com>
+
+ Patches from Owen Taylor:
+
+ * src/cairo_pdf_surface.c
+ (_cairo_pdf_surface_show_glyphs): Emit text as octal escapes,
+ to avoid problems with \, \r, ), etc.
+ (_cairo_pdf_document_write_fonts): Change /Flags to be 4 (symbolic),
+ not 32 (non-symbolic), otherwise acroread gets confuse.
+ (cairo_pdf_ft_font_write_cmap_table): Use a 1,0 cmap subtable,
+ not a 0,0, to conform to the PDF spec.
+
+2005-02-13 Carl Worth <cworth@cworth.org>
+
+ * autogen.sh (LC_NUMERIC): Use LC_NUMERIC=C so that decimal
+ separator works in version checks.
+
+2005-02-12 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_gstate.c (_cairo_gstate_clip_and_composite_trapezoids): Fix
+ x2/x1 typo.
+
+2005-02-12 Carl Worth <cworth@cworth.org>
+
+ * src/cairo.c (cairo_text_extents): Return all-zero extents if
+ string is NULL.
+
+2005-02-12 Kristian Høgsberg <krh@redhat.com>
+
+ * src/cairo_gstate.c
+ (_cairo_gstate_clip_and_composite_trapezoids): Make clipping fast
+ path fast. When we have a clipping region set, intersect it
+ against the drawing extents to determine the bounding box for the
+ visible drawing.
+
+2005-02-10 Carl Worth <cworth@cworth.org>
+
+ * BUGS: Add bug for cairo_show_surface under non-default CTM.
+
+2005-02-07 Kristian Høgsberg <krh@redhat.com>
+
+ * test/pixman_rotate.c, test/pixman_rotate-ref.png: New test case
+ which exposes off-by-one rotation error in pixman.
+
+2005-02-06 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_gstate.c src/cairo.c: Allow cairo_set_font (cr, NULL)
+ to unset the current font and return the cairo_t to the the
+ "use the font from cairo_select_font() state".
+
+2005-02-06 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_win32_font.c (_cairo_win32_font_text_to_glyphs):
+ Return the right status. (Reported by Hans Breuer.)
+
+2005-02-06 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_win32_font.c (_cairo_win32_font_text_to_glyphs): Free
+ glyph_indices, not glyphs. (Reported by Hans Breuer.)
+
+2005-02-05 Carl Worth <cworth@cworth.org>
+
+ * configure.in: Add message stating why glitz backend is disabled.
+
+2005-02-05 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_ft_font.c (_cairo_ft_font_text_to_glyphs):
+ Don't free *glyphs when succeeding! (Reported by Øyvind Kolås)
+
+ * configure.in: Temporarily disable glitz by default.
+
+2005-02-04 Carl Worth <cworth@cworth.org>
+
+ * src/Makefile.am: Generate an error during make install if old
+ cairo headers are found in includedir, (rather than
+ includedir/cairo where the new ones are going).
+
+2005-02-03 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_ft_font.c (_cairo_ft_font_text_to_glyphs,
+ _cairo_ft_font_create_glyph): Fix missing cairo_ft_font_unlock_face().
+
+ * src/cairo_cache.c (_cairo_cache_random_entry): Fix problem
+ when no entry could be found.
+
+2005-02-03 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_font.c src/cairo.h doc/public/cairo-sections.txt:
+ Add cairo_font_extents().
+
+ * src/cairo_win32_font.c src/cairo-win32.h doc/public/cairo-sections.txt:
+ Rename cairo_font_create_for_logfont() into
+ cairo_font_create_for_logfontw() to make clear what it takes.
+ Don't add cairo_font_create_for_logfonta() for now.
+
+2005-02-02 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_win32_font.c doc/public/cairo-sections.txt
+ doc/public/Makefile.am: Add windows functions to the docs.
+
+2005-02-02 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_win32_font.c (cairo_win32_font_select_font,
+ cairo_win32_release_font, cairo_win32_font_get_scale_factor):
+ Add some functions to select the font into a device context
+ with the intention to enable callers to use, e.g, Uniscribe.
+
+ * src/cairo_win32_font.c: Use 'hdc' not 'dc' for param/variable
+ name.
+
+2005-02-02 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_win32_font.c (cairo_win32_font_select_font,
+ cairo_win32_release_font, cairo_win32_font_get_scale_factor):
+ Add some functions to select the font into a device context
+ with the intention to enable callers to use, e.g, Uniscribe.
+
+ * src/cairo_win32_font.c: Use 'hdc' not 'dc' for param/variable
+ name.
+
+ * src/cairo_win32_font.c (_cairo_win32_font_show_glyphs): Return
+ immediately if height or width is 0.
+
+2005-02-02 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_win32_font.c: Mostly-functioning Win32 font backend;
+ no glyph paths yet.
+
+ * configure.in: Turn on building of the Win32 font backend.
+
+ * src/cairo-win32-private.h src/Makefile.am: Private header for
+ the Win32 backend.
+
+ * src/cairo-win32-private.h src/cairo_win32_surface.c:
+ Internally export _cairo_win32_print_gdi_error() for use
+ in the font code.
+
+ * src/cairo-win32-private.h src/cairo_win32_surface.c:
+ Add _cairo_win32_surface_create_dib to create a DIB surface.
+
+ src/cairo-win32-private.h src/cairo_win32_surface.c:
+ Add _cairo_surface_is_win32()
+
+ * configure.in: Check for vasnprintf.
+
+ * test/cairo_test.c (xasprintf): Add a simple fixed-buffer size
+ snprintf fallback in the absence of vasnprintf.
+
+2005-02-01 Kristian Høgsberg <krh@redhat.com>
+
+ * src/cairo_pdf_surface.c (_cairo_pdf_surface_composite): Pretend
+ we support compositing of solid color or gradient patterns to
+ prevent image fallback.
+ (emit_pattern): New function, code factored out from
+ _cairo_pdf_surface_composite_trapezoids.
+ (_cairo_pdf_surface_show_glyphs): Use emit_pattern here so we get
+ pattern support for text.
+
+ * src/cairo_ft_font.c (_cairo_ft_font_get_unscaled_font): Fix typo.
+
+2005-02-01 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_unicode.c src/cairoint.h src/Makefile.am: Add
+ _cairo_utf8_to_utf16(), _cairo_utf8_to_ucs4() based on code from GLib.
+
+ * src/cairo.[ch]: Add CAIRO_STATUS_INVALID_STRING
+
+ * src/cairo_ft_font.c: Use _cairo_utf8_to_ucs4().
+
+ * src/cairo.h: Add cairo_bool_t
+
+ * src/cairoint.h: Add TRUE/FALSE definitions.
+
+ * src/cairo.[ch] src/cairoint.h src/cairo_gstate.c: switch
+ cairo_in_stroke/cairo_in_fill and all the functions used to
+ implement them over to cairo_bool_t.
+
+2005-01-31 Owen Taylor <otaylor@redhat.com>
+
+ * configure.in src/cairo-features.h.in: Add a check for the
+ Windows platform and --enable-win32. Also add some (currently
+ always off) stubs for native Win32 fonts.
+
+ * configure.in: Make building the PDF backend conditional
+ on having FreeType.
+
+ * src/Makefile.am src/cairo_win32_surface.c src/cairo_win32_font.c
+ src/cairo-win32.h: Add a Win32 backend using GDI and software
+ fallbacks Font code is not yet there yet, but it works with the
+ fontconfig backend.
+
+ * src/cairo_gdip_font.cpp src/cairo_gdip_surface.cpp: Remove
+ remnants of a GDI+ based backend.
+
+ * src/cairoint.h: Prefer platform-specific font backends
+ to the fontconfig backend.
+
+2005-01-31 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairoint.h src/cairo_image_surface.c
+ src/cairo_pdf_surface.c src/cairo_png_surface.c
+ src/cairo_surface.c src/cairo_xlib_surface.c: Replace
+ the get_image()/set_image() backend operations with
+ a more specific {acquire,release}_{source,dest}_image()
+ and clone_similar().
+
+ * src/cairoint.h src/cairo_pattern.c: Replace
+ _cairo_pattern_get_surface() with a
+ _cairo_pattern_begin_draw()/_cairo_pattern_end_draw() pair.
+
+ * src/cairo_image_surface.c: Save the format for which
+ an image is created so we can access it later. (Needed
+ for the _cairo_xlib_surface_clone_similar())
+
+ * src/cairoint.h src/cairo_image_surface.c:
+ Add _cairo_surface_is_image().
+
+ * src/cairoint.h: Add CAIRO_OK(status) to check
+ for CAIRO_STATUS_SUCCESS.
+
+ * src/cairo_xlib_surface.c: In the absence of of
+ RENDER, make cairo_xlib_surface_create_similar()
+ return an image surface.
+
+ * src/cairo_xlib_surface.c: Don't try to use RENDER
+ to composite glyphs in the absence of the RENDER
+ extension.
+
+2005-01-30 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_ps_surface.c (_cairo_ps_surface_copy_page): Update
+ composite-over-white code to use a pattern, not a surface.
+ (to match _cairo_surface_composite API change.)
+
+2005-01-30 Owen Taylor <otaylor@redhat.com>
+
+ Fixes from David Reveman:
+
+ * src/cairo_pattern.c (_cairo_pattern_save/restore_surface): Don't
+ save to surface part of the union when the pattern isn't a surface
+ pattern.
+ (_cairo_pattern_get_surface): Create the new surface at the width
+ and height of the source.
+
+ * src/Makefile.am (libcairo_ft_sources): Add cairo-ft-private.h
+
+2005-01-28 Kristian Høgsberg <krh@redhat.com>
+
+ * src/cairo_png_surface.c (_cairo_png_surface_composite): Update
+ prototype to eliminate warning.
+
+ * src/cairo_pattern.c (_cairo_pattern_init_copy): Remember to
+ reference surfaces when copying patterns.
+
+ * src/cairo_gstate.c: (_cairo_rectangle_intersect),
+ (_cairo_gstate_clip_and_composite_trapezoids),
+ (_cairo_gstate_clip), (_cairo_gstate_show_glyphs): Don't call
+ _gstate_create_pattern for internally created patterns.
+ (_cairo_gstate_show_surface): Don't change the surface matrix
+ here, it's done later when we set it up as a pattern.
+
+ * test/Makefile.am: Correct clip_twice-ref.png filename.
+
+ * src/cairoint.h (MIN, MAX): Add these.
+
+ * src/cairo_gstate.c (_cairo_rectangle_intersect): Fix broken
+ intersection code.
+
+2005-01-27 Kristian Høgsberg <krh@redhat.com>
+
+ * src/cairo_pattern.c (_cairo_pattern_get_surface): Make sure we
+ always return a surface similar to dst in the gradient case.
+
+ * src/cairo_pattern.c (_cairo_pattern_get_surface): Fold
+ _cairo_pattern_get_image into _cairo_pattern_get_surface and make
+ sure we always return a surface of the same type as dest.
+
+ * src/cairo_glitz_surface.c (_cairo_glitz_composite),
+ (_cairo_glitz_surface_composite_trapezoids): Use
+ _cairo_pattern_get_surface instead of _cairo_pattern_get_image.
+
+ * src/cairo_xlib_surface.c (_cairo_xlib_surface_show_glyphs),
+ (_cairo_xlib_surface_composite)
+ (_cairo_xlib_surface_composite_trapezoids): Remove use of
+ _cairo_xlib_surface_clone_similar since _cairo_pattern_get_surface
+ always gives us an xlib surface for the pattern. Clean up error
+ handling code in _cairo_xlib_surface_show_glyphs.
+
+ * src/cairo_image_surface.c (_cairo_image_surface_composite):
+ (_cairo_image_surface_composite_trapezoids): Add missing
+ cairo_surface_destroy and tidy up offset calculations as suggested
+ by Owen.
+
+ * src/cairoint.h (cairo_clip_rect_t):
+ * src/cairo_gstate.c (_cairo_gstate_clip_and_composite_trapezoids)
+ (_cairo_gstate_clip, _cairo_gstate_show_glyphs): Simplify code for
+ computing the extents of clipping area, by introducing a couple of
+ cairo_rectangle_t functions.
+
+2005-01-27 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo.[ch] src/cairo_font.c src/cairo_ft_font.c
+ src/cairo_ps_surface.c src/cairo_xlib_surface.c: Move
+ docs from docs/reference, with a fair bit of addition
+ and rewriting.
+
+ * doc/reference/: Remove old-format docs.
+
+ * configure.in: Add a AC_PREREQ(2.54) (Jason Dorje Short)
+
+2005-01-27 Kristian Høgsberg <krh@redhat.com>
+
+ * test/coverage-ref.png:
+ * test/clip_twice-ref.png:
+ Update these two once again, this time generated using
+ libpixman-0.1.3 without leaky circles.
+
+2005-01-27 Owen Taylor <otaylor@redhat.com>
+
+ * configure.in Makefile.am docs/Makefile.am docs/public/*:
+ Add framework for doing docs via gtk-doc.
+
+ * src/cairo.[ch] src/cairo-matrix.c: Add some inline docs
+ for arcs and matrices.
+
+ * gtk-doc.m4 acinclude.m4: Check in files from gtk-doc
+ to make the dependency on gtk-doc optional.
+
+ * autogen.sh (LANG): Add --enable-gtk-doc to the default
+ args.
+
+2005-01-27 Kristian Høgsberg <krh@redhat.com>
+
+ * test/write_png.c (unpremultiply_data):
+ * test/read_png.c (premultiply_data):
+ Fix missing rounding in these two functions.
+
+ * test/coverage-ref.png:
+ * test/clip_twice-ref.png:
+ Update these to versions with properly rounded alpha values.
+
+ * test/Makefile.am: Move clip_twice out of XFAIL now that rounding
+ works.
+
+ * test/.cvsignore: Add new test cases.
+
+2005-01-27 Kristian Høgsberg <krh@redhat.com>
+
+ The overall idea of this rewrite is that we want to pass the
+ source pattern all the way down into the backends. The motivation
+ for this is that not all backends want a surface for the source
+ operand, and by passing the pattern down, backends can choose to
+ convert it to a surface if they need that.
+
+ The patch removes the create_surface function pointer from the
+ surface vtable and moves much of that code into a couple of helper
+ functions. The composite, compsite_trapezoids, and show_glyphs
+ backend functions are updated to take a cairo_pattern_t instead of
+ a surface as the source.
+
+ * src/cairo_font.c: (_cairo_font_show_glyphs):
+ * src/cairo_gstate.c: (_cairo_gstate_create_pattern),
+ (_cairo_gstate_clip_and_composite_trapezoids),
+ (_cairo_gstate_clip), (_cairo_gstate_show_surface),
+ (_cairo_gstate_show_glyphs):
+ Change these functions to not create a surface for the pattern and
+ just pass the pattern down to the backend functions.
+
+ * src/cairo_gstate.c: (translate_traps):
+ New function to translate a set of trapezoids.
+
+ * src/cairo_pattern.c:
+ (_cairo_pattern_init),
+ (_cairo_pattern_init_copy),
+ (_cairo_pattern_prepare_surface),
+ (_cairo_pattern_restore_surface):
+ Break out the code to adjust and restore surface transformation
+ and repeat settings into _cairo_pattern_prepare_surface and
+ _cairo_pattern_restore_surface.
+
+ * src/cairo_pattern.c: (_cairo_pattern_fini),
+ (_cairo_pattern_init_for_surface),
+ (cairo_pattern_create_for_surface):
+ Split cairo_pattern_create_for_surface into an init function and a
+ create function.
+
+ * src/cairo_pattern.c: (_cairo_pattern_get_image),
+ (_cairo_pattern_get_surface):
+ Utility functions to create a surface from a pattern.
+
+ * src/cairo_ft_font.c:
+ * src/cairo_image_surface.c:
+ * src/cairo_pdf_surface.c:
+ * src/cairo_png_surface.c:
+ * src/cairo_ps_surface.c:
+ * src/cairo_xlib_surface.c:
+ * src/cairo_glitz_surface.c:
+ Update these backends to work with the new pattern API. Glitz
+ work by David Reveman.
+
+ * src/cairo_surface.c: (_cairo_surface_composite),
+ (_cairo_surface_composite_trapezoids),
+ (_cairo_surface_set_clip_region):
+ Update these to pass through the new set of args.
+
+ * test/coverage-ref.png:
+ Update this reference image as we now render it correctly.
+
+2005-01-26 Kristian Høgsberg <krh@redhat.com>
+
+ * test/clip_twice.c, test/clip_twice-ref.png: New test case to
+ verify that the clip surface is correctly updated when extending
+ an existing clip path.
+
+ * test/coverage.c (draw): Set alpha to 1 before setting clip mask.
+
+ * test/coverage-ref.png: Added the right reference PNG. Running
+ test against stock 0.3.0 gives the expected results.
+
+ * test/Makefile.am, test/coverage.c, test/coverage-ref.png: New
+ test case, covering various combinations of pattern types, drawing
+ operations and clipping. Currently fails, for some combinations,
+ coverage-ref.png is just a placeholder.
+
+ * test/romedalen.png: Added this PNG from cairo-snippets to use
+ for pattern fills.
+
+ * test/cairo_test.c, test/cairo_test.h: expose PNG loading to test
+ cases.
+
+2005-01-26 Alexander Larsson <alexl@redhat.com>
+
+ * src/cairo_ft_font.c: (_ft_unscaled_font_set_scale):
+ Fix access to uninitialized data
+
+ * src/cairo_xlib_surface.c:
+ key must be first element in cache entry
+
+2005-01-25 David Reveman <davidr@novell.com>
+
+ * AUTHORS: Update mail address.
+
+ * src/cairo_glitz_surface.c: Update mail address.
+
+ * configure.in: Require version 0.4.0 of glitz.
+
+ * src/cairo_glitz_surface.c: Track changes to glitz.
+
+ * src/cairo_xcb_surface.c: Add missing include directive so xcb
+ backend compile again.
+
+2005-01-25 Carl Worth <cworth@cworth.org>
+
+ * test/imagediff.c
+ * test/testsvg: Add new testsvg script and accompanying imagediff
+ program, (for interim SVG-based test suites while we wait for the
+ standard cairo test suite to mature).
+
+ * test/buffer_diff.c:
+ * test/cairo_test.c: Split buffer_diff out into its own file for
+ the purpose of imagediff.
+
+ * src/cairo_ft_font.c (_cairo_ft_font_show_glyphs): Fixed rounding
+ of glyph positioning.
+
+2005-01-25 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_pdf_surface.c (_cairo_pdf_document_get_font): Chec
+ pdf_font for NULL, not font.
+
+2005-01-25 Alexander Larsson <alexl@redhat.com>
+
+ * src/Makefile.am:
+ Fix typo that made cairo-ft.h not get installed
+
+2005-01-24 Carl Worth <cworth@cworth.org>
+
+ * AUTHORS: Add Shawn T. Amundson, Calum Robinson, and Owen Taylor.
+
+ * src/Makefile.am: Conditionally install header files only for
+ backends that are compiled. Thanks to Shawn T. Amundson
+ <amundson@gtk.org>.
+
+ * src/cairoint.h:
+ * src/cairo_color.c (_cairo_color_get_rgb): Qualify color argument
+ as const. Closes bug #2336.
+
+2005-01-23 Dave Beckett <Dave.Beckett@bristol.ac.uk>
+
+ * src/cairo_ft_font.c (_get_load_flags): Protect switch on
+ hintstyle with #ifdef FC_HINT_STYLE.
+
+2005-01-23 Carl Worth <cworth@cworth.org>
+
+ * RELEASING: Add instructions for handling the new "-head" suffix
+ of CAIRO_VERSION at release-time.
+
+ * configure.in: Append "-head" to CAIRO_VERSION to indicate state
+ between snapshots.
+
+ * src/cairo_gstate.c: Add missing prototype for _cairo_gstate_ensure_font.
+ (_cairo_gstate_current_font): Add missing declaration so things
+ compile again.
+
+2005-01-21 Owen Taylor <otaylor@redhat.com>
+
+ * Call _cairo_gstate_ensure_font(). Don't reference
+ the returned font.
+
+2005-01-21 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo_ft_font.c (_get_load_flags): Make dependence
+ on FC_HINT_STYLE conditional. (reported by Abraham Egnor)
+
+ * src/cairo_ft_font.c: Use FT_LOAD_MONOCHROME if
+ FT_LOAD_TARGET_MONO isn't defined for compatibility
+ with older FreeType.
+
+2005-01-16 Owen Taylor <otaylor@redhat.com>
+
+ Change cairo_font_t to refer to a font scaled to a particular
+ output device resolution.
+
+ * src/cairoint.h src/cairo_font.c src/cairo_ft_font.c
+ src/cairo_xlib_surface.c src/cairo_pdf_surface.c src/cairo_gstate.c
+ src/cairo.c: Switch many internal methods from handling
+ cairo_unscaled_font_t and cairo_font_scale_t pairs to handling
+ cairo_font_t.
+
+ * src/cairo-ft-private.h src/cairo_ft_fontc: Add some internal
+ interfaces for use by the FreeType backend.
+
+ * src/cairo_gstate.c: Clear the gstate's current font when
+ the transform or target surface changes.
+
+ * src/cairo.h src/cairo_ft_font.c: Rename cairo_ft_font_pattern
+ to cairo_ft_font_get_pattern().
+
+ * src/cairo.h src/cairo_ft_font.c: Make cairo_ft_font_create()
+ and cairo_ft_font_create_for_ft_face() take a font scale;
+ make the latter take load_flags for FT_Load_Glyph() as well.
+ Change cairo_ft_font_face() to Xft-style cairo_ft_font_lock_face,
+ cairo_ft_font_unlock_face.
+
+ * src/cairo_font.c: Remove the name/slant/weight=>unscaled font
+ cache, it didn't work with the new cairo_font_t setup. If it turns
+ out to be needed, it can be added back in some other form.
+
+ * src/cairoint.h src/cairo_font.c: Add a 'flags' field
+ to cairo_glyph_cache_key_t, we use it for load flags with
+ freetype backend.
+
+ * src/cairo_ft_font.c: Switch the caching to be from
+ resolved fontconfig pattern => file; keep only a fixed number
+ of FT_Face objects open at once, similar to FreeType.
+
+ * src/cairo_font.c (cairo_font_glyph_extents) src/cairo_gstate.c
+ src/cairoint.h: Add public cairo_font_glyph_extents, use it
+ to implement _cairo_gstate_glyph_extents().
+
+ * src/cairo_xlib_surface.c (_glyphset_cache_entry_reference):
+ Add refcounting for glyph cache elements; there was an
+ bug where elements got ejected from the cache and freed before
+ they could be used.
+
+ * src/cairoint.h src/cairo_cache.c (_cairo_cache_random_entry())
+ New function to return a random entry in the cache matching a predicate;
+ reuse the internals for the previous _random_live_entry().
+
+ * src/cairoint.h src/cairo_cache.c (_cairo_cache_lookup()): Add an
+ optional created_entry return value.
+
+ * src/cairo_ft_font.c src/cairo_xlib_surface.c: Adapt to
+ _cairo_cache_lookup() change.
+
+ * src/cairo_cache.c (_cairo_cache_lookup()): Support max_memory == 0
+ to indicate an unbounded cache.
+
+ * src/cairoint.h src/cairo_cache.c (_cairo_cache_remove()): Add a
+ function to manually remove entries from the cache.
+
+ * doc/reference: Update for changes, document cairo_matrix_t,
+ cairo_glyph_t, etc.
+
+ * src/cairo.h src/cairo-atsui.h src/cairo-ft.h src/cairo-glitz.h
+ src/cairo-pdf.h src/cairo-png.h src/cairo-ps.h src/cairo-quartz.h
+ src/cairo-xcb.h src/cairo-xlib.h: Add CAIRO_BEGIN/END_DECLS for
+ extern "C", use it on all public headers. Move header guards
+ outermost.
+
+ * src/cairo_quartz_surface.c: Fix encoding.
+
2005-01-21 Carl Worth <cworth@cworth.org>
* configure.in: Increment CAIRO_VERSION to 0.3.0
diff --git a/Makefile.am b/Makefile.am
index 3a33e9a7c..60ae80514 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = src test
+SUBDIRS = src test doc
EXTRA_DIST = \
COPYING \
diff --git a/NEWS b/NEWS
index 6bb4c13c7..62a1b1829 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,129 @@
+Snapshot 0.4.0 (2005-03-08 Carl Worth <cworth@cworth.org>)
+==========================================================
+New documentation
+-----------------
+Owen Taylor has converted cairo's documentation system to gtk-doc and
+has begun some long-needed work on the documentation, which can now be
+viewed online here:
+
+ http://cairographics.org/manual/
+
+New backend: win32
+------------------
+This is the first snapshot to include a functional win32 backend,
+(thanks to Owen Taylor). The interface is as follows:
+
+ #include <cairo-win32.h>
+
+ void
+ cairo_set_target_win32 (cairo_t *cr,
+ HDC hdc);
+
+ cairo_surface_t *
+ cairo_win32_surface_create (HDC hdc);
+
+ cairo_font_t *
+ cairo_win32_font_create_for_logfontw (LOGFONTW *logfont,
+ cairo_matrix_t *scale);
+
+ cairo_status_t
+ cairo_win32_font_select_font (cairo_font_t *font,
+ HDC hdc);
+
+ void
+ cairo_win32_font_done_font (cairo_font_t *font);
+
+ double
+ cairo_win32_font_get_scale_factor (cairo_font_t *font);
+
+And see also the documentation at:
+
+http://cairographics.org/manual/cairo-Microsoft-Windows-Backend.html
+
+Disabled backend: quartz
+------------------------
+Unfortunately, the quartz backend code is currently out of date with
+respect to some recent backend interface changes. So, the quartz
+backend is disabled in this snapshot.
+
+If the quartz backend is brought up-to-date before the next snapshot,
+we would be glad to make a 0.4.1 snapshot that re-enables it, (we do
+not expect many more big backend interface changes).
+
+API Changes
+-----------
+The font system has been revamped, (as Owen Taylor's work with
+integrating pango and cairo gave us the first serious usage of the
+non-toy font API).
+
+One fundamental, user-visible change is that the cairo_font_t object
+now represents a font that is scaled to a particular device
+resolution. Further changes are described below.
+
+ cairo.h
+ -------
+ Removed cairo_font_set_transform and cairo_font_current_transform.
+
+ Added cairo_font_extents and cairo_font_glyph_extents. See
+ documentation for details:
+
+ http://cairographics.org/manual/cairo-cairo-t.html#cairo-font-extents
+
+ cairo-ft.h
+ ----------
+ The cairo_ft_font API changed considerably. Please see the
+ documentation for details:
+
+ http://cairographics.org/manual/cairo-FreeType-Fonts.html
+
+Performance
+-----------
+Make the fast-path clipping (pixel-aligned rectangles) faster.
+
+Add optimization for applying a constant alpha to a pattern.
+
+Optimize gradients that are horizontal or vertical in device space.
+
+Xlib: When RENDER is not available, use image surfaces for
+intermediate surfaces rather than xlib surfaces.
+
+Backend-specific changes
+------------------------
+ Glitz
+ -----
+ Major update to glitz backend. The output quality should now be just
+ as good as the image and xlib backends.
+
+ Track changes to glitz 0.4.0.
+
+ PDF
+ ---
+ Various improvements to produce more conformant output.
+
+Internals
+---------
+David Reveman contributed a large re-work of the cairo_pattern_t
+implementation, providing cleaner code and more optimization
+opportunities.
+
+ Backend interface changes
+ -------------------------
+ Rework backend interface to accept patterns, not surfaces for source
+ and mask.
+
+ Remove set_matrix, set_filter, and set_repeat functions.
+
+ More sophisticated backend interface for image fallbacks,
+ ({acquire,release}_{source,dest}_image() and clone_similar).
+
+Bug fixes
+---------
+Only install header files for backends that have been compiled.
+
+Fixed some rounding errors leading to incorrectly placed glyphs.
+
+Many other minor fixes.
+
Snapshot 0.3.0 (2005-01-21 Carl Worth <cworth@cworth.org>)
==========================================================
Major API changes
diff --git a/README b/README
index 47f7ff9bf..5649c4bbc 100644
--- a/README
+++ b/README
@@ -43,7 +43,7 @@ model will help in understanding cairo.
History
-------
-Cairo was originally developed by Carl Worth <cworth@isi.edu> and
+Cairo was originally developed by Carl Worth <cworth@cworth.org> and
Keith Packard <keithp@keithp.com>. Many thanks are due to Lyle Ramshaw
without whose patient help our ignorance would be much more apparent.
diff --git a/RELEASING b/RELEASING
index 9088f9b5d..57f289dfc 100644
--- a/RELEASING
+++ b/RELEASING
@@ -39,15 +39,19 @@ fixes are committed. Here are the steps to follow:
4) Increment CAIRO_VERSION in configure.in
- Right now, in its pre-release form, we are incrementing
- CAIRO_VERSION for each snapshot but we are not changing
- the libtool shared library version information. Increment the
- subminor version for bug fixes and backwards-compatible
- additions to the API. Increment the minor number (and reset
- the subminor) for backward-incompatible changes to the API
- (including removals). Leave the major number at 0 until we are
- ready for the first 1.0 release, (at which point these rules
- will change).
+ First, remove the "-head" suffix, then increment the version
+ as follows:
+
+ If there are backward-incompatible changes in the API,
+ (function removals, or semantic changes), increment the minor
+ number and reset the sub-minor number to 0.
+
+ Otherwise, (that is, if there are only bug fixes and perhaps
+ API additions), then increment only the sub-minor number.
+
+ Prior to the initial "1.0" release of cairo, leave the major
+ number at 0. Also, do not modify the "libtool shared library
+ version" variables, (LT_CURRENT, LT_VERSION, LT_AGE).
5) Commit the changes to NEWS and configure.in
@@ -71,6 +75,8 @@ fixes are committed. Here are the steps to follow:
cvs tag SNAPSHOT_X_Y_Z
+8) Add a "-head" to CAIRO_VERSION in configure, and commit.
+
9) Send a message to cairo-announce@cairographics.org to announce the
new snapshot using the text provided from "make release-publish".
diff --git a/TODO b/TODO
index bbd549f99..f0edbc309 100644
--- a/TODO
+++ b/TODO
@@ -1,51 +1,47 @@
-* Add support for non-antialiased rendering. API ?
-
-* Cleanup cairo_snippets so they operate in a more default cairo
- environment, (particularly with a default CTM).
-
-* Add one of cairo_surface_finish/_finalize/_close to resolve the
- "reference counting vs garbage collection" thread.
+API Shakeup work
+----------------
+Patch? Reviewed?
+yes yes user data (was Re: [cairo] Patch improving fallbacks)
+ cairo_paint
+yes yes setters and getters
+ cairo_current_matrix
+ Renaming the terms of the rendering equation
+ Making set_source consistent
+ Eliminating cairo_show_surface
+ cairo_mask
+ cairo_begin_group, cairo_end_group, cairo_get_group
+yes yes cairo_output_stream_t and cairo_surface_finish()
+ cairo_create and eliminating cairo_set_target_surface
+ cairo_fill_preserve, cairo_stroke_preserve, cairo_clip_preserve
+ default matrix
+ cairo_current_path -> cairo_copy_path_data
+ cairo_surface_finish, cairo_surface_flush
+ cairo_<device>_surface_mark_dirty
+ Eliminating cairo_copy
+ Eliminating cairo_surface_set_repeat/matrix/filter
+ A hidden offset for the xlib backend
+ cairo_stroke_path -> cairo_stroke_to_path
+ Simplifying the operator set
+ Abbreviation hunt: cairo_init_clip and cairo_concat_matrix
+ Consistent error handling for all objects
-* Shove experimental snapping code from libsvg-cairo down int cairo
- proper.
+* Add support for non-antialiased rendering. API ?
* Clean up the cache code a bit, (there is at least one redundant
level of cacheing, and there are some minor style issues).
-* Implement the parallel install stuff, (most importantly, push
- cairo.h down into into one directory below $(includedir)).
-
* Add CAIRO_FILL_RULE_INVERSE_WINDING and CAIRO_FILL_RULE_INVERSE_EVEN_ODD
-* Simplifying the operator set?
-
* Fix clipping to work for all operators. The equation we have come up
with is:
((src Op dest) In clip) Add (dest Out clip)
-* Resolve the rest of the rendering equation. We need a fundamental
- equation upon which more convenient operations are based, (at least
- formally). Some of the common operations that should be convenient:
-
- * display surface
- * display surface multiplied by constant alpha
- * display pattern masked by surface
-
- So this involves deciding whether to expose a new mask object in the
- graphics state, and deciding exactly what set_alpha means. It almost
- certainly means adding cairo_show_surface_mask.
-
-* Implement a hidden transform, (as per the result of the hidden
- offset thread on the mailing list).
-
* Replace PNG backend with an image_surface function to save a PNG
image.
* Clean up the API in preparation for freezing and release.
-* Implement a PDF backend.
-
* Make a more interesting PS backend, (other than the current
"giant-image for every page" approach).
@@ -54,9 +50,6 @@
* Change stroke code to go through one giant polygon. This will fix
problems with stroking self-intersecting paths.
-* Implement cairo_stroke_path, (very easy to do after the above change
-is done).
-
* Re-work the backend clipping interface to use geometry rather than
images.
@@ -90,17 +83,6 @@ do gradients the Right Way).
* Implement cairo_arc_to.
-* Fix support for old X servers so that it is not swamped with image
-transport. The key idea is to assume that nothing external to cairo
-will be drawing to the same drawable after it is handed to
-cairo. Beyond that, we might actually provide support for cooperating
-with external entities by adding one or more of the following
-functions:
-
- cairo_flush
- cairo_erase
- cairo_mark_dirty
-
* Re-implement the trapezoid rasterization algorithm according to the
new "specification".
@@ -146,134 +128,3 @@ functions:
* Verification, profiling, optimization.
centi_unfinished.svg may provide a good test case.
-
-A comparison with PostScript
-============================
-
-Here's a list of several classes of PostScript operators indicating
-which operators have rough equivalents in cairo and which do not. In
-general, the name of a cairo function corresponding to a PostScript
-operator can be obtained by inserting a '_' between each word and
-prefixing it with "cairo_". For example, "cairo_move_to" corresponds
-to the PostScript "moveto".
-
-In cases where the name of the cairo function deviates from this
-convention, or when the behavior of the cairo function is
-significantly different, the change is noted in parentheses below.
-
-This list is not exhaustive, (there are definitely some minor (major?)
-semantic deviations that are not noted below). Also, this list is
-almost certainly out of date with respect to the current cairo
-implementation. Caveat lector.
-
-Operators that are not yet in cairo, but probably should be: arcto,
-strokepath, rectclip?, clipsave/restore?, setstrokeadjust?,
-currentdash, grestoreall?, initgraphics?, currentgstate?, setgstate?,
-erasepage?, setsmoothness?
-
-Painting operators
-------------------
-in cairo: stroke, fill, eofill (set_fill_rule/fill), image
-(show_surface)
-
-not in cairo: erasepage, rectstroke, rectfill, shfill, colorimage,
-imagemask
-
-Path construction operators
----------------------------
-in cairo: arc, arcn (arc_negative), newpath, moveto, rmoveto
-(rel_move_to), lineto, rlineto (rel_line_to), curveto, rcurveto
-(rel_curve_to), closepath, currentpoint, charpath (text_path),
-pathforall (current_path), flattenpath (current_path_flat)
-
-not in cairo: arct, arcto, reversepath, strokepath, clippath, pathbbox
-
-Clipping
---------
-in cairo: clip, eoclip (set_fill_rule/clip)
-
-not in cairo: initclip, rectclip, clipsave, cliprestore
-
-Graphics state operators
-------------------------
-in cairo: setlinewidth, currentlinewidth, setlinecap, currentlinecap,
-setlinejoin, currentlinejoin, setmiterlimit, currentmiterlimit,
-setdash
-
-not in cairo: setstrokeadjust, currentstrokeadjust, currentdash
-
-Color specification operators
------------------------------
-in cairo: setrgbcolor, currentcolor
-
-not in cairo: setcolor, setgray, currentgray, currentrgbcolor,
-sethsbcolor, currenthsbcolor, setcmykcolor, currentcmykcolor,
-setcolorspace, currentcolorspace
-
-Form and pattern operators
---------------------------
-in cairo: setpattern, makepattern (lock_pattern)
-
-not in cairo: execform
-
-Whole-state manipulation
-------------------------
-in cairo: gsave (save), grestore (restore)
-
-not in cairo: grestoreall, initgraphics, gstate, currentgstate,
-setgstate
-
-Coordinate system and matrix operators
---------------------------------------
-in cairo: identmatrix (identity_matrix), initmatrix (default_matrix),
-setmatrix, translate, scale, rotate, concatmatrix, currentmatrix,
-transform (transform_point), dtransform (transform_distance)
-
-not in cairo: matrix, defaultmatrix, concat, itransform, idtransform,
-invertmatrix
-
-Insideness testing
-------------------
-in cairo: infill, instroke, ineofill (set_fill_rule/in_fill)
-
-not in cairo: inufill, inustroke, inueofill
-
-Device setup
-------------
-in cairo: showpage, copypage
-
-not in cairo: setpagedevice, currentpagedevice, nulldevice
-
-Glyph and font operators
-------------------------
-in cairo: currentfont, definefont (font_create_for_ft_face),
-undefine_font (font_destroy), findfont (font_create), makefont
-(transform_font), setfont, scalefont, selectfont, show (show_text),
-stringwidth (x/y in text_extents), xyshow (glyph_show -- but ignoring
-current_point and using absolute positions)
-
-not in cairo, (and likely not needed): composefont, rootfont, ashow,
-widthshow, awidthshow, xshow, xyshow, yshow, glyphshow, cshow, kshow,
-FontDirectory, GlobalFontDirectory, StandardEncoding,
-ISOLatin1Encoding, findencoding, setcachedevice, setcachedevice2,
-setcharwidth
-
-Graphics state operators (device-dependent)
--------------------------------------------
-in cairo: setflat (set_tolerance), currentflat (current_tolerance)
-
-not in cairo: sethalftone, currenthalftone, setscreen, currentscreen,
-setcolorscreen, currentcolorscreen, settransfer, currenttransfer,
-setcolortransfer, currentcolortransfer, setblackgeneration,
-currentblackgeneration, setundercolorremoval,
-currentundercolorremoval, setcolorrendering, currentcolorrendering,
-setoverprint, currentoverprint, setsmoothness, currentsmoothness
-
-PostScript operators never to be in cairo
------------------------------------------
-Operator Stack Manipulation Operators, Arithmetic and Math Operators,
-Array Operators, Packed Array Operators, Dictionary Operators, String
-Operators, Rational,Boolean,and Bitwise Operators, Control Operators,
-Type,Attribute,and Conversion Operators, File Operators, Resource
-Operators, Virtual Memory Operators, Miscellaneous Operators,
-Interpreter Parameter Operators, Errors, User Path Operators
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 000000000..af73800bf
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,53 @@
+dnl -*- mode: autoconf -*-
+
+# serial 1
+
+dnl Usage:
+dnl GTK_DOC_CHECK([minimum-gtk-doc-version])
+AC_DEFUN([GTK_DOC_CHECK],
+[
+ AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+ AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+ dnl for overriding the documentation installation directory
+ AC_ARG_WITH(html-dir,
+ AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
+ [with_html_dir='${datadir}/gtk-doc/html'])
+ HTML_DIR="$with_html_dir"
+ AC_SUBST(HTML_DIR)
+
+ dnl enable/disable documentation building
+ AC_ARG_ENABLE(gtk-doc,
+ AC_HELP_STRING([--enable-gtk-doc],
+ [use gtk-doc to build documentation [default=no]]),,
+ enable_gtk_doc=no)
+
+ have_gtk_doc=no
+ if test x$enable_gtk_doc = xyes; then
+ if test -z "$PKG_CONFIG"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ fi
+ if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists gtk-doc; then
+ have_gtk_doc=yes
+ fi
+
+ dnl do we want to do a version check?
+ifelse([$1],[],,
+ [gtk_doc_min_version=$1
+ if test "$have_gtk_doc" = yes; then
+ AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])
+ if $PKG_CONFIG --atleast-version $gtk_doc_min_version gtk-doc; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ have_gtk_doc=no
+ fi
+ fi
+])
+ if test "$have_gtk_doc" != yes; then
+ enable_gtk_doc=no
+ fi
+ fi
+
+ AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
+ AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL")
+])
diff --git a/autogen.sh b/autogen.sh
index 46ca3422b..f834cfed1 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -22,6 +22,7 @@ libtoolize_min_vers=1.4
# The awk-based string->number conversion we use needs a C locale to work as expected.
LANG=C
+LC_NUMERIC=C
ARGV0=$0
@@ -133,4 +134,4 @@ do_cmd $AUTOMAKE $AUTOMAKE_FLAGS
do_cmd $AUTOCONF
-do_cmd ./configure --enable-maintainer-mode ${1+"$@"} && echo "Now type \`make' to compile" || exit 1
+do_cmd ./configure --enable-maintainer-mode --enable-gtk-doc ${1+"$@"} && echo "Now type \`make' to compile" || exit 1
diff --git a/cairo.pc.in b/cairo.pc.in
index 4e420b202..2cd0ff182 100644
--- a/cairo.pc.in
+++ b/cairo.pc.in
@@ -7,6 +7,6 @@ Name: cairo
Description: Multi-platform 2D graphics library
Version: @VERSION@
-Requires: fontconfig libpixman @XRENDER_REQUIRES@ @PNG_REQUIRES@ @GLITZ_REQUIRES@
+Requires: @FREETYPE_REQUIRES@ libpixman @XRENDER_REQUIRES@ @PNG_REQUIRES@ @GLITZ_REQUIRES@
Libs: @FREETYPE_LIBS@ -L${libdir} -lcairo
Cflags: @FREETYPE_CFLAGS@ -I${includedir}/cairo
diff --git a/configure.in b/configure.in
index 61d9adbae..5ee585e73 100644
--- a/configure.in
+++ b/configure.in
@@ -1,9 +1,11 @@
+AC_PREREQ(2.54)
+
AC_INIT(src/cairo.h)
dnl ===========================================================================
# Package version number, (as distinct from shared library version)
-CAIRO_VERSION=0.3.0
+CAIRO_VERSION=0.4.0
# libtool shared library version
@@ -35,6 +37,8 @@ AM_PROG_LIBTOOL
AC_STDC_HEADERS
AC_C_BIGENDIAN
+AC_CHECK_FUNCS(vasnprintf)
+
AC_CHECK_LIBM
LIBS="$LIBS $LIBM"
@@ -75,7 +79,7 @@ CAIRO_LIBS="$CAIRO_LIBS $XRENDER_LIBS"
AC_ARG_ENABLE(quartz,
[ --disable-quartz Disable cairo's quartz backend],
- [use_quartz=$enableval], [use_quartz=yes])
+ [use_quartz=$enableval], [use_quartz="no (temporarily disabled while code is out of sync)"])
if test "x$use_quartz" = "xyes"; then
dnl There is no pkgconfig for quartz; lets do a header check
@@ -120,6 +124,50 @@ AC_SUBST(XCB_SURFACE_FEATURE)
dnl ===========================================================================
+AC_MSG_CHECKING([for some Win32 platform])
+case "$host" in
+ *-*-mingw*|*-*-cygwin*)
+ cairo_platform_win32=yes
+ ;;
+ *)
+ cairo_platform_win32=no
+ ;;
+esac
+AC_MSG_RESULT([$cairo_platform_win32])
+
+AC_ARG_ENABLE(win32,
+ [ --disable-win32 Disable cairo's Microsoft Windows backend],
+ [use_win32=$enableval], [use_win32="yes"])
+
+if test "x$cairo_platform_win32" != "xyes" ; then
+ use_win32=no
+fi
+
+if test "x$use_win32" = "xyes"; then
+ CAIRO_LIBS="$CAIRO_LIBS -lgdi32 -lmsimg32"
+fi
+
+if test "x$use_win32" != "xyes"; then
+ WIN32_SURFACE_FEATURE=CAIRO_HAS_NO_WIN32_SURFACE
+ AM_CONDITIONAL(CAIRO_HAS_WIN32_SURFACE, false)
+else
+ WIN32_SURFACE_FEATURE=CAIRO_HAS_WIN32_SURFACE
+ AM_CONDITIONAL(CAIRO_HAS_WIN32_SURFACE, true)
+fi
+
+if test "x$use_win32" != "xyes"; then
+ WIN32_FONT_FEATURE=CAIRO_HAS_NO_WIN32_FONT
+ AM_CONDITIONAL(CAIRO_HAS_WIN32_FONT, false)
+else
+ WIN32_FONT_FEATURE=CAIRO_HAS_WIN32_FONT
+ AM_CONDITIONAL(CAIRO_HAS_WIN32_FONT, true)
+fi
+
+AC_SUBST(WIN32_SURFACE_FEATURE)
+AC_SUBST(WIN32_FONT_FEATURE)
+
+dnl ===========================================================================
+
AC_ARG_ENABLE(ps,
[ --disable-ps Disable cairo's PostScript backend],
[use_ps=$enableval], [use_ps=yes])
@@ -140,37 +188,27 @@ AC_SUBST(PS_LIBS)
dnl ===========================================================================
-AC_ARG_ENABLE(pdf,
- [ --disable-pdf Disable cairo's PDF backend],
- [use_pdf=$enableval], [use_pdf=yes])
-
-if test "x$use_pdf" != "xyes"; then
- PDF_SURFACE_FEATURE=CAIRO_HAS_NO_PDF_SURFACE
- AM_CONDITIONAL(CAIRO_HAS_PDF_SURFACE, false)
-else
- PDF_SURFACE_FEATURE=CAIRO_HAS_PDF_SURFACE
- PDF_LIBS=-lz
- AM_CONDITIONAL(CAIRO_HAS_PDF_SURFACE, true)
-fi
-
-CAIRO_LIBS="$CAIRO_LIBS $PDF_LIBS"
-
-AC_SUBST(PDF_SURFACE_FEATURE)
-AC_SUBST(PDF_LIBS)
-
-dnl ===========================================================================
-
AC_ARG_ENABLE(png,
[ --disable-png Disable cairo's PNG backend],
[use_png=$enableval], [use_png=yes])
if test "x$use_png" = "xyes"; then
- PKG_CHECK_MODULES(PNG, libpng12, [
- PNG_REQUIRES=libpng12
- use_png=yes], [
- PKG_CHECK_MODULES(PNG, libpng10, [
- PNG_REQUIRES=libpng10
- use_png=yes], [use_png="no (requires libpng http://www.libpng.org)"])])
+ use_png=no
+ # libpng13 is GnuWin32's libpng-1.2.8 :-(
+ for l in libpng12 libpng13 libpng10 ; do
+ if $PKG_CONFIG --exists $l ; then
+ PNG_REQUIRES=$l
+ use_png=yes
+ break
+ fi
+ done
+
+ if test "x$use_png" = "xyes" ; then
+ # Sets PNG_CFLAGS, PNG_LIBS
+ PKG_CHECK_MODULES(PNG, $PNG_REQUIRES)
+ else
+ AC_MSG_WARN([Could not find libpng in the pkg-config search path])
+ fi
fi
if test "x$use_png" != "xyes"; then
@@ -194,7 +232,7 @@ AC_ARG_ENABLE(glitz,
[use_glitz=$enableval], [use_glitz=yes])
if test "x$use_glitz" = "xyes"; then
- PKG_CHECK_MODULES(GLITZ, glitz >= 0.3.0, [
+ PKG_CHECK_MODULES(GLITZ, glitz >= 0.4.0, [
GLITZ_REQUIRES=glitz
use_glitz=yes], [use_glitz="no (requires glitz http://freedesktop.org/software/glitz)"])
fi
@@ -229,7 +267,7 @@ AC_SUBST(SANITY_CHECKING_FEATURE)
dnl ===========================================================================
-PKG_CHECK_MODULES(PIXMAN, libpixman >= 0.1.2)
+PKG_CHECK_MODULES(PIXMAN, libpixman >= 0.1.4)
CAIRO_CFLAGS="$CAIRO_CFLAGS $PIXMAN_CFLAGS"
CAIRO_LIBS="$CAIRO_LIBS $PIXMAN_LIBS"
@@ -285,9 +323,11 @@ if test "x$use_freetype" = "xyes"; then
AC_MSG_RESULT($FREETYPE_VERSION - OK)
FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
- FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
+ FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
+ FREETYPE_REQUIRES=fontconfig
AC_SUBST(FREETYPE_CFLAGS)
AC_SUBST(FREETYPE_LIBS)
+ AC_SUBST(FREETYPE_REQUIRES)
fi
CAIRO_CFLAGS="$CAIRO_CFLAGS $FREETYPE_CFLAGS"
@@ -304,6 +344,31 @@ AC_SUBST(FT_FONT_FEATURE)
dnl ===========================================================================
+AC_ARG_ENABLE(pdf,
+ [ --disable-pdf Disable cairo's PDF backend],
+ [use_pdf=$enableval], [use_pdf=yes])
+
+if test x"$use_freetype" != "xyes" ; then
+ AC_MSG_WARN([PDF backend requires FreeType, disabling])
+ use_pdf=no
+fi
+
+if test "x$use_pdf" != "xyes"; then
+ PDF_SURFACE_FEATURE=CAIRO_HAS_NO_PDF_SURFACE
+ AM_CONDITIONAL(CAIRO_HAS_PDF_SURFACE, false)
+else
+ PDF_SURFACE_FEATURE=CAIRO_HAS_PDF_SURFACE
+ PDF_LIBS=-lz
+ AM_CONDITIONAL(CAIRO_HAS_PDF_SURFACE, true)
+fi
+
+CAIRO_LIBS="$CAIRO_LIBS $PDF_LIBS"
+
+AC_SUBST(PDF_SURFACE_FEATURE)
+AC_SUBST(PDF_LIBS)
+
+dnl ===========================================================================
+
dnl This check should default to 'yes' once we have code to actually
dnl check for the atsui font backend.
@@ -346,6 +411,9 @@ AC_SUBST(CAIRO_CFLAGS)
AC_SUBST(CAIRO_LIBS)
dnl ===========================================================================
+dnl Check for gtk-doc and docbook
+
+GTK_DOC_CHECK([1.3])
AC_OUTPUT([
cairo.pc
@@ -353,6 +421,8 @@ Makefile
src/Makefile
src/cairo-features.h
test/Makefile
+doc/Makefile
+doc/public/Makefile
])
dnl ===========================================================================
@@ -362,13 +432,25 @@ echo "cairo will be compiled with the following surface backends:"
echo " Xlib: $use_xlib"
echo " Quartz: $use_quartz"
echo " XCB: $use_xcb"
+echo " Win32: $use_win32"
echo " PostScript: $use_ps"
echo " PDF: $use_pdf"
echo " PNG: $use_png"
echo " glitz: $use_glitz"
echo ""
echo "and the following font backends:"
-echo " freetype: $use_freetype"
-echo " atsui: $use_atsui"
+echo " FreeType: $use_freetype"
+echo " Win32: $use_win32"
+echo " ATSUI: $use_atsui"
echo ""
+if test x"$use_freetype" != "xyes" && \
+ test x"$use_win32" != "xyes" && \
+ test x"$use_atsui" != "xyes" ; then
+
+ AC_MSG_ERROR([Cairo requires at least one font backend.
+ Please install freetype and fontconfig, then try again:
+ http://freetype.org/ http://fontconfig.org/
+ ])
+fi
+
diff --git a/doc/.cvsignore b/doc/.cvsignore
new file mode 100644
index 000000000..282522db0
--- /dev/null
+++ b/doc/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 000000000..411ad5c93
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS=public
+
diff --git a/doc/public/.cvsignore b/doc/public/.cvsignore
new file mode 100644
index 000000000..35479d5e3
--- /dev/null
+++ b/doc/public/.cvsignore
@@ -0,0 +1,15 @@
+*.stamp
+Makefile
+Makefile.in
+cairo-decl-list.txt
+cairo-decl.txt
+cairo-undocumented.txt
+cairo-unused.txt
+cairo.hierarchy
+cairo.interfaces
+cairo.prerequisites
+cairo.args
+cairo.signals
+html
+xml
+
diff --git a/doc/public/Makefile.am b/doc/public/Makefile.am
new file mode 100644
index 000000000..b993bb978
--- /dev/null
+++ b/doc/public/Makefile.am
@@ -0,0 +1,46 @@
+## Process this file with automake to create Makefile.in.
+
+AUTOMAKE_OPTIONS = 1.7
+
+# The name of the module.
+DOC_MODULE=cairo
+
+# The top-level SGML file.
+DOC_MAIN_SGML_FILE=cairo-docs.xml
+
+# Extra options to supply to gtkdoc-scan
+SCAN_OPTIONS=--deprecated-guards="CAIRO_DISABLE_DEPRECATED"
+
+# The directory containing the source code. Relative to $(srcdir)
+DOC_SOURCE_DIR=../../src
+
+# Used for dependencies
+HFILE_GLOB=$(top_srcdir)/src/*.h
+CFILE_GLOB=$(top_srcdir)/src/*.c $(top_srcdir)/src/*.h
+
+# Headers to ignore
+IGNORE_HFILES= \
+ cairo-features.h \
+ cairo-ft-private.h \
+ cairo-win32-private.h \
+ cairoint.h \
+ cairo-wideint.h
+
+# CFLAGS and LDFLAGS for compiling scan program. Only needed
+# if $(DOC_MODULE).types is non-empty.
+INCLUDES =
+GTKDOC_LIBS =
+
+# Extra options to supply to gtkdoc-mkdb
+MKDB_OPTIONS=--sgml-mode --output-format=xml
+
+# Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE)
+content_files =
+
+# Images to copy into HTML directory
+HTML_IMAGES =
+
+# Extra options to supply to gtkdoc-fixref
+FIXXREF_OPTIONS=
+
+include $(top_srcdir)/gtk-doc.make
diff --git a/doc/public/cairo-docs.xml b/doc/public/cairo-docs.xml
new file mode 100644
index 000000000..2a4cdae8a
--- /dev/null
+++ b/doc/public/cairo-docs.xml
@@ -0,0 +1,31 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+<book lang="en" id="libglade" xmlns:xi="http://www.w3.org/2003/XInclude">
+<title>Cairo: A Vector Graphics Library</title>
+ <part>
+ <title>Tutorial</title>
+ </part>
+ <part>
+ <title>Reference</title>
+ <xi:include href="xml/cairo.xml"/>
+ <xi:include href="xml/cairo-surface.xml"/>
+ <xi:include href="xml/cairo-pattern.xml"/>
+ <xi:include href="xml/cairo-matrix.xml"/>
+ <xi:include href="xml/cairo-atsui.xml"/>
+ <xi:include href="xml/cairo-ft.xml"/>
+ <xi:include href="xml/cairo-glitz.xml"/>
+ <xi:include href="xml/cairo-pdf.xml"/>
+ <xi:include href="xml/cairo-png.xml"/>
+ <xi:include href="xml/cairo-ps.xml"/>
+ <xi:include href="xml/cairo-quartz.xml"/>
+ <xi:include href="xml/cairo-win32.xml"/>
+ <xi:include href="xml/cairo-xcb.xml"/>
+ <xi:include href="xml/cairo-xlib.xml"/>
+ </part>
+</book>
+
+
+
+
+
diff --git a/doc/public/cairo-overrides.txt b/doc/public/cairo-overrides.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/doc/public/cairo-overrides.txt
diff --git a/doc/public/cairo-sections.txt b/doc/public/cairo-sections.txt
new file mode 100644
index 000000000..3da0fa801
--- /dev/null
+++ b/doc/public/cairo-sections.txt
@@ -0,0 +1,251 @@
+<SECTION>
+<FILE>cairo-atsui</FILE>
+<TITLE>ATSUI Fonts</TITLE>
+cairo_atsui_font_create
+</SECTION>
+
+<SECTION>
+<FILE>cairo-ft</FILE>
+<TITLE>FreeType Fonts</TITLE>
+cairo_ft_font_create
+cairo_ft_font_create_for_ft_face
+cairo_ft_font_lock_face
+cairo_ft_font_unlock_face
+cairo_ft_font_get_pattern
+</SECTION>
+
+<SECTION>
+<FILE>cairo-glitz</FILE>
+<TITLE>Glitz backend</TITLE>
+cairo_set_target_glitz
+cairo_glitz_surface_create
+</SECTION>
+
+<SECTION>
+<FILE>cairo-pdf</FILE>
+<TITLE>PDF Backend</TITLE>
+cairo_set_target_pdf
+cairo_pdf_surface_create
+</SECTION>
+
+<SECTION>
+<FILE>cairo-png</FILE>
+<TITLE>PNG Backend</TITLE>
+cairo_set_target_png
+cairo_png_surface_create
+</SECTION>
+
+<SECTION>
+<FILE>cairo-ps</FILE>
+<TITLE>PS Backend</TITLE>
+cairo_set_target_ps
+cairo_ps_surface_create
+</SECTION>
+
+<SECTION>
+<FILE>cairo-quartz</FILE>
+<TITLE>Quartz Backend</TITLE>
+cairo_set_target_quartz_context
+cairo_quartz_surface_create
+</SECTION>
+
+<SECTION>
+<FILE>cairo-win32</FILE>
+<TITLE>Microsoft Windows Backend</TITLE>
+cairo_set_target_win32
+cairo_win32_surface_create
+cairo_win32_font_create_for_logfontw
+cairo_win32_font_select_font
+cairo_win32_font_done_font
+cairo_win32_font_get_scale_factor
+</SECTION>
+
+<SECTION>
+<FILE>cairo-xcb</FILE>
+<TITLE>XCB Backend</TITLE>
+cairo_set_target_xcb
+</SECTION>
+
+<SECTION>
+<FILE>cairo-xlib</FILE>
+<TITLE>XLib Backend</TITLE>
+cairo_set_target_drawable
+cairo_xlib_surface_create
+</SECTION>
+
+<SECTION>
+<FILE>cairo-surface</FILE>
+<TITLE>cairo_surface_t</TITLE>
+cairo_surface_t
+cairo_surface_create_for_image
+cairo_surface_create_similar
+cairo_surface_reference
+cairo_surface_destroy
+cairo_surface_set_repeat
+cairo_surface_set_matrix
+cairo_surface_get_matrix
+cairo_surface_set_filter
+cairo_surface_get_filter
+</SECTION>
+
+<SECTION>
+<FILE>cairo-pattern</FILE>
+<TITLE>cairo_pattern_t</TITLE>
+cairo_pattern_t
+cairo_pattern_create_for_surface
+cairo_pattern_create_linear
+cairo_pattern_create_radial
+cairo_pattern_reference
+cairo_pattern_destroy
+cairo_pattern_add_color_stop
+cairo_pattern_set_matrix
+cairo_pattern_get_matrix
+cairo_extend_t
+cairo_pattern_set_extend
+cairo_pattern_get_extend
+cairo_pattern_set_filter
+cairo_pattern_get_filter
+</SECTION>
+
+<SECTION>
+<FILE>cairo-matrix</FILE>
+<TITLE>cairo_matrix_t</TITLE>
+cairo_matrix_t
+cairo_matrix_create
+cairo_matrix_destroy
+cairo_matrix_copy
+cairo_matrix_set_identity
+cairo_matrix_set_affine
+cairo_matrix_get_affine
+cairo_matrix_translate
+cairo_matrix_scale
+cairo_matrix_rotate
+cairo_matrix_invert
+cairo_matrix_multiply
+cairo_matrix_transform_distance
+cairo_matrix_transform_point
+</SECTION>
+
+<SECTION>
+<FILE>cairo</FILE>
+<TITLE>cairo_t</TITLE>
+cairo_t
+cairo_create
+cairo_reference
+cairo_destroy
+cairo_save
+cairo_restore
+cairo_copy
+cairo_set_target_surface
+cairo_format_t
+cairo_set_target_image
+cairo_operator_t
+cairo_set_operator
+cairo_set_rgb_color
+cairo_set_pattern
+cairo_set_alpha
+cairo_set_tolerance
+cairo_fill_rule_t
+cairo_set_fill_rule
+cairo_set_line_width
+cairo_line_cap_t
+cairo_set_line_cap
+cairo_line_join_t
+cairo_set_line_join
+cairo_set_dash
+cairo_set_miter_limit
+cairo_translate
+cairo_scale
+cairo_rotate
+cairo_concat_matrix
+cairo_set_matrix
+cairo_default_matrix
+cairo_identity_matrix
+cairo_transform_point
+cairo_transform_distance
+cairo_inverse_transform_point
+cairo_inverse_transform_distance
+cairo_new_path
+cairo_move_to
+cairo_line_to
+cairo_curve_to
+cairo_arc
+cairo_arc_negative
+cairo_rel_move_to
+cairo_rel_line_to
+cairo_rel_curve_to
+cairo_rectangle
+cairo_close_path
+cairo_stroke
+cairo_fill
+cairo_copy_page
+cairo_show_page
+cairo_in_stroke
+cairo_in_fill
+cairo_bool_t
+cairo_stroke_extents
+cairo_fill_extents
+cairo_init_clip
+cairo_clip
+cairo_font_t
+cairo_glyph_t
+cairo_text_extents_t
+cairo_font_extents_t
+cairo_font_slant_t
+cairo_font_weight_t
+cairo_select_font
+cairo_scale_font
+cairo_transform_font
+cairo_show_text
+cairo_show_glyphs
+cairo_current_font
+cairo_current_font_extents
+cairo_set_font
+cairo_text_extents
+cairo_glyph_extents
+cairo_text_path
+cairo_glyph_path
+cairo_font_reference
+cairo_font_destroy
+cairo_font_extents
+cairo_font_glyph_extents
+cairo_show_surface
+cairo_current_operator
+cairo_current_rgb_color
+cairo_current_pattern
+cairo_current_alpha
+cairo_current_tolerance
+cairo_current_point
+cairo_current_fill_rule
+cairo_current_line_width
+cairo_current_line_cap
+cairo_current_line_join
+cairo_current_miter_limit
+cairo_current_matrix
+cairo_current_target_surface
+cairo_current_path
+cairo_current_path_flat
+cairo_status_t
+cairo_status
+cairo_status_string
+cairo_filter_t
+cairo_image_surface_create
+cairo_image_surface_create_for_data
+<SUBSECTION Private>
+CAIRO_BEGIN_DECLS
+CAIRO_END_DECLS
+cairo_get_operator
+cairo_get_rgb_color
+cairo_get_alpha
+cairo_get_tolerance
+cairo_get_current_point
+cairo_get_fill_rule
+cairo_get_line_width
+cairo_get_line_cap
+cairo_get_line_join
+cairo_get_miter_limit
+cairo_get_matrix
+cairo_get_target_surface
+cairo_get_status
+cairo_get_status_string
+</SECTION>
diff --git a/doc/public/cairo.types b/doc/public/cairo.types
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/doc/public/cairo.types
diff --git a/doc/public/tmpl/.cvsignore b/doc/public/tmpl/.cvsignore
new file mode 100644
index 000000000..844dc52df
--- /dev/null
+++ b/doc/public/tmpl/.cvsignore
@@ -0,0 +1 @@
+cairo-unused.sgml
diff --git a/doc/public/tmpl/cairo-atsui.sgml b/doc/public/tmpl/cairo-atsui.sgml
new file mode 100644
index 000000000..0d957ecdf
--- /dev/null
+++ b/doc/public/tmpl/cairo-atsui.sgml
@@ -0,0 +1,25 @@
+<!-- ##### SECTION Title ##### -->
+ATSUI Fonts
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### FUNCTION cairo_atsui_font_create ##### -->
+<para>
+
+</para>
+
+@style:
+@Returns:
+
+
diff --git a/doc/public/tmpl/cairo-ft.sgml b/doc/public/tmpl/cairo-ft.sgml
new file mode 100644
index 000000000..bcf52ac34
--- /dev/null
+++ b/doc/public/tmpl/cairo-ft.sgml
@@ -0,0 +1,63 @@
+<!-- ##### SECTION Title ##### -->
+FreeType Fonts
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### FUNCTION cairo_ft_font_create ##### -->
+<para>
+
+</para>
+
+@pattern:
+@scale:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_ft_font_create_for_ft_face ##### -->
+<para>
+
+</para>
+
+@face:
+@load_flags:
+@scale:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_ft_font_lock_face ##### -->
+<para>
+
+</para>
+
+@ft_font:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_ft_font_unlock_face ##### -->
+<para>
+
+</para>
+
+@ft_font:
+
+
+<!-- ##### FUNCTION cairo_ft_font_get_pattern ##### -->
+<para>
+
+</para>
+
+@ft_font:
+@Returns:
+
+
diff --git a/doc/public/tmpl/cairo-glitz.sgml b/doc/public/tmpl/cairo-glitz.sgml
new file mode 100644
index 000000000..101eb9e3e
--- /dev/null
+++ b/doc/public/tmpl/cairo-glitz.sgml
@@ -0,0 +1,34 @@
+<!-- ##### SECTION Title ##### -->
+Glitz backend
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### FUNCTION cairo_set_target_glitz ##### -->
+<para>
+
+</para>
+
+@cr:
+@surface:
+
+
+<!-- ##### FUNCTION cairo_glitz_surface_create ##### -->
+<para>
+
+</para>
+
+@surface:
+@Returns:
+
+
diff --git a/doc/public/tmpl/cairo-matrix.sgml b/doc/public/tmpl/cairo-matrix.sgml
new file mode 100644
index 000000000..dc24c5754
--- /dev/null
+++ b/doc/public/tmpl/cairo-matrix.sgml
@@ -0,0 +1,193 @@
+<!-- ##### SECTION Title ##### -->
+cairo_matrix_t
+
+<!-- ##### SECTION Short_Description ##### -->
+
+ Transformation matrices
+
+<!-- ##### SECTION Long_Description ##### -->
+
+ <para><indexterm><primary>types</primary><secondary>cairo_matrix</secondary></indexterm><indexterm><primary/></indexterm>
+ <structname>cairo_matrix_t</structname> is used throughout
+ Cairo to represents between different coordinates spaces.
+ A <structname>cairo_matrix</structname> holds an affine
+ transformation, such as a scale, rotation, or shear, or a
+ combination of those. Mathematically, the effect of an affine
+ transformation on a point (<literal>x</literal>,<literal>y</literal>) is given by:
+ </para>
+ <programlisting>
+ x_new = x * a + y * c + tx;
+ y_new = x * b + y * d + ty;
+ </programlisting>
+ <para>
+ The parameters <literal>a</literal>, <literal>b</literal>,
+ <literal>c</literal>, <literal>d</literal>, <literal>tx</literal>,
+ <literal>ty</literal> can be retrieved with
+ cairo_matrix_get_affine() and set with cairo_matrix_get_affine().
+ </para>
+ <para>
+ The primary use of transformation matrices in Cairo is as the
+ current transformation matrix in a #cairo_t. The current
+ transformation matrix gives the transformation from user space
+ coordinates to device coordinates. See cairo_set_matrix(),
+ cairo_current_matrix().
+ </para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### TYPEDEF cairo_matrix_t ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION cairo_matrix_create ##### -->
+<para>
+
+</para>
+
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_matrix_destroy ##### -->
+<para>
+
+</para>
+
+@matrix:
+
+
+<!-- ##### FUNCTION cairo_matrix_copy ##### -->
+<para>
+
+</para>
+
+@matrix:
+@other:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_matrix_set_identity ##### -->
+<para>
+
+</para>
+
+@matrix:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_matrix_set_affine ##### -->
+<para>
+
+</para>
+
+@matrix:
+@a:
+@b:
+@c:
+@d:
+@tx:
+@ty:
+@Returns:
+<!-- # Unused Parameters # -->
+@cr:
+
+
+<!-- ##### FUNCTION cairo_matrix_get_affine ##### -->
+<para>
+
+</para>
+
+@matrix:
+@a:
+@b:
+@c:
+@d:
+@tx:
+@ty:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_matrix_translate ##### -->
+<para>
+
+</para>
+
+@matrix:
+@tx:
+@ty:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_matrix_scale ##### -->
+<para>
+
+</para>
+
+@matrix:
+@sx:
+@sy:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_matrix_rotate ##### -->
+<para>
+
+</para>
+
+@matrix:
+@radians:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_matrix_invert ##### -->
+<para>
+
+</para>
+
+@matrix:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_matrix_multiply ##### -->
+<para>
+
+</para>
+
+@result:
+@a:
+@b:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_matrix_transform_distance ##### -->
+<para>
+
+</para>
+
+@matrix:
+@dx:
+@dy:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_matrix_transform_point ##### -->
+<para>
+</para>
+
+@matrix:
+@x:
+@y:
+@Returns:
+
+<!--
+Local variables:
+mode: sgml
+sgml-parent-document: ("../cairo-docs.xml" "book" "refsect2" "")
+End:
+-->
+
+
diff --git a/doc/public/tmpl/cairo-pattern.sgml b/doc/public/tmpl/cairo-pattern.sgml
new file mode 100644
index 000000000..84728212b
--- /dev/null
+++ b/doc/public/tmpl/cairo-pattern.sgml
@@ -0,0 +1,154 @@
+<!-- ##### SECTION Title ##### -->
+cairo_pattern_t
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### TYPEDEF cairo_pattern_t ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION cairo_pattern_create_for_surface ##### -->
+<para>
+
+</para>
+
+@surface:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_pattern_create_linear ##### -->
+<para>
+
+</para>
+
+@x0:
+@y0:
+@x1:
+@y1:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_pattern_create_radial ##### -->
+<para>
+
+</para>
+
+@cx0:
+@cy0:
+@radius0:
+@cx1:
+@cy1:
+@radius1:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_pattern_reference ##### -->
+<para>
+
+</para>
+
+@pattern:
+
+
+<!-- ##### FUNCTION cairo_pattern_destroy ##### -->
+<para>
+
+</para>
+
+@pattern:
+
+
+<!-- ##### FUNCTION cairo_pattern_add_color_stop ##### -->
+<para>
+
+</para>
+
+@pattern:
+@offset:
+@red:
+@green:
+@blue:
+@alpha:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_pattern_set_matrix ##### -->
+<para>
+
+</para>
+
+@pattern:
+@matrix:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_pattern_get_matrix ##### -->
+<para>
+
+</para>
+
+@pattern:
+@matrix:
+@Returns:
+
+
+<!-- ##### ENUM cairo_extend_t ##### -->
+<para>
+
+</para>
+
+@CAIRO_EXTEND_NONE:
+@CAIRO_EXTEND_REPEAT:
+@CAIRO_EXTEND_REFLECT:
+
+<!-- ##### FUNCTION cairo_pattern_set_extend ##### -->
+<para>
+
+</para>
+
+@pattern:
+@extend:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_pattern_get_extend ##### -->
+<para>
+
+</para>
+
+@pattern:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_pattern_set_filter ##### -->
+<para>
+
+</para>
+
+@pattern:
+@filter:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_pattern_get_filter ##### -->
+<para>
+
+</para>
+
+@pattern:
+@Returns:
+
+
diff --git a/doc/public/tmpl/cairo-pdf.sgml b/doc/public/tmpl/cairo-pdf.sgml
new file mode 100644
index 000000000..e627c236e
--- /dev/null
+++ b/doc/public/tmpl/cairo-pdf.sgml
@@ -0,0 +1,42 @@
+<!-- ##### SECTION Title ##### -->
+PDF Backend
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### FUNCTION cairo_set_target_pdf ##### -->
+<para>
+
+</para>
+
+@cr:
+@file:
+@width_inches:
+@height_inches:
+@x_pixels_per_inch:
+@y_pixels_per_inch:
+
+
+<!-- ##### FUNCTION cairo_pdf_surface_create ##### -->
+<para>
+
+</para>
+
+@file:
+@width_inches:
+@height_inches:
+@x_pixels_per_inch:
+@y_pixels_per_inch:
+@Returns:
+
+
diff --git a/doc/public/tmpl/cairo-png.sgml b/doc/public/tmpl/cairo-png.sgml
new file mode 100644
index 000000000..d4d5a66b5
--- /dev/null
+++ b/doc/public/tmpl/cairo-png.sgml
@@ -0,0 +1,40 @@
+<!-- ##### SECTION Title ##### -->
+PNG Backend
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### FUNCTION cairo_set_target_png ##### -->
+<para>
+
+</para>
+
+@cr:
+@file:
+@format:
+@width:
+@height:
+
+
+<!-- ##### FUNCTION cairo_png_surface_create ##### -->
+<para>
+
+</para>
+
+@file:
+@format:
+@width:
+@height:
+@Returns:
+
+
diff --git a/doc/public/tmpl/cairo-ps.sgml b/doc/public/tmpl/cairo-ps.sgml
new file mode 100644
index 000000000..70b2e7e8f
--- /dev/null
+++ b/doc/public/tmpl/cairo-ps.sgml
@@ -0,0 +1,42 @@
+<!-- ##### SECTION Title ##### -->
+PS Backend
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### FUNCTION cairo_set_target_ps ##### -->
+<para>
+
+</para>
+
+@cr:
+@file:
+@width_inches:
+@height_inches:
+@x_pixels_per_inch:
+@y_pixels_per_inch:
+
+
+<!-- ##### FUNCTION cairo_ps_surface_create ##### -->
+<para>
+
+</para>
+
+@file:
+@width_inches:
+@height_inches:
+@x_pixels_per_inch:
+@y_pixels_per_inch:
+@Returns:
+
+
diff --git a/doc/public/tmpl/cairo-quartz.sgml b/doc/public/tmpl/cairo-quartz.sgml
new file mode 100644
index 000000000..04c9bc61f
--- /dev/null
+++ b/doc/public/tmpl/cairo-quartz.sgml
@@ -0,0 +1,38 @@
+<!-- ##### SECTION Title ##### -->
+Quartz Backend
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### FUNCTION cairo_set_target_quartz_context ##### -->
+<para>
+
+</para>
+
+@cr:
+@context:
+@width:
+@height:
+
+
+<!-- ##### FUNCTION cairo_quartz_surface_create ##### -->
+<para>
+
+</para>
+
+@context:
+@width:
+@height:
+@Returns:
+
+
diff --git a/doc/public/tmpl/cairo-surface.sgml b/doc/public/tmpl/cairo-surface.sgml
new file mode 100644
index 000000000..2f8ad470c
--- /dev/null
+++ b/doc/public/tmpl/cairo-surface.sgml
@@ -0,0 +1,112 @@
+<!-- ##### SECTION Title ##### -->
+cairo_surface_t
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### TYPEDEF cairo_surface_t ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION cairo_surface_create_for_image ##### -->
+<para>
+
+</para>
+
+@data:
+@format:
+@width:
+@height:
+@stride:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_surface_create_similar ##### -->
+<para>
+
+</para>
+
+@other:
+@format:
+@width:
+@height:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_surface_reference ##### -->
+<para>
+
+</para>
+
+@surface:
+
+
+<!-- ##### FUNCTION cairo_surface_destroy ##### -->
+<para>
+
+</para>
+
+@surface:
+
+
+<!-- ##### FUNCTION cairo_surface_set_repeat ##### -->
+<para>
+
+</para>
+
+@surface:
+@repeat:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_surface_set_matrix ##### -->
+<para>
+
+</para>
+
+@surface:
+@matrix:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_surface_get_matrix ##### -->
+<para>
+
+</para>
+
+@surface:
+@matrix:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_surface_set_filter ##### -->
+<para>
+
+</para>
+
+@surface:
+@filter:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_surface_get_filter ##### -->
+<para>
+
+</para>
+
+@surface:
+@Returns:
+
+
diff --git a/doc/public/tmpl/cairo-xcb.sgml b/doc/public/tmpl/cairo-xcb.sgml
new file mode 100644
index 000000000..e5e1ee912
--- /dev/null
+++ b/doc/public/tmpl/cairo-xcb.sgml
@@ -0,0 +1,28 @@
+<!-- ##### SECTION Title ##### -->
+XCB Backend
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### FUNCTION cairo_set_target_xcb ##### -->
+<para>
+
+</para>
+
+@cr:
+@dpy:
+@drawable:
+@visual:
+@format:
+
+
diff --git a/doc/public/tmpl/cairo-xlib.sgml b/doc/public/tmpl/cairo-xlib.sgml
new file mode 100644
index 000000000..b18e76aae
--- /dev/null
+++ b/doc/public/tmpl/cairo-xlib.sgml
@@ -0,0 +1,39 @@
+<!-- ##### SECTION Title ##### -->
+XLib Backend
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### FUNCTION cairo_set_target_drawable ##### -->
+<para>
+
+</para>
+
+@cr:
+@dpy:
+@drawable:
+
+
+<!-- ##### FUNCTION cairo_xlib_surface_create ##### -->
+<para>
+
+</para>
+
+@dpy:
+@drawable:
+@visual:
+@format:
+@colormap:
+@Returns:
+
+
diff --git a/doc/public/tmpl/cairo.sgml b/doc/public/tmpl/cairo.sgml
new file mode 100644
index 000000000..a9e195c73
--- /dev/null
+++ b/doc/public/tmpl/cairo.sgml
@@ -0,0 +1,1019 @@
+<!-- ##### SECTION Title ##### -->
+cairo_t
+
+<!-- ##### SECTION Short_Description ##### -->
+Drawing contexts.
+
+<!-- ##### SECTION Long_Description ##### -->
+
+ <para>
+ #cairo_t is the main object used when drawing with Cairo. To
+ draw with Cairo, you create a #cairo_t, set the target surface,
+ and drawing options for the #cairo_t, create shapes with
+ functions like cairo_move_to() and cairo_line_to(), and then
+ draw ships with cairo_stroke() or cairo_fill().
+ </para>
+ <para>
+ #cairo_t<!-- -->'s can be pushed to a stack via cairo_save().
+ They may then safely be changed, without loosing the current state.
+ Use cairo_restore() to restore to the saved state.
+ </para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### TYPEDEF cairo_t ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION cairo_create ##### -->
+<para>
+
+</para>
+
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_reference ##### -->
+<para>
+
+</para>
+
+@cr:
+
+
+<!-- ##### FUNCTION cairo_destroy ##### -->
+<para>
+
+</para>
+
+@cr:
+
+
+<!-- ##### FUNCTION cairo_save ##### -->
+<para>
+
+</para>
+
+@cr:
+
+
+<!-- ##### FUNCTION cairo_restore ##### -->
+<para>
+
+</para>
+
+@cr:
+
+
+<!-- ##### FUNCTION cairo_copy ##### -->
+<para>
+
+</para>
+
+@dest:
+@src:
+
+
+<!-- ##### FUNCTION cairo_set_target_surface ##### -->
+<para>
+
+</para>
+
+@cr:
+@surface:
+
+
+<!-- ##### ENUM cairo_format_t ##### -->
+<para>
+
+</para>
+
+@CAIRO_FORMAT_ARGB32:
+@CAIRO_FORMAT_RGB24:
+@CAIRO_FORMAT_A8:
+@CAIRO_FORMAT_A1:
+
+<!-- ##### FUNCTION cairo_set_target_image ##### -->
+<para>
+
+</para>
+
+@cr:
+@data:
+@format:
+@width:
+@height:
+@stride:
+
+
+<!-- ##### ENUM cairo_operator_t ##### -->
+<para>
+
+</para>
+
+@CAIRO_OPERATOR_CLEAR:
+@CAIRO_OPERATOR_SRC:
+@CAIRO_OPERATOR_DST:
+@CAIRO_OPERATOR_OVER:
+@CAIRO_OPERATOR_OVER_REVERSE:
+@CAIRO_OPERATOR_IN:
+@CAIRO_OPERATOR_IN_REVERSE:
+@CAIRO_OPERATOR_OUT:
+@CAIRO_OPERATOR_OUT_REVERSE:
+@CAIRO_OPERATOR_ATOP:
+@CAIRO_OPERATOR_ATOP_REVERSE:
+@CAIRO_OPERATOR_XOR:
+@CAIRO_OPERATOR_ADD:
+@CAIRO_OPERATOR_SATURATE:
+
+<!-- ##### FUNCTION cairo_set_operator ##### -->
+<para>
+
+</para>
+
+@cr:
+@op:
+
+
+<!-- ##### FUNCTION cairo_set_rgb_color ##### -->
+<para>
+
+</para>
+
+@cr:
+@red:
+@green:
+@blue:
+
+
+<!-- ##### FUNCTION cairo_set_pattern ##### -->
+<para>
+
+</para>
+
+@cr:
+@pattern:
+
+
+<!-- ##### FUNCTION cairo_set_alpha ##### -->
+<para>
+
+</para>
+
+@cr:
+@alpha:
+
+
+<!-- ##### FUNCTION cairo_set_tolerance ##### -->
+<para>
+
+</para>
+
+@cr:
+@tolerance:
+
+
+<!-- ##### ENUM cairo_fill_rule_t ##### -->
+<para>
+
+</para>
+
+@CAIRO_FILL_RULE_WINDING:
+@CAIRO_FILL_RULE_EVEN_ODD:
+
+<!-- ##### FUNCTION cairo_set_fill_rule ##### -->
+<para>
+
+</para>
+
+@cr:
+@fill_rule:
+
+
+<!-- ##### FUNCTION cairo_set_line_width ##### -->
+<para>
+
+</para>
+
+@cr:
+@width:
+
+
+<!-- ##### ENUM cairo_line_cap_t ##### -->
+<para>
+
+</para>
+
+@CAIRO_LINE_CAP_BUTT:
+@CAIRO_LINE_CAP_ROUND:
+@CAIRO_LINE_CAP_SQUARE:
+
+<!-- ##### FUNCTION cairo_set_line_cap ##### -->
+<para>
+
+</para>
+
+@cr:
+@line_cap:
+
+
+<!-- ##### ENUM cairo_line_join_t ##### -->
+<para>
+
+</para>
+
+@CAIRO_LINE_JOIN_MITER:
+@CAIRO_LINE_JOIN_ROUND:
+@CAIRO_LINE_JOIN_BEVEL:
+
+<!-- ##### FUNCTION cairo_set_line_join ##### -->
+<para>
+
+</para>
+
+@cr:
+@line_join:
+
+
+<!-- ##### FUNCTION cairo_set_dash ##### -->
+<para>
+
+</para>
+
+@cr:
+@dashes:
+@ndash:
+@offset:
+
+
+<!-- ##### FUNCTION cairo_set_miter_limit ##### -->
+<para>
+
+</para>
+
+@cr:
+@limit:
+
+
+<!-- ##### FUNCTION cairo_translate ##### -->
+<para>
+
+</para>
+
+@cr:
+@tx:
+@ty:
+
+
+<!-- ##### FUNCTION cairo_scale ##### -->
+<para>
+
+</para>
+
+@cr:
+@sx:
+@sy:
+
+
+<!-- ##### FUNCTION cairo_rotate ##### -->
+<para>
+
+</para>
+
+@cr:
+@angle:
+
+
+<!-- ##### FUNCTION cairo_concat_matrix ##### -->
+<para>
+
+</para>
+
+@cr:
+@matrix:
+
+
+<!-- ##### FUNCTION cairo_set_matrix ##### -->
+<para>
+
+</para>
+
+@cr:
+@matrix:
+
+
+<!-- ##### FUNCTION cairo_default_matrix ##### -->
+<para>
+
+</para>
+
+@cr:
+
+
+<!-- ##### FUNCTION cairo_identity_matrix ##### -->
+<para>
+
+</para>
+
+@cr:
+
+
+<!-- ##### FUNCTION cairo_transform_point ##### -->
+<para>
+
+</para>
+
+@cr:
+@x:
+@y:
+
+
+<!-- ##### FUNCTION cairo_transform_distance ##### -->
+<para>
+
+</para>
+
+@cr:
+@dx:
+@dy:
+
+
+<!-- ##### FUNCTION cairo_inverse_transform_point ##### -->
+<para>
+
+</para>
+
+@cr:
+@x:
+@y:
+
+
+<!-- ##### FUNCTION cairo_inverse_transform_distance ##### -->
+<para>
+
+</para>
+
+@cr:
+@dx:
+@dy:
+
+
+<!-- ##### FUNCTION cairo_new_path ##### -->
+<para>
+
+</para>
+
+@cr:
+
+
+<!-- ##### FUNCTION cairo_move_to ##### -->
+<para>
+
+</para>
+
+@cr:
+@x:
+@y:
+
+
+<!-- ##### FUNCTION cairo_line_to ##### -->
+<para>
+
+</para>
+
+@cr:
+@x:
+@y:
+
+
+<!-- ##### FUNCTION cairo_curve_to ##### -->
+<para>
+
+</para>
+
+@cr:
+@x1:
+@y1:
+@x2:
+@y2:
+@x3:
+@y3:
+
+
+<!-- ##### FUNCTION cairo_arc ##### -->
+<para>
+
+</para>
+
+@cr:
+@xc:
+@yc:
+@radius:
+@angle1:
+@angle2:
+
+
+<!-- ##### FUNCTION cairo_arc_negative ##### -->
+<para>
+
+</para>
+
+@cr:
+@xc:
+@yc:
+@radius:
+@angle1:
+@angle2:
+
+
+<!-- ##### FUNCTION cairo_rel_move_to ##### -->
+<para>
+
+</para>
+
+@cr:
+@dx:
+@dy:
+
+
+<!-- ##### FUNCTION cairo_rel_line_to ##### -->
+<para>
+
+</para>
+
+@cr:
+@dx:
+@dy:
+
+
+<!-- ##### FUNCTION cairo_rel_curve_to ##### -->
+<para>
+
+</para>
+
+@cr:
+@dx1:
+@dy1:
+@dx2:
+@dy2:
+@dx3:
+@dy3:
+
+
+<!-- ##### FUNCTION cairo_rectangle ##### -->
+<para>
+
+</para>
+
+@cr:
+@x:
+@y:
+@width:
+@height:
+
+
+<!-- ##### FUNCTION cairo_close_path ##### -->
+<para>
+
+</para>
+
+@cr:
+
+
+<!-- ##### FUNCTION cairo_stroke ##### -->
+<para>
+
+</para>
+
+@cr:
+
+
+<!-- ##### FUNCTION cairo_fill ##### -->
+<para>
+
+</para>
+
+@cr:
+
+
+<!-- ##### FUNCTION cairo_copy_page ##### -->
+<para>
+
+</para>
+
+@cr:
+
+
+<!-- ##### FUNCTION cairo_show_page ##### -->
+<para>
+
+</para>
+
+@cr:
+
+
+<!-- ##### FUNCTION cairo_in_stroke ##### -->
+<para>
+
+</para>
+
+@cr:
+@x:
+@y:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_in_fill ##### -->
+<para>
+
+</para>
+
+@cr:
+@x:
+@y:
+@Returns:
+
+
+<!-- ##### TYPEDEF cairo_bool_t ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION cairo_stroke_extents ##### -->
+<para>
+
+</para>
+
+@cr:
+@x1:
+@y1:
+@x2:
+@y2:
+
+
+<!-- ##### FUNCTION cairo_fill_extents ##### -->
+<para>
+
+</para>
+
+@cr:
+@x1:
+@y1:
+@x2:
+@y2:
+
+
+<!-- ##### FUNCTION cairo_init_clip ##### -->
+<para>
+
+</para>
+
+@cr:
+
+
+<!-- ##### FUNCTION cairo_clip ##### -->
+<para>
+
+</para>
+
+@cr:
+
+
+<!-- ##### TYPEDEF cairo_font_t ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### STRUCT cairo_glyph_t ##### -->
+<para>
+
+</para>
+
+@index:
+@x:
+@y:
+
+<!-- ##### STRUCT cairo_text_extents_t ##### -->
+<para>
+
+</para>
+
+@x_bearing:
+@y_bearing:
+@width:
+@height:
+@x_advance:
+@y_advance:
+
+<!-- ##### STRUCT cairo_font_extents_t ##### -->
+<para>
+
+</para>
+
+@ascent:
+@descent:
+@height:
+@max_x_advance:
+@max_y_advance:
+
+<!-- ##### ENUM cairo_font_slant_t ##### -->
+<para>
+
+</para>
+
+@CAIRO_FONT_SLANT_NORMAL:
+@CAIRO_FONT_SLANT_ITALIC:
+@CAIRO_FONT_SLANT_OBLIQUE:
+
+<!-- ##### ENUM cairo_font_weight_t ##### -->
+<para>
+
+</para>
+
+@CAIRO_FONT_WEIGHT_NORMAL:
+@CAIRO_FONT_WEIGHT_BOLD:
+
+<!-- ##### FUNCTION cairo_select_font ##### -->
+<para>
+
+</para>
+
+@cr:
+@family:
+@slant:
+@weight:
+
+
+<!-- ##### FUNCTION cairo_scale_font ##### -->
+<para>
+
+</para>
+
+@cr:
+@scale:
+
+
+<!-- ##### FUNCTION cairo_transform_font ##### -->
+<para>
+
+</para>
+
+@cr:
+@matrix:
+
+
+<!-- ##### FUNCTION cairo_show_text ##### -->
+<para>
+
+</para>
+
+@cr:
+@utf8:
+
+
+<!-- ##### FUNCTION cairo_show_glyphs ##### -->
+<para>
+
+</para>
+
+@cr:
+@glyphs:
+@num_glyphs:
+
+
+<!-- ##### FUNCTION cairo_current_font ##### -->
+<para>
+
+</para>
+
+@cr:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_current_font_extents ##### -->
+<para>
+
+</para>
+
+@cr:
+@extents:
+
+
+<!-- ##### FUNCTION cairo_set_font ##### -->
+<para>
+
+</para>
+
+@cr:
+@font:
+
+
+<!-- ##### FUNCTION cairo_text_extents ##### -->
+<para>
+
+</para>
+
+@cr:
+@utf8:
+@extents:
+
+
+<!-- ##### FUNCTION cairo_glyph_extents ##### -->
+<para>
+
+</para>
+
+@cr:
+@glyphs:
+@num_glyphs:
+@extents:
+
+
+<!-- ##### FUNCTION cairo_text_path ##### -->
+<para>
+
+</para>
+
+@cr:
+@utf8:
+
+
+<!-- ##### FUNCTION cairo_glyph_path ##### -->
+<para>
+
+</para>
+
+@cr:
+@glyphs:
+@num_glyphs:
+
+
+<!-- ##### FUNCTION cairo_font_reference ##### -->
+<para>
+
+</para>
+
+@font:
+
+
+<!-- ##### FUNCTION cairo_font_destroy ##### -->
+<para>
+
+</para>
+
+@font:
+
+
+<!-- ##### FUNCTION cairo_font_glyph_extents ##### -->
+<para>
+
+</para>
+
+@font:
+@font_matrix:
+@glyphs:
+@num_glyphs:
+@extents:
+
+
+<!-- ##### FUNCTION cairo_show_surface ##### -->
+<para>
+
+</para>
+
+@cr:
+@surface:
+@width:
+@height:
+
+
+<!-- ##### FUNCTION cairo_current_operator ##### -->
+<para>
+
+</para>
+
+@cr:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_current_rgb_color ##### -->
+<para>
+
+</para>
+
+@cr:
+@red:
+@green:
+@blue:
+
+
+<!-- ##### FUNCTION cairo_current_pattern ##### -->
+<para>
+
+</para>
+
+@cr:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_current_alpha ##### -->
+<para>
+
+</para>
+
+@cr:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_current_tolerance ##### -->
+<para>
+
+</para>
+
+@cr:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_current_point ##### -->
+<para>
+
+</para>
+
+@cr:
+@x:
+@y:
+
+
+<!-- ##### FUNCTION cairo_current_fill_rule ##### -->
+<para>
+
+</para>
+
+@cr:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_current_line_width ##### -->
+<para>
+
+</para>
+
+@cr:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_current_line_cap ##### -->
+<para>
+
+</para>
+
+@cr:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_current_line_join ##### -->
+<para>
+
+</para>
+
+@cr:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_current_miter_limit ##### -->
+<para>
+
+</para>
+
+@cr:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_current_matrix ##### -->
+<para>
+
+</para>
+
+@cr:
+@matrix:
+
+
+<!-- ##### FUNCTION cairo_current_target_surface ##### -->
+<para>
+
+</para>
+
+@cr:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_current_path ##### -->
+<para>
+
+</para>
+
+@cr:
+@move_to:
+@line_to:
+@curve_to:
+@close_path:
+@closure:
+
+
+<!-- ##### FUNCTION cairo_current_path_flat ##### -->
+<para>
+
+</para>
+
+@cr:
+@move_to:
+@line_to:
+@close_path:
+@closure:
+
+
+<!-- ##### ENUM cairo_status_t ##### -->
+<para>
+
+</para>
+
+@CAIRO_STATUS_SUCCESS:
+@CAIRO_STATUS_NO_MEMORY:
+@CAIRO_STATUS_INVALID_RESTORE:
+@CAIRO_STATUS_INVALID_POP_GROUP:
+@CAIRO_STATUS_NO_CURRENT_POINT:
+@CAIRO_STATUS_INVALID_MATRIX:
+@CAIRO_STATUS_NO_TARGET_SURFACE:
+@CAIRO_STATUS_NULL_POINTER:
+@CAIRO_STATUS_INVALID_STRING:
+
+<!-- ##### FUNCTION cairo_status ##### -->
+<para>
+
+</para>
+
+@cr:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_status_string ##### -->
+<para>
+
+</para>
+
+@cr:
+@Returns:
+
+
+<!-- ##### ENUM cairo_filter_t ##### -->
+<para>
+
+</para>
+
+@CAIRO_FILTER_FAST:
+@CAIRO_FILTER_GOOD:
+@CAIRO_FILTER_BEST:
+@CAIRO_FILTER_NEAREST:
+@CAIRO_FILTER_BILINEAR:
+@CAIRO_FILTER_GAUSSIAN:
+
+<!-- ##### FUNCTION cairo_image_surface_create ##### -->
+<para>
+
+</para>
+
+@format:
+@width:
+@height:
+@Returns:
+
+
+<!-- ##### FUNCTION cairo_image_surface_create_for_data ##### -->
+<para>
+
+</para>
+
+@data:
+@format:
+@width:
+@height:
+@stride:
+@Returns:
+
+
+
+<!--
+Local variables:
+mode: sgml
+sgml-parent-document: ("../cairo-docs.xml" "book" "refsect2" "")
+End:
+-->
+
+
diff --git a/doc/reference/.cvsignore b/doc/reference/.cvsignore
deleted file mode 100644
index a25ff09ee..000000000
--- a/doc/reference/.cvsignore
+++ /dev/null
@@ -1,20 +0,0 @@
-Makefile
-Makefile.in
-aclocal.m4
-autom4te.cache
-cairo.pc
-config.cache
-config.guess
-config.h
-config.h.in
-config.log
-config.status
-config.sub
-configure
-libtool
-ltmain.sh
-stamp-h
-stamp-h1
-stamp-h.in
-*~
-
diff --git a/doc/reference/ChangeLog b/doc/reference/ChangeLog
deleted file mode 100644
index 708499b71..000000000
--- a/doc/reference/ChangeLog
+++ /dev/null
@@ -1,16 +0,0 @@
-2003-10-16 Thomas Hunger <info@teh-web.de>
-
- * xml/some started to document stuff from top to bottom
-
-2003-10-16 Thomas Hunger <info@teh-web.de>
-
- * xml/* changed all files in the xml directory to
- look more like gtk. now <link> elements may be
- embedded almost everywhere
- * added ruby script crossreferences which puts
- <link> tags around all known refentries
-
-2003-10-15 Thomas Hunger <info@teh-web.de>
-
- * doc.xml: some documentation skeleton
- * files for each entry can be found in xml/
diff --git a/doc/reference/README b/doc/reference/README
deleted file mode 100644
index 656a76fb4..000000000
--- a/doc/reference/README
+++ /dev/null
@@ -1,11 +0,0 @@
-How to transform the docs to html:
-call
-$ xmlto html doc.xml
-from within the reference directory
-
-cross-referecing
-----------------
-there is a small ruby script which collects all id="" thingies from the xml files in xml and creates links around the symbols found in files.
-exceptions:
-- there is already a link around a symbol.
-- its part of a function: cairo_translate !=> <link>cairo_t</link>ranslate \ No newline at end of file
diff --git a/doc/reference/crossreference.rb b/doc/reference/crossreference.rb
deleted file mode 100644
index 9f7c30350..000000000
--- a/doc/reference/crossreference.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-d = Dir.glob("xml/*.xml")
-
-ids = []
-
-# collect symbols
-d.each do |file|
- f = File.new(file)
- buf = f.read
- ids << buf.scan(/.*id="(.*)".*/)
-end
-ids = ids.flatten
-
-#resolve symbols
-d.each do |file|
- f = File.new(file,"r+")
- buf = f.read
- p file
- ids.each do |id|
- if "xml/"+id+".xml" == file
- next
- end
- re = Regexp.compile('([^"\w\d])('+id+')([^"\w\d])')
- buf.gsub!(re, '\1<link linkend="\2">\2</link>\3')
- buf.gsub!(/(<\/link>)+/, '\1')
- buf.gsub!(/(<link[^>]*>)+/, '\1')
- end
- f.rewind
- f.write buf
- f.rewind
-end
diff --git a/doc/reference/doc.xml b/doc/reference/doc.xml
deleted file mode 100644
index 1530ec957..000000000
--- a/doc/reference/doc.xml
+++ /dev/null
@@ -1,204 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
- "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
-<!ENTITY cairo_create SYSTEM "xml/cairo_create.xml">
-<!ENTITY cairo_reference SYSTEM "xml/cairo_reference.xml">
-<!ENTITY cairo_destroy SYSTEM "xml/cairo_destroy.xml">
-<!ENTITY cairo_save SYSTEM "xml/cairo_save.xml">
-<!ENTITY cairo_restore SYSTEM "xml/cairo_restore.xml">
-<!ENTITY cairo_copy SYSTEM "xml/cairo_copy.xml">
-<!ENTITY cairo_push_group SYSTEM "xml/cairo_push_group.xml">
-<!ENTITY cairo_pop_group SYSTEM "xml/cairo_pop_group.xml">
-<!ENTITY cairo_set_target_surface SYSTEM "xml/cairo_set_target_surface.xml">
-<!ENTITY cairo_set_target_image SYSTEM "xml/cairo_set_target_image.xml">
-<!ENTITY cairo_set_target_ps SYSTEM "xml/cairo_set_target_ps.xml">
-<!ENTITY cairo_set_target_drawable SYSTEM "xml/cairo_set_target_drawable.xml">
-<!ENTITY cairo_set_target_xcb SYSTEM "xml/cairo_set_target_xcb.xml">
-<!ENTITY cairo_set_target_png SYSTEM "xml/cairo_set_target_png.xml">
-<!ENTITY cairo_set_operator SYSTEM "xml/cairo_set_operator.xml">
-<!ENTITY cairo_set_rgb_color SYSTEM "xml/cairo_set_rgb_color.xml">
-<!ENTITY cairo_set_alpha SYSTEM "xml/cairo_set_alpha.xml">
-<!ENTITY cairo_set_pattern SYSTEM "xml/cairo_set_pattern.xml">
-<!ENTITY cairo_set_tolerance SYSTEM "xml/cairo_set_tolerance.xml">
-<!ENTITY cairo_set_fill_rule SYSTEM "xml/cairo_set_fill_rule.xml">
-<!ENTITY cairo_set_line_width SYSTEM "xml/cairo_set_line_width.xml">
-<!ENTITY cairo_set_line_cap SYSTEM "xml/cairo_set_line_cap.xml">
-<!ENTITY cairo_set_line_join SYSTEM "xml/cairo_set_line_join.xml">
-<!ENTITY cairo_set_dash SYSTEM "xml/cairo_set_dash.xml">
-<!ENTITY cairo_set_miter_limit SYSTEM "xml/cairo_set_miter_limit.xml">
-<!ENTITY cairo_translate SYSTEM "xml/cairo_translate.xml">
-<!ENTITY cairo_scale SYSTEM "xml/cairo_scale.xml">
-<!ENTITY cairo_rotate SYSTEM "xml/cairo_rotate.xml">
-<!ENTITY cairo_default_matrix SYSTEM "xml/cairo_default_matrix.xml">
-<!ENTITY cairo_identity_matrix SYSTEM "xml/cairo_identity_matrix.xml">
-<!ENTITY cairo_transform_point SYSTEM "xml/cairo_transform_point.xml">
-<!ENTITY cairo_transform_distance SYSTEM "xml/cairo_transform_distance.xml">
-<!ENTITY cairo_inverse_transform_point SYSTEM "xml/cairo_inverse_transform_point.xml">
-<!ENTITY cairo_inverse_transform_distance SYSTEM "xml/cairo_inverse_transform_distance.xml">
-<!ENTITY cairo_new_path SYSTEM "xml/cairo_new_path.xml">
-<!ENTITY cairo_move_to SYSTEM "xml/cairo_move_to.xml">
-<!ENTITY cairo_line_to SYSTEM "xml/cairo_line_to.xml">
-<!ENTITY cairo_arc SYSTEM "xml/cairo_arc.xml">
-<!ENTITY cairo_arc_negative SYSTEM "xml/cairo_arc_negative.xml">
-<!ENTITY cairo_rel_move_to SYSTEM "xml/cairo_rel_move_to.xml">
-<!ENTITY cairo_rel_line_to SYSTEM "xml/cairo_rel_line_to.xml">
-<!ENTITY cairo_rectangle SYSTEM "xml/cairo_rectangle.xml">
-<!ENTITY cairo_curve_to SYSTEM "xml/cairo_curve_to.xml">
-<!ENTITY cairo_stroke_path SYSTEM "xml/cairo_stroke_path.xml">
-<!ENTITY cairo_close_path SYSTEM "xml/cairo_close_path.xml">
-<!ENTITY cairo_stroke SYSTEM "xml/cairo_stroke.xml">
-<!ENTITY cairo_fill SYSTEM "xml/cairo_fill.xml">
-<!ENTITY cairo_clip SYSTEM "xml/cairo_clip.xml">
-<!ENTITY cairo_select_font SYSTEM "xml/cairo_select_font.xml">
-<!ENTITY cairo_scale_font SYSTEM "xml/cairo_scale_font.xml">
-<!ENTITY cairo_show_text SYSTEM "xml/cairo_show_text.xml">
-<!ENTITY cairo_text_extents SYSTEM "xml/cairo_text_extents.xml">
-<!ENTITY cairo_current_operator SYSTEM "xml/cairo_current_operator.xml">
-<!ENTITY cairo_current_rgb_color SYSTEM "xml/cairo_current_rgb_color.xml">
-<!ENTITY cairo_current_alpha SYSTEM "xml/cairo_current_alpha.xml">
-<!ENTITY cairo_current_tolerance SYSTEM "xml/cairo_current_tolerance.xml">
-<!ENTITY cairo_current_point SYSTEM "xml/cairo_current_point.xml">
-<!ENTITY cairo_current_fill_rule SYSTEM "xml/cairo_current_fill_rule.xml">
-<!ENTITY cairo_current_line_width SYSTEM "xml/cairo_current_line_width.xml">
-<!ENTITY cairo_current_line_cap SYSTEM "xml/cairo_current_line_cap.xml">
-<!ENTITY cairo_current_line_join SYSTEM "xml/cairo_current_line_join.xml">
-<!ENTITY cairo_current_miter_limit SYSTEM "xml/cairo_current_miter_limit.xml">
-<!ENTITY cairo_current_matrix SYSTEM "xml/cairo_current_matrix.xml">
-<!ENTITY cairo_current_target_surface SYSTEM "xml/cairo_current_target_surface.xml">
-<!ENTITY cairo_status SYSTEM "xml/cairo_status.xml">
-<!ENTITY cairo_status_string SYSTEM "xml/cairo_status_string.xml">
-<!ENTITY cairo_surface_reference SYSTEM "xml/cairo_surface_reference.xml">
-<!ENTITY cairo_surface_destroy SYSTEM "xml/cairo_surface_destroy.xml">
-<!ENTITY cairo_surface_clip_restore SYSTEM "xml/cairo_surface_clip_restore.xml">
-<!ENTITY cairo_surface_set_repeat SYSTEM "xml/cairo_surface_set_repeat.xml">
-<!ENTITY cairo_surface_set_matrix SYSTEM "xml/cairo_surface_set_matrix.xml">
-<!ENTITY cairo_surface_get_matrix SYSTEM "xml/cairo_surface_get_matrix.xml">
-<!ENTITY cairo_surface_set_filter SYSTEM "xml/cairo_surface_set_filter.xml">
-<!ENTITY cairo_matrix_create SYSTEM "xml/cairo_matrix_create.xml">
-<!ENTITY cairo_matrix_destroy SYSTEM "xml/cairo_matrix_destroy.xml">
-<!ENTITY cairo_matrix_copy SYSTEM "xml/cairo_matrix_copy.xml">
-<!ENTITY cairo_matrix_set_identity SYSTEM "xml/cairo_matrix_set_identity.xml">
-<!ENTITY cairo_matrix_translate SYSTEM "xml/cairo_matrix_translate.xml">
-<!ENTITY cairo_matrix_scale SYSTEM "xml/cairo_matrix_scale.xml">
-<!ENTITY cairo_matrix_rotate SYSTEM "xml/cairo_matrix_rotate.xml">
-<!ENTITY cairo_matrix_invert SYSTEM "xml/cairo_matrix_invert.xml">
-<!ENTITY cairo_matrix_multiply SYSTEM "xml/cairo_matrix_multiply.xml">
-<!ENTITY cairo_matrix_transform_distance SYSTEM "xml/cairo_matrix_transform_distance.xml">
-<!ENTITY cairo_matrix_transform_point SYSTEM "xml/cairo_matrix_transform_point.xml">
-<!ENTITY cairo_t SYSTEM "xml/cairo_t.xml">
-<!ENTITY cairo_matrix_t SYSTEM "xml/cairo_matrix_t.xml">
-<!ENTITY cairo_surface_t SYSTEM "xml/cairo_surface_t.xml">
-<!ENTITY cairo_format_t SYSTEM "xml/cairo_format_t.xml">
-<!ENTITY cairo_operator_t SYSTEM "xml/cairo_operator_t.xml">
-<!ENTITY cairo_fill_rule_t SYSTEM "xml/cairo_fill_rule_t.xml">
-<!ENTITY cairo_line_cap_t SYSTEM "xml/cairo_line_cap_t.xml">
-<!ENTITY cairo_text_extents_t SYSTEM "xml/cairo_text_extents_t.xml">
-]>
-<book lang="en">
-<title>Cairo: A Vector Graphics Library</title>
-
-
-<reference>
-<title>functions</title>
-&cairo_create;
-&cairo_reference;
-&cairo_destroy;
-&cairo_save;
-&cairo_restore;
-&cairo_copy;
-&cairo_push_group;
-&cairo_pop_group;
-&cairo_set_target_surface;
-&cairo_set_target_image;
-&cairo_set_target_ps;
-&cairo_set_target_png;
-&cairo_set_target_drawable;
-&cairo_set_target_xcb;
-&cairo_set_operator;
-&cairo_set_rgb_color;
-&cairo_set_alpha;
-&cairo_set_pattern;
-&cairo_set_tolerance;
-&cairo_set_fill_rule;
-&cairo_set_line_width;
-&cairo_set_line_cap;
-&cairo_set_line_join;
-&cairo_set_dash;
-&cairo_set_miter_limit;
-&cairo_translate;
-&cairo_scale;
-&cairo_rotate;
-&cairo_default_matrix;
-&cairo_identity_matrix;
-&cairo_transform_point;
-&cairo_transform_distance;
-&cairo_inverse_transform_point;
-&cairo_inverse_transform_distance;
-&cairo_new_path;
-&cairo_move_to;
-&cairo_line_to;
-&cairo_arc;
-&cairo_arc_negative;
-&cairo_rel_move_to;
-&cairo_rel_line_to;
-&cairo_rectangle;
-&cairo_curve_to;
-&cairo_stroke_path;
-&cairo_close_path;
-&cairo_stroke;
-&cairo_fill;
-&cairo_clip;
-&cairo_select_font;
-&cairo_scale_font;
-&cairo_show_text;
-&cairo_text_extents;
-&cairo_current_operator;
-&cairo_current_rgb_color;
-&cairo_current_alpha;
-&cairo_current_tolerance;
-&cairo_current_point;
-&cairo_current_fill_rule;
-&cairo_current_line_width;
-&cairo_current_line_cap;
-&cairo_current_line_join;
-&cairo_current_miter_limit;
-&cairo_current_matrix;
-&cairo_current_target_surface;
-&cairo_status;
-&cairo_status_string;
-&cairo_surface_reference;
-&cairo_surface_destroy;
-&cairo_surface_clip_restore;
-&cairo_surface_set_repeat;
-&cairo_surface_set_matrix;
-&cairo_surface_get_matrix;
-&cairo_surface_set_filter;
-&cairo_matrix_create;
-&cairo_matrix_destroy;
-&cairo_matrix_copy;
-&cairo_matrix_set_identity;
-&cairo_matrix_translate;
-&cairo_matrix_scale;
-&cairo_matrix_rotate;
-&cairo_matrix_invert;
-&cairo_matrix_multiply;
-&cairo_matrix_transform_distance;
-&cairo_matrix_transform_point;
-</reference>
-<reference>
-<title>types and enums</title>
-&cairo_t;
-&cairo_matrix_t;
-&cairo_surface_t;
-&cairo_format_t;
-&cairo_operator_t;
-&cairo_fill_rule_t;
-&cairo_line_cap_t;
-&cairo_text_extents_t;
-</reference>
-</book>
-
-
-
-
-
diff --git a/doc/reference/xml/cairo_arc.xml b/doc/reference/xml/cairo_arc.xml
deleted file mode 100644
index b8a391f9d..000000000
--- a/doc/reference/xml/cairo_arc.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<refentry id="cairo_arc">
- <refmeta>
- <refentrytitle>cairo_arc</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_arc</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
- void cairo_arc (<link linkend="cairo_t">cairo_t</link> *cr, double xc, double yc, double radius, double angle1, double angle2);</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>xc, yc</parameter> :</term>
- <listitem>
- <simpara>center of arc (a full arc makes a circle)</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_arc</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_arc_negative.xml b/doc/reference/xml/cairo_arc_negative.xml
deleted file mode 100644
index ece1af7f5..000000000
--- a/doc/reference/xml/cairo_arc_negative.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<refentry id="cairo_arc_negative">
- <refmeta>
- <refentrytitle>cairo_arc_negative</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_arc_negative</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
- void cairo_arc_negative (<link linkend="cairo_t">cairo_t</link> *cr, double xc, double yc, double radius, double angle1, double angle2);</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>xc, yc</parameter> :</term>
- <listitem>
- <simpara>center of the arc</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_arc_negative</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_clip.xml b/doc/reference/xml/cairo_clip.xml
deleted file mode 100644
index c1f165306..000000000
--- a/doc/reference/xml/cairo_clip.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_clip">
- <refmeta>
- <refentrytitle>cairo_clip</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_clip</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_clip (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_clip</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_close_path.xml b/doc/reference/xml/cairo_close_path.xml
deleted file mode 100644
index d610c0eee..000000000
--- a/doc/reference/xml/cairo_close_path.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_close_path">
- <refmeta>
- <refentrytitle>cairo_close_path</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_close_path</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_close_path (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_close_path</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_copy.xml b/doc/reference/xml/cairo_copy.xml
deleted file mode 100644
index f9d6537da..000000000
--- a/doc/reference/xml/cairo_copy.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<refentry id="cairo_copy">
- <refmeta>
- <refentrytitle>cairo_copy</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_copy</refname>
- <refpurpose>copy contents from one <link linkend="cairo_t">cairo_t</link> to another</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_copy (<link linkend="cairo_t">cairo_t</link> *dest, <link linkend="cairo_t">cairo_t</link> *src)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>dest</parameter> :</term>
- <listitem>
- <simpara>an allocated <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>src</parameter> :</term>
- <listitem>
- <simpara><link linkend="cairo_t">cairo_t</link> to copy</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_copy</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- This function copies all state information from src to dest. That includes not yet drawn paths and font information.
- </para>
- <para>
-The new <link linkend="cairo_t">cairo_t</link> will become owner of the target and clip surfaces by incrementing their refcount. But the surfaces will not be copied, that means operations on either src or dest will be painted onto the same surface.
- </para>
- <para>
- Note that saved states on the stack can only be restored once. So if you have unclosed calls to <link linkend="cairo_save">cairo_save</link> before copying, calling <link linkend="cairo_restore">cairo_restore</link> on both, src and dest is invalid.
- </para>
- </refsect1>
- <refsect1>
- <title>See also</title>
- <para>
- cairo_clone
- </para>
- </refsect1>
-
-</refentry>
diff --git a/doc/reference/xml/cairo_create.xml b/doc/reference/xml/cairo_create.xml
deleted file mode 100644
index eb1c530aa..000000000
--- a/doc/reference/xml/cairo_create.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<refentry id="cairo_create">
- <refmeta>
- <refentrytitle>cairo_create</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_create</refname>
- <refpurpose>create a new <link linkend="cairo_t">cairo_t</link> object</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting><link linkend="cairo_t">cairo_t</link> * cairo_create (void)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term/>
- <listitem>
- <simpara>this takes no arguments</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_create</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- This function creates a new <link linkend="cairo_t">cairo_t</link> with a reference count of one. Call <link linkend="cairo_destroy">cairo_destroy</link> to free the allocated resources.
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_current_alpha.xml b/doc/reference/xml/cairo_current_alpha.xml
deleted file mode 100644
index 9aae8e166..000000000
--- a/doc/reference/xml/cairo_current_alpha.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_current_alpha">
- <refmeta>
- <refentrytitle>cairo_current_alpha</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_current_alpha</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-double cairo_current_alpha (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_current_alpha</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_current_fill_rule.xml b/doc/reference/xml/cairo_current_fill_rule.xml
deleted file mode 100644
index 3902c7acb..000000000
--- a/doc/reference/xml/cairo_current_fill_rule.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_current_fill_rule">
- <refmeta>
- <refentrytitle>cairo_current_fill_rule</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_current_fill_rule</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-<link linkend="cairo_fill_rule_t">cairo_fill_rule_t</link> cairo_current_fill_rule (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_current_fill_rule</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_current_font.xml b/doc/reference/xml/cairo_current_font.xml
deleted file mode 100644
index 3503b6db7..000000000
--- a/doc/reference/xml/cairo_current_font.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-<refentry id="cairo_current_font">
- <refmeta>
- <refentrytitle>cairo_current_font</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_current_font</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
- cairo_font_t *
- cairo_current_font (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_current_font</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- returns pointer to the current cairo_font_t object in the <link linkend="cairo_t">cairo_t</link>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_current_font_extents.xml b/doc/reference/xml/cairo_current_font_extents.xml
deleted file mode 100644
index 822cd4049..000000000
--- a/doc/reference/xml/cairo_current_font_extents.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<refentry id="cairo_current_font_extents">
- <refmeta>
- <refentrytitle>cairo_current_font_extents</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_current_font_extents</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_current_font_extents (<link linkend="cairo_t">cairo_t</link> *cr, cairo_font_extents_t *extents)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>extents</parameter> :</term>
- <listitem>
- <simpara>fills in a provided cairo_font_extents_t object</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_current_font_extents</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_current_line_cap.xml b/doc/reference/xml/cairo_current_line_cap.xml
deleted file mode 100644
index 4b01c4db7..000000000
--- a/doc/reference/xml/cairo_current_line_cap.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_current_line_cap">
- <refmeta>
- <refentrytitle>cairo_current_line_cap</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_current_line_cap</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-<link linkend="cairo_line_cap_t">cairo_line_cap_t</link> cairo_current_line_cap (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_current_line_cap</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_current_line_join.xml b/doc/reference/xml/cairo_current_line_join.xml
deleted file mode 100644
index 58571aba8..000000000
--- a/doc/reference/xml/cairo_current_line_join.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_current_line_join">
- <refmeta>
- <refentrytitle>cairo_current_line_join</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_current_line_join</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_line_join_t cairo_current_line_join (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_current_line_join</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_current_line_width.xml b/doc/reference/xml/cairo_current_line_width.xml
deleted file mode 100644
index f2af35f8f..000000000
--- a/doc/reference/xml/cairo_current_line_width.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_current_line_width">
- <refmeta>
- <refentrytitle>cairo_current_line_width</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_current_line_width</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-double cairo_current_line_width (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_current_line_width</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_current_matrix.xml b/doc/reference/xml/cairo_current_matrix.xml
deleted file mode 100644
index 03f435227..000000000
--- a/doc/reference/xml/cairo_current_matrix.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-<refentry id="cairo_current_matrix">
- <refmeta>
- <refentrytitle>cairo_current_matrix</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_current_matrix</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_current_matrix (<link linkend="cairo_t">cairo_t</link> *cr, <link linkend="cairo_matrix_t">cairo_matrix_t</link> *matrix)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>matrix</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_current_matrix</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_current_miter_limit.xml b/doc/reference/xml/cairo_current_miter_limit.xml
deleted file mode 100644
index fa0403ddb..000000000
--- a/doc/reference/xml/cairo_current_miter_limit.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_current_miter_limit">
- <refmeta>
- <refentrytitle>cairo_current_miter_limit</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_current_miter_limit</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-double cairo_current_miter_limit (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_current_miter_limit</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_current_operator.xml b/doc/reference/xml/cairo_current_operator.xml
deleted file mode 100644
index 166717300..000000000
--- a/doc/reference/xml/cairo_current_operator.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_current_operator">
- <refmeta>
- <refentrytitle>cairo_current_operator</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_current_operator</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-<link linkend="cairo_operator_t">cairo_operator_t</link> cairo_current_operator (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_current_operator</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_current_point.xml b/doc/reference/xml/cairo_current_point.xml
deleted file mode 100644
index a865bf1e5..000000000
--- a/doc/reference/xml/cairo_current_point.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_current_point">
- <refmeta>
- <refentrytitle>cairo_current_point</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_current_point</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_current_point (<link linkend="cairo_t">cairo_t</link> *cr, double *x, double *y)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>x</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>y</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_current_point</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_current_rgb_color.xml b/doc/reference/xml/cairo_current_rgb_color.xml
deleted file mode 100644
index a1a8bbcac..000000000
--- a/doc/reference/xml/cairo_current_rgb_color.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-
-<refentry id="cairo_current_rgb_color">
- <refmeta>
- <refentrytitle>cairo_current_rgb_color</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_current_rgb_color</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_current_rgb_color (<link linkend="cairo_t">cairo_t</link> *cr, double *red, double *green, double *blue)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>red</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>green</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>blue</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_current_rgb_color</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_current_target_surface.xml b/doc/reference/xml/cairo_current_target_surface.xml
deleted file mode 100644
index 60d0263b6..000000000
--- a/doc/reference/xml/cairo_current_target_surface.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-<refentry id="cairo_current_target_surface">
- <refmeta>
- <refentrytitle>cairo_current_target_surface</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_current_target_surface</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting><link linkend="cairo_surface_t">cairo_surface_t</link> * cairo_current_target_surface (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_current_target_surface</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_current_tolerance.xml b/doc/reference/xml/cairo_current_tolerance.xml
deleted file mode 100644
index bfc24151c..000000000
--- a/doc/reference/xml/cairo_current_tolerance.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_current_tolerance">
- <refmeta>
- <refentrytitle>cairo_current_tolerance</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_current_tolerance</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-double cairo_current_tolerance (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_current_tolerance</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_curve_to.xml b/doc/reference/xml/cairo_curve_to.xml
deleted file mode 100644
index 330ed3629..000000000
--- a/doc/reference/xml/cairo_curve_to.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<refentry id="cairo_curve_to">
- <refmeta>
- <refentrytitle>cairo_curve_to</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_curve_to</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
- void cairo_curve_to (<link linkend="cairo_t">cairo_t</link> *cr, double x1, double y1, double x2, double y2, double x3, double y3);</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>x1</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>y1</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>x2</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>y2</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>x3</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>y3</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_curve_to</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_default_matrix.xml b/doc/reference/xml/cairo_default_matrix.xml
deleted file mode 100644
index 182ca01a3..000000000
--- a/doc/reference/xml/cairo_default_matrix.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_default_matrix">
- <refmeta>
- <refentrytitle>cairo_default_matrix</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_default_matrix</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_default_matrix (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_default_matrix</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_destroy.xml b/doc/reference/xml/cairo_destroy.xml
deleted file mode 100644
index 0f55239fa..000000000
--- a/doc/reference/xml/cairo_destroy.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<refentry id="cairo_destroy">
- <refmeta>
- <refentrytitle>cairo_destroy</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_destroy</refname>
- <refpurpose>free a <link linkend="cairo_t">cairo_t</link></refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_destroy (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_destroy</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- Decreases the reference of a a <link linkend="cairo_t">cairo_t</link>. If the refcount drops to zero, all associated resources will be freed.
- </para>
- <para>
- Saved states on the stack which were not restored with <link linkend="cairo_restore">cairo_restore</link> will be destroyed, too.
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_fill.xml b/doc/reference/xml/cairo_fill.xml
deleted file mode 100644
index e890ab1b1..000000000
--- a/doc/reference/xml/cairo_fill.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_fill">
- <refmeta>
- <refentrytitle>cairo_fill</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_fill</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_fill (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_fill</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_fill_rule_t.xml b/doc/reference/xml/cairo_fill_rule_t.xml
deleted file mode 100644
index 9f1fbe3ee..000000000
--- a/doc/reference/xml/cairo_fill_rule_t.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<refentry id="cairo_fill_rule_t">
- <refmeta>
- <refentrytitle>cairo_fill_rule_t</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
-
- <refnamediv>
- <refname>cairo_fill_rule_t</refname>
- <refpurpose>enumeration for fill rules</refpurpose>
- </refnamediv>
-
- <refsect1>
- <title>Description</title>
- <indexterm><primary>enums</primary>
- <secondary>cairo_fill_rule_t</secondary></indexterm>
-<programlisting>typedef enum cairo_fill_rule {
- CAIRO_FILL_RULE_WINDING,
- CAIRO_FILL_RULE_EVEN_ODD
-} cairo_fill_rule_t;
-</programlisting>
-<para>
-Select ways to fill paths.
-</para>
-<variablelist role="enum">
-<varlistentry>
-<term><literal>CAIRO_FILL_RULE_WINDING</literal></term>
-<listitem><simpara>counts all intersections with a clockwise line positive and intersections with a counter-clockwise line negative. All areas with a non-zero counts are filled.
-</simpara></listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>CAIRO_FILL_RULE_EVEN_ODD</literal></term>
-<listitem><simpara>Only the area from one intersection to the next will be filled, no matter what orientation the intersected line has.
-</simpara></listitem>
-</varlistentry>
-</variablelist>
- </refsect1>
-</refentry>
-
-
-
diff --git a/doc/reference/xml/cairo_format_t.xml b/doc/reference/xml/cairo_format_t.xml
deleted file mode 100644
index e80c18a94..000000000
--- a/doc/reference/xml/cairo_format_t.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<refentry id="cairo_format_t">
- <refmeta>
- <refentrytitle>cairo_format_t</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
-
- <refnamediv>
- <refname>cairo_format_t</refname>
- <refpurpose>enumeration for image formats</refpurpose>
- </refnamediv>
-
- <refsect1>
- <title>Description</title>
- <indexterm><primary>enums</primary>
- <secondary>cairo_format_t</secondary></indexterm>
-<programlisting>typedef enum cairo_format {
- CAIRO_FORMAT_ARGB32 = PictStandardARGB32,
- CAIRO_FORMAT_RGB24 = PictStandardRGB24,
- CAIRO_FORMAT_A8 = PictStandardA8,
- CAIRO_FORMAT_A1 = PictStandardA1
-} cairo_format_t;
-</programlisting>
-<para>
-Possible formats for in-memory images.
-</para>
-<variablelist role="enum">
-<varlistentry>
-<term><literal>CAIRO_FORMAT_ARGB32</literal></term>
-<listitem><simpara>one byte for red, green, blue and alpha. (rowstride = width * 4)
-</simpara></listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>CAIRO_FORMAT_RGB24</literal></term>
-<listitem><simpara>one byte for red, green and blue (rowstride = width * 4)
-</simpara></listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>CAIRO_FORMAT_A8</literal></term>
-<listitem><simpara>indexed color image
-</simpara></listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>CAIRO_FORMAT_A1</literal></term>
-<listitem><simpara>a bitmap
-</simpara></listitem>
-</varlistentry>
-</variablelist>
- </refsect1>
-</refentry>
-
-
-
diff --git a/doc/reference/xml/cairo_hit.xml b/doc/reference/xml/cairo_hit.xml
deleted file mode 100644
index 3d834586a..000000000
--- a/doc/reference/xml/cairo_hit.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-<refentry id="cairo_hit">
- <refmeta>
- <refentrytitle>cairo_hit</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_hit</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <funcsynopsis>
- <funcsynopsisinfo>
-</funcsynopsisinfo>
- <funcprototype>
- <funcdef>int <function>cairo_hit</function></funcdef>
- <paramdef>
- <link linkend="cairo_t">cairo_t</link>
- <parameter>*cr</parameter>
- </paramdef>
- </funcprototype>
- </funcsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_hit</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_identity_matrix.xml b/doc/reference/xml/cairo_identity_matrix.xml
deleted file mode 100644
index 23dafad9e..000000000
--- a/doc/reference/xml/cairo_identity_matrix.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_identity_matrix">
- <refmeta>
- <refentrytitle>cairo_identity_matrix</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_identity_matrix</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_identity_matrix (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_identity_matrix</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_in_fill.xml b/doc/reference/xml/cairo_in_fill.xml
deleted file mode 100644
index df78c484a..000000000
--- a/doc/reference/xml/cairo_in_fill.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<refentry id="cairo_in_fill">
-<refmeta>
-<refentrytitle>cairo_in_fill</refentrytitle>
-<manvolnum>3</manvolnum>
-</refmeta>
-
-<refnamediv>
-<refname>cairo_in_fill</refname>
-<refpurpose>some description</refpurpose>
-</refnamediv>
-
-
-<refsynopsisdiv>
-<funcsynopsis>
-<funcsynopsisinfo>
-</funcsynopsisinfo>
-<funcprototype>
- <funcdef>void <function>cairo_in_fill</function></funcdef><paramdef><link linkend="cairo_t">cairo_t</link> <parameter>*cr</parameter></paramdef>
-<paramdef>double <parameter>x</parameter></paramdef>
-<paramdef>double <parameter>y</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-</refsynopsisdiv>
-
-<refsect1>
- <title>Description</title>
- <para>
- <indexterm><primary>functions</primary>
- <secondary>cairo_in_fill</secondary></indexterm>
- <indexterm><primary></primary></indexterm>
- </para>
- </refsect1>
-</refentry>
-
diff --git a/doc/reference/xml/cairo_in_stroke.xml b/doc/reference/xml/cairo_in_stroke.xml
deleted file mode 100644
index 77c9d6c34..000000000
--- a/doc/reference/xml/cairo_in_stroke.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<refentry id="cairo_in_stroke">
-<refmeta>
-<refentrytitle>cairo_in_stroke</refentrytitle>
-<manvolnum>3</manvolnum>
-</refmeta>
-
-<refnamediv>
-<refname>cairo_in_stroke</refname>
-<refpurpose>some description</refpurpose>
-</refnamediv>
-
-
-<refsynopsisdiv>
-<funcsynopsis>
-<funcsynopsisinfo>
-</funcsynopsisinfo>
-<funcprototype>
- <funcdef>void <function>cairo_in_stroke</function></funcdef><paramdef><link linkend="cairo_t">cairo_t</link> <parameter>*cr</parameter></paramdef>
-<paramdef>double <parameter>x</parameter></paramdef>
-<paramdef>double <parameter>y</parameter></paramdef>
-</funcprototype>
-</funcsynopsis>
-</refsynopsisdiv>
-
-<refsect1>
- <title>Description</title>
- <para>
- <indexterm><primary>functions</primary>
- <secondary>cairo_in_stroke</secondary></indexterm>
- <indexterm><primary></primary></indexterm>
- </para>
- </refsect1>
-</refentry>
-
diff --git a/doc/reference/xml/cairo_inverse_transform_distance.xml b/doc/reference/xml/cairo_inverse_transform_distance.xml
deleted file mode 100644
index a525fdc0e..000000000
--- a/doc/reference/xml/cairo_inverse_transform_distance.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_inverse_transform_distance">
- <refmeta>
- <refentrytitle>cairo_inverse_transform_distance</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_inverse_transform_distance</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_inverse_transform_distance (<link linkend="cairo_t">cairo_t</link> *cr, double *dx, double *dy)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dx</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dy</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_inverse_transform_distance</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_inverse_transform_point.xml b/doc/reference/xml/cairo_inverse_transform_point.xml
deleted file mode 100644
index 7100a92bd..000000000
--- a/doc/reference/xml/cairo_inverse_transform_point.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_inverse_transform_point">
- <refmeta>
- <refentrytitle>cairo_inverse_transform_point</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_inverse_transform_point</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_inverse_transform_point (<link linkend="cairo_t">cairo_t</link> *cr, double *x, double *y)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>x</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>y</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_inverse_transform_point</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_line_cap_t.xml b/doc/reference/xml/cairo_line_cap_t.xml
deleted file mode 100644
index 9f1ee028a..000000000
--- a/doc/reference/xml/cairo_line_cap_t.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<refentry id="cairo_line_cap_t">
- <refmeta>
- <refentrytitle>cairo_line_cap_t</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
-
- <refnamediv>
- <refname>cairo_line_cap_t</refname>
- <refpurpose>enumeration for style of line-endings</refpurpose>
- </refnamediv>
-
- <refsect1>
- <title>Description</title>
- <indexterm><primary>enums</primary>
- <secondary>cairo_line_cap_t</secondary></indexterm>
-<programlisting>typedef enum cairo_line_cap {
- CAIRO_LINE_CAP_BUTT,
- CAIRO_LINE_CAP_ROUND,
- CAIRO_LINE_CAP_SQUARE
-} cairo_line_cap_t;
-</programlisting>
-<variablelist role="enum">
-<varlistentry>
-<term><literal>CAIRO_LINE_CAP_BUTT</literal></term>
-<listitem><simpara>start(stop) the line exactly at the start(end) point
-</simpara></listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>CAIRO_LINE_CAP_ROUND</literal></term>
-<listitem><simpara>use a round ending, the center of the circle is the end point.
-</simpara></listitem>
-</varlistentry>
-<varlistentry>
-<term><literal>CAIRO_LINE_CAP_SQUARE</literal></term>
-<listitem><simpara>use squared ending, the center of the square is the end point.
-</simpara></listitem>
-</varlistentry>
-</variablelist>
- </refsect1>
-</refentry>
-
-
-
diff --git a/doc/reference/xml/cairo_line_to.xml b/doc/reference/xml/cairo_line_to.xml
deleted file mode 100644
index 7cc226dad..000000000
--- a/doc/reference/xml/cairo_line_to.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_line_to">
- <refmeta>
- <refentrytitle>cairo_line_to</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_line_to</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_line_to (<link linkend="cairo_t">cairo_t</link> *cr, double x, double y)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>x</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>y</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_line_to</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_matrix_copy.xml b/doc/reference/xml/cairo_matrix_copy.xml
deleted file mode 100644
index a7da42078..000000000
--- a/doc/reference/xml/cairo_matrix_copy.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-<refentry id="cairo_matrix_copy">
- <refmeta>
- <refentrytitle>cairo_matrix_copy</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_matrix_copy</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_status_t cairo_matrix_copy (<link linkend="cairo_matrix_t">cairo_matrix_t</link> *matrix, const <link linkend="cairo_matrix_t">cairo_matrix_t</link> *other)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>matrix</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>other</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_matrix_copy</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_matrix_create.xml b/doc/reference/xml/cairo_matrix_create.xml
deleted file mode 100644
index b3351c8a9..000000000
--- a/doc/reference/xml/cairo_matrix_create.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-<refentry id="cairo_matrix_create">
- <refmeta>
- <refentrytitle>cairo_matrix_create</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_matrix_create</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting><link linkend="cairo_matrix_t">cairo_matrix_t</link> * cairo_matrix_create (void)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term/>
- <listitem>
- <simpara>this takes no arguments</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_matrix_create</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_matrix_destroy.xml b/doc/reference/xml/cairo_matrix_destroy.xml
deleted file mode 100644
index 24cb7d385..000000000
--- a/doc/reference/xml/cairo_matrix_destroy.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_matrix_destroy">
- <refmeta>
- <refentrytitle>cairo_matrix_destroy</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_matrix_destroy</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_matrix_destroy (<link linkend="cairo_matrix_t">cairo_matrix_t</link> *matrix)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>matrix</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_matrix_destroy</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_matrix_invert.xml b/doc/reference/xml/cairo_matrix_invert.xml
deleted file mode 100644
index 3786b24a7..000000000
--- a/doc/reference/xml/cairo_matrix_invert.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_matrix_invert">
- <refmeta>
- <refentrytitle>cairo_matrix_invert</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_matrix_invert</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_status_t cairo_matrix_invert (<link linkend="cairo_matrix_t">cairo_matrix_t</link> *matrix)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>matrix</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_matrix_invert</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_matrix_multiply.xml b/doc/reference/xml/cairo_matrix_multiply.xml
deleted file mode 100644
index 55d2a71ad..000000000
--- a/doc/reference/xml/cairo_matrix_multiply.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_matrix_multiply">
- <refmeta>
- <refentrytitle>cairo_matrix_multiply</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_matrix_multiply</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_status_t cairo_matrix_multiply (<link linkend="cairo_matrix_t">cairo_matrix_t</link> *result, const <link linkend="cairo_matrix_t">cairo_matrix_t</link> *a, const <link linkend="cairo_matrix_t">cairo_matrix_t</link> *b)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>result</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>a</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>b</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_matrix_multiply</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_matrix_rotate.xml b/doc/reference/xml/cairo_matrix_rotate.xml
deleted file mode 100644
index 1f9005125..000000000
--- a/doc/reference/xml/cairo_matrix_rotate.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-<refentry id="cairo_matrix_rotate">
- <refmeta>
- <refentrytitle>cairo_matrix_rotate</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_matrix_rotate</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_status_t cairo_matrix_rotate (<link linkend="cairo_matrix_t">cairo_matrix_t</link> *matrix, double radians)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>matrix</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>radians</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_matrix_rotate</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_matrix_scale.xml b/doc/reference/xml/cairo_matrix_scale.xml
deleted file mode 100644
index 183ef6d55..000000000
--- a/doc/reference/xml/cairo_matrix_scale.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_matrix_scale">
- <refmeta>
- <refentrytitle>cairo_matrix_scale</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_matrix_scale</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_status_t cairo_matrix_scale (<link linkend="cairo_matrix_t">cairo_matrix_t</link> *matrix, double sx, double sy)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>matrix</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>sx</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>sy</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_matrix_scale</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_matrix_set_identity.xml b/doc/reference/xml/cairo_matrix_set_identity.xml
deleted file mode 100644
index 449de6d4f..000000000
--- a/doc/reference/xml/cairo_matrix_set_identity.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_matrix_set_identity">
- <refmeta>
- <refentrytitle>cairo_matrix_set_identity</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_matrix_set_identity</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_status_t cairo_matrix_set_identity (<link linkend="cairo_matrix_t">cairo_matrix_t</link> *matrix)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>matrix</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_matrix_set_identity</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_matrix_t.xml b/doc/reference/xml/cairo_matrix_t.xml
deleted file mode 100644
index 67632ac18..000000000
--- a/doc/reference/xml/cairo_matrix_t.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-<refentry id="cairo_matrix_t">
- <refmeta>
- <refentrytitle>cairo_matrix</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_matrix</refname>
- <refpurpose>a matrix</refpurpose>
- </refnamediv>
- <refsect1>
- <title>Description</title>
- <para><indexterm><primary>types</primary><secondary>cairo_matrix</secondary></indexterm><indexterm><primary/></indexterm>
- A <varname>cairo_matrix</varname> contains the current state of the rendering device,
- including coordinates of yet to be drawn shapes.
- <varname>cairo_matrix</varname>'s can be pushed to a stack via
- <link linkend="cairo_save">cairo_save</link>.
- They may then savely be changed, without loosing the current state.
- Use <link linkend="cairo_restore">cairo_restore</link> to
- restore to the saved state.
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_matrix_transform_distance.xml b/doc/reference/xml/cairo_matrix_transform_distance.xml
deleted file mode 100644
index a1a558078..000000000
--- a/doc/reference/xml/cairo_matrix_transform_distance.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_matrix_transform_distance">
- <refmeta>
- <refentrytitle>cairo_matrix_transform_distance</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_matrix_transform_distance</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_status_t cairo_matrix_transform_distance (<link linkend="cairo_matrix_t">cairo_matrix_t</link> *matrix, double *dx, double *dy)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>matrix</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dx</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dy</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_matrix_transform_distance</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_matrix_transform_point.xml b/doc/reference/xml/cairo_matrix_transform_point.xml
deleted file mode 100644
index 2b0e12b59..000000000
--- a/doc/reference/xml/cairo_matrix_transform_point.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_matrix_transform_point">
- <refmeta>
- <refentrytitle>cairo_matrix_transform_point</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_matrix_transform_point</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_status_t cairo_matrix_transform_point (<link linkend="cairo_matrix_t">cairo_matrix_t</link> *matrix, double *x, double *y)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>matrix</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>x</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>y</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_matrix_transform_point</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_matrix_translate.xml b/doc/reference/xml/cairo_matrix_translate.xml
deleted file mode 100644
index 9800569ca..000000000
--- a/doc/reference/xml/cairo_matrix_translate.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_matrix_translate">
- <refmeta>
- <refentrytitle>cairo_matrix_translate</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_matrix_translate</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_status_t cairo_matrix_translate (<link linkend="cairo_matrix_t">cairo_matrix_t</link> *matrix, double tx, double ty)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>matrix</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>tx</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>ty</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_matrix_translate</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_move_to.xml b/doc/reference/xml/cairo_move_to.xml
deleted file mode 100644
index dc8118f87..000000000
--- a/doc/reference/xml/cairo_move_to.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_move_to">
- <refmeta>
- <refentrytitle>cairo_move_to</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_move_to</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_move_to (<link linkend="cairo_t">cairo_t</link> *cr, double x, double y)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>x</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>y</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_move_to</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_new_path.xml b/doc/reference/xml/cairo_new_path.xml
deleted file mode 100644
index 680d7f937..000000000
--- a/doc/reference/xml/cairo_new_path.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_new_path">
- <refmeta>
- <refentrytitle>cairo_new_path</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_new_path</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_new_path (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_new_path</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_operator_t.xml b/doc/reference/xml/cairo_operator_t.xml
deleted file mode 100644
index b659bb9b2..000000000
--- a/doc/reference/xml/cairo_operator_t.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<refentry id="cairo_operator_t">
- <refmeta>
- <refentrytitle>cairo_operator_t</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
-
- <refnamediv>
- <refname>cairo_operator_t</refname>
- <refpurpose>enumeration for image operators</refpurpose>
- </refnamediv>
-
- <refsect1>
- <title>Description</title>
- <indexterm><primary>enums</primary>
- <secondary>cairo_operator_t</secondary></indexterm>
-<programlisting>typedef enum cairo_operator {
- CAIRO_OPERATOR_CLEAR,
- CAIRO_OPERATOR_SRC,
- CAIRO_OPERATOR_DST,
- CAIRO_OPERATOR_OVER,
- CAIRO_OPERATOR_OVER_REVERSE,
- CAIRO_OPERATOR_IN,
- CAIRO_OPERATOR_IN_REVERSE,
- CAIRO_OPERATOR_OUT,
- CAIRO_OPERATOR_OUT_REVERSE,
- CAIRO_OPERATOR_ATOP,
- CAIRO_OPERATOR_ATOP_REVERSE,
- CAIRO_OPERATOR_XOR,
- CAIRO_OPERATOR_ADD,
- CAIRO_OPERATOR_SATURATE
-} cairo_operator_t;
-</programlisting>
-<para>
-Operators for surface-compositing. XXX
-</para>
-<variablelist role="enum">
-<varlistentry>
-<term><literal></literal></term>
-<listitem><simpara>
-</simpara></listitem>
-</varlistentry>
-</variablelist>
- </refsect1>
-</refentry>
-
-
-
diff --git a/doc/reference/xml/cairo_pop_group.xml b/doc/reference/xml/cairo_pop_group.xml
deleted file mode 100644
index 9adc0ad62..000000000
--- a/doc/reference/xml/cairo_pop_group.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_pop_group">
- <refmeta>
- <refentrytitle>cairo_pop_group</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_pop_group</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_pop_group (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_pop_group</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_push_group.xml b/doc/reference/xml/cairo_push_group.xml
deleted file mode 100644
index 9d252cc72..000000000
--- a/doc/reference/xml/cairo_push_group.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_push_group">
- <refmeta>
- <refentrytitle>cairo_push_group</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_push_group</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_push_group (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_push_group</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_rectangle.xml b/doc/reference/xml/cairo_rectangle.xml
deleted file mode 100644
index bab307f32..000000000
--- a/doc/reference/xml/cairo_rectangle.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<refentry id="cairo_rectangle">
- <refmeta>
- <refentrytitle>cairo_rectangle</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_rectangle</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
- void cairo_rectangle (<link linkend="cairo_t">cairo_t</link> *cr, double x, double y, double width, double height);</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>x, y</parameter> :</term>
- <listitem>
- <simpara>coordinates of the left top corner</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>width, height</parameter> :</term>
- <listitem>
- <simpara>width and height of the rectangle</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_rectangle</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- The current line style applies to the lines of the rectangle.
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_reference.xml b/doc/reference/xml/cairo_reference.xml
deleted file mode 100644
index 21725adbd..000000000
--- a/doc/reference/xml/cairo_reference.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<refentry id="cairo_reference">
- <refmeta>
- <refentrytitle>cairo_reference</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_reference</refname>
- <refpurpose>increase reference count of <link linkend="cairo_t">cairo_t</link></refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_reference (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_reference</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- When calling <function>cairo_reference</function> the reference count will be increased by one and the caller becomes owner of the <link linkend="cairo_t">cairo_t</link>. When the creator of the <link linkend="cairo_t">cairo_t</link> destroys the the object via <link linkend="cairo_destroy">cairo_destroy</link> the refcount will be decreased but the object will stay valid, since you are still owner of the object.
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_rel_curve_to.xml b/doc/reference/xml/cairo_rel_curve_to.xml
deleted file mode 100644
index c16f85ff2..000000000
--- a/doc/reference/xml/cairo_rel_curve_to.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<refentry id="cairo_curve_to">
- <refmeta>
- <refentrytitle><link linkend="cairo_curve_to">cairo_curve_to</link></refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname><link linkend="cairo_curve_to">cairo_curve_to</link></refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
- void <link linkend="cairo_curve_to">cairo_curve_to</link> (<link linkend="cairo_t">cairo_t</link> *cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3);</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dx1</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dy1</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dx2</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dy2</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dx3</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dy3</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary><link linkend="cairo_curve_to">cairo_curve_to</link></secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_rel_line_to.xml b/doc/reference/xml/cairo_rel_line_to.xml
deleted file mode 100644
index 208cb4d33..000000000
--- a/doc/reference/xml/cairo_rel_line_to.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_rel_line_to">
- <refmeta>
- <refentrytitle>cairo_rel_line_to</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_rel_line_to</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_rel_line_to (<link linkend="cairo_t">cairo_t</link> *cr, double dx, double dy)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dx</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dy</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_rel_line_to</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_rel_move_to.xml b/doc/reference/xml/cairo_rel_move_to.xml
deleted file mode 100644
index 2468536b9..000000000
--- a/doc/reference/xml/cairo_rel_move_to.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_rel_move_to">
- <refmeta>
- <refentrytitle>cairo_rel_move_to</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_rel_move_to</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_rel_move_to (<link linkend="cairo_t">cairo_t</link> *cr, double dx, double dy)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dx</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dy</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_rel_move_to</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_restore.xml b/doc/reference/xml/cairo_restore.xml
deleted file mode 100644
index ed2411a52..000000000
--- a/doc/reference/xml/cairo_restore.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-<refentry id="cairo_restore">
- <refmeta>
- <refentrytitle>cairo_restore</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_restore</refname>
- <refpurpose>restore a saved state</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_restore (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_restore</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- This fucntion is the counterpart to <link linkend="cairo_save">cairo_save</link>. A saved state can be restored with cairo_restore.
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_rotate.xml b/doc/reference/xml/cairo_rotate.xml
deleted file mode 100644
index 6effd5648..000000000
--- a/doc/reference/xml/cairo_rotate.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-<refentry id="cairo_rotate">
- <refmeta>
- <refentrytitle>cairo_rotate</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_rotate</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_rotate (<link linkend="cairo_t">cairo_t</link> *cr, double angle)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>angle</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_rotate</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_save.xml b/doc/reference/xml/cairo_save.xml
deleted file mode 100644
index fc2a4e04e..000000000
--- a/doc/reference/xml/cairo_save.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-<refentry id="cairo_save">
- <refmeta>
- <refentrytitle>cairo_save</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_save</refname>
- <refpurpose>save current state</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_save (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_save</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- This function stores the complete state of a <link linkend="cairo_t">cairo_t</link>. It may then be changed in any way. The saved state can then be restored with <link linkend="cairo_restore">cairo_restore</link>. Calls to cairo_save may be nested to an arbitraty depth.
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_scale.xml b/doc/reference/xml/cairo_scale.xml
deleted file mode 100644
index eccd8af80..000000000
--- a/doc/reference/xml/cairo_scale.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_scale">
- <refmeta>
- <refentrytitle>cairo_scale</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_scale</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_scale (<link linkend="cairo_t">cairo_t</link> *cr, double sx, double sy)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>sx</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>sy</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_scale</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_scale_font.xml b/doc/reference/xml/cairo_scale_font.xml
deleted file mode 100644
index 170df09b0..000000000
--- a/doc/reference/xml/cairo_scale_font.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-<refentry id="cairo_scale_font">
- <refmeta>
- <refentrytitle>cairo_scale_font</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_scale_font</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_scale_font (<link linkend="cairo_t">cairo_t</link> *cr, double scale)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>scale</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_scale_font</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_select_font.xml b/doc/reference/xml/cairo_select_font.xml
deleted file mode 100644
index 36bd782f8..000000000
--- a/doc/reference/xml/cairo_select_font.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-
-<refentry id="cairo_select_font">
- <refmeta>
- <refentrytitle>cairo_select_font</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_select_font</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_select_font (<link linkend="cairo_t">cairo_t</link> *cr, const char *family, cairo_font_slant_t slant, cairo_font_weight_t weight);</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>family</parameter> :</term>
- <listitem>
- <simpara>name for the font family (e.g. XXX)</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>slant</parameter> :</term>
- <listitem>
- <simpara>see cairo_font_slant_t for valid values</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>weight</parameter> :</term>
- <listitem>
- <simpara>see cairo_font_weight_t for valid values</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_select_font</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_alpha.xml b/doc/reference/xml/cairo_set_alpha.xml
deleted file mode 100644
index e996c33bf..000000000
--- a/doc/reference/xml/cairo_set_alpha.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-<refentry id="cairo_set_alpha">
- <refmeta>
- <refentrytitle>cairo_set_alpha</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_alpha</refname>
- <refpurpose>set opaqueness for painting</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_set_alpha (<link linkend="cairo_t">cairo_t</link> *cr, double alpha)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a cairo_r</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>alpha</parameter> :</term>
- <listitem>
- <simpara>an alpha value between 0.0 and 1.0</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_alpha</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- If alpha is not between 0.0 and 1.0 it will be restricted to fit.
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_dash.xml b/doc/reference/xml/cairo_set_dash.xml
deleted file mode 100644
index 50d1b37ff..000000000
--- a/doc/reference/xml/cairo_set_dash.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-
-<refentry id="cairo_set_dash">
- <refmeta>
- <refentrytitle>cairo_set_dash</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_dash</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_set_dash (<link linkend="cairo_t">cairo_t</link> *cr, double *dashes, int ndash, double offset)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dashes</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>ndash</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>offset</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_dash</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_fill_rule.xml b/doc/reference/xml/cairo_set_fill_rule.xml
deleted file mode 100644
index 64bd9b51c..000000000
--- a/doc/reference/xml/cairo_set_fill_rule.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-<refentry id="cairo_set_fill_rule">
- <refmeta>
- <refentrytitle>cairo_set_fill_rule</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_fill_rule</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_set_fill_rule (<link linkend="cairo_t">cairo_t</link> *cr, <link linkend="cairo_fill_rule_t">cairo_fill_rule_t</link> fill_rule)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>fill_rule</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_fill_rule</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_font.xml b/doc/reference/xml/cairo_set_font.xml
deleted file mode 100644
index 31661494e..000000000
--- a/doc/reference/xml/cairo_set_font.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<refentry id="cairo_set_font">
- <refmeta>
- <refentrytitle>cairo_set_font</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_font</refname>
- <refpurpose>replace the font in the current state</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_set_font (<link linkend="cairo_t">cairo_t</link> *cr, cairo_font_t *font)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>font</parameter> :</term>
- <listitem>
- <simpara>replaces the current cairo_font_t object in the <link linkend="cairo_t">cairo_t</link> with font. The replaced font in the <link linkend="cairo_t">cairo_t</link> will be destroyed if there are no other references to it.</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_font</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_line_cap.xml b/doc/reference/xml/cairo_set_line_cap.xml
deleted file mode 100644
index 9b346b782..000000000
--- a/doc/reference/xml/cairo_set_line_cap.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<refentry id="cairo_set_line_cap">
- <refmeta>
- <refentrytitle>cairo_set_line_cap</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_line_cap</refname>
- <refpurpose>determine shape of line endings</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_set_line_cap (<link linkend="cairo_t">cairo_t</link> *cr, <link linkend="cairo_line_cap_t">cairo_line_cap_t</link> line_cap)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>line_cap</parameter> :</term>
- <listitem>
- <simpara>see <link linkend="cairo_line_cap_t">cairo_line_cap_t</link> for styles</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_line_cap</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- When the line width is larger than one device unit, it matters which way the ending of a line is drawn. Use this function to set the line-ending-style.
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_line_join.xml b/doc/reference/xml/cairo_set_line_join.xml
deleted file mode 100644
index 28e5b6956..000000000
--- a/doc/reference/xml/cairo_set_line_join.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-<refentry id="cairo_set_line_join">
- <refmeta>
- <refentrytitle>cairo_set_line_join</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_line_join</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_set_line_join (<link linkend="cairo_t">cairo_t</link> *cr, cairo_line_join_t line_join)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>line_join</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_line_join</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_line_width.xml b/doc/reference/xml/cairo_set_line_width.xml
deleted file mode 100644
index 033a426c1..000000000
--- a/doc/reference/xml/cairo_set_line_width.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-<refentry id="cairo_set_line_width">
- <refmeta>
- <refentrytitle>cairo_set_line_width</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_line_width</refname>
- <refpurpose>set line width in device units</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_set_line_width (<link linkend="cairo_t">cairo_t</link> *cr, double width)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>width</parameter> :</term>
- <listitem>
- <simpara>width in device units</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_line_width</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_miter_limit.xml b/doc/reference/xml/cairo_set_miter_limit.xml
deleted file mode 100644
index e86c14227..000000000
--- a/doc/reference/xml/cairo_set_miter_limit.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-<refentry id="cairo_set_miter_limit">
- <refmeta>
- <refentrytitle>cairo_set_miter_limit</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_miter_limit</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_set_miter_limit (<link linkend="cairo_t">cairo_t</link> *cr, double limit)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>limit</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_miter_limit</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_operator.xml b/doc/reference/xml/cairo_set_operator.xml
deleted file mode 100644
index 0bde0b1b5..000000000
--- a/doc/reference/xml/cairo_set_operator.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-<refentry id="cairo_set_operator">
- <refmeta>
- <refentrytitle>cairo_set_operator</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_operator</refname>
- <refpurpose>select operator for surface compositing</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_set_operator (<link linkend="cairo_t">cairo_t</link> *cr, <link linkend="cairo_operator_t">cairo_operator_t</link> op)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>op</parameter> :</term>
- <listitem>
- <simpara>the operator for subsequent compositing operations</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_operator</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
-
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_pattern.xml b/doc/reference/xml/cairo_set_pattern.xml
deleted file mode 100644
index 14d0678df..000000000
--- a/doc/reference/xml/cairo_set_pattern.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<refentry id="cairo_set_pattern">
- <refmeta>
- <refentrytitle>cairo_set_pattern</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_pattern</refname>
- <refpurpose>select a surface as fill pattern</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_set_pattern (<link linkend="cairo_t">cairo_t</link> *cr, <link linkend="cairo_surface_t">cairo_surface_t</link> *pattern)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>pattern</parameter> :</term>
- <listitem>
- <simpara>a surface</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_pattern</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- This function selects <varname>pattern</varname> as pattern for fill operations. If the repeat flag is set via <link linkend="cairo_surface_set_repeat">cairo_surface_set_repeat</link>, the pattern will be tiled, otherwise just drawn once.
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_rgb_color.xml b/doc/reference/xml/cairo_set_rgb_color.xml
deleted file mode 100644
index 24db26a63..000000000
--- a/doc/reference/xml/cairo_set_rgb_color.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-
-<refentry id="cairo_set_rgb_color">
- <refmeta>
- <refentrytitle>cairo_set_rgb_color</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_rgb_color</refname>
- <refpurpose>select color for painting operations</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_set_rgb_color (<link linkend="cairo_t">cairo_t</link> *cr, double red, double green, double blue)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>red</parameter> :</term>
- <listitem>
- <simpara>red component</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>green</parameter> :</term>
- <listitem>
- <simpara>green component</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>blue</parameter> :</term>
- <listitem>
- <simpara>blue component</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_rgb_color</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- Set the color for subsequent drawing operations. Values which are not between 0.0 and 1.0 will be changed (e.g. red=2.0 => red=1.0).
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_target_drawable.xml b/doc/reference/xml/cairo_set_target_drawable.xml
deleted file mode 100644
index febabb554..000000000
--- a/doc/reference/xml/cairo_set_target_drawable.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<refentry id="cairo_set_target_drawable">
- <refmeta>
- <refentrytitle>cairo_set_target_drawable</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_target_drawable</refname>
- <refpurpose>set surface for painting operations </refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>void cairo_set_target_drawable (<link linkend="cairo_t">cairo_t</link> *cr, Display *dpy, Drawable drawable);</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dpy</parameter> :</term>
- <listitem>
- <simpara>X Display</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>drawable</parameter> :</term>
- <listitem>
- <simpara>an X onscreen or offscreen drawable</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_target_drawable</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_target_image.xml b/doc/reference/xml/cairo_set_target_image.xml
deleted file mode 100644
index b96a5fbdc..000000000
--- a/doc/reference/xml/cairo_set_target_image.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<refentry id="cairo_set_target_image">
- <refmeta>
- <refentrytitle>cairo_set_target_image</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_target_image</refname>
- <refpurpose>set image for painting operations </refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_set_target_image (<link linkend="cairo_t">cairo_t</link> *cr,char *data, <link linkend="cairo_format_t">cairo_format_t</link> format, int width, int height, int stride)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>data</parameter> :</term>
- <listitem>
- <simpara>pointer to an user-allocated buffer of appropriate size</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>format</parameter> :</term>
- <listitem>
- <simpara>select color-format of image</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>width, height</parameter></term>
- <listitem>
- <simpara>width and height describe the visibles image size.</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>stride</parameter></term>
- <listitem>
- <simpara>stride is the actual with of the image and can be larger than with. It is requiered even if stride is equal to with.</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_target_image</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_target_png.xml b/doc/reference/xml/cairo_set_target_png.xml
deleted file mode 100644
index 8577fa160..000000000
--- a/doc/reference/xml/cairo_set_target_png.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<refentry id="cairo_set_target_png">
- <refmeta>
- <refentrytitle>cairo_set_target_png</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_target_png</refname>
- <refpurpose>set surface for painting operations </refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>void cairo_set_target_png (<link linkend="cairo_t">cairo_t</link> *cr, FILE *file, <link linkend="cairo_format_t">cairo_format_t</link> format, int width, int height);</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>FILE</parameter> :</term>
- <listitem>
- <simpara>an open, writeable file</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter><link linkend="cairo_format_t">cairo_format_t</link></parameter> :</term>
- <listitem>
- <simpara>determines the color-depth of the resulting png image</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>width, height</parameter> :</term>
- <listitem>
- <simpara>sets width and height of resulting png image </simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_target_png</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_target_ps.xml b/doc/reference/xml/cairo_set_target_ps.xml
deleted file mode 100644
index b1211a9d8..000000000
--- a/doc/reference/xml/cairo_set_target_ps.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<refentry id="cairo_set_target_ps">
- <refmeta>
- <refentrytitle>cairo_set_target_ps</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_target_ps</refname>
- <refpurpose>set surface for painting operations </refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_set_target_ps (<link linkend="cairo_t">cairo_t</link> *cr,FILE *file, double width_inches, double height_inches, double x_pixels_per_inch, double y_pixels_per_inch);</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>FILE</parameter> :</term>
- <listitem>
- <simpara>an open, writeable file</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>width_inches, height_inches</parameter> :</term>
- <listitem>
- <simpara>width and height of an output page in inches</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>x_pixels_per_inch, y_pixels_per_inch</parameter> :</term>
- <listitem>
- <simpara>Resolution of the postscript file. Right now cairo dumps an entire image on every page, so this parameters define the resolution of the resulting image.</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_target_ps</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_target_surface.xml b/doc/reference/xml/cairo_set_target_surface.xml
deleted file mode 100644
index 473df3fe9..000000000
--- a/doc/reference/xml/cairo_set_target_surface.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<refentry id="cairo_set_target_surface">
- <refmeta>
- <refentrytitle>cairo_set_target_surface</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_target_surface</refname>
- <refpurpose>set surface for painting operations </refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_set_target_surface (<link linkend="cairo_t">cairo_t</link> *cr, <link linkend="cairo_surface_t">cairo_surface_t</link> *surface)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>surface</parameter> :</term>
- <listitem>
- <simpara>an allocated <link linkend="cairo_surface_t">cairo_surface_t</link></simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_target_surface</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
-Selects <varname>surface</varname> as the surface to draw on. If there already is a surface set, it will be substituted by <varname>surface</varname>. It references <varname>surface</varname>e to ensure that it will be valid at least until another surface was selected or the <link linkend="cairo_t">cairo_t</link> is destroyed.
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_target_xcb.xml b/doc/reference/xml/cairo_set_target_xcb.xml
deleted file mode 100644
index d7bd2b05f..000000000
--- a/doc/reference/xml/cairo_set_target_xcb.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<refentry id="cairo_set_target_xcb">
- <refmeta>
- <refentrytitle>cairo_set_target_xcb</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_target_xcb</refname>
- <refpurpose>set surface for painting operations </refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>void
-cairo_set_target_xcb (<link linkend="cairo_t">cairo_t</link> *cr, XCBConnection *dpy, DRAWABLE drawable, VISUALTYPE *visual, <link linkend="cairo_format_t">cairo_format_t</link> format);</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dpy</parameter> :</term>
- <listitem>
- <simpara>...</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>drawable</parameter> :</term>
- <listitem>
- <simpara>an X onscreen or offscreen drawable</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>visual</parameter> :</term>
- <listitem>
- <simpara>...</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>format</parameter> :</term>
- <listitem>
- <simpara>...</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_target_xcb</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_set_tolerance.xml b/doc/reference/xml/cairo_set_tolerance.xml
deleted file mode 100644
index 2ab257c0a..000000000
--- a/doc/reference/xml/cairo_set_tolerance.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<refentry id="cairo_set_tolerance">
- <refmeta>
- <refentrytitle>cairo_set_tolerance</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_set_tolerance</refname>
- <refpurpose>set accuracy of painting operations</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_set_tolerance (<link linkend="cairo_t">cairo_t</link> *cr, double tolerance)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>tolerance</parameter> :</term>
- <listitem>
- <simpara>the accuracy in device pixels</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_set_tolerance</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- This function adjusts the error tolerance for tesselating curved objects. The default value is 0.1 (device pixels). This function can be used to trade speed against accuracy.
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_show_glyphs.xml b/doc/reference/xml/cairo_show_glyphs.xml
deleted file mode 100644
index aab0de1de..000000000
--- a/doc/reference/xml/cairo_show_glyphs.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<refentry id="cairo_show_glyphs">
- <refmeta>
- <refentrytitle>cairo_show_glyphs</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_show_glyphs</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_show_glyphs (<link linkend="cairo_t">cairo_t</link> *cr, cairo_glyph_t *glyphs, int num_glyphs);</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>glyphs</parameter> :</term>
- <listitem>
- <simpara></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>num_glyphs</parameter> :</term>
- <listitem>
- <simpara></simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_show_glyphs</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_show_text.xml b/doc/reference/xml/cairo_show_text.xml
deleted file mode 100644
index db16c9704..000000000
--- a/doc/reference/xml/cairo_show_text.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-<refentry id="cairo_show_text">
- <refmeta>
- <refentrytitle>cairo_show_text</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_show_text</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_show_text (<link linkend="cairo_t">cairo_t</link> *cr, const unsigned char *utf8)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>utf8</parameter> :</term>
- <listitem>
- <simpara>text to show</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_show_text</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_status.xml b/doc/reference/xml/cairo_status.xml
deleted file mode 100644
index bb5b890e5..000000000
--- a/doc/reference/xml/cairo_status.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_status">
- <refmeta>
- <refentrytitle>cairo_status</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_status</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_status_t cairo_status (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_status</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_status_string.xml b/doc/reference/xml/cairo_status_string.xml
deleted file mode 100644
index 17e6efeef..000000000
--- a/doc/reference/xml/cairo_status_string.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_status_string">
- <refmeta>
- <refentrytitle>cairo_status_string</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_status_string</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-const char * cairo_status_string (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_status_string</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_stroke.xml b/doc/reference/xml/cairo_stroke.xml
deleted file mode 100644
index 0d9e270c0..000000000
--- a/doc/reference/xml/cairo_stroke.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_stroke">
- <refmeta>
- <refentrytitle>cairo_stroke</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_stroke</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_stroke (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_stroke</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_stroke_path.xml b/doc/reference/xml/cairo_stroke_path.xml
deleted file mode 100644
index 1003b1d0c..000000000
--- a/doc/reference/xml/cairo_stroke_path.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_stroke_path">
- <refmeta>
- <refentrytitle>cairo_stroke_path</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_stroke_path</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_stroke_path (<link linkend="cairo_t">cairo_t</link> *cr)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_stroke_path</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_surface_clip_restore.xml b/doc/reference/xml/cairo_surface_clip_restore.xml
deleted file mode 100644
index eb5b4d8e1..000000000
--- a/doc/reference/xml/cairo_surface_clip_restore.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_surface_clip_restore">
- <refmeta>
- <refentrytitle>cairo_surface_clip_restore</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_surface_clip_restore</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_status_t cairo_surface_clip_restore (<link linkend="cairo_surface_t">cairo_surface_t</link> *surface)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>surface</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_surface_clip_restore</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_surface_destroy.xml b/doc/reference/xml/cairo_surface_destroy.xml
deleted file mode 100644
index 4d788f2fd..000000000
--- a/doc/reference/xml/cairo_surface_destroy.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_surface_destroy">
- <refmeta>
- <refentrytitle>cairo_surface_destroy</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_surface_destroy</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_surface_destroy (<link linkend="cairo_surface_t">cairo_surface_t</link> *surface)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>surface</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_surface_destroy</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_surface_get_matrix.xml b/doc/reference/xml/cairo_surface_get_matrix.xml
deleted file mode 100644
index 6a8dd4cc0..000000000
--- a/doc/reference/xml/cairo_surface_get_matrix.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-<refentry id="cairo_surface_get_matrix">
- <refmeta>
- <refentrytitle>cairo_surface_get_matrix</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_surface_get_matrix</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_status_t cairo_surface_get_matrix (<link linkend="cairo_surface_t">cairo_surface_t</link> *surface, <link linkend="cairo_matrix_t">cairo_matrix_t</link> *matrix)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>surface</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>matrix</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_surface_get_matrix</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_surface_reference.xml b/doc/reference/xml/cairo_surface_reference.xml
deleted file mode 100644
index 1767830d9..000000000
--- a/doc/reference/xml/cairo_surface_reference.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-<refentry id="cairo_surface_reference">
- <refmeta>
- <refentrytitle>cairo_surface_reference</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_surface_reference</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_surface_reference (<link linkend="cairo_surface_t">cairo_surface_t</link> *surface)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>surface</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_surface_reference</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_surface_set_filter.xml b/doc/reference/xml/cairo_surface_set_filter.xml
deleted file mode 100644
index 399cca19b..000000000
--- a/doc/reference/xml/cairo_surface_set_filter.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-<refentry id="cairo_surface_set_filter">
- <refmeta>
- <refentrytitle>cairo_surface_set_filter</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_surface_set_filter</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_status_t cairo_surface_set_filter (<link linkend="cairo_surface_t">cairo_surface_t</link> *surface, cairo_filter_t filter)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>surface</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>filter</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_surface_set_filter</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_surface_set_matrix.xml b/doc/reference/xml/cairo_surface_set_matrix.xml
deleted file mode 100644
index 83e466a4b..000000000
--- a/doc/reference/xml/cairo_surface_set_matrix.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-<refentry id="cairo_surface_set_matrix">
- <refmeta>
- <refentrytitle>cairo_surface_set_matrix</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_surface_set_matrix</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_status_t cairo_surface_set_matrix (<link linkend="cairo_surface_t">cairo_surface_t</link> *surface, <link linkend="cairo_matrix_t">cairo_matrix_t</link> *matrix)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>surface</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>matrix</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_surface_set_matrix</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_surface_set_repeat.xml b/doc/reference/xml/cairo_surface_set_repeat.xml
deleted file mode 100644
index d64be4795..000000000
--- a/doc/reference/xml/cairo_surface_set_repeat.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-<refentry id="cairo_surface_set_repeat">
- <refmeta>
- <refentrytitle>cairo_surface_set_repeat</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_surface_set_repeat</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-cairo_status_t cairo_surface_set_repeat (<link linkend="cairo_surface_t">cairo_surface_t</link> *surface, int repeat)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>surface</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>repeat</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_surface_set_repeat</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_surface_t.xml b/doc/reference/xml/cairo_surface_t.xml
deleted file mode 100644
index aa5b9d80e..000000000
--- a/doc/reference/xml/cairo_surface_t.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-<refentry id="cairo_surface_t">
- <refmeta>
- <refentrytitle>cairo_surface_t</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_surface_t</refname>
- <refpurpose>surface to draw on</refpurpose>
- </refnamediv>
- <refsect1>
- <title>Description</title>
- <para><indexterm><primary>types</primary><secondary>cairo_surface_t</secondary></indexterm><indexterm><primary/></indexterm>
- A <varname>cairo_surface_t</varname> is a high level wrapper for varoius surface. So far the surface can be a bitmap or a memory image. It also contains information about the width and height, repeating information (in case it is used as a pattern: <link linkend="cairo_surface_set_repeat">cairo_surface_set_repeat</link>), the quality for rescaling (<link linkend="cairo_surface_set_filter">cairo_surface_set_filter</link>), and transformations. Surfaces support reference counting via <link linkend="cairo_surface_reference">cairo_surface_reference</link> and <link linkend="cairo_surface_destroy">cairo_surface_destroy</link>.
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_t.xml b/doc/reference/xml/cairo_t.xml
deleted file mode 100644
index 5adb628a5..000000000
--- a/doc/reference/xml/cairo_t.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-<refentry id="cairo_t">
- <refmeta>
- <refentrytitle>cairo_t</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_t</refname>
- <refpurpose>holds the current state</refpurpose>
- </refnamediv>
- <refsect1>
- <title>Description</title>
- <para><indexterm><primary>types</primary><secondary>cairo_t</secondary></indexterm><indexterm><primary/></indexterm>
- A <varname>cairo_t</varname> contains the current state of the rendering device,
- including coordinates of yet to be drawn shapes.
- <varname>cairo_t</varname>'s can be pushed to a stack via
- <link linkend="cairo_save">cairo_save</link>.
- They may then savely be changed, without loosing the current state.
- Use <link linkend="cairo_restore">cairo_restore</link> to
- restore to the saved state.
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_text_extents.xml b/doc/reference/xml/cairo_text_extents.xml
deleted file mode 100644
index fcb359304..000000000
--- a/doc/reference/xml/cairo_text_extents.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_text_extents">
- <refmeta>
- <refentrytitle>cairo_text_extents</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_text_extents</refname>
- <refpurpose>determine extents of a utf8 string</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>void cairo_text_extents (<link linkend="cairo_t">cairo_t</link> *ct, const unsigned char *utf8, <link linkend="cairo_text_extents_t">cairo_text_extents_t</link> *extents);</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_t">cairo_t</link></simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>utf8</parameter> :</term>
- <listitem>
- <simpara>utf8 encoded string</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>extents</parameter> :</term>
- <listitem>
- <simpara>a <link linkend="cairo_text_extents_t">cairo_text_extents_t</link> structure</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_text_extents</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
-
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_text_extents_t.xml b/doc/reference/xml/cairo_text_extents_t.xml
deleted file mode 100644
index 80e8534d5..000000000
--- a/doc/reference/xml/cairo_text_extents_t.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-<refentry id="cairo_text_extents_t">
- <refmeta>
- <refentrytitle>cairo_text_extents_t</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_text_extents_t</refname>
- <refpurpose>struct to store extents of a string</refpurpose>
- </refnamediv>
- <refsect1>
- <title>Description</title>
- <para><indexterm><primary>types</primary><secondary>cairo_text_extents_t</secondary></indexterm><indexterm><primary/></indexterm>
- <programlisting>
- typedef struct {
- double x_bearing;
- double y_bearing;
- double width;
- double height;
- double x_advance;
- double y_advance;
- } cairo_text_extents_t;
- </programlisting>
- </para>
- <para>
- XXX. not sure what the status is right know.
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_transform_distance.xml b/doc/reference/xml/cairo_transform_distance.xml
deleted file mode 100644
index 5f348f5fb..000000000
--- a/doc/reference/xml/cairo_transform_distance.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_transform_distance">
- <refmeta>
- <refentrytitle>cairo_transform_distance</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_transform_distance</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_transform_distance (<link linkend="cairo_t">cairo_t</link> *cr, double *dx, double *dy)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dx</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>dy</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_transform_distance</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_transform_font.xml b/doc/reference/xml/cairo_transform_font.xml
deleted file mode 100644
index d348d9b54..000000000
--- a/doc/reference/xml/cairo_transform_font.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-<refentry id="cairo_transform_font">
- <refmeta>
- <refentrytitle>cairo_transform_font</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_transform_font</refname>
- <refpurpose>set transformation matrix for individual glyphs</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
- void cairo_transform_font (<link linkend="cairo_t">cairo_t</link> *cr, <link linkend="cairo_matrix_t">cairo_matrix_t</link> *matrix);</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>matrix</parameter> :</term>
- <listitem>
- <simpara>an affine transformation matrix</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_transform_font</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_transform_point.xml b/doc/reference/xml/cairo_transform_point.xml
deleted file mode 100644
index 3c369696f..000000000
--- a/doc/reference/xml/cairo_transform_point.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_transform_point">
- <refmeta>
- <refentrytitle>cairo_transform_point</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_transform_point</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_transform_point (<link linkend="cairo_t">cairo_t</link> *cr, double *x, double *y)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>x</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>y</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_transform_point</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/cairo_translate.xml b/doc/reference/xml/cairo_translate.xml
deleted file mode 100644
index cb8c54c43..000000000
--- a/doc/reference/xml/cairo_translate.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<refentry id="cairo_translate">
- <refmeta>
- <refentrytitle>cairo_translate</refentrytitle>
- <manvolnum>3</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>cairo_translate</refname>
- <refpurpose>some description</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <programlisting>
-void cairo_translate (<link linkend="cairo_t">cairo_t</link> *cr, double tx, double ty)</programlisting>
- <variablelist role="params">
- <varlistentry>
- <term><parameter>cr</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>tx</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>ty</parameter> :</term>
- <listitem>
- <simpara>description</simpara>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- <indexterm>
- <primary>functions</primary>
- <secondary>cairo_translate</secondary>
- </indexterm>
- <indexterm>
- <primary/>
- </indexterm>
- </para>
- </refsect1>
-</refentry>
diff --git a/doc/reference/xml/skeleton.xml b/doc/reference/xml/skeleton.xml
deleted file mode 100644
index 66a1923b7..000000000
--- a/doc/reference/xml/skeleton.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<refentry id="##function##">
-
-<refnamediv>
-<refname><link linkend="##function##">##function##</link></refname>
-<refpurpose></refpurpose>
-</refnamediv>
-
-<refsynopsisdiv>
-<funcsynopsis>
-<funcsynopsisinfo>
-#include &lt;cairo.h&gt;
-</funcsynopsisinfo>
-<funcprototype>
- <funcdef><link linkend="cairo_t">cairo_t</link> *<function><link linkend="##function##">##function##</link></function></funcdef>
- <paramdef>
- </paramdef>
-</funcprototype>
-</funcsynopsis>
-</refsynopsisdiv>
-
-<refsect1><title>Description</title>
-<para>
-<indexterm><primary>functions</primary>
- <secondary></secondary></indexterm>
-<indexterm><primary></primary></indexterm>
-
-<function><link linkend="##function##">##function##</link></function>
-</para>
-</refsect1>
-</refentry>
diff --git a/gtk-doc.make b/gtk-doc.make
new file mode 100644
index 000000000..18c60c2d7
--- /dev/null
+++ b/gtk-doc.make
@@ -0,0 +1,163 @@
+#
+# *** NOTE *** this file is checked into CVS for convenience only.
+# DO NOT EDIT. Rather get changes into upstream gtk-doc and then
+# update this version from the gtk-doc version.
+#
+
+# -*- mode: makefile -*-
+
+####################################
+# Everything below here is generic #
+####################################
+
+if GTK_DOC_USE_LIBTOOL
+GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS)
+else
+GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS)
+endif
+
+# We set GPATH here; this gives us semantics for GNU make
+# which are more like other make's VPATH, when it comes to
+# whether a source that is a target of one rule is then
+# searched for in VPATH/GPATH.
+#
+GPATH = $(srcdir)
+
+TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
+
+EXTRA_DIST = \
+ $(content_files) \
+ $(HTML_IMAGES) \
+ $(DOC_MAIN_SGML_FILE) \
+ $(DOC_MODULE).types \
+ $(DOC_MODULE)-sections.txt \
+ $(DOC_MODULE)-overrides.txt
+
+DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
+ $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
+
+SCANOBJ_FILES = \
+ $(DOC_MODULE).args \
+ $(DOC_MODULE).hierarchy \
+ $(DOC_MODULE).interfaces \
+ $(DOC_MODULE).prerequisites \
+ $(DOC_MODULE).signals
+
+CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
+
+if ENABLE_GTK_DOC
+all-local: html-build.stamp
+
+#### scan ####
+
+scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
+ @echo '*** Scanning header files ***'
+ @-chmod -R u+w $(srcdir)
+ if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null ; then \
+ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
+ else \
+ cd $(srcdir) ; \
+ for i in $(SCANOBJ_FILES) ; do \
+ test -f $$i || touch $$i ; \
+ done \
+ fi
+ cd $(srcdir) && \
+ gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
+ touch scan-build.stamp
+
+$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
+ @true
+
+#### templates ####
+
+tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
+ @echo '*** Rebuilding template files ***'
+ @-chmod -R u+w $(srcdir)
+ cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
+ touch tmpl-build.stamp
+
+tmpl.stamp: tmpl-build.stamp
+ @true
+
+#### xml ####
+
+sgml-build.stamp: tmpl.stamp $(CFILE_GLOB) $(srcdir)/tmpl/*.sgml
+ @echo '*** Building XML ***'
+ @-chmod -R u+w $(srcdir)
+ cd $(srcdir) && \
+ gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml $(MKDB_OPTIONS)
+ touch sgml-build.stamp
+
+sgml.stamp: sgml-build.stamp
+ @true
+
+#### html ####
+
+html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
+ @echo '*** Building HTML ***'
+ @-chmod -R u+w $(srcdir)
+ rm -rf $(srcdir)/html
+ mkdir $(srcdir)/html
+ cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
+ test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
+ @echo '-- Fixing Crossreferences'
+ cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
+ touch html-build.stamp
+else
+all-local:
+endif
+
+##############
+
+clean-local:
+ rm -f *~ *.bak
+ rm -rf .libs
+
+maintainer-clean-local: clean
+ cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+
+install-data-local:
+ installfiles=`echo $(srcdir)/html/*`; \
+ if test "$$installfiles" = '$(srcdir)/html/*'; \
+ then echo '-- Nothing to install' ; \
+ else \
+ $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \
+ for i in $$installfiles; do \
+ echo '-- Installing '$$i ; \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
+ done; \
+ echo '-- Installing $(srcdir)/html/index.sgml' ; \
+ $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \
+ fi
+
+uninstall-local:
+ rm -f $(DESTDIR)$(TARGET_DIR)/*
+
+#
+# Require gtk-doc when making dist
+#
+if ENABLE_GTK_DOC
+dist-check-gtkdoc:
+else
+dist-check-gtkdoc:
+ @echo "*** gtk-doc must be installed and enabled in order to make dist"
+ @false
+endif
+
+# XXX: Before this was:
+# dist-hook: dist-check-gtkdoc dist-hook-local
+# which seems reasonable, but for some reason the dist-check-gtkdoc
+# was always failing on me, even though I do have gtk-doc installed
+# and it is successfully building the documentation.
+
+dist-hook: dist-hook-local
+ mkdir $(distdir)/tmpl
+ mkdir $(distdir)/xml
+ mkdir $(distdir)/html
+ -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
+ -cp $(srcdir)/xml/*.xml $(distdir)/xml
+ -cp $(srcdir)/html/* $(distdir)/html
+
+.PHONY : dist-hook-local
diff --git a/src/Makefile.am b/src/Makefile.am
index d4155e817..3f76d2726 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,53 +1,56 @@
-cairoincludedir = $(includedir)/cairo
-cairoinclude_HEADERS = \
- cairo.h \
- cairo-atsui.h \
- cairo-features.h\
- cairo-ft.h \
- cairo-glitz.h \
- cairo-pdf.h \
- cairo-png.h \
- cairo-ps.h \
- cairo-quartz.h \
- cairo-xcb.h \
- cairo-xlib.h
-
-lib_LTLIBRARIES = libcairo.la
if CAIRO_HAS_PS_SURFACE
-libcairo_ps_sources = cairo_ps_surface.c cairo-ps.h
+libcairo_ps_headers = cairo-ps.h
+libcairo_ps_sources = cairo_ps_surface.c
endif
if CAIRO_HAS_PDF_SURFACE
-libcairo_pdf_sources = cairo_pdf_surface.c cairo-pdf.h
+libcairo_pdf_headers = cairo-pdf.h
+libcairo_pdf_sources = cairo_pdf_surface.c
endif
if CAIRO_HAS_PNG_SURFACE
-libcairo_png_sources = cairo_png_surface.c cairo-png.h
+libcairo_png_headers = cairo-png.h
+libcairo_png_sources = cairo_png_surface.c
endif
if CAIRO_HAS_XLIB_SURFACE
-libcairo_xlib_sources = cairo_xlib_surface.c cairo-xlib.h
+libcairo_xlib_headers = cairo-xlib.h
+libcairo_xlib_sources = cairo_xlib_surface.c
endif
if CAIRO_HAS_QUARTZ_SURFACE
-libcairo_quartz_sources = cairo_quartz_surface.c cairo-quartz.h
+libcairo_quartz_headers = cairo-quartz.h
+libcairo_quartz_sources = cairo_quartz_surface.c
endif
if CAIRO_HAS_XCB_SURFACE
-libcairo_xcb_sources = cairo_xcb_surface.c cairo-xcb.h
+libcairo_xcb_headers = cairo-xcb.h
+libcairo_xcb_sources = cairo_xcb_surface.c
+endif
+
+libcairo_win32_sources =
+if CAIRO_HAS_WIN32_SURFACE
+libcairo_win32_headers = cairo-win32.h
+libcairo_win32_sources += cairo_win32_surface.c cairo-win32-private.h
+endif
+if CAIRO_HAS_WIN32_FONT
+libcairo_win32_sources += cairo_win32_font.c
endif
if CAIRO_HAS_GLITZ_SURFACE
-libcairo_glitz_sources = cairo_glitz_surface.c cairo-glitz.h
+libcairo_glitz_headers = cairo-glitz.h
+libcairo_glitz_sources = cairo_glitz_surface.c
endif
if CAIRO_HAS_ATSUI_FONT
-libcairo_atsui_sources = cairo_atsui_font.c cairo-atsui.h
+libcairo_atsui_headers = cairo-atsui.h
+libcairo_atsui_sources = cairo_atsui_font.c
endif
if CAIRO_HAS_FT_FONT
-libcairo_ft_sources = cairo_ft_font.c cairo-ft.h
+libcairo_ft_headers = cairo-ft.h
+libcairo_ft_sources = cairo_ft_font.c cairo-ft-private.h
endif
# These names match automake style variable definition conventions so
@@ -57,6 +60,23 @@ endif
FONTCONFIG_LIBS=@FONTCONFIG_LIBS@
XRENDER_LIBS=@XRENDER_LIBS@
+cairoincludedir = $(includedir)/cairo
+cairoinclude_HEADERS = \
+ cairo.h \
+ cairo-features.h \
+ $(libcairo_atsui_headers) \
+ $(libcairo_ft_headers) \
+ $(libcairo_glitz_headers) \
+ $(libcairo_pdf_headers) \
+ $(libcairo_png_headers) \
+ $(libcairo_ps_headers) \
+ $(libcairo_quartz_headers) \
+ $(libcairo_win32_headers) \
+ $(libcairo_xcb_headers) \
+ $(libcairo_xlib_headers)
+
+lib_LTLIBRARIES = libcairo.la
+
libcairo_la_SOURCES = \
cairo.c \
cairo.h \
@@ -80,6 +100,7 @@ libcairo_la_SOURCES = \
cairo_surface.c \
cairo_traps.c \
cairo_pattern.c \
+ cairo_unicode.c \
cairo_wideint.c \
cairo-wideint.h \
$(libcairo_atsui_sources)\
@@ -91,6 +112,8 @@ libcairo_la_SOURCES = \
$(libcairo_quartz_sources)\
$(libcairo_xcb_sources) \
$(libcairo_glitz_sources)\
+ $(libcairo_win32_sources)\
+ $(libcairo_freetype_sources) \
cairoint.h
libcairo_la_LDFLAGS = -version-info @VERSION_INFO@ -no-undefined
@@ -98,3 +121,13 @@ libcairo_la_LDFLAGS = -version-info @VERSION_INFO@ -no-undefined
INCLUDES = -I$(srcdir) $(CAIRO_CFLAGS)
libcairo_la_LIBADD = $(CAIRO_LIBS)
+
+install-data-local:
+ @if test -f $(includedir)/cairo.h || test -f $(includedir)/cairo-features.h ; then \
+ echo "****************************************************************" ; \
+ echo "*** Error: Old headers found. You should remove the following" ; \
+ echo "*** files and then type 'make install' again." ; \
+ ls $(includedir)/cairo*.h ; \
+ echo "****************************************************************" ; \
+ false ; \
+ fi
diff --git a/src/cairo-atsui-font.c b/src/cairo-atsui-font.c
index 52cfc6bd8..cb4b1c5d7 100644
--- a/src/cairo-atsui-font.c
+++ b/src/cairo-atsui-font.c
@@ -1,6 +1,6 @@
/* cairo - a vector graphics library with display and print output
*
- * Copyright 2004 Calum Robinson
+ * Copyright © 2004 Calum Robinson
*
* This library is free software; you can redistribute it and/or
* modify it either under the terms of the GNU Lesser General Public
diff --git a/src/cairo-atsui.h b/src/cairo-atsui.h
index 94b30432a..a5b7308f8 100644
--- a/src/cairo-atsui.h
+++ b/src/cairo-atsui.h
@@ -1,6 +1,6 @@
/* cairo - a vector graphics library with display and print output
*
- * Copyright 2004 Calum Robinson
+ * Copyright © 2004 Calum Robinson
*
* This library is free software; you can redistribute it and/or
* modify it either under the terms of the GNU Lesser General Public
@@ -33,18 +33,23 @@
* Calum Robinson <calumr@mac.com>
*/
-#include <cairo.h>
-
#ifndef CAIRO_ATSUI_H
#define CAIRO_ATSUI_H
+
+#include <cairo.h>
+
#ifdef CAIRO_HAS_ATSUI_FONT
/* ATSUI platform-specific font interface */
#include <Carbon/Carbon.h>
+CAIRO_BEGIN_DECLS
+
cairo_font_t *
cairo_atsui_font_create(ATSUStyle style);
+CAIRO_END_DECLS
+
#endif /* CAIRO_HAS_ATSUI_FONT */
#endif /* CAIRO_ATSUI_H */
diff --git a/src/cairo-cache.c b/src/cairo-cache.c
index b097b609b..d1ad5a4e2 100644
--- a/src/cairo-cache.c
+++ b/src/cairo-cache.c
@@ -94,9 +94,9 @@ static const cairo_cache_arrangement_t cache_arrangements [] = {
* a mostly-dead table.
*
* Generally you do not need to worry about freeing cache entries; the
- * cache will expire entries randomly as it experiences memory pressure.
- * There is currently no explicit entry-removing call, though one can be
- * added easily.
+ * cache will expire entries randomly as it experiences memory pressure.
+ * If max_memory is set, entries are not expired, and must be explicitely
+ * removed.
*
* This table is open-addressed with double hashing. Each table size is a
* prime chosen to be a little more than double the high water mark for a
@@ -282,17 +282,51 @@ _load_factor (cairo_cache_t *cache)
}
#endif
-static unsigned long
-_random_live_entry (cairo_cache_t *cache)
-{
- unsigned long idx;
- assert(cache != NULL);
- do {
- idx = rand () % cache->arrangement->size;
- } while (! LIVE_ENTRY_P(cache, idx));
- return idx;
-}
+/* Find a random in the cache matching the given predicate. We use the
+ * same algorithm as the probing algorithm to walk over the entries in
+ * the hash table in a pseudo-random order. Walking linearly would
+ * favor entries following gaps in the hash table. We could also
+ * call rand() repeatedly, which works well for almost-full tables,
+ * but degrades when the table is almost empty, or predicate
+ * returns false for most entries.
+ */
+static cairo_cache_entry_base_t **
+_random_entry (cairo_cache_t *cache,
+ int (*predicate)(void*))
+{
+ cairo_cache_entry_base_t **probe;
+ unsigned long hash;
+ unsigned long table_size, i, idx, step;
+
+ _cache_sane_state (cache);
+
+ table_size = cache->arrangement->size;
+ hash = rand ();
+ idx = hash % table_size;
+ step = 0;
+
+ for (i = 0; i < table_size; ++i)
+ {
+ assert(idx < table_size);
+ probe = cache->entries + idx;
+ if (LIVE_ENTRY_P(cache, idx)
+ && (!predicate || predicate (*probe)))
+ return probe;
+
+ if (step == 0) {
+ step = hash % cache->arrangement->rehash;
+ if (step == 0)
+ step = 1;
+ }
+
+ idx += step;
+ if (idx >= table_size)
+ idx -= table_size;
+ }
+
+ return NULL;
+}
/* public API follows */
@@ -356,8 +390,9 @@ _cairo_cache_destroy (cairo_cache_t *cache)
cairo_status_t
_cairo_cache_lookup (cairo_cache_t *cache,
- void *key,
- void **entry_return)
+ void *key,
+ void **entry_return,
+ int *created_entry)
{
unsigned long idx;
@@ -392,6 +427,8 @@ _cairo_cache_lookup (cairo_cache_t *cache,
cache->hits++;
#endif
*entry_return = *slot;
+ if (created_entry)
+ *created_entry = 0;
return status;
}
@@ -401,19 +438,18 @@ _cairo_cache_lookup (cairo_cache_t *cache,
/* Build the new entry. */
status = cache->backend->create_entry (cache, key,
- entry_return);
+ (void **)&new_entry);
if (status != CAIRO_STATUS_SUCCESS)
return status;
- new_entry = (cairo_cache_entry_base_t *) (*entry_return);
-
/* Store the hash value in case the backend forgot. */
new_entry->hashcode = cache->backend->hash (cache, key);
/* Make some entries die if we're under memory pressure. */
while (cache->live_entries > 0 &&
+ cache->max_memory > 0 &&
((cache->max_memory - cache->used_memory) < new_entry->memory)) {
- idx = _random_live_entry (cache);
+ idx = _random_entry (cache, NULL) - cache->entries;
assert (idx < cache->arrangement->size);
_entry_destroy (cache, idx);
}
@@ -425,7 +461,6 @@ _cairo_cache_lookup (cairo_cache_t *cache,
status = _resize_cache (cache, cache->live_entries + 1);
if (status != CAIRO_STATUS_SUCCESS) {
cache->backend->destroy_entry (cache, new_entry);
- *entry_return = NULL;
return status;
}
@@ -439,9 +474,38 @@ _cairo_cache_lookup (cairo_cache_t *cache,
_cache_sane_state (cache);
+ *entry_return = new_entry;
+ if (created_entry)
+ *created_entry = 1;
+
return status;
}
+cairo_status_t
+_cairo_cache_remove (cairo_cache_t *cache,
+ void *key)
+{
+ cairo_cache_entry_base_t **slot;
+
+ _cache_sane_state (cache);
+
+ /* See if we have an entry in the table already. */
+ slot = _find_exact_live_entry_for (cache, key);
+ if (slot != NULL)
+ _entry_destroy (cache, slot - cache->entries);
+
+ return CAIRO_STATUS_SUCCESS;
+}
+
+void *
+_cairo_cache_random_entry (cairo_cache_t *cache,
+ int (*predicate)(void*))
+{
+ cairo_cache_entry_base_t **slot = _random_entry (cache, predicate);
+
+ return slot ? *slot : NULL;
+}
+
unsigned long
_cairo_hash_string (const char *c)
{
diff --git a/src/cairo-color.c b/src/cairo-color.c
index 899b1e3d5..f203d96cc 100644
--- a/src/cairo-color.c
+++ b/src/cairo-color.c
@@ -31,7 +31,7 @@
* California.
*
* Contributor(s):
- * Carl D. Worth <cworth@isi.edu>
+ * Carl D. Worth <cworth@cworth.org>
*/
#include "cairoint.h"
@@ -67,7 +67,8 @@ _cairo_color_set_rgb (cairo_color_t *color, double red, double green, double blu
}
void
-_cairo_color_get_rgb (cairo_color_t *color, double *red, double *green, double *blue)
+_cairo_color_get_rgb (const cairo_color_t *color,
+ double *red, double *green, double *blue)
{
if (red)
*red = color->red;
diff --git a/src/cairo-features.h.in b/src/cairo-features.h.in
index e2a62ba66..a13250d97 100644
--- a/src/cairo-features.h.in
+++ b/src/cairo-features.h.in
@@ -31,7 +31,7 @@
* California.
*
* Contributor(s):
- * Carl Worth <cworth@east.isi.edu>
+ * Carl D. Worth <cworth@cworth.org>
*/
#ifndef CAIRO_FEATURES_H
@@ -49,10 +49,14 @@
#define @XCB_SURFACE_FEATURE@
+#define @WIN32_SURFACE_FEATURE@
+
#define @GLITZ_SURFACE_FEATURE@
#define @FT_FONT_FEATURE@
+#define @WIN32_FONT_FEATURE@
+
#define @ATSUI_FONT_FEATURE@
#define @SANITY_CHECKING_FEATURE@
diff --git a/src/cairo-fixed.c b/src/cairo-fixed.c
index ee31718ef..a4faa1708 100644
--- a/src/cairo-fixed.c
+++ b/src/cairo-fixed.c
@@ -31,7 +31,7 @@
* California.
*
* Contributor(s):
- * Carl D. Worth <cworth@isi.edu>
+ * Carl D. Worth <cworth@cworth.org>
*/
#include "cairoint.h"
diff --git a/src/cairo-font.c b/src/cairo-font.c
index f5fc0e981..529c1c7c3 100644
--- a/src/cairo-font.c
+++ b/src/cairo-font.c
@@ -1,6 +1,7 @@
/* cairo - a vector graphics library with display and print output
*
* Copyright © 2002 University of Southern California
+ * Copyright © 2005 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it either under the terms of the GNU Lesser General Public
@@ -31,293 +32,129 @@
* California.
*
* Contributor(s):
- * Carl D. Worth <cworth@isi.edu>
+ * Carl D. Worth <cworth@cworth.org>
+ * Graydon Hoare <graydon@redhat.com>
+ * Owen Taylor <otaylor@redhat.com>
*/
#include "cairoint.h"
-/* First we implement a global font cache for named fonts. */
-
-typedef struct {
- cairo_cache_entry_base_t base;
- const char *family;
- cairo_font_slant_t slant;
- cairo_font_weight_t weight;
-} cairo_font_cache_key_t;
-
-typedef struct {
- cairo_font_cache_key_t key;
- cairo_unscaled_font_t *unscaled;
-} cairo_font_cache_entry_t;
-
-static unsigned long
-_font_cache_hash (void *cache, void *key)
-{
- unsigned long hash;
- cairo_font_cache_key_t *in;
- in = (cairo_font_cache_key_t *) key;
-
- /* 1607 and 1451 are just a couple random primes. */
- hash = _cairo_hash_string (in->family);
- hash += ((unsigned long) in->slant) * 1607;
- hash += ((unsigned long) in->weight) * 1451;
- return hash;
-}
-
-
-static int
-_font_cache_keys_equal (void *cache,
- void *k1,
- void *k2)
-{
- cairo_font_cache_key_t *a, *b;
- a = (cairo_font_cache_key_t *) k1;
- b = (cairo_font_cache_key_t *) k2;
-
- return (strcmp (a->family, b->family) == 0)
- && (a->weight == b->weight)
- && (a->slant == b->slant);
-}
-
-
-static cairo_status_t
-_font_cache_create_entry (void *cache,
- void *key,
- void **return_value)
-{
- const cairo_font_backend_t *backend = CAIRO_FONT_BACKEND_DEFAULT;
- cairo_font_cache_key_t *k;
- cairo_font_cache_entry_t *entry;
- k = (cairo_font_cache_key_t *) key;
-
- /* XXX: The current freetype backend may return NULL, (for example
- * if no fonts are installed), but I would like to guarantee that
- * the toy API always returns at least *some* font, so I would
- * like to build in some sort fo font here, (even a really lame,
- * ugly one if necessary). */
-
- entry = malloc (sizeof (cairo_font_cache_entry_t));
- if (entry == NULL)
- goto FAIL;
-
- entry->key.slant = k->slant;
- entry->key.weight = k->weight;
- entry->key.family = strdup(k->family);
- if (entry->key.family == NULL)
- goto FREE_ENTRY;
-
- entry->unscaled = backend->create (k->family, k->slant, k->weight);
- if (entry->unscaled == NULL)
- goto FREE_FAMILY;
-
- /* Not sure how to measure backend font mem; use a simple count for now.*/
- entry->key.base.memory = 1;
- *return_value = entry;
- return CAIRO_STATUS_SUCCESS;
-
- FREE_FAMILY:
- free ((void *) entry->key.family);
-
- FREE_ENTRY:
- free (entry);
-
- FAIL:
- return CAIRO_STATUS_NO_MEMORY;
-}
-
-static void
-_font_cache_destroy_entry (void *cache,
- void *entry)
-{
- cairo_font_cache_entry_t *e;
-
- e = (cairo_font_cache_entry_t *) entry;
- _cairo_unscaled_font_destroy (e->unscaled);
- free ((void *) e->key.family);
- free (e);
-}
-
-static void
-_font_cache_destroy_cache (void *cache)
-{
- free (cache);
-}
-
-static const cairo_cache_backend_t cairo_font_cache_backend = {
- _font_cache_hash,
- _font_cache_keys_equal,
- _font_cache_create_entry,
- _font_cache_destroy_entry,
- _font_cache_destroy_cache
-};
-
-static void
-_lock_global_font_cache (void)
-{
- /* FIXME: implement locking. */
-}
-
-static void
-_unlock_global_font_cache (void)
-{
- /* FIXME: implement locking. */
-}
-
-static cairo_cache_t *
-_global_font_cache = NULL;
-
-static cairo_cache_t *
-_get_global_font_cache (void)
-{
- if (_global_font_cache == NULL) {
- _global_font_cache = malloc (sizeof (cairo_cache_t));
-
- if (_global_font_cache == NULL)
- goto FAIL;
-
- if (_cairo_cache_init (_global_font_cache,
- &cairo_font_cache_backend,
- CAIRO_FONT_CACHE_NUM_FONTS_DEFAULT))
- goto FAIL;
- }
-
- return _global_font_cache;
-
- FAIL:
- if (_global_font_cache)
- free (_global_font_cache);
- _global_font_cache = NULL;
- return NULL;
-}
-
-
/* Now the internal "unscaled + scale" font API */
-cairo_unscaled_font_t *
-_cairo_unscaled_font_create (const char *family,
- cairo_font_slant_t slant,
- cairo_font_weight_t weight)
+cairo_private cairo_status_t
+_cairo_font_create (const char *family,
+ cairo_font_slant_t slant,
+ cairo_font_weight_t weight,
+ cairo_font_scale_t *sc,
+ cairo_font_t **font)
{
- cairo_cache_t * cache;
- cairo_font_cache_key_t key;
- cairo_font_cache_entry_t *font;
- cairo_status_t status;
-
- _lock_global_font_cache ();
- cache = _get_global_font_cache ();
- if (cache == NULL) {
- _unlock_global_font_cache ();
- return NULL;
- }
-
- key.family = family;
- key.slant = slant;
- key.weight = weight;
-
- status = _cairo_cache_lookup (cache, &key, (void **) &font);
- if (status) {
- _unlock_global_font_cache ();
- return NULL;
- }
+ const cairo_font_backend_t *backend = CAIRO_FONT_BACKEND_DEFAULT;
- _cairo_unscaled_font_reference (font->unscaled);
- _unlock_global_font_cache ();
- return font->unscaled;
+ return backend->create (family, slant, weight, sc, font);
}
void
-_cairo_font_init (cairo_font_t *scaled,
- cairo_font_scale_t *scale,
- cairo_unscaled_font_t *unscaled)
+_cairo_font_init (cairo_font_t *font,
+ cairo_font_scale_t *scale,
+ const cairo_font_backend_t *backend)
{
- scaled->scale = *scale;
- scaled->unscaled = unscaled;
- scaled->refcount = 1;
+ font->scale = *scale;
+ font->refcount = 1;
+ font->backend = backend;
}
-cairo_status_t
-_cairo_unscaled_font_init (cairo_unscaled_font_t *font,
- const cairo_font_backend_t *backend)
+void
+_cairo_unscaled_font_init (cairo_unscaled_font_t *font,
+ const cairo_font_backend_t *backend)
{
font->refcount = 1;
font->backend = backend;
- return CAIRO_STATUS_SUCCESS;
}
-
cairo_status_t
-_cairo_unscaled_font_text_to_glyphs (cairo_unscaled_font_t *font,
- cairo_font_scale_t *scale,
- const unsigned char *utf8,
- cairo_glyph_t **glyphs,
- int *num_glyphs)
+_cairo_font_text_to_glyphs (cairo_font_t *font,
+ const unsigned char *utf8,
+ cairo_glyph_t **glyphs,
+ int *num_glyphs)
{
- return font->backend->text_to_glyphs (font, scale, utf8, glyphs, num_glyphs);
+ return font->backend->text_to_glyphs (font, utf8, glyphs, num_glyphs);
}
cairo_status_t
-_cairo_unscaled_font_glyph_extents (cairo_unscaled_font_t *font,
- cairo_font_scale_t *scale,
- cairo_glyph_t *glyphs,
- int num_glyphs,
- cairo_text_extents_t *extents)
+_cairo_font_glyph_extents (cairo_font_t *font,
+ cairo_glyph_t *glyphs,
+ int num_glyphs,
+ cairo_text_extents_t *extents)
{
- return font->backend->glyph_extents(font, scale, glyphs, num_glyphs, extents);
+ return font->backend->glyph_extents(font, glyphs, num_glyphs, extents);
}
cairo_status_t
-_cairo_unscaled_font_glyph_bbox (cairo_unscaled_font_t *font,
- cairo_font_scale_t *scale,
- cairo_glyph_t *glyphs,
- int num_glyphs,
- cairo_box_t *bbox)
+_cairo_font_glyph_bbox (cairo_font_t *font,
+ cairo_glyph_t *glyphs,
+ int num_glyphs,
+ cairo_box_t *bbox)
{
- return font->backend->glyph_bbox (font, scale, glyphs, num_glyphs, bbox);
+ return font->backend->glyph_bbox (font, glyphs, num_glyphs, bbox);
}
cairo_status_t
-_cairo_unscaled_font_show_glyphs (cairo_unscaled_font_t *font,
- cairo_font_scale_t *scale,
- cairo_operator_t operator,
- cairo_surface_t *source,
- cairo_surface_t *surface,
- int source_x,
- int source_y,
- cairo_glyph_t *glyphs,
- int num_glyphs)
+_cairo_font_show_glyphs (cairo_font_t *font,
+ cairo_operator_t operator,
+ cairo_pattern_t *pattern,
+ cairo_surface_t *surface,
+ int source_x,
+ int source_y,
+ int dest_x,
+ int dest_y,
+ unsigned int width,
+ unsigned int height,
+ cairo_glyph_t *glyphs,
+ int num_glyphs)
{
cairo_status_t status;
if (surface->backend->show_glyphs != NULL) {
- status = surface->backend->show_glyphs (font, scale, operator, source,
- surface, source_x, source_y,
+ status = surface->backend->show_glyphs (font, operator, pattern,
+ surface,
+ source_x, source_y,
+ dest_x, dest_y,
+ width, height,
glyphs, num_glyphs);
if (status == CAIRO_STATUS_SUCCESS)
return status;
}
/* Surface display routine either does not exist or failed. */
- return font->backend->show_glyphs (font, scale, operator, source,
- surface, source_x, source_y,
+ return font->backend->show_glyphs (font, operator, pattern,
+ surface,
+ source_x, source_y,
+ dest_x, dest_y,
+ width, height,
glyphs, num_glyphs);
}
cairo_status_t
-_cairo_unscaled_font_glyph_path (cairo_unscaled_font_t *font,
- cairo_font_scale_t *scale,
- cairo_glyph_t *glyphs,
- int num_glyphs,
- cairo_path_t *path)
+_cairo_font_glyph_path (cairo_font_t *font,
+ cairo_glyph_t *glyphs,
+ int num_glyphs,
+ cairo_path_t *path)
+{
+ return font->backend->glyph_path (font, glyphs, num_glyphs, path);
+}
+
+void
+_cairo_font_get_glyph_cache_key (cairo_font_t *font,
+ cairo_glyph_cache_key_t *key)
{
- return font->backend->glyph_path (font, scale, glyphs, num_glyphs, path);
+ font->backend->get_glyph_cache_key (font, key);
}
cairo_status_t
-_cairo_unscaled_font_font_extents (cairo_unscaled_font_t *font,
- cairo_font_scale_t *scale,
- cairo_font_extents_t *extents)
+_cairo_font_font_extents (cairo_font_t *font,
+ cairo_font_extents_t *extents)
{
- return font->backend->font_extents(font, scale, extents);
+ return font->backend->font_extents (font, extents);
}
void
@@ -332,8 +169,7 @@ _cairo_unscaled_font_destroy (cairo_unscaled_font_t *font)
if (--(font->refcount) > 0)
return;
- if (font->backend)
- font->backend->destroy (font);
+ font->backend->destroy_unscaled_font (font);
}
@@ -352,37 +188,154 @@ cairo_font_destroy (cairo_font_t *font)
if (--(font->refcount) > 0)
return;
- if (font->unscaled)
- _cairo_unscaled_font_destroy (font->unscaled);
-
- free (font);
+ font->backend->destroy_font (font);
}
-void
-cairo_font_set_transform (cairo_font_t *font,
- cairo_matrix_t *matrix)
+/**
+ * cairo_font_extents:
+ * @font: a #cairo_font_t
+ * @font_matrix: the font transformation for which this font was
+ * created. (See cairo_transform_font()). This is needed
+ * properly convert the metrics from the font into user space.
+ * @extents: a #cairo_font_extents_t which to store the retrieved extents.
+ *
+ * Gets the metrics for a #cairo_font_t.
+ *
+ * Return value: %CAIRO_STATUS_SUCCESS on success. Otherwise, an
+ * error such as %CAIRO_STATUS_NO_MEMORY.
+ **/
+cairo_status_t
+cairo_font_extents (cairo_font_t *font,
+ cairo_matrix_t *font_matrix,
+ cairo_font_extents_t *extents)
{
- double dummy;
- cairo_matrix_get_affine (matrix,
- &font->scale.matrix[0][0],
- &font->scale.matrix[0][1],
- &font->scale.matrix[1][0],
- &font->scale.matrix[1][1],
- &dummy, &dummy);
+ cairo_int_status_t status;
+ double font_scale_x, font_scale_y;
+
+ status = _cairo_font_font_extents (font, extents);
+
+ if (!CAIRO_OK (status))
+ return status;
+
+ _cairo_matrix_compute_scale_factors (font_matrix,
+ &font_scale_x, &font_scale_y,
+ /* XXX */ 1);
+
+ /*
+ * The font responded in unscaled units, scale by the font
+ * matrix scale factors to get to user space
+ */
+
+ extents->ascent *= font_scale_y;
+ extents->descent *= font_scale_y;
+ extents->height *= font_scale_y;
+ extents->max_x_advance *= font_scale_x;
+ extents->max_y_advance *= font_scale_y;
+
+ return status;
}
+/**
+ * cairo_font_glyph_extents:
+ * @font: a #cairo_font_t
+ * @font_matrix: the font transformation for which this font was
+ * created. (See cairo_transform_font()). This is needed
+ * properly convert the metrics from the font into user space.
+ * @glyphs: an array of glyph IDs with X and Y offsets.
+ * @num_glyphs: the number of glyphs in the @glyphs array
+ * @extents: a #cairo_text_extents_t which to store the retrieved extents.
+ *
+ * cairo_font_glyph_extents() gets the overall metrics for a string of
+ * glyphs. The X and Y offsets in @glyphs are taken from an origin of 0,0.
+ **/
void
-cairo_font_current_transform (cairo_font_t *font,
- cairo_matrix_t *matrix)
+cairo_font_glyph_extents (cairo_font_t *font,
+ cairo_matrix_t *font_matrix,
+ cairo_glyph_t *glyphs,
+ int num_glyphs,
+ cairo_text_extents_t *extents)
{
- cairo_matrix_set_affine (matrix,
- font->scale.matrix[0][0],
- font->scale.matrix[0][1],
- font->scale.matrix[1][0],
- font->scale.matrix[1][1],
- 0, 0);
-}
+ cairo_status_t status = CAIRO_STATUS_SUCCESS;
+ cairo_glyph_t origin_glyph;
+ cairo_text_extents_t origin_extents;
+ int i;
+ double min_x = 0.0, min_y = 0.0, max_x = 0.0, max_y = 0.0;
+ double x_pos = 0.0, y_pos = 0.0;
+ int set = 0;
+
+ if (!num_glyphs)
+ {
+ extents->x_bearing = 0.0;
+ extents->y_bearing = 0.0;
+ extents->width = 0.0;
+ extents->height = 0.0;
+ extents->x_advance = 0.0;
+ extents->y_advance = 0.0;
+
+ return;
+ }
+ for (i = 0; i < num_glyphs; i++)
+ {
+ double x, y;
+ double wm, hm;
+
+ origin_glyph = glyphs[i];
+ origin_glyph.x = 0.0;
+ origin_glyph.y = 0.0;
+ status = _cairo_font_glyph_extents (font,
+ &origin_glyph, 1,
+ &origin_extents);
+
+ /*
+ * Transform font space metrics into user space metrics
+ * by running the corners through the font matrix and
+ * expanding the bounding box as necessary
+ */
+ x = origin_extents.x_bearing;
+ y = origin_extents.y_bearing;
+ cairo_matrix_transform_point (font_matrix,
+ &x, &y);
+
+ for (hm = 0.0; hm <= 1.0; hm += 1.0)
+ for (wm = 0.0; wm <= 1.0; wm += 1.0)
+ {
+ x = origin_extents.x_bearing + origin_extents.width * wm;
+ y = origin_extents.y_bearing + origin_extents.height * hm;
+ cairo_matrix_transform_point (font_matrix,
+ &x, &y);
+ x += glyphs[i].x;
+ y += glyphs[i].y;
+ if (!set)
+ {
+ min_x = max_x = x;
+ min_y = max_y = y;
+ set = 1;
+ }
+ else
+ {
+ if (x < min_x) min_x = x;
+ if (x > max_x) max_x = x;
+ if (y < min_y) min_y = y;
+ if (y > max_y) max_y = y;
+ }
+ }
+
+ x = origin_extents.x_advance;
+ y = origin_extents.y_advance;
+ cairo_matrix_transform_point (font_matrix,
+ &x, &y);
+ x_pos = glyphs[i].x + x;
+ y_pos = glyphs[i].y + y;
+ }
+
+ extents->x_bearing = min_x - glyphs[0].x;
+ extents->y_bearing = min_y - glyphs[0].y;
+ extents->width = max_x - min_x;
+ extents->height = max_y - min_y;
+ extents->x_advance = x_pos - glyphs[0].x;
+ extents->y_advance = y_pos - glyphs[0].y;
+}
/* Now we implement functions to access a default global image & metrics
* cache.
@@ -398,7 +351,8 @@ _cairo_glyph_cache_hash (void *cache, void *key)
^ ((unsigned long) in->scale.matrix[0][0])
^ ((unsigned long) in->scale.matrix[0][1])
^ ((unsigned long) in->scale.matrix[1][0])
- ^ ((unsigned long) in->scale.matrix[1][1])
+ ^ ((unsigned long) in->scale.matrix[1][1])
+ ^ (in->flags * 1451) /* 1451 is just an abitrary prime */
^ in->index;
}
@@ -412,6 +366,7 @@ _cairo_glyph_cache_keys_equal (void *cache,
b = (cairo_glyph_cache_key_t *) k2;
return (a->index == b->index)
&& (a->unscaled == b->unscaled)
+ && (a->flags == b->flags)
&& (a->scale.matrix[0][0] == b->scale.matrix[0][0])
&& (a->scale.matrix[0][1] == b->scale.matrix[0][1])
&& (a->scale.matrix[1][0] == b->scale.matrix[1][0])
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index b928b04fc..44e1b0e84 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -1,29 +1,40 @@
-/*
- * Copyright © 2003 Red Hat Inc.
+/* cairo - a vector graphics library with display and print output
+ *
+ * Copyright © 2005 Red Hat, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it either under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation
+ * (the "LGPL") or, at your option, under the terms of the Mozilla
+ * Public License Version 1.1 (the "MPL"). If you do not alter this
+ * notice, a recipient may use your version of this file under either
+ * the MPL or the LGPL.
+ *
+ * You should have received a copy of the LGPL along with this library
+ * in the file COPYING-LGPL-2.1; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the MPL along with this library
+ * in the file COPYING-MPL-1.1
*
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Red Hat Inc. not be used
- * in advertising or publicity pertaining to distribution of the software
- * without specific, written prior permission. Red Hat Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * The contents of this file are subject to the Mozilla Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
*
- * RED HAT INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL RED HAT INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
+ * OF ANY KIND, either express or implied. See the LGPL or the MPL for
+ * the specific language governing rights and limitations.
*
- * Author: Graydon Hoare <graydon@redhat.com>
+ * The Original Code is the cairo graphics library.
+ *
+ * The Initial Developer of the Original Code is Red Hat, Inc.
+ *
+ * Contributor(s):
+ * Graydon Hoare <graydon@redhat.com>
+ * Owen Taylor <otaylor@redhat.com>
*/
-#include "cairoint.h"
-#include "cairo-ft.h"
+#include "cairo-ft-private.h"
#include <fontconfig/fontconfig.h>
#include <fontconfig/fcfreetype.h>
@@ -38,19 +49,9 @@
#define DOUBLE_TO_16_16(d) ((FT_Fixed)((d) * 65536.0))
#define DOUBLE_FROM_16_16(t) ((double)(t) / 65536.0)
-/*
- * First we make a private, sharable implementation object which can be
- * stored both in a private cache and in public font objects (including
- * those connected to fonts we don't own)
+/* This is the max number of FT_face objects we keep open at once
*/
-
-typedef struct {
- int refcount;
-
- FT_Face face;
- int owns_face;
-
-} ft_font_val_t;
+#define MAX_OPEN_FACES 10
/*
* The simple 2x2 matrix is converted into separate scale and shape
@@ -62,141 +63,126 @@ typedef struct {
double shape[2][2];
} ft_font_transform_t;
-static ft_font_val_t *
-_create_from_face (FT_Face face, int owns_face)
-{
- ft_font_val_t *tmp = malloc (sizeof(ft_font_val_t));
- if (tmp) {
- tmp->refcount = 1;
- tmp->face = face;
- tmp->owns_face = owns_face;
- FT_Set_Char_Size (face,
- DOUBLE_TO_26_6 (1.0),
- DOUBLE_TO_26_6 (1.0),
- 0, 0);
- }
- return tmp;
-}
+/*
+ * We create an object that corresponds to a single font on the disk;
+ * (identified by a filename/id pair) these are shared between all
+ * fonts using that file. For cairo_ft_font_create_for_ft_face(), we
+ * just create a one-off version with a permanent face value.
+ */
-static void
-_reference_font_val (ft_font_val_t *f)
-{
- f->refcount++;
-}
+typedef struct {
+ cairo_unscaled_font_t base;
-static void
-_destroy_font_val (ft_font_val_t *f)
-{
- if (--(f->refcount) > 0)
- return;
+ int from_face; /* from cairo_ft_font_create_for_ft_face()? */
+ FT_Face face; /* provided or cached face */
- if (f->owns_face)
- FT_Done_Face (f->face);
+ /* only set if from_face is false */
+ FT_Library library;
+ char *filename;
+ int id;
- free (f);
-}
+ /* We temporarily scale the unscaled font as neede */
+ int have_scale;
+ cairo_font_scale_t current_scale;
+ double x_scale; /* Extracted X scale factor */
+ double y_scale; /* Extracted Y scale factor */
+
+ int lock; /* count of how many times this font has been locked */
+} ft_unscaled_font_t;
-static ft_font_val_t *
-_create_from_library_and_pattern (FT_Library ft_library, FcPattern *pattern)
-{
- ft_font_val_t *f = NULL;
- char *filename = NULL;
- int owns_face = 0;
- FT_Face face = NULL;
- FcPattern *resolved = NULL;
- FcResult result = FcResultMatch;
+const cairo_font_backend_t cairo_ft_font_backend;
- if (pattern == NULL)
- goto FAIL;
+static ft_unscaled_font_t *
+_ft_unscaled_font_create_from_face (FT_Face face)
+{
+ ft_unscaled_font_t *unscaled = malloc (sizeof(ft_unscaled_font_t));
+ if (!unscaled)
+ return NULL;
+
+ unscaled->from_face = 1;
+ unscaled->face = face;
- FcConfigSubstitute (0, pattern, FcMatchPattern);
- FcDefaultSubstitute (pattern);
+ unscaled->library = NULL;
+ unscaled->filename = NULL;
+ unscaled->id = 0;
- resolved = FcFontMatch (0, pattern, &result);
- if (!resolved)
- goto FAIL;
+ unscaled->have_scale = 0;
+ unscaled->lock = 0;
- if (result != FcResultMatch)
- goto FREE_RESOLVED;
+ _cairo_unscaled_font_init ((cairo_unscaled_font_t *)unscaled,
+ &cairo_ft_font_backend);
+ return unscaled;
+}
+
+static ft_unscaled_font_t *
+_ft_unscaled_font_create_from_filename (FT_Library library,
+ const char *filename,
+ int id)
+{
+ ft_unscaled_font_t *unscaled;
+ char *new_filename;
- /* If the pattern has an FT_Face object, use that. */
- if (FcPatternGetFTFace (resolved, FC_FT_FACE, 0, &face) != FcResultMatch
- || face == NULL)
- {
- /* otherwise it had better have a filename */
- result = FcPatternGetString (resolved, FC_FILE, 0, (FcChar8 **)(&filename));
-
- if (result == FcResultMatch)
- if (FT_New_Face (ft_library, filename, 0, &face))
- goto FREE_RESOLVED;
-
- if (face == NULL)
- goto FREE_RESOLVED;
-
- owns_face = 1;
+ new_filename = strdup (filename);
+ if (!new_filename)
+ return NULL;
+
+ unscaled = malloc (sizeof (ft_unscaled_font_t));
+ if (!unscaled) {
+ free (new_filename);
+ return NULL;
}
+
+ unscaled->from_face = 0;
+ unscaled->face = NULL;
- f = _create_from_face (face, owns_face);
-
- FcPatternDestroy (resolved);
- return f;
+ unscaled->library = library;
+ unscaled->filename = new_filename;
+ unscaled->id = id;
- FREE_RESOLVED:
- if (resolved)
- FcPatternDestroy (resolved);
-
- FAIL:
- return NULL;
+ unscaled->have_scale = 0;
+ unscaled->lock = 0;
+
+ _cairo_unscaled_font_init ((cairo_unscaled_font_t *)unscaled,
+ &cairo_ft_font_backend);
+ return unscaled;
}
-
-/*
- * We then make the user-exposed structure out of one of these impls, such
- * that it is reasonably cheap to copy and/or destroy. Unfortunately this
- * duplicates a certain amount of the caching machinery in the font cache,
- * but that's unavoidable as we also provide an FcPattern resolution API,
- * which is not part of cairo's generic font finding system.
- */
-
-typedef struct {
- cairo_unscaled_font_t base;
- FcPattern *pattern;
- ft_font_val_t *val;
-} cairo_ft_font_t;
-
-/*
- * We then make a key and entry type which are compatible with the generic
- * cache system. This cache serves to share single ft_font_val_t instances
- * between fonts (or between font lifecycles).
+/*
+ * We keep a global cache from [file/id] => [ft_unscaled_font_t]. This
+ * hash isn't limited in size. However, we limit the number of
+ * FT_Face objects we keep around; when we've exceeeded that
+ * limit and need to create a new FT_Face, we dump the FT_Face from
+ * a random ft_unscaled_font_t.
*/
typedef struct {
cairo_cache_entry_base_t base;
- FcPattern *pattern;
+ char *filename;
+ int id;
} cairo_ft_cache_key_t;
typedef struct {
cairo_ft_cache_key_t key;
- ft_font_val_t *val;
+ ft_unscaled_font_t *unscaled;
} cairo_ft_cache_entry_t;
-/*
- * Then we create a cache which maps FcPattern keys to the refcounted
- * ft_font_val_t values.
- */
-
typedef struct {
cairo_cache_t base;
FT_Library lib;
+ int n_faces; /* Number of open FT_Face objects */
} ft_cache_t;
-
static unsigned long
_ft_font_cache_hash (void *cache, void *key)
{
- cairo_ft_cache_key_t *in;
- in = (cairo_ft_cache_key_t *) key;
- return FcPatternHash (in->pattern);
+ cairo_ft_cache_key_t *in = (cairo_ft_cache_key_t *) key;
+ unsigned long hash;
+
+ /* 1607 is just a random prime. */
+ hash = _cairo_hash_string (in->filename);
+ hash += ((unsigned long) in->id) * 1607;
+
+ return hash;
}
static int
@@ -208,10 +194,10 @@ _ft_font_cache_keys_equal (void *cache,
cairo_ft_cache_key_t *b;
a = (cairo_ft_cache_key_t *) k1;
b = (cairo_ft_cache_key_t *) k2;
-
- return FcPatternEqual (a->pattern, b->pattern);
-}
+ return strcmp (a->filename, b->filename) == 0 &&
+ a->id == b->id;
+}
static cairo_status_t
_ft_font_cache_create_entry (void *cache,
@@ -226,27 +212,33 @@ _ft_font_cache_create_entry (void *cache,
if (entry == NULL)
return CAIRO_STATUS_NO_MEMORY;
- entry->key.pattern = FcPatternDuplicate (k->pattern);
- if (!entry->key.pattern) {
+ entry->unscaled = _ft_unscaled_font_create_from_filename (ftcache->lib,
+ k->filename,
+ k->id);
+ if (!entry->unscaled) {
free (entry);
return CAIRO_STATUS_NO_MEMORY;
}
-
- entry->val = _create_from_library_and_pattern (ftcache->lib, entry->key.pattern);
- entry->key.base.memory = 1;
-
+
+ entry->key.base.memory = 0;
+ entry->key.filename = entry->unscaled->filename;
+ entry->key.id = entry->unscaled->id;
+
*return_entry = entry;
return CAIRO_STATUS_SUCCESS;
}
+/* Entries are never spontaneously destroyed; but only when
+ * we remove them from the cache specifically. We free entry->unscaled
+ * in the code that removes the entry from the cache
+ */
static void
_ft_font_cache_destroy_entry (void *cache,
void *entry)
{
cairo_ft_cache_entry_t *e = (cairo_ft_cache_entry_t *) entry;
- FcPatternDestroy (e->key.pattern);
- _destroy_font_val (e->val);
+
free (e);
}
@@ -291,11 +283,12 @@ _get_global_ft_cache (void)
if (_cairo_cache_init (&_global_ft_cache->base,
&_ft_font_cache_backend,
- CAIRO_FT_CACHE_NUM_FONTS_DEFAULT))
+ 0)) /* No memory limit */
goto FAIL;
if (FT_Init_FreeType (&_global_ft_cache->lib))
goto FAIL;
+ _global_ft_cache->n_faces = 0;
}
return &_global_ft_cache->base;
@@ -306,30 +299,304 @@ _get_global_ft_cache (void)
return NULL;
}
-/* implement the backend interface */
+/* Finds or creates a ft_unscaled_font for the filename/id from pattern.
+ * Returns a new reference to the unscaled font.
+ */
+static ft_unscaled_font_t *
+_ft_unscaled_font_get_for_pattern (FcPattern *pattern)
+{
+ cairo_ft_cache_entry_t *entry;
+ cairo_ft_cache_key_t key;
+ cairo_cache_t *cache;
+ cairo_status_t status;
+ FcChar8 *filename;
+ int created_entry;
+
+ if (FcPatternGetString (pattern, FC_FILE, 0, &filename) != FcResultMatch)
+ return NULL;
+ key.filename = (char *)filename;
+
+ if (FcPatternGetInteger (pattern, FC_INDEX, 0, &key.id) != FcResultMatch)
+ return NULL;
+
+ _lock_global_ft_cache ();
+ cache = _get_global_ft_cache ();
+ if (cache == NULL) {
+ _unlock_global_ft_cache ();
+ return NULL;
+ }
+
+ status = _cairo_cache_lookup (cache, &key, (void **) &entry, &created_entry);
+ _unlock_global_ft_cache ();
+ if (status)
+ return NULL;
+
+ if (!created_entry)
+ _cairo_unscaled_font_reference ((cairo_unscaled_font_t *)entry->unscaled);
+
+ return entry->unscaled;
+}
+
+static int
+_has_unlocked_face (void *entry)
+{
+ cairo_ft_cache_entry_t *e = entry;
-const cairo_font_backend_t cairo_ft_font_backend;
+ return (e->unscaled->lock == 0 && e->unscaled->face);
+}
+
+/* Ensures that an unscaled font has a face object. If we exceed
+ * MAX_OPEN_FACES, try to close some.
+ */
+static FT_Face
+_ft_unscaled_font_lock_face (ft_unscaled_font_t *unscaled)
+{
+ ft_cache_t *ftcache;
+ FT_Face face = NULL;
+
+ if (unscaled->face) {
+ unscaled->lock++;
+ return unscaled->face;
+ }
-static cairo_unscaled_font_t *
-_cairo_ft_font_create (const char *family,
+ assert (!unscaled->from_face);
+
+ _lock_global_ft_cache ();
+ ftcache = (ft_cache_t *) _get_global_ft_cache ();
+ assert (ftcache != NULL);
+
+ while (ftcache->n_faces >= MAX_OPEN_FACES) {
+ cairo_ft_cache_entry_t *entry;
+
+ entry = _cairo_cache_random_entry ((cairo_cache_t *)ftcache, _has_unlocked_face);
+ if (entry) {
+ FT_Done_Face (entry->unscaled->face);
+ entry->unscaled->face = NULL;
+ entry->unscaled->have_scale = 0;
+ ftcache->n_faces--;
+ } else {
+ break;
+ }
+ }
+
+ if (FT_New_Face (ftcache->lib,
+ unscaled->filename,
+ unscaled->id,
+ &face) != FT_Err_Ok)
+ goto FAIL;
+
+ unscaled->face = face;
+ unscaled->lock++;
+ ftcache->n_faces++;
+
+ FAIL:
+ _unlock_global_ft_cache ();
+ return face;
+}
+
+/* Unlock unscaled font locked with _ft_unscaled_font_lock_face
+ */
+static void
+_ft_unscaled_font_unlock_face (ft_unscaled_font_t *unscaled)
+{
+ assert (unscaled->lock > 0);
+
+ unscaled->lock--;
+}
+
+static void
+_compute_transform (ft_font_transform_t *sf,
+ cairo_font_scale_t *sc)
+{
+ cairo_matrix_t normalized;
+ double tx, ty;
+
+ /* The font matrix has x and y "scale" components which we extract and
+ * use as character scale values. These influence the way freetype
+ * chooses hints, as well as selecting different bitmaps in
+ * hand-rendered fonts. We also copy the normalized matrix to
+ * freetype's transformation.
+ */
+
+ cairo_matrix_set_affine (&normalized,
+ sc->matrix[0][0],
+ sc->matrix[0][1],
+ sc->matrix[1][0],
+ sc->matrix[1][1],
+ 0, 0);
+
+ _cairo_matrix_compute_scale_factors (&normalized,
+ &sf->x_scale, &sf->y_scale,
+ /* XXX */ 1);
+ cairo_matrix_scale (&normalized, 1.0 / sf->x_scale, 1.0 / sf->y_scale);
+ cairo_matrix_get_affine (&normalized,
+ &sf->shape[0][0], &sf->shape[0][1],
+ &sf->shape[1][0], &sf->shape[1][1],
+ &tx, &ty);
+}
+
+/* Temporarily scales an unscaled font to the give scale. We catch
+ * scaling to the same size, since changing a FT_Face is expensive.
+ */
+static void
+_ft_unscaled_font_set_scale (ft_unscaled_font_t *unscaled,
+ cairo_font_scale_t *scale)
+{
+ ft_font_transform_t sf;
+ FT_Matrix mat;
+
+ assert (unscaled->face != NULL);
+
+ if (unscaled->have_scale &&
+ scale->matrix[0][0] == unscaled->current_scale.matrix[0][0] &&
+ scale->matrix[0][1] == unscaled->current_scale.matrix[0][1] &&
+ scale->matrix[1][0] == unscaled->current_scale.matrix[1][0] &&
+ scale->matrix[1][1] == unscaled->current_scale.matrix[1][1])
+ return;
+
+ unscaled->have_scale = 1;
+ unscaled->current_scale = *scale;
+
+ _compute_transform (&sf, scale);
+
+ unscaled->x_scale = sf.x_scale;
+ unscaled->y_scale = sf.y_scale;
+
+ mat.xx = DOUBLE_TO_16_16(sf.shape[0][0]);
+ mat.yx = - DOUBLE_TO_16_16(sf.shape[0][1]);
+ mat.xy = - DOUBLE_TO_16_16(sf.shape[1][0]);
+ mat.yy = DOUBLE_TO_16_16(sf.shape[1][1]);
+
+ FT_Set_Transform(unscaled->face, &mat, NULL);
+
+ FT_Set_Pixel_Sizes(unscaled->face,
+ (FT_UInt) sf.x_scale,
+ (FT_UInt) sf.y_scale);
+}
+
+/* implement the font backend interface */
+
+typedef struct {
+ cairo_font_t base;
+ FcPattern *pattern;
+ int load_flags;
+ ft_unscaled_font_t *unscaled;
+} cairo_ft_font_t;
+
+/* for compatibility with older freetype versions */
+#ifndef FT_LOAD_TARGET_MONO
+#define FT_LOAD_TARGET_MONO FT_LOAD_MONOCHROME
+#endif
+
+/* The load flags passed to FT_Load_Glyph control aspects like hinting and
+ * antialiasing. Here we compute them from the fields of a FcPattern.
+ */
+static int
+_get_load_flags (FcPattern *pattern)
+{
+ FcBool antialias, hinting, autohint;
+#ifdef FC_HINT_STYLE
+ int hintstyle;
+#endif
+ int load_flags = 0;
+
+ /* disable antialiasing if requested */
+ if (FcPatternGetBool (pattern,
+ FC_ANTIALIAS, 0, &antialias) != FcResultMatch)
+ antialias = FcTrue;
+
+ if (antialias)
+ load_flags |= FT_LOAD_NO_BITMAP;
+ else
+ load_flags |= FT_LOAD_TARGET_MONO;
+
+ /* disable hinting if requested */
+ if (FcPatternGetBool (pattern,
+ FC_HINTING, 0, &hinting) != FcResultMatch)
+ hinting = FcTrue;
+
+#ifdef FC_HINT_STYLE
+ if (FcPatternGetInteger (pattern, FC_HINT_STYLE, 0, &hintstyle) != FcResultMatch)
+ hintstyle = FC_HINT_FULL;
+
+ if (!hinting || hintstyle == FC_HINT_NONE)
+ load_flags |= FT_LOAD_NO_HINTING;
+
+ switch (hintstyle) {
+ case FC_HINT_SLIGHT:
+ case FC_HINT_MEDIUM:
+ load_flags |= FT_LOAD_TARGET_LIGHT;
+ break;
+ default:
+ load_flags |= FT_LOAD_TARGET_NORMAL;
+ break;
+ }
+#else /* !FC_HINT_STYLE */
+ if (!hinting)
+ load_flags |= FT_LOAD_NO_HINTING;
+#endif /* FC_FHINT_STYLE */
+
+ /* force autohinting if requested */
+ if (FcPatternGetBool (pattern,
+ FC_AUTOHINT, 0, &autohint) != FcResultMatch)
+ autohint = FcFalse;
+
+ if (autohint)
+ load_flags |= FT_LOAD_FORCE_AUTOHINT;
+
+ return load_flags;
+}
+
+/* Like the public cairo_ft_font_create, but takes a cairo_font_scale_t,
+ * rather than a cairo_font_t
+ */
+static cairo_font_t *
+_ft_font_create (FcPattern *pattern,
+ cairo_font_scale_t *scale)
+{
+ cairo_ft_font_t *f = NULL;
+ ft_unscaled_font_t *unscaled = NULL;
+
+ unscaled = _ft_unscaled_font_get_for_pattern (pattern);
+ if (unscaled == NULL)
+ return NULL;
+
+ f = malloc (sizeof(cairo_ft_font_t));
+ if (f == NULL)
+ goto FREE_UNSCALED;
+
+ f->unscaled = unscaled;
+ f->pattern = pattern;
+ FcPatternReference (pattern);
+ f->load_flags = _get_load_flags (pattern);
+
+ _cairo_font_init ((cairo_font_t *)f, scale, &cairo_ft_font_backend);
+
+ return (cairo_font_t *)f;
+
+ FREE_UNSCALED:
+ _cairo_unscaled_font_destroy ((cairo_unscaled_font_t *)unscaled);
+
+ return NULL;
+}
+
+static cairo_status_t
+_cairo_ft_font_create (const char *family,
cairo_font_slant_t slant,
- cairo_font_weight_t weight)
+ cairo_font_weight_t weight,
+ cairo_font_scale_t *scale,
+ cairo_font_t **font)
{
- cairo_status_t status;
- cairo_ft_font_t *font = NULL;
+ FcPattern *pattern, *resolved;
+ cairo_font_t *new_font;
+ FcResult result;
int fcslant;
int fcweight;
- cairo_cache_t *cache;
- cairo_ft_cache_entry_t *entry;
- cairo_ft_cache_key_t key;
-
- key.pattern = FcPatternCreate ();
- if (key.pattern == NULL)
- goto FAIL;
+ ft_font_transform_t sf;
- font = malloc (sizeof (cairo_ft_font_t));
- if (font == NULL)
- goto FREE_PATTERN;
+ pattern = FcPatternCreate ();
+ if (!pattern)
+ return CAIRO_STATUS_NO_MEMORY;
switch (weight)
{
@@ -356,46 +623,44 @@ _cairo_ft_font_create (const char *family,
break;
}
- FcPatternAddString (key.pattern, FC_FAMILY, family);
- FcPatternAddInteger (key.pattern, FC_SLANT, fcslant);
- FcPatternAddInteger (key.pattern, FC_WEIGHT, fcweight);
-
- if (_cairo_unscaled_font_init (&font->base, &cairo_ft_font_backend))
+ if (!FcPatternAddString (pattern, FC_FAMILY, family))
goto FREE_PATTERN;
-
- _lock_global_ft_cache ();
- cache = _get_global_ft_cache ();
- if (cache == NULL) {
- _unlock_global_ft_cache ();
+ if (!FcPatternAddInteger (pattern, FC_SLANT, fcslant))
+ goto FREE_PATTERN;
+ if (!FcPatternAddInteger (pattern, FC_WEIGHT, fcweight))
goto FREE_PATTERN;
- }
- status = _cairo_cache_lookup (cache, &key, (void **) &entry);
- _unlock_global_ft_cache ();
+ _compute_transform (&sf, scale);
- if (status)
- goto FREE_PATTERN;
+ FcPatternAddInteger (pattern, FC_PIXEL_SIZE, sf.y_scale);
- font->pattern = FcPatternDuplicate (entry->key.pattern);
- if (font->pattern == NULL)
+ FcConfigSubstitute (NULL, pattern, FcMatchPattern);
+ FcDefaultSubstitute (pattern);
+
+ resolved = FcFontMatch (NULL, pattern, &result);
+ if (!resolved)
goto FREE_PATTERN;
- font->val = entry->val;
- _reference_font_val (font->val);
-
- return &font->base;
+ new_font = _ft_font_create (resolved, scale);
- FREE_PATTERN:
- FcPatternDestroy (key.pattern);
+ FcPatternDestroy (resolved);
+ FcPatternDestroy (pattern);
- FAIL:
- return NULL;
+ if (new_font) {
+ *font = new_font;
+ return CAIRO_STATUS_SUCCESS;
+ } else {
+ return CAIRO_STATUS_NO_MEMORY; /* A guess */
+ }
-}
+ FREE_PATTERN:
+ FcPatternDestroy (pattern);
+ return CAIRO_STATUS_NO_MEMORY;
+}
static void
-_cairo_ft_font_destroy (void *abstract_font)
+_cairo_ft_font_destroy_font (void *abstract_font)
{
cairo_ft_font_t * font = abstract_font;
@@ -405,179 +670,94 @@ _cairo_ft_font_destroy (void *abstract_font)
if (font->pattern != NULL)
FcPatternDestroy (font->pattern);
- _destroy_font_val (font->val);
+ _cairo_unscaled_font_destroy ((cairo_unscaled_font_t *)font->unscaled);
free (font);
}
static void
-_utf8_to_ucs4 (char const *utf8,
- FT_ULong **ucs4,
- int *nchars)
+_cairo_ft_font_destroy_unscaled_font (void *abstract_font)
{
- int len = 0, step = 0;
- int n = 0, alloc = 0;
- FcChar32 u = 0;
+ ft_unscaled_font_t *unscaled = abstract_font;
- if (utf8 == NULL || ucs4 == NULL || nchars == NULL)
- return;
+ if (!unscaled->from_face) {
+ cairo_cache_t *cache;
+ cairo_ft_cache_key_t key;
+
+ _lock_global_ft_cache ();
+ cache = _get_global_ft_cache ();
+ assert (cache);
- len = strlen (utf8);
- alloc = len;
- *ucs4 = malloc (sizeof (FT_ULong) * alloc);
- if (*ucs4 == NULL)
- return;
-
- while (len && (step = FcUtf8ToUcs4(utf8, &u, len)) > 0)
- {
- if (n == alloc)
- {
- alloc *= 2;
- *ucs4 = realloc (*ucs4, sizeof (FT_ULong) * alloc);
- if (*ucs4 == NULL)
- return;
- }
- (*ucs4)[n++] = u;
- len -= step;
- utf8 += step;
+ key.filename = unscaled->filename;
+ key.id = unscaled->id;
+
+ _cairo_cache_remove (cache, &key);
+
+ _unlock_global_ft_cache ();
}
- *nchars = n;
-}
-
-/*
- * Split a matrix into the component pieces of scale and shape
- */
-
-static void
-_cairo_ft_font_compute_transform (ft_font_transform_t *sf, cairo_font_scale_t *sc)
-{
- cairo_matrix_t normalized;
- double tx, ty;
- /* The font matrix has x and y "scale" components which we extract and
- * use as character scale values. These influence the way freetype
- * chooses hints, as well as selecting different bitmaps in
- * hand-rendered fonts. We also copy the normalized matrix to
- * freetype's transformation.
- */
-
- cairo_matrix_set_affine (&normalized,
- sc->matrix[0][0],
- sc->matrix[0][1],
- sc->matrix[1][0],
- sc->matrix[1][1],
- 0, 0);
-
- _cairo_matrix_compute_scale_factors (&normalized,
- &sf->x_scale, &sf->y_scale,
- /* XXX */ 1);
- cairo_matrix_scale (&normalized, 1.0 / sf->x_scale, 1.0 / sf->y_scale);
- cairo_matrix_get_affine (&normalized,
- &sf->shape[0][0], &sf->shape[0][1],
- &sf->shape[1][0], &sf->shape[1][1],
- &tx, &ty);
-}
-
-/*
- * Set the font transformation
- */
-
-static void
-_cairo_ft_font_install_transform (ft_font_transform_t *sf, FT_Face face)
-{
- FT_Matrix mat;
-
- mat.xx = DOUBLE_TO_16_16(sf->shape[0][0]);
- mat.yx = -DOUBLE_TO_16_16(sf->shape[0][1]);
- mat.xy = -DOUBLE_TO_16_16(sf->shape[1][0]);
- mat.yy = DOUBLE_TO_16_16(sf->shape[1][1]);
+ if (unscaled == NULL)
+ return;
- FT_Set_Transform(face, &mat, NULL);
+ if (!unscaled->from_face && unscaled->face)
+ FT_Done_Face (unscaled->face);
- FT_Set_Char_Size(face,
- (FT_F26Dot6) (sf->x_scale * 64.0),
- (FT_F26Dot6) (sf->y_scale * 64.0),
- 0, 0);
+ if (unscaled->filename)
+ free (unscaled->filename);
+
+ free (unscaled);
}
static void
-_install_font_scale (cairo_font_scale_t *sc, FT_Face face)
+_cairo_ft_font_get_glyph_cache_key (void *abstract_font,
+ cairo_glyph_cache_key_t *key)
{
- cairo_matrix_t normalized;
- double x_scale, y_scale;
- double xx, xy, yx, yy, tx, ty;
- FT_Matrix mat;
-
- /* The font matrix has x and y "scale" components which we extract and
- * use as character scale values. These influence the way freetype
- * chooses hints, as well as selecting different bitmaps in
- * hand-rendered fonts. We also copy the normalized matrix to
- * freetype's transformation.
- */
-
- cairo_matrix_set_affine (&normalized,
- sc->matrix[0][0],
- sc->matrix[0][1],
- sc->matrix[1][0],
- sc->matrix[1][1],
- 0, 0);
-
- _cairo_matrix_compute_scale_factors (&normalized, &x_scale, &y_scale,
- /* XXX */ 1);
- cairo_matrix_scale (&normalized, 1.0 / x_scale, 1.0 / y_scale);
- cairo_matrix_get_affine (&normalized,
- &xx /* 00 */ , &yx /* 01 */,
- &xy /* 10 */, &yy /* 11 */,
- &tx, &ty);
-
- mat.xx = DOUBLE_TO_16_16(xx);
- mat.xy = -DOUBLE_TO_16_16(xy);
- mat.yx = -DOUBLE_TO_16_16(yx);
- mat.yy = DOUBLE_TO_16_16(yy);
-
- FT_Set_Transform(face, &mat, NULL);
+ cairo_ft_font_t *font = abstract_font;
- FT_Set_Pixel_Sizes(face,
- (FT_UInt) x_scale,
- (FT_UInt) y_scale);
+ key->unscaled = (cairo_unscaled_font_t *)font->unscaled;
+ key->scale = font->base.scale;
+ key->flags = font->load_flags;
}
static cairo_status_t
_cairo_ft_font_text_to_glyphs (void *abstract_font,
- cairo_font_scale_t *sc,
const unsigned char *utf8,
cairo_glyph_t **glyphs,
int *nglyphs)
{
double x = 0., y = 0.;
size_t i;
- FT_ULong *ucs4 = NULL;
+ uint32_t *ucs4 = NULL;
cairo_ft_font_t *font = abstract_font;
- FT_Face face = font->val->face;
+ FT_Face face;
cairo_glyph_cache_key_t key;
cairo_image_glyph_cache_entry_t *val;
- cairo_cache_t *cache;
+ cairo_cache_t *cache = NULL;
+ cairo_status_t status = CAIRO_STATUS_SUCCESS;
- key.unscaled = &font->base;
- key.scale = *sc;
+ _cairo_ft_font_get_glyph_cache_key (font, &key);
- _utf8_to_ucs4 (utf8, &ucs4, nglyphs);
-
- if (ucs4 == NULL)
- return CAIRO_STATUS_NO_MEMORY;
+ status = _cairo_utf8_to_ucs4 (utf8, -1, &ucs4, nglyphs);
+ if (!CAIRO_OK (status))
+ return status;
- *glyphs = (cairo_glyph_t *) malloc ((*nglyphs) * (sizeof (cairo_glyph_t)));
- if (*glyphs == NULL)
- {
- free (ucs4);
- return CAIRO_STATUS_NO_MEMORY;
+ face = cairo_ft_font_lock_face ((cairo_font_t *)font);
+ if (!face) {
+ status = CAIRO_STATUS_NO_MEMORY;
+ goto FAIL1;
}
_cairo_lock_global_image_glyph_cache ();
cache = _cairo_get_global_image_glyph_cache ();
if (cache == NULL) {
- _cairo_unlock_global_image_glyph_cache ();
- return CAIRO_STATUS_NO_MEMORY;
+ status = CAIRO_STATUS_NO_MEMORY;
+ goto FAIL2;
+ }
+
+ *glyphs = (cairo_glyph_t *) malloc ((*nglyphs) * (sizeof (cairo_glyph_t)));
+ if (*glyphs == NULL) {
+ status = CAIRO_STATUS_NO_MEMORY;
+ goto FAIL2;
}
for (i = 0; i < *nglyphs; i++)
@@ -589,51 +769,62 @@ _cairo_ft_font_text_to_glyphs (void *abstract_font,
val = NULL;
key.index = (*glyphs)[i].index;
- if (_cairo_cache_lookup (cache, &key, (void **) &val)
+ if (_cairo_cache_lookup (cache, &key, (void **) &val, NULL)
!= CAIRO_STATUS_SUCCESS || val == NULL)
continue;
x += val->extents.x_advance;
y += val->extents.y_advance;
}
- _cairo_unlock_global_image_glyph_cache ();
+ FAIL2:
+ if (cache)
+ _cairo_unlock_global_image_glyph_cache ();
+
+ cairo_ft_font_unlock_face ((cairo_font_t *)font);
+
+ FAIL1:
free (ucs4);
- return CAIRO_STATUS_SUCCESS;
+
+ return status;
}
static cairo_status_t
_cairo_ft_font_font_extents (void *abstract_font,
- cairo_font_scale_t *sc,
cairo_font_extents_t *extents)
{
cairo_ft_font_t *font = abstract_font;
- FT_Face face = font->val->face;
- FT_Size_Metrics *metrics = &face->size->metrics;
- ft_font_transform_t sf;
+ FT_Face face;
+ FT_Size_Metrics *metrics;
+
+ face = _ft_unscaled_font_lock_face (font->unscaled);
+ if (!face)
+ return CAIRO_STATUS_NO_MEMORY;
- _cairo_ft_font_compute_transform (&sf, sc);
- _cairo_ft_font_install_transform (&sf, face);
+ metrics = &face->size->metrics;
+ _ft_unscaled_font_set_scale (font->unscaled, &font->base.scale);
+
/*
* Get to unscaled metrics so that the upper level can get back to
* user space
*/
- extents->ascent = DOUBLE_FROM_26_6(metrics->ascender) / sf.y_scale;
- extents->descent = DOUBLE_FROM_26_6(metrics->descender) / sf.y_scale;
- extents->height = DOUBLE_FROM_26_6(metrics->height) / sf.y_scale;
- extents->max_x_advance = DOUBLE_FROM_26_6(metrics->max_advance) / sf.x_scale;
+ extents->ascent = DOUBLE_FROM_26_6(metrics->ascender) / font->unscaled->y_scale;
+ extents->descent = DOUBLE_FROM_26_6(metrics->descender) / font->unscaled->y_scale;
+ extents->height = DOUBLE_FROM_26_6(metrics->height) / font->unscaled->y_scale;
+ extents->max_x_advance = DOUBLE_FROM_26_6(metrics->max_advance) / font->unscaled->x_scale;
/* FIXME: this doesn't do vertical layout atm. */
extents->max_y_advance = 0.0;
+ _ft_unscaled_font_unlock_face (font->unscaled);
+
return CAIRO_STATUS_SUCCESS;
}
static cairo_status_t
_cairo_ft_font_glyph_extents (void *abstract_font,
- cairo_font_scale_t *sc,
cairo_glyph_t *glyphs,
int num_glyphs,
cairo_text_extents_t *extents)
@@ -670,14 +861,13 @@ _cairo_ft_font_glyph_extents (void *abstract_font,
return CAIRO_STATUS_NO_MEMORY;
}
- key.unscaled = &font->base;
- key.scale = *sc;
+ _cairo_ft_font_get_glyph_cache_key (font, &key);
for (i = 0; i < num_glyphs; i++)
{
img = NULL;
key.index = glyphs[i].index;
- if (_cairo_cache_lookup (cache, &key, (void **) &img)
+ if (_cairo_cache_lookup (cache, &key, (void **) &img, NULL)
!= CAIRO_STATUS_SUCCESS || img == NULL)
continue;
@@ -721,7 +911,6 @@ _cairo_ft_font_glyph_extents (void *abstract_font,
static cairo_status_t
_cairo_ft_font_glyph_bbox (void *abstract_font,
- cairo_font_scale_t *sc,
const cairo_glyph_t *glyphs,
int num_glyphs,
cairo_box_t *bbox)
@@ -747,16 +936,15 @@ _cairo_ft_font_glyph_bbox (void *abstract_font,
return CAIRO_STATUS_NO_MEMORY;
}
- key.unscaled = &font->base;
- key.scale = *sc;
-
+ _cairo_ft_font_get_glyph_cache_key (font, &key);
+
for (i = 0; i < num_glyphs; i++)
{
img = NULL;
key.index = glyphs[i].index;
- if (_cairo_cache_lookup (cache, &key, (void **) &img)
+ if (_cairo_cache_lookup (cache, &key, (void **) &img, NULL)
!= CAIRO_STATUS_SUCCESS || img == NULL)
continue;
@@ -785,12 +973,15 @@ _cairo_ft_font_glyph_bbox (void *abstract_font,
static cairo_status_t
_cairo_ft_font_show_glyphs (void *abstract_font,
- cairo_font_scale_t *sc,
cairo_operator_t operator,
- cairo_surface_t *source,
+ cairo_pattern_t *pattern,
cairo_surface_t *surface,
int source_x,
int source_y,
+ int dest_x,
+ int dest_y,
+ unsigned int width,
+ unsigned int height,
const cairo_glyph_t *glyphs,
int num_glyphs)
{
@@ -798,9 +989,9 @@ _cairo_ft_font_show_glyphs (void *abstract_font,
cairo_cache_t *cache;
cairo_glyph_cache_key_t key;
cairo_ft_font_t *font = abstract_font;
+ cairo_surface_pattern_t glyph_pattern;
cairo_status_t status;
-
- double x, y;
+ int x, y;
int i;
_cairo_lock_global_image_glyph_cache ();
@@ -808,47 +999,54 @@ _cairo_ft_font_show_glyphs (void *abstract_font,
if (cache == NULL
|| font == NULL
- || source == NULL
+ || pattern == NULL
|| surface == NULL
|| glyphs == NULL) {
_cairo_unlock_global_image_glyph_cache ();
return CAIRO_STATUS_NO_MEMORY;
}
- key.unscaled = &font->base;
- key.scale = *sc;
+ key.unscaled = (cairo_unscaled_font_t *)font->unscaled;
+ key.scale = font->base.scale;
+ key.flags = font->load_flags;
for (i = 0; i < num_glyphs; i++)
{
img = NULL;
key.index = glyphs[i].index;
- if (_cairo_cache_lookup (cache, &key, (void **) &img)
+ if (_cairo_cache_lookup (cache, &key, (void **) &img, NULL)
!= CAIRO_STATUS_SUCCESS
|| img == NULL
|| img->image == NULL)
continue;
- x = glyphs[i].x;
- y = glyphs[i].y;
+ x = (int) floor (glyphs[i].x + 0.5);
+ y = (int) floor (glyphs[i].y + 0.5);
+
+ _cairo_pattern_init_for_surface (&glyph_pattern, &(img->image->base));
- status = _cairo_surface_composite (operator, source,
- &(img->image->base),
+ status = _cairo_surface_composite (operator, pattern,
+ &glyph_pattern.base,
surface,
- source_x + x + img->size.x,
- source_y + y + img->size.y,
+ x + img->size.x,
+ y + img->size.y,
0, 0,
x + img->size.x,
y + img->size.y,
(double) img->size.width,
(double) img->size.height);
+ _cairo_pattern_fini (&glyph_pattern.base);
+
if (status) {
- _cairo_unlock_global_image_glyph_cache ();
+ _cairo_unlock_global_image_glyph_cache ();
return status;
}
}
+
_cairo_unlock_global_image_glyph_cache ();
+
return CAIRO_STATUS_SUCCESS;
}
@@ -932,7 +1130,6 @@ _cubic_to (FT_Vector *control1, FT_Vector *control2, FT_Vector *to, void *closur
static cairo_status_t
_cairo_ft_font_glyph_path (void *abstract_font,
- cairo_font_scale_t *sc,
cairo_glyph_t *glyphs,
int num_glyphs,
cairo_path_t *path)
@@ -940,6 +1137,7 @@ _cairo_ft_font_glyph_path (void *abstract_font,
int i;
cairo_ft_font_t *font = abstract_font;
FT_GlyphSlot glyph;
+ FT_Face face;
FT_Error error;
FT_Outline_Funcs outline_funcs = {
_move_to,
@@ -949,10 +1147,12 @@ _cairo_ft_font_glyph_path (void *abstract_font,
0, /* shift */
0, /* delta */
};
+
+ face = cairo_ft_font_lock_face (abstract_font);
+ if (!face)
+ return CAIRO_STATUS_NO_MEMORY;
- glyph = font->val->face->glyph;
-
- _install_font_scale (sc, font->val->face);
+ glyph = face->glyph;
for (i = 0; i < num_glyphs; i++)
{
@@ -961,7 +1161,7 @@ _cairo_ft_font_glyph_path (void *abstract_font,
0, DOUBLE_TO_16_16 (-1.0),
};
- error = FT_Load_Glyph (font->val->face, glyphs[i].index, FT_LOAD_DEFAULT);
+ error = FT_Load_Glyph (font->unscaled->face, glyphs[i].index, font->load_flags | FT_LOAD_NO_BITMAP);
/* XXX: What to do in this error case? */
if (error)
continue;
@@ -977,32 +1177,39 @@ _cairo_ft_font_glyph_path (void *abstract_font,
FT_Outline_Decompose (&glyph->outline, &outline_funcs, path);
}
_cairo_path_close_path (path);
+
+ cairo_ft_font_unlock_face (abstract_font);
return CAIRO_STATUS_SUCCESS;
}
-
static cairo_status_t
-_cairo_ft_font_create_glyph(cairo_image_glyph_cache_entry_t *val)
+_cairo_ft_font_create_glyph (cairo_image_glyph_cache_entry_t *val)
{
- cairo_ft_font_t *font = (cairo_ft_font_t *)val->key.unscaled;
+ ft_unscaled_font_t *unscaled = (ft_unscaled_font_t *)val->key.unscaled;
FT_GlyphSlot glyphslot;
unsigned int width, height, stride;
+ FT_Face face;
FT_Outline *outline;
FT_BBox cbox;
FT_Bitmap bitmap;
FT_Glyph_Metrics *metrics;
- ft_font_transform_t sf;
+ cairo_status_t status = CAIRO_STATUS_SUCCESS;
- glyphslot = font->val->face->glyph;
+ glyphslot = unscaled->face->glyph;
metrics = &glyphslot->metrics;
- _cairo_ft_font_compute_transform (&sf, &val->key.scale);
- _cairo_ft_font_install_transform (&sf, font->val->face);
-
- if (FT_Load_Glyph (font->val->face, val->key.index, FT_LOAD_DEFAULT) != 0)
+ face = _ft_unscaled_font_lock_face (unscaled);
+ if (!face)
return CAIRO_STATUS_NO_MEMORY;
+ _ft_unscaled_font_set_scale (unscaled, &val->key.scale);
+
+ if (FT_Load_Glyph (face, val->key.index, val->key.flags) != 0) {
+ status = CAIRO_STATUS_NO_MEMORY;
+ goto FAIL;
+ }
+
/*
* Note: the font's coordinate system is upside down from ours, so the
* Y coordinates of the bearing and advance need to be negated.
@@ -1011,11 +1218,11 @@ _cairo_ft_font_create_glyph(cairo_image_glyph_cache_entry_t *val)
* by FreeType
*/
- val->extents.x_bearing = DOUBLE_FROM_26_6 (metrics->horiBearingX) / sf.x_scale;
- val->extents.y_bearing = -DOUBLE_FROM_26_6 (metrics->horiBearingY) / sf.y_scale;
+ val->extents.x_bearing = DOUBLE_FROM_26_6 (metrics->horiBearingX) / unscaled->x_scale;
+ val->extents.y_bearing = -DOUBLE_FROM_26_6 (metrics->horiBearingY) / unscaled->y_scale;
- val->extents.width = DOUBLE_FROM_26_6 (metrics->width) / sf.x_scale;
- val->extents.height = DOUBLE_FROM_26_6 (metrics->height) / sf.y_scale;
+ val->extents.width = DOUBLE_FROM_26_6 (metrics->width) / unscaled->x_scale;
+ val->extents.height = DOUBLE_FROM_26_6 (metrics->height) / unscaled->y_scale;
/*
* use untransformed advance values
@@ -1023,8 +1230,8 @@ _cairo_ft_font_create_glyph(cairo_image_glyph_cache_entry_t *val)
should provide FT_LOAD_VERTICAL_LAYOUT
*/
- val->extents.x_advance = DOUBLE_FROM_26_6 (font->val->face->glyph->metrics.horiAdvance) / sf.x_scale;
- val->extents.y_advance = 0 / sf.y_scale;
+ val->extents.x_advance = DOUBLE_FROM_26_6 (face->glyph->metrics.horiAdvance) / unscaled->x_scale;
+ val->extents.y_advance = 0 / unscaled->y_scale;
outline = &glyphslot->outline;
@@ -1052,14 +1259,16 @@ _cairo_ft_font_create_glyph(cairo_image_glyph_cache_entry_t *val)
bitmap.buffer = calloc (1, stride * height);
if (bitmap.buffer == NULL) {
- return CAIRO_STATUS_NO_MEMORY;
- };
+ status = CAIRO_STATUS_NO_MEMORY;
+ goto FAIL;
+ }
FT_Outline_Translate (outline, -cbox.xMin, -cbox.yMin);
if (FT_Outline_Get_Bitmap (glyphslot->library, outline, &bitmap) != 0) {
free (bitmap.buffer);
- return CAIRO_STATUS_NO_MEMORY;
+ status = CAIRO_STATUS_NO_MEMORY;
+ goto FAIL;
}
val->image = (cairo_image_surface_t *)
@@ -1068,7 +1277,8 @@ _cairo_ft_font_create_glyph(cairo_image_glyph_cache_entry_t *val)
width, height, stride);
if (val->image == NULL) {
free (bitmap.buffer);
- return CAIRO_STATUS_NO_MEMORY;
+ status = CAIRO_STATUS_NO_MEMORY;
+ goto FAIL;
}
_cairo_image_surface_assume_ownership_of_data (val->image);
@@ -1084,138 +1294,245 @@ _cairo_ft_font_create_glyph(cairo_image_glyph_cache_entry_t *val)
val->size.x = (short) (cbox.xMin >> 6);
val->size.y = - (short) (cbox.yMax >> 6);
- return CAIRO_STATUS_SUCCESS;
+ FAIL:
+ _ft_unscaled_font_unlock_face (unscaled);
+
+ return status;
}
const cairo_font_backend_t cairo_ft_font_backend = {
_cairo_ft_font_create,
- _cairo_ft_font_destroy,
+ _cairo_ft_font_destroy_font,
+ _cairo_ft_font_destroy_unscaled_font,
_cairo_ft_font_font_extents,
_cairo_ft_font_text_to_glyphs,
_cairo_ft_font_glyph_extents,
_cairo_ft_font_glyph_bbox,
_cairo_ft_font_show_glyphs,
_cairo_ft_font_glyph_path,
+ _cairo_ft_font_get_glyph_cache_key,
_cairo_ft_font_create_glyph
};
-
/* implement the platform-specific interface */
+/**
+ * cairo_ft_font_create:
+ * @pattern: A fully resolved fontconfig
+ * pattern. A pattern can be resolved, by, among other things, calling
+ * FcConfigSubstitute(), FcDefaultSubstitute(), then
+ * FcFontMatch(). Cairo will call FcPatternReference() on this
+ * pattern, so you should not further modify the pattern, but you can
+ * release your reference to the pattern with FcPatternDestroy() if
+ * you no longer need to access it.
+ * @scale: The scale at which this font will be used. The
+ * scale is given by multiplying the font matrix (see
+ * cairo_transform_font()) by the current transformation matrix.
+ * The translation elements of the resulting matrix are ignored.
+ *
+ * Creates a new font for the FreeType font backend based on a
+ * fontconfig pattern. This font can then be used with
+ * cairo_set_font(), cairo_font_glyph_extents(), or FreeType backend
+ * specific functions like cairo_ft_font_lock_face().
+ *
+ * Return value: a newly created #cairo_font_t. Free with
+ * cairo_font_destroy() when you are done using it.
+ **/
cairo_font_t *
-cairo_ft_font_create (FT_Library ft_library, FcPattern *pattern)
+cairo_ft_font_create (FcPattern *pattern,
+ cairo_matrix_t *scale)
{
- cairo_font_scale_t scale;
- cairo_font_t *scaled;
- cairo_ft_font_t *f = NULL;
- ft_font_val_t *v = NULL;
- FcPattern *dup;
-
- scale.matrix[0][0] = 1.;
- scale.matrix[0][1] = 0.;
- scale.matrix[1][0] = 0.;
- scale.matrix[1][1] = 1.;
-
- scaled = malloc (sizeof (cairo_font_t));
- if (scaled == NULL)
- goto FAIL;
-
- dup = FcPatternDuplicate(pattern);
- if (dup == NULL)
- goto FREE_SCALED;
-
- v = _create_from_library_and_pattern (ft_library, pattern);
- if (v == NULL)
- goto FREE_PATTERN;
-
- f = malloc (sizeof(cairo_ft_font_t));
- if (f == NULL)
- goto FREE_VAL;
-
- if (_cairo_unscaled_font_init (&f->base, &cairo_ft_font_backend))
- goto FREE_VAL;
-
- f->pattern = dup;
- f->val = v;
-
- _cairo_font_init (scaled, &scale, &f->base);
-
- return scaled;
-
- FREE_VAL:
- _destroy_font_val (v);
-
- FREE_PATTERN:
- FcPatternDestroy (dup);
+ cairo_font_scale_t sc;
+ double tx, ty;
- FREE_SCALED:
- free (scaled);
+ cairo_matrix_get_affine (scale,
+ &sc.matrix[0][0], &sc.matrix[0][1],
+ &sc.matrix[1][0], &sc.matrix[1][1],
+ &tx, &ty);
- FAIL:
- return NULL;
+ return _ft_font_create (pattern, &sc);
}
+/**
+ * cairo_ft_font_create_for_ft_face:
+ * @face: A FreeType face object, already opened. This must
+ * be kept around until the font object's refcount drops to
+ * zero and it is freed. The font object can be kept alive by
+ * internal caching, so it's safest to keep the face object
+ * around forever.
+ * @load_flags: The flags to pass to FT_Load_Glyph when loading
+ * glyphs from the font. These flags control aspects of
+ * rendering such as hinting and antialiasing. See the FreeType
+ * docs for full information.
+ * @scale: The scale at which this font will be used. The
+ * scale is given by multiplying the font matrix (see
+ * cairo_transform_font()) by the current transformation matrix.
+ * The translation elements of the resulting matrix are ignored.
+ *
+ * Creates a new font forthe FreeType font backend from a pre-opened
+ * FreeType face. This font can then be used with cairo_set_font(),
+ * cairo_font_glyph_extents(), or FreeType backend specific
+ * functions like cairo_ft_font_lock_face() Cairo will determine the
+ * pixel size and transformation from the @scale parameter and call
+ * FT_Set_Transform() and FT_Set_Pixel_Sizes().
+ *
+ * Return value: a newly created #cairo_font_t. Free with
+ * cairo_font_destroy() when you are done using it.
+ **/
cairo_font_t *
-cairo_ft_font_create_for_ft_face (FT_Face face)
+cairo_ft_font_create_for_ft_face (FT_Face face,
+ int load_flags,
+ cairo_matrix_t *scale)
{
- cairo_font_scale_t scale;
- cairo_font_t *scaled;
cairo_ft_font_t *f = NULL;
- ft_font_val_t *v = NULL;
-
- scale.matrix[0][0] = 1.;
- scale.matrix[0][1] = 0.;
- scale.matrix[1][0] = 0.;
- scale.matrix[1][1] = 1.;
-
- scaled = malloc (sizeof (cairo_font_t));
- if (scaled == NULL)
- goto FAIL;
+ ft_unscaled_font_t *unscaled = NULL;
+ cairo_font_scale_t sc;
+ double tx, ty;
- v = _create_from_face (face, 0);
- if (v == NULL)
- goto FREE_SCALED;
+ unscaled = _ft_unscaled_font_create_from_face (face);
+ if (unscaled == NULL)
+ return NULL;
f = malloc (sizeof(cairo_ft_font_t));
if (f == NULL)
- goto FREE_VAL;
+ goto FREE_UNSCALED;
- _cairo_unscaled_font_init (&f->base, &cairo_ft_font_backend);
+ f->unscaled = unscaled;
f->pattern = NULL;
- f->val = v;
+ f->load_flags = load_flags;
- _cairo_font_init (scaled, &scale, &f->base);
+ cairo_matrix_get_affine (scale,
+ &sc.matrix[0][0], &sc.matrix[0][1],
+ &sc.matrix[1][0], &sc.matrix[1][1],
+ &tx, &ty);
- return scaled;
+ _cairo_font_init ((cairo_font_t *)f, &sc, &cairo_ft_font_backend);
- FREE_VAL:
- _destroy_font_val (v);
+ return (cairo_font_t *)f;
- FREE_SCALED:
- free (scaled);
+ FREE_UNSCALED:
+ _cairo_unscaled_font_destroy ((cairo_unscaled_font_t *)unscaled);
- FAIL:
return NULL;
}
+
+/**
+ * cairo_ft_font_lock_face:
+ * @ft_font: A #cairo_font_t from the FreeType font backend. Such an
+ * object can be created with cairo_ft_font_create() or
+ * cairo_ft_font_create_for_ft_face(). On some platforms the font from
+ * cairo_current_font() will also be a FreeType font, but using this
+ * functionality with fonts you don't create yourself is not
+ * recommended.
+ *
+ * cairo_ft_font_lock_face() gets the #FT_Face object from a FreeType
+ * backend font and scales it appropriately for the font. You must
+ * release the face with cairo_ft_font_unlock_face()
+ * when you are done using it. Since the #FT_Face object can be
+ * shared between multiple #cairo_font_t objects, you must not
+ * lock any other font objects until you unlock this one. A count is
+ * kept of the number of times cairo_ft_font_lock_face() is
+ * called. cairo_ft_font_unlock_face() must be called the same number
+ * of times.
+ *
+ * You must be careful when using this function in a library or in a
+ * threaded application, because other threads may lock faces that
+ * share the same #FT_Face object. For this reason, you must call
+ * cairo_ft_lock() before locking any face objects, and
+ * cairo_ft_unlock() after you are done. (These functions are not yet
+ * implemented, so this function cannot be currently safely used in a
+ * threaded application.)
+
+ * Return value: The #FT_Face object for @font, scaled appropriately.
+ **/
FT_Face
-cairo_ft_font_face (cairo_font_t *abstract_font)
+cairo_ft_font_lock_face (cairo_font_t *abstract_font)
{
- cairo_ft_font_t *font = (cairo_ft_font_t *) abstract_font->unscaled;
+ cairo_ft_font_t *font = (cairo_ft_font_t *) abstract_font;
+ FT_Face face;
- if (font == NULL || font->val == NULL)
- return NULL;
+ face = _ft_unscaled_font_lock_face (font->unscaled);
+ if (!face)
+ return NULL;
+
+ _ft_unscaled_font_set_scale (font->unscaled, &font->base.scale);
+
+ return face;
+}
- return font->val->face;
+/**
+ * cairo_ft_font_unlock_face:
+ * @ft_font: A #cairo_font_t from the FreeType font backend. Such an
+ * object can be created with cairo_ft_font_create() or
+ * cairo_ft_font_create_for_ft_face(). On some platforms the font from
+ * cairo_current_font() will also be a FreeType font, but using this
+ * functionality with fonts you don't create yourself is not
+ * recommended.
+ *
+ * Releases a face obtained with cairo_ft_font_lock_face(). See the
+ * documentation for that function for full details.
+ **/
+void
+cairo_ft_font_unlock_face (cairo_font_t *abstract_font)
+{
+ cairo_ft_font_t *font = (cairo_ft_font_t *) abstract_font;
+
+ _ft_unscaled_font_unlock_face (font->unscaled);
}
+/**
+ * cairo_ft_font_get_pattern:
+ * @ft_font: A #cairo_font_t from the FreeType font backend. Such an
+ * object can be created with cairo_ft_font_create() or
+ * cairo_ft_font_create_for_ft_face(). On some platforms the font from
+ * cairo_current_font() will also be a FreeType font, but using this
+ * functionality with fonts you don't create yourself is not
+ * recommended.
+ *
+ * cairo_ft_font_get_pattern() gets the #FcPattern for a FreeType
+ * backend font.
+
+ * Return value: The #FcPattenr for @font. The return value is owned
+ * by the font, so you must not modify it, and must call
+ * FcPatternReference() to keep a persistant reference to the
+ * pattern. If the font was created with cairo_ft_font_create_for_ft_face()
+ * returns %NULL.
+ **/
FcPattern *
-cairo_ft_font_pattern (cairo_font_t *abstract_font)
+cairo_ft_font_get_pattern (cairo_font_t *abstract_font)
{
- cairo_ft_font_t *font = (cairo_ft_font_t *) abstract_font->unscaled;
+ cairo_ft_font_t *font = (cairo_ft_font_t *) abstract_font;
if (font == NULL)
return NULL;
return font->pattern;
}
+
+/* We expose our unscaled font implementation internally for the the
+ * PDF backend, which needs to keep track of the the different
+ * fonts-on-disk used by a document, so it can embed them.
+ */
+cairo_unscaled_font_t *
+_cairo_ft_font_get_unscaled_font (cairo_font_t *abstract_font)
+{
+ cairo_ft_font_t *font = (cairo_ft_font_t *) abstract_font;
+
+ return (cairo_unscaled_font_t *)font->unscaled;
+}
+
+/* This differs from _cairo_ft_scaled_font_lock_face in that it doesn't
+ * set the scale on the face, but just returns it at the last scale.
+ */
+FT_Face
+_cairo_ft_unscaled_font_lock_face (cairo_unscaled_font_t *unscaled_font)
+{
+ return _ft_unscaled_font_lock_face ((ft_unscaled_font_t *)unscaled_font);
+}
+
+void
+_cairo_ft_unscaled_font_unlock_face (cairo_unscaled_font_t *unscaled_font)
+{
+ _ft_unscaled_font_unlock_face ((ft_unscaled_font_t *)unscaled_font);
+}
diff --git a/src/cairo-ft-private.h b/src/cairo-ft-private.h
new file mode 100644
index 000000000..37a6feecc
--- /dev/null
+++ b/src/cairo-ft-private.h
@@ -0,0 +1,63 @@
+/* cairo - a vector graphics library with display and print output
+ *
+ * Copyright © 2005 Red Hat, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it either under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation
+ * (the "LGPL") or, at your option, under the terms of the Mozilla
+ * Public License Version 1.1 (the "MPL"). If you do not alter this
+ * notice, a recipient may use your version of this file under either
+ * the MPL or the LGPL.
+ *
+ * You should have received a copy of the LGPL along with this library
+ * in the file COPYING-LGPL-2.1; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the MPL along with this library
+ * in the file COPYING-MPL-1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
+ * OF ANY KIND, either express or implied. See the LGPL or the MPL for
+ * the specific language governing rights and limitations.
+ *
+ * The Original Code is the cairo graphics library.
+ *
+ * The Initial Developer of the Original Code is Red Hat, Inc.
+ *
+ * Contributor(s):
+ * Graydon Hoare <graydon@redhat.com>
+ * Owen Taylor <otaylor@redhat.com>
+ */
+
+#ifndef CAIRO_FT_PRIVATE_H
+#define CAIRO_FT_PRIVATE_H
+
+#include <cairo-ft.h>
+#include <cairoint.h>
+
+#ifdef CAIRO_HAS_FT_FONT
+
+CAIRO_BEGIN_DECLS
+
+/* These functions are needed by the PDF backend, which needs to keep track of the
+ * the different fonts-on-disk used by a document, so it can embed them
+ */
+cairo_private cairo_unscaled_font_t *
+_cairo_ft_font_get_unscaled_font (cairo_font_t *font);
+
+cairo_private FT_Face
+_cairo_ft_unscaled_font_lock_face (cairo_unscaled_font_t *unscaled_font);
+
+cairo_private void
+_cairo_ft_unscaled_font_unlock_face (cairo_unscaled_font_t *unscaled_font);
+
+CAIRO_END_DECLS
+
+#endif /* CAIRO_HAS_FT_FONT */
+
+#endif /* CAIRO_FT_PRIVATE_H */
diff --git a/src/cairo-ft.h b/src/cairo-ft.h
index 57d439ab2..f10c67d80 100644
--- a/src/cairo-ft.h
+++ b/src/cairo-ft.h
@@ -1,6 +1,6 @@
/* cairo - a vector graphics library with display and print output
*
- * Copyright © 2002 University of Southern California
+ * Copyright © 2005 Red Hat, Inc
*
* This library is free software; you can redistribute it and/or
* modify it either under the terms of the GNU Lesser General Public
@@ -27,17 +27,18 @@
*
* The Original Code is the cairo graphics library.
*
- * The Initial Developer of the Original Code is University of Southern
- * California.
+ * The Initial Developer of the Original Code is Red Hat, Inc.
*
* Contributor(s):
- * Carl D. Worth <cworth@isi.edu>
+ * Graydon Hoare <graydon@redhat.com>
+ * Owen Taylor <otaylor@redhat.com>
*/
-#include <cairo.h>
-
#ifndef CAIRO_FT_H
#define CAIRO_FT_H
+
+#include <cairo.h>
+
#ifdef CAIRO_HAS_FT_FONT
/* Fontconfig/Freetype platform-specific font interface */
@@ -46,17 +47,27 @@
#include <ft2build.h>
#include FT_FREETYPE_H
+CAIRO_BEGIN_DECLS
+
cairo_font_t *
-cairo_ft_font_create (FT_Library ft_library, FcPattern *pattern);
+cairo_ft_font_create (FcPattern *pattern,
+ cairo_matrix_t *scale);
cairo_font_t *
-cairo_ft_font_create_for_ft_face (FT_Face face);
+cairo_ft_font_create_for_ft_face (FT_Face face,
+ int load_flags,
+ cairo_matrix_t *scale);
FT_Face
-cairo_ft_font_face (cairo_font_t *ft_font);
+cairo_ft_font_lock_face (cairo_font_t *ft_font);
+
+void
+cairo_ft_font_unlock_face (cairo_font_t *ft_font);
FcPattern *
-cairo_ft_font_pattern (cairo_font_t *ft_font);
+cairo_ft_font_get_pattern (cairo_font_t *ft_font);
+
+CAIRO_END_DECLS
#endif /* CAIRO_HAS_FT_FONT */
#endif /* CAIRO_FT_H */
diff --git a/src/cairo-glitz-surface.c b/src/cairo-glitz-surface.c
index 69fc82f2e..ee664e1cc 100644
--- a/src/cairo-glitz-surface.c
+++ b/src/cairo-glitz-surface.c
@@ -21,30 +21,12 @@
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * Author: David Reveman <c99drn@cs.umu.se>
+ * Author: David Reveman <davidr@novell.com>
*/
#include "cairoint.h"
#include "cairo-glitz.h"
-#define GLITZ_FIXED_TO_FLOAT(f) \
- (((glitz_float_t) (f)) / 65536)
-
-#define GLITZ_FIXED_LINE_X_TO_FLOAT(line, v) \
- (((glitz_float_t) \
- ((line).p1.x + (cairo_fixed_16_16_t) \
- (((cairo_fixed_32_32_t) ((v) - (line).p1.y) * \
- ((line).p2.x - (line).p1.x)) / \
- ((line).p2.y - (line).p1.y)))) / 65536)
-
-#define GLITZ_FIXED_LINE_X_CEIL_TO_FLOAT(line, v) \
- (((glitz_float_t) \
- ((line).p1.x + (cairo_fixed_16_16_t) \
- (((((line).p2.y - (line).p1.y) - 1) + \
- ((cairo_fixed_32_32_t) ((v) - (line).p1.y) * \
- ((line).p2.x - (line).p1.x))) / \
- ((line).p2.y - (line).p1.y)))) / 65536)
-
void
cairo_set_target_glitz (cairo_t *cr, glitz_surface_t *surface)
{
@@ -65,13 +47,11 @@ cairo_set_target_glitz (cairo_t *cr, glitz_surface_t *surface)
}
typedef struct _cairo_glitz_surface {
- cairo_surface_t base;
-
- glitz_surface_t *surface;
- glitz_format_t *format;
+ cairo_surface_t base;
- cairo_pattern_t pattern;
- cairo_box_t pattern_box;
+ glitz_surface_t *surface;
+ glitz_format_t *format;
+ pixman_region16_t *clip;
} cairo_glitz_surface_t;
static void
@@ -79,11 +59,60 @@ _cairo_glitz_surface_destroy (void *abstract_surface)
{
cairo_glitz_surface_t *surface = abstract_surface;
+ if (surface->clip)
+ {
+ glitz_surface_set_clip_region (surface->surface, 0, 0, NULL, 0);
+ pixman_region_destroy (surface->clip);
+ }
+
glitz_surface_destroy (surface->surface);
+ free (surface);
+}
- _cairo_pattern_fini (&surface->pattern);
+static glitz_format_name_t
+_glitz_format (cairo_format_t format)
+{
+ switch (format) {
+ default:
+ case CAIRO_FORMAT_ARGB32:
+ return GLITZ_STANDARD_ARGB32;
+ case CAIRO_FORMAT_RGB24:
+ return GLITZ_STANDARD_RGB24;
+ case CAIRO_FORMAT_A8:
+ return GLITZ_STANDARD_A8;
+ case CAIRO_FORMAT_A1:
+ return GLITZ_STANDARD_A1;
+ }
+}
- free (surface);
+static cairo_surface_t *
+_cairo_glitz_surface_create_similar (void *abstract_src,
+ cairo_format_t format,
+ int draw,
+ int width,
+ int height)
+{
+ cairo_glitz_surface_t *src = abstract_src;
+ cairo_surface_t *crsurface;
+ glitz_drawable_t *drawable;
+ glitz_surface_t *surface;
+ glitz_format_t *gformat;
+
+ drawable = glitz_surface_get_drawable (src->surface);
+
+ gformat = glitz_find_standard_format (drawable, _glitz_format (format));
+ if (!gformat)
+ return NULL;
+
+ surface = glitz_surface_create (drawable, gformat, width, height, 0, NULL);
+ if (!surface)
+ return NULL;
+
+ crsurface = cairo_glitz_surface_create (surface);
+
+ glitz_surface_destroy (surface);
+
+ return crsurface;
}
static double
@@ -92,31 +121,54 @@ _cairo_glitz_surface_pixels_per_inch (void *abstract_surface)
return 96.0;
}
-static cairo_image_surface_t *
-_cairo_glitz_surface_get_image (void *abstract_surface)
+static cairo_status_t
+_cairo_glitz_surface_get_image (cairo_glitz_surface_t *surface,
+ cairo_rectangle_t *interest,
+ cairo_image_surface_t **image_out,
+ cairo_rectangle_t *rect_out)
{
- cairo_glitz_surface_t *surface = abstract_surface;
cairo_image_surface_t *image;
- char *pixels;
- int width, height;
- cairo_format_masks_t format;
- glitz_buffer_t *buffer;
- glitz_pixel_format_t pf;
-
- if (surface->pattern.type != CAIRO_PATTERN_SURFACE) {
- cairo_box_t box;
-
- box.p1.x = box.p1.y = 0;
- box.p2.x = surface->pattern_box.p2.x;
- box.p2.y = surface->pattern_box.p2.y;
-
- return _cairo_pattern_get_image (&surface->pattern, &box);
+ int x1, y1, x2, y2;
+ int width, height;
+ char *pixels;
+ cairo_format_masks_t format;
+ glitz_buffer_t *buffer;
+ glitz_pixel_format_t pf;
+
+ x1 = 0;
+ y1 = 0;
+ x2 = glitz_surface_get_width (surface->surface);
+ y2 = glitz_surface_get_height (surface->surface);
+
+ if (interest)
+ {
+ if (interest->x > x1)
+ x1 = interest->x;
+ if (interest->y > y1)
+ y1 = interest->y;
+ if (interest->x + interest->width < x2)
+ x2 = interest->x + interest->width;
+ if (interest->y + interest->height < y2)
+ y2 = interest->y + interest->height;
+
+ if (x1 >= x2 || y1 >= y2)
+ {
+ *image_out = NULL;
+ return CAIRO_STATUS_SUCCESS;
+ }
}
+ width = x2 - x1;
+ height = y2 - y1;
- width = glitz_surface_get_width (surface->surface);
- height = glitz_surface_get_height (surface->surface);
-
+ if (rect_out)
+ {
+ rect_out->x = x1;
+ rect_out->y = y1;
+ rect_out->width = width;
+ rect_out->height = height;
+ }
+
if (surface->format->type == GLITZ_FORMAT_TYPE_COLOR) {
if (surface->format->color.red_size > 0) {
format.bpp = 32;
@@ -149,21 +201,24 @@ _cairo_glitz_surface_get_image (void *abstract_surface)
pf.masks.blue_mask = format.blue_mask;
pf.xoffset = 0;
pf.skip_lines = 0;
+
+ /* XXX: we should eventually return images with negative stride,
+ need to verify that libpixman have no problem with this first. */
pf.bytes_per_line = (((width * format.bpp) / 8) + 3) & -4;
pf.scanline_order = GLITZ_PIXEL_SCANLINE_ORDER_TOP_DOWN;
pixels = malloc (height * pf.bytes_per_line);
if (!pixels)
- return NULL;
+ return CAIRO_STATUS_NO_MEMORY;
buffer = glitz_buffer_create_for_data (pixels);
if (!buffer) {
free (pixels);
- return NULL;
+ return CAIRO_STATUS_NO_MEMORY;
}
glitz_get_pixels (surface->surface,
- 0, 0,
+ x1, y1,
width, height,
&pf,
buffer);
@@ -175,27 +230,38 @@ _cairo_glitz_surface_get_image (void *abstract_surface)
&format,
width, height,
pf.bytes_per_line);
-
+
+ if (!image)
+ {
+ free (pixels);
+ return CAIRO_STATUS_NO_MEMORY;
+ }
+
_cairo_image_surface_assume_ownership_of_data (image);
_cairo_image_surface_set_repeat (image, surface->base.repeat);
_cairo_image_surface_set_matrix (image, &(surface->base.matrix));
- return image;
+ *image_out = image;
+
+ return CAIRO_STATUS_SUCCESS;
}
static cairo_status_t
-_cairo_glitz_surface_set_image (void *abstract_surface,
- cairo_image_surface_t *image)
+_cairo_glitz_surface_set_image (void *abstract_surface,
+ cairo_image_surface_t *image,
+ int x_dst,
+ int y_dst)
{
cairo_glitz_surface_t *surface = abstract_surface;
- glitz_buffer_t *buffer;
- glitz_pixel_format_t pf;
- pixman_format_t *format;
- int am, rm, gm, bm;
+ glitz_buffer_t *buffer;
+ glitz_pixel_format_t pf;
+ pixman_format_t *format;
+ int am, rm, gm, bm;
+ char *data;
format = pixman_image_get_format (image->pixman_image);
- if (format == NULL)
+ if (!format)
return CAIRO_STATUS_NO_MEMORY;
pixman_format_get_masks (format, &pf.masks.bpp, &am, &rm, &gm, &bm);
@@ -206,15 +272,27 @@ _cairo_glitz_surface_set_image (void *abstract_surface,
pf.masks.blue_mask = bm;
pf.xoffset = 0;
pf.skip_lines = 0;
- pf.bytes_per_line = image->stride;
- pf.scanline_order = GLITZ_PIXEL_SCANLINE_ORDER_TOP_DOWN;
- buffer = glitz_buffer_create_for_data (image->data);
+ /* check for negative stride */
+ if (image->stride < 0)
+ {
+ pf.bytes_per_line = -image->stride;
+ pf.scanline_order = GLITZ_PIXEL_SCANLINE_ORDER_BOTTOM_UP;
+ data = (char *) image->data + image->stride * (image->height - 1);
+ }
+ else
+ {
+ pf.bytes_per_line = image->stride;
+ pf.scanline_order = GLITZ_PIXEL_SCANLINE_ORDER_TOP_DOWN;
+ data = (char *) image->data;
+ }
+
+ buffer = glitz_buffer_create_for_data (data);
if (!buffer)
return CAIRO_STATUS_NO_MEMORY;
glitz_set_pixels (surface->surface,
- 0, 0,
+ x_dst, y_dst,
image->width, image->height,
&pf,
buffer);
@@ -225,63 +303,118 @@ _cairo_glitz_surface_set_image (void *abstract_surface,
}
static cairo_status_t
-_cairo_glitz_surface_set_matrix (void *abstract_surface,
- cairo_matrix_t *matrix)
+_cairo_glitz_surface_acquire_source_image (void *abstract_surface,
+ cairo_image_surface_t **image_out,
+ void **image_extra)
{
cairo_glitz_surface_t *surface = abstract_surface;
- glitz_transform_t transform;
- transform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]);
- transform.matrix[0][1] = _cairo_fixed_from_double (matrix->m[1][0]);
- transform.matrix[0][2] = _cairo_fixed_from_double (matrix->m[2][0]);
+ *image_extra = NULL;
+
+ return _cairo_glitz_surface_get_image (surface, NULL, image_out, NULL);
+}
- transform.matrix[1][0] = _cairo_fixed_from_double (matrix->m[0][1]);
- transform.matrix[1][1] = _cairo_fixed_from_double (matrix->m[1][1]);
- transform.matrix[1][2] = _cairo_fixed_from_double (matrix->m[2][1]);
+static void
+_cairo_glitz_surface_release_source_image (void *abstract_surface,
+ cairo_image_surface_t *image,
+ void *image_extra)
+{
+ cairo_surface_destroy (&image->base);
+}
- transform.matrix[2][0] = 0;
- transform.matrix[2][1] = 0;
- transform.matrix[2][2] = 1 << 16;
+static cairo_status_t
+_cairo_glitz_surface_acquire_dest_image (void *abstract_surface,
+ cairo_rectangle_t *interest_rect,
+ cairo_image_surface_t **image_out,
+ cairo_rectangle_t *image_rect_out,
+ void **image_extra)
+{
+ cairo_glitz_surface_t *surface = abstract_surface;
+ cairo_image_surface_t *image;
+ cairo_status_t status;
- glitz_surface_set_transform (surface->surface, &transform);
+ status = _cairo_glitz_surface_get_image (surface, interest_rect, &image,
+ image_rect_out);
+ if (status)
+ return status;
- return CAIRO_STATUS_SUCCESS;
+ *image_out = image;
+ *image_extra = NULL;
+
+ return status;
}
+static void
+_cairo_glitz_surface_release_dest_image (void *abstract_surface,
+ cairo_rectangle_t *interest_rect,
+ cairo_image_surface_t *image,
+ cairo_rectangle_t *image_rect,
+ void *image_extra)
+{
+ cairo_glitz_surface_t *surface = abstract_surface;
+
+ _cairo_glitz_surface_set_image (surface, image,
+ image_rect->x, image_rect->y);
+
+ cairo_surface_destroy (&image->base);
+}
+
+
static cairo_status_t
-_cairo_glitz_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
+_cairo_glitz_surface_clone_similar (void *abstract_surface,
+ cairo_surface_t *src,
+ cairo_surface_t **clone_out)
{
cairo_glitz_surface_t *surface = abstract_surface;
- glitz_filter_t glitz_filter;
+ cairo_glitz_surface_t *clone;
- switch (filter) {
- case CAIRO_FILTER_FAST:
- case CAIRO_FILTER_NEAREST:
- glitz_filter = GLITZ_FILTER_NEAREST;
- break;
- case CAIRO_FILTER_GOOD:
- case CAIRO_FILTER_BEST:
- case CAIRO_FILTER_BILINEAR:
- default:
- glitz_filter = GLITZ_FILTER_BILINEAR;
- break;
+ if (src->backend == surface->base.backend)
+ {
+ *clone_out = src;
+ cairo_surface_reference (src);
+
+ return CAIRO_STATUS_SUCCESS;
}
+ else if (_cairo_surface_is_image (src))
+ {
+ cairo_image_surface_t *image_src = (cairo_image_surface_t *) src;
+
+ clone = (cairo_glitz_surface_t *)
+ _cairo_glitz_surface_create_similar (surface, image_src->format, 0,
+ image_src->width,
+ image_src->height);
+ if (!clone)
+ return CAIRO_STATUS_NO_MEMORY;
- glitz_surface_set_filter (surface->surface, glitz_filter, NULL, 0);
+ _cairo_glitz_surface_set_image (clone, image_src, 0, 0);
+
+ *clone_out = &clone->base;
- return CAIRO_STATUS_SUCCESS;
+ return CAIRO_STATUS_SUCCESS;
+ }
+
+ return CAIRO_INT_STATUS_UNSUPPORTED;
}
-static cairo_status_t
-_cairo_glitz_surface_set_repeat (void *abstract_surface, int repeat)
+static void
+_cairo_glitz_surface_set_matrix (cairo_glitz_surface_t *surface,
+ cairo_matrix_t *matrix)
{
- cairo_glitz_surface_t *surface = abstract_surface;
+ glitz_transform_t transform;
+
+ transform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]);
+ transform.matrix[0][1] = _cairo_fixed_from_double (matrix->m[1][0]);
+ transform.matrix[0][2] = _cairo_fixed_from_double (matrix->m[2][0]);
- glitz_surface_set_fill (surface->surface,
- (repeat)? GLITZ_FILL_REPEAT:
- GLITZ_FILL_TRANSPARENT);
+ transform.matrix[1][0] = _cairo_fixed_from_double (matrix->m[0][1]);
+ transform.matrix[1][1] = _cairo_fixed_from_double (matrix->m[1][1]);
+ transform.matrix[1][2] = _cairo_fixed_from_double (matrix->m[2][1]);
- return CAIRO_STATUS_SUCCESS;
+ transform.matrix[2][0] = 0;
+ transform.matrix[2][1] = 0;
+ transform.matrix[2][2] = 1 << 16;
+
+ glitz_surface_set_transform (surface->surface, &transform);
}
static glitz_operator_t
@@ -318,32 +451,6 @@ _glitz_operator (cairo_operator_t op)
}
}
-static glitz_surface_t *
-_glitz_surface_create_solid (glitz_surface_t *other,
- glitz_format_name_t format_name,
- glitz_color_t *color)
-{
- glitz_drawable_t *drawable;
- glitz_format_t *format;
- glitz_surface_t *surface;
-
- drawable = glitz_surface_get_drawable (other);
-
- format = glitz_find_standard_format (drawable, format_name);
- if (format == NULL)
- return NULL;
-
- surface = glitz_surface_create (drawable, format, 1, 1);
- if (surface == NULL)
- return NULL;
-
- glitz_set_rectangle (surface, color, 0, 0, 1, 1);
-
- glitz_surface_set_fill (surface, GLITZ_FILL_REPEAT);
-
- return surface;
-}
-
static glitz_status_t
_glitz_ensure_target (glitz_surface_t *surface)
{
@@ -355,7 +462,6 @@ _glitz_ensure_target (glitz_surface_t *surface)
glitz_drawable_format_t templ;
glitz_format_t *format;
glitz_drawable_t *pbuffer;
- glitz_pbuffer_attributes_t attributes;
unsigned long mask;
int i;
@@ -397,21 +503,13 @@ _glitz_ensure_target (glitz_surface_t *surface)
if (!dformat)
return CAIRO_INT_STATUS_UNSUPPORTED;
- attributes.width = glitz_surface_get_width (surface);
- attributes.height = glitz_surface_get_height (surface);
- mask = GLITZ_PBUFFER_WIDTH_MASK | GLITZ_PBUFFER_HEIGHT_MASK;
-
- pbuffer = glitz_create_pbuffer_drawable (drawable, dformat,
- &attributes, mask);
+ pbuffer =
+ glitz_create_pbuffer_drawable (drawable, dformat,
+ glitz_surface_get_width (surface),
+ glitz_surface_get_height (surface));
if (!pbuffer)
return CAIRO_INT_STATUS_UNSUPPORTED;
- if (glitz_drawable_get_width (pbuffer) < attributes.width ||
- glitz_drawable_get_height (pbuffer) < attributes.height) {
- glitz_drawable_destroy (pbuffer);
- return CAIRO_INT_STATUS_UNSUPPORTED;
- }
-
glitz_surface_attach (surface, pbuffer,
GLITZ_DRAWABLE_BUFFER_FRONT_COLOR,
0, 0);
@@ -422,388 +520,711 @@ _glitz_ensure_target (glitz_surface_t *surface)
return CAIRO_STATUS_SUCCESS;
}
-static glitz_format_name_t
-_glitz_format (cairo_format_t format)
+typedef struct _cairo_glitz_surface_attributes {
+ cairo_surface_attributes_t base;
+
+ glitz_fill_t fill;
+ glitz_filter_t filter;
+ glitz_fixed16_16_t *params;
+ int n_params;
+ cairo_bool_t acquired;
+} cairo_glitz_surface_attributes_t;
+
+static cairo_int_status_t
+_cairo_glitz_pattern_acquire_surface (cairo_pattern_t *pattern,
+ cairo_glitz_surface_t *dst,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height,
+ cairo_glitz_surface_t **surface_out,
+ cairo_glitz_surface_attributes_t *attr)
{
- switch (format) {
+ cairo_glitz_surface_t *src = NULL;
+
+ attr->acquired = FALSE;
+
+ switch (pattern->type) {
+ case CAIRO_PATTERN_LINEAR:
+ case CAIRO_PATTERN_RADIAL: {
+ cairo_gradient_pattern_t *gradient =
+ (cairo_gradient_pattern_t *) pattern;
+ glitz_drawable_t *drawable;
+ glitz_fixed16_16_t *params;
+ int n_params;
+ int i;
+ unsigned short alpha;
+
+ /* XXX: the current color gradient acceleration provided by glitz is
+ * experimental, it's been proven inappropriate in a number of ways,
+ * most importantly, it's currently implemented as filters and
+ * gradients are not filters. eventually, it will be replaced with
+ * something more appropriate.
+ */
+
+ if (gradient->n_stops < 2)
+ break;
+
+ /* glitz doesn't support inner and outer circle with different
+ center points. */
+ if (pattern->type == CAIRO_PATTERN_RADIAL)
+ {
+ cairo_radial_pattern_t *grad = (cairo_radial_pattern_t *) pattern;
+
+ if (grad->center0.x != grad->center1.x ||
+ grad->center0.y != grad->center1.y)
+ break;
+ }
+
+ drawable = glitz_surface_get_drawable (dst->surface);
+ if (!(glitz_drawable_get_features (drawable) &
+ GLITZ_FEATURE_FRAGMENT_PROGRAM_MASK))
+ break;
+
+ if (pattern->filter != CAIRO_FILTER_BILINEAR &&
+ pattern->filter != CAIRO_FILTER_GOOD &&
+ pattern->filter != CAIRO_FILTER_BEST)
+ break;
+
+ alpha = (gradient->stops[0].color.alpha * pattern->alpha) * 0xffff;
+ for (i = 1; i < gradient->n_stops; i++)
+ {
+ unsigned short a;
+
+ a = (gradient->stops[i].color.alpha * pattern->alpha) * 0xffff;
+ if (a != alpha)
+ break;
+ }
+
+ /* we can't have color stops with different alpha as gradient color
+ interpolation should be done to unpremultiplied colors. */
+ if (i < gradient->n_stops)
+ break;
+
+ n_params = gradient->n_stops * 3 + 4;
+
+ params = malloc (sizeof (glitz_fixed16_16_t) * n_params);
+ if (!params)
+ return CAIRO_STATUS_NO_MEMORY;
+
+ src = (cairo_glitz_surface_t *)
+ _cairo_surface_create_similar_scratch (&dst->base,
+ CAIRO_FORMAT_ARGB32, 0,
+ gradient->n_stops, 1);
+ if (!src)
+ {
+ free (params);
+ return CAIRO_STATUS_NO_MEMORY;
+ }
+
+ for (i = 0; i < gradient->n_stops; i++) {
+ glitz_color_t color;
+
+ color.red = gradient->stops[i].color.red * alpha;
+ color.green = gradient->stops[i].color.green * alpha;
+ color.blue = gradient->stops[i].color.blue * alpha;
+ color.alpha = alpha;
+
+ glitz_set_rectangle (src->surface, &color, i, 0, 1, 1);
+
+ params[4 + 3 * i] = gradient->stops[i].offset;
+ params[5 + 3 * i] = i << 16;
+ params[6 + 3 * i] = 0;
+ }
+
+ if (pattern->type == CAIRO_PATTERN_LINEAR)
+ {
+ cairo_linear_pattern_t *grad = (cairo_linear_pattern_t *) pattern;
+
+ params[0] = _cairo_fixed_from_double (grad->point0.x);
+ params[1] = _cairo_fixed_from_double (grad->point0.y);
+ params[2] = _cairo_fixed_from_double (grad->point1.x);
+ params[3] = _cairo_fixed_from_double (grad->point1.y);
+ attr->filter = GLITZ_FILTER_LINEAR_GRADIENT;
+ }
+ else
+ {
+ cairo_radial_pattern_t *grad = (cairo_radial_pattern_t *) pattern;
+
+ params[0] = _cairo_fixed_from_double (grad->center0.x);
+ params[1] = _cairo_fixed_from_double (grad->center0.y);
+ params[2] = _cairo_fixed_from_double (grad->radius0);
+ params[3] = _cairo_fixed_from_double (grad->radius1);
+ attr->filter = GLITZ_FILTER_RADIAL_GRADIENT;
+ }
+
+ switch (pattern->extend) {
+ case CAIRO_EXTEND_NONE:
+ attr->fill = GLITZ_FILL_NEAREST;
+ break;
+ case CAIRO_EXTEND_REPEAT:
+ attr->fill = GLITZ_FILL_REPEAT;
+ break;
+ case CAIRO_EXTEND_REFLECT:
+ attr->fill = GLITZ_FILL_REFLECT;
+ break;
+ }
+
+ attr->params = params;
+ attr->n_params = n_params;
+ attr->base.matrix = pattern->matrix;
+ attr->base.x_offset = 0;
+ attr->base.y_offset = 0;
+ } break;
default:
- case CAIRO_FORMAT_ARGB32:
- return GLITZ_STANDARD_ARGB32;
- case CAIRO_FORMAT_RGB24:
- return GLITZ_STANDARD_RGB24;
- case CAIRO_FORMAT_A8:
- return GLITZ_STANDARD_A8;
- case CAIRO_FORMAT_A1:
- return GLITZ_STANDARD_A1;
+ break;
}
-}
-static cairo_surface_t *
-_cairo_glitz_surface_create_similar (void *abstract_src,
- cairo_format_t format,
- int draw,
- int width,
- int height)
-{
- cairo_glitz_surface_t *src = abstract_src;
- cairo_surface_t *crsurface;
- glitz_drawable_t *drawable;
- glitz_surface_t *surface;
- glitz_format_t *gformat;
+ if (!src)
+ {
+ cairo_int_status_t status;
- drawable = glitz_surface_get_drawable (src->surface);
-
- gformat = glitz_find_standard_format (drawable, _glitz_format (format));
- if (gformat == NULL)
- return NULL;
-
- surface = glitz_surface_create (drawable, gformat, width, height);
- if (surface == NULL)
- return NULL;
+ status = _cairo_pattern_acquire_surface (pattern, &dst->base,
+ x, y, width, height,
+ (cairo_surface_t **) &src,
+ &attr->base);
+ if (status)
+ return status;
+
+ if (src)
+ {
+ switch (attr->base.extend) {
+ case CAIRO_EXTEND_NONE:
+ attr->fill = GLITZ_FILL_TRANSPARENT;
+ break;
+ case CAIRO_EXTEND_REPEAT:
+ attr->fill = GLITZ_FILL_REPEAT;
+ break;
+ case CAIRO_EXTEND_REFLECT:
+ attr->fill = GLITZ_FILL_REFLECT;
+ break;
+ }
- crsurface = cairo_glitz_surface_create (surface);
-
- glitz_surface_destroy (surface);
+ switch (attr->base.filter) {
+ case CAIRO_FILTER_FAST:
+ case CAIRO_FILTER_NEAREST:
+ attr->filter = GLITZ_FILTER_NEAREST;
+ break;
+ case CAIRO_FILTER_GOOD:
+ case CAIRO_FILTER_BEST:
+ case CAIRO_FILTER_BILINEAR:
+ default:
+ attr->filter = GLITZ_FILTER_BILINEAR;
+ break;
+ }
+
+ attr->params = NULL;
+ attr->n_params = 0;
+ attr->acquired = TRUE;
+ }
+ }
- return crsurface;
+ *surface_out = src;
+
+ return CAIRO_STATUS_SUCCESS;
}
-static cairo_glitz_surface_t *
-_cairo_glitz_surface_clone_similar (cairo_glitz_surface_t *templ,
- cairo_surface_t *src,
- cairo_format_t format)
+static void
+_cairo_glitz_pattern_release_surface (cairo_glitz_surface_t *dst,
+ cairo_glitz_surface_t *surface,
+ cairo_glitz_surface_attributes_t *attr)
{
- cairo_glitz_surface_t *clone;
- cairo_image_surface_t *src_image;
+ if (attr->acquired)
+ _cairo_pattern_release_surface (&dst->base, &surface->base,
+ &attr->base);
+ else
+ _cairo_glitz_surface_destroy (surface);
+}
- src_image = _cairo_surface_get_image (src);
+static cairo_int_status_t
+_cairo_glitz_pattern_acquire_surfaces (cairo_pattern_t *src,
+ cairo_pattern_t *mask,
+ cairo_glitz_surface_t *dst,
+ int src_x,
+ int src_y,
+ int mask_x,
+ int mask_y,
+ unsigned int width,
+ unsigned int height,
+ cairo_glitz_surface_t **src_out,
+ cairo_glitz_surface_t **mask_out,
+ cairo_glitz_surface_attributes_t *sattr,
+ cairo_glitz_surface_attributes_t *mattr)
+{
+ cairo_int_status_t status;
+ cairo_pattern_union_t tmp;
+ cairo_bool_t src_opaque, mask_opaque;
+ double src_alpha, mask_alpha;
- clone = (cairo_glitz_surface_t *)
- _cairo_glitz_surface_create_similar (templ, format, 0,
- src_image->width,
- src_image->height);
- if (clone == NULL)
- return NULL;
-
- _cairo_glitz_surface_set_filter (clone, cairo_surface_get_filter (src));
+ src_opaque = _cairo_pattern_is_opaque (src);
+ mask_opaque = !mask || _cairo_pattern_is_opaque (mask);
- _cairo_glitz_surface_set_image (clone, src_image);
-
- _cairo_glitz_surface_set_matrix (clone, &(src_image->base.matrix));
+ /* For surface patterns, we move any translucency from src->alpha
+ * to mask->alpha so we can use the source unchanged. Otherwise we
+ * move the translucency from mask->alpha to src->alpha so that
+ * we can drop the mask if possible.
+ */
+ if (src->type == CAIRO_PATTERN_SURFACE)
+ {
+ if (mask) {
+ mask_opaque = mask_opaque && src_opaque;
+ mask_alpha = mask->alpha * src->alpha;
+ } else {
+ mask_opaque = src_opaque;
+ mask_alpha = src->alpha;
+ }
+
+ src_alpha = 1.0;
+ src_opaque = TRUE;
+ }
+ else
+ {
+ if (mask)
+ {
+ src_opaque = mask_opaque && src_opaque;
+ src_alpha = mask->alpha * src->alpha;
+ /* FIXME: This needs changing when we support RENDER
+ * style 4-channel masks.
+ */
+ if (mask->type == CAIRO_PATTERN_SOLID)
+ mask = NULL;
+ } else
+ src_alpha = src->alpha;
+
+ mask_alpha = 1.0;
+ mask_opaque = TRUE;
+ }
+
+ _cairo_pattern_init_copy (&tmp.base, src);
+ _cairo_pattern_set_alpha (&tmp.base, src_alpha);
+
+ status = _cairo_glitz_pattern_acquire_surface (&tmp.base, dst,
+ src_x, src_y,
+ width, height,
+ src_out, sattr);
- cairo_surface_destroy (&src_image->base);
+ _cairo_pattern_fini (&tmp.base);
- return clone;
-}
+ if (status)
+ return status;
-static cairo_int_status_t
-_glitz_composite (glitz_operator_t op,
- glitz_surface_t *src,
- glitz_surface_t *mask,
- glitz_surface_t *dst,
- int src_x,
- int src_y,
- int mask_x,
- int mask_y,
- int dst_x,
- int dst_y,
- int width,
- int height,
- glitz_buffer_t *geometry,
- glitz_geometry_format_t *format)
-{
- if (_glitz_ensure_target (dst))
- return CAIRO_INT_STATUS_UNSUPPORTED;
+ if (mask || !mask_opaque)
+ {
+ if (mask)
+ _cairo_pattern_init_copy (&tmp.base, mask);
+ else
+ _cairo_pattern_init_solid (&tmp.solid, 0.0, 0.0, 0.0);
- if (glitz_surface_get_status (dst))
- return CAIRO_STATUS_NO_TARGET_SURFACE;
-
- glitz_set_geometry (dst,
- 0, 0,
- format, geometry);
-
- glitz_composite (op,
- src,
- mask,
- dst,
- src_x, src_y,
- mask_x, mask_y,
- dst_x, dst_y,
- width, height);
-
- glitz_set_geometry (dst, 0, 0, NULL, NULL);
+ _cairo_pattern_set_alpha (&tmp.base, mask_alpha);
+
+ status = _cairo_glitz_pattern_acquire_surface (&tmp.base, dst,
+ mask_x, mask_y,
+ width, height,
+ mask_out, mattr);
+
+ _cairo_pattern_fini (&tmp.base);
- if (glitz_surface_get_status (dst) == GLITZ_STATUS_NOT_SUPPORTED)
- return CAIRO_INT_STATUS_UNSUPPORTED;
+ if (status)
+ {
+ _cairo_glitz_pattern_release_surface (dst, *src_out, sattr);
+ return status;
+ }
+ }
+ else
+ {
+ *mask_out = NULL;
+ }
return CAIRO_STATUS_SUCCESS;
}
+static void
+_cairo_glitz_surface_set_attributes (cairo_glitz_surface_t *surface,
+ cairo_glitz_surface_attributes_t *a)
+{
+ _cairo_glitz_surface_set_matrix (surface, &a->base.matrix);
+ glitz_surface_set_fill (surface->surface, a->fill);
+ glitz_surface_set_filter (surface->surface, a->filter,
+ a->params, a->n_params);
+}
+
static cairo_int_status_t
_cairo_glitz_surface_composite (cairo_operator_t op,
- cairo_surface_t *generic_src,
- cairo_surface_t *generic_mask,
- void *abstract_dst,
- int src_x,
- int src_y,
- int mask_x,
- int mask_y,
- int dst_x,
- int dst_y,
- unsigned int width,
- unsigned int height)
+ cairo_pattern_t *src_pattern,
+ cairo_pattern_t *mask_pattern,
+ void *abstract_dst,
+ int src_x,
+ int src_y,
+ int mask_x,
+ int mask_y,
+ int dst_x,
+ int dst_y,
+ unsigned int width,
+ unsigned int height)
{
- cairo_glitz_surface_t *dst = abstract_dst;
- cairo_glitz_surface_t *src = (cairo_glitz_surface_t *) generic_src;
- cairo_glitz_surface_t *mask = (cairo_glitz_surface_t *) generic_mask;
- cairo_glitz_surface_t *src_clone = NULL;
- cairo_glitz_surface_t *mask_clone = NULL;
- cairo_int_status_t status;
+ cairo_glitz_surface_attributes_t src_attr, mask_attr;
+ cairo_glitz_surface_t *dst = abstract_dst;
+ cairo_glitz_surface_t *src;
+ cairo_glitz_surface_t *mask;
+ cairo_int_status_t status;
if (op == CAIRO_OPERATOR_SATURATE)
return CAIRO_INT_STATUS_UNSUPPORTED;
- if (generic_src->backend != dst->base.backend) {
- src_clone = _cairo_glitz_surface_clone_similar (dst, generic_src,
- CAIRO_FORMAT_ARGB32);
- if (!src_clone)
- return CAIRO_INT_STATUS_UNSUPPORTED;
+ if (_glitz_ensure_target (dst->surface))
+ return CAIRO_INT_STATUS_UNSUPPORTED;
+
+ status = _cairo_glitz_pattern_acquire_surfaces (src_pattern, mask_pattern,
+ dst,
+ src_x, src_y,
+ mask_x, mask_y,
+ width, height,
+ &src, &mask,
+ &src_attr, &mask_attr);
+ if (status)
+ return status;
+
+ _cairo_glitz_surface_set_attributes (src, &src_attr);
+ if (mask)
+ {
+ _cairo_glitz_surface_set_attributes (mask, &mask_attr);
+ glitz_composite (_glitz_operator (op),
+ src->surface,
+ mask->surface,
+ dst->surface,
+ src_x + src_attr.base.x_offset,
+ src_y + src_attr.base.y_offset,
+ mask_x + mask_attr.base.x_offset,
+ mask_y + mask_attr.base.y_offset,
+ dst_x, dst_y,
+ width, height);
- src = src_clone;
- }
-
- if (generic_mask && (generic_mask->backend != dst->base.backend)) {
- mask_clone = _cairo_glitz_surface_clone_similar (dst, generic_mask,
- CAIRO_FORMAT_A8);
- if (!mask_clone)
- return CAIRO_INT_STATUS_UNSUPPORTED;
+ if (mask_attr.n_params)
+ free (mask_attr.params);
- mask = mask_clone;
+ _cairo_glitz_pattern_release_surface (dst, mask, &mask_attr);
+ }
+ else
+ {
+ glitz_composite (_glitz_operator (op),
+ src->surface,
+ NULL,
+ dst->surface,
+ src_x + src_attr.base.x_offset,
+ src_y + src_attr.base.y_offset,
+ 0, 0,
+ dst_x, dst_y,
+ width, height);
}
- status = _glitz_composite (_glitz_operator (op),
- src->surface,
- (mask)? mask->surface: NULL,
- dst->surface,
- src_x, src_y,
- mask_x, mask_y,
- dst_x, dst_y,
- width, height,
- NULL, NULL);
-
- if (src_clone)
- cairo_surface_destroy (&src_clone->base);
-
- if (mask_clone)
- cairo_surface_destroy (&mask_clone->base);
+ if (src_attr.n_params)
+ free (src_attr.params);
- return status;
+ _cairo_glitz_pattern_release_surface (dst, src, &src_attr);
+
+ if (glitz_surface_get_status (dst->surface) == GLITZ_STATUS_NOT_SUPPORTED)
+ return CAIRO_INT_STATUS_UNSUPPORTED;
+
+ return CAIRO_STATUS_SUCCESS;
}
static cairo_int_status_t
-_cairo_glitz_surface_fill_rectangles (void *abstract_dst,
- cairo_operator_t op,
+_cairo_glitz_surface_fill_rectangles (void *abstract_dst,
+ cairo_operator_t op,
const cairo_color_t *color,
- cairo_rectangle_t *rects,
- int n_rects)
+ cairo_rectangle_t *rects,
+ int n_rects)
{
cairo_glitz_surface_t *dst = abstract_dst;
- glitz_color_t glitz_color;
- if (op == CAIRO_OPERATOR_SATURATE)
- return CAIRO_INT_STATUS_UNSUPPORTED;
-
- glitz_color.red = color->red_short;
- glitz_color.green = color->green_short;
- glitz_color.blue = color->blue_short;
- glitz_color.alpha = color->alpha_short;
+ if (op == CAIRO_OPERATOR_SRC)
+ {
+ glitz_color_t glitz_color;
+
+ glitz_color.red = color->red_short;
+ glitz_color.green = color->green_short;
+ glitz_color.blue = color->blue_short;
+ glitz_color.alpha = color->alpha_short;
+
+ if (glitz_surface_get_width (dst->surface) != 1 ||
+ glitz_surface_get_height (dst->surface) != 1)
+ _glitz_ensure_target (dst->surface);
- if (op != CAIRO_OPERATOR_SRC) {
- glitz_surface_t *solid;
- glitz_float_t *vertices;
- glitz_buffer_t *buffer;
- glitz_geometry_format_t gf;
- cairo_int_status_t status;
- int width, height;
- void *data;
+ glitz_set_rectangles (dst->surface, &glitz_color,
+ (glitz_rectangle_t *) rects, n_rects);
+ }
+ else
+ {
+ cairo_glitz_surface_t *src;
- gf.mode = GLITZ_GEOMETRY_MODE_DIRECT;
- gf.edge_hint = GLITZ_GEOMETRY_EDGE_HINT_SHARP;
- gf.primitive = GLITZ_GEOMETRY_PRIMITIVE_QUADS;
- gf.type = GLITZ_DATA_TYPE_FLOAT;
- gf.first = 0;
- gf.count = n_rects * 4;
-
- data = malloc (n_rects * 8 * sizeof (glitz_float_t));
- if (!data)
- return CAIRO_STATUS_NO_MEMORY;
-
- buffer = glitz_buffer_create_for_data (data);
- if (buffer == NULL) {
- free (data);
- return CAIRO_STATUS_NO_MEMORY;
- }
+ if (op == CAIRO_OPERATOR_SATURATE)
+ return CAIRO_INT_STATUS_UNSUPPORTED;
- width = height = 0;
- vertices = glitz_buffer_map (buffer, GLITZ_BUFFER_ACCESS_WRITE_ONLY);
- for (; n_rects; rects++, n_rects--) {
- *vertices++ = (glitz_float_t) rects->x;
- *vertices++ = (glitz_float_t) rects->y;
- *vertices++ = (glitz_float_t) (rects->x + rects->width);
- *vertices++ = (glitz_float_t) rects->y;
- *vertices++ = (glitz_float_t) (rects->x + rects->width);
- *vertices++ = (glitz_float_t) (rects->y + rects->height);
- *vertices++ = (glitz_float_t) rects->x;
- *vertices++ = (glitz_float_t) (rects->y + rects->height);
-
- if ((rects->x + rects->width) > width)
- width = rects->x + rects->width;
-
- if ((rects->y + rects->height) > height)
- height = rects->y + rects->height;
- }
- glitz_buffer_unmap (buffer);
+ if (_glitz_ensure_target (dst->surface))
+ return CAIRO_INT_STATUS_UNSUPPORTED;
- solid = _glitz_surface_create_solid (dst->surface,
- GLITZ_STANDARD_ARGB32,
- &glitz_color);
- if (solid == NULL)
+ src = (cairo_glitz_surface_t *)
+ _cairo_surface_create_similar_solid (&dst->base,
+ CAIRO_FORMAT_ARGB32, 1, 1,
+ (cairo_color_t *) color);
+ if (!src)
return CAIRO_STATUS_NO_MEMORY;
-
- status = _glitz_composite (_glitz_operator (op),
- solid,
- NULL,
- dst->surface,
- 0, 0,
- 0, 0,
- 0, 0,
- width, height,
- buffer, &gf);
-
- glitz_surface_destroy (solid);
- glitz_buffer_destroy (buffer);
- free (data);
-
- return status;
- } else {
- if (glitz_surface_get_width (dst->surface) != 1 ||
- glitz_surface_get_height (dst->surface) != 1) {
- if (_glitz_ensure_target (dst->surface))
- return CAIRO_INT_STATUS_UNSUPPORTED;
+
+ while (n_rects--)
+ {
+ glitz_composite (_glitz_operator (op),
+ src->surface,
+ NULL,
+ dst->surface,
+ 0, 0,
+ 0, 0,
+ rects->x, rects->y,
+ rects->width, rects->height);
+ rects++;
}
- glitz_set_rectangles (dst->surface, &glitz_color,
- (glitz_rectangle_t *) rects, n_rects);
+ cairo_surface_destroy (&src->base);
}
+ if (glitz_surface_get_status (dst->surface) == GLITZ_STATUS_NOT_SUPPORTED)
+ return CAIRO_INT_STATUS_UNSUPPORTED;
+
return CAIRO_STATUS_SUCCESS;
}
static cairo_int_status_t
-_cairo_glitz_surface_composite_trapezoids (cairo_operator_t op,
- cairo_surface_t *generic_src,
- void *abstract_dst,
- int x_src,
- int y_src,
+_cairo_glitz_surface_composite_trapezoids (cairo_operator_t op,
+ cairo_pattern_t *pattern,
+ void *abstract_dst,
+ int src_x,
+ int src_y,
+ int dst_x,
+ int dst_y,
+ unsigned int width,
+ unsigned int height,
cairo_trapezoid_t *traps,
- int n_traps)
+ int n_traps)
{
- cairo_glitz_surface_t *dst = abstract_dst;
- cairo_glitz_surface_t *src = (cairo_glitz_surface_t *) generic_src;
- glitz_surface_t *mask = NULL;
- glitz_float_t *vertices;
- glitz_buffer_t *buffer;
- glitz_geometry_format_t gf;
- cairo_int_status_t status;
- int x_dst, y_dst, x_rel, y_rel, width, height;
- void *data;
+ cairo_glitz_surface_attributes_t attributes;
+ cairo_glitz_surface_t *dst = abstract_dst;
+ cairo_glitz_surface_t *src;
+ cairo_glitz_surface_t *mask = NULL;
+ glitz_buffer_t *buffer = NULL;
+ void *data = NULL;
+ cairo_int_status_t status;
+ unsigned short alpha;
if (op == CAIRO_OPERATOR_SATURATE)
return CAIRO_INT_STATUS_UNSUPPORTED;
- if (generic_src->backend != dst->base.backend)
+ if (_glitz_ensure_target (dst->surface))
return CAIRO_INT_STATUS_UNSUPPORTED;
- gf.mode = GLITZ_GEOMETRY_MODE_DIRECT;
- gf.edge_hint = GLITZ_GEOMETRY_EDGE_HINT_GOOD_SMOOTH;
- gf.primitive = GLITZ_GEOMETRY_PRIMITIVE_QUADS;
- gf.type = GLITZ_DATA_TYPE_FLOAT;
- gf.first = 0;
- gf.count = n_traps * 4;
+ if (pattern->type == CAIRO_PATTERN_SURFACE)
+ {
+ cairo_pattern_union_t tmp;
- data = malloc (n_traps * 8 * sizeof (glitz_float_t));
- if (!data)
- return CAIRO_STATUS_NO_MEMORY;
-
- buffer = glitz_buffer_create_for_data (data);
- if (buffer == NULL) {
- free (data);
- return CAIRO_STATUS_NO_MEMORY;
- }
-
- x_dst = traps[0].left.p1.x >> 16;
- y_dst = traps[0].left.p1.y >> 16;
+ _cairo_pattern_init_copy (&tmp.base, pattern);
+ _cairo_pattern_set_alpha (&tmp.base, 1.0);
- vertices = glitz_buffer_map (buffer, GLITZ_BUFFER_ACCESS_WRITE_ONLY);
- for (; n_traps; traps++, n_traps--) {
- glitz_float_t top, bottom;
+ status = _cairo_glitz_pattern_acquire_surface (&tmp.base, dst,
+ src_x, src_y,
+ width, height,
+ &src, &attributes);
- top = GLITZ_FIXED_TO_FLOAT (traps->top);
- bottom = GLITZ_FIXED_TO_FLOAT (traps->bottom);
+ _cairo_pattern_fini (&tmp.base);
- *vertices++ = GLITZ_FIXED_LINE_X_TO_FLOAT (traps->left, traps->top);
- *vertices++ = top;
- *vertices++ =
- GLITZ_FIXED_LINE_X_CEIL_TO_FLOAT (traps->right, traps->top);
- *vertices++ = top;
- *vertices++ =
- GLITZ_FIXED_LINE_X_CEIL_TO_FLOAT (traps->right, traps->bottom);
- *vertices++ = bottom;
- *vertices++ = GLITZ_FIXED_LINE_X_TO_FLOAT (traps->left, traps->bottom);
- *vertices++ = bottom;
+ alpha = pattern->alpha * 0xffff;
}
- glitz_buffer_unmap (buffer);
+ else
+ {
+ status = _cairo_glitz_pattern_acquire_surface (pattern, dst,
+ src_x, src_y,
+ width, height,
+ &src, &attributes);
+ alpha = 0xffff;
+ }
+
+ if (status)
+ return status;
+
+ if (op == CAIRO_OPERATOR_ADD || n_traps <= 1)
+ {
+ static glitz_color_t clear_black = { 0, 0, 0, 0 };
+ glitz_color_t color;
+ glitz_geometry_format_t format;
+ int n_trap_added;
+ int offset = 0;
+ int data_size = 0;
+ int size = 30 * n_traps; /* just a guess */
+
+ format.vertex.primitive = GLITZ_PRIMITIVE_QUADS;
+ format.vertex.type = GLITZ_DATA_TYPE_FLOAT;
+ format.vertex.bytes_per_vertex = 3 * sizeof (glitz_float_t);
+ format.vertex.attributes = GLITZ_VERTEX_ATTRIBUTE_MASK_COORD_MASK;
+ format.vertex.mask.type = GLITZ_DATA_TYPE_FLOAT;
+ format.vertex.mask.size = GLITZ_COORDINATE_SIZE_X;
+ format.vertex.mask.offset = 2 * sizeof (glitz_float_t);
+
+ mask = (cairo_glitz_surface_t *)
+ _cairo_glitz_surface_create_similar (&dst->base,
+ CAIRO_FORMAT_A8, 0,
+ 2, 1);
+ if (!mask)
+ {
+ _cairo_glitz_pattern_release_surface (dst, src, &attributes);
+ return CAIRO_INT_STATUS_UNSUPPORTED;
+ }
+
+ color.red = color.green = color.blue = color.alpha = alpha;
- if ((src->pattern.type == CAIRO_PATTERN_SURFACE) &&
- (src->pattern.color.alpha != 1.0)) {
- glitz_color_t color;
+ glitz_set_rectangle (mask->surface, &clear_black, 0, 0, 1, 1);
+ glitz_set_rectangle (mask->surface, &color, 1, 0, 1, 1);
+
+ glitz_surface_set_fill (mask->surface, GLITZ_FILL_NEAREST);
+ glitz_surface_set_filter (mask->surface,
+ GLITZ_FILTER_BILINEAR,
+ NULL, 0);
+
+ size *= format.vertex.bytes_per_vertex;
- color.red = color.green = color.blue = 0;
- color.alpha = src->pattern.color.alpha_short;
+ while (n_traps)
+ {
+ if (data_size < size)
+ {
+ data_size = size;
+ data = realloc (data, data_size);
+ if (!data)
+ {
+ _cairo_glitz_pattern_release_surface (dst, src,
+ &attributes);
+ return CAIRO_STATUS_NO_MEMORY;
+ }
+
+ if (buffer)
+ glitz_buffer_destroy (buffer);
+
+ buffer = glitz_buffer_create_for_data (data);
+ if (!buffer) {
+ free (data);
+ _cairo_glitz_pattern_release_surface (dst, src,
+ &attributes);
+ return CAIRO_STATUS_NO_MEMORY;
+ }
+ }
- mask = _glitz_surface_create_solid (dst->surface,
- GLITZ_STANDARD_A8,
- &color);
+ offset +=
+ glitz_add_trapezoids (buffer,
+ offset, size - offset,
+ format.vertex.type, mask->surface,
+ (glitz_trapezoid_t *) traps, n_traps,
+ &n_trap_added);
+
+ n_traps -= n_trap_added;
+ traps += n_trap_added;
+ size *= 2;
+ }
+
+ glitz_set_geometry (dst->surface,
+ GLITZ_GEOMETRY_TYPE_VERTEX,
+ &format, buffer);
+ glitz_set_array (dst->surface, 0, 3,
+ offset / format.vertex.bytes_per_vertex,
+ 0, 0);
}
+ else
+ {
+ cairo_image_surface_t *image;
+ char *ptr;
+ int stride;
+
+ stride = (width + 3) & -4;
+ data = malloc (stride * height);
+ if (!data)
+ {
+ _cairo_glitz_pattern_release_surface (dst, src, &attributes);
+ return CAIRO_STATUS_NO_MEMORY;
+ }
+
+ memset (data, 0, stride * height);
- x_rel = (src->pattern_box.p1.x >> 16) + x_src - x_dst;
- y_rel = (src->pattern_box.p1.y >> 16) + y_src - y_dst;
+ /* using negative stride */
+ ptr = (char *) data + stride * (height - 1);
+
+ image = (cairo_image_surface_t *)
+ cairo_image_surface_create_for_data (ptr,
+ CAIRO_FORMAT_A8,
+ width, height,
+ -stride);
+ if (!image)
+ {
+ cairo_surface_destroy (&src->base);
+ free (data);
+ return CAIRO_STATUS_NO_MEMORY;
+ }
- x_dst = src->pattern_box.p1.x >> 16;
- y_dst = src->pattern_box.p1.y >> 16;
+ pixman_add_trapezoids (image->pixman_image, -dst_x, -dst_y,
+ (pixman_trapezoid_t *) traps, n_traps);
+
+ if (alpha != 0xffff)
+ {
+ pixman_color_t color;
+
+ color.red = color.green = color.blue = color.alpha = alpha;
+
+ pixman_fill_rectangle (PIXMAN_OPERATOR_IN,
+ image->pixman_image,
+ &color,
+ 0, 0, width, height);
+ }
+
+ mask = (cairo_glitz_surface_t *)
+ _cairo_surface_create_similar_scratch (&dst->base,
+ CAIRO_FORMAT_A8, 0,
+ width, height);
+ if (!mask)
+ {
+ _cairo_glitz_pattern_release_surface (dst, src, &attributes);
+ free (data);
+ cairo_surface_destroy (&image->base);
+ return CAIRO_STATUS_NO_MEMORY;
+ }
+
+ _cairo_glitz_surface_set_image (mask, image, 0, 0);
+ }
+
+ _cairo_glitz_surface_set_attributes (src, &attributes);
- width = ((src->pattern_box.p2.x + 65535) >> 16) -
- (src->pattern_box.p1.x >> 16);
- height = ((src->pattern_box.p2.y + 65535) >> 16) -
- (src->pattern_box.p1.y >> 16);
+ glitz_composite (_glitz_operator (op),
+ src->surface,
+ mask->surface,
+ dst->surface,
+ src_x + attributes.base.x_offset,
+ src_y + attributes.base.y_offset,
+ 0, 0,
+ dst_x, dst_y,
+ width, height);
+
+ if (attributes.n_params)
+ free (attributes.params);
+
+ glitz_set_geometry (dst->surface,
+ GLITZ_GEOMETRY_TYPE_NONE,
+ NULL, NULL);
+
+ if (buffer)
+ glitz_buffer_destroy (buffer);
- status = _glitz_composite (_glitz_operator (op),
- src->surface,
- mask,
- dst->surface,
- x_rel, y_rel,
- 0, 0,
- x_dst, y_dst,
- width, height,
- buffer, &gf);
+ free (data);
+ _cairo_glitz_pattern_release_surface (dst, src, &attributes);
if (mask)
- glitz_surface_destroy (mask);
+ cairo_surface_destroy (&mask->base);
- glitz_buffer_destroy (buffer);
- free (data);
+ if (glitz_surface_get_status (dst->surface) == GLITZ_STATUS_NOT_SUPPORTED)
+ return CAIRO_INT_STATUS_UNSUPPORTED;
- return status;
+ return CAIRO_STATUS_SUCCESS;
}
static cairo_int_status_t
@@ -819,173 +1240,56 @@ _cairo_glitz_surface_show_page (void *abstract_surface)
}
static cairo_int_status_t
-_cairo_glitz_surface_create_pattern (void *abstract_dst,
- cairo_pattern_t *pattern,
- cairo_box_t *box)
+_cairo_glitz_surface_set_clip_region (void *abstract_surface,
+ pixman_region16_t *region)
{
- cairo_glitz_surface_t *dst = abstract_dst;
- cairo_surface_t *generic_src = NULL;
- cairo_image_surface_t *image = NULL;
- cairo_glitz_surface_t *src;
-
- switch (pattern->type) {
- case CAIRO_PATTERN_SOLID:
- generic_src =
- _cairo_surface_create_similar_solid (abstract_dst,
- CAIRO_FORMAT_ARGB32,
- 1, 1,
- &pattern->color);
- if (generic_src)
- cairo_surface_set_repeat (generic_src, 1);
- break;
- case CAIRO_PATTERN_RADIAL:
- /* glitz doesn't support inner and outer circle with different
- center points. */
- if (pattern->u.radial.center0.x != pattern->u.radial.center1.x ||
- pattern->u.radial.center0.y != pattern->u.radial.center1.y)
- break;
- /* fall-through */
- case CAIRO_PATTERN_LINEAR: {
- glitz_drawable_t *drawable;
- glitz_fixed16_16_t *params;
- int i, n_params;
-
- drawable = glitz_surface_get_drawable (dst->surface);
- if (!(glitz_drawable_get_features (drawable) &
- GLITZ_FEATURE_FRAGMENT_PROGRAM_MASK))
- break;
-
- if (pattern->filter != CAIRO_FILTER_BILINEAR)
- break;
-
- n_params = pattern->n_stops * 3 + 4;
-
- params = malloc (sizeof (glitz_fixed16_16_t) * n_params);
- if (params == NULL)
- return CAIRO_STATUS_NO_MEMORY;
-
- generic_src =
- _cairo_glitz_surface_create_similar (abstract_dst,
- CAIRO_FORMAT_ARGB32, 0,
- pattern->n_stops, 1);
- if (generic_src == NULL) {
- free (params);
- return CAIRO_STATUS_NO_MEMORY;
- }
-
- src = (cairo_glitz_surface_t *) generic_src;
-
- for (i = 0; i < pattern->n_stops; i++) {
- glitz_color_t color;
+ cairo_glitz_surface_t *surface = abstract_surface;
- color.alpha = pattern->stops[i].color_char[3];
- color.red = pattern->stops[i].color_char[0] * color.alpha;
- color.green = pattern->stops[i].color_char[1] * color.alpha;
- color.blue = pattern->stops[i].color_char[2] * color.alpha;
- color.alpha *= 256;
+ if (region)
+ {
+ glitz_box_t *box;
+ int n;
- glitz_set_rectangle (src->surface, &color, i, 0, 1, 1);
-
- params[4 + 3 * i] = pattern->stops[i].offset;
- params[5 + 3 * i] = i << 16;
- params[6 + 3 * i] = 0;
- }
-
- if (pattern->type == CAIRO_PATTERN_LINEAR) {
- params[0] = _cairo_fixed_from_double (pattern->u.linear.point0.x);
- params[1] = _cairo_fixed_from_double (pattern->u.linear.point0.y);
- params[2] = _cairo_fixed_from_double (pattern->u.linear.point1.x);
- params[3] = _cairo_fixed_from_double (pattern->u.linear.point1.y);
-
- glitz_surface_set_filter (src->surface,
- GLITZ_FILTER_LINEAR_GRADIENT,
- params, n_params);
- } else {
- params[0] = _cairo_fixed_from_double (pattern->u.radial.center0.x);
- params[1] = _cairo_fixed_from_double (pattern->u.radial.center0.y);
- params[2] = _cairo_fixed_from_double (pattern->u.radial.radius0);
- params[3] = _cairo_fixed_from_double (pattern->u.radial.radius1);
-
- glitz_surface_set_filter (src->surface,
- GLITZ_FILTER_RADIAL_GRADIENT,
- params, n_params);
- }
-
- switch (pattern->extend) {
- case CAIRO_EXTEND_REPEAT:
- glitz_surface_set_fill (src->surface, GLITZ_FILL_REPEAT);
- break;
- case CAIRO_EXTEND_REFLECT:
- glitz_surface_set_fill (src->surface, GLITZ_FILL_REFLECT);
- break;
- case CAIRO_EXTEND_NONE:
- default:
- glitz_surface_set_fill (src->surface, GLITZ_FILL_NEAREST);
- break;
+ if (!surface->clip)
+ {
+ surface->clip = pixman_region_create ();
+ if (!surface->clip)
+ return CAIRO_STATUS_NO_MEMORY;
}
+ pixman_region_copy (surface->clip, region);
- cairo_surface_set_matrix (&src->base, &pattern->matrix);
-
- free (params);
- } break;
- case CAIRO_PATTERN_SURFACE:
- generic_src = pattern->u.surface.surface;
- cairo_surface_reference (generic_src);
- break;
- }
-
- if (generic_src == NULL) {
- image = _cairo_pattern_get_image (pattern, box);
- if (image == NULL)
- return CAIRO_STATUS_NO_MEMORY;
-
- generic_src = &image->base;
+ box = (glitz_box_t *) pixman_region_rects (surface->clip);
+ n = pixman_region_num_rects (surface->clip);
+ glitz_surface_set_clip_region (surface->surface, 0, 0, box, n);
}
+ else
+ {
+ glitz_surface_set_clip_region (surface->surface, 0, 0, NULL, 0);
- if (generic_src->backend != dst->base.backend) {
- src = _cairo_glitz_surface_clone_similar (dst, generic_src,
- CAIRO_FORMAT_ARGB32);
- if (src == NULL)
- return CAIRO_STATUS_NO_MEMORY;
-
- cairo_surface_set_repeat (&src->base, generic_src->repeat);
- } else
- src = (cairo_glitz_surface_t *) generic_src;
+ if (surface->clip)
+ pixman_region_destroy (surface->clip);
- if (image)
- cairo_surface_destroy (&image->base);
-
- _cairo_pattern_init_copy (&src->pattern, pattern);
- src->pattern_box = *box;
-
- pattern->source = &src->base;
+ surface->clip = NULL;
+ }
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
-_cairo_glitz_surface_set_clip_region (void *abstract_surface,
- pixman_region16_t *region)
-{
- return CAIRO_INT_STATUS_UNSUPPORTED;
-}
-
static const cairo_surface_backend_t cairo_glitz_surface_backend = {
_cairo_glitz_surface_create_similar,
_cairo_glitz_surface_destroy,
_cairo_glitz_surface_pixels_per_inch,
- _cairo_glitz_surface_get_image,
- _cairo_glitz_surface_set_image,
- _cairo_glitz_surface_set_matrix,
- _cairo_glitz_surface_set_filter,
- _cairo_glitz_surface_set_repeat,
+ _cairo_glitz_surface_acquire_source_image,
+ _cairo_glitz_surface_release_source_image,
+ _cairo_glitz_surface_acquire_dest_image,
+ _cairo_glitz_surface_release_dest_image,
+ _cairo_glitz_surface_clone_similar,
_cairo_glitz_surface_composite,
_cairo_glitz_surface_fill_rectangles,
_cairo_glitz_surface_composite_trapezoids,
_cairo_glitz_surface_copy_page,
_cairo_glitz_surface_show_page,
_cairo_glitz_surface_set_clip_region,
- _cairo_glitz_surface_create_pattern,
NULL /* show_glyphs */
};
@@ -1004,12 +1308,10 @@ cairo_glitz_surface_create (glitz_surface_t *surface)
_cairo_surface_init (&crsurface->base, &cairo_glitz_surface_backend);
glitz_surface_reference (surface);
- crsurface->surface = surface;
- crsurface->format = glitz_surface_get_format (surface);
- _cairo_pattern_init (&crsurface->pattern);
- crsurface->pattern.type = CAIRO_PATTERN_SURFACE;
- crsurface->pattern.u.surface.surface = NULL;
+ crsurface->surface = surface;
+ crsurface->format = glitz_surface_get_format (surface);
+ crsurface->clip = NULL;
return (cairo_surface_t *) crsurface;
}
diff --git a/src/cairo-glitz.h b/src/cairo-glitz.h
index 350d10233..f1917eb28 100644
--- a/src/cairo-glitz.h
+++ b/src/cairo-glitz.h
@@ -31,17 +31,20 @@
* California.
*
* Contributor(s):
- * Carl D. Worth <cworth@isi.edu>
+ * Carl D. Worth <cworth@cworth.org>
*/
-#include <cairo.h>
-
#ifndef CAIRO_GLITZ_H
#define CAIRO_GLITZ_H
+
+#include <cairo.h>
+
#ifdef CAIRO_HAS_GLITZ_SURFACE
#include <glitz.h>
+CAIRO_BEGIN_DECLS
+
void
cairo_set_target_glitz (cairo_t *cr,
glitz_surface_t *surface);
@@ -49,5 +52,7 @@ cairo_set_target_glitz (cairo_t *cr,
cairo_surface_t *
cairo_glitz_surface_create (glitz_surface_t *surface);
+CAIRO_END_DECLS
+
#endif /* CAIRO_HAS_GLITZ_SURFACE */
#endif /* CAIRO_GLITZ_H */
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index e855a7a66..d6db560a3 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -31,7 +31,7 @@
* California.
*
* Contributor(s):
- * Carl D. Worth <cworth@isi.edu>
+ * Carl D. Worth <cworth@cworth.org>
*/
#include <stdlib.h>
@@ -46,20 +46,33 @@ _cairo_gstate_clip_and_composite_trapezoids (cairo_gstate_t *gstate,
cairo_surface_t *dst,
cairo_traps_t *traps);
+static cairo_status_t
+_cairo_gstate_ensure_font (cairo_gstate_t *gstate);
+
+static void
+_cairo_gstate_unset_font (cairo_gstate_t *gstate);
+
cairo_gstate_t *
_cairo_gstate_create ()
{
+ cairo_status_t status;
cairo_gstate_t *gstate;
gstate = malloc (sizeof (cairo_gstate_t));
if (gstate)
- _cairo_gstate_init (gstate);
+ {
+ status = _cairo_gstate_init (gstate);
+ if (status) {
+ free (gstate);
+ return NULL;
+ }
+ }
return gstate;
}
-void
+cairo_status_t
_cairo_gstate_init (cairo_gstate_t *gstate)
{
gstate->operator = CAIRO_GSTATE_OPERATOR_DEFAULT;
@@ -77,9 +90,11 @@ _cairo_gstate_init (cairo_gstate_t *gstate)
gstate->num_dashes = 0;
gstate->dash_offset = 0.0;
- gstate->font = _cairo_unscaled_font_create (CAIRO_FONT_FAMILY_DEFAULT,
- CAIRO_FONT_SLANT_DEFAULT,
- CAIRO_FONT_WEIGHT_DEFAULT);
+ gstate->font_family = NULL;
+ gstate->font_slant = CAIRO_FONT_SLANT_DEFAULT;
+ gstate->font_weight = CAIRO_FONT_WEIGHT_DEFAULT;
+
+ gstate->font = NULL;
gstate->surface = NULL;
@@ -87,6 +102,9 @@ _cairo_gstate_init (cairo_gstate_t *gstate)
gstate->clip.surface = NULL;
gstate->pattern = _cairo_pattern_create_solid (0.0, 0.0, 0.0);
+ if (!gstate->pattern)
+ return CAIRO_STATUS_NO_MEMORY;
+
gstate->alpha = 1.0;
gstate->pixels_per_inch = CAIRO_GSTATE_PIXELS_PER_INCH_DEFAULT;
@@ -97,6 +115,8 @@ _cairo_gstate_init (cairo_gstate_t *gstate)
_cairo_pen_init_empty (&gstate->pen_regular);
gstate->next = NULL;
+
+ return CAIRO_STATUS_SUCCESS;
}
cairo_status_t
@@ -118,9 +138,15 @@ _cairo_gstate_init_copy (cairo_gstate_t *gstate, cairo_gstate_t *other)
memcpy (gstate->dash, other->dash, other->num_dashes * sizeof (double));
}
+ if (other->font_family) {
+ gstate->font_family = strdup (other->font_family);
+ if (!gstate->font_family)
+ goto CLEANUP_DASH;
+ }
+
if (other->font) {
gstate->font = other->font;
- _cairo_unscaled_font_reference (gstate->font);
+ cairo_font_reference (gstate->font);
}
if (other->clip.region)
@@ -148,18 +174,29 @@ _cairo_gstate_init_copy (cairo_gstate_t *gstate, cairo_gstate_t *other)
_cairo_path_fini (&gstate->path);
CLEANUP_FONT:
- _cairo_unscaled_font_destroy (gstate->font);
+ cairo_font_destroy (gstate->font);
+ gstate->font = NULL;
+
+ if (gstate->font_family) {
+ free (gstate->font_family);
+ gstate->font_family = NULL;
+ }
+ CLEANUP_DASH:
free (gstate->dash);
gstate->dash = NULL;
- return status;
+ return CAIRO_STATUS_NO_MEMORY;
}
void
_cairo_gstate_fini (cairo_gstate_t *gstate)
{
- _cairo_unscaled_font_destroy (gstate->font);
+ if (gstate->font_family)
+ free (gstate->font_family);
+
+ if (gstate->font)
+ cairo_font_destroy (gstate->font);
if (gstate->surface)
cairo_surface_destroy (gstate->surface);
@@ -323,6 +360,8 @@ _cairo_gstate_set_target_surface (cairo_gstate_t *gstate, cairo_surface_t *surfa
{
double scale;
+ _cairo_gstate_unset_font (gstate);
+
if (gstate->surface)
cairo_surface_destroy (gstate->surface);
@@ -365,11 +404,9 @@ _cairo_gstate_set_pattern (cairo_gstate_t *gstate, cairo_pattern_t *pattern)
if (pattern == NULL)
return CAIRO_STATUS_NULL_POINTER;
- if (gstate->pattern)
- cairo_pattern_destroy (gstate->pattern);
-
- gstate->pattern = pattern;
cairo_pattern_reference (pattern);
+ cairo_pattern_destroy (gstate->pattern);
+ gstate->pattern = pattern;
return CAIRO_STATUS_SUCCESS;
}
@@ -407,6 +444,8 @@ _cairo_gstate_set_rgb_color (cairo_gstate_t *gstate, double red, double green, d
cairo_pattern_destroy (gstate->pattern);
gstate->pattern = _cairo_pattern_create_solid (red, green, blue);
+ if (!gstate->pattern)
+ return CAIRO_STATUS_NO_MEMORY;
return CAIRO_STATUS_SUCCESS;
}
@@ -549,6 +588,8 @@ _cairo_gstate_translate (cairo_gstate_t *gstate, double tx, double ty)
{
cairo_matrix_t tmp;
+ _cairo_gstate_unset_font (gstate);
+
_cairo_matrix_set_translate (&tmp, tx, ty);
cairo_matrix_multiply (&gstate->ctm, &tmp, &gstate->ctm);
@@ -566,6 +607,8 @@ _cairo_gstate_scale (cairo_gstate_t *gstate, double sx, double sy)
if (sx == 0 || sy == 0)
return CAIRO_STATUS_INVALID_MATRIX;
+ _cairo_gstate_unset_font (gstate);
+
_cairo_matrix_set_scale (&tmp, sx, sy);
cairo_matrix_multiply (&gstate->ctm, &tmp, &gstate->ctm);
@@ -580,6 +623,8 @@ _cairo_gstate_rotate (cairo_gstate_t *gstate, double angle)
{
cairo_matrix_t tmp;
+ _cairo_gstate_unset_font (gstate);
+
_cairo_matrix_set_rotate (&tmp, angle);
cairo_matrix_multiply (&gstate->ctm, &tmp, &gstate->ctm);
@@ -595,6 +640,8 @@ _cairo_gstate_concat_matrix (cairo_gstate_t *gstate,
{
cairo_matrix_t tmp;
+ _cairo_gstate_unset_font (gstate);
+
cairo_matrix_copy (&tmp, matrix);
cairo_matrix_multiply (&gstate->ctm, &tmp, &gstate->ctm);
@@ -610,6 +657,8 @@ _cairo_gstate_set_matrix (cairo_gstate_t *gstate,
{
cairo_status_t status;
+ _cairo_gstate_unset_font (gstate);
+
cairo_matrix_copy (&gstate->ctm, matrix);
cairo_matrix_copy (&gstate->ctm_inverse, matrix);
@@ -627,6 +676,8 @@ _cairo_gstate_default_matrix (cairo_gstate_t *gstate)
if (scale == 0)
scale = 1;
+ _cairo_gstate_unset_font (gstate);
+
cairo_matrix_set_identity (&gstate->font_matrix);
cairo_matrix_set_identity (&gstate->ctm);
@@ -640,6 +691,8 @@ _cairo_gstate_default_matrix (cairo_gstate_t *gstate)
cairo_status_t
_cairo_gstate_identity_matrix (cairo_gstate_t *gstate)
{
+ _cairo_gstate_unset_font (gstate);
+
cairo_matrix_set_identity (&gstate->ctm);
cairo_matrix_set_identity (&gstate->ctm_inverse);
@@ -1256,54 +1309,17 @@ _cairo_gstate_interpret_path (cairo_gstate_t *gstate,
&gpi);
}
-/* This function modifies the pattern and the state of the pattern surface it
- may contain. The pattern surface will be restored to its orignal state
- when the pattern is destroyed. The appropriate way is to pass a copy of
- the original pattern to this function just before the pattern should be
- used and destroy the copy when done. */
-static cairo_status_t
-_cairo_gstate_create_pattern (cairo_gstate_t *gstate,
- cairo_pattern_t *pattern,
- cairo_box_t *extents)
+/* XXX: gstate->alpha will be going away before too long, and when it
+ * does, it may make sense for this function to just disappear.
+ */
+static void
+_cairo_gstate_pattern_init_copy (cairo_gstate_t *gstate,
+ cairo_pattern_union_t *pattern,
+ cairo_pattern_t *src)
{
- cairo_int_status_t status;
-
- if (gstate->surface == NULL) {
- _cairo_pattern_fini (pattern);
- return CAIRO_STATUS_NO_TARGET_SURFACE;
- }
-
- if (pattern->type == CAIRO_PATTERN_LINEAR ||
- pattern->type == CAIRO_PATTERN_RADIAL) {
- if (pattern->n_stops < 2) {
- pattern->type = CAIRO_PATTERN_SOLID;
-
- if (pattern->n_stops) {
- cairo_color_stop_t *stop = pattern->stops;
-
- _cairo_color_set_rgb (&pattern->color,
- (double) stop->color_char[0] / 0xff,
- (double) stop->color_char[1] / 0xff,
- (double) stop->color_char[2] / 0xff);
- _cairo_color_set_alpha (&pattern->color,
- (double) stop->color_char[3] / 0xff);
- }
- }
- }
-
- _cairo_pattern_set_alpha (pattern, gstate->alpha);
- _cairo_pattern_transform (pattern, &gstate->ctm_inverse);
-
- status = _cairo_surface_create_pattern (gstate->surface, pattern, extents);
- if (status) {
- _cairo_pattern_fini (pattern);
- return status;
- }
-
- if (pattern->type == CAIRO_PATTERN_SURFACE)
- _cairo_pattern_prepare_surface (pattern);
-
- return CAIRO_STATUS_SUCCESS;
+ _cairo_pattern_init_copy (&pattern->base, src);
+ _cairo_pattern_transform (&pattern->base, &gstate->ctm_inverse);
+ _cairo_pattern_set_alpha (&pattern->base, gstate->alpha);
}
cairo_status_t
@@ -1342,7 +1358,7 @@ cairo_status_t
_cairo_gstate_in_stroke (cairo_gstate_t *gstate,
double x,
double y,
- int *inside_ret)
+ cairo_bool_t *inside_ret)
{
cairo_status_t status = CAIRO_STATUS_SUCCESS;
cairo_traps_t traps;
@@ -1365,51 +1381,85 @@ BAIL:
return status;
}
-static cairo_status_t
-_calculate_region_for_intermediate_clip_surface (pixman_region16_t *out,
- cairo_box_t *extents,
- cairo_clip_rec_t *clip_rect)
+/* XXX We currently have a confusing mix of boxes and rectangles as
+ * exemplified by this function. A cairo_box_t is a rectangular area
+ * represented by the coordinates of the upper left and lower right
+ * corners, expressed in fixed point numbers. A cairo_rectangle_t is
+ * also a rectangular area, but represented by the upper left corner
+ * and the width and the height, as integer numbers.
+ *
+ * This function converts a cairo_box_t to a cairo_rectangle_t by
+ * increasing the area to the nearest integer coordinates. We should
+ * standardize on cairo_rectangle_t and cairo_rectangle_fixed_t, and
+ * this function could be renamed to the more reasonable
+ * _cairo_rectangle_fixed_round.
+ */
+
+static void
+_cairo_box_round_to_rectangle (cairo_box_t *box, cairo_rectangle_t *rectangle)
{
- cairo_status_t status;
- pixman_region16_t *extents_region, *clip_region;
- pixman_box16_t clip_box, pixman_extents;
-
- pixman_extents.x1 = _cairo_fixed_integer_floor (extents->p1.x);
- pixman_extents.y1 = _cairo_fixed_integer_floor (extents->p1.y);
- pixman_extents.x2 = _cairo_fixed_integer_ceil (extents->p2.x);
- pixman_extents.y2 = _cairo_fixed_integer_ceil (extents->p2.y);
- extents_region = pixman_region_create_simple (&pixman_extents);
- if (extents_region == NULL)
- {
- status = CAIRO_STATUS_NO_MEMORY;
- goto BAIL0;
- }
+ rectangle->x = _cairo_fixed_integer_floor (box->p1.x);
+ rectangle->y = _cairo_fixed_integer_floor (box->p1.y);
+ rectangle->width = _cairo_fixed_integer_ceil (box->p2.x) - rectangle->x;
+ rectangle->height = _cairo_fixed_integer_ceil (box->p2.y) - rectangle->y;
+}
- clip_box.x1 = clip_rect->x;
- clip_box.y1 = clip_rect->y;
- clip_box.x2 = clip_rect->x + clip_rect->width;
- clip_box.y2 = clip_rect->y + clip_rect->height;
- clip_region = pixman_region_create_simple (&clip_box);
- if (clip_region == NULL)
- {
- status = CAIRO_STATUS_NO_MEMORY;
- goto BAIL1;
- }
+static void
+_cairo_rectangle_intersect (cairo_rectangle_t *dest, cairo_rectangle_t *src)
+{
+ int x1, y1, x2, y2;
- if (pixman_region_intersect (out,
- extents_region,
- clip_region)
- == PIXMAN_REGION_STATUS_FAILURE)
- status = CAIRO_STATUS_NO_MEMORY;
- else
- status = CAIRO_STATUS_SUCCESS;
-
- pixman_region_destroy (extents_region);
- BAIL1:
- pixman_region_destroy (clip_region);
-
- BAIL0:
- return status;
+ x1 = MAX (dest->x, src->x);
+ y1 = MAX (dest->y, src->y);
+ x2 = MIN (dest->x + dest->width, src->x + src->width);
+ y2 = MIN (dest->y + dest->height, src->y + src->height);
+
+ if (x1 >= x2 || y1 >= y2) {
+ dest->x = 0;
+ dest->y = 0;
+ dest->width = 0;
+ dest->height = 0;
+ } else {
+ dest->x = x1;
+ dest->y = y1;
+ dest->width = x2 - x1;
+ dest->height = y2 - y1;
+ }
+}
+
+static int
+_cairo_rectangle_empty (cairo_rectangle_t *rect)
+{
+ return rect->width == 0 || rect->height == 0;
+}
+
+static void
+translate_traps (cairo_traps_t *traps, int x, int y)
+{
+ cairo_fixed_t xoff, yoff;
+ cairo_trapezoid_t *t;
+ int i;
+
+ /* Ugh. The cairo_composite/(Render) interface doesn't allow
+ an offset for the trapezoids. Need to manually shift all
+ the coordinates to align with the offset origin of the
+ intermediate surface. */
+
+ xoff = _cairo_fixed_from_int (x);
+ yoff = _cairo_fixed_from_int (y);
+
+ for (i = 0, t = traps->traps; i < traps->num_traps; i++, t++) {
+ t->top += yoff;
+ t->bottom += yoff;
+ t->left.p1.x += xoff;
+ t->left.p1.y += yoff;
+ t->left.p2.x += xoff;
+ t->left.p2.y += yoff;
+ t->right.p1.x += xoff;
+ t->right.p1.y += yoff;
+ t->right.p2.x += xoff;
+ t->right.p2.y += yoff;
+ }
}
@@ -1422,173 +1472,148 @@ _cairo_gstate_clip_and_composite_trapezoids (cairo_gstate_t *gstate,
cairo_traps_t *traps)
{
cairo_status_t status;
- cairo_pattern_t pattern;
- cairo_box_t extents;
- int x_src, y_src;
+ cairo_pattern_union_t pattern;
+ cairo_rectangle_t extents;
+ cairo_box_t trap_extents;
if (traps->num_traps == 0)
return CAIRO_STATUS_SUCCESS;
+ if (gstate->surface == NULL)
+ return CAIRO_STATUS_NO_TARGET_SURFACE;
+
+ _cairo_traps_extents (traps, &trap_extents);
+ _cairo_box_round_to_rectangle (&trap_extents, &extents);
+
if (gstate->clip.surface) {
- cairo_fixed_t xoff, yoff;
- cairo_trapezoid_t *t;
- int i;
cairo_surface_t *intermediate;
+ cairo_surface_pattern_t intermediate_pattern;
cairo_color_t empty_color;
- pixman_box16_t *draw_extents;
- pixman_region16_t *draw_region;
- draw_region = pixman_region_create ();
- if (draw_region == NULL)
- {
- status = CAIRO_STATUS_NO_MEMORY;
- goto BAIL0;
- }
-
- _cairo_traps_extents (traps, &extents);
-
- status = _calculate_region_for_intermediate_clip_surface (draw_region,
- &extents,
- &gstate->clip);
- if (status)
- goto BAIL1;
+ _cairo_rectangle_intersect (&extents, &gstate->clip.rect);
- /* Shortcut if empty */
- if (!pixman_region_not_empty (draw_region)) {
+ if (_cairo_rectangle_empty (&extents)) {
status = CAIRO_STATUS_SUCCESS;
goto BAIL1;
}
- draw_extents = pixman_region_extents (draw_region);
-
- /* Ugh. The cairo_composite/(Render) interface doesn't allow
- an offset for the trapezoids. Need to manually shift all
- the coordinates to align with the offset origin of the
- intermediate surface. */
- xoff = _cairo_fixed_from_int (draw_extents->x1);
- yoff = _cairo_fixed_from_int (draw_extents->y1);
- for (i=0, t=traps->traps; i < traps->num_traps; i++, t++) {
- t->top -= yoff;
- t->bottom -= yoff;
- t->left.p1.x -= xoff;
- t->left.p1.y -= yoff;
- t->left.p2.x -= xoff;
- t->left.p2.y -= yoff;
- t->right.p1.x -= xoff;
- t->right.p1.y -= yoff;
- t->right.p2.x -= xoff;
- t->right.p2.y -= yoff;
- }
-
- if (traps->traps[0].left.p1.y < traps->traps[0].left.p2.y) {
- x_src = _cairo_fixed_to_double (traps->traps[0].left.p1.x);
- y_src = _cairo_fixed_to_double (traps->traps[0].left.p1.y);
- } else {
- x_src = _cairo_fixed_to_double (traps->traps[0].left.p2.x);
- y_src = _cairo_fixed_to_double (traps->traps[0].left.p2.y);
- }
-
- _cairo_pattern_init_solid (&pattern, 1.0, 1.0, 1.0);
- _cairo_pattern_set_alpha (&pattern, 1.0);
-
- status = _cairo_gstate_create_pattern (gstate, &pattern, &extents);
- if (status)
- goto BAIL1;
+ translate_traps (traps, -extents.x, -extents.y);
_cairo_color_init (&empty_color);
_cairo_color_set_alpha (&empty_color, 0.);
intermediate = _cairo_surface_create_similar_solid (gstate->clip.surface,
CAIRO_FORMAT_A8,
- draw_extents->x2 - draw_extents->x1,
- draw_extents->y2 - draw_extents->y1,
+ extents.width,
+ extents.height,
&empty_color);
if (intermediate == NULL) {
status = CAIRO_STATUS_NO_MEMORY;
- goto BAIL2;
+ goto BAIL1;
}
+ _cairo_pattern_init_solid (&pattern.solid, 1.0, 1.0, 1.0);
+
status = _cairo_surface_composite_trapezoids (CAIRO_OPERATOR_ADD,
- pattern.source, intermediate,
- x_src,
- y_src,
+ &pattern.base,
+ intermediate,
+ extents.x, extents.y,
+ 0, 0,
+ extents.width,
+ extents.height,
traps->traps,
traps->num_traps);
+ _cairo_pattern_fini (&pattern.base);
+
if (status)
- goto BAIL3;
+ goto BAIL2;
+
+
+ _cairo_pattern_init_for_surface (&pattern.surface,
+ gstate->clip.surface);
status = _cairo_surface_composite (CAIRO_OPERATOR_IN,
- gstate->clip.surface,
+ &pattern.base,
NULL,
intermediate,
- draw_extents->x1 - gstate->clip.x,
- draw_extents->y1 - gstate->clip.y,
+ extents.x - gstate->clip.rect.x,
+ extents.y - gstate->clip.rect.y,
0, 0,
0, 0,
- draw_extents->x2 - draw_extents->x1,
- draw_extents->y2 - draw_extents->y1);
- if (status)
- goto BAIL3;
-
- _cairo_pattern_fini (&pattern);
+ extents.width, extents.height);
+ _cairo_pattern_fini (&pattern.base);
- _cairo_pattern_init_copy (&pattern, src);
-
- extents.p1.x = _cairo_fixed_from_int (draw_extents->x1);
- extents.p1.y = _cairo_fixed_from_int (draw_extents->y1);
- extents.p2.x = _cairo_fixed_from_int (draw_extents->x2);
- extents.p2.y = _cairo_fixed_from_int (draw_extents->y2);
- status = _cairo_gstate_create_pattern (gstate, &pattern, &extents);
if (status)
- goto BAIL3;
+ goto BAIL2;
- if (dst == gstate->clip.surface)
- xoff = yoff = 0;
+ _cairo_pattern_init_for_surface (&intermediate_pattern, intermediate);
+ _cairo_gstate_pattern_init_copy (gstate, &pattern, src);
status = _cairo_surface_composite (operator,
- pattern.source, intermediate, dst,
- 0, 0,
+ &pattern.base,
+ &intermediate_pattern.base,
+ dst,
+ extents.x, extents.y,
0, 0,
- xoff >> 16,
- yoff >> 16,
- draw_extents->x2 - draw_extents->x1,
- draw_extents->y2 - draw_extents->y1);
+ extents.x, extents.y,
+ extents.width, extents.height);
+ _cairo_pattern_fini (&pattern.base);
+ _cairo_pattern_fini (&intermediate_pattern.base);
- BAIL3:
- cairo_surface_destroy (intermediate);
BAIL2:
- _cairo_pattern_fini (&pattern);
+ cairo_surface_destroy (intermediate);
BAIL1:
- pixman_region_destroy (draw_region);
- BAIL0:
if (status)
return status;
} else {
- if (traps->traps[0].left.p1.y < traps->traps[0].left.p2.y) {
- x_src = _cairo_fixed_to_double (traps->traps[0].left.p1.x);
- y_src = _cairo_fixed_to_double (traps->traps[0].left.p1.y);
- } else {
- x_src = _cairo_fixed_to_double (traps->traps[0].left.p2.x);
- y_src = _cairo_fixed_to_double (traps->traps[0].left.p2.y);
+ if (gstate->clip.region) {
+ pixman_box16_t box;
+ pixman_box16_t *intersection_extents;
+ pixman_region16_t *rect, *intersection;
+
+ box.x1 = _cairo_fixed_integer_floor (trap_extents.p1.x);
+ box.y1 = _cairo_fixed_integer_floor (trap_extents.p1.y);
+ box.x2 = _cairo_fixed_integer_ceil (trap_extents.p2.x);
+ box.y2 = _cairo_fixed_integer_ceil (trap_extents.p2.y);
+
+ rect = pixman_region_create_simple (&box);
+ if (rect == NULL)
+ goto bail1;
+ intersection = pixman_region_create();
+ if (intersection == NULL)
+ goto bail2;
+
+ if (pixman_region_intersect (intersection, gstate->clip.region,
+ rect) != PIXMAN_REGION_STATUS_SUCCESS)
+ goto bail3;
+ intersection_extents = pixman_region_extents (intersection);
+
+ extents.x = intersection_extents->x1;
+ extents.y = intersection_extents->y1;
+ extents.width = intersection_extents->x2 - intersection_extents->x1;
+ extents.height = intersection_extents->y2 - intersection_extents->y1;
+ bail3:
+ pixman_region_destroy (intersection);
+ bail2:
+ pixman_region_destroy (rect);
+ bail1:
+ ;
}
- _cairo_pattern_init_copy (&pattern, src);
+ _cairo_gstate_pattern_init_copy (gstate, &pattern, src);
- _cairo_traps_extents (traps, &extents);
- status = _cairo_gstate_create_pattern (gstate, &pattern, &extents);
- if (status)
- return status;
-
status = _cairo_surface_composite_trapezoids (gstate->operator,
- pattern.source, dst,
- x_src - pattern.source_offset.x,
- y_src - pattern.source_offset.y,
+ &pattern.base, dst,
+ extents.x, extents.y,
+ extents.x, extents.y,
+ extents.width,
+ extents.height,
traps->traps,
traps->num_traps);
- _cairo_pattern_fini (&pattern);
+ _cairo_pattern_fini (&pattern.base);
if (status)
return status;
@@ -1628,7 +1653,7 @@ cairo_status_t
_cairo_gstate_in_fill (cairo_gstate_t *gstate,
double x,
double y,
- int *inside_ret)
+ cairo_bool_t *inside_ret)
{
cairo_status_t status = CAIRO_STATUS_SUCCESS;
cairo_traps_t traps;
@@ -1807,9 +1832,10 @@ cairo_status_t
_cairo_gstate_clip (cairo_gstate_t *gstate)
{
cairo_status_t status;
- cairo_pattern_t pattern;
+ cairo_pattern_union_t pattern;
cairo_traps_t traps;
cairo_color_t white_color;
+ cairo_box_t extents;
pixman_box16_t box;
/* Fill the clip region as traps. */
@@ -1871,33 +1897,32 @@ _cairo_gstate_clip (cairo_gstate_t *gstate)
_cairo_color_init (&white_color);
if (gstate->clip.surface == NULL) {
- cairo_box_t extents;
-
_cairo_traps_extents (&traps, &extents);
- gstate->clip.x = extents.p1.x >> 16;
- gstate->clip.y = extents.p1.y >> 16;
- gstate->clip.width = ((extents.p2.x + 65535) >> 16) - gstate->clip.x;
- gstate->clip.height = ((extents.p2.y + 65535) >> 16) - gstate->clip.y;
+ _cairo_box_round_to_rectangle (&extents, &gstate->clip.rect);
gstate->clip.surface =
_cairo_surface_create_similar_solid (gstate->surface,
CAIRO_FORMAT_A8,
- gstate->clip.width,
- gstate->clip.height,
+ gstate->clip.rect.width,
+ gstate->clip.rect.height,
&white_color);
if (gstate->clip.surface == NULL)
return CAIRO_STATUS_NO_MEMORY;
}
- _cairo_pattern_init_solid (&pattern, 1.0, 1.0, 1.0);
- _cairo_pattern_set_alpha (&pattern, 1.0);
-
- _cairo_gstate_clip_and_composite_trapezoids (gstate,
- &pattern,
- CAIRO_OPERATOR_IN,
- gstate->clip.surface,
- &traps);
+ translate_traps (&traps, -gstate->clip.rect.x, -gstate->clip.rect.y);
+ _cairo_pattern_init_solid (&pattern.solid, 1.0, 1.0, 1.0);
- _cairo_pattern_fini (&pattern);
+ status = _cairo_surface_composite_trapezoids (CAIRO_OPERATOR_IN,
+ &pattern.base,
+ gstate->clip.surface,
+ 0, 0,
+ 0, 0,
+ gstate->clip.rect.width,
+ gstate->clip.rect.height,
+ traps.traps,
+ traps.num_traps);
+
+ _cairo_pattern_fini (&pattern.base);
_cairo_traps_fini (&traps);
@@ -1978,19 +2003,15 @@ _cairo_gstate_show_surface (cairo_gstate_t *gstate,
*
*/
- cairo_status_t status;
- cairo_matrix_t user_to_image, image_to_user;
- cairo_matrix_t image_to_device, device_to_image;
+ cairo_status_t status = CAIRO_STATUS_SUCCESS;
+ cairo_matrix_t image_to_user, image_to_device;
double device_x, device_y;
double device_width, device_height;
- cairo_pattern_t pattern;
+ cairo_surface_pattern_t pattern;
cairo_box_t pattern_extents;
+ cairo_rectangle_t extents;
- cairo_surface_get_matrix (surface, &user_to_image);
- cairo_matrix_multiply (&device_to_image, &gstate->ctm_inverse, &user_to_image);
- cairo_surface_set_matrix (surface, &device_to_image);
-
- image_to_user = user_to_image;
+ cairo_surface_get_matrix (surface, &image_to_user);
cairo_matrix_invert (&image_to_user);
cairo_matrix_multiply (&image_to_device, &image_to_user, &gstate->ctm);
@@ -2001,126 +2022,82 @@ _cairo_gstate_show_surface (cairo_gstate_t *gstate,
&device_x, &device_y,
&device_width, &device_height);
- _cairo_pattern_init (&pattern);
+ _cairo_pattern_init_for_surface (&pattern, surface);
+
+ /* inherit surface attributes while surface attribute functions still
+ exist */
+ pattern.base.matrix = surface->matrix;
+ pattern.base.filter = surface->filter;
+ if (surface->repeat)
+ pattern.base.extend = CAIRO_EXTEND_REPEAT;
+ else
+ pattern.base.extend = CAIRO_EXTEND_NONE;
+
+ _cairo_pattern_transform (&pattern.base, &gstate->ctm_inverse);
+ _cairo_pattern_set_alpha (&pattern.base, gstate->alpha);
pattern_extents.p1.x = _cairo_fixed_from_double (device_x);
pattern_extents.p1.y = _cairo_fixed_from_double (device_y);
pattern_extents.p2.x = _cairo_fixed_from_double (device_x + device_width);
pattern_extents.p2.y = _cairo_fixed_from_double (device_y + device_height);
-
- if ((gstate->pattern->type != CAIRO_PATTERN_SOLID) ||
- (gstate->alpha != 1.0)) {
- /* I'm allowing any type of pattern for the mask right now.
- Maybe this is bad. Will allow for some cool effects though. */
- _cairo_pattern_init_copy (&pattern, gstate->pattern);
- status = _cairo_gstate_create_pattern (gstate, &pattern, &pattern_extents);
- if (status)
- return status;
- }
-
+ _cairo_box_round_to_rectangle (&pattern_extents, &extents);
+
if (gstate->clip.surface)
{
- cairo_surface_t *intermediate;
- cairo_color_t empty_color;
- pixman_box16_t *draw_extents;
- pixman_region16_t *draw_region;
-
- draw_region = pixman_region_create ();
- if (draw_region == NULL)
- {
- status = CAIRO_STATUS_NO_MEMORY;
- goto BAIL0;
+ _cairo_rectangle_intersect (&extents, &gstate->clip.rect);
+
+ /* We only need to composite if the rectangle is not empty. */
+ if (!_cairo_rectangle_empty (&extents)) {
+ cairo_surface_pattern_t clip_pattern;
+
+ _cairo_pattern_init_for_surface (&clip_pattern,
+ gstate->clip.surface);
+
+ status = _cairo_surface_composite (gstate->operator,
+ &pattern.base,
+ &clip_pattern.base,
+ gstate->surface,
+ extents.x, extents.y,
+ 0, 0,
+ extents.x, extents.y,
+ extents.width, extents.height);
+
+ _cairo_pattern_fini (&clip_pattern.base);
}
-
- status = _calculate_region_for_intermediate_clip_surface (draw_region,
- &pattern_extents,
- &gstate->clip);
- if (status)
- goto BAIL1;
-
- /* Shortcut if empty */
- if (!pixman_region_not_empty (draw_region)) {
- status = CAIRO_STATUS_SUCCESS;
- goto BAIL1;
- }
-
- draw_extents = pixman_region_extents (draw_region);
-
- _cairo_color_init (&empty_color);
- _cairo_color_set_alpha (&empty_color, .0);
- intermediate = _cairo_surface_create_similar_solid (gstate->clip.surface,
- CAIRO_FORMAT_A8,
- draw_extents->x2 - draw_extents->x1,
- draw_extents->y2 - draw_extents->y1,
- &empty_color);
-
- /* it is not completely clear what the "right" way to combine the
- pattern and mask surface is. I will use the the clip as a source
- and the pattern as a mask in building up my temporary, because
- this is not *totally* bogus and accomodates the case where
- pattern's source image is NULL reasonably well. feel free to
- correct this if you see a reason. */
-
- status = _cairo_surface_composite (CAIRO_OPERATOR_SRC,
- gstate->clip.surface,
- pattern.source,
- intermediate,
- draw_extents->x1 - gstate->clip.x,
- draw_extents->y1 - gstate->clip.y,
- 0, 0,
- 0, 0,
- draw_extents->x2 - draw_extents->x1,
- draw_extents->y2 - draw_extents->y1);
-
-
- if (status)
- goto BAIL2;
-
- status = _cairo_surface_composite (gstate->operator,
- surface,
- intermediate,
- gstate->surface,
- draw_extents->x1, draw_extents->y1,
- 0, 0,
- draw_extents->x1, draw_extents->y1,
- draw_extents->x2 - draw_extents->x1,
- draw_extents->y2 - draw_extents->y1);
-
- BAIL2:
- cairo_surface_destroy (intermediate);
- BAIL1:
- pixman_region_destroy (draw_region);
- BAIL0:
- ;
}
else
{
-
- /* XXX: The rendered size is sometimes 1 or 2 pixels short from
- what I expect. Need to fix this. */
+ /* XXX: The rendered size is sometimes 1 or 2 pixels short
+ * from what I expect. Need to fix this.
+ * KRH: I'm guessing this was due to rounding error when
+ * passing double coordinates for integer arguments. Using
+ * the extents rectangle should fix this, since it's properly
+ * rounded. Is this still the case?
+ */
status = _cairo_surface_composite (gstate->operator,
- surface,
- pattern.source,
+ &pattern.base,
+ NULL,
gstate->surface,
- device_x, device_y,
+ extents.x, extents.y,
0, 0,
- device_x, device_y,
- device_width,
- device_height);
+ extents.x, extents.y,
+ extents.width, extents.height);
}
- _cairo_pattern_fini (&pattern);
+ _cairo_pattern_fini (&pattern.base);
- /* restore the matrix originally in the surface */
- cairo_surface_set_matrix (surface, &user_to_image);
-
- if (status)
- return status;
-
- return CAIRO_STATUS_SUCCESS;
+ return status;
}
+static void
+_cairo_gstate_unset_font (cairo_gstate_t *gstate)
+{
+ if (gstate->font) {
+ cairo_font_destroy (gstate->font);
+ gstate->font = NULL;
+ }
+}
cairo_status_t
_cairo_gstate_select_font (cairo_gstate_t *gstate,
@@ -2128,12 +2105,17 @@ _cairo_gstate_select_font (cairo_gstate_t *gstate,
cairo_font_slant_t slant,
cairo_font_weight_t weight)
{
- if (gstate->font)
- _cairo_unscaled_font_destroy (gstate->font);
+ char *new_family;
- gstate->font = _cairo_unscaled_font_create (family, slant, weight);
- if (gstate->font == NULL)
+ new_family = strdup (family);
+ if (!new_family)
return CAIRO_STATUS_NO_MEMORY;
+
+ _cairo_gstate_unset_font (gstate);
+
+ gstate->font_family = new_family;
+ gstate->font_slant = slant;
+ gstate->font_weight = weight;
cairo_matrix_set_identity (&gstate->font_matrix);
@@ -2144,6 +2126,8 @@ cairo_status_t
_cairo_gstate_scale_font (cairo_gstate_t *gstate,
double scale)
{
+ _cairo_gstate_unset_font (gstate);
+
return cairo_matrix_scale (&gstate->font_matrix, scale, scale);
}
@@ -2153,6 +2137,9 @@ _cairo_gstate_transform_font (cairo_gstate_t *gstate,
{
cairo_matrix_t tmp;
double a, b, c, d, tx, ty;
+
+ _cairo_gstate_unset_font (gstate);
+
cairo_matrix_get_affine (matrix, &a, &b, &c, &d, &tx, &ty);
cairo_matrix_set_affine (&tmp, a, b, c, d, 0, 0);
return cairo_matrix_multiply (&gstate->font_matrix, &gstate->font_matrix, &tmp);
@@ -2160,28 +2147,16 @@ _cairo_gstate_transform_font (cairo_gstate_t *gstate,
cairo_status_t
-_cairo_gstate_current_font (cairo_gstate_t *gstate,
- cairo_font_t **font)
+_cairo_gstate_current_font (cairo_gstate_t *gstate,
+ cairo_font_t **font)
{
- cairo_font_scale_t scale;
- cairo_font_t *scaled;
- double dummy;
-
- scaled = malloc (sizeof (cairo_font_t));
- if (scaled == NULL)
- return CAIRO_STATUS_NO_MEMORY;
-
- cairo_matrix_get_affine (&gstate->font_matrix,
- &scale.matrix[0][0],
- &scale.matrix[0][1],
- &scale.matrix[1][0],
- &scale.matrix[1][1],
- &dummy, &dummy);
-
- _cairo_font_init (scaled, &scale, gstate->font);
- _cairo_unscaled_font_reference (gstate->font);
+ cairo_status_t status;
- *font = scaled;
+ status = _cairo_gstate_ensure_font (gstate);
+ if (status)
+ return status;
+
+ *font = gstate->font;
return CAIRO_STATUS_SUCCESS;
}
@@ -2190,6 +2165,8 @@ void
_cairo_gstate_set_font_transform (cairo_gstate_t *gstate,
cairo_matrix_t *matrix)
{
+ _cairo_gstate_unset_font (gstate);
+
cairo_matrix_copy (&gstate->font_matrix, matrix);
}
@@ -2214,12 +2191,10 @@ _cairo_gstate_current_font_transform (cairo_gstate_t *gstate,
* independently scale the user coordinate system *or* the font matrix, in
* order to adjust the rendered size of the font.
*
- * If the user asks for a permanent reference to "a font", they are given a
- * handle to a structure holding a scale matrix and an unscaled font. This
- * effectively decouples the font from further changes to user space. Even
- * if the user then "sets" the current cairo_t font to the handle they were
- * passed, further changes to the cairo_t CTM will not affect externally
- * held references to the font.
+ * The only font type exposed to the user is cairo_font_t which is a
+ * a font specialized to a particular scale matrix, CTM, and target
+ * surface. The user is responsible for not using a cairo_font_t
+ * after changing the parameters; doing so will produce garbled metrics.
*
*
* The font's view
@@ -2279,9 +2254,9 @@ _cairo_gstate_current_font_transform (cairo_gstate_t *gstate,
*
*/
-static void
-_build_font_scale (cairo_gstate_t *gstate,
- cairo_font_scale_t *sc)
+void
+_cairo_gstate_current_font_scale (cairo_gstate_t *gstate,
+ cairo_font_scale_t *sc)
{
cairo_matrix_t tmp;
double dummy;
@@ -2294,34 +2269,46 @@ _build_font_scale (cairo_gstate_t *gstate,
&dummy, &dummy);
}
-cairo_status_t
-_cairo_gstate_current_font_extents (cairo_gstate_t *gstate,
- cairo_font_extents_t *extents)
+static cairo_status_t
+_cairo_gstate_ensure_font (cairo_gstate_t *gstate)
{
- cairo_int_status_t status;
cairo_font_scale_t sc;
- double font_scale_x, font_scale_y;
+ cairo_status_t status;
+ const char *family;
+
+ if (gstate->font)
+ return CAIRO_STATUS_SUCCESS;
+
+ _cairo_gstate_current_font_scale (gstate, &sc);
- _build_font_scale (gstate, &sc);
+ if (gstate->font_family)
+ family = gstate->font_family;
+ else
+ family = CAIRO_FONT_FAMILY_DEFAULT;
+
+ status = _cairo_font_create (family,
+ gstate->font_slant,
+ gstate->font_weight,
+ &sc,
+ &gstate->font);
- status = _cairo_unscaled_font_font_extents (gstate->font, &sc, extents);
+ if (status)
+ return status;
- _cairo_matrix_compute_scale_factors (&gstate->font_matrix,
- &font_scale_x, &font_scale_y,
- /* XXX */ 1);
-
- /*
- * The font responded in unscaled units, scale by the font
- * matrix scale factors to get to user space
- */
-
- extents->ascent *= font_scale_y;
- extents->descent *= font_scale_y;
- extents->height *= font_scale_y;
- extents->max_x_advance *= font_scale_x;
- extents->max_y_advance *= font_scale_y;
-
- return status;
+ return CAIRO_STATUS_SUCCESS;
+}
+
+cairo_status_t
+_cairo_gstate_current_font_extents (cairo_gstate_t *gstate,
+ cairo_font_extents_t *extents)
+{
+ cairo_status_t status = _cairo_gstate_ensure_font (gstate);
+ if (status)
+ return status;
+
+ return cairo_font_extents (gstate->font,
+ &gstate->font_matrix,
+ extents);
}
cairo_status_t
@@ -2331,14 +2318,15 @@ _cairo_gstate_text_to_glyphs (cairo_gstate_t *gstate,
int *nglyphs)
{
cairo_status_t status;
- cairo_font_scale_t sc;
cairo_point_t point;
double origin_x, origin_y;
int i;
- _build_font_scale (gstate, &sc);
-
+ status = _cairo_gstate_ensure_font (gstate);
+ if (status)
+ return status;
+
status = _cairo_path_current_point (&gstate->path, &point);
if (status == CAIRO_STATUS_NO_CURRENT_POINT) {
origin_x = 0.0;
@@ -2350,8 +2338,8 @@ _cairo_gstate_text_to_glyphs (cairo_gstate_t *gstate,
&origin_x, &origin_y);
}
- status = _cairo_unscaled_font_text_to_glyphs (gstate->font,
- &sc, utf8, glyphs, nglyphs);
+ status = _cairo_font_text_to_glyphs (gstate->font,
+ utf8, glyphs, nglyphs);
if (status || !glyphs || !nglyphs || !(*glyphs) || !(nglyphs))
return status;
@@ -2373,18 +2361,16 @@ _cairo_gstate_text_to_glyphs (cairo_gstate_t *gstate,
cairo_status_t
_cairo_gstate_set_font (cairo_gstate_t *gstate,
- cairo_font_t *font)
-{
- if (gstate->font != NULL)
- _cairo_unscaled_font_destroy (gstate->font);
- gstate->font = font->unscaled;
- _cairo_unscaled_font_reference (gstate->font);
- cairo_matrix_set_affine (&gstate->font_matrix,
- font->scale.matrix[0][0],
- font->scale.matrix[0][1],
- font->scale.matrix[1][0],
- font->scale.matrix[1][1],
- 0, 0);
+ cairo_font_t *font)
+{
+ if (font != gstate->font) {
+ if (gstate->font)
+ cairo_font_destroy (gstate->font);
+ gstate->font = font;
+ if (gstate->font)
+ cairo_font_reference (gstate->font);
+ }
+
return CAIRO_STATUS_SUCCESS;
}
@@ -2394,90 +2380,18 @@ _cairo_gstate_glyph_extents (cairo_gstate_t *gstate,
int num_glyphs,
cairo_text_extents_t *extents)
{
- cairo_status_t status = CAIRO_STATUS_SUCCESS;
- cairo_glyph_t origin_glyph;
- cairo_text_extents_t origin_extents;
- cairo_font_scale_t sc;
- int i;
- double min_x = 0.0, min_y = 0.0, max_x = 0.0, max_y = 0.0;
- double x_pos = 0.0, y_pos = 0.0;
- int set = 0;
-
- if (!num_glyphs)
- {
- extents->x_bearing = 0.0;
- extents->y_bearing = 0.0;
- extents->width = 0.0;
- extents->height = 0.0;
- extents->x_advance = 0.0;
- extents->y_advance = 0.0;
- return CAIRO_STATUS_SUCCESS;
- }
-
- _build_font_scale (gstate, &sc);
-
- for (i = 0; i < num_glyphs; i++)
- {
- double x, y;
- double wm, hm;
-
- origin_glyph = glyphs[i];
- origin_glyph.x = 0.0;
- origin_glyph.y = 0.0;
- status = _cairo_unscaled_font_glyph_extents (gstate->font, &sc,
- &origin_glyph, 1,
- &origin_extents);
-
- /*
- * Transform font space metrics into user space metrics
- * by running the corners through the font matrix and
- * expanding the bounding box as necessary
- */
- x = origin_extents.x_bearing;
- y = origin_extents.y_bearing;
- cairo_matrix_transform_point (&gstate->font_matrix,
- &x, &y);
-
- for (hm = 0.0; hm <= 1.0; hm += 1.0)
- for (wm = 0.0; wm <= 1.0; wm += 1.0)
- {
- x = origin_extents.x_bearing + origin_extents.width * wm;
- y = origin_extents.y_bearing + origin_extents.height * hm;
- cairo_matrix_transform_point (&gstate->font_matrix,
- &x, &y);
- x += glyphs[i].x;
- y += glyphs[i].y;
- if (!set)
- {
- min_x = max_x = x;
- min_y = max_y = y;
- set = 1;
- }
- else
- {
- if (x < min_x) min_x = x;
- if (x > max_x) max_x = x;
- if (y < min_y) min_y = y;
- if (y > max_y) max_y = y;
- }
- }
+ cairo_status_t status;
- x = origin_extents.x_advance;
- y = origin_extents.y_advance;
- cairo_matrix_transform_point (&gstate->font_matrix,
- &x, &y);
- x_pos = glyphs[i].x + x;
- y_pos = glyphs[i].y + y;
- }
+ status = _cairo_gstate_ensure_font (gstate);
+ if (status)
+ return status;
- extents->x_bearing = min_x - glyphs[0].x;
- extents->y_bearing = min_y - glyphs[0].y;
- extents->width = max_x - min_x;
- extents->height = max_y - min_y;
- extents->x_advance = x_pos - glyphs[0].x;
- extents->y_advance = y_pos - glyphs[0].y;
+ cairo_font_glyph_extents (gstate->font,
+ &gstate->font_matrix,
+ glyphs, num_glyphs,
+ extents);
- return status;
+ return CAIRO_STATUS_SUCCESS;
}
cairo_status_t
@@ -2488,12 +2402,14 @@ _cairo_gstate_show_glyphs (cairo_gstate_t *gstate,
cairo_status_t status;
int i;
cairo_glyph_t *transformed_glyphs = NULL;
- cairo_font_scale_t sc;
- cairo_pattern_t pattern;
+ cairo_pattern_union_t pattern;
cairo_box_t bbox;
+ cairo_rectangle_t extents;
- _build_font_scale (gstate, &sc);
-
+ status = _cairo_gstate_ensure_font (gstate);
+ if (status)
+ return status;
+
transformed_glyphs = malloc (num_glyphs * sizeof(cairo_glyph_t));
if (transformed_glyphs == NULL)
return CAIRO_STATUS_NO_MEMORY;
@@ -2506,52 +2422,34 @@ _cairo_gstate_show_glyphs (cairo_gstate_t *gstate,
&transformed_glyphs[i].y);
}
- _cairo_pattern_init_copy (&pattern, gstate->pattern);
- status = _cairo_unscaled_font_glyph_bbox (gstate->font, &sc,
- transformed_glyphs, num_glyphs,
- &bbox);
- if (status)
- goto CLEANUP_GLYPHS;
+ status = _cairo_font_glyph_bbox (gstate->font,
+ transformed_glyphs, num_glyphs,
+ &bbox);
+ _cairo_box_round_to_rectangle (&bbox, &extents);
- status = _cairo_gstate_create_pattern (gstate, &pattern, &bbox);
if (status)
goto CLEANUP_GLYPHS;
-
+
if (gstate->clip.surface)
{
cairo_surface_t *intermediate;
+ cairo_surface_pattern_t intermediate_pattern;
cairo_color_t empty_color;
- pixman_box16_t *draw_extents;
- pixman_region16_t *draw_region;
-
- draw_region = pixman_region_create ();
- if (draw_region == NULL)
- {
- status = CAIRO_STATUS_NO_MEMORY;
- goto BAIL0;
- }
- status = _calculate_region_for_intermediate_clip_surface (draw_region,
- &bbox,
- &gstate->clip);
- if (status) {
- goto BAIL1;
- }
+ _cairo_rectangle_intersect (&extents, &gstate->clip.rect);
/* Shortcut if empty */
- if (!pixman_region_not_empty (draw_region)) {
+ if (_cairo_rectangle_empty (&extents)) {
status = CAIRO_STATUS_SUCCESS;
goto BAIL1;
}
- draw_extents = pixman_region_extents (draw_region);
-
_cairo_color_init (&empty_color);
_cairo_color_set_alpha (&empty_color, .0);
intermediate = _cairo_surface_create_similar_solid (gstate->clip.surface,
CAIRO_FORMAT_A8,
- draw_extents->x2 - draw_extents->x1,
- draw_extents->y2 - draw_extents->y1,
+ extents.width,
+ extents.height,
&empty_color);
if (intermediate == NULL) {
status = CAIRO_STATUS_NO_MEMORY;
@@ -2561,66 +2459,77 @@ _cairo_gstate_show_glyphs (cairo_gstate_t *gstate,
/* move the glyphs again, from dev space to intermediate space */
for (i = 0; i < num_glyphs; ++i)
{
- transformed_glyphs[i].x -= draw_extents->x1;
- transformed_glyphs[i].y -= draw_extents->y1;
+ transformed_glyphs[i].x -= extents.x;
+ transformed_glyphs[i].y -= extents.y;
}
- status = _cairo_unscaled_font_show_glyphs (gstate->font,
- &sc,
- CAIRO_OPERATOR_ADD,
- pattern.source, intermediate,
- draw_extents->x1 - pattern.source_offset.x,
- draw_extents->y1 - pattern.source_offset.y,
- transformed_glyphs, num_glyphs);
+ _cairo_pattern_init_solid (&pattern.solid, 1.0, 1.0, 1.0);
+
+ status = _cairo_font_show_glyphs (gstate->font,
+ CAIRO_OPERATOR_ADD,
+ &pattern.base, intermediate,
+ extents.x, extents.y,
+ 0, 0,
+ extents.width, extents.height,
+ transformed_glyphs, num_glyphs);
+
+ _cairo_pattern_fini (&pattern.base);
if (status)
goto BAIL2;
+ _cairo_pattern_init_for_surface (&pattern.surface,
+ gstate->clip.surface);
+
status = _cairo_surface_composite (CAIRO_OPERATOR_IN,
- gstate->clip.surface,
+ &pattern.base,
NULL,
intermediate,
- draw_extents->x1 - gstate->clip.x,
- draw_extents->y1 - gstate->clip.y,
+ extents.x - gstate->clip.rect.x,
+ extents.y - gstate->clip.rect.y,
0, 0,
0, 0,
- draw_extents->x2 - draw_extents->x1,
- draw_extents->y2 - draw_extents->y1);
+ extents.width, extents.height);
+
+ _cairo_pattern_fini (&pattern.base);
if (status)
goto BAIL2;
+ _cairo_pattern_init_for_surface (&intermediate_pattern, intermediate);
+ _cairo_gstate_pattern_init_copy (gstate, &pattern, gstate->pattern);
+
status = _cairo_surface_composite (gstate->operator,
- pattern.source,
- intermediate,
+ &pattern.base,
+ &intermediate_pattern.base,
gstate->surface,
- 0, 0,
+ extents.x, extents.y,
0, 0,
- draw_extents->x1,
- draw_extents->y1,
- draw_extents->x2 - draw_extents->x1,
- draw_extents->y2 - draw_extents->y1);
+ extents.x, extents.y,
+ extents.width, extents.height);
+ _cairo_pattern_fini (&pattern.base);
+ _cairo_pattern_fini (&intermediate_pattern.base);
BAIL2:
cairo_surface_destroy (intermediate);
BAIL1:
- pixman_region_destroy (draw_region);
- BAIL0:
;
}
else
{
- status = _cairo_unscaled_font_show_glyphs (gstate->font,
- &sc,
- gstate->operator, pattern.source,
- gstate->surface,
- -pattern.source_offset.x,
- -pattern.source_offset.y,
- transformed_glyphs, num_glyphs);
+ _cairo_gstate_pattern_init_copy (gstate, &pattern, gstate->pattern);
+
+ status = _cairo_font_show_glyphs (gstate->font,
+ gstate->operator, &pattern.base,
+ gstate->surface,
+ extents.x, extents.y,
+ extents.x, extents.y,
+ extents.width, extents.height,
+ transformed_glyphs, num_glyphs);
+
+ _cairo_pattern_fini (&pattern.base);
}
- _cairo_pattern_fini (&pattern);
-
CLEANUP_GLYPHS:
free (transformed_glyphs);
@@ -2635,9 +2544,6 @@ _cairo_gstate_glyph_path (cairo_gstate_t *gstate,
cairo_status_t status;
int i;
cairo_glyph_t *transformed_glyphs = NULL;
- cairo_font_scale_t sc;
-
- _build_font_scale (gstate, &sc);
transformed_glyphs = malloc (num_glyphs * sizeof(cairo_glyph_t));
if (transformed_glyphs == NULL)
@@ -2651,9 +2557,9 @@ _cairo_gstate_glyph_path (cairo_gstate_t *gstate,
&(transformed_glyphs[i].y));
}
- status = _cairo_unscaled_font_glyph_path (gstate->font, &sc,
- transformed_glyphs, num_glyphs,
- &gstate->path);
+ status = _cairo_font_glyph_path (gstate->font,
+ transformed_glyphs, num_glyphs,
+ &gstate->path);
free (transformed_glyphs);
return status;
diff --git a/src/cairo-hash.c b/src/cairo-hash.c
index b097b609b..d1ad5a4e2 100644
--- a/src/cairo-hash.c
+++ b/src/cairo-hash.c
@@ -94,9 +94,9 @@ static const cairo_cache_arrangement_t cache_arrangements [] = {
* a mostly-dead table.
*
* Generally you do not need to worry about freeing cache entries; the
- * cache will expire entries randomly as it experiences memory pressure.
- * There is currently no explicit entry-removing call, though one can be
- * added easily.
+ * cache will expire entries randomly as it experiences memory pressure.
+ * If max_memory is set, entries are not expired, and must be explicitely
+ * removed.
*
* This table is open-addressed with double hashing. Each table size is a
* prime chosen to be a little more than double the high water mark for a
@@ -282,17 +282,51 @@ _load_factor (cairo_cache_t *cache)
}
#endif
-static unsigned long
-_random_live_entry (cairo_cache_t *cache)
-{
- unsigned long idx;
- assert(cache != NULL);
- do {
- idx = rand () % cache->arrangement->size;
- } while (! LIVE_ENTRY_P(cache, idx));
- return idx;
-}
+/* Find a random in the cache matching the given predicate. We use the
+ * same algorithm as the probing algorithm to walk over the entries in
+ * the hash table in a pseudo-random order. Walking linearly would
+ * favor entries following gaps in the hash table. We could also
+ * call rand() repeatedly, which works well for almost-full tables,
+ * but degrades when the table is almost empty, or predicate
+ * returns false for most entries.
+ */
+static cairo_cache_entry_base_t **
+_random_entry (cairo_cache_t *cache,
+ int (*predicate)(void*))
+{
+ cairo_cache_entry_base_t **probe;
+ unsigned long hash;
+ unsigned long table_size, i, idx, step;
+
+ _cache_sane_state (cache);
+
+ table_size = cache->arrangement->size;
+ hash = rand ();
+ idx = hash % table_size;
+ step = 0;
+
+ for (i = 0; i < table_size; ++i)
+ {
+ assert(idx < table_size);
+ probe = cache->entries + idx;
+ if (LIVE_ENTRY_P(cache, idx)
+ && (!predicate || predicate (*probe)))
+ return probe;
+
+ if (step == 0) {
+ step = hash % cache->arrangement->rehash;
+ if (step == 0)
+ step = 1;
+ }
+
+ idx += step;
+ if (idx >= table_size)
+ idx -= table_size;
+ }
+
+ return NULL;
+}
/* public API follows */
@@ -356,8 +390,9 @@ _cairo_cache_destroy (cairo_cache_t *cache)
cairo_status_t
_cairo_cache_lookup (cairo_cache_t *cache,
- void *key,
- void **entry_return)
+ void *key,
+ void **entry_return,
+ int *created_entry)
{
unsigned long idx;
@@ -392,6 +427,8 @@ _cairo_cache_lookup (cairo_cache_t *cache,
cache->hits++;
#endif
*entry_return = *slot;
+ if (created_entry)
+ *created_entry = 0;
return status;
}
@@ -401,19 +438,18 @@ _cairo_cache_lookup (cairo_cache_t *cache,
/* Build the new entry. */
status = cache->backend->create_entry (cache, key,
- entry_return);
+ (void **)&new_entry);
if (status != CAIRO_STATUS_SUCCESS)
return status;
- new_entry = (cairo_cache_entry_base_t *) (*entry_return);
-
/* Store the hash value in case the backend forgot. */
new_entry->hashcode = cache->backend->hash (cache, key);
/* Make some entries die if we're under memory pressure. */
while (cache->live_entries > 0 &&
+ cache->max_memory > 0 &&
((cache->max_memory - cache->used_memory) < new_entry->memory)) {
- idx = _random_live_entry (cache);
+ idx = _random_entry (cache, NULL) - cache->entries;
assert (idx < cache->arrangement->size);
_entry_destroy (cache, idx);
}
@@ -425,7 +461,6 @@ _cairo_cache_lookup (cairo_cache_t *cache,
status = _resize_cache (cache, cache->live_entries + 1);
if (status != CAIRO_STATUS_SUCCESS) {
cache->backend->destroy_entry (cache, new_entry);
- *entry_return = NULL;
return status;
}
@@ -439,9 +474,38 @@ _cairo_cache_lookup (cairo_cache_t *cache,
_cache_sane_state (cache);
+ *entry_return = new_entry;
+ if (created_entry)
+ *created_entry = 1;
+
return status;
}
+cairo_status_t
+_cairo_cache_remove (cairo_cache_t *cache,
+ void *key)
+{
+ cairo_cache_entry_base_t **slot;
+
+ _cache_sane_state (cache);
+
+ /* See if we have an entry in the table already. */
+ slot = _find_exact_live_entry_for (cache, key);
+ if (slot != NULL)
+ _entry_destroy (cache, slot - cache->entries);
+
+ return CAIRO_STATUS_SUCCESS;
+}
+
+void *
+_cairo_cache_random_entry (cairo_cache_t *cache,
+ int (*predicate)(void*))
+{
+ cairo_cache_entry_base_t **slot = _random_entry (cache, predicate);
+
+ return slot ? *slot : NULL;
+}
+
unsigned long
_cairo_hash_string (const char *c)
{
diff --git a/src/cairo-hull.c b/src/cairo-hull.c
index 99b16d1ae..c93d70625 100644
--- a/src/cairo-hull.c
+++ b/src/cairo-hull.c
@@ -31,7 +31,7 @@
* California.
*
* Contributor(s):
- * Carl D. Worth <cworth@isi.edu>
+ * Carl D. Worth <cworth@cworth.org>
*/
#include "cairoint.h"
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 14e30f695..9745b3150 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -31,7 +31,7 @@
* California.
*
* Contributor(s):
- * Carl D. Worth <cworth@isi.edu>
+ * Carl D. Worth <cworth@cworth.org>
*/
#include "cairoint.h"
@@ -54,7 +54,8 @@ _cairo_format_bpp (cairo_format_t format)
}
static cairo_image_surface_t *
-_cairo_image_surface_create_for_pixman_image (pixman_image_t *pixman_image)
+_cairo_image_surface_create_for_pixman_image (pixman_image_t *pixman_image,
+ cairo_format_t format)
{
cairo_image_surface_t *surface;
@@ -66,6 +67,7 @@ _cairo_image_surface_create_for_pixman_image (pixman_image_t *pixman_image)
surface->pixman_image = pixman_image;
+ surface->format = format;
surface->data = (char *) pixman_image_get_data (pixman_image);
surface->owns_data = 0;
@@ -105,7 +107,8 @@ _cairo_image_surface_create_with_masks (char *data,
if (pixman_image == NULL)
return NULL;
- surface = _cairo_image_surface_create_for_pixman_image (pixman_image);
+ surface = _cairo_image_surface_create_for_pixman_image (pixman_image,
+ (cairo_format_t)-1);
return surface;
}
@@ -130,6 +133,20 @@ _create_pixman_format (cairo_format_t format)
}
}
+/**
+ * cairo_image_surface_create:
+ * @format: format of pixels in the surface to create
+ * @width: width of the surface, in pixels
+ * @height: height of the surface, in pixels
+ *
+ * Creates an image surface of the specified format and
+ * dimensions. The initial contents of the surface is undefined; you
+ * must explicitely clear the buffer, using, for example,
+ * cairo_rectangle() and cairo_fill() if you want it cleared.
+ *
+ * Return value: the newly created surface, or %NULL if it couldn't
+ * be created because of lack of memory
+ **/
cairo_surface_t *
cairo_image_surface_create (cairo_format_t format,
int width,
@@ -150,11 +167,33 @@ cairo_image_surface_create (cairo_format_t format,
if (pixman_image == NULL)
return NULL;
- surface = _cairo_image_surface_create_for_pixman_image (pixman_image);
+ surface = _cairo_image_surface_create_for_pixman_image (pixman_image, format);
return &surface->base;
}
+/**
+ * cairo_image_surface_create_for_data:
+ * @data: a pointer to a buffer supplied by the application
+ * in which to write contents.
+ * @format: the format of pixels in the buffer
+ * @width: the width of the image to be stored in the buffer
+ * @height: the height of the image to be stored in the buffer
+ * @stride: the number of bytes between the start of rows
+ * in the buffer. Having this be specified separate from @width
+ * allows for padding at the end of rows, or for writing
+ * to a subportion of a larger image.
+ *
+ * Creates an image surface for the provided pixel data. The output
+ * buffer must be kept around until the #cairo_surface_t is destroyed
+ * or cairo_surface_finish() is called on the surface. The initial
+ * contents of @buffer will be used as the inital image contents; you
+ * must explicitely clear the buffer, using, for example,
+ * cairo_rectangle() and cairo_fill() if you want it cleared.
+ *
+ * Return value: the newly created surface, or %NULL if it couldn't
+ * be created because of lack of memory
+ **/
cairo_surface_t *
cairo_image_surface_create_for_data (char *data,
cairo_format_t format,
@@ -180,7 +219,7 @@ cairo_image_surface_create_for_data (char *data,
if (pixman_image == NULL)
return NULL;
- surface = _cairo_image_surface_create_for_pixman_image (pixman_image);
+ surface = _cairo_image_surface_create_for_pixman_image (pixman_image, format);
return &surface->base;
}
@@ -224,33 +263,66 @@ _cairo_image_surface_pixels_per_inch (void *abstract_surface)
return 96.0;
}
-static cairo_image_surface_t *
-_cairo_image_surface_get_image (void *abstract_surface)
+static cairo_status_t
+_cairo_image_surface_acquire_source_image (void *abstract_surface,
+ cairo_image_surface_t **image_out,
+ void **image_extra)
{
- cairo_image_surface_t *surface = abstract_surface;
-
- cairo_surface_reference (&surface->base);
+ *image_out = abstract_surface;
+
+ return CAIRO_STATUS_SUCCESS;
+}
- return surface;
+static void
+_cairo_image_surface_release_source_image (void *abstract_surface,
+ cairo_image_surface_t *image,
+ void *image_extra)
+{
}
static cairo_status_t
-_cairo_image_surface_set_image (void *abstract_surface,
- cairo_image_surface_t *image)
+_cairo_image_surface_acquire_dest_image (void *abstract_surface,
+ cairo_rectangle_t *interest_rect,
+ cairo_image_surface_t **image_out,
+ cairo_rectangle_t *image_rect_out,
+ void **image_extra)
{
- if (image == abstract_surface)
- return CAIRO_STATUS_SUCCESS;
+ cairo_image_surface_t *surface = abstract_surface;
+
+ image_rect_out->x = 0;
+ image_rect_out->y = 0;
+ image_rect_out->width = surface->width;
+ image_rect_out->height = surface->height;
+
+ *image_out = surface;
- /* XXX: This case has not yet been implemented. We'll lie for now. */
return CAIRO_STATUS_SUCCESS;
}
+static void
+_cairo_image_surface_release_dest_image (void *abstract_surface,
+ cairo_rectangle_t *interest_rect,
+ cairo_image_surface_t *image,
+ cairo_rectangle_t *image_rect,
+ void *image_extra)
+{
+}
+
static cairo_status_t
-_cairo_image_abstract_surface_set_matrix (void *abstract_surface,
- cairo_matrix_t *matrix)
+_cairo_image_surface_clone_similar (void *abstract_surface,
+ cairo_surface_t *src,
+ cairo_surface_t **clone_out)
{
cairo_image_surface_t *surface = abstract_surface;
- return _cairo_image_surface_set_matrix (surface, matrix);
+
+ if (src->backend == surface->base.backend) {
+ *clone_out = src;
+ cairo_surface_reference (src);
+
+ return CAIRO_STATUS_SUCCESS;
+ }
+
+ return CAIRO_INT_STATUS_UNSUPPORTED;
}
cairo_status_t
@@ -276,14 +348,6 @@ _cairo_image_surface_set_matrix (cairo_image_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
-_cairo_image_abstract_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
-{
- cairo_image_surface_t *surface = abstract_surface;
-
- return _cairo_image_surface_set_filter (surface, filter);
-}
-
cairo_status_t
_cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t filter)
{
@@ -314,13 +378,6 @@ _cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t
return CAIRO_STATUS_SUCCESS;
}
-static cairo_status_t
-_cairo_image_abstract_surface_set_repeat (void *abstract_surface, int repeat)
-{
- cairo_image_surface_t *surface = abstract_surface;
- return _cairo_image_surface_set_repeat (surface, repeat);
-}
-
cairo_status_t
_cairo_image_surface_set_repeat (cairo_image_surface_t *surface, int repeat)
{
@@ -329,6 +386,34 @@ _cairo_image_surface_set_repeat (cairo_image_surface_t *surface, int repeat)
return CAIRO_STATUS_SUCCESS;
}
+static cairo_int_status_t
+_cairo_image_surface_set_attributes (cairo_image_surface_t *surface,
+ cairo_surface_attributes_t *attributes)
+{
+ cairo_int_status_t status;
+
+ status = _cairo_image_surface_set_matrix (surface, &attributes->matrix);
+ if (status)
+ return status;
+
+ switch (attributes->extend) {
+ case CAIRO_EXTEND_NONE:
+ _cairo_image_surface_set_repeat (surface, 0);
+ break;
+ case CAIRO_EXTEND_REPEAT:
+ _cairo_image_surface_set_repeat (surface, 1);
+ break;
+ case CAIRO_EXTEND_REFLECT:
+ /* XXX: Obviously wrong. */
+ _cairo_image_surface_set_repeat (surface, 1);
+ break;
+ }
+
+ status = _cairo_image_surface_set_filter (surface, attributes->filter);
+
+ return status;
+}
+
static pixman_operator_t
_pixman_operator (cairo_operator_t operator)
{
@@ -368,8 +453,8 @@ _pixman_operator (cairo_operator_t operator)
static cairo_int_status_t
_cairo_image_surface_composite (cairo_operator_t operator,
- cairo_surface_t *generic_src,
- cairo_surface_t *generic_mask,
+ cairo_pattern_t *src_pattern,
+ cairo_pattern_t *mask_pattern,
void *abstract_dst,
int src_x,
int src_y,
@@ -380,26 +465,61 @@ _cairo_image_surface_composite (cairo_operator_t operator,
unsigned int width,
unsigned int height)
{
- cairo_image_surface_t *dst = abstract_dst;
- cairo_image_surface_t *src = (cairo_image_surface_t *) generic_src;
- cairo_image_surface_t *mask = (cairo_image_surface_t *) generic_mask;
-
- if (generic_src->backend != dst->base.backend ||
- (generic_mask && (generic_mask->backend != dst->base.backend)))
+ cairo_surface_attributes_t src_attr, mask_attr;
+ cairo_image_surface_t *dst = abstract_dst;
+ cairo_image_surface_t *src;
+ cairo_image_surface_t *mask;
+ cairo_int_status_t status;
+
+ status = _cairo_pattern_acquire_surfaces (src_pattern, mask_pattern,
+ &dst->base,
+ src_x, src_y,
+ mask_x, mask_y,
+ width, height,
+ (cairo_surface_t **) &src,
+ (cairo_surface_t **) &mask,
+ &src_attr, &mask_attr);
+ if (status)
+ return status;
+
+ status = _cairo_image_surface_set_attributes (src, &src_attr);
+ if (CAIRO_OK (status))
{
- return CAIRO_INT_STATUS_UNSUPPORTED;
+ if (mask)
+ {
+ status = _cairo_image_surface_set_attributes (mask, &mask_attr);
+ if (CAIRO_OK (status))
+ pixman_composite (_pixman_operator (operator),
+ src->pixman_image,
+ mask->pixman_image,
+ dst->pixman_image,
+ src_x + src_attr.x_offset,
+ src_y + src_attr.y_offset,
+ mask_x + mask_attr.x_offset,
+ mask_y + mask_attr.y_offset,
+ dst_x, dst_y,
+ width, height);
+ }
+ else
+ {
+ pixman_composite (_pixman_operator (operator),
+ src->pixman_image,
+ NULL,
+ dst->pixman_image,
+ src_x + src_attr.x_offset,
+ src_y + src_attr.y_offset,
+ 0, 0,
+ dst_x, dst_y,
+ width, height);
+ }
}
- pixman_composite (_pixman_operator (operator),
- src->pixman_image,
- mask ? mask->pixman_image : NULL,
- dst->pixman_image,
- src_x, src_y,
- mask_x, mask_y,
- dst_x, dst_y,
- width, height);
-
- return CAIRO_STATUS_SUCCESS;
+ if (mask)
+ _cairo_pattern_release_surface (&dst->base, &mask->base, &mask_attr);
+
+ _cairo_pattern_release_surface (&dst->base, &src->base, &src_attr);
+
+ return status;
}
static cairo_int_status_t
@@ -427,24 +547,56 @@ _cairo_image_surface_fill_rectangles (void *abstract_surface,
static cairo_int_status_t
_cairo_image_surface_composite_trapezoids (cairo_operator_t operator,
- cairo_surface_t *generic_src,
+ cairo_pattern_t *pattern,
void *abstract_dst,
- int x_src,
- int y_src,
+ int src_x,
+ int src_y,
+ int dst_x,
+ int dst_y,
+ unsigned int width,
+ unsigned int height,
cairo_trapezoid_t *traps,
int num_traps)
{
- cairo_image_surface_t *dst = abstract_dst;
- cairo_image_surface_t *src = (cairo_image_surface_t *) generic_src;
+ cairo_surface_attributes_t attributes;
+ cairo_image_surface_t *dst = abstract_dst;
+ cairo_image_surface_t *src;
+ cairo_int_status_t status;
+ int render_reference_x, render_reference_y;
+ int render_src_x, render_src_y;
+
+ status = _cairo_pattern_acquire_surface (pattern, &dst->base,
+ src_x, src_y, width, height,
+ (cairo_surface_t **) &src,
+ &attributes);
+ if (status)
+ return status;
+
+ if (traps[0].left.p1.y < traps[0].left.p2.y) {
+ render_reference_x = _cairo_fixed_integer_floor (traps[0].left.p1.x);
+ render_reference_y = _cairo_fixed_integer_floor (traps[0].left.p1.y);
+ } else {
+ render_reference_x = _cairo_fixed_integer_floor (traps[0].left.p2.x);
+ render_reference_y = _cairo_fixed_integer_floor (traps[0].left.p2.y);
+ }
- if (generic_src->backend != dst->base.backend)
- return CAIRO_INT_STATUS_UNSUPPORTED;
+ render_src_x = src_x + render_reference_x - dst_x;
+ render_src_y = src_y + render_reference_y - dst_y;
- /* XXX: The pixman_trapezoid_t cast is evil and needs to go away somehow. */
- pixman_composite_trapezoids (operator, src->pixman_image, dst->pixman_image,
- x_src, y_src, (pixman_trapezoid_t *) traps, num_traps);
+ /* XXX: The pixman_trapezoid_t cast is evil and needs to go away
+ * somehow. */
+ status = _cairo_image_surface_set_attributes (src, &attributes);
+ if (CAIRO_OK (status))
+ pixman_composite_trapezoids (operator,
+ src->pixman_image,
+ dst->pixman_image,
+ render_src_x + attributes.x_offset,
+ render_src_y + attributes.y_offset,
+ (pixman_trapezoid_t *) traps, num_traps);
- return CAIRO_STATUS_SUCCESS;
+ _cairo_pattern_release_surface (&dst->base, &src->base, &attributes);
+
+ return status;
}
static cairo_int_status_t
@@ -490,41 +642,34 @@ _cairo_image_surface_set_clip_region (cairo_image_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
-static cairo_int_status_t
-_cairo_image_abstract_surface_create_pattern (void *abstract_surface,
- cairo_pattern_t *pattern,
- cairo_box_t *box)
+/**
+ * _cairo_surface_is_image:
+ * @surface: a #cairo_surface_t
+ *
+ * Checks if a surface is an #cairo_image_surface_t
+ *
+ * Return value: True if the surface is an image surface
+ **/
+int
+_cairo_surface_is_image (cairo_surface_t *surface)
{
- cairo_image_surface_t *image;
-
- /* Fall back to general pattern creation for surface patterns. */
- if (pattern->type == CAIRO_PATTERN_SURFACE)
- return CAIRO_INT_STATUS_UNSUPPORTED;
-
- image = _cairo_pattern_get_image (pattern, box);
- if (image) {
- pattern->source = &image->base;
-
- return CAIRO_STATUS_SUCCESS;
- } else
- return CAIRO_STATUS_NO_MEMORY;
+ return surface->backend == &cairo_image_surface_backend;
}
-
+
static const cairo_surface_backend_t cairo_image_surface_backend = {
_cairo_image_surface_create_similar,
_cairo_image_abstract_surface_destroy,
_cairo_image_surface_pixels_per_inch,
- _cairo_image_surface_get_image,
- _cairo_image_surface_set_image,
- _cairo_image_abstract_surface_set_matrix,
- _cairo_image_abstract_surface_set_filter,
- _cairo_image_abstract_surface_set_repeat,
+ _cairo_image_surface_acquire_source_image,
+ _cairo_image_surface_release_source_image,
+ _cairo_image_surface_acquire_dest_image,
+ _cairo_image_surface_release_dest_image,
+ _cairo_image_surface_clone_similar,
_cairo_image_surface_composite,
_cairo_image_surface_fill_rectangles,
_cairo_image_surface_composite_trapezoids,
_cairo_image_surface_copy_page,
_cairo_image_surface_show_page,
_cairo_image_abstract_surface_set_clip_region,
- _cairo_image_abstract_surface_create_pattern,
NULL /* show_glyphs */
};
diff --git a/src/cairo-matrix.c b/src/cairo-matrix.c
index b964b688c..88e536e8a 100644
--- a/src/cairo-matrix.c
+++ b/src/cairo-matrix.c
@@ -31,7 +31,7 @@
* California.
*
* Contributor(s):
- * Carl D. Worth <cworth@isi.edu>
+ * Carl D. Worth <cworth@cworth.org>
*/
#define _GNU_SOURCE
@@ -54,6 +54,14 @@ _cairo_matrix_scalar_multiply (cairo_matrix_t *matrix, double scalar);
static void
_cairo_matrix_compute_adjoint (cairo_matrix_t *matrix);
+/**
+ * cairo_matrix_create:
+ *
+ * Creates a new identity matrix.
+ *
+ * Return value: a newly created matrix; free with cairo_matrix_destroy(),
+ * or %NULL if memory couldn't be allocated.
+ **/
cairo_matrix_t *
cairo_matrix_create (void)
{
@@ -80,6 +88,12 @@ _cairo_matrix_fini (cairo_matrix_t *matrix)
/* nothing to do here */
}
+/**
+ * cairo_matrix_destroy:
+ * @matrix: a #cairo_matrix_t
+ *
+ * Frees a matrix created with cairo_matrix_create.
+ **/
void
cairo_matrix_destroy (cairo_matrix_t *matrix)
{
@@ -87,6 +101,15 @@ cairo_matrix_destroy (cairo_matrix_t *matrix)
free (matrix);
}
+/**
+ * cairo_matrix_copy:
+ * @matrix: a #cairo_matrix_t
+ * @other: another #cairo_
+ *
+ * Modifies @matrix to be identical to @other.
+ *
+ * Return value: %CAIRO_STATUS_SUCCESS, always.
+ **/
cairo_status_t
cairo_matrix_copy (cairo_matrix_t *matrix, const cairo_matrix_t *other)
{
@@ -96,6 +119,14 @@ cairo_matrix_copy (cairo_matrix_t *matrix, const cairo_matrix_t *other)
}
slim_hidden_def(cairo_matrix_copy);
+/**
+ * cairo_matrix_set_identity:
+ * @matrix: a #cairo_matrix_t
+ *
+ * Modifies @matrix to be an identity transformation.
+ *
+ * Return value: %CAIRO_STATUS_SUCCESS, always.
+ **/
cairo_status_t
cairo_matrix_set_identity (cairo_matrix_t *matrix)
{
@@ -105,6 +136,26 @@ cairo_matrix_set_identity (cairo_matrix_t *matrix)
}
slim_hidden_def(cairo_matrix_set_identity);
+/**
+ * cairo_matrix_set_affine:
+ * @matrix: a cairo_matrix_t
+ * @a: a component of the affine transformation
+ * @b: b component of the affine transformation
+ * @c: c component of the affine transformation
+ * @d: d component of the affine transformation
+ * @tx: X translation component of the affine transformation
+ * @ty: Y translation component of the affine transformation
+ *
+ * Sets @matrix to be the affine transformation given by
+ * @a, b, @c, @d, @tx, @ty. The transformation is given
+ * by:
+ * <programlisting>
+ * x_new = x * a + y * c + tx;
+ * y_new = x * b + y * d + ty;
+ * </programlisting>
+ *
+ * Return value: %CAIRO_STATUS_SUCCESS, always.
+ **/
cairo_status_t
cairo_matrix_set_affine (cairo_matrix_t *matrix,
double a, double b,
@@ -119,6 +170,21 @@ cairo_matrix_set_affine (cairo_matrix_t *matrix,
}
slim_hidden_def(cairo_matrix_set_affine);
+/**
+ * cairo_matrix_get_affine:
+ * @matrix: a @cairo_matrix_t
+ * @a: location to store a component of affine transformation, or %NULL
+ * @b: location to store b component of affine transformation, or %NULL
+ * @c: location to store c component of affine transformation, or %NULL
+ * @d: location to store d component of affine transformation, or %NULL
+ * @tx: location to store X-translation component of affine transformation, or %NULL
+ * @ty: location to store Y-translation component of affine transformation, or %NULL
+ *
+ * Gets the matrix values for the affine tranformation that @matrix represents.
+ * See cairo_matrix_set_affine().
+ *
+ * Return value: %CAIRO_STATUS_SUCCESS, always.
+ **/
cairo_status_t
cairo_matrix_get_affine (cairo_matrix_t *matrix,
double *a, double *b,
@@ -153,6 +219,18 @@ _cairo_matrix_set_translate (cairo_matrix_t *matrix,
tx, ty);
}
+/**
+ * cairo_matrix_translate:
+ * @matrix: a cairo_matrix_t
+ * @tx: amount to rotate in the X direction
+ * @ty: amount to rotate in the Y direction
+ *
+ * Applies a translation by @tx, @ty to the transformation in
+ * @matrix. The new transformation is given by first translating by
+ * @tx, @ty then applying the original transformation
+ *
+ * Return value: %CAIRO_STATUS_SUCCESS, always.
+ **/
cairo_status_t
cairo_matrix_translate (cairo_matrix_t *matrix, double tx, double ty)
{
@@ -173,6 +251,18 @@ _cairo_matrix_set_scale (cairo_matrix_t *matrix,
0, 0);
}
+/**
+ * cairo_matrix_scale:
+ * @matrix: a #cairo_matrix_t
+ * @sx: Scale factor in the X direction
+ * @sy: Scale factor in the Y direction
+ *
+ * Applies scaling by @tx, @ty to the transformation in
+ * @matrix. The new transformation is given by first scaling by @sx
+ * and @sy then applying the original transformation
+ *
+ * Return value: %CAIRO_STATUS_SUCCESS, always.
+ **/
cairo_status_t
cairo_matrix_scale (cairo_matrix_t *matrix, double sx, double sy)
{
@@ -202,6 +292,21 @@ _cairo_matrix_set_rotate (cairo_matrix_t *matrix,
0, 0);
}
+/**
+ * cairo_matrix_rotate:
+ * @matrix: a @cairo_matrix_t
+ * @radians: angle of rotation, in radians. Angles are defined
+ * so that an angle of 90 degrees (%M_PI radians) rotates the
+ * positive X axis into the positive Y axis. With the default
+ * Cairo choice of axis orientation, positive rotations are
+ * clockwise.
+ *
+ * Applies rotation by @radians to the transformation in
+ * @matrix. The new transformation is given by first rotating by
+ * @radians then applying the original transformation
+ *
+ * Return value: %CAIRO_STATUS_SUCCESS, always.
+ **/
cairo_status_t
cairo_matrix_rotate (cairo_matrix_t *matrix, double radians)
{
@@ -212,6 +317,19 @@ cairo_matrix_rotate (cairo_matrix_t *matrix, double radians)
return cairo_matrix_multiply (matrix, &tmp, matrix);
}
+/**
+ * cairo_matrix_multiply:
+ * @result: a @cairo_matrix_t in which to store the result
+ * @a: a @cairo_matrix_t
+ * @b: a @cairo_matrix_t
+ *
+ * Multiplies the affine transformations in @a and @b together
+ * and stores the result in @result. The resulting transformation
+ * is given by first applying the transformation in @b then
+ * applying the transformation in @a.
+ *
+ * Return value: %CAIRO_STATUS_SUCCESS, always.
+ **/
cairo_status_t
cairo_matrix_multiply (cairo_matrix_t *result, const cairo_matrix_t *a, const cairo_matrix_t *b)
{
@@ -238,6 +356,27 @@ cairo_matrix_multiply (cairo_matrix_t *result, const cairo_matrix_t *a, const ca
}
slim_hidden_def(cairo_matrix_multiply);
+/**
+ * cairo_matrix_transform_distance:
+ * @matrix: a @cairo_matrix_t
+ * @dx: a distance in the X direction. An in/out parameter
+ * @dy: a distance in the Y direction. An in/out parameter
+ *
+ * Transforms the vector (@dx,@dy) by @matrix. Translation is
+ * ignored. In terms of the components of the affine transformation:
+ *
+ * <programlisting>
+ * dx2 = dx1 * a + dy1 * c;
+ * dy2 = dx1 * b + dy1 * d;
+ * </programlisting>
+ *
+ * Affine transformations are position invariant, so the same vector
+ * always transforms to the same vector. If (@x1,@y1) transforms
+ * to (@x2,@y2) then (@x1+@dx1,@y1+@dy1) will transform to
+ * (@x1+@dx2,@y1+@dy2) for all values of @x1 and @x2.
+ *
+ * Return value: %CAIRO_STATUS_SUCCESS, always.
+ **/
cairo_status_t
cairo_matrix_transform_distance (cairo_matrix_t *matrix, double *dx, double *dy)
{
@@ -255,6 +394,16 @@ cairo_matrix_transform_distance (cairo_matrix_t *matrix, double *dx, double *dy)
}
slim_hidden_def(cairo_matrix_transform_distance);
+/**
+ * cairo_matrix_transform_point:
+ * @matrix: a @cairo_matrix_t
+ * @x: X position. An in/out parameter
+ * @y: Y position. An in/out parameter
+ *
+ * Transforms the point (@x, @y) by @matrix.
+ *
+ * Return value: %CAIRO_STATUS_SUCCESS, always.
+ **/
cairo_status_t
cairo_matrix_transform_point (cairo_matrix_t *matrix, double *x, double *y)
{
@@ -351,6 +500,19 @@ _cairo_matrix_compute_adjoint (cairo_matrix_t *matrix)
c*ty - d*tx, b*tx - a*ty);
}
+/**
+ * cairo_matrix_invert:
+ * @matrix: a @cairo_matrix_t
+ *
+ * Changes @matrix to be the inverse of it's original value. Not
+ * all transformation matrices have inverses; if the matrix
+ * collapses points together (it is <firstterm>degenerate</firstterm>),
+ * then it has no inverse and this function will fail.
+ *
+ * Returns: If @matrix has an inverse, modifies @matrix to
+ * be the inverse matrix and returns %CAIRO_STATUS_SUCCESS. Otherwise,
+ * returns %CAIRO_STATUS_INVALID_MATRIX.
+ **/
cairo_status_t
cairo_matrix_invert (cairo_matrix_t *matrix)
{
@@ -458,7 +620,7 @@ _cairo_matrix_compute_scale_factors (cairo_matrix_t *matrix, double *sx, double
return CAIRO_STATUS_SUCCESS;
}
-int
+cairo_bool_t
_cairo_matrix_is_integer_translation(cairo_matrix_t *mat,
int *itx, int *ity)
{
@@ -477,7 +639,7 @@ _cairo_matrix_is_integer_translation(cairo_matrix_t *mat,
if (ok) {
*itx = _cairo_fixed_integer_part(ttx);
*ity = _cairo_fixed_integer_part(tty);
- return 1;
+ return TRUE;
}
- return 0;
+ return FALSE;
}
diff --git a/src/cairo-path-bounds.c b/src/cairo-path-bounds.c
index cfcdd97ee..7c5772a82 100644
--- a/src/cairo-path-bounds.c
+++ b/src/cairo-path-bounds.c
@@ -31,7 +31,7 @@
* California.
*
* Contributor(s):
- * Carl D. Worth <cworth@isi.edu>
+ * Carl D. Worth <cworth@cworth.org>
*/
#include "cairoint.h"
diff --git a/src/cairo-path-fill.c b/src/cairo-path-fill.c
index 6c6ebd976..dc79b6b96 100644
--- a/src/cairo-path-fill.c
+++ b/src/cairo-path-fill.c
@@ -31,7 +31,7 @@
* California.
*
* Contributor(s):
- * Carl D. Worth <cworth@isi.edu>
+ * Carl D. Worth <cworth@cworth.org>
*/
#include "cairoint.h"
diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c
index ad0220370..08b380902 100644
--- a/src/cairo-path-stroke.c
+++ b/src/cairo-path-stroke.c
@@ -31,7 +31,7 @@
* California.
*
* Contributor(s):
- * Carl D. Worth <cworth@isi.edu>
+ * Carl D. Worth <cworth@cworth.org>
*/
#include "cairoint.h"
diff --git a/src/cairo-path.c b/src/cairo-path.c
index 36c25d637..8314f601c 100644
--- a/src/cairo-path.c
+++ b/src/cairo-path.c
@@ -31,7 +31,7 @@
* California.
*
* Contributor(s):
- * Carl D. Worth <cworth@isi.edu>
+ * Carl D. Worth <cworth@cworth.org>
*/
#include <stdlib.h>
@@ -100,6 +100,7 @@ _cairo_path_init_copy (cairo_path_t *path, cairo_path_t *other)
for (other_op = other->op_head; other_op; other_op = other_op->next) {
op = _cairo_path_op_buf_create ();
if (op == NULL) {
+ _cairo_path_fini(path);
return CAIRO_STATUS_NO_MEMORY;
}
*op = *other_op;
@@ -109,6 +110,7 @@ _cairo_path_init_copy (cairo_path_t *path, cairo_path_t *other)
for (other_arg = other->arg_head; other_arg; other_arg = other_arg->next) {
arg = _cairo_path_arg_buf_create ();
if (arg == NULL) {
+ _cairo_path_fini(path);
return CAIRO_STATUS_NO_MEMORY;
}
*arg = *other_arg;
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 6cb981458..283c36dbd 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -21,58 +21,108 @@
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * Author: David Reveman <c99drn@cs.umu.se>
+ * Author: David Reveman <davidr@novell.com>
*/
#include "cairoint.h"
+typedef void (*cairo_shader_function_t) (unsigned char *color0,
+ unsigned char *color1,
+ cairo_fixed_t factor,
+ uint32_t *pixel);
+
+typedef struct _cairo_shader_color_stop {
+ cairo_fixed_t offset;
+ cairo_fixed_48_16_t scale;
+ int id;
+ unsigned char color_char[4];
+} cairo_shader_color_stop_t;
+
+typedef struct _cairo_shader_op {
+ cairo_shader_color_stop_t *stops;
+ int n_stops;
+ cairo_extend_t extend;
+ cairo_shader_function_t shader_function;
+} cairo_shader_op_t;
+
#define MULTIPLY_COLORCOMP(c1, c2) \
((unsigned char) \
((((unsigned char) (c1)) * (int) ((unsigned char) (c2))) / 0xff))
-void
-_cairo_pattern_init (cairo_pattern_t *pattern)
+static void
+_cairo_pattern_init (cairo_pattern_t *pattern, cairo_pattern_type_t type)
{
+ pattern->type = type;
pattern->ref_count = 1;
-
- pattern->extend = CAIRO_EXTEND_DEFAULT;
- pattern->filter = CAIRO_FILTER_DEFAULT;
-
- _cairo_color_init (&pattern->color);
+ pattern->extend = CAIRO_EXTEND_DEFAULT;
+ pattern->filter = CAIRO_FILTER_DEFAULT;
+ pattern->alpha = 1.0;
_cairo_matrix_init (&pattern->matrix);
+}
- pattern->stops = NULL;
- pattern->n_stops = 0;
+static cairo_status_t
+_cairo_gradient_pattern_init_copy (cairo_gradient_pattern_t *pattern,
+ cairo_gradient_pattern_t *other)
+{
+ if (other->base.type == CAIRO_PATTERN_LINEAR)
+ {
+ cairo_linear_pattern_t *dst = (cairo_linear_pattern_t *) pattern;
+ cairo_linear_pattern_t *src = (cairo_linear_pattern_t *) other;
+
+ *dst = *src;
+ }
+ else
+ {
+ cairo_radial_pattern_t *dst = (cairo_radial_pattern_t *) pattern;
+ cairo_radial_pattern_t *src = (cairo_radial_pattern_t *) other;
+
+ *dst = *src;
+ }
- pattern->type = CAIRO_PATTERN_SOLID;
+ if (other->n_stops)
+ {
+ pattern->stops = malloc (other->n_stops * sizeof (cairo_color_stop_t));
+ if (!pattern->stops)
+ return CAIRO_STATUS_NO_MEMORY;
+
+ memcpy (pattern->stops, other->stops,
+ other->n_stops * sizeof (cairo_color_stop_t));
+ }
- pattern->source = NULL;
- pattern->source_offset.x = 0.0;
- pattern->source_offset.y = 0.0;
+ return CAIRO_STATUS_SUCCESS;
}
cairo_status_t
_cairo_pattern_init_copy (cairo_pattern_t *pattern, cairo_pattern_t *other)
{
- *pattern = *other;
-
- pattern->ref_count = 1;
+ switch (other->type) {
+ case CAIRO_PATTERN_SOLID: {
+ cairo_solid_pattern_t *dst = (cairo_solid_pattern_t *) pattern;
+ cairo_solid_pattern_t *src = (cairo_solid_pattern_t *) other;
- if (pattern->n_stops) {
- pattern->stops =
- malloc (sizeof (cairo_color_stop_t) * pattern->n_stops);
- if (pattern->stops == NULL)
- return CAIRO_STATUS_NO_MEMORY;
- memcpy (pattern->stops, other->stops,
- sizeof (cairo_color_stop_t) * other->n_stops);
+ *dst = *src;
+ } break;
+ case CAIRO_PATTERN_SURFACE: {
+ cairo_surface_pattern_t *dst = (cairo_surface_pattern_t *) pattern;
+ cairo_surface_pattern_t *src = (cairo_surface_pattern_t *) other;
+
+ *dst = *src;
+ cairo_surface_reference (dst->surface);
+ } break;
+ case CAIRO_PATTERN_LINEAR:
+ case CAIRO_PATTERN_RADIAL: {
+ cairo_gradient_pattern_t *dst = (cairo_gradient_pattern_t *) pattern;
+ cairo_gradient_pattern_t *src = (cairo_gradient_pattern_t *) other;
+ cairo_status_t status;
+
+ status = _cairo_gradient_pattern_init_copy (dst, src);
+ if (status)
+ return status;
+ } break;
}
-
- if (pattern->source)
- cairo_surface_reference (other->source);
-
- if (pattern->type == CAIRO_PATTERN_SURFACE)
- cairo_surface_reference (other->u.surface.surface);
+
+ pattern->ref_count = 1;
return CAIRO_STATUS_SUCCESS;
}
@@ -80,110 +130,145 @@ _cairo_pattern_init_copy (cairo_pattern_t *pattern, cairo_pattern_t *other)
void
_cairo_pattern_fini (cairo_pattern_t *pattern)
{
- if (pattern->n_stops)
- free (pattern->stops);
-
- if (pattern->type == CAIRO_PATTERN_SURFACE) {
- /* show_surface require us to restore surface matrix, repeat
- attribute, filter type */
- if (pattern->source) {
- cairo_surface_set_matrix (pattern->source,
- &pattern->u.surface.save_matrix);
- cairo_surface_set_repeat (pattern->source,
- pattern->u.surface.save_repeat);
- cairo_surface_set_filter (pattern->source,
- pattern->u.surface.save_filter);
- }
- cairo_surface_destroy (pattern->u.surface.surface);
+ switch (pattern->type) {
+ case CAIRO_PATTERN_SOLID:
+ break;
+ case CAIRO_PATTERN_SURFACE: {
+ cairo_surface_pattern_t *fini = (cairo_surface_pattern_t *) pattern;
+
+ cairo_surface_destroy (fini->surface);
+ } break;
+ case CAIRO_PATTERN_LINEAR:
+ case CAIRO_PATTERN_RADIAL: {
+ cairo_gradient_pattern_t *fini = (cairo_gradient_pattern_t *) pattern;
+
+ if (fini->n_stops)
+ free (fini->stops);
+ } break;
}
+}
+
+void
+_cairo_pattern_init_solid (cairo_solid_pattern_t *pattern,
+ double red,
+ double green,
+ double blue)
+{
+ _cairo_pattern_init (&pattern->base, CAIRO_PATTERN_SOLID);
- if (pattern->source)
- cairo_surface_destroy (pattern->source);
+ pattern->red = red;
+ pattern->green = green;
+ pattern->blue = blue;
}
void
-_cairo_pattern_init_solid (cairo_pattern_t *pattern,
- double red, double green, double blue)
+_cairo_pattern_init_for_surface (cairo_surface_pattern_t *pattern,
+ cairo_surface_t *surface)
{
- _cairo_pattern_init (pattern);
+ _cairo_pattern_init (&pattern->base, CAIRO_PATTERN_SURFACE);
+
+ pattern->surface = surface;
+ cairo_surface_reference (surface);
+}
- pattern->type = CAIRO_PATTERN_SOLID;
- _cairo_color_set_rgb (&pattern->color, red, green, blue);
+static void
+_cairo_pattern_init_gradient (cairo_gradient_pattern_t *pattern,
+ cairo_pattern_type_t type)
+{
+ _cairo_pattern_init (&pattern->base, type);
+
+ pattern->stops = 0;
+ pattern->n_stops = 0;
+}
+
+void
+_cairo_pattern_init_linear (cairo_linear_pattern_t *pattern,
+ double x0, double y0, double x1, double y1)
+{
+ _cairo_pattern_init_gradient (&pattern->base, CAIRO_PATTERN_LINEAR);
+
+ pattern->point0.x = x0;
+ pattern->point0.y = y0;
+ pattern->point1.x = x1;
+ pattern->point1.y = y1;
+}
+
+void
+_cairo_pattern_init_radial (cairo_radial_pattern_t *pattern,
+ double cx0, double cy0, double radius0,
+ double cx1, double cy1, double radius1)
+{
+ _cairo_pattern_init_gradient (&pattern->base, CAIRO_PATTERN_RADIAL);
+
+ pattern->center0.x = cx0;
+ pattern->center0.y = cy0;
+ pattern->radius0 = fabs (radius0);
+ pattern->center1.x = cx1;
+ pattern->center1.y = cy1;
+ pattern->radius1 = fabs (radius1);
}
cairo_pattern_t *
_cairo_pattern_create_solid (double red, double green, double blue)
{
- cairo_pattern_t *pattern;
+ cairo_solid_pattern_t *pattern;
- pattern = malloc (sizeof (cairo_pattern_t));
+ pattern = malloc (sizeof (cairo_solid_pattern_t));
if (pattern == NULL)
return NULL;
_cairo_pattern_init_solid (pattern, red, green, blue);
- return pattern;
+ return &pattern->base;
}
cairo_pattern_t *
cairo_pattern_create_for_surface (cairo_surface_t *surface)
{
- cairo_pattern_t *pattern;
+ cairo_surface_pattern_t *pattern;
- pattern = malloc (sizeof (cairo_pattern_t));
+ pattern = malloc (sizeof (cairo_surface_pattern_t));
if (pattern == NULL)
return NULL;
- _cairo_pattern_init (pattern);
-
- pattern->type = CAIRO_PATTERN_SURFACE;
- pattern->u.surface.surface = surface;
- cairo_surface_reference (surface);
+ _cairo_pattern_init_for_surface (pattern, surface);
+
+ /* this will go away when we completely remove the surface attributes */
+ if (surface->repeat)
+ pattern->base.extend = CAIRO_EXTEND_REPEAT;
+ else
+ pattern->base.extend = CAIRO_EXTEND_DEFAULT;
- return pattern;
+ return &pattern->base;
}
cairo_pattern_t *
cairo_pattern_create_linear (double x0, double y0, double x1, double y1)
{
- cairo_pattern_t *pattern;
+ cairo_linear_pattern_t *pattern;
- pattern = malloc (sizeof (cairo_pattern_t));
+ pattern = malloc (sizeof (cairo_linear_pattern_t));
if (pattern == NULL)
return NULL;
- _cairo_pattern_init (pattern);
-
- pattern->type = CAIRO_PATTERN_LINEAR;
- pattern->u.linear.point0.x = x0;
- pattern->u.linear.point0.y = y0;
- pattern->u.linear.point1.x = x1;
- pattern->u.linear.point1.y = y1;
+ _cairo_pattern_init_linear (pattern, x0, y0, x1, y1);
- return pattern;
+ return &pattern->base.base;
}
cairo_pattern_t *
cairo_pattern_create_radial (double cx0, double cy0, double radius0,
double cx1, double cy1, double radius1)
{
- cairo_pattern_t *pattern;
+ cairo_radial_pattern_t *pattern;
- pattern = malloc (sizeof (cairo_pattern_t));
+ pattern = malloc (sizeof (cairo_radial_pattern_t));
if (pattern == NULL)
return NULL;
- _cairo_pattern_init (pattern);
-
- pattern->type = CAIRO_PATTERN_RADIAL;
- pattern->u.radial.center0.x = cx0;
- pattern->u.radial.center0.y = cy0;
- pattern->u.radial.radius0 = fabs (radius0);
- pattern->u.radial.center1.x = cx1;
- pattern->u.radial.center1.y = cy1;
- pattern->u.radial.radius1 = fabs (radius1);
+ _cairo_pattern_init_radial (pattern, cx0, cy0, radius0, cx1, cy1, radius1);
- return pattern;
+ return &pattern->base.base;
}
void
@@ -209,37 +294,19 @@ cairo_pattern_destroy (cairo_pattern_t *pattern)
free (pattern);
}
-static int
-_cairo_pattern_stop_compare (const void *elem1, const void *elem2)
-{
- return
- (((cairo_color_stop_t *) elem1)->offset ==
- ((cairo_color_stop_t *) elem2)->offset) ?
- /* equal offsets, sort on id */
- ((((cairo_color_stop_t *) elem1)->id <
- ((cairo_color_stop_t *) elem2)->id) ? -1 : 1) :
- /* sort on offset */
- ((((cairo_color_stop_t *) elem1)->offset <
- ((cairo_color_stop_t *) elem2)->offset) ? -1 : 1);
-}
-
-cairo_status_t
-cairo_pattern_add_color_stop (cairo_pattern_t *pattern,
- double offset,
- double red, double green, double blue,
- double alpha)
+static cairo_status_t
+_cairo_pattern_add_color_stop (cairo_gradient_pattern_t *pattern,
+ double offset,
+ double red,
+ double green,
+ double blue,
+ double alpha)
{
cairo_color_stop_t *stop;
- int i;
-
- _cairo_restrict_value (&offset, 0.0, 1.0);
- _cairo_restrict_value (&red, 0.0, 1.0);
- _cairo_restrict_value (&green, 0.0, 1.0);
- _cairo_restrict_value (&blue, 0.0, 1.0);
pattern->n_stops++;
pattern->stops = realloc (pattern->stops,
- sizeof (cairo_color_stop_t) * pattern->n_stops);
+ pattern->n_stops * sizeof (cairo_color_stop_t));
if (pattern->stops == NULL) {
pattern->n_stops = 0;
@@ -249,41 +316,51 @@ cairo_pattern_add_color_stop (cairo_pattern_t *pattern,
stop = &pattern->stops[pattern->n_stops - 1];
stop->offset = _cairo_fixed_from_double (offset);
- stop->id = pattern->n_stops;
- stop->color_char[0] = red * 0xff;
- stop->color_char[1] = green * 0xff;
- stop->color_char[2] = blue * 0xff;
- stop->color_char[3] = alpha * 0xff;
+ _cairo_color_init (&stop->color);
+ _cairo_color_set_rgb (&stop->color, red, green, blue);
+ _cairo_color_set_alpha (&stop->color, alpha);
- /* sort stops in ascending order */
- qsort (pattern->stops, pattern->n_stops, sizeof (cairo_color_stop_t),
- _cairo_pattern_stop_compare);
-
- for (i = 0; i < pattern->n_stops - 1; i++) {
- pattern->stops[i + 1].scale =
- pattern->stops[i + 1].offset - pattern->stops[i].offset;
- if (pattern->stops[i + 1].scale == 65536)
- pattern->stops[i + 1].scale = 0;
+ return CAIRO_STATUS_SUCCESS;
+}
+
+cairo_status_t
+cairo_pattern_add_color_stop (cairo_pattern_t *pattern,
+ double offset,
+ double red,
+ double green,
+ double blue,
+ double alpha)
+{
+ if (pattern->type != CAIRO_PATTERN_LINEAR &&
+ pattern->type != CAIRO_PATTERN_RADIAL)
+ {
+ /* XXX: CAIRO_STATUS_INVALID_PATTERN? */
+ return CAIRO_STATUS_SUCCESS;
}
- return CAIRO_STATUS_SUCCESS;
+ _cairo_restrict_value (&offset, 0.0, 1.0);
+ _cairo_restrict_value (&red, 0.0, 1.0);
+ _cairo_restrict_value (&green, 0.0, 1.0);
+ _cairo_restrict_value (&blue, 0.0, 1.0);
+ _cairo_restrict_value (&alpha, 0.0, 1.0);
+
+ return _cairo_pattern_add_color_stop ((cairo_gradient_pattern_t *) pattern,
+ offset,
+ red, green, blue,
+ alpha);
}
cairo_status_t
cairo_pattern_set_matrix (cairo_pattern_t *pattern, cairo_matrix_t *matrix)
{
- cairo_matrix_copy (&pattern->matrix, matrix);
-
- return CAIRO_STATUS_SUCCESS;
+ return cairo_matrix_copy (&pattern->matrix, matrix);
}
cairo_status_t
cairo_pattern_get_matrix (cairo_pattern_t *pattern, cairo_matrix_t *matrix)
{
- cairo_matrix_copy (matrix, &pattern->matrix);
-
- return CAIRO_STATUS_SUCCESS;
+ return cairo_matrix_copy (matrix, &pattern->matrix);
}
cairo_status_t
@@ -316,9 +393,20 @@ cairo_pattern_get_extend (cairo_pattern_t *pattern)
cairo_status_t
_cairo_pattern_get_rgb (cairo_pattern_t *pattern,
- double *red, double *green, double *blue)
+ double *red,
+ double *green,
+ double *blue)
{
- _cairo_color_get_rgb (&pattern->color, red, green, blue);
+
+ if (pattern->type == CAIRO_PATTERN_SOLID)
+ {
+ cairo_solid_pattern_t *solid = (cairo_solid_pattern_t *) pattern;
+
+ *red = solid->red;
+ *green = solid->green;
+ *blue = solid->blue;
+ } else
+ *red = *green = *blue = 1.0;
return CAIRO_STATUS_SUCCESS;
}
@@ -326,63 +414,16 @@ _cairo_pattern_get_rgb (cairo_pattern_t *pattern,
void
_cairo_pattern_set_alpha (cairo_pattern_t *pattern, double alpha)
{
- int i;
-
- _cairo_color_set_alpha (&pattern->color, alpha);
-
- for (i = 0; i < pattern->n_stops; i++)
- pattern->stops[i].color_char[3] =
- MULTIPLY_COLORCOMP (pattern->stops[i].color_char[3], alpha * 0xff);
-}
-
-void
-_cairo_pattern_set_source_offset (cairo_pattern_t *pattern,
- double x, double y)
-{
- pattern->source_offset.x = x;
- pattern->source_offset.y = y;
+ pattern->alpha = alpha;
}
void
_cairo_pattern_transform (cairo_pattern_t *pattern,
- cairo_matrix_t *ctm_inverse)
+ cairo_matrix_t *ctm_inverse)
{
cairo_matrix_multiply (&pattern->matrix, ctm_inverse, &pattern->matrix);
}
-void
-_cairo_pattern_prepare_surface (cairo_pattern_t *pattern)
-{
- cairo_matrix_t device_to_source;
- cairo_matrix_t user_to_source;
-
- /* should the surface matrix interface be remove from the API?
- for now we multiple the surface matrix with the pattern matrix */
- cairo_surface_get_matrix (pattern->u.surface.surface, &user_to_source);
- cairo_matrix_multiply (&device_to_source, &pattern->matrix,
- &user_to_source);
- cairo_surface_set_matrix (pattern->source, &device_to_source);
-
- /* storing original surface matrix in pattern */
- pattern->u.surface.save_matrix = user_to_source;
-
- /* storing original surface repeat mode in pattern */
- pattern->u.surface.save_repeat = pattern->source->repeat;
-
- /* what do we do with extend types pad and reflect? */
- if (pattern->extend == CAIRO_EXTEND_REPEAT
- || pattern->source->repeat == 1)
- cairo_surface_set_repeat (pattern->source, 1);
- else
- cairo_surface_set_repeat (pattern->source, 0);
-
- /* storing original surface filter in pattern */
- pattern->u.surface.save_filter =
- cairo_surface_get_filter (pattern->source);
-
- cairo_surface_set_filter (pattern->source, pattern->filter);
-}
-
#define INTERPOLATE_COLOR_NEAREST(c1, c2, factor) \
((factor < 32768)? c1: c2)
@@ -390,7 +431,7 @@ static void
_cairo_pattern_shader_nearest (unsigned char *color0,
unsigned char *color1,
cairo_fixed_t factor,
- int *pixel)
+ uint32_t *pixel)
{
*pixel =
((INTERPOLATE_COLOR_NEAREST (color0[3], color1[3], factor) << 24) |
@@ -408,7 +449,7 @@ static void
_cairo_pattern_shader_linear (unsigned char *color0,
unsigned char *color1,
cairo_fixed_t factor,
- int *pixel)
+ uint32_t *pixel)
{
*pixel = ((INTERPOLATE_COLOR_LINEAR (color0[3], color1[3], factor) << 24) |
(INTERPOLATE_COLOR_LINEAR (color0[0], color1[0], factor) << 16) |
@@ -422,7 +463,7 @@ static void
_cairo_pattern_shader_gaussian (unsigned char *color0,
unsigned char *color1,
cairo_fixed_t factor,
- int *pixel)
+ uint32_t *pixel)
{
double f = ((double) factor) / 65536.0;
@@ -436,17 +477,59 @@ _cairo_pattern_shader_gaussian (unsigned char *color0,
#undef INTERPOLATE_COLOR_LINEAR
-void
-_cairo_pattern_shader_init (cairo_pattern_t *pattern,
- cairo_shader_op_t *op)
-{
- op->stops = pattern->stops;
- op->n_stops = pattern->n_stops - 1;
- op->min_offset = pattern->stops[0].offset;
- op->max_offset = pattern->stops[op->n_stops].offset;
- op->extend = pattern->extend;
-
- switch (pattern->filter) {
+static int
+_cairo_shader_color_stop_compare (const void *elem1, const void *elem2)
+{
+ cairo_shader_color_stop_t *s1 = (cairo_shader_color_stop_t *) elem1;
+ cairo_shader_color_stop_t *s2 = (cairo_shader_color_stop_t *) elem2;
+
+ return
+ (s1->offset == s2->offset) ?
+ /* equal offsets, sort on id */
+ ((s1->id < s2->id) ? -1 : 1) :
+ /* sort on offset */
+ ((s1->offset < s2->offset) ? -1 : 1);
+}
+
+static cairo_status_t
+_cairo_pattern_shader_init (cairo_gradient_pattern_t *pattern,
+ cairo_shader_op_t *op)
+{
+ int i;
+
+ op->stops = malloc (pattern->n_stops * sizeof (cairo_shader_color_stop_t));
+ if (!op->stops)
+ return CAIRO_STATUS_NO_MEMORY;
+
+ for (i = 0; i < pattern->n_stops; i++)
+ {
+ op->stops[i].color_char[0] = pattern->stops[i].color.red * 0xff;
+ op->stops[i].color_char[1] = pattern->stops[i].color.green * 0xff;
+ op->stops[i].color_char[2] = pattern->stops[i].color.blue * 0xff;
+ op->stops[i].color_char[3] = pattern->stops[i].color.alpha *
+ pattern->base.alpha * 0xff;
+ op->stops[i].offset = pattern->stops[i].offset;
+ op->stops[i].id = i;
+ }
+
+ /* sort stops in ascending order */
+ qsort (op->stops, pattern->n_stops, sizeof (cairo_shader_color_stop_t),
+ _cairo_shader_color_stop_compare);
+
+ for (i = 0; i < pattern->n_stops - 1; i++)
+ {
+ op->stops[i + 1].scale = op->stops[i + 1].offset - op->stops[i].offset;
+ if (op->stops[i + 1].scale == 65536)
+ op->stops[i + 1].scale = 0;
+ }
+
+ op->n_stops = pattern->n_stops;
+ op->extend = pattern->base.extend;
+
+ /* XXX: this is wrong, the filter should not be used for selecting
+ color stop interpolation function. function should always be 'linear'
+ and filter should be used for computing pixels. */
+ switch (pattern->base.filter) {
case CAIRO_FILTER_FAST:
case CAIRO_FILTER_NEAREST:
op->shader_function = _cairo_pattern_shader_nearest;
@@ -460,15 +543,56 @@ _cairo_pattern_shader_init (cairo_pattern_t *pattern,
op->shader_function = _cairo_pattern_shader_linear;
break;
}
+
+ return CAIRO_STATUS_SUCCESS;
}
-void
-_cairo_pattern_calc_color_at_pixel (cairo_shader_op_t *op,
- cairo_fixed_t factor,
- int *pixel)
+static void
+_cairo_pattern_shader_fini (cairo_shader_op_t *op)
+{
+ if (op->stops)
+ free (op->stops);
+}
+
+/* Find two color stops bounding the given offset. If the given offset
+ * is before the first or after the last stop offset, the nearest
+ * offset is returned twice.
+ */
+static void
+_cairo_shader_op_find_color_stops (cairo_shader_op_t *op,
+ cairo_fixed_t offset,
+ cairo_shader_color_stop_t *stops[2])
{
int i;
-
+
+ /* Before first stop. */
+ if (offset <= op->stops[0].offset) {
+ stops[0] = &op->stops[0];
+ stops[1] = &op->stops[0];
+ return;
+ }
+
+ /* Between two stops. */
+ for (i = 0; i < op->n_stops - 1; i++) {
+ if (offset <= op->stops[i + 1].offset) {
+ stops[0] = &op->stops[i];
+ stops[1] = &op->stops[i + 1];
+ return;
+ }
+ }
+
+ /* After last stop. */
+ stops[0] = &op->stops[op->n_stops - 1];
+ stops[1] = &op->stops[op->n_stops - 1];
+}
+
+static void
+_cairo_pattern_calc_color_at_pixel (cairo_shader_op_t *op,
+ cairo_fixed_t factor,
+ uint32_t *pixel)
+{
+ cairo_shader_color_stop_t *stops[2];
+
switch (op->extend) {
case CAIRO_EXTEND_REPEAT:
factor -= factor & 0xffff0000;
@@ -485,96 +609,158 @@ _cairo_pattern_calc_color_at_pixel (cairo_shader_op_t *op,
break;
}
- if (factor < op->min_offset)
- factor = op->min_offset;
- else if (factor > op->max_offset)
- factor = op->max_offset;
-
- for (i = 0; i < op->n_stops; i++) {
- if (factor <= op->stops[i + 1].offset) {
-
- /* take offset as new 0 of coordinate system */
- factor -= op->stops[i].offset;
-
- /* difference between two offsets == 0, abrubt change */
- if (op->stops[i + 1].scale)
- factor = ((cairo_fixed_48_16_t) factor << 16) /
- op->stops[i + 1].scale;
+ _cairo_shader_op_find_color_stops (op, factor, stops);
+
+ /* take offset as new 0 of coordinate system */
+ factor -= stops[0]->offset;
- op->shader_function (op->stops[i].color_char,
- op->stops[i + 1].color_char,
- factor, pixel);
+ /* difference between two offsets == 0, abrubt change */
+ if (stops[1]->scale)
+ factor = ((cairo_fixed_48_16_t) factor << 16) /
+ stops[1]->scale;
+
+ op->shader_function (stops[0]->color_char,
+ stops[1]->color_char,
+ factor, pixel);
- /* multiply alpha */
- if (((unsigned char) (*pixel >> 24)) != 0xff) {
- *pixel = (*pixel & 0xff000000) |
- (MULTIPLY_COLORCOMP (*pixel >> 16, *pixel >> 24) << 16) |
- (MULTIPLY_COLORCOMP (*pixel >> 8, *pixel >> 24) << 8) |
- (MULTIPLY_COLORCOMP (*pixel >> 0, *pixel >> 24) << 0);
- }
- break;
- }
+ /* multiply alpha */
+ if (((unsigned char) (*pixel >> 24)) != 0xff) {
+ *pixel = (*pixel & 0xff000000) |
+ (MULTIPLY_COLORCOMP (*pixel >> 16, *pixel >> 24) << 16) |
+ (MULTIPLY_COLORCOMP (*pixel >> 8, *pixel >> 24) << 8) |
+ (MULTIPLY_COLORCOMP (*pixel >> 0, *pixel >> 24) << 0);
}
}
-static void
-_cairo_image_data_set_linear (cairo_pattern_t *pattern,
- double offset_x,
- double offset_y,
- int *pixels,
- int width,
- int height)
+static cairo_status_t
+_cairo_image_data_set_linear (cairo_linear_pattern_t *pattern,
+ double offset_x,
+ double offset_y,
+ uint32_t *pixels,
+ int width,
+ int height)
{
int x, y;
cairo_point_double_t point0, point1;
- double px, py, ex, ey;
double a, b, c, d, tx, ty;
- double length, start, angle, fx, fy, factor;
+ double scale, start, dx, dy, factor;
cairo_shader_op_t op;
-
- _cairo_pattern_shader_init (pattern, &op);
-
- point0.x = pattern->u.linear.point0.x;
- point0.y = pattern->