summaryrefslogtreecommitdiff
path: root/libs/cairo-1.16.0/boilerplate
diff options
context:
space:
mode:
Diffstat (limited to 'libs/cairo-1.16.0/boilerplate')
-rw-r--r--libs/cairo-1.16.0/boilerplate/Makefile.am76
-rw-r--r--libs/cairo-1.16.0/boilerplate/Makefile.am.features519
-rw-r--r--libs/cairo-1.16.0/boilerplate/Makefile.in1843
-rw-r--r--libs/cairo-1.16.0/boilerplate/Makefile.sources41
-rw-r--r--libs/cairo-1.16.0/boilerplate/Makefile.win3224
-rw-r--r--libs/cairo-1.16.0/boilerplate/Makefile.win32.features523
-rw-r--r--libs/cairo-1.16.0/boilerplate/README14
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-beos.cpp273
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-cogl.c206
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-constructors.c25
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-directfb.c235
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-drm.c112
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-egl.c194
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-getopt.c247
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-getopt.h63
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-glx.c457
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-pdf.c279
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-private.h53
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-ps.c369
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-qt.cpp114
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-quartz.c76
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-scaled-font.h34
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-script.c141
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-svg.c344
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-system.c166
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-system.h59
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-test-surfaces.c462
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-vg.c363
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-wgl.c239
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-win32-printing.c407
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-win32.c294
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-xcb.c876
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-xlib.c638
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate-xlib.h33
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate.c1103
-rw-r--r--libs/cairo-1.16.0/boilerplate/cairo-boilerplate.h252
-rw-r--r--libs/cairo-1.16.0/boilerplate/check-link.c24
-rw-r--r--libs/cairo-1.16.0/boilerplate/make-cairo-boilerplate-constructors.sh29
38 files changed, 11207 insertions, 0 deletions
diff --git a/libs/cairo-1.16.0/boilerplate/Makefile.am b/libs/cairo-1.16.0/boilerplate/Makefile.am
new file mode 100644
index 0000000..29ad015
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/Makefile.am
@@ -0,0 +1,76 @@
+# Note: All source files are listed in Makefile.sources.
+
+include $(top_srcdir)/build/Makefile.am.common
+include $(srcdir)/Makefile.am.features
+
+EXTRA_DIST += Makefile.win32 Makefile.win32.features
+#MAINTAINERCLEANFILES += $(srcdir)/Makefile.win32.features
+
+AM_CPPFLAGS = \
+ -I$(srcdir) \
+ -I$(top_builddir)/src \
+ -I$(top_srcdir)/src \
+ $(CAIRO_CFLAGS) \
+ $(NULL)
+AM_LDFLAGS = $(CAIRO_LDFLAGS)
+
+if BUILD_CXX
+cxx_boilerplate_lib = libcairoboilerplate_cxx.la
+else
+cxx_boilerplate_lib =
+endif
+
+EXTRA_LTLIBRARIES += libcairoboilerplate.la $(cxx_boilerplate_lib)
+
+
+libcairoboilerplate_la_SOURCES = \
+ $(enabled_cairo_boilerplate_headers) \
+ $(enabled_cairo_boilerplate_private) \
+ $(enabled_cairo_boilerplate_sources) \
+ cairo-boilerplate-constructors.c \
+ $(NULL)
+libcairoboilerplate_cxx_la_SOURCES = \
+ $(enabled_cairo_boilerplate_cxx_sources) \
+ $(NULL)
+libcairoboilerplate_la_LIBADD = $(top_builddir)/src/libcairo.la \
+ $(cxx_boilerplate_lib) \
+ $(CAIRO_LIBS) \
+ $(CAIROBOILERPLATE_LIBS) \
+ $(NULL)
+libcairoboilerplate_cxx_la_LIBADD = $(top_builddir)/src/libcairo.la \
+ $(CAIRO_LIBS) \
+ $(CAIROBOILERPLATE_LIBS) \
+ $(NULL)
+libcairoboilerplate_la_DEPENDENCIES = \
+ $(cxx_boilerplate_lib) \
+ $(NULL)
+
+if CAIRO_HAS_DL
+libcairoboilerplate_la_LIBADD += -ldl
+endif
+
+if CAIRO_HAS_BEOS_SURFACE
+# BeOS system headers trigger this warning
+libcairoboilerplate_cxx_la_CXXFLAGS = -Wno-multichar
+endif
+
+if CAIRO_HAS_WIN32_SURFACE
+libcairoboilerplate_la_LIBADD += -lwinspool
+endif
+
+cairo-boilerplate-constructors.c: Makefile $(enabled_cairo_boilerplate_sources) $(enabled_cairo_boilerplate_cxx_sources) make-cairo-boilerplate-constructors.sh
+ (cd $(srcdir) && sh ./make-cairo-boilerplate-constructors.sh $(enabled_cairo_boilerplate_sources) $(enabled_cairo_boilerplate_cxx_sources)) > $@
+
+BUILT_SOURCES += cairo-boilerplate-constructors.c
+EXTRA_DIST += $(BUILT_SOURCES) make-cairo-boilerplate-constructors.sh
+CLEANFILES += $(BUILT_SOURCES)
+
+test: check
+
+if CROSS_COMPILING
+else
+TESTS += check-link$(EXEEXT)
+endif
+
+check_PROGRAMS += check-link
+check_link_LDADD = libcairoboilerplate.la
diff --git a/libs/cairo-1.16.0/boilerplate/Makefile.am.features b/libs/cairo-1.16.0/boilerplate/Makefile.am.features
new file mode 100644
index 0000000..c166f01
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/Makefile.am.features
@@ -0,0 +1,519 @@
+# Generated by configure. Do not edit.
+
+include $(top_srcdir)/boilerplate/Makefile.sources
+
+supported_cairo_boilerplate_headers = $(cairo_boilerplate_headers)
+unsupported_cairo_boilerplate_headers =
+all_cairo_boilerplate_headers = $(cairo_boilerplate_headers)
+all_cairo_boilerplate_private = $(cairo_boilerplate_private)
+all_cairo_boilerplate_cxx_sources = $(cairo_boilerplate_cxx_sources)
+all_cairo_boilerplate_sources = $(cairo_boilerplate_sources)
+
+enabled_cairo_boilerplate_headers = $(cairo_boilerplate_headers)
+enabled_cairo_boilerplate_private = $(cairo_boilerplate_private)
+enabled_cairo_boilerplate_cxx_sources = $(cairo_boilerplate_cxx_sources)
+enabled_cairo_boilerplate_sources = $(cairo_boilerplate_sources)
+
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_xlib_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xlib_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_xlib_sources)
+if CAIRO_HAS_XLIB_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_xlib_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xlib_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_xlib_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_xrender_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_xrender_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_xlib_xrender_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xlib_xrender_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_xlib_xrender_sources)
+if CAIRO_HAS_XLIB_XRENDER_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_xrender_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_xlib_xrender_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xlib_xrender_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_xlib_xrender_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_xcb_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_xcb_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_xcb_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xcb_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_xcb_sources)
+if CAIRO_HAS_XCB_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_xcb_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_xcb_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xcb_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_xcb_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_xcb_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_xcb_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_xlib_xcb_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xlib_xcb_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_xlib_xcb_sources)
+if CAIRO_HAS_XLIB_XCB_FUNCTIONS
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_xcb_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_xlib_xcb_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xlib_xcb_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_xlib_xcb_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_xcb_shm_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_xcb_shm_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_xcb_shm_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xcb_shm_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_xcb_shm_sources)
+if CAIRO_HAS_XCB_SHM_FUNCTIONS
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_xcb_shm_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_xcb_shm_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xcb_shm_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_xcb_shm_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_qt_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_qt_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_qt_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_qt_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_qt_sources)
+if CAIRO_HAS_QT_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_qt_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_qt_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_qt_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_qt_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_quartz_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_quartz_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_quartz_sources)
+if CAIRO_HAS_QUARTZ_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_quartz_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_quartz_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_quartz_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_font_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_font_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_quartz_font_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_quartz_font_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_quartz_font_sources)
+if CAIRO_HAS_QUARTZ_FONT
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_font_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_quartz_font_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_quartz_font_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_quartz_font_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_image_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_image_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_quartz_image_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_quartz_image_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_quartz_image_sources)
+if CAIRO_HAS_QUARTZ_IMAGE_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_image_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_quartz_image_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_quartz_image_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_quartz_image_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_win32_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_win32_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_win32_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_win32_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_win32_sources)
+if CAIRO_HAS_WIN32_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_win32_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_win32_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_win32_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_win32_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_win32_font_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_win32_font_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_win32_font_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_win32_font_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_win32_font_sources)
+if CAIRO_HAS_WIN32_FONT
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_win32_font_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_win32_font_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_win32_font_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_win32_font_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_os2_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_os2_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_os2_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_os2_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_os2_sources)
+if CAIRO_HAS_OS2_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_os2_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_os2_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_os2_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_os2_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_beos_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_beos_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_beos_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_beos_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_beos_sources)
+if CAIRO_HAS_BEOS_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_beos_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_beos_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_beos_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_beos_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_drm_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_drm_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_drm_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_drm_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_drm_sources)
+if CAIRO_HAS_DRM_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_drm_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_drm_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_drm_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_drm_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_gallium_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_gallium_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_gallium_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_gallium_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_gallium_sources)
+if CAIRO_HAS_GALLIUM_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_gallium_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_gallium_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_gallium_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_gallium_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_png_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_png_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_png_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_png_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_png_sources)
+if CAIRO_HAS_PNG_FUNCTIONS
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_png_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_png_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_png_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_png_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_gl_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_gl_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_gl_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_gl_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_gl_sources)
+if CAIRO_HAS_GL_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_gl_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_gl_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_gl_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_gl_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_glesv2_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_glesv2_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_glesv2_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_glesv2_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_glesv2_sources)
+if CAIRO_HAS_GLESV2_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_glesv2_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_glesv2_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_glesv2_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_glesv2_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_glesv3_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_glesv3_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_glesv3_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_glesv3_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_glesv3_sources)
+if CAIRO_HAS_GLESV3_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_glesv3_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_glesv3_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_glesv3_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_glesv3_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_cogl_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_cogl_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_cogl_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_cogl_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_cogl_sources)
+if CAIRO_HAS_COGL_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_cogl_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_cogl_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_cogl_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_cogl_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_directfb_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_directfb_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_directfb_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_directfb_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_directfb_sources)
+if CAIRO_HAS_DIRECTFB_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_directfb_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_directfb_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_directfb_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_directfb_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_vg_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_vg_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_vg_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_vg_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_vg_sources)
+if CAIRO_HAS_VG_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_vg_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_vg_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_vg_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_vg_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_egl_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_egl_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_egl_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_egl_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_egl_sources)
+if CAIRO_HAS_EGL_FUNCTIONS
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_egl_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_egl_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_egl_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_egl_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_glx_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_glx_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_glx_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_glx_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_glx_sources)
+if CAIRO_HAS_GLX_FUNCTIONS
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_glx_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_glx_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_glx_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_glx_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_wgl_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_wgl_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_wgl_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_wgl_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_wgl_sources)
+if CAIRO_HAS_WGL_FUNCTIONS
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_wgl_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_wgl_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_wgl_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_wgl_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_script_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_script_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_script_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_script_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_script_sources)
+if CAIRO_HAS_SCRIPT_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_script_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_script_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_script_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_script_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_ft_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_ft_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_ft_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_ft_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_ft_sources)
+if CAIRO_HAS_FT_FONT
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_ft_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_ft_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_ft_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_ft_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_fc_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_fc_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_fc_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_fc_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_fc_sources)
+if CAIRO_HAS_FC_FONT
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_fc_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_fc_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_fc_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_fc_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_ps_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_ps_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_ps_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_ps_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_ps_sources)
+if CAIRO_HAS_PS_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_ps_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_ps_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_ps_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_ps_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_pdf_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_pdf_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_pdf_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_pdf_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_pdf_sources)
+if CAIRO_HAS_PDF_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_pdf_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_pdf_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_pdf_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_pdf_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_svg_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_svg_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_svg_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_svg_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_svg_sources)
+if CAIRO_HAS_SVG_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_svg_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_svg_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_svg_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_svg_sources)
+endif
+
+all_cairo_boilerplate_private += $(cairo_boilerplate_test_surfaces_private) $(cairo_boilerplate_test_surfaces_headers)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_test_surfaces_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_test_surfaces_sources)
+if CAIRO_HAS_TEST_SURFACES
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_test_surfaces_private) $(cairo_boilerplate_test_surfaces_headers)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_test_surfaces_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_test_surfaces_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_image_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_image_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_image_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_image_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_image_sources)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_image_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_image_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_image_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_image_sources)
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_mime_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_mime_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_mime_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_mime_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_mime_sources)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_mime_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_mime_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_mime_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_mime_sources)
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_recording_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_recording_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_recording_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_recording_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_recording_sources)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_recording_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_recording_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_recording_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_recording_sources)
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_observer_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_observer_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_observer_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_observer_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_observer_sources)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_observer_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_observer_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_observer_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_observer_sources)
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_tee_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_tee_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_tee_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_tee_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_tee_sources)
+if CAIRO_HAS_TEE_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_tee_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_tee_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_tee_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_tee_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_xml_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_xml_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_xml_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xml_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_xml_sources)
+if CAIRO_HAS_XML_SURFACE
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_xml_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_xml_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xml_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_xml_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_user_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_user_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_user_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_user_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_user_sources)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_user_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_user_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_user_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_user_sources)
+
+all_cairo_boilerplate_private += $(cairo_boilerplate_pthread_private) $(cairo_boilerplate_pthread_headers)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_pthread_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_pthread_sources)
+if CAIRO_HAS_PTHREAD
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_pthread_private) $(cairo_boilerplate_pthread_headers)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_pthread_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_pthread_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_gobject_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_gobject_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_gobject_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_gobject_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_gobject_sources)
+if CAIRO_HAS_GOBJECT_FUNCTIONS
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_gobject_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_gobject_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_gobject_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_gobject_sources)
+endif
+
+all_cairo_boilerplate_private += $(cairo_boilerplate_trace_private) $(cairo_boilerplate_trace_headers)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_trace_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_trace_sources)
+if CAIRO_HAS_TRACE
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_trace_private) $(cairo_boilerplate_trace_headers)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_trace_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_trace_sources)
+endif
+
+all_cairo_boilerplate_private += $(cairo_boilerplate_interpreter_private) $(cairo_boilerplate_interpreter_headers)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_interpreter_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_interpreter_sources)
+if CAIRO_HAS_INTERPRETER
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_interpreter_private) $(cairo_boilerplate_interpreter_headers)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_interpreter_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_interpreter_sources)
+endif
+
+all_cairo_boilerplate_private += $(cairo_boilerplate_symbol_lookup_private) $(cairo_boilerplate_symbol_lookup_headers)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_symbol_lookup_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_symbol_lookup_sources)
+if CAIRO_HAS_SYMBOL_LOOKUP
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_symbol_lookup_private) $(cairo_boilerplate_symbol_lookup_headers)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_symbol_lookup_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_symbol_lookup_sources)
+endif
diff --git a/libs/cairo-1.16.0/boilerplate/Makefile.in b/libs/cairo-1.16.0/boilerplate/Makefile.in
new file mode 100644
index 0000000..8e74a5a
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/Makefile.in
@@ -0,0 +1,1843 @@
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Note: All source files are listed in Makefile.sources.
+
+# Generated by configure. Do not edit.
+
+# Makefile.sources
+#
+# This file is pretty similar to $(top_srcdir)/src/Makefile.sources,
+# but for boilerplate. Unlike that file, there are no special headers.
+#
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+EXTRA_PROGRAMS =
+check_PROGRAMS = check-link$(EXEEXT)
+@CAIRO_HAS_XLIB_SURFACE_TRUE@am__append_1 = $(cairo_boilerplate_xlib_headers)
+@CAIRO_HAS_XLIB_SURFACE_TRUE@am__append_2 = $(cairo_boilerplate_xlib_private)
+@CAIRO_HAS_XLIB_SURFACE_TRUE@am__append_3 = $(cairo_boilerplate_xlib_cxx_sources)
+@CAIRO_HAS_XLIB_SURFACE_TRUE@am__append_4 = $(cairo_boilerplate_xlib_sources)
+@CAIRO_HAS_XLIB_XRENDER_SURFACE_TRUE@am__append_5 = $(cairo_boilerplate_xlib_xrender_headers)
+@CAIRO_HAS_XLIB_XRENDER_SURFACE_TRUE@am__append_6 = $(cairo_boilerplate_xlib_xrender_private)
+@CAIRO_HAS_XLIB_XRENDER_SURFACE_TRUE@am__append_7 = $(cairo_boilerplate_xlib_xrender_cxx_sources)
+@CAIRO_HAS_XLIB_XRENDER_SURFACE_TRUE@am__append_8 = $(cairo_boilerplate_xlib_xrender_sources)
+@CAIRO_HAS_XCB_SURFACE_TRUE@am__append_9 = $(cairo_boilerplate_xcb_headers)
+@CAIRO_HAS_XCB_SURFACE_TRUE@am__append_10 = $(cairo_boilerplate_xcb_private)
+@CAIRO_HAS_XCB_SURFACE_TRUE@am__append_11 = $(cairo_boilerplate_xcb_cxx_sources)
+@CAIRO_HAS_XCB_SURFACE_TRUE@am__append_12 = $(cairo_boilerplate_xcb_sources)
+@CAIRO_HAS_XLIB_XCB_FUNCTIONS_TRUE@am__append_13 = $(cairo_boilerplate_xlib_xcb_headers)
+@CAIRO_HAS_XLIB_XCB_FUNCTIONS_TRUE@am__append_14 = $(cairo_boilerplate_xlib_xcb_private)
+@CAIRO_HAS_XLIB_XCB_FUNCTIONS_TRUE@am__append_15 = $(cairo_boilerplate_xlib_xcb_cxx_sources)
+@CAIRO_HAS_XLIB_XCB_FUNCTIONS_TRUE@am__append_16 = $(cairo_boilerplate_xlib_xcb_sources)
+@CAIRO_HAS_XCB_SHM_FUNCTIONS_TRUE@am__append_17 = $(cairo_boilerplate_xcb_shm_headers)
+@CAIRO_HAS_XCB_SHM_FUNCTIONS_TRUE@am__append_18 = $(cairo_boilerplate_xcb_shm_private)
+@CAIRO_HAS_XCB_SHM_FUNCTIONS_TRUE@am__append_19 = $(cairo_boilerplate_xcb_shm_cxx_sources)
+@CAIRO_HAS_XCB_SHM_FUNCTIONS_TRUE@am__append_20 = $(cairo_boilerplate_xcb_shm_sources)
+@CAIRO_HAS_QT_SURFACE_TRUE@am__append_21 = $(cairo_boilerplate_qt_headers)
+@CAIRO_HAS_QT_SURFACE_TRUE@am__append_22 = $(cairo_boilerplate_qt_private)
+@CAIRO_HAS_QT_SURFACE_TRUE@am__append_23 = $(cairo_boilerplate_qt_cxx_sources)
+@CAIRO_HAS_QT_SURFACE_TRUE@am__append_24 = $(cairo_boilerplate_qt_sources)
+@CAIRO_HAS_QUARTZ_SURFACE_TRUE@am__append_25 = $(cairo_boilerplate_quartz_headers)
+@CAIRO_HAS_QUARTZ_SURFACE_TRUE@am__append_26 = $(cairo_boilerplate_quartz_private)
+@CAIRO_HAS_QUARTZ_SURFACE_TRUE@am__append_27 = $(cairo_boilerplate_quartz_cxx_sources)
+@CAIRO_HAS_QUARTZ_SURFACE_TRUE@am__append_28 = $(cairo_boilerplate_quartz_sources)
+@CAIRO_HAS_QUARTZ_FONT_TRUE@am__append_29 = $(cairo_boilerplate_quartz_font_headers)
+@CAIRO_HAS_QUARTZ_FONT_TRUE@am__append_30 = $(cairo_boilerplate_quartz_font_private)
+@CAIRO_HAS_QUARTZ_FONT_TRUE@am__append_31 = $(cairo_boilerplate_quartz_font_cxx_sources)
+@CAIRO_HAS_QUARTZ_FONT_TRUE@am__append_32 = $(cairo_boilerplate_quartz_font_sources)
+@CAIRO_HAS_QUARTZ_IMAGE_SURFACE_TRUE@am__append_33 = $(cairo_boilerplate_quartz_image_headers)
+@CAIRO_HAS_QUARTZ_IMAGE_SURFACE_TRUE@am__append_34 = $(cairo_boilerplate_quartz_image_private)
+@CAIRO_HAS_QUARTZ_IMAGE_SURFACE_TRUE@am__append_35 = $(cairo_boilerplate_quartz_image_cxx_sources)
+@CAIRO_HAS_QUARTZ_IMAGE_SURFACE_TRUE@am__append_36 = $(cairo_boilerplate_quartz_image_sources)
+@CAIRO_HAS_WIN32_SURFACE_TRUE@am__append_37 = $(cairo_boilerplate_win32_headers)
+@CAIRO_HAS_WIN32_SURFACE_TRUE@am__append_38 = $(cairo_boilerplate_win32_private)
+@CAIRO_HAS_WIN32_SURFACE_TRUE@am__append_39 = $(cairo_boilerplate_win32_cxx_sources)
+@CAIRO_HAS_WIN32_SURFACE_TRUE@am__append_40 = $(cairo_boilerplate_win32_sources)
+@CAIRO_HAS_WIN32_FONT_TRUE@am__append_41 = $(cairo_boilerplate_win32_font_headers)
+@CAIRO_HAS_WIN32_FONT_TRUE@am__append_42 = $(cairo_boilerplate_win32_font_private)
+@CAIRO_HAS_WIN32_FONT_TRUE@am__append_43 = $(cairo_boilerplate_win32_font_cxx_sources)
+@CAIRO_HAS_WIN32_FONT_TRUE@am__append_44 = $(cairo_boilerplate_win32_font_sources)
+@CAIRO_HAS_OS2_SURFACE_TRUE@am__append_45 = $(cairo_boilerplate_os2_headers)
+@CAIRO_HAS_OS2_SURFACE_TRUE@am__append_46 = $(cairo_boilerplate_os2_private)
+@CAIRO_HAS_OS2_SURFACE_TRUE@am__append_47 = $(cairo_boilerplate_os2_cxx_sources)
+@CAIRO_HAS_OS2_SURFACE_TRUE@am__append_48 = $(cairo_boilerplate_os2_sources)
+@CAIRO_HAS_BEOS_SURFACE_TRUE@am__append_49 = $(cairo_boilerplate_beos_headers)
+@CAIRO_HAS_BEOS_SURFACE_TRUE@am__append_50 = $(cairo_boilerplate_beos_private)
+@CAIRO_HAS_BEOS_SURFACE_TRUE@am__append_51 = $(cairo_boilerplate_beos_cxx_sources)
+@CAIRO_HAS_BEOS_SURFACE_TRUE@am__append_52 = $(cairo_boilerplate_beos_sources)
+@CAIRO_HAS_DRM_SURFACE_TRUE@am__append_53 = $(cairo_boilerplate_drm_headers)
+@CAIRO_HAS_DRM_SURFACE_TRUE@am__append_54 = $(cairo_boilerplate_drm_private)
+@CAIRO_HAS_DRM_SURFACE_TRUE@am__append_55 = $(cairo_boilerplate_drm_cxx_sources)
+@CAIRO_HAS_DRM_SURFACE_TRUE@am__append_56 = $(cairo_boilerplate_drm_sources)
+@CAIRO_HAS_GALLIUM_SURFACE_TRUE@am__append_57 = $(cairo_boilerplate_gallium_headers)
+@CAIRO_HAS_GALLIUM_SURFACE_TRUE@am__append_58 = $(cairo_boilerplate_gallium_private)
+@CAIRO_HAS_GALLIUM_SURFACE_TRUE@am__append_59 = $(cairo_boilerplate_gallium_cxx_sources)
+@CAIRO_HAS_GALLIUM_SURFACE_TRUE@am__append_60 = $(cairo_boilerplate_gallium_sources)
+@CAIRO_HAS_PNG_FUNCTIONS_TRUE@am__append_61 = $(cairo_boilerplate_png_headers)
+@CAIRO_HAS_PNG_FUNCTIONS_TRUE@am__append_62 = $(cairo_boilerplate_png_private)
+@CAIRO_HAS_PNG_FUNCTIONS_TRUE@am__append_63 = $(cairo_boilerplate_png_cxx_sources)
+@CAIRO_HAS_PNG_FUNCTIONS_TRUE@am__append_64 = $(cairo_boilerplate_png_sources)
+@CAIRO_HAS_GL_SURFACE_TRUE@am__append_65 = $(cairo_boilerplate_gl_headers)
+@CAIRO_HAS_GL_SURFACE_TRUE@am__append_66 = $(cairo_boilerplate_gl_private)
+@CAIRO_HAS_GL_SURFACE_TRUE@am__append_67 = $(cairo_boilerplate_gl_cxx_sources)
+@CAIRO_HAS_GL_SURFACE_TRUE@am__append_68 = $(cairo_boilerplate_gl_sources)
+@CAIRO_HAS_GLESV2_SURFACE_TRUE@am__append_69 = $(cairo_boilerplate_glesv2_headers)
+@CAIRO_HAS_GLESV2_SURFACE_TRUE@am__append_70 = $(cairo_boilerplate_glesv2_private)
+@CAIRO_HAS_GLESV2_SURFACE_TRUE@am__append_71 = $(cairo_boilerplate_glesv2_cxx_sources)
+@CAIRO_HAS_GLESV2_SURFACE_TRUE@am__append_72 = $(cairo_boilerplate_glesv2_sources)
+@CAIRO_HAS_GLESV3_SURFACE_TRUE@am__append_73 = $(cairo_boilerplate_glesv3_headers)
+@CAIRO_HAS_GLESV3_SURFACE_TRUE@am__append_74 = $(cairo_boilerplate_glesv3_private)
+@CAIRO_HAS_GLESV3_SURFACE_TRUE@am__append_75 = $(cairo_boilerplate_glesv3_cxx_sources)
+@CAIRO_HAS_GLESV3_SURFACE_TRUE@am__append_76 = $(cairo_boilerplate_glesv3_sources)
+@CAIRO_HAS_COGL_SURFACE_TRUE@am__append_77 = $(cairo_boilerplate_cogl_headers)
+@CAIRO_HAS_COGL_SURFACE_TRUE@am__append_78 = $(cairo_boilerplate_cogl_private)
+@CAIRO_HAS_COGL_SURFACE_TRUE@am__append_79 = $(cairo_boilerplate_cogl_cxx_sources)
+@CAIRO_HAS_COGL_SURFACE_TRUE@am__append_80 = $(cairo_boilerplate_cogl_sources)
+@CAIRO_HAS_DIRECTFB_SURFACE_TRUE@am__append_81 = $(cairo_boilerplate_directfb_headers)
+@CAIRO_HAS_DIRECTFB_SURFACE_TRUE@am__append_82 = $(cairo_boilerplate_directfb_private)
+@CAIRO_HAS_DIRECTFB_SURFACE_TRUE@am__append_83 = $(cairo_boilerplate_directfb_cxx_sources)
+@CAIRO_HAS_DIRECTFB_SURFACE_TRUE@am__append_84 = $(cairo_boilerplate_directfb_sources)
+@CAIRO_HAS_VG_SURFACE_TRUE@am__append_85 = $(cairo_boilerplate_vg_headers)
+@CAIRO_HAS_VG_SURFACE_TRUE@am__append_86 = $(cairo_boilerplate_vg_private)
+@CAIRO_HAS_VG_SURFACE_TRUE@am__append_87 = $(cairo_boilerplate_vg_cxx_sources)
+@CAIRO_HAS_VG_SURFACE_TRUE@am__append_88 = $(cairo_boilerplate_vg_sources)
+@CAIRO_HAS_EGL_FUNCTIONS_TRUE@am__append_89 = $(cairo_boilerplate_egl_headers)
+@CAIRO_HAS_EGL_FUNCTIONS_TRUE@am__append_90 = $(cairo_boilerplate_egl_private)
+@CAIRO_HAS_EGL_FUNCTIONS_TRUE@am__append_91 = $(cairo_boilerplate_egl_cxx_sources)
+@CAIRO_HAS_EGL_FUNCTIONS_TRUE@am__append_92 = $(cairo_boilerplate_egl_sources)
+@CAIRO_HAS_GLX_FUNCTIONS_TRUE@am__append_93 = $(cairo_boilerplate_glx_headers)
+@CAIRO_HAS_GLX_FUNCTIONS_TRUE@am__append_94 = $(cairo_boilerplate_glx_private)
+@CAIRO_HAS_GLX_FUNCTIONS_TRUE@am__append_95 = $(cairo_boilerplate_glx_cxx_sources)
+@CAIRO_HAS_GLX_FUNCTIONS_TRUE@am__append_96 = $(cairo_boilerplate_glx_sources)
+@CAIRO_HAS_WGL_FUNCTIONS_TRUE@am__append_97 = $(cairo_boilerplate_wgl_headers)
+@CAIRO_HAS_WGL_FUNCTIONS_TRUE@am__append_98 = $(cairo_boilerplate_wgl_private)
+@CAIRO_HAS_WGL_FUNCTIONS_TRUE@am__append_99 = $(cairo_boilerplate_wgl_cxx_sources)
+@CAIRO_HAS_WGL_FUNCTIONS_TRUE@am__append_100 = $(cairo_boilerplate_wgl_sources)
+@CAIRO_HAS_SCRIPT_SURFACE_TRUE@am__append_101 = $(cairo_boilerplate_script_headers)
+@CAIRO_HAS_SCRIPT_SURFACE_TRUE@am__append_102 = $(cairo_boilerplate_script_private)
+@CAIRO_HAS_SCRIPT_SURFACE_TRUE@am__append_103 = $(cairo_boilerplate_script_cxx_sources)
+@CAIRO_HAS_SCRIPT_SURFACE_TRUE@am__append_104 = $(cairo_boilerplate_script_sources)
+@CAIRO_HAS_FT_FONT_TRUE@am__append_105 = $(cairo_boilerplate_ft_headers)
+@CAIRO_HAS_FT_FONT_TRUE@am__append_106 = $(cairo_boilerplate_ft_private)
+@CAIRO_HAS_FT_FONT_TRUE@am__append_107 = $(cairo_boilerplate_ft_cxx_sources)
+@CAIRO_HAS_FT_FONT_TRUE@am__append_108 = $(cairo_boilerplate_ft_sources)
+@CAIRO_HAS_FC_FONT_TRUE@am__append_109 = $(cairo_boilerplate_fc_headers)
+@CAIRO_HAS_FC_FONT_TRUE@am__append_110 = $(cairo_boilerplate_fc_private)
+@CAIRO_HAS_FC_FONT_TRUE@am__append_111 = $(cairo_boilerplate_fc_cxx_sources)
+@CAIRO_HAS_FC_FONT_TRUE@am__append_112 = $(cairo_boilerplate_fc_sources)
+@CAIRO_HAS_PS_SURFACE_TRUE@am__append_113 = $(cairo_boilerplate_ps_headers)
+@CAIRO_HAS_PS_SURFACE_TRUE@am__append_114 = $(cairo_boilerplate_ps_private)
+@CAIRO_HAS_PS_SURFACE_TRUE@am__append_115 = $(cairo_boilerplate_ps_cxx_sources)
+@CAIRO_HAS_PS_SURFACE_TRUE@am__append_116 = $(cairo_boilerplate_ps_sources)
+@CAIRO_HAS_PDF_SURFACE_TRUE@am__append_117 = $(cairo_boilerplate_pdf_headers)
+@CAIRO_HAS_PDF_SURFACE_TRUE@am__append_118 = $(cairo_boilerplate_pdf_private)
+@CAIRO_HAS_PDF_SURFACE_TRUE@am__append_119 = $(cairo_boilerplate_pdf_cxx_sources)
+@CAIRO_HAS_PDF_SURFACE_TRUE@am__append_120 = $(cairo_boilerplate_pdf_sources)
+@CAIRO_HAS_SVG_SURFACE_TRUE@am__append_121 = $(cairo_boilerplate_svg_headers)
+@CAIRO_HAS_SVG_SURFACE_TRUE@am__append_122 = $(cairo_boilerplate_svg_private)
+@CAIRO_HAS_SVG_SURFACE_TRUE@am__append_123 = $(cairo_boilerplate_svg_cxx_sources)
+@CAIRO_HAS_SVG_SURFACE_TRUE@am__append_124 = $(cairo_boilerplate_svg_sources)
+@CAIRO_HAS_TEST_SURFACES_TRUE@am__append_125 = $(cairo_boilerplate_test_surfaces_private) $(cairo_boilerplate_test_surfaces_headers)
+@CAIRO_HAS_TEST_SURFACES_TRUE@am__append_126 = $(cairo_boilerplate_test_surfaces_cxx_sources)
+@CAIRO_HAS_TEST_SURFACES_TRUE@am__append_127 = $(cairo_boilerplate_test_surfaces_sources)
+@CAIRO_HAS_TEE_SURFACE_TRUE@am__append_128 = $(cairo_boilerplate_tee_headers)
+@CAIRO_HAS_TEE_SURFACE_TRUE@am__append_129 = $(cairo_boilerplate_tee_private)
+@CAIRO_HAS_TEE_SURFACE_TRUE@am__append_130 = $(cairo_boilerplate_tee_cxx_sources)
+@CAIRO_HAS_TEE_SURFACE_TRUE@am__append_131 = $(cairo_boilerplate_tee_sources)
+@CAIRO_HAS_XML_SURFACE_TRUE@am__append_132 = $(cairo_boilerplate_xml_headers)
+@CAIRO_HAS_XML_SURFACE_TRUE@am__append_133 = $(cairo_boilerplate_xml_private)
+@CAIRO_HAS_XML_SURFACE_TRUE@am__append_134 = $(cairo_boilerplate_xml_cxx_sources)
+@CAIRO_HAS_XML_SURFACE_TRUE@am__append_135 = $(cairo_boilerplate_xml_sources)
+@CAIRO_HAS_PTHREAD_TRUE@am__append_136 = $(cairo_boilerplate_pthread_private) $(cairo_boilerplate_pthread_headers)
+@CAIRO_HAS_PTHREAD_TRUE@am__append_137 = $(cairo_boilerplate_pthread_cxx_sources)
+@CAIRO_HAS_PTHREAD_TRUE@am__append_138 = $(cairo_boilerplate_pthread_sources)
+@CAIRO_HAS_GOBJECT_FUNCTIONS_TRUE@am__append_139 = $(cairo_boilerplate_gobject_headers)
+@CAIRO_HAS_GOBJECT_FUNCTIONS_TRUE@am__append_140 = $(cairo_boilerplate_gobject_private)
+@CAIRO_HAS_GOBJECT_FUNCTIONS_TRUE@am__append_141 = $(cairo_boilerplate_gobject_cxx_sources)
+@CAIRO_HAS_GOBJECT_FUNCTIONS_TRUE@am__append_142 = $(cairo_boilerplate_gobject_sources)
+@CAIRO_HAS_TRACE_TRUE@am__append_143 = $(cairo_boilerplate_trace_private) $(cairo_boilerplate_trace_headers)
+@CAIRO_HAS_TRACE_TRUE@am__append_144 = $(cairo_boilerplate_trace_cxx_sources)
+@CAIRO_HAS_TRACE_TRUE@am__append_145 = $(cairo_boilerplate_trace_sources)
+@CAIRO_HAS_INTERPRETER_TRUE@am__append_146 = $(cairo_boilerplate_interpreter_private) $(cairo_boilerplate_interpreter_headers)
+@CAIRO_HAS_INTERPRETER_TRUE@am__append_147 = $(cairo_boilerplate_interpreter_cxx_sources)
+@CAIRO_HAS_INTERPRETER_TRUE@am__append_148 = $(cairo_boilerplate_interpreter_sources)
+@CAIRO_HAS_SYMBOL_LOOKUP_TRUE@am__append_149 = $(cairo_boilerplate_symbol_lookup_private) $(cairo_boilerplate_symbol_lookup_headers)
+@CAIRO_HAS_SYMBOL_LOOKUP_TRUE@am__append_150 = $(cairo_boilerplate_symbol_lookup_cxx_sources)
+@CAIRO_HAS_SYMBOL_LOOKUP_TRUE@am__append_151 = $(cairo_boilerplate_symbol_lookup_sources)
+@CAIRO_HAS_DL_TRUE@am__append_152 = -ldl
+@CAIRO_HAS_WIN32_SURFACE_TRUE@am__append_153 = -lwinspool
+@CROSS_COMPILING_FALSE@am__append_154 = check-link$(EXEEXT)
+subdir = boilerplate
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/build/aclocal.cairo.m4 \
+ $(top_srcdir)/build/aclocal.compare.m4 \
+ $(top_srcdir)/build/aclocal.enable.m4 \
+ $(top_srcdir)/build/aclocal.float.m4 \
+ $(top_srcdir)/build/aclocal.makefile.m4 \
+ $(top_srcdir)/build/aclocal.pkg.m4 \
+ $(top_srcdir)/build/gtk-doc.m4 $(top_srcdir)/build/libtool.m4 \
+ $(top_srcdir)/build/ltoptions.m4 \
+ $(top_srcdir)/build/ltsugar.m4 \
+ $(top_srcdir)/build/ltversion.m4 \
+ $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/cairo-version.h \
+ $(top_srcdir)/build/configure.ac.version \
+ $(top_srcdir)/build/configure.ac.tools \
+ $(top_srcdir)/build/configure.ac.features \
+ $(top_srcdir)/build/configure.ac.warnings \
+ $(top_srcdir)/build/configure.ac.system \
+ $(top_srcdir)/build/configure.ac.analysis \
+ $(top_srcdir)/build/configure.ac.noversion \
+ $(top_srcdir)/build/configure.ac.pthread \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+@BUILD_CXX_TRUE@am__DEPENDENCIES_1 = libcairoboilerplate_cxx.la
+am__DEPENDENCIES_2 =
+am__libcairoboilerplate_la_SOURCES_DIST = cairo-boilerplate-getopt.h \
+ cairo-boilerplate-scaled-font.h cairo-boilerplate-system.h \
+ cairo-boilerplate.h cairo-boilerplate-xlib.h \
+ cairo-boilerplate-private.h cairo-boilerplate-getopt.c \
+ cairo-boilerplate-system.c cairo-boilerplate.c \
+ cairo-boilerplate-xlib.c cairo-boilerplate-xcb.c \
+ cairo-boilerplate-quartz.c cairo-boilerplate-win32.c \
+ cairo-boilerplate-win32-printing.c cairo-boilerplate-drm.c \
+ cairo-boilerplate-cogl.c cairo-boilerplate-directfb.c \
+ cairo-boilerplate-vg.c cairo-boilerplate-egl.c \
+ cairo-boilerplate-glx.c cairo-boilerplate-wgl.c \
+ cairo-boilerplate-script.c cairo-boilerplate-ps.c \
+ cairo-boilerplate-pdf.c cairo-boilerplate-svg.c \
+ cairo-boilerplate-test-surfaces.c \
+ cairo-boilerplate-constructors.c
+am__objects_1 =
+@CAIRO_HAS_XLIB_SURFACE_TRUE@am__objects_2 = $(am__objects_1)
+am__objects_3 = $(am__objects_1) $(am__objects_2) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1)
+am__objects_4 = $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1)
+am__objects_5 = cairo-boilerplate-getopt.lo \
+ cairo-boilerplate-system.lo cairo-boilerplate.lo
+am__objects_6 = cairo-boilerplate-xlib.lo
+@CAIRO_HAS_XLIB_SURFACE_TRUE@am__objects_7 = $(am__objects_6)
+am__objects_8 = cairo-boilerplate-xcb.lo
+@CAIRO_HAS_XCB_SURFACE_TRUE@am__objects_9 = $(am__objects_8)
+am__objects_10 = cairo-boilerplate-quartz.lo
+@CAIRO_HAS_QUARTZ_SURFACE_TRUE@am__objects_11 = $(am__objects_10)
+am__objects_12 = cairo-boilerplate-win32.lo \
+ cairo-boilerplate-win32-printing.lo
+@CAIRO_HAS_WIN32_SURFACE_TRUE@am__objects_13 = $(am__objects_12)
+am__objects_14 = cairo-boilerplate-drm.lo
+@CAIRO_HAS_DRM_SURFACE_TRUE@am__objects_15 = $(am__objects_14)
+am__objects_16 = cairo-boilerplate-cogl.lo
+@CAIRO_HAS_COGL_SURFACE_TRUE@am__objects_17 = $(am__objects_16)
+am__objects_18 = cairo-boilerplate-directfb.lo
+@CAIRO_HAS_DIRECTFB_SURFACE_TRUE@am__objects_19 = $(am__objects_18)
+am__objects_20 = cairo-boilerplate-vg.lo
+@CAIRO_HAS_VG_SURFACE_TRUE@am__objects_21 = $(am__objects_20)
+am__objects_22 = cairo-boilerplate-egl.lo
+@CAIRO_HAS_EGL_FUNCTIONS_TRUE@am__objects_23 = $(am__objects_22)
+am__objects_24 = cairo-boilerplate-glx.lo
+@CAIRO_HAS_GLX_FUNCTIONS_TRUE@am__objects_25 = $(am__objects_24)
+am__objects_26 = cairo-boilerplate-wgl.lo
+@CAIRO_HAS_WGL_FUNCTIONS_TRUE@am__objects_27 = $(am__objects_26)
+am__objects_28 = cairo-boilerplate-script.lo
+@CAIRO_HAS_SCRIPT_SURFACE_TRUE@am__objects_29 = $(am__objects_28)
+am__objects_30 = cairo-boilerplate-ps.lo
+@CAIRO_HAS_PS_SURFACE_TRUE@am__objects_31 = $(am__objects_30)
+am__objects_32 = cairo-boilerplate-pdf.lo
+@CAIRO_HAS_PDF_SURFACE_TRUE@am__objects_33 = $(am__objects_32)
+am__objects_34 = cairo-boilerplate-svg.lo
+@CAIRO_HAS_SVG_SURFACE_TRUE@am__objects_35 = $(am__objects_34)
+am__objects_36 = cairo-boilerplate-test-surfaces.lo
+@CAIRO_HAS_TEST_SURFACES_TRUE@am__objects_37 = $(am__objects_36)
+am__objects_38 = $(am__objects_5) $(am__objects_7) $(am__objects_1) \
+ $(am__objects_9) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_11) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_13) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_15) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_17) \
+ $(am__objects_19) $(am__objects_21) $(am__objects_23) \
+ $(am__objects_25) $(am__objects_27) $(am__objects_29) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_31) \
+ $(am__objects_33) $(am__objects_35) $(am__objects_37) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1)
+am_libcairoboilerplate_la_OBJECTS = $(am__objects_3) $(am__objects_4) \
+ $(am__objects_38) cairo-boilerplate-constructors.lo
+libcairoboilerplate_la_OBJECTS = $(am_libcairoboilerplate_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+libcairoboilerplate_cxx_la_DEPENDENCIES = \
+ $(top_builddir)/src/libcairo.la $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_2)
+am__libcairoboilerplate_cxx_la_SOURCES_DIST = \
+ cairo-boilerplate-qt.cpp cairo-boilerplate-beos.cpp
+am__objects_39 = libcairoboilerplate_cxx_la-cairo-boilerplate-qt.lo
+@CAIRO_HAS_QT_SURFACE_TRUE@am__objects_40 = $(am__objects_39)
+am__objects_41 = libcairoboilerplate_cxx_la-cairo-boilerplate-beos.lo
+@CAIRO_HAS_BEOS_SURFACE_TRUE@am__objects_42 = $(am__objects_41)
+am__objects_43 = $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_40) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_42) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1) \
+ $(am__objects_1) $(am__objects_1) $(am__objects_1)
+am_libcairoboilerplate_cxx_la_OBJECTS = $(am__objects_43)
+libcairoboilerplate_cxx_la_OBJECTS = \
+ $(am_libcairoboilerplate_cxx_la_OBJECTS)
+libcairoboilerplate_cxx_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
+ $(libcairoboilerplate_cxx_la_CXXFLAGS) $(CXXFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+@BUILD_CXX_TRUE@am_libcairoboilerplate_cxx_la_rpath =
+check_link_SOURCES = check-link.c
+check_link_OBJECTS = check-link.$(OBJEXT)
+check_link_DEPENDENCIES = libcairoboilerplate.la
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/build/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo " CXX " $@;
+am__v_CXX_1 =
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+am__v_CXXLD_1 =
+SOURCES = $(libcairoboilerplate_la_SOURCES) \
+ $(libcairoboilerplate_cxx_la_SOURCES) check-link.c
+DIST_SOURCES = $(am__libcairoboilerplate_la_SOURCES_DIST) \
+ $(am__libcairoboilerplate_cxx_la_SOURCES_DIST) check-link.c
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/build/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.am.features $(srcdir)/Makefile.in \
+ $(top_srcdir)/boilerplate/Makefile.sources \
+ $(top_srcdir)/build/Makefile.am.common \
+ $(top_srcdir)/build/depcomp $(top_srcdir)/build/test-driver \
+ README
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+CAIROBOILERPLATE_LIBS = @CAIROBOILERPLATE_LIBS@
+CAIRO_CFLAGS = @CAIRO_CFLAGS@
+CAIRO_LDFLAGS = @CAIRO_LDFLAGS@
+CAIRO_LIBS = @CAIRO_LIBS@
+CAIRO_LIBTOOL_VERSION_INFO = @CAIRO_LIBTOOL_VERSION_INFO@
+CAIRO_NONPKGCONFIG_CFLAGS = @CAIRO_NONPKGCONFIG_CFLAGS@
+CAIRO_NONPKGCONFIG_LIBS = @CAIRO_NONPKGCONFIG_LIBS@
+CAIRO_RELEASE_STATUS = @CAIRO_RELEASE_STATUS@
+CAIRO_REQUIRES = @CAIRO_REQUIRES@
+CAIRO_TEST_MODE = @CAIRO_TEST_MODE@
+CAIRO_TEST_UNDEFINED_LDFLAGS = @CAIRO_TEST_UNDEFINED_LDFLAGS@
+CAIRO_VERSION_MAJOR = @CAIRO_VERSION_MAJOR@
+CAIRO_VERSION_MICRO = @CAIRO_VERSION_MICRO@
+CAIRO_VERSION_MINOR = @CAIRO_VERSION_MINOR@
+CAIRO_VERSION_SONUM = @CAIRO_VERSION_SONUM@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FIND = @FIND@
+FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
+FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
+FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
+FREETYPE_CONFIG = @FREETYPE_CONFIG@
+FREETYPE_LIBS = @FREETYPE_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GREP = @GREP@
+GS = @GS@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
+GTKDOC_MKPDF = @GTKDOC_MKPDF@
+GTKDOC_REBASE = @GTKDOC_REBASE@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBRSVG_CFLAGS = @LIBRSVG_CFLAGS@
+LIBRSVG_LIBS = @LIBRSVG_LIBS@
+LIBS = @LIBS@
+LIBSPECTRE_CFLAGS = @LIBSPECTRE_CFLAGS@
+LIBSPECTRE_LIBS = @LIBSPECTRE_LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKGCONFIG_REQUIRES = @PKGCONFIG_REQUIRES@
+PKG_CONFIG = @PKG_CONFIG@
+POPPLER_CFLAGS = @POPPLER_CFLAGS@
+POPPLER_LIBS = @POPPLER_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SHLIB_EXT = @SHLIB_EXT@
+SHM_LIBS = @SHM_LIBS@
+SHTOOL = @SHTOOL@
+STRIP = @STRIP@
+VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
+VALGRIND_LIBS = @VALGRIND_LIBS@
+VERSION = @VERSION@
+XARGS = @XARGS@
+XMKMF = @XMKMF@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cogl_CFLAGS = @cogl_CFLAGS@
+cogl_LIBS = @cogl_LIBS@
+datadir = @datadir@
+datarootdir = @datarootdir@
+directfb_CFLAGS = @directfb_CFLAGS@
+directfb_LIBS = @directfb_LIBS@
+docdir = @docdir@
+drm_CFLAGS = @drm_CFLAGS@
+drm_LIBS = @drm_LIBS@
+dvidir = @dvidir@
+egl_CFLAGS = @egl_CFLAGS@
+egl_LIBS = @egl_LIBS@
+exec_prefix = @exec_prefix@
+gallium_DIR = @gallium_DIR@
+gl_CFLAGS = @gl_CFLAGS@
+gl_LIBS = @gl_LIBS@
+glesv2_CFLAGS = @glesv2_CFLAGS@
+glesv2_LIBS = @glesv2_LIBS@
+glesv3_CFLAGS = @glesv3_CFLAGS@
+glesv3_LIBS = @glesv3_LIBS@
+glib_CFLAGS = @glib_CFLAGS@
+glib_LIBS = @glib_LIBS@
+gtk_CFLAGS = @gtk_CFLAGS@
+gtk_LIBS = @gtk_LIBS@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lzo_LIBS = @lzo_LIBS@
+mandir = @mandir@
+mesa_DIR = @mesa_DIR@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pixman_CFLAGS = @pixman_CFLAGS@
+pixman_LIBS = @pixman_LIBS@
+png_CFLAGS = @png_CFLAGS@
+png_LIBS = @png_LIBS@
+png_REQUIRES = @png_REQUIRES@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pthread_CFLAGS = @pthread_CFLAGS@
+pthread_LIBS = @pthread_LIBS@
+qt_CFLAGS = @qt_CFLAGS@
+qt_LIBS = @qt_LIBS@
+real_pthread_CFLAGS = @real_pthread_CFLAGS@
+real_pthread_LIBS = @real_pthread_LIBS@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+shm_LIBS = @shm_LIBS@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+xcb_CFLAGS = @xcb_CFLAGS@
+xcb_LIBS = @xcb_LIBS@
+xcb_shm_CFLAGS = @xcb_shm_CFLAGS@
+xcb_shm_LIBS = @xcb_shm_LIBS@
+xlib_CFLAGS = @xlib_CFLAGS@
+xlib_LIBS = @xlib_LIBS@
+xlib_xcb_CFLAGS = @xlib_xcb_CFLAGS@
+xlib_xcb_LIBS = @xlib_xcb_LIBS@
+xlib_xrender_CFLAGS = @xlib_xrender_CFLAGS@
+xlib_xrender_LIBS = @xlib_xrender_LIBS@
+BUILT_SOURCES = cairo-boilerplate-constructors.c
+CLEANFILES = *.i *.s *.gch $(EXTRA_LTLIBRARIES) $(EXTRA_PROGRAMS) \
+ $(check_PROGRAMS) $(BUILT_SOURCES)
+DISTCLEANFILES = $(BUILT_SOURCES)
+EXTRA_DIST = Makefile.win32 Makefile.win32.features $(BUILT_SOURCES) \
+ make-cairo-boilerplate-constructors.sh
+EXTRA_LTLIBRARIES = libcairoboilerplate.la $(cxx_boilerplate_lib)
+MAINTAINERCLEANFILES = Makefile.in
+TESTS = $(am__append_154)
+cairo_boilerplate_headers = \
+ cairo-boilerplate-getopt.h \
+ cairo-boilerplate-scaled-font.h \
+ cairo-boilerplate-system.h \
+ cairo-boilerplate.h \
+ $(NULL)
+
+cairo_boilerplate_sources = \
+ cairo-boilerplate-getopt.c \
+ cairo-boilerplate-system.c \
+ cairo-boilerplate.c \
+ $(NULL)
+
+cairo_boilerplate_private = \
+ cairo-boilerplate-private.h \
+ $(NULL)
+
+cairo_boilerplate_beos_cxx_sources = cairo-boilerplate-beos.cpp
+cairo_boilerplate_directfb_sources = cairo-boilerplate-directfb.c
+cairo_boilerplate_drm_sources = cairo-boilerplate-drm.c
+cairo_boilerplate_glx_sources = cairo-boilerplate-glx.c
+cairo_boilerplate_wgl_sources = cairo-boilerplate-wgl.c
+cairo_boilerplate_egl_sources = cairo-boilerplate-egl.c
+cairo_boilerplate_pdf_sources = cairo-boilerplate-pdf.c
+cairo_boilerplate_ps_sources = cairo-boilerplate-ps.c
+cairo_boilerplate_qt_cxx_sources = cairo-boilerplate-qt.cpp
+cairo_boilerplate_quartz_sources = cairo-boilerplate-quartz.c
+cairo_boilerplate_script_sources = cairo-boilerplate-script.c
+cairo_boilerplate_skia_sources = cairo-boilerplate-skia.c
+cairo_boilerplate_svg_sources = cairo-boilerplate-svg.c
+cairo_boilerplate_test_surfaces_sources = cairo-boilerplate-test-surfaces.c
+cairo_boilerplate_win32_sources = cairo-boilerplate-win32.c cairo-boilerplate-win32-printing.c
+cairo_boilerplate_xcb_sources = cairo-boilerplate-xcb.c
+cairo_boilerplate_xlib_headers = cairo-boilerplate-xlib.h
+cairo_boilerplate_xlib_sources = cairo-boilerplate-xlib.c
+cairo_boilerplate_vg_sources = cairo-boilerplate-vg.c
+cairo_boilerplate_cogl_sources = cairo-boilerplate-cogl.c
+supported_cairo_boilerplate_headers = $(cairo_boilerplate_headers) \
+ $(cairo_boilerplate_xlib_headers) \
+ $(cairo_boilerplate_xlib_xrender_headers) \
+ $(cairo_boilerplate_xcb_headers) \
+ $(cairo_boilerplate_xcb_shm_headers) \
+ $(cairo_boilerplate_quartz_headers) \
+ $(cairo_boilerplate_quartz_font_headers) \
+ $(cairo_boilerplate_win32_headers) \
+ $(cairo_boilerplate_win32_font_headers) \
+ $(cairo_boilerplate_png_headers) \
+ $(cairo_boilerplate_egl_headers) \
+ $(cairo_boilerplate_glx_headers) \
+ $(cairo_boilerplate_wgl_headers) \
+ $(cairo_boilerplate_script_headers) \
+ $(cairo_boilerplate_ft_headers) \
+ $(cairo_boilerplate_fc_headers) \
+ $(cairo_boilerplate_ps_headers) \
+ $(cairo_boilerplate_pdf_headers) \
+ $(cairo_boilerplate_svg_headers) \
+ $(cairo_boilerplate_image_headers) \
+ $(cairo_boilerplate_mime_headers) \
+ $(cairo_boilerplate_recording_headers) \
+ $(cairo_boilerplate_observer_headers) \
+ $(cairo_boilerplate_user_headers) \
+ $(cairo_boilerplate_gobject_headers)
+unsupported_cairo_boilerplate_headers = \
+ $(cairo_boilerplate_xlib_xcb_headers) \
+ $(cairo_boilerplate_qt_headers) \
+ $(cairo_boilerplate_quartz_image_headers) \
+ $(cairo_boilerplate_os2_headers) \
+ $(cairo_boilerplate_beos_headers) \
+ $(cairo_boilerplate_drm_headers) \
+ $(cairo_boilerplate_gallium_headers) \
+ $(cairo_boilerplate_gl_headers) \
+ $(cairo_boilerplate_glesv2_headers) \
+ $(cairo_boilerplate_glesv3_headers) \
+ $(cairo_boilerplate_cogl_headers) \
+ $(cairo_boilerplate_directfb_headers) \
+ $(cairo_boilerplate_vg_headers) \
+ $(cairo_boilerplate_tee_headers) \
+ $(cairo_boilerplate_xml_headers)
+all_cairo_boilerplate_headers = $(cairo_boilerplate_headers) \
+ $(cairo_boilerplate_xlib_headers) \
+ $(cairo_boilerplate_xlib_xrender_headers) \
+ $(cairo_boilerplate_xcb_headers) \
+ $(cairo_boilerplate_xlib_xcb_headers) \
+ $(cairo_boilerplate_xcb_shm_headers) \
+ $(cairo_boilerplate_qt_headers) \
+ $(cairo_boilerplate_quartz_headers) \
+ $(cairo_boilerplate_quartz_font_headers) \
+ $(cairo_boilerplate_quartz_image_headers) \
+ $(cairo_boilerplate_win32_headers) \
+ $(cairo_boilerplate_win32_font_headers) \
+ $(cairo_boilerplate_os2_headers) \
+ $(cairo_boilerplate_beos_headers) \
+ $(cairo_boilerplate_drm_headers) \
+ $(cairo_boilerplate_gallium_headers) \
+ $(cairo_boilerplate_png_headers) \
+ $(cairo_boilerplate_gl_headers) \
+ $(cairo_boilerplate_glesv2_headers) \
+ $(cairo_boilerplate_glesv3_headers) \
+ $(cairo_boilerplate_cogl_headers) \
+ $(cairo_boilerplate_directfb_headers) \
+ $(cairo_boilerplate_vg_headers) \
+ $(cairo_boilerplate_egl_headers) \
+ $(cairo_boilerplate_glx_headers) \
+ $(cairo_boilerplate_wgl_headers) \
+ $(cairo_boilerplate_script_headers) \
+ $(cairo_boilerplate_ft_headers) \
+ $(cairo_boilerplate_fc_headers) \
+ $(cairo_boilerplate_ps_headers) \
+ $(cairo_boilerplate_pdf_headers) \
+ $(cairo_boilerplate_svg_headers) \
+ $(cairo_boilerplate_image_headers) \
+ $(cairo_boilerplate_mime_headers) \
+ $(cairo_boilerplate_recording_headers) \
+ $(cairo_boilerplate_observer_headers) \
+ $(cairo_boilerplate_tee_headers) \
+ $(cairo_boilerplate_xml_headers) \
+ $(cairo_boilerplate_user_headers) \
+ $(cairo_boilerplate_gobject_headers)
+all_cairo_boilerplate_private = $(cairo_boilerplate_private) \
+ $(cairo_boilerplate_xlib_private) \
+ $(cairo_boilerplate_xlib_xrender_private) \
+ $(cairo_boilerplate_xcb_private) \
+ $(cairo_boilerplate_xlib_xcb_private) \
+ $(cairo_boilerplate_xcb_shm_private) \
+ $(cairo_boilerplate_qt_private) \
+ $(cairo_boilerplate_quartz_private) \
+ $(cairo_boilerplate_quartz_font_private) \
+ $(cairo_boilerplate_quartz_image_private) \
+ $(cairo_boilerplate_win32_private) \
+ $(cairo_boilerplate_win32_font_private) \
+ $(cairo_boilerplate_os2_private) \
+ $(cairo_boilerplate_beos_private) \
+ $(cairo_boilerplate_drm_private) \
+ $(cairo_boilerplate_gallium_private) \
+ $(cairo_boilerplate_png_private) \
+ $(cairo_boilerplate_gl_private) \
+ $(cairo_boilerplate_glesv2_private) \
+ $(cairo_boilerplate_glesv3_private) \
+ $(cairo_boilerplate_cogl_private) \
+ $(cairo_boilerplate_directfb_private) \
+ $(cairo_boilerplate_vg_private) \
+ $(cairo_boilerplate_egl_private) \
+ $(cairo_boilerplate_glx_private) \
+ $(cairo_boilerplate_wgl_private) \
+ $(cairo_boilerplate_script_private) \
+ $(cairo_boilerplate_ft_private) \
+ $(cairo_boilerplate_fc_private) \
+ $(cairo_boilerplate_ps_private) \
+ $(cairo_boilerplate_pdf_private) \
+ $(cairo_boilerplate_svg_private) \
+ $(cairo_boilerplate_test_surfaces_private) \
+ $(cairo_boilerplate_test_surfaces_headers) \
+ $(cairo_boilerplate_image_private) \
+ $(cairo_boilerplate_mime_private) \
+ $(cairo_boilerplate_recording_private) \
+ $(cairo_boilerplate_observer_private) \
+ $(cairo_boilerplate_tee_private) \
+ $(cairo_boilerplate_xml_private) \
+ $(cairo_boilerplate_user_private) \
+ $(cairo_boilerplate_pthread_private) \
+ $(cairo_boilerplate_pthread_headers) \
+ $(cairo_boilerplate_gobject_private) \
+ $(cairo_boilerplate_trace_private) \
+ $(cairo_boilerplate_trace_headers) \
+ $(cairo_boilerplate_interpreter_private) \
+ $(cairo_boilerplate_interpreter_headers) \
+ $(cairo_boilerplate_symbol_lookup_private) \
+ $(cairo_boilerplate_symbol_lookup_headers)
+all_cairo_boilerplate_cxx_sources = $(cairo_boilerplate_cxx_sources) \
+ $(cairo_boilerplate_xlib_cxx_sources) \
+ $(cairo_boilerplate_xlib_xrender_cxx_sources) \
+ $(cairo_boilerplate_xcb_cxx_sources) \
+ $(cairo_boilerplate_xlib_xcb_cxx_sources) \
+ $(cairo_boilerplate_xcb_shm_cxx_sources) \
+ $(cairo_boilerplate_qt_cxx_sources) \
+ $(cairo_boilerplate_quartz_cxx_sources) \
+ $(cairo_boilerplate_quartz_font_cxx_sources) \
+ $(cairo_boilerplate_quartz_image_cxx_sources) \
+ $(cairo_boilerplate_win32_cxx_sources) \
+ $(cairo_boilerplate_win32_font_cxx_sources) \
+ $(cairo_boilerplate_os2_cxx_sources) \
+ $(cairo_boilerplate_beos_cxx_sources) \
+ $(cairo_boilerplate_drm_cxx_sources) \
+ $(cairo_boilerplate_gallium_cxx_sources) \
+ $(cairo_boilerplate_png_cxx_sources) \
+ $(cairo_boilerplate_gl_cxx_sources) \
+ $(cairo_boilerplate_glesv2_cxx_sources) \
+ $(cairo_boilerplate_glesv3_cxx_sources) \
+ $(cairo_boilerplate_cogl_cxx_sources) \
+ $(cairo_boilerplate_directfb_cxx_sources) \
+ $(cairo_boilerplate_vg_cxx_sources) \
+ $(cairo_boilerplate_egl_cxx_sources) \
+ $(cairo_boilerplate_glx_cxx_sources) \
+ $(cairo_boilerplate_wgl_cxx_sources) \
+ $(cairo_boilerplate_script_cxx_sources) \
+ $(cairo_boilerplate_ft_cxx_sources) \
+ $(cairo_boilerplate_fc_cxx_sources) \
+ $(cairo_boilerplate_ps_cxx_sources) \
+ $(cairo_boilerplate_pdf_cxx_sources) \
+ $(cairo_boilerplate_svg_cxx_sources) \
+ $(cairo_boilerplate_test_surfaces_cxx_sources) \
+ $(cairo_boilerplate_image_cxx_sources) \
+ $(cairo_boilerplate_mime_cxx_sources) \
+ $(cairo_boilerplate_recording_cxx_sources) \
+ $(cairo_boilerplate_observer_cxx_sources) \
+ $(cairo_boilerplate_tee_cxx_sources) \
+ $(cairo_boilerplate_xml_cxx_sources) \
+ $(cairo_boilerplate_user_cxx_sources) \
+ $(cairo_boilerplate_pthread_cxx_sources) \
+ $(cairo_boilerplate_gobject_cxx_sources) \
+ $(cairo_boilerplate_trace_cxx_sources) \
+ $(cairo_boilerplate_interpreter_cxx_sources) \
+ $(cairo_boilerplate_symbol_lookup_cxx_sources)
+all_cairo_boilerplate_sources = $(cairo_boilerplate_sources) \
+ $(cairo_boilerplate_xlib_sources) \
+ $(cairo_boilerplate_xlib_xrender_sources) \
+ $(cairo_boilerplate_xcb_sources) \
+ $(cairo_boilerplate_xlib_xcb_sources) \
+ $(cairo_boilerplate_xcb_shm_sources) \
+ $(cairo_boilerplate_qt_sources) \
+ $(cairo_boilerplate_quartz_sources) \
+ $(cairo_boilerplate_quartz_font_sources) \
+ $(cairo_boilerplate_quartz_image_sources) \
+ $(cairo_boilerplate_win32_sources) \
+ $(cairo_boilerplate_win32_font_sources) \
+ $(cairo_boilerplate_os2_sources) \
+ $(cairo_boilerplate_beos_sources) \
+ $(cairo_boilerplate_drm_sources) \
+ $(cairo_boilerplate_gallium_sources) \
+ $(cairo_boilerplate_png_sources) \
+ $(cairo_boilerplate_gl_sources) \
+ $(cairo_boilerplate_glesv2_sources) \
+ $(cairo_boilerplate_glesv3_sources) \
+ $(cairo_boilerplate_cogl_sources) \
+ $(cairo_boilerplate_directfb_sources) \
+ $(cairo_boilerplate_vg_sources) \
+ $(cairo_boilerplate_egl_sources) \
+ $(cairo_boilerplate_glx_sources) \
+ $(cairo_boilerplate_wgl_sources) \
+ $(cairo_boilerplate_script_sources) \
+ $(cairo_boilerplate_ft_sources) \
+ $(cairo_boilerplate_fc_sources) \
+ $(cairo_boilerplate_ps_sources) \
+ $(cairo_boilerplate_pdf_sources) \
+ $(cairo_boilerplate_svg_sources) \
+ $(cairo_boilerplate_test_surfaces_sources) \
+ $(cairo_boilerplate_image_sources) \
+ $(cairo_boilerplate_mime_sources) \
+ $(cairo_boilerplate_recording_sources) \
+ $(cairo_boilerplate_observer_sources) \
+ $(cairo_boilerplate_tee_sources) \
+ $(cairo_boilerplate_xml_sources) \
+ $(cairo_boilerplate_user_sources) \
+ $(cairo_boilerplate_pthread_sources) \
+ $(cairo_boilerplate_gobject_sources) \
+ $(cairo_boilerplate_trace_sources) \
+ $(cairo_boilerplate_interpreter_sources) \
+ $(cairo_boilerplate_symbol_lookup_sources)
+enabled_cairo_boilerplate_headers = $(cairo_boilerplate_headers) \
+ $(am__append_1) $(am__append_5) $(am__append_9) \
+ $(am__append_13) $(am__append_17) $(am__append_21) \
+ $(am__append_25) $(am__append_29) $(am__append_33) \
+ $(am__append_37) $(am__append_41) $(am__append_45) \
+ $(am__append_49) $(am__append_53) $(am__append_57) \
+ $(am__append_61) $(am__append_65) $(am__append_69) \
+ $(am__append_73) $(am__append_77) $(am__append_81) \
+ $(am__append_85) $(am__append_89) $(am__append_93) \
+ $(am__append_97) $(am__append_101) $(am__append_105) \
+ $(am__append_109) $(am__append_113) $(am__append_117) \
+ $(am__append_121) $(cairo_boilerplate_image_headers) \
+ $(cairo_boilerplate_mime_headers) \
+ $(cairo_boilerplate_recording_headers) \
+ $(cairo_boilerplate_observer_headers) $(am__append_128) \
+ $(am__append_132) $(cairo_boilerplate_user_headers) \
+ $(am__append_139)
+enabled_cairo_boilerplate_private = $(cairo_boilerplate_private) \
+ $(am__append_2) $(am__append_6) $(am__append_10) \
+ $(am__append_14) $(am__append_18) $(am__append_22) \
+ $(am__append_26) $(am__append_30) $(am__append_34) \
+ $(am__append_38) $(am__append_42) $(am__append_46) \
+ $(am__append_50) $(am__append_54) $(am__append_58) \
+ $(am__append_62) $(am__append_66) $(am__append_70) \
+ $(am__append_74) $(am__append_78) $(am__append_82) \
+ $(am__append_86) $(am__append_90) $(am__append_94) \
+ $(am__append_98) $(am__append_102) $(am__append_106) \
+ $(am__append_110) $(am__append_114) $(am__append_118) \
+ $(am__append_122) $(am__append_125) \
+ $(cairo_boilerplate_image_private) \
+ $(cairo_boilerplate_mime_private) \
+ $(cairo_boilerplate_recording_private) \
+ $(cairo_boilerplate_observer_private) $(am__append_129) \
+ $(am__append_133) $(cairo_boilerplate_user_private) \
+ $(am__append_136) $(am__append_140) $(am__append_143) \
+ $(am__append_146) $(am__append_149)
+enabled_cairo_boilerplate_cxx_sources = \
+ $(cairo_boilerplate_cxx_sources) $(am__append_3) \
+ $(am__append_7) $(am__append_11) $(am__append_15) \
+ $(am__append_19) $(am__append_23) $(am__append_27) \
+ $(am__append_31) $(am__append_35) $(am__append_39) \
+ $(am__append_43) $(am__append_47) $(am__append_51) \
+ $(am__append_55) $(am__append_59) $(am__append_63) \
+ $(am__append_67) $(am__append_71) $(am__append_75) \
+ $(am__append_79) $(am__append_83) $(am__append_87) \
+ $(am__append_91) $(am__append_95) $(am__append_99) \
+ $(am__append_103) $(am__append_107) $(am__append_111) \
+ $(am__append_115) $(am__append_119) $(am__append_123) \
+ $(am__append_126) $(cairo_boilerplate_image_cxx_sources) \
+ $(cairo_boilerplate_mime_cxx_sources) \
+ $(cairo_boilerplate_recording_cxx_sources) \
+ $(cairo_boilerplate_observer_cxx_sources) $(am__append_130) \
+ $(am__append_134) $(cairo_boilerplate_user_cxx_sources) \
+ $(am__append_137) $(am__append_141) $(am__append_144) \
+ $(am__append_147) $(am__append_150)
+enabled_cairo_boilerplate_sources = $(cairo_boilerplate_sources) \
+ $(am__append_4) $(am__append_8) $(am__append_12) \
+ $(am__append_16) $(am__append_20) $(am__append_24) \
+ $(am__append_28) $(am__append_32) $(am__append_36) \
+ $(am__append_40) $(am__append_44) $(am__append_48) \
+ $(am__append_52) $(am__append_56) $(am__append_60) \
+ $(am__append_64) $(am__append_68) $(am__append_72) \
+ $(am__append_76) $(am__append_80) $(am__append_84) \
+ $(am__append_88) $(am__append_92) $(am__append_96) \
+ $(am__append_100) $(am__append_104) $(am__append_108) \
+ $(am__append_112) $(am__append_116) $(am__append_120) \
+ $(am__append_124) $(am__append_127) \
+ $(cairo_boilerplate_image_sources) \
+ $(cairo_boilerplate_mime_sources) \
+ $(cairo_boilerplate_recording_sources) \
+ $(cairo_boilerplate_observer_sources) $(am__append_131) \
+ $(am__append_135) $(cairo_boilerplate_user_sources) \
+ $(am__append_138) $(am__append_142) $(am__append_145) \
+ $(am__append_148) $(am__append_151)
+#MAINTAINERCLEANFILES += $(srcdir)/Makefile.win32.features
+AM_CPPFLAGS = \
+ -I$(srcdir) \
+ -I$(top_builddir)/src \
+ -I$(top_srcdir)/src \
+ $(CAIRO_CFLAGS) \
+ $(NULL)
+
+AM_LDFLAGS = $(CAIRO_LDFLAGS)
+@BUILD_CXX_FALSE@cxx_boilerplate_lib =
+@BUILD_CXX_TRUE@cxx_boilerplate_lib = libcairoboilerplate_cxx.la
+libcairoboilerplate_la_SOURCES = \
+ $(enabled_cairo_boilerplate_headers) \
+ $(enabled_cairo_boilerplate_private) \
+ $(enabled_cairo_boilerplate_sources) \
+ cairo-boilerplate-constructors.c \
+ $(NULL)
+
+libcairoboilerplate_cxx_la_SOURCES = \
+ $(enabled_cairo_boilerplate_cxx_sources) \
+ $(NULL)
+
+libcairoboilerplate_la_LIBADD = $(top_builddir)/src/libcairo.la \
+ $(cxx_boilerplate_lib) $(CAIRO_LIBS) $(CAIROBOILERPLATE_LIBS) \
+ $(NULL) $(am__append_152) $(am__append_153)
+libcairoboilerplate_cxx_la_LIBADD = $(top_builddir)/src/libcairo.la \
+ $(CAIRO_LIBS) \
+ $(CAIROBOILERPLATE_LIBS) \
+ $(NULL)
+
+libcairoboilerplate_la_DEPENDENCIES = \
+ $(cxx_boilerplate_lib) \
+ $(NULL)
+
+
+# BeOS system headers trigger this warning
+@CAIRO_HAS_BEOS_SURFACE_TRUE@libcairoboilerplate_cxx_la_CXXFLAGS = -Wno-multichar
+check_link_LDADD = libcairoboilerplate.la
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .cpp .lo .log .o .obj .test .test$(EXEEXT) .trs
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/build/Makefile.am.common $(srcdir)/Makefile.am.features $(top_srcdir)/boilerplate/Makefile.sources $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign boilerplate/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign boilerplate/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+$(top_srcdir)/build/Makefile.am.common $(srcdir)/Makefile.am.features $(top_srcdir)/boilerplate/Makefile.sources $(am__empty):
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+libcairoboilerplate.la: $(libcairoboilerplate_la_OBJECTS) $(libcairoboilerplate_la_DEPENDENCIES) $(EXTRA_libcairoboilerplate_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(libcairoboilerplate_la_OBJECTS) $(libcairoboilerplate_la_LIBADD) $(LIBS)
+
+libcairoboilerplate_cxx.la: $(libcairoboilerplate_cxx_la_OBJECTS) $(libcairoboilerplate_cxx_la_DEPENDENCIES) $(EXTRA_libcairoboilerplate_cxx_la_DEPENDENCIES)
+ $(AM_V_CXXLD)$(libcairoboilerplate_cxx_la_LINK) $(am_libcairoboilerplate_cxx_la_rpath) $(libcairoboilerplate_cxx_la_OBJECTS) $(libcairoboilerplate_cxx_la_LIBADD) $(LIBS)
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+check-link$(EXEEXT): $(check_link_OBJECTS) $(check_link_DEPENDENCIES) $(EXTRA_check_link_DEPENDENCIES)
+ @rm -f check-link$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_link_OBJECTS) $(check_link_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-cogl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-constructors.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-directfb.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-drm.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-egl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-getopt.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-glx.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-pdf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-ps.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-quartz.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-script.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-svg.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-system.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-test-surfaces.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-vg.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-wgl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-win32-printing.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-win32.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-xcb.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate-xlib.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo-boilerplate.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-link.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcairoboilerplate_cxx_la-cairo-boilerplate-beos.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcairoboilerplate_cxx_la-cairo-boilerplate-qt.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+libcairoboilerplate_cxx_la-cairo-boilerplate-qt.lo: cairo-boilerplate-qt.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcairoboilerplate_cxx_la_CXXFLAGS) $(CXXFLAGS) -MT libcairoboilerplate_cxx_la-cairo-boilerplate-qt.lo -MD -MP -MF $(DEPDIR)/libcairoboilerplate_cxx_la-cairo-boilerplate-qt.Tpo -c -o libcairoboilerplate_cxx_la-cairo-boilerplate-qt.lo `test -f 'cairo-boilerplate-qt.cpp' || echo '$(srcdir)/'`cairo-boilerplate-qt.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcairoboilerplate_cxx_la-cairo-boilerplate-qt.Tpo $(DEPDIR)/libcairoboilerplate_cxx_la-cairo-boilerplate-qt.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cairo-boilerplate-qt.cpp' object='libcairoboilerplate_cxx_la-cairo-boilerplate-qt.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcairoboilerplate_cxx_la_CXXFLAGS) $(CXXFLAGS) -c -o libcairoboilerplate_cxx_la-cairo-boilerplate-qt.lo `test -f 'cairo-boilerplate-qt.cpp' || echo '$(srcdir)/'`cairo-boilerplate-qt.cpp
+
+libcairoboilerplate_cxx_la-cairo-boilerplate-beos.lo: cairo-boilerplate-beos.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcairoboilerplate_cxx_la_CXXFLAGS) $(CXXFLAGS) -MT libcairoboilerplate_cxx_la-cairo-boilerplate-beos.lo -MD -MP -MF $(DEPDIR)/libcairoboilerplate_cxx_la-cairo-boilerplate-beos.Tpo -c -o libcairoboilerplate_cxx_la-cairo-boilerplate-beos.lo `test -f 'cairo-boilerplate-beos.cpp' || echo '$(srcdir)/'`cairo-boilerplate-beos.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcairoboilerplate_cxx_la-cairo-boilerplate-beos.Tpo $(DEPDIR)/libcairoboilerplate_cxx_la-cairo-boilerplate-beos.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='cairo-boilerplate-beos.cpp' object='libcairoboilerplate_cxx_la-cairo-boilerplate-beos.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcairoboilerplate_cxx_la_CXXFLAGS) $(CXXFLAGS) -c -o libcairoboilerplate_cxx_la-cairo-boilerplate-beos.lo `test -f 'cairo-boilerplate-beos.cpp' || echo '$(srcdir)/'`cairo-boilerplate-beos.cpp
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ elif test -n "$$redo_logs"; then \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all $(check_PROGRAMS)
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+check-link.log: check-link$(EXEEXT)
+ @p='check-link$(EXEEXT)'; \
+ b='check-link'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile
+installdirs:
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: all check check-am install install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \
+ ctags ctags-am distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ recheck tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+cairo-boilerplate-constructors.c: Makefile $(enabled_cairo_boilerplate_sources) $(enabled_cairo_boilerplate_cxx_sources) make-cairo-boilerplate-constructors.sh
+ (cd $(srcdir) && sh ./make-cairo-boilerplate-constructors.sh $(enabled_cairo_boilerplate_sources) $(enabled_cairo_boilerplate_cxx_sources)) > $@
+
+test: check
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libs/cairo-1.16.0/boilerplate/Makefile.sources b/libs/cairo-1.16.0/boilerplate/Makefile.sources
new file mode 100644
index 0000000..101e997
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/Makefile.sources
@@ -0,0 +1,41 @@
+# Makefile.sources
+#
+# This file is pretty similar to $(top_srcdir)/src/Makefile.sources,
+# but for boilerplate. Unlike that file, there are no special headers.
+#
+
+cairo_boilerplate_headers = \
+ cairo-boilerplate-getopt.h \
+ cairo-boilerplate-scaled-font.h \
+ cairo-boilerplate-system.h \
+ cairo-boilerplate.h \
+ $(NULL)
+cairo_boilerplate_sources = \
+ cairo-boilerplate-getopt.c \
+ cairo-boilerplate-system.c \
+ cairo-boilerplate.c \
+ $(NULL)
+cairo_boilerplate_private = \
+ cairo-boilerplate-private.h \
+ $(NULL)
+
+cairo_boilerplate_beos_cxx_sources = cairo-boilerplate-beos.cpp
+cairo_boilerplate_directfb_sources = cairo-boilerplate-directfb.c
+cairo_boilerplate_drm_sources = cairo-boilerplate-drm.c
+cairo_boilerplate_glx_sources = cairo-boilerplate-glx.c
+cairo_boilerplate_wgl_sources = cairo-boilerplate-wgl.c
+cairo_boilerplate_egl_sources = cairo-boilerplate-egl.c
+cairo_boilerplate_pdf_sources = cairo-boilerplate-pdf.c
+cairo_boilerplate_ps_sources = cairo-boilerplate-ps.c
+cairo_boilerplate_qt_cxx_sources = cairo-boilerplate-qt.cpp
+cairo_boilerplate_quartz_sources = cairo-boilerplate-quartz.c
+cairo_boilerplate_script_sources = cairo-boilerplate-script.c
+cairo_boilerplate_skia_sources = cairo-boilerplate-skia.c
+cairo_boilerplate_svg_sources = cairo-boilerplate-svg.c
+cairo_boilerplate_test_surfaces_sources = cairo-boilerplate-test-surfaces.c
+cairo_boilerplate_win32_sources = cairo-boilerplate-win32.c cairo-boilerplate-win32-printing.c
+cairo_boilerplate_xcb_sources = cairo-boilerplate-xcb.c
+cairo_boilerplate_xlib_headers = cairo-boilerplate-xlib.h
+cairo_boilerplate_xlib_sources = cairo-boilerplate-xlib.c
+cairo_boilerplate_vg_sources = cairo-boilerplate-vg.c
+cairo_boilerplate_cogl_sources = cairo-boilerplate-cogl.c
diff --git a/libs/cairo-1.16.0/boilerplate/Makefile.win32 b/libs/cairo-1.16.0/boilerplate/Makefile.win32
new file mode 100644
index 0000000..29df5cf
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/Makefile.win32
@@ -0,0 +1,24 @@
+top_srcdir = ..
+include $(top_srcdir)/build/Makefile.win32.common
+include Makefile.win32.features
+
+HEADERS = \
+ $(enabled_cairo_boilerplate_headers) \
+ $(enabled_cairo_boilerplate_private) \
+ $(NULL)
+
+SOURCES = \
+ $(enabled_cairo_boilerplate_sources) \
+ cairo-boilerplate-constructors.c \
+ $(NULL)
+
+OBJECTS = $(patsubst %.c, $(CFG)/%-static.obj, $(SOURCES))
+
+cairo-boilerplate-constructors.c: Makefile.sources Makefile.win32 $(enabled_cairo_boilerplate_sources) make-cairo-boilerplate-constructors.sh
+ sh ./make-cairo-boilerplate-constructors.sh $(enabled_cairo_boilerplate_sources) > $@
+
+all: $(CFG)/boiler.lib
+
+
+$(CFG)/boiler.lib: $(OBJECTS)
+ @$(AR) $(CAIRO_ARFLAGS) -OUT:$@ $(OBJECTS)
diff --git a/libs/cairo-1.16.0/boilerplate/Makefile.win32.features b/libs/cairo-1.16.0/boilerplate/Makefile.win32.features
new file mode 100644
index 0000000..178d5b6
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/Makefile.win32.features
@@ -0,0 +1,523 @@
+# Generated by configure. Do not edit.
+
+ifeq ($(top_srcdir),)
+include Makefile.sources
+else
+include $(top_srcdir)/boilerplate/Makefile.sources
+endif
+
+supported_cairo_boilerplate_headers = $(cairo_boilerplate_headers)
+unsupported_cairo_boilerplate_headers =
+all_cairo_boilerplate_headers = $(cairo_boilerplate_headers)
+all_cairo_boilerplate_private = $(cairo_boilerplate_private)
+all_cairo_boilerplate_cxx_sources = $(cairo_boilerplate_cxx_sources)
+all_cairo_boilerplate_sources = $(cairo_boilerplate_sources)
+
+enabled_cairo_boilerplate_headers = $(cairo_boilerplate_headers)
+enabled_cairo_boilerplate_private = $(cairo_boilerplate_private)
+enabled_cairo_boilerplate_cxx_sources = $(cairo_boilerplate_cxx_sources)
+enabled_cairo_boilerplate_sources = $(cairo_boilerplate_sources)
+
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_xlib_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xlib_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_xlib_sources)
+ifeq ($(CAIRO_HAS_XLIB_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_xlib_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xlib_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_xlib_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_xrender_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_xrender_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_xlib_xrender_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xlib_xrender_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_xlib_xrender_sources)
+ifeq ($(CAIRO_HAS_XLIB_XRENDER_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_xrender_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_xlib_xrender_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xlib_xrender_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_xlib_xrender_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_xcb_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_xcb_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_xcb_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xcb_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_xcb_sources)
+ifeq ($(CAIRO_HAS_XCB_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_xcb_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_xcb_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xcb_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_xcb_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_xcb_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_xcb_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_xlib_xcb_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xlib_xcb_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_xlib_xcb_sources)
+ifeq ($(CAIRO_HAS_XLIB_XCB_FUNCTIONS),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_xlib_xcb_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_xlib_xcb_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xlib_xcb_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_xlib_xcb_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_xcb_shm_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_xcb_shm_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_xcb_shm_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xcb_shm_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_xcb_shm_sources)
+ifeq ($(CAIRO_HAS_XCB_SHM_FUNCTIONS),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_xcb_shm_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_xcb_shm_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xcb_shm_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_xcb_shm_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_qt_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_qt_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_qt_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_qt_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_qt_sources)
+ifeq ($(CAIRO_HAS_QT_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_qt_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_qt_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_qt_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_qt_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_quartz_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_quartz_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_quartz_sources)
+ifeq ($(CAIRO_HAS_QUARTZ_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_quartz_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_quartz_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_quartz_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_font_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_font_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_quartz_font_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_quartz_font_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_quartz_font_sources)
+ifeq ($(CAIRO_HAS_QUARTZ_FONT),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_font_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_quartz_font_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_quartz_font_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_quartz_font_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_image_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_image_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_quartz_image_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_quartz_image_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_quartz_image_sources)
+ifeq ($(CAIRO_HAS_QUARTZ_IMAGE_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_quartz_image_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_quartz_image_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_quartz_image_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_quartz_image_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_win32_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_win32_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_win32_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_win32_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_win32_sources)
+ifeq ($(CAIRO_HAS_WIN32_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_win32_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_win32_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_win32_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_win32_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_win32_font_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_win32_font_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_win32_font_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_win32_font_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_win32_font_sources)
+ifeq ($(CAIRO_HAS_WIN32_FONT),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_win32_font_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_win32_font_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_win32_font_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_win32_font_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_os2_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_os2_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_os2_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_os2_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_os2_sources)
+ifeq ($(CAIRO_HAS_OS2_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_os2_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_os2_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_os2_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_os2_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_beos_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_beos_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_beos_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_beos_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_beos_sources)
+ifeq ($(CAIRO_HAS_BEOS_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_beos_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_beos_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_beos_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_beos_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_drm_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_drm_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_drm_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_drm_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_drm_sources)
+ifeq ($(CAIRO_HAS_DRM_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_drm_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_drm_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_drm_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_drm_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_gallium_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_gallium_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_gallium_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_gallium_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_gallium_sources)
+ifeq ($(CAIRO_HAS_GALLIUM_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_gallium_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_gallium_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_gallium_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_gallium_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_png_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_png_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_png_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_png_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_png_sources)
+ifeq ($(CAIRO_HAS_PNG_FUNCTIONS),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_png_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_png_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_png_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_png_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_gl_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_gl_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_gl_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_gl_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_gl_sources)
+ifeq ($(CAIRO_HAS_GL_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_gl_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_gl_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_gl_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_gl_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_glesv2_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_glesv2_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_glesv2_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_glesv2_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_glesv2_sources)
+ifeq ($(CAIRO_HAS_GLESV2_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_glesv2_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_glesv2_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_glesv2_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_glesv2_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_glesv3_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_glesv3_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_glesv3_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_glesv3_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_glesv3_sources)
+ifeq ($(CAIRO_HAS_GLESV3_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_glesv3_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_glesv3_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_glesv3_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_glesv3_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_cogl_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_cogl_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_cogl_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_cogl_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_cogl_sources)
+ifeq ($(CAIRO_HAS_COGL_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_cogl_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_cogl_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_cogl_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_cogl_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_directfb_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_directfb_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_directfb_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_directfb_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_directfb_sources)
+ifeq ($(CAIRO_HAS_DIRECTFB_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_directfb_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_directfb_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_directfb_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_directfb_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_vg_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_vg_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_vg_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_vg_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_vg_sources)
+ifeq ($(CAIRO_HAS_VG_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_vg_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_vg_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_vg_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_vg_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_egl_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_egl_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_egl_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_egl_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_egl_sources)
+ifeq ($(CAIRO_HAS_EGL_FUNCTIONS),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_egl_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_egl_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_egl_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_egl_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_glx_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_glx_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_glx_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_glx_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_glx_sources)
+ifeq ($(CAIRO_HAS_GLX_FUNCTIONS),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_glx_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_glx_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_glx_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_glx_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_wgl_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_wgl_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_wgl_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_wgl_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_wgl_sources)
+ifeq ($(CAIRO_HAS_WGL_FUNCTIONS),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_wgl_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_wgl_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_wgl_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_wgl_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_script_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_script_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_script_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_script_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_script_sources)
+ifeq ($(CAIRO_HAS_SCRIPT_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_script_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_script_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_script_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_script_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_ft_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_ft_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_ft_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_ft_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_ft_sources)
+ifeq ($(CAIRO_HAS_FT_FONT),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_ft_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_ft_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_ft_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_ft_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_fc_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_fc_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_fc_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_fc_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_fc_sources)
+ifeq ($(CAIRO_HAS_FC_FONT),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_fc_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_fc_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_fc_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_fc_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_ps_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_ps_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_ps_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_ps_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_ps_sources)
+ifeq ($(CAIRO_HAS_PS_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_ps_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_ps_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_ps_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_ps_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_pdf_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_pdf_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_pdf_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_pdf_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_pdf_sources)
+ifeq ($(CAIRO_HAS_PDF_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_pdf_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_pdf_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_pdf_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_pdf_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_svg_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_svg_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_svg_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_svg_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_svg_sources)
+ifeq ($(CAIRO_HAS_SVG_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_svg_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_svg_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_svg_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_svg_sources)
+endif
+
+all_cairo_boilerplate_private += $(cairo_boilerplate_test_surfaces_private) $(cairo_boilerplate_test_surfaces_headers)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_test_surfaces_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_test_surfaces_sources)
+ifeq ($(CAIRO_HAS_TEST_SURFACES),1)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_test_surfaces_private) $(cairo_boilerplate_test_surfaces_headers)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_test_surfaces_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_test_surfaces_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_image_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_image_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_image_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_image_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_image_sources)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_image_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_image_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_image_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_image_sources)
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_mime_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_mime_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_mime_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_mime_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_mime_sources)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_mime_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_mime_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_mime_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_mime_sources)
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_recording_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_recording_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_recording_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_recording_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_recording_sources)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_recording_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_recording_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_recording_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_recording_sources)
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_observer_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_observer_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_observer_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_observer_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_observer_sources)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_observer_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_observer_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_observer_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_observer_sources)
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_tee_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_tee_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_tee_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_tee_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_tee_sources)
+ifeq ($(CAIRO_HAS_TEE_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_tee_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_tee_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_tee_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_tee_sources)
+endif
+
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_xml_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_xml_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_xml_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xml_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_xml_sources)
+ifeq ($(CAIRO_HAS_XML_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_xml_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_xml_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_xml_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_xml_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_user_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_user_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_user_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_user_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_user_sources)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_user_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_user_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_user_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_user_sources)
+
+all_cairo_boilerplate_private += $(cairo_boilerplate_pthread_private) $(cairo_boilerplate_pthread_headers)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_pthread_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_pthread_sources)
+ifeq ($(CAIRO_HAS_PTHREAD),1)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_pthread_private) $(cairo_boilerplate_pthread_headers)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_pthread_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_pthread_sources)
+endif
+
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_gobject_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_gobject_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_gobject_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_gobject_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_gobject_sources)
+ifeq ($(CAIRO_HAS_GOBJECT_FUNCTIONS),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_gobject_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_gobject_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_gobject_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_gobject_sources)
+endif
+
+all_cairo_boilerplate_private += $(cairo_boilerplate_trace_private) $(cairo_boilerplate_trace_headers)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_trace_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_trace_sources)
+ifeq ($(CAIRO_HAS_TRACE),1)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_trace_private) $(cairo_boilerplate_trace_headers)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_trace_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_trace_sources)
+endif
+
+all_cairo_boilerplate_private += $(cairo_boilerplate_interpreter_private) $(cairo_boilerplate_interpreter_headers)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_interpreter_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_interpreter_sources)
+ifeq ($(CAIRO_HAS_INTERPRETER),1)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_interpreter_private) $(cairo_boilerplate_interpreter_headers)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_interpreter_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_interpreter_sources)
+endif
+
+all_cairo_boilerplate_private += $(cairo_boilerplate_symbol_lookup_private) $(cairo_boilerplate_symbol_lookup_headers)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_symbol_lookup_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_symbol_lookup_sources)
+ifeq ($(CAIRO_HAS_SYMBOL_LOOKUP),1)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_symbol_lookup_private) $(cairo_boilerplate_symbol_lookup_headers)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_symbol_lookup_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_symbol_lookup_sources)
+endif
diff --git a/libs/cairo-1.16.0/boilerplate/README b/libs/cairo-1.16.0/boilerplate/README
new file mode 100644
index 0000000..2a27c41
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/README
@@ -0,0 +1,14 @@
+This directory provides code that is common to both of cairo's tests
+suites:
+
+ * The test suite for correctness in test/
+ * The test suite for performance in perf/
+
+We call it boilerplate as it consists primarily of the boilerplate
+code necessary for initializing a backend in order to create a surface
+for that backend.
+
+The code here just might be useful for someone looking to get started
+writing cairo code to use a particular backend, (but there are no
+promises that the boilerplate code found here for any particular
+backend is exemplary).
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-beos.cpp b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-beos.cpp
new file mode 100644
index 0000000..8a1b1af
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-beos.cpp
@@ -0,0 +1,273 @@
+/* vim:set ts=8 sw=4 noet cin: */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.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/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Takashi Toyoshima <toyoshim@be-in.org>
+ * Fredrik Holmqvist <thesuckiestemail@yahoo.se>
+ * Christian Biesinger <cbiesinger@web.de>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#include "cairo-boilerplate.h"
+#include <cairo-beos.h>
+
+// Part of this code was originally part of
+// xpfe/bootstrap/nsNativeAppSupportBeOS.cpp in the Mozilla source code.
+
+#include <Application.h>
+#include <Window.h>
+#include <View.h>
+#include <Bitmap.h>
+
+class CairoTestWindow : public BWindow
+{
+public:
+ CairoTestWindow(BRect frame, const char* title);
+ virtual ~CairoTestWindow();
+ BView* View() const { return mView; }
+private:
+ BView* mView;
+};
+
+CairoTestWindow::CairoTestWindow(BRect frame, const char* title)
+ : BWindow(frame, title, B_TITLED_WINDOW,
+ B_NOT_RESIZABLE|B_NOT_ZOOMABLE)
+{
+ mView = new BView(frame, "CairoWindowTestView", B_FOLLOW_ALL_SIDES, 0);
+ AddChild(mView);
+ Show();
+
+ // Make sure the window is actually on screen
+ Lock();
+ Sync();
+ mView->SetViewColor(B_TRANSPARENT_COLOR);
+ mView->Sync();
+ Unlock();
+}
+
+CairoTestWindow::~CairoTestWindow()
+{
+ RemoveChild(mView);
+ delete mView;
+}
+
+
+class nsBeOSApp : public BApplication
+{
+public:
+ nsBeOSApp(sem_id sem) : BApplication(GetAppSig()), init(sem)
+ {}
+
+ void ReadyToRun()
+ {
+ release_sem(init);
+ }
+
+ static int32 Main(void *args)
+ {
+ nsBeOSApp *app = new nsBeOSApp( (sem_id)args );
+ if(app == NULL)
+ return B_ERROR;
+ return app->Run();
+ }
+
+private:
+
+ const char *GetAppSig()
+ {
+ return "application/x-vnd.cairo-test-app";
+ }
+
+ sem_id init;
+}; //class nsBeOSApp
+
+class AppRunner
+{
+ public:
+ AppRunner();
+ ~AppRunner();
+};
+
+AppRunner::AppRunner()
+{
+ if (be_app)
+ return;
+
+ sem_id initsem = create_sem(0, "Cairo BApplication init");
+ if (initsem < B_OK) {
+ fprintf (stderr, "Error creating BeOS initialization semaphore\n");
+ return;
+ }
+
+ thread_id tid = spawn_thread(nsBeOSApp::Main, "Cairo/BeOS test", B_NORMAL_PRIORITY, (void *)initsem);
+ if (tid < B_OK || B_OK != resume_thread(tid)) {
+ fprintf (stderr, "Error spawning thread\n");
+ return;
+ }
+
+ if (B_OK != acquire_sem(initsem)) {
+ fprintf (stderr, "Error acquiring semaphore\n");
+ return;
+ }
+
+ delete_sem(initsem);
+ return;
+}
+
+AppRunner::~AppRunner()
+{
+ if (be_app) {
+ if (be_app->Lock())
+ be_app->Quit();
+ delete be_app;
+ be_app = NULL;
+ }
+}
+
+// Make sure that the BApplication is initialized
+static AppRunner sAppRunner;
+
+struct beos_boilerplate_closure {
+ BView* view;
+ BBitmap* bitmap;
+ BWindow* window;
+};
+
+// Test a real window
+static cairo_surface_t *
+_cairo_boilerplate_beos_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ float right = width ? width - 1 : 0;
+ float bottom = height ? height - 1 : 0;
+ BRect rect(0.0, 0.0, right, bottom);
+ CairoTestWindow* wnd = new CairoTestWindow(rect, name);
+
+ beos_boilerplate_closure* bclosure = new beos_boilerplate_closure;
+ bclosure->view = wnd->View();
+ bclosure->bitmap = NULL;
+ bclosure->window = wnd;
+
+ *closure = bclosure;
+
+ return cairo_beos_surface_create(wnd->View());
+}
+
+static void
+_cairo_boilerplate_beos_cleanup (void *closure)
+{
+ beos_boilerplate_closure* bclosure = reinterpret_cast<beos_boilerplate_closure*>(closure);
+
+ bclosure->window->Lock();
+ bclosure->window->Quit();
+
+ delete bclosure;
+}
+
+// Test a bitmap
+static cairo_surface_t *
+_cairo_boilerplate_beos_create_surface_for_bitmap (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ BRect rect(0.0, 0.0, width - 1, height - 1);
+ color_space beosformat = (content == CAIRO_CONTENT_COLOR_ALPHA) ? B_RGBA32
+ : B_RGB32;
+ BBitmap* bmp = new BBitmap(rect, beosformat, true);
+ BView* view = new BView(rect, "Cairo test view", B_FOLLOW_ALL_SIDES, 0);
+ bmp->AddChild(view);
+
+ beos_boilerplate_closure* bclosure = new beos_boilerplate_closure;
+ bclosure->view = view;
+ bclosure->bitmap = bmp;
+ bclosure->window = NULL;
+ *closure = bclosure;
+
+ return cairo_beos_surface_create_for_bitmap(view, bmp);
+}
+
+static void
+_cairo_boilerplate_beos_cleanup_bitmap (void *closure)
+{
+ beos_boilerplate_closure* bclosure = reinterpret_cast<beos_boilerplate_closure*>(closure);
+
+ bclosure->bitmap->RemoveChild(bclosure->view);
+
+
+ delete bclosure->view;
+ delete bclosure->bitmap;
+
+ delete bclosure;
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+ /* BeOS sometimes produces a slightly different image. Perhaps this
+ * is related to the fact that it doesn't use premultiplied alpha...
+ * Just ignore the small difference. */
+ {
+ "beos", "beos", NULL, NULL,
+ CAIRO_SURFACE_TYPE_BEOS, CAIRO_CONTENT_COLOR, 1,
+ _cairo_boilerplate_beos_create_surface,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_beos_cleanup
+ },
+ {
+ "beos-bitmap", "beos", NULL, NULL,
+ CAIRO_SURFACE_TYPE_BEOS, CAIRO_CONTENT_COLOR, 1,
+ _cairo_boilerplate_beos_create_surface_for_bitmap,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_beos_cleanup_bitmap
+ },
+ {
+ "beos-bitmap", "beos", NULL, NULL,
+ CAIRO_SURFACE_TYPE_BEOS, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ _cairo_boilerplate_beos_create_surface_for_bitmap,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_beos_cleanup_bitmap
+ },
+};
+CAIRO_BOILERPLATE (beos, targets)
+
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-cogl.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-cogl.c
new file mode 100644
index 0000000..e39ad33
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-cogl.c
@@ -0,0 +1,206 @@
+/* Cairo - a vector graphics library with display and print output
+ *
+ * Copyright © 2009 Chris Wilson
+ *
+ * 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, 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 Chris Wilson.
+ */
+
+#include "cairo-boilerplate-private.h"
+
+#include <cairo-cogl.h>
+#include <cogl/cogl2-experimental.h>
+
+typedef struct _cogl_closure {
+ cairo_device_t *device;
+ CoglFramebuffer *fb;
+ cairo_surface_t *surface;
+} cogl_closure_t;
+
+static const cairo_user_data_key_t cogl_closure_key;
+
+static CoglContext *context = NULL;
+
+static void
+_cairo_boilerplate_cogl_cleanup (void *abstract_closure)
+{
+ cogl_closure_t *closure = abstract_closure;
+
+ cogl_object_unref (closure->fb);
+
+ cairo_device_finish (closure->device);
+ cairo_device_destroy (closure->device);
+
+ free (closure);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_cogl_create_offscreen_color_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **abstract_closure)
+{
+ cairo_device_t *device;
+ CoglTexture *tex;
+ CoglHandle offscreen;
+ CoglFramebuffer *fb;
+ cogl_closure_t *closure;
+ cairo_status_t status;
+
+ if (!context)
+ context = cogl_context_new (NULL, NULL);
+
+ device = cairo_cogl_device_create (context);
+ tex = cogl_texture_new_with_size (width, height,
+ COGL_TEXTURE_NO_SLICING,
+ COGL_PIXEL_FORMAT_BGRA_8888_PRE);
+ offscreen = cogl_offscreen_new_to_texture (tex);
+ fb = COGL_FRAMEBUFFER (offscreen);
+
+ cogl_framebuffer_allocate (fb, NULL);
+ cogl_push_framebuffer (fb);
+ cogl_ortho (0, cogl_framebuffer_get_width (fb),
+ cogl_framebuffer_get_height (fb), 0,
+ -1, 100);
+ cogl_pop_framebuffer ();
+
+ closure = malloc (sizeof (cogl_closure_t));
+ *abstract_closure = closure;
+ closure->device = device;
+ closure->fb = fb;
+ closure->surface = cairo_cogl_surface_create (device, fb);
+
+ status = cairo_surface_set_user_data (closure->surface,
+ &cogl_closure_key, closure, NULL);
+ if (status == CAIRO_STATUS_SUCCESS)
+ return closure->surface;
+
+ _cairo_boilerplate_cogl_cleanup (closure);
+ return cairo_boilerplate_surface_create_in_error (status);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_cogl_create_onscreen_color_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **abstract_closure)
+{
+ cairo_device_t *device;
+ CoglOnscreen *onscreen;
+ CoglFramebuffer *fb;
+ cogl_closure_t *closure;
+ cairo_status_t status;
+
+ if (!context)
+ context = cogl_context_new (NULL, NULL);
+
+ device = cairo_cogl_device_create (context);
+ onscreen = cogl_onscreen_new (context, width, height);
+ fb = COGL_FRAMEBUFFER (onscreen);
+
+ cogl_onscreen_show (onscreen);
+
+ cogl_push_framebuffer (fb);
+ cogl_ortho (0, cogl_framebuffer_get_width (fb),
+ cogl_framebuffer_get_height (fb), 0,
+ -1, 100);
+ cogl_pop_framebuffer ();
+
+ closure = malloc (sizeof (cogl_closure_t));
+ *abstract_closure = closure;
+ closure->device = device;
+ closure->fb = fb;
+ closure->surface = cairo_cogl_surface_create (device, fb);
+
+ status = cairo_surface_set_user_data (closure->surface,
+ &cogl_closure_key, closure, NULL);
+ if (status == CAIRO_STATUS_SUCCESS)
+ return closure->surface;
+
+ _cairo_boilerplate_cogl_cleanup (closure);
+ return cairo_boilerplate_surface_create_in_error (status);
+}
+
+static cairo_status_t
+_cairo_boilerplate_cogl_finish_onscreen (cairo_surface_t *surface)
+{
+ cogl_closure_t *closure = cairo_surface_get_user_data (surface, &cogl_closure_key);
+
+ cairo_cogl_surface_end_frame (surface);
+
+ cogl_framebuffer_swap_buffers (closure->fb);
+
+ return CAIRO_STATUS_SUCCESS;
+}
+
+static void
+_cairo_boilerplate_cogl_synchronize (void *abstract_closure)
+{
+ cogl_closure_t *closure = abstract_closure;
+ cogl_framebuffer_finish (closure->fb);
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+ {
+ "cogl-offscreen-color", "cogl", NULL, NULL,
+ CAIRO_SURFACE_TYPE_COGL, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_cogl_device_create",
+ _cairo_boilerplate_cogl_create_offscreen_color_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_cogl_cleanup,
+ _cairo_boilerplate_cogl_synchronize,
+ NULL,
+ TRUE, FALSE, FALSE
+ },
+ {
+ "cogl-onscreen-color", "cogl", NULL, NULL,
+ CAIRO_SURFACE_TYPE_COGL, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_cogl_device_create",
+ _cairo_boilerplate_cogl_create_onscreen_color_surface,
+ cairo_surface_create_similar,
+ NULL,
+ _cairo_boilerplate_cogl_finish_onscreen,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_cogl_cleanup,
+ _cairo_boilerplate_cogl_synchronize,
+ NULL,
+ TRUE, FALSE, FALSE
+ }
+};
+CAIRO_BOILERPLATE (cogl, targets)
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-constructors.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-constructors.c
new file mode 100644
index 0000000..b42bb0d
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-constructors.c
@@ -0,0 +1,25 @@
+/* WARNING: Autogenerated file - see ./make-cairo-boilerplate-constructors.sh! */
+
+#include "cairo-boilerplate-private.h"
+
+void _cairo_boilerplate_register_all (void);
+
+extern void _register_builtin (void);
+extern void _register_xlib (void);
+extern void _register_xcb (void);
+extern void _register_script (void);
+extern void _register_ps (void);
+extern void _register_pdf (void);
+extern void _register_svg (void);
+
+void
+_cairo_boilerplate_register_all (void)
+{
+ _register_builtin ();
+ _register_xlib ();
+ _register_xcb ();
+ _register_script ();
+ _register_ps ();
+ _register_pdf ();
+ _register_svg ();
+}
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-directfb.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-directfb.c
new file mode 100644
index 0000000..a479011
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-directfb.c
@@ -0,0 +1,235 @@
+/*
+Test were run with the following script
+target can be directfb_bitmap or directfb
+
+export CAIRO_TEST_TARGET=directfb_bitmap
+export DFBARGS=quiet,no-banner,no-debug,log-file=dfblog,system=x11
+cd cairo/test
+make check
+
+*/
+
+#include "cairo-boilerplate-private.h"
+
+#include <cairo-directfb.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <direct/debug.h>
+
+D_DEBUG_DOMAIN (CairoDFB_Boiler, "CairoDFB/Boiler", "Cairo DirectFB Boilerplate");
+
+/* macro for a safe call to DirectFB functions */
+#define DFBCHECK(x...) do{ \
+ err = x; \
+ if (err != DFB_OK) { \
+ fprintf (stderr, "%s <%d>:\n\t", __FILE__, __LINE__); \
+ goto ERROR; \
+ } \
+} while (0)
+
+typedef struct _DFBInfo {
+ IDirectFB *dfb;
+ IDirectFBDisplayLayer *layer;
+ IDirectFBWindow *window;
+ IDirectFBSurface *surface;
+} DFBInfo;
+
+static void
+_cairo_boilerplate_directfb_cleanup (void *closure)
+{
+ DFBInfo *info = (DFBInfo *) closure;
+
+ if (info->surface)
+ info->surface->Release (info->surface);
+
+ if (info->window)
+ info->window->Release (info->window);
+
+ if (info->layer)
+ info->layer->Release (info->layer);
+
+ if (info->dfb)
+ info->dfb->Release (info->dfb);
+
+ free (info);
+}
+
+static DFBInfo *
+init (void)
+{
+ DFBDisplayLayerConfig layer_config;
+ DFBGraphicsDeviceDescription desc;
+ int err;
+ DFBInfo *info;
+
+ info = xcalloc (1, sizeof (DFBInfo));
+ if (info == NULL)
+ return NULL;
+
+ DFBCHECK (DirectFBInit (NULL, NULL));
+ DFBCHECK (DirectFBCreate (&info->dfb));
+ info->dfb->GetDeviceDescription (info->dfb, &desc);
+
+ DFBCHECK (info->dfb->GetDisplayLayer (info->dfb,
+ DLID_PRIMARY, &info->layer));
+ info->layer->SetCooperativeLevel (info->layer, DLSCL_ADMINISTRATIVE);
+
+ if ((desc.blitting_flags & (DSBLIT_BLEND_ALPHACHANNEL |
+ DSBLIT_BLEND_COLORALPHA)) !=
+ (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA))
+ {
+ layer_config.flags = DLCONF_BUFFERMODE;
+ layer_config.buffermode = DLBM_BACKSYSTEM;
+ info->layer->SetConfiguration (info->layer, &layer_config);
+ }
+
+ return info;
+
+ERROR:
+ if (info != NULL)
+ _cairo_boilerplate_directfb_cleanup (info);
+ return NULL;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_directfb_window_create_surface (DFBInfo *info,
+ cairo_content_t content,
+ int width,
+ int height)
+{
+ DFBWindowDescription desc;
+ int err;
+
+ D_DEBUG_AT (CairoDFB_Boiler, "%s (%p, %s, %dx%d)\n", __FUNCTION__, info,
+ content == CAIRO_CONTENT_ALPHA ? "ALPHA" :
+ content == CAIRO_CONTENT_COLOR ? "RGB" :
+ content == CAIRO_CONTENT_COLOR_ALPHA ? "ARGB" : "unknown content!",
+ width, height);
+
+ desc.flags = DWDESC_POSX | DWDESC_POSY |
+ DWDESC_WIDTH | DWDESC_HEIGHT;
+ desc.caps = DSCAPS_NONE;
+ desc.posx = 0;
+ desc.posy = 0;
+ desc.width = width;
+ desc.height = height;
+ if (content == CAIRO_CONTENT_COLOR_ALPHA) {
+ desc.flags |= DWDESC_CAPS | DWDESC_PIXELFORMAT;
+ desc.caps |= DWCAPS_DOUBLEBUFFER | DWCAPS_ALPHACHANNEL;
+ desc.pixelformat = DSPF_ARGB;
+ }
+
+ DFBCHECK (info->layer->CreateWindow (info->layer, &desc, &info->window));
+ info->window->SetOpacity (info->window, 0xFF);
+ info->window->GetSurface (info->window, &info->surface);
+ info->surface->SetColor (info->surface, 0xFF, 0xFF, 0xFF, 0xFF);
+ info->surface->FillRectangle (info->surface,0, 0, desc.width, desc.height);
+ info->surface->Flip (info->surface, NULL, 0);
+
+ return cairo_directfb_surface_create (info->dfb, info->surface);
+
+ERROR:
+ _cairo_boilerplate_directfb_cleanup (info);
+ return NULL;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_directfb_bitmap_create_surface (DFBInfo *info,
+ cairo_content_t content,
+ int width,
+ int height)
+{
+ int err;
+ DFBSurfaceDescription desc;
+
+ D_DEBUG_AT (CairoDFB_Boiler, "%s (%p, %s, %dx%d)\n", __FUNCTION__, info,
+ content == CAIRO_CONTENT_ALPHA ? "ALPHA" :
+ content == CAIRO_CONTENT_COLOR ? "RGB" :
+ content == CAIRO_CONTENT_COLOR_ALPHA ? "ARGB" : "unknown content!",
+ width, height);
+
+ desc.flags = DSDESC_WIDTH | DSDESC_HEIGHT;
+ desc.caps = DSCAPS_NONE;
+ desc.width = width;
+ desc.height = height;
+ if (content == CAIRO_CONTENT_COLOR_ALPHA) {
+ desc.flags |= DSDESC_PIXELFORMAT;
+ desc.pixelformat = DSPF_ARGB;
+ }
+ DFBCHECK (info->dfb->CreateSurface (info->dfb, &desc, &info->surface));
+
+ return cairo_directfb_surface_create (info->dfb, info->surface);
+
+ERROR:
+ _cairo_boilerplate_directfb_cleanup (info);
+ return NULL;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_directfb_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+
+ DFBInfo *info;
+
+ info = init ();
+ if (info == NULL)
+ return NULL;
+
+ *closure = info;
+
+ D_DEBUG_AT (CairoDFB_Boiler, "%s ('%s', %s, %dx%d, %s)\n",
+ __FUNCTION__, name,
+ content == CAIRO_CONTENT_ALPHA ? "ALPHA" :
+ content == CAIRO_CONTENT_COLOR ? "RGB" :
+ content == CAIRO_CONTENT_COLOR_ALPHA ? "ARGB" : "unknown content!",
+ width, height,
+ mode == CAIRO_BOILERPLATE_MODE_TEST ? "TEST" :
+ mode == CAIRO_BOILERPLATE_MODE_PERF ? "PERF" : "unknown mode!");
+
+ if (width == 0)
+ width = 1;
+ if (height == 0)
+ height = 1;
+
+ if (mode == CAIRO_BOILERPLATE_MODE_TEST)
+ return _cairo_boilerplate_directfb_bitmap_create_surface (info, content, width, height);
+ else /* mode == CAIRO_BOILERPLATE_MODE_PERF */
+ return _cairo_boilerplate_directfb_window_create_surface (info, content, width, height);
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+ {
+ "directfb", "directfb", NULL, NULL,
+ CAIRO_SURFACE_TYPE_DIRECTFB, CAIRO_CONTENT_COLOR, 0,
+ "cairo_directfb_surface_create",
+ _cairo_boilerplate_directfb_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_directfb_cleanup,
+ NULL, NULL, TRUE, FALSE, FALSE
+ },
+ {
+ "directfb-bitmap", "directfb", NULL, NULL,
+ CAIRO_SURFACE_TYPE_DIRECTFB, CAIRO_CONTENT_COLOR_ALPHA, 0,
+ "cairo_directfb_surface_create",
+ _cairo_boilerplate_directfb_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_directfb_cleanup,
+ NULL, NULL, FALSE, FALSE, FALSE
+ },
+};
+CAIRO_BOILERPLATE (directfb, targets);
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-drm.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-drm.c
new file mode 100644
index 0000000..79d9229
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-drm.c
@@ -0,0 +1,112 @@
+/* Cairo - a vector graphics library with display and print output
+ *
+ * Copyright © 2009 Chris Wilson
+ *
+ * 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, 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 Chris Wilson.
+ */
+
+#include "cairo-boilerplate-private.h"
+
+#include <cairo-drm.h>
+
+static cairo_surface_t *
+_cairo_boilerplate_drm_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ cairo_device_t *device;
+ cairo_format_t format;
+
+ device = cairo_drm_device_default ();
+ if (device == NULL)
+ return NULL; /* skip tests if no supported h/w found */
+
+ switch (content) {
+ case CAIRO_CONTENT_ALPHA:
+ format = CAIRO_FORMAT_A8;
+ break;
+ case CAIRO_CONTENT_COLOR:
+ format = CAIRO_FORMAT_RGB24;
+ break;
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ default:
+ format = CAIRO_FORMAT_ARGB32;
+ break;
+ }
+
+ return *closure = cairo_drm_surface_create (device, format, width, height);
+}
+
+static void
+_cairo_boilerplate_drm_synchronize (void *closure)
+{
+ cairo_surface_t *image;
+
+ image = cairo_drm_surface_map_to_image (closure);
+ if (cairo_surface_status (image) == CAIRO_STATUS_SUCCESS)
+ cairo_drm_surface_unmap (closure, image);
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+ /* Acceleration architectures may make the results differ by a
+ * bit, so we set the error tolerance to 1. */
+ {
+ "drm", "drm", NULL, NULL,
+ CAIRO_SURFACE_TYPE_DRM, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_drm_surface_create",
+ _cairo_boilerplate_drm_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL,
+ _cairo_boilerplate_drm_synchronize,
+ NULL,
+ TRUE, FALSE, FALSE
+ },
+ {
+ "drm", "drm", NULL, NULL,
+ CAIRO_SURFACE_TYPE_DRM, CAIRO_CONTENT_COLOR, 1,
+ "cairo_drm_surface_create",
+ _cairo_boilerplate_drm_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL,
+ _cairo_boilerplate_drm_synchronize,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+};
+CAIRO_BOILERPLATE (drm, targets)
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-egl.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-egl.c
new file mode 100644
index 0000000..c44441c
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-egl.c
@@ -0,0 +1,194 @@
+/* Cairo - a vector graphics library with display and print output
+ *
+ * Copyright © 2009 Chris Wilson
+ *
+ * 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, 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 Chris Wilson.
+ */
+
+#include "cairo-boilerplate-private.h"
+
+#include <cairo-gl.h>
+#if CAIRO_HAS_GLESV3_SURFACE
+#include <GLES3/gl3.h>
+#include <EGL/eglext.h>
+#elif CAIRO_HAS_GLESV2_SURFACE
+#include <GLES2/gl2.h>
+#elif CAIRO_HAS_GL_SURFACE
+#include <GL/gl.h>
+#endif
+
+static const cairo_user_data_key_t gl_closure_key;
+
+typedef struct _egl_target_closure {
+ EGLDisplay dpy;
+ EGLContext ctx;
+
+ cairo_device_t *device;
+ cairo_surface_t *surface;
+} egl_target_closure_t;
+
+static void
+_cairo_boilerplate_egl_cleanup (void *closure)
+{
+ egl_target_closure_t *gltc = closure;
+
+ cairo_device_finish (gltc->device);
+ cairo_device_destroy (gltc->device);
+
+ eglDestroyContext (gltc->dpy, gltc->ctx);
+ eglMakeCurrent (gltc->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+ eglTerminate (gltc->dpy);
+
+ free (gltc);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_egl_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ egl_target_closure_t *gltc;
+ cairo_surface_t *surface;
+ int major, minor;
+ EGLConfig config;
+ EGLint numConfigs;
+ EGLint config_attribs[] = {
+ EGL_RED_SIZE, 8,
+ EGL_GREEN_SIZE, 8,
+ EGL_BLUE_SIZE, 8,
+ EGL_ALPHA_SIZE, 8,
+ EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
+#if CAIRO_HAS_GLESV3_SURFACE
+ EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT_KHR,
+#elif CAIRO_HAS_GLESV2_SURFACE
+ EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+#elif CAIRO_HAS_GL_SURFACE
+ EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
+#endif
+ EGL_NONE
+ };
+ const EGLint ctx_attribs[] = {
+#if CAIRO_HAS_GLESV3_SURFACE
+ EGL_CONTEXT_CLIENT_VERSION, 3,
+#elif CAIRO_HAS_GLESV2_SURFACE
+ EGL_CONTEXT_CLIENT_VERSION, 2,
+#endif
+ EGL_NONE
+ };
+
+ gltc = xcalloc (1, sizeof (egl_target_closure_t));
+ *closure = gltc;
+
+ gltc->dpy = eglGetDisplay (EGL_DEFAULT_DISPLAY);
+
+ if (! eglInitialize (gltc->dpy, &major, &minor)) {
+ free (gltc);
+ return NULL;
+ }
+
+ eglChooseConfig (gltc->dpy, config_attribs, &config, 1, &numConfigs);
+#if CAIRO_HAS_GLESV3_SURFACE && CAIRO_HAS_GLESV2_SURFACE
+ if (numConfigs == 0) {
+ /* retry with ES2_BIT */
+ config_attribs[11] = ES2_BIT; /* FIXME: Ick */
+ eglChooseConfig (gltc->dpy, config_attribs, &config, 1, &numConfigs);
+ }
+#endif
+ if (numConfigs == 0) {
+ free (gltc);
+ return NULL;
+ }
+
+#if CAIRO_HAS_GLESV3_SURFACE || CAIRO_HAS_GLESV2_SURFACE
+ eglBindAPI (EGL_OPENGL_ES_API);
+#elif CAIRO_HAS_GL_SURFACE
+ eglBindAPI (EGL_OPENGL_API);
+#endif
+
+ gltc->ctx = eglCreateContext (gltc->dpy, config, EGL_NO_CONTEXT,
+ ctx_attribs);
+ if (gltc->ctx == EGL_NO_CONTEXT) {
+ eglTerminate (gltc->dpy);
+ free (gltc);
+ return NULL;
+ }
+
+ gltc->device = cairo_egl_device_create (gltc->dpy, gltc->ctx);
+ if (mode == CAIRO_BOILERPLATE_MODE_PERF)
+ cairo_gl_device_set_thread_aware(gltc->device, FALSE);
+
+ if (width < 1)
+ width = 1;
+ if (height < 1)
+ height = 1;
+
+ gltc->surface = surface = cairo_gl_surface_create (gltc->device,
+ content,
+ ceil (width),
+ ceil (height));
+ if (cairo_surface_status (surface))
+ _cairo_boilerplate_egl_cleanup (gltc);
+
+ return surface;
+}
+
+static void
+_cairo_boilerplate_egl_synchronize (void *closure)
+{
+ egl_target_closure_t *gltc = closure;
+
+ if (cairo_device_acquire (gltc->device))
+ return;
+
+ glFinish ();
+
+ cairo_device_release (gltc->device);
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+ {
+ "egl", "gl", NULL, NULL,
+ CAIRO_SURFACE_TYPE_GL, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_egl_device_create",
+ _cairo_boilerplate_egl_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_egl_cleanup,
+ _cairo_boilerplate_egl_synchronize,
+ NULL,
+ TRUE, FALSE, FALSE
+ }
+};
+CAIRO_BOILERPLATE (egl, targets)
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-getopt.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-getopt.c
new file mode 100644
index 0000000..53b150c
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-getopt.c
@@ -0,0 +1,247 @@
+/*****************************************************************************
+* getopt.c - competent and free getopt library.
+* $Header: /cvsroot/freegetopt/freegetopt/getopt.c,v 1.2 2003/10/26 03:10:20 vindaci Exp $
+*
+* Copyright (c)2002-2003 Mark K. Kim
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+*
+* * Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in
+* the documentation and/or other materials provided with the
+* distribution.
+*
+* * Neither the original author of this software nor the names of its
+* contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+* DAMAGE.
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "cairo-boilerplate-getopt.h"
+
+
+char* optarg = NULL;
+int optind = 0;
+int opterr = 1;
+int optopt = '?';
+
+
+static char** prev_argv = NULL; /* Keep a copy of argv and argc to */
+static int prev_argc = 0; /* tell if getopt params change */
+static int argv_index = 0; /* Option we're checking */
+static int argv_index2 = 0; /* Option argument we're checking */
+static int opt_offset = 0; /* Index into compounded "-option" */
+static int dashdash = 0; /* True if "--" option reached */
+static int nonopt = 0; /* How many nonopts we've found */
+
+static void increment_index(void)
+{
+ /* Move onto the next option */
+ if(argv_index < argv_index2)
+ {
+ while(prev_argv[++argv_index] && prev_argv[argv_index][0] != '-'
+ && argv_index < argv_index2+1);
+ }
+ else argv_index++;
+ opt_offset = 1;
+}
+
+
+/*
+* Permutes argv[] so that the argument currently being processed is moved
+* to the end.
+*/
+static int permute_argv_once(void)
+{
+ /* Movability check */
+ if(argv_index + nonopt >= prev_argc) return 1;
+ /* Move the current option to the end, bring the others to front */
+ else
+ {
+ char* tmp = prev_argv[argv_index];
+
+ /* Move the data */
+ memmove(&prev_argv[argv_index], &prev_argv[argv_index+1],
+ sizeof(char**) * (prev_argc - argv_index - 1));
+ prev_argv[prev_argc - 1] = tmp;
+
+ nonopt++;
+ return 0;
+ }
+}
+
+
+int _cairo_getopt(int argc, char** argv, const char* optstr)
+{
+ int c = 0;
+
+ /* If we have new argv, reinitialize */
+ if(prev_argv != argv || prev_argc != argc)
+ {
+ /* Initialize variables */
+ prev_argv = argv;
+ prev_argc = argc;
+ argv_index = 1;
+ argv_index2 = 1;
+ opt_offset = 1;
+ dashdash = 0;
+ nonopt = 0;
+ }
+
+ /* Jump point in case we want to ignore the current argv_index */
+ getopt_top:
+
+ /* Misc. initializations */
+ optarg = NULL;
+
+ /* Dash-dash check */
+ if(argv[argv_index] && !strcmp(argv[argv_index], "--"))
+ {
+ dashdash = 1;
+ increment_index();
+ }
+
+ /* If we're at the end of argv, that's it. */
+ if(argv[argv_index] == NULL)
+ {
+ c = -1;
+ }
+ /* Are we looking at a string? Single dash is also a string */
+ else if(dashdash || argv[argv_index][0] != '-' || !strcmp(argv[argv_index], "-"))
+ {
+ /* If we want a string... */
+ if(optstr[0] == '-')
+ {
+ c = 1;
+ optarg = argv[argv_index];
+ increment_index();
+ }
+ /* If we really don't want it (we're in POSIX mode), we're done */
+ else if(optstr[0] == '+' || getenv("POSIXLY_CORRECT"))
+ {
+ c = -1;
+
+ /* Everything else is a non-opt argument */
+ nonopt = argc - argv_index;
+ }
+ /* If we mildly don't want it, then move it back */
+ else
+ {
+ if(!permute_argv_once()) goto getopt_top;
+ else c = -1;
+ }
+ }
+ /* Otherwise we're looking at an option */
+ else
+ {
+ char* opt_ptr = NULL;
+
+ /* Grab the option */
+ c = argv[argv_index][opt_offset++];
+
+ /* Is the option in the optstr? */
+ if(optstr[0] == '-') opt_ptr = strchr(optstr+1, c);
+ else opt_ptr = strchr(optstr, c);
+ /* Invalid argument */
+ if(!opt_ptr)
+ {
+ if(opterr)
+ {
+ fprintf(stderr, "%s: invalid option -- %c\n", argv[0], c);
+ }
+
+ optopt = c;
+ c = '?';
+
+ /* Move onto the next option */
+ increment_index();
+ }
+ /* Option takes argument */
+ else if(opt_ptr[1] == ':')
+ {
+ /* ie, -oARGUMENT, -xxxoARGUMENT, etc. */
+ if(argv[argv_index][opt_offset] != '\0')
+ {
+ optarg = &argv[argv_index][opt_offset];
+ increment_index();
+ }
+ /* ie, -o ARGUMENT (only if it's a required argument) */
+ else if(opt_ptr[2] != ':')
+ {
+ /* One of those "you're not expected to understand this" moment */
+ if(argv_index2 < argv_index) argv_index2 = argv_index;
+ while(argv[++argv_index2] && argv[argv_index2][0] == '-');
+ optarg = argv[argv_index2];
+
+ /* Don't cross into the non-option argument list */
+ if(argv_index2 + nonopt >= prev_argc) optarg = NULL;
+
+ /* Move onto the next option */
+ increment_index();
+ }
+ else
+ {
+ /* Move onto the next option */
+ increment_index();
+ }
+
+ /* In case we got no argument for an option with required argument */
+ if(optarg == NULL && opt_ptr[2] != ':')
+ {
+ optopt = c;
+ c = '?';
+
+ if(opterr)
+ {
+ fprintf(stderr,"%s: option requires an argument -- %c\n",
+ argv[0], optopt);
+ }
+ }
+ }
+ /* Option does not take argument */
+ else
+ {
+ /* Next argv_index */
+ if(argv[argv_index][opt_offset] == '\0')
+ {
+ increment_index();
+ }
+ }
+ }
+
+ /* Calculate optind */
+ if(c == -1)
+ {
+ optind = argc - nonopt;
+ }
+ else
+ {
+ optind = argv_index;
+ }
+
+ return c;
+}
+
+
+/* vim:ts=3
+*/
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-getopt.h b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-getopt.h
new file mode 100644
index 0000000..74bce14
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-getopt.h
@@ -0,0 +1,63 @@
+/*****************************************************************************
+* getopt.h - competent and free getopt library.
+* $Header: /cvsroot/freegetopt/freegetopt/getopt.h,v 1.2 2003/10/26 03:10:20 vindaci Exp $
+*
+* Copyright (c)2002-2003 Mark K. Kim
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+*
+* * Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in
+* the documentation and/or other materials provided with the
+* distribution.
+*
+* * Neither the original author of this software nor the names of its
+* contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+* DAMAGE.
+*/
+#ifndef GETOPT_H_
+#define GETOPT_H_
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+extern char* optarg;
+extern int optind;
+extern int opterr;
+extern int optopt;
+
+int _cairo_getopt(int argc, char** argv, const char* optstr);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* GETOPT_H_ */
+
+
+/* vim:ts=3
+*/
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-glx.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-glx.c
new file mode 100644
index 0000000..7701d90
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-glx.c
@@ -0,0 +1,457 @@
+/* Cairo - a vector graphics library with display and print output
+ *
+ * Copyright © 2009 Chris Wilson
+ *
+ * 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, 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 Chris Wilson.
+ */
+
+#include "cairo-boilerplate-private.h"
+
+#include <cairo-gl.h>
+
+#include <X11/X.h>
+#include <X11/Xutil.h> /* for XDestroyImage */
+
+static const cairo_user_data_key_t gl_closure_key;
+
+typedef struct _gl_target_closure {
+ Display *dpy;
+ int screen;
+ Window drawable;
+
+ GLXContext ctx;
+ cairo_device_t *device;
+ cairo_surface_t *surface;
+} gl_target_closure_t;
+
+static void
+_cairo_boilerplate_gl_cleanup (void *closure)
+{
+ gl_target_closure_t *gltc = closure;
+
+ cairo_device_finish (gltc->device);
+ cairo_device_destroy (gltc->device);
+
+ glXDestroyContext (gltc->dpy, gltc->ctx);
+
+ if (gltc->drawable)
+ XDestroyWindow (gltc->dpy, gltc->drawable);
+ XCloseDisplay (gltc->dpy);
+
+ free (gltc);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_gl_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ int rgba_attribs[] = { GLX_RGBA,
+ GLX_RED_SIZE, 1,
+ GLX_GREEN_SIZE, 1,
+ GLX_BLUE_SIZE, 1,
+ GLX_ALPHA_SIZE, 1,
+ GLX_DOUBLEBUFFER,
+ None };
+ int rgb_attribs[] = { GLX_RGBA,
+ GLX_RED_SIZE, 1,
+ GLX_GREEN_SIZE, 1,
+ GLX_BLUE_SIZE, 1,
+ GLX_DOUBLEBUFFER,
+ None };
+ XVisualInfo *visinfo;
+ GLXContext ctx;
+ gl_target_closure_t *gltc;
+ cairo_surface_t *surface;
+ Display *dpy;
+
+ gltc = calloc (1, sizeof (gl_target_closure_t));
+ *closure = gltc;
+
+ width = ceil (width);
+ height = ceil (height);
+
+ if (width == 0)
+ width = 1;
+ if (height == 0)
+ height = 1;
+
+ dpy = XOpenDisplay (NULL);
+ gltc->dpy = dpy;
+ if (!gltc->dpy) {
+ fprintf (stderr, "Failed to open display: %s\n", XDisplayName(0));
+ free (gltc);
+ return NULL;
+ }
+
+ if (mode == CAIRO_BOILERPLATE_MODE_TEST)
+ XSynchronize (gltc->dpy, 1);
+
+ if (content == CAIRO_CONTENT_COLOR)
+ visinfo = glXChooseVisual (dpy, DefaultScreen (dpy), rgb_attribs);
+ else
+ visinfo = glXChooseVisual (dpy, DefaultScreen (dpy), rgba_attribs);
+
+ if (visinfo == NULL) {
+ fprintf (stderr, "Failed to create RGB, double-buffered visual\n");
+ XCloseDisplay (dpy);
+ free (gltc);
+ return NULL;
+ }
+
+ ctx = glXCreateContext (dpy, visinfo, NULL, True);
+ XFree (visinfo);
+
+ gltc->ctx = ctx;
+ gltc->device = cairo_glx_device_create (dpy, ctx);
+
+ if (mode == CAIRO_BOILERPLATE_MODE_PERF)
+ cairo_gl_device_set_thread_aware(gltc->device, FALSE);
+
+ gltc->surface = surface = cairo_gl_surface_create (gltc->device,
+ content, width, height);
+ if (cairo_surface_status (surface))
+ _cairo_boilerplate_gl_cleanup (gltc);
+
+ return surface;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_gl_create_window_common (int rgba_attribs[],
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ gl_target_closure_t *gltc)
+{
+ XVisualInfo *vi;
+ GLXContext ctx;
+ cairo_surface_t *surface;
+ Display *dpy;
+ XSetWindowAttributes attr;
+
+ width = ceil (width);
+ height = ceil (height);
+
+ if (width == 0)
+ width = 1;
+ if (height == 0)
+ height = 1;
+
+ dpy = XOpenDisplay (NULL);
+ gltc->dpy = dpy;
+ if (!gltc->dpy) {
+ fprintf (stderr, "Failed to open display: %s\n", XDisplayName(0));
+ free (gltc);
+ return NULL;
+ }
+
+ if (mode == CAIRO_BOILERPLATE_MODE_TEST)
+ XSynchronize (gltc->dpy, 1);
+
+ vi = glXChooseVisual (dpy, DefaultScreen (dpy), rgba_attribs);
+ if (vi == NULL) {
+ fprintf (stderr, "Failed to create RGBA, double-buffered visual\n");
+ XCloseDisplay (dpy);
+ free (gltc);
+ return NULL;
+ }
+
+ attr.colormap = XCreateColormap (dpy,
+ RootWindow (dpy, vi->screen),
+ vi->visual,
+ AllocNone);
+ attr.border_pixel = 0;
+ attr.override_redirect = True;
+ gltc->drawable = XCreateWindow (dpy, DefaultRootWindow (dpy), 0, 0,
+ width, height, 0, vi->depth,
+ InputOutput, vi->visual,
+ CWOverrideRedirect | CWBorderPixel | CWColormap,
+ &attr);
+ XMapWindow (dpy, gltc->drawable);
+
+ ctx = glXCreateContext (dpy, vi, NULL, True);
+ XFree (vi);
+
+ gltc->ctx = ctx;
+ gltc->device = cairo_glx_device_create (dpy, ctx);
+
+ gltc->surface = surface = cairo_gl_surface_create_for_window (gltc->device,
+ gltc->drawable,
+ width, height);
+ if (cairo_surface_status (surface)) {
+ _cairo_boilerplate_gl_cleanup (gltc);
+ return NULL;
+ }
+ return surface;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_gl_create_window (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ gl_target_closure_t *gltc;
+
+ int rgba_attribs[] = { GLX_RGBA,
+ GLX_RED_SIZE, 1,
+ GLX_GREEN_SIZE, 1,
+ GLX_BLUE_SIZE, 1,
+ GLX_ALPHA_SIZE, 1,
+ GLX_DOUBLEBUFFER,
+ GLX_NONE };
+
+ gltc = calloc (1, sizeof (gl_target_closure_t));
+ *closure = gltc;
+
+ return _cairo_boilerplate_gl_create_window_common (rgba_attribs, content,
+ width, height,
+ max_width, max_height,
+ mode, gltc);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_gl_create_window_msaa (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ gl_target_closure_t *gltc;
+
+ int rgba_attribs[] = { GLX_RGBA,
+ GLX_RED_SIZE, 1,
+ GLX_GREEN_SIZE, 1,
+ GLX_BLUE_SIZE, 1,
+ GLX_ALPHA_SIZE, 1,
+ GLX_STENCIL_SIZE, 1,
+ GLX_SAMPLES, 4,
+ GLX_SAMPLE_BUFFERS, 1,
+ GLX_DOUBLEBUFFER,
+ GLX_NONE };
+
+ gltc = calloc (1, sizeof (gl_target_closure_t));
+ *closure = gltc;
+ return _cairo_boilerplate_gl_create_window_common (rgba_attribs, content,
+ width, height,
+ max_width, max_height,
+ mode, gltc);
+
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_gl_create_window_db (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ cairo_status_t status;
+ cairo_surface_t *surface;
+ gl_target_closure_t *gltc;
+
+ int rgba_attribs[] = { GLX_RGBA,
+ GLX_RED_SIZE, 1,
+ GLX_GREEN_SIZE, 1,
+ GLX_BLUE_SIZE, 1,
+ GLX_ALPHA_SIZE, 1,
+ GLX_DOUBLEBUFFER,
+ GLX_NONE };
+
+ gltc = calloc (1, sizeof (gl_target_closure_t));
+ *closure = gltc;
+
+ surface = _cairo_boilerplate_gl_create_window_common (rgba_attribs, content,
+ width, height,
+ max_width, max_height,
+ mode, gltc);
+
+ if (! surface)
+ return NULL;
+
+ surface = cairo_surface_create_similar (gltc->surface, content, width, height);
+ status = cairo_surface_set_user_data (surface, &gl_closure_key, gltc, NULL);
+ if (status == CAIRO_STATUS_SUCCESS)
+ return surface;
+
+ cairo_surface_destroy (surface);
+ _cairo_boilerplate_gl_cleanup (gltc);
+ return cairo_boilerplate_surface_create_in_error (status);
+}
+
+static cairo_status_t
+_cairo_boilerplate_gl_finish_window (cairo_surface_t *surface)
+{
+ gl_target_closure_t *gltc = cairo_surface_get_user_data (surface,
+ &gl_closure_key);
+
+ if (gltc != NULL && gltc->surface != NULL) {
+ cairo_t *cr;
+
+ cr = cairo_create (gltc->surface);
+ cairo_surface_set_device_offset (surface, 0, 0);
+ cairo_set_source_surface (cr, surface, 0, 0);
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+ cairo_paint (cr);
+ cairo_destroy (cr);
+
+ surface = gltc->surface;
+ }
+
+ cairo_gl_surface_swapbuffers (surface);
+ return CAIRO_STATUS_SUCCESS;
+}
+
+static void
+_cairo_boilerplate_gl_synchronize (void *closure)
+{
+ gl_target_closure_t *gltc = closure;
+
+ if (cairo_device_acquire (gltc->device))
+ return;
+
+ glFinish ();
+
+ cairo_device_release (gltc->device);
+}
+
+static char *
+_cairo_boilerplate_gl_describe (void *closure)
+{
+ gl_target_closure_t *gltc = closure;
+ char *s;
+ const GLubyte *vendor, *renderer, *version;
+
+ if (cairo_device_acquire (gltc->device))
+ return NULL;
+
+ vendor = glGetString (GL_VENDOR);
+ renderer = glGetString (GL_RENDERER);
+ version = glGetString (GL_VERSION);
+
+ xasprintf (&s, "%s %s %s", vendor, renderer, version);
+
+ cairo_device_release (gltc->device);
+
+ return s;
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+ {
+ "gl", "gl", NULL, NULL,
+ CAIRO_SURFACE_TYPE_GL, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_gl_surface_create",
+ _cairo_boilerplate_gl_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_gl_cleanup,
+ _cairo_boilerplate_gl_synchronize,
+ _cairo_boilerplate_gl_describe,
+ TRUE, FALSE, FALSE
+ },
+ {
+ "gl", "gl", NULL, NULL,
+ CAIRO_SURFACE_TYPE_GL, CAIRO_CONTENT_COLOR, 1,
+ "cairo_gl_surface_create",
+ _cairo_boilerplate_gl_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_gl_cleanup,
+ _cairo_boilerplate_gl_synchronize,
+ _cairo_boilerplate_gl_describe,
+ FALSE, FALSE, FALSE
+ },
+ {
+ "gl-window", "gl", NULL, NULL,
+ CAIRO_SURFACE_TYPE_GL, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_gl_surface_create_for_window",
+ _cairo_boilerplate_gl_create_window,
+ cairo_surface_create_similar,
+ NULL,
+ _cairo_boilerplate_gl_finish_window,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_gl_cleanup,
+ _cairo_boilerplate_gl_synchronize,
+ _cairo_boilerplate_gl_describe,
+ FALSE, FALSE, FALSE
+ },
+ {
+ "gl-window-msaa", "gl", NULL, NULL,
+ CAIRO_SURFACE_TYPE_GL, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_gl_surface_create_for_window",
+ _cairo_boilerplate_gl_create_window_msaa,
+ cairo_surface_create_similar,
+ NULL,
+ _cairo_boilerplate_gl_finish_window,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_gl_cleanup,
+ _cairo_boilerplate_gl_synchronize,
+ _cairo_boilerplate_gl_describe,
+ FALSE, FALSE, FALSE
+ },
+ {
+ "gl-window&", "gl", NULL, NULL,
+ CAIRO_SURFACE_TYPE_GL, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_gl_surface_create_for_window",
+ _cairo_boilerplate_gl_create_window_db,
+ cairo_surface_create_similar,
+ NULL,
+ _cairo_boilerplate_gl_finish_window,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_gl_cleanup,
+ _cairo_boilerplate_gl_synchronize,
+ _cairo_boilerplate_gl_describe,
+ FALSE, FALSE, FALSE
+ },
+};
+CAIRO_BOILERPLATE (gl, targets)
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-pdf.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-pdf.c
new file mode 100644
index 0000000..c6c6b63
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-pdf.c
@@ -0,0 +1,279 @@
+/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
+/*
+ * Copyright © 2004,2006 Red Hat, Inc.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Author: Carl D. Worth <cworth@cworth.org>
+ */
+
+#include "cairo-boilerplate-private.h"
+
+#if CAIRO_CAN_TEST_PDF_SURFACE
+
+#include <cairo-pdf.h>
+#include <cairo-pdf-surface-private.h>
+#include <cairo-paginated-surface-private.h>
+
+#if HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+
+#if HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#if ! CAIRO_HAS_RECORDING_SURFACE
+#define CAIRO_SURFACE_TYPE_RECORDING CAIRO_INTERNAL_SURFACE_TYPE_RECORDING
+#endif
+
+static const cairo_user_data_key_t pdf_closure_key;
+
+typedef struct _pdf_target_closure
+{
+ char *filename;
+ int width;
+ int height;
+ cairo_surface_t *target;
+} pdf_target_closure_t;
+
+static cairo_surface_t *
+_cairo_boilerplate_pdf_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ pdf_target_closure_t *ptc;
+ cairo_surface_t *surface;
+ cairo_status_t status;
+
+ /* Sanitize back to a real cairo_content_t value. */
+ if (content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED)
+ content = CAIRO_CONTENT_COLOR_ALPHA;
+
+ *closure = ptc = xmalloc (sizeof (pdf_target_closure_t));
+
+ ptc->width = ceil (width);
+ ptc->height = ceil (height);
+
+ xasprintf (&ptc->filename, "%s.out.pdf", name);
+ xunlink (ptc->filename);
+
+ surface = cairo_pdf_surface_create (ptc->filename, width, height);
+ if (cairo_surface_status (surface))
+ goto CLEANUP_FILENAME;
+
+ cairo_pdf_surface_set_metadata (surface, CAIRO_PDF_METADATA_CREATE_DATE, NULL);
+ cairo_surface_set_fallback_resolution (surface, 72., 72.);
+
+ if (content == CAIRO_CONTENT_COLOR) {
+ ptc->target = surface;
+ surface = cairo_surface_create_similar (ptc->target,
+ CAIRO_CONTENT_COLOR,
+ ptc->width, ptc->height);
+ if (cairo_surface_status (surface))
+ goto CLEANUP_TARGET;
+ } else {
+ ptc->target = NULL;
+ }
+
+ status = cairo_surface_set_user_data (surface, &pdf_closure_key, ptc, NULL);
+ if (status == CAIRO_STATUS_SUCCESS)
+ return surface;
+
+ cairo_surface_destroy (surface);
+ surface = cairo_boilerplate_surface_create_in_error (status);
+
+ CLEANUP_TARGET:
+ cairo_surface_destroy (ptc->target);
+ CLEANUP_FILENAME:
+ free (ptc->filename);
+ free (ptc);
+ return surface;
+}
+
+static cairo_status_t
+_cairo_boilerplate_pdf_finish_surface (cairo_surface_t *surface)
+{
+ pdf_target_closure_t *ptc = cairo_surface_get_user_data (surface,
+ &pdf_closure_key);
+ cairo_status_t status;
+
+ /* Both surface and ptc->target were originally created at the
+ * same dimensions. We want a 1:1 copy here, so we first clear any
+ * device offset on surface.
+ *
+ * In a more realistic use case of device offsets, the target of
+ * this copying would be of a different size than the source, and
+ * the offset would be desirable during the copy operation. */
+ cairo_surface_set_device_offset (surface, 0, 0);
+
+ if (ptc->target) {
+ cairo_t *cr;
+ cr = cairo_create (ptc->target);
+ cairo_set_source_surface (cr, surface, 0, 0);
+ cairo_paint (cr);
+ cairo_show_page (cr);
+ status = cairo_status (cr);
+ cairo_destroy (cr);
+
+ if (status)
+ return status;
+
+ cairo_surface_finish (surface);
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
+
+ surface = ptc->target;
+ }
+
+ cairo_surface_finish (surface);
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
+
+ return CAIRO_STATUS_SUCCESS;
+}
+
+static cairo_status_t
+_cairo_boilerplate_pdf_surface_write_to_png (cairo_surface_t *surface,
+ const char *filename)
+{
+ pdf_target_closure_t *ptc = cairo_surface_get_user_data (surface, &pdf_closure_key);
+ char command[4096];
+ int exitstatus;
+
+ sprintf (command, "./pdf2png %s %s 1",
+ ptc->filename, filename);
+
+ exitstatus = system (command);
+#if _XOPEN_SOURCE && HAVE_SIGNAL_H
+ if (WIFSIGNALED (exitstatus))
+ raise (WTERMSIG (exitstatus));
+#endif
+ if (exitstatus)
+ return CAIRO_STATUS_WRITE_ERROR;
+
+ return CAIRO_STATUS_SUCCESS;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_pdf_convert_to_image (cairo_surface_t *surface,
+ int page)
+{
+ pdf_target_closure_t *ptc = cairo_surface_get_user_data (surface,
+ &pdf_closure_key);
+
+ return cairo_boilerplate_convert_to_image (ptc->filename, page+1);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_pdf_get_image_surface (cairo_surface_t *surface,
+ int page,
+ int width,
+ int height)
+{
+ cairo_surface_t *image;
+
+ image = _cairo_boilerplate_pdf_convert_to_image (surface, page);
+ cairo_surface_set_device_offset (image,
+ cairo_image_surface_get_width (image) - width,
+ cairo_image_surface_get_height (image) - height);
+ surface = _cairo_boilerplate_get_image_surface (image, 0, width, height);
+ cairo_surface_destroy (image);
+
+ return surface;
+}
+
+static void
+_cairo_boilerplate_pdf_cleanup (void *closure)
+{
+ pdf_target_closure_t *ptc = closure;
+ if (ptc->target) {
+ cairo_surface_finish (ptc->target);
+ cairo_surface_destroy (ptc->target);
+ }
+ free (ptc->filename);
+ free (ptc);
+}
+
+static void
+_cairo_boilerplate_pdf_force_fallbacks (cairo_surface_t *abstract_surface,
+ double x_pixels_per_inch,
+ double y_pixels_per_inch)
+{
+ pdf_target_closure_t *ptc = cairo_surface_get_user_data (abstract_surface,
+ &pdf_closure_key);
+
+ cairo_paginated_surface_t *paginated;
+ cairo_pdf_surface_t *surface;
+
+ if (ptc->target)
+ abstract_surface = ptc->target;
+
+ paginated = (cairo_paginated_surface_t*) abstract_surface;
+ surface = (cairo_pdf_surface_t*) paginated->target;
+ surface->force_fallbacks = TRUE;
+ cairo_surface_set_fallback_resolution (&paginated->base,
+ x_pixels_per_inch,
+ y_pixels_per_inch);
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+ {
+ "pdf", "pdf", ".pdf", NULL,
+ CAIRO_SURFACE_TYPE_PDF,
+ CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0,
+ "cairo_pdf_surface_create",
+ _cairo_boilerplate_pdf_create_surface,
+ cairo_surface_create_similar,
+ _cairo_boilerplate_pdf_force_fallbacks,
+ _cairo_boilerplate_pdf_finish_surface,
+ _cairo_boilerplate_pdf_get_image_surface,
+ _cairo_boilerplate_pdf_surface_write_to_png,
+ _cairo_boilerplate_pdf_cleanup,
+ NULL, NULL, FALSE, TRUE, TRUE
+ },
+ {
+ "pdf", "pdf", ".pdf", NULL,
+ CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 0,
+ "cairo_pdf_surface_create",
+ _cairo_boilerplate_pdf_create_surface,
+ cairo_surface_create_similar,
+ _cairo_boilerplate_pdf_force_fallbacks,
+ _cairo_boilerplate_pdf_finish_surface,
+ _cairo_boilerplate_pdf_get_image_surface,
+ _cairo_boilerplate_pdf_surface_write_to_png,
+ _cairo_boilerplate_pdf_cleanup,
+ NULL, NULL, FALSE, TRUE, TRUE
+ },
+};
+CAIRO_BOILERPLATE (pdf, targets)
+
+#else
+
+CAIRO_NO_BOILERPLATE (pdf)
+
+#endif
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-private.h b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-private.h
new file mode 100644
index 0000000..d16a645
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-private.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright © 2009 Chris Wilson
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Author: Chris Wilson <chris@chris-wilson.co.uk>
+ */
+
+#ifndef _CAIRO_BOILERPLATE_PRIVATE_H_
+#define _CAIRO_BOILERPLATE_PRIVATE_H_
+
+#include "cairo-boilerplate.h"
+
+CAIRO_BEGIN_DECLS
+
+void
+_cairo_boilerplate_register_all (void);
+
+void
+_cairo_boilerplate_register_backend (const cairo_boilerplate_target_t *targets,
+ unsigned int count);
+
+#define CAIRO_BOILERPLATE(name__, targets__) \
+void _register_##name__ (void); \
+void _register_##name__ (void) { \
+ _cairo_boilerplate_register_backend (targets__, \
+ ARRAY_LENGTH(targets__)); \
+}
+
+#define CAIRO_NO_BOILERPLATE(name__) \
+void _register_##name__ (void); \
+void _register_##name__ (void) { }
+
+CAIRO_END_DECLS
+
+#endif /* _CAIRO_BOILERPLATE_PRIVATE_H_ */
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-ps.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-ps.c
new file mode 100644
index 0000000..ae61239
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-ps.c
@@ -0,0 +1,369 @@
+/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
+/*
+ * Copyright © 2004,2006 Red Hat, Inc.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Author: Carl D. Worth <cworth@cworth.org>
+ */
+
+#include "cairo-boilerplate-private.h"
+
+#if CAIRO_CAN_TEST_PS_SURFACE
+
+#include <cairo-ps.h>
+
+#include <cairo-ps-surface-private.h>
+#include <cairo-paginated-surface-private.h>
+
+#if HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+
+#if HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#if ! CAIRO_HAS_RECORDING_SURFACE
+#define CAIRO_SURFACE_TYPE_RECORDING CAIRO_INTERNAL_SURFACE_TYPE_RECORDING
+#endif
+
+static const cairo_user_data_key_t ps_closure_key;
+
+typedef struct _ps_target_closure {
+ char *filename;
+ int width;
+ int height;
+ cairo_surface_t *target;
+ cairo_ps_level_t level;
+} ps_target_closure_t;
+
+static cairo_status_t
+_cairo_boilerplate_ps_surface_set_creation_date (cairo_surface_t *abstract_surface,
+ time_t date)
+{
+ cairo_paginated_surface_t *paginated = (cairo_paginated_surface_t*) abstract_surface;
+ cairo_ps_surface_t *surface;
+
+ if (cairo_surface_get_type (abstract_surface) != CAIRO_SURFACE_TYPE_PS)
+ return CAIRO_STATUS_SURFACE_TYPE_MISMATCH;
+
+ surface = (cairo_ps_surface_t*) paginated->target;
+
+ surface->has_creation_date = TRUE;
+ surface->creation_date = date;
+
+ return CAIRO_STATUS_SUCCESS;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_ps_create_surface (const char *name,
+ cairo_content_t content,
+ cairo_ps_level_t level,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ ps_target_closure_t *ptc;
+ cairo_surface_t *surface;
+ cairo_status_t status;
+
+ /* Sanitize back to a real cairo_content_t value. */
+ if (content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED)
+ content = CAIRO_CONTENT_COLOR_ALPHA;
+
+ *closure = ptc = xmalloc (sizeof (ps_target_closure_t));
+
+ xasprintf (&ptc->filename, "%s.out.ps", name);
+ xunlink (ptc->filename);
+
+ ptc->level = level;
+ ptc->width = ceil (width);
+ ptc->height = ceil (height);
+
+ surface = cairo_ps_surface_create (ptc->filename, width, height);
+ if (cairo_surface_status (surface))
+ goto CLEANUP_FILENAME;
+
+ cairo_ps_surface_restrict_to_level (surface, level);
+ _cairo_boilerplate_ps_surface_set_creation_date (surface, 0);
+ cairo_surface_set_fallback_resolution (surface, 72., 72.);
+
+ if (content == CAIRO_CONTENT_COLOR) {
+ ptc->target = surface;
+ surface = cairo_surface_create_similar (ptc->target,
+ CAIRO_CONTENT_COLOR,
+ ptc->width, ptc->height);
+ if (cairo_surface_status (surface))
+ goto CLEANUP_TARGET;
+ } else {
+ ptc->target = NULL;
+ }
+
+ status = cairo_surface_set_user_data (surface, &ps_closure_key, ptc, NULL);
+ if (status == CAIRO_STATUS_SUCCESS)
+ return surface;
+
+ cairo_surface_destroy (surface);
+ surface = cairo_boilerplate_surface_create_in_error (status);
+
+ CLEANUP_TARGET:
+ cairo_surface_destroy (ptc->target);
+ CLEANUP_FILENAME:
+ free (ptc->filename);
+ free (ptc);
+ return surface;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_ps2_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ return _cairo_boilerplate_ps_create_surface (name, content,
+ CAIRO_PS_LEVEL_2,
+ width, height,
+ max_width, max_height,
+ mode,
+ closure);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_ps3_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ return _cairo_boilerplate_ps_create_surface (name, content,
+ CAIRO_PS_LEVEL_3,
+ width, height,
+ max_width, max_height,
+ mode,
+ closure);
+}
+
+static cairo_status_t
+_cairo_boilerplate_ps_finish_surface (cairo_surface_t *surface)
+{
+ ps_target_closure_t *ptc = cairo_surface_get_user_data (surface,
+ &ps_closure_key);
+ cairo_status_t status;
+
+ /* Both surface and ptc->target were originally created at the
+ * same dimensions. We want a 1:1 copy here, so we first clear any
+ * device offset on surface.
+ *
+ * In a more realistic use case of device offsets, the target of
+ * this copying would be of a different size than the source, and
+ * the offset would be desirable during the copy operation. */
+ cairo_surface_set_device_offset (surface, 0, 0);
+
+ if (ptc->target) {
+ cairo_t *cr;
+
+ cr = cairo_create (ptc->target);
+ cairo_set_source_surface (cr, surface, 0, 0);
+ cairo_paint (cr);
+ cairo_show_page (cr);
+ status = cairo_status (cr);
+ cairo_destroy (cr);
+
+ if (status)
+ return status;
+
+ cairo_surface_finish (surface);
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
+
+ surface = ptc->target;
+ }
+
+ cairo_surface_finish (surface);
+ return cairo_surface_status (surface);
+}
+
+static cairo_status_t
+_cairo_boilerplate_ps_surface_write_to_png (cairo_surface_t *surface,
+ const char *filename)
+{
+ ps_target_closure_t *ptc = cairo_surface_get_user_data (surface,
+ &ps_closure_key);
+ char command[4096];
+ int exitstatus;
+
+ sprintf (command, "gs -q -r72 -g%dx%d -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pngalpha -sOutputFile=%s %s %s",
+ ptc->width, ptc->height, filename,
+ ptc->level == CAIRO_PS_LEVEL_2 ? "-c 2 .setlanguagelevel -f" : "",
+ ptc->filename);
+ exitstatus = system (command);
+#if _XOPEN_SOURCE && HAVE_SIGNAL_H
+ if (WIFSIGNALED (exitstatus))
+ raise (WTERMSIG (exitstatus));
+#endif
+ if (exitstatus)
+ return CAIRO_STATUS_WRITE_ERROR;
+
+ return CAIRO_STATUS_SUCCESS;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_ps_get_image_surface (cairo_surface_t *surface,
+ int page,
+ int width,
+ int height)
+{
+ ps_target_closure_t *ptc = cairo_surface_get_user_data (surface,
+ &ps_closure_key);
+ char *filename;
+ cairo_status_t status;
+
+ if (page == 0)
+ xasprintf (&filename, "%s.png", ptc->filename);
+ else
+ xasprintf (&filename, "%s-%%05d.png", ptc->filename);
+ status = _cairo_boilerplate_ps_surface_write_to_png (surface, filename);
+ if (status)
+ return cairo_boilerplate_surface_create_in_error (status);
+
+ if (page != 0) {
+ free (filename);
+ xasprintf (&filename, "%s-%05d.png", ptc->filename, page);
+ }
+ surface = cairo_boilerplate_get_image_surface_from_png (filename,
+ width,
+ height,
+ ptc->target == NULL);
+
+ remove (filename);
+ free (filename);
+
+ return surface;
+}
+
+static void
+_cairo_boilerplate_ps_cleanup (void *closure)
+{
+ ps_target_closure_t *ptc = closure;
+ if (ptc->target) {
+ cairo_surface_finish (ptc->target);
+ cairo_surface_destroy (ptc->target);
+ }
+ free (ptc->filename);
+ free (ptc);
+}
+
+static void
+_cairo_boilerplate_ps_force_fallbacks (cairo_surface_t *abstract_surface,
+ double x_pixels_per_inch,
+ double y_pixels_per_inch)
+{
+ ps_target_closure_t *ptc = cairo_surface_get_user_data (abstract_surface,
+ &ps_closure_key);
+
+ cairo_paginated_surface_t *paginated;
+ cairo_ps_surface_t *surface;
+
+ if (ptc->target)
+ abstract_surface = ptc->target;
+
+ paginated = (cairo_paginated_surface_t*) abstract_surface;
+ surface = (cairo_ps_surface_t*) paginated->target;
+ surface->force_fallbacks = TRUE;
+ cairo_surface_set_fallback_resolution (&paginated->base,
+ x_pixels_per_inch,
+ y_pixels_per_inch);
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+ {
+ "ps2", "ps", ".ps", NULL,
+ CAIRO_SURFACE_TYPE_PS,
+ CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0,
+ "cairo_ps_surface_create",
+ _cairo_boilerplate_ps2_create_surface,
+ cairo_surface_create_similar,
+ _cairo_boilerplate_ps_force_fallbacks,
+ _cairo_boilerplate_ps_finish_surface,
+ _cairo_boilerplate_ps_get_image_surface,
+ _cairo_boilerplate_ps_surface_write_to_png,
+ _cairo_boilerplate_ps_cleanup,
+ NULL, NULL, FALSE, TRUE, TRUE
+ },
+ {
+ "ps2", "ps", ".ps", NULL,
+ CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 0,
+ "cairo_ps_surface_create",
+ _cairo_boilerplate_ps2_create_surface,
+ cairo_surface_create_similar,
+ _cairo_boilerplate_ps_force_fallbacks,
+ _cairo_boilerplate_ps_finish_surface,
+ _cairo_boilerplate_ps_get_image_surface,
+ _cairo_boilerplate_ps_surface_write_to_png,
+ _cairo_boilerplate_ps_cleanup,
+ NULL, NULL, FALSE, TRUE, TRUE
+ },
+ {
+ "ps3", "ps", ".ps", NULL,
+ CAIRO_SURFACE_TYPE_PS,
+ CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0,
+ "cairo_ps_surface_create",
+ _cairo_boilerplate_ps3_create_surface,
+ cairo_surface_create_similar,
+ _cairo_boilerplate_ps_force_fallbacks,
+ _cairo_boilerplate_ps_finish_surface,
+ _cairo_boilerplate_ps_get_image_surface,
+ _cairo_boilerplate_ps_surface_write_to_png,
+ _cairo_boilerplate_ps_cleanup,
+ NULL, NULL, FALSE, TRUE, TRUE
+ },
+ {
+ "ps3", "ps", ".ps", NULL,
+ CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 0,
+ "cairo_ps_surface_create",
+ _cairo_boilerplate_ps3_create_surface,
+ cairo_surface_create_similar,
+ _cairo_boilerplate_ps_force_fallbacks,
+ _cairo_boilerplate_ps_finish_surface,
+ _cairo_boilerplate_ps_get_image_surface,
+ _cairo_boilerplate_ps_surface_write_to_png,
+ _cairo_boilerplate_ps_cleanup,
+ NULL, NULL, FALSE, TRUE, TRUE
+ },
+};
+CAIRO_BOILERPLATE (ps, targets)
+
+#else
+
+CAIRO_NO_BOILERPLATE (ps)
+
+#endif
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-qt.cpp b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-qt.cpp
new file mode 100644
index 0000000..31c0814
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-qt.cpp
@@ -0,0 +1,114 @@
+/* Cairo - a vector graphics library with display and print output
+ *
+ * Copyright © 2009 Chris Wilson
+ *
+ * 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, 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 Chris Wilson.
+ */
+
+#include "cairo-boilerplate-private.h"
+
+#include <cairo-qt.h>
+
+#include <qapplication.h>
+#include <X11/Xlib.h>
+
+typedef struct _qt_closure {
+ Display *dpy;
+ QApplication *app;
+} qt_closure_t;
+
+static void
+_cairo_boilerplate_qt_cleanup (void *closure)
+{
+ qt_closure_t *qtc = (qt_closure_t *) closure;
+
+ delete qtc->app;
+ XCloseDisplay (qtc->dpy);
+ free (qtc);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_qt_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ qt_closure_t *qtc;
+
+ qtc = (qt_closure_t *) xcalloc (1, sizeof (qt_closure_t));
+ qtc->dpy = XOpenDisplay (NULL);
+ if (qtc->dpy == NULL) {
+ free (qtc);
+ return NULL;
+ }
+
+ if (mode == CAIRO_BOILERPLATE_MODE_TEST)
+ XSynchronize (qtc->dpy, True);
+
+ qtc->app = new QApplication (qtc->dpy);
+ *closure = qtc;
+ return cairo_qt_surface_create_with_qpixmap (content, width, height);
+}
+
+static void
+_cairo_boilerplate_qt_synchronize (void *closure)
+{
+ qt_closure_t *qtc = (qt_closure_t *) closure;
+
+ qtc->app->flush (); /* not sure if this is sufficient */
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+ {
+ "qt", "qt", NULL, NULL,
+ CAIRO_SURFACE_TYPE_QT, CAIRO_CONTENT_COLOR_ALPHA, 0,
+ "cairo_qt_surface_create",
+ _cairo_boilerplate_qt_create_surface,
+ NULL, NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_qt_cleanup
+ },
+ {
+ "qt", "qt", NULL, NULL,
+ CAIRO_SURFACE_TYPE_QT, CAIRO_CONTENT_COLOR, 0,
+ "cairo_qt_surface_create",
+ _cairo_boilerplate_qt_create_surface,
+ NULL, NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_qt_cleanup
+ },
+};
+extern "C" {
+CAIRO_BOILERPLATE (qt, targets)
+}
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-quartz.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-quartz.c
new file mode 100644
index 0000000..d4ca353
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-quartz.c
@@ -0,0 +1,76 @@
+/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
+/*
+ * Copyright © 2004,2007 Red Hat, Inc.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Author: Carl D. Worth <cworth@cworth.org>
+ */
+
+#include "cairo-boilerplate-private.h"
+
+#include <cairo-quartz.h>
+
+static cairo_surface_t *
+_cairo_boilerplate_quartz_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ cairo_format_t format;
+
+ format = cairo_boilerplate_format_from_content (content);
+
+ *closure = NULL;
+
+ return cairo_quartz_surface_create (format, width, height);
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+ {
+ "quartz", "quartz", NULL, NULL,
+ CAIRO_SURFACE_TYPE_QUARTZ, CAIRO_CONTENT_COLOR_ALPHA, 0,
+ "cairo_quartz_surface_create",
+ _cairo_boilerplate_quartz_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL, NULL,
+ TRUE, FALSE, FALSE
+ },
+ {
+ "quartz", "quartz", NULL, NULL,
+ CAIRO_SURFACE_TYPE_QUARTZ, CAIRO_CONTENT_COLOR, 0,
+ "cairo_quartz_surface_create",
+ _cairo_boilerplate_quartz_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL, NULL,
+ FALSE, FALSE, FALSE
+ },
+};
+CAIRO_BOILERPLATE (quartz, targets)
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-scaled-font.h b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-scaled-font.h
new file mode 100644
index 0000000..a7ba2fe
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-scaled-font.h
@@ -0,0 +1,34 @@
+/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
+/*
+ * Copyright © 2007 Red Hat, Inc.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Author: Behdad Esfahbod <behdad@behdad.org>
+ */
+
+#ifndef _CAIRO_BOILERPLATE_SCALED_FONT_H_
+#define _CAIRO_BOILERPLATE_SCALED_FONT_H_
+
+void
+cairo_boilerplate_scaled_font_set_max_glyphs_cached (cairo_scaled_font_t *scaled_font,
+ int max_glyphs);
+
+#endif
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-script.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-script.c
new file mode 100644
index 0000000..da8ae3b
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-script.c
@@ -0,0 +1,141 @@
+/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
+/*
+ * Copyright © Chris Wilson
+ *
+ * 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
+ * Chris Wilson not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Chris Wilson makes no representations about the
+ * suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * CHRIS WILSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL CHRIS WILSON 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.
+ *
+ * Author: Chris Wilson <chris@chris-wilson.co.uk>
+ */
+
+#include "cairo-boilerplate-private.h"
+
+#include "cairo-script.h"
+
+static cairo_user_data_key_t script_closure_key;
+
+typedef struct _script_target_closure {
+ char *filename;
+ double width;
+ double height;
+} script_target_closure_t;
+
+static cairo_surface_t *
+_cairo_boilerplate_script_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ script_target_closure_t *ptc;
+ cairo_device_t *ctx;
+ cairo_surface_t *surface;
+ cairo_status_t status;
+
+ *closure = ptc = xmalloc (sizeof (script_target_closure_t));
+
+ ptc->width = width;
+ ptc->height = height;
+
+ xasprintf (&ptc->filename, "%s.out.cs", name);
+ xunlink (ptc->filename);
+
+ ctx = cairo_script_create (ptc->filename);
+ surface = cairo_script_surface_create (ctx, content, width, height);
+ cairo_device_destroy (ctx);
+
+ status = cairo_surface_set_user_data (surface,
+ &script_closure_key, ptc, NULL);
+ if (status == CAIRO_STATUS_SUCCESS)
+ return surface;
+
+ cairo_surface_destroy (surface);
+ surface = cairo_boilerplate_surface_create_in_error (status);
+
+ free (ptc->filename);
+ free (ptc);
+ return surface;
+}
+
+static cairo_status_t
+_cairo_boilerplate_script_finish_surface (cairo_surface_t *surface)
+{
+ cairo_surface_finish (surface);
+ return cairo_surface_status (surface);
+}
+
+static cairo_status_t
+_cairo_boilerplate_script_surface_write_to_png (cairo_surface_t *surface,
+ const char *filename)
+{
+ return CAIRO_STATUS_WRITE_ERROR;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_script_convert_to_image (cairo_surface_t *surface,
+ int page)
+{
+ script_target_closure_t *ptc = cairo_surface_get_user_data (surface,
+ &script_closure_key);
+ return cairo_boilerplate_convert_to_image (ptc->filename, page);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_script_get_image_surface (cairo_surface_t *surface,
+ int page,
+ int width,
+ int height)
+{
+ cairo_surface_t *image;
+
+ image = _cairo_boilerplate_script_convert_to_image (surface, page);
+ cairo_surface_set_device_offset (image,
+ cairo_image_surface_get_width (image) - width,
+ cairo_image_surface_get_height (image) - height);
+ surface = _cairo_boilerplate_get_image_surface (image, 0, width, height);
+ cairo_surface_destroy (image);
+
+ return surface;
+}
+
+static void
+_cairo_boilerplate_script_cleanup (void *closure)
+{
+ script_target_closure_t *ptc = closure;
+ free (ptc->filename);
+ free (ptc);
+}
+
+static const cairo_boilerplate_target_t target[] = {{
+ "script", "script", ".cs", NULL,
+ CAIRO_SURFACE_TYPE_SCRIPT, CAIRO_CONTENT_COLOR_ALPHA, 0,
+ "cairo_script_surface_create",
+ _cairo_boilerplate_script_create_surface,
+ cairo_surface_create_similar,
+ NULL,
+ _cairo_boilerplate_script_finish_surface,
+ _cairo_boilerplate_script_get_image_surface,
+ _cairo_boilerplate_script_surface_write_to_png,
+ _cairo_boilerplate_script_cleanup,
+ NULL, NULL, FALSE, FALSE, FALSE
+}};
+CAIRO_BOILERPLATE (script, target)
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-svg.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-svg.c
new file mode 100644
index 0000000..797106e
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-svg.c
@@ -0,0 +1,344 @@
+/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
+/*
+ * Copyright © 2004,2006 Red Hat, Inc.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Author: Carl D. Worth <cworth@cworth.org>
+ */
+
+#include "cairo-boilerplate-private.h"
+
+#if CAIRO_CAN_TEST_SVG_SURFACE
+
+#include <cairo-svg.h>
+#include <cairo-svg-surface-private.h>
+#include <cairo-paginated-surface-private.h>
+
+#if HAVE_SIGNAL_H
+#include <stdlib.h>
+#include <signal.h>
+#endif
+
+#if HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#if ! CAIRO_HAS_RECORDING_SURFACE
+#define CAIRO_SURFACE_TYPE_RECORDING CAIRO_INTERNAL_SURFACE_TYPE_RECORDING
+#endif
+
+static const cairo_user_data_key_t svg_closure_key;
+
+typedef struct _svg_target_closure {
+ char *filename;
+ int width, height;
+ cairo_surface_t *target;
+} svg_target_closure_t;
+
+static cairo_surface_t *
+_cairo_boilerplate_svg_create_surface (const char *name,
+ cairo_content_t content,
+ cairo_svg_version_t version,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ svg_target_closure_t *ptc;
+ cairo_surface_t *surface;
+ cairo_status_t status;
+
+ *closure = ptc = xmalloc (sizeof (svg_target_closure_t));
+
+ ptc->width = ceil (width);
+ ptc->height = ceil (height);
+
+ xasprintf (&ptc->filename, "%s.out.svg", name);
+ xunlink (ptc->filename);
+
+ surface = cairo_svg_surface_create (ptc->filename, width, height);
+ if (cairo_surface_status (surface))
+ goto CLEANUP_FILENAME;
+
+ cairo_svg_surface_restrict_to_version (surface, version);
+ cairo_surface_set_fallback_resolution (surface, 72., 72.);
+
+ if (content == CAIRO_CONTENT_COLOR) {
+ ptc->target = surface;
+ surface = cairo_surface_create_similar (ptc->target,
+ CAIRO_CONTENT_COLOR,
+ ptc->width, ptc->height);
+ if (cairo_surface_status (surface))
+ goto CLEANUP_TARGET;
+ } else
+ ptc->target = NULL;
+
+ status = cairo_surface_set_user_data (surface, &svg_closure_key, ptc, NULL);
+ if (status == CAIRO_STATUS_SUCCESS)
+ return surface;
+
+ cairo_surface_destroy (surface);
+ surface = cairo_boilerplate_surface_create_in_error (status);
+
+ CLEANUP_TARGET:
+ cairo_surface_destroy (ptc->target);
+ CLEANUP_FILENAME:
+ free (ptc->filename);
+ free (ptc);
+ return surface;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_svg11_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ /* current default, but be explicit in case the default changes */
+ return _cairo_boilerplate_svg_create_surface (name, content,
+ CAIRO_SVG_VERSION_1_1,
+ width, height,
+ max_width, max_height,
+ mode,
+ closure);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_svg12_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ return _cairo_boilerplate_svg_create_surface (name, content,
+ CAIRO_SVG_VERSION_1_2,
+ width, height,
+ max_width, max_height,
+ mode,
+ closure);
+}
+
+static cairo_status_t
+_cairo_boilerplate_svg_finish_surface (cairo_surface_t *surface)
+{
+ svg_target_closure_t *ptc = cairo_surface_get_user_data (surface,
+ &svg_closure_key);
+ cairo_status_t status;
+
+ /* Both surface and ptc->target were originally created at the
+ * same dimensions. We want a 1:1 copy here, so we first clear any
+ * device offset on surface.
+ *
+ * In a more realistic use case of device offsets, the target of
+ * this copying would be of a different size than the source, and
+ * the offset would be desirable during the copy operation. */
+ cairo_surface_set_device_offset (surface, 0, 0);
+
+ if (ptc->target) {
+ cairo_t *cr;
+ cr = cairo_create (ptc->target);
+ cairo_set_source_surface (cr, surface, 0, 0);
+ cairo_paint (cr);
+ cairo_show_page (cr);
+ status = cairo_status (cr);
+ cairo_destroy (cr);
+
+ if (status)
+ return status;
+
+ cairo_surface_finish (surface);
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
+
+ surface = ptc->target;
+ }
+
+ cairo_surface_finish (surface);
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
+
+ return CAIRO_STATUS_SUCCESS;
+}
+
+static cairo_status_t
+_cairo_boilerplate_svg_surface_write_to_png (cairo_surface_t *surface,
+ const char *filename)
+{
+ svg_target_closure_t *ptc = cairo_surface_get_user_data (surface,
+ &svg_closure_key);
+ char command[4096];
+ int exitstatus;
+
+ sprintf (command, "./svg2png %s %s",
+ ptc->filename, filename);
+
+ exitstatus = system (command);
+#if _XOPEN_SOURCE && HAVE_SIGNAL_H
+ if (WIFSIGNALED (exitstatus))
+ raise (WTERMSIG (exitstatus));
+#endif
+ if (exitstatus)
+ return CAIRO_STATUS_WRITE_ERROR;
+
+ return CAIRO_STATUS_SUCCESS;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_svg_convert_to_image (cairo_surface_t *surface)
+{
+ svg_target_closure_t *ptc = cairo_surface_get_user_data (surface,
+ &svg_closure_key);
+
+ return cairo_boilerplate_convert_to_image (ptc->filename, 0);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_svg_get_image_surface (cairo_surface_t *surface,
+ int page,
+ int width,
+ int height)
+{
+ cairo_surface_t *image;
+
+ if (page != 0)
+ return cairo_boilerplate_surface_create_in_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH);
+
+ image = _cairo_boilerplate_svg_convert_to_image (surface);
+ cairo_surface_set_device_offset (image,
+ cairo_image_surface_get_width (image) - width,
+ cairo_image_surface_get_height (image) - height);
+ surface = _cairo_boilerplate_get_image_surface (image, 0, width, height);
+ cairo_surface_destroy (image);
+
+ return surface;
+}
+
+static void
+_cairo_boilerplate_svg_cleanup (void *closure)
+{
+ svg_target_closure_t *ptc = closure;
+ if (ptc->target != NULL) {
+ cairo_surface_finish (ptc->target);
+ cairo_surface_destroy (ptc->target);
+ }
+ free (ptc->filename);
+ free (ptc);
+}
+
+static void
+_cairo_boilerplate_svg_force_fallbacks (cairo_surface_t *abstract_surface,
+ double x_pixels_per_inch,
+ double y_pixels_per_inch)
+{
+ svg_target_closure_t *ptc = cairo_surface_get_user_data (abstract_surface,
+ &svg_closure_key);
+
+ cairo_paginated_surface_t *paginated;
+ cairo_svg_surface_t *surface;
+
+ if (ptc->target)
+ abstract_surface = ptc->target;
+
+ paginated = (cairo_paginated_surface_t*) abstract_surface;
+ surface = (cairo_svg_surface_t*) paginated->target;
+ surface->force_fallbacks = TRUE;
+ cairo_surface_set_fallback_resolution (&paginated->base,
+ x_pixels_per_inch,
+ y_pixels_per_inch);
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+ /* It seems we should be able to round-trip SVG content perfectly
+ * through librsvg and cairo, but for some mysterious reason, some
+ * systems get an error of 1 for some pixels on some of the text
+ * tests. XXX: I'd still like to chase these down at some point.
+ * For now just set the svg error tolerance to 1. */
+ {
+ "svg11", "svg", ".svg", NULL,
+ CAIRO_SURFACE_TYPE_SVG, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_svg_surface_create",
+ _cairo_boilerplate_svg11_create_surface,
+ cairo_surface_create_similar,
+ _cairo_boilerplate_svg_force_fallbacks,
+ _cairo_boilerplate_svg_finish_surface,
+ _cairo_boilerplate_svg_get_image_surface,
+ _cairo_boilerplate_svg_surface_write_to_png,
+ _cairo_boilerplate_svg_cleanup,
+ NULL, NULL, FALSE, TRUE, TRUE
+ },
+ {
+ "svg11", "svg", ".svg", NULL,
+ CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 1,
+ "cairo_svg_surface_create",
+ _cairo_boilerplate_svg11_create_surface,
+ cairo_surface_create_similar,
+ _cairo_boilerplate_svg_force_fallbacks,
+ _cairo_boilerplate_svg_finish_surface,
+ _cairo_boilerplate_svg_get_image_surface,
+ _cairo_boilerplate_svg_surface_write_to_png,
+ _cairo_boilerplate_svg_cleanup,
+ NULL, NULL, FALSE, TRUE, TRUE
+ },
+ {
+ "svg12", "svg", ".svg", NULL,
+ CAIRO_SURFACE_TYPE_SVG, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_svg_surface_create",
+ _cairo_boilerplate_svg12_create_surface,
+ cairo_surface_create_similar,
+ _cairo_boilerplate_svg_force_fallbacks,
+ _cairo_boilerplate_svg_finish_surface,
+ _cairo_boilerplate_svg_get_image_surface,
+ _cairo_boilerplate_svg_surface_write_to_png,
+ _cairo_boilerplate_svg_cleanup,
+ NULL, NULL, FALSE, TRUE, TRUE
+ },
+ {
+ "svg12", "svg", ".svg", NULL,
+ CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 1,
+ "cairo_svg_surface_create",
+ _cairo_boilerplate_svg12_create_surface,
+ cairo_surface_create_similar,
+ _cairo_boilerplate_svg_force_fallbacks,
+ _cairo_boilerplate_svg_finish_surface,
+ _cairo_boilerplate_svg_get_image_surface,
+ _cairo_boilerplate_svg_surface_write_to_png,
+ _cairo_boilerplate_svg_cleanup,
+ NULL, NULL, FALSE, TRUE, TRUE
+ },
+};
+CAIRO_BOILERPLATE (svg, targets)
+
+#else
+
+CAIRO_NO_BOILERPLATE (svg)
+
+#endif
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-system.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-system.c
new file mode 100644
index 0000000..ec23341
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-system.c
@@ -0,0 +1,166 @@
+/*
+ * Copyright © 2004 Red Hat, Inc.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Author: Carl D. Worth <cworth@cworth.org>
+ */
+
+#define _GNU_SOURCE 1 /* for vasprintf */
+
+#include "cairo-boilerplate.h"
+#include "cairo-boilerplate-system.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <errno.h>
+
+void *
+xmalloc (size_t size)
+{
+ void *buf;
+
+ if (size == 0)
+ return NULL;
+
+ buf = malloc (size);
+ if (buf == NULL) {
+ fprintf (stderr, "Error: Out of memory. Exiting.\n");
+ exit (1);
+ }
+
+ return buf;
+}
+
+void *
+xcalloc (size_t nmemb,
+ size_t size)
+{
+ void *buf;
+
+ if (nmemb == 0 || size == 0)
+ return NULL;
+
+ buf = calloc (nmemb, size);
+ if (buf == NULL) {
+ fprintf (stderr, "Error: Out of memory. Exiting\n");
+ exit (1);
+ }
+
+ return buf;
+}
+
+void *
+xrealloc (void *buf,
+ size_t size)
+{
+ buf = realloc (buf, size);
+ if (buf == NULL && size != 0) {
+ fprintf (stderr, "Error: Out of memory. Exiting\n");
+ exit (1);
+ }
+
+ return buf;
+}
+
+void
+xasprintf (char **strp,
+ const char *fmt,
+ ...)
+{
+#ifdef HAVE_VASPRINTF
+ va_list va;
+ int ret;
+
+ va_start (va, fmt);
+ ret = vasprintf (strp, fmt, va);
+ va_end (va);
+
+ if (ret < 0) {
+ fprintf (stderr, "Error: Out of memory. Exiting.\n");
+ exit (1);
+ }
+#else /* !HAVE_VASNPRINTF */
+#define BUF_SIZE 1024
+ va_list va;
+ char buffer[BUF_SIZE];
+ int ret, len;
+
+ va_start (va, fmt);
+ ret = vsnprintf (buffer, sizeof (buffer), fmt, va);
+ va_end (va);
+
+ if (ret < 0) {
+ fprintf (stderr, "Failure in vsnprintf\n");
+ exit (1);
+ }
+
+ len = (ret + sizeof (int)) & -sizeof (int);
+ *strp = malloc (len);
+ if (*strp == NULL) {
+ fprintf (stderr, "Out of memory\n");
+ exit (1);
+ }
+
+ if ((unsigned) ret < sizeof (buffer)) {
+ memcpy (*strp, buffer, ret);
+ } else {
+ va_start (va, fmt);
+ ret = vsnprintf (*strp, len, fmt, va);
+ va_end (va);
+
+ if (ret >= len) {
+ free (*strp);
+ fprintf (stderr, "Overflowed dynamic buffer\n");
+ exit (1);
+ }
+ }
+ memset (*strp + ret, 0, len-ret);
+#endif /* !HAVE_VASNPRINTF */
+}
+
+void
+xunlink (const char *pathname)
+{
+ if (unlink (pathname) < 0 && errno != ENOENT) {
+ fprintf (stderr, "Error: Cannot remove %s: %s\n",
+ pathname, strerror (errno));
+ exit (1);
+ }
+}
+
+char *
+xstrdup (const char *str)
+{
+ if (str == NULL)
+ return NULL;
+
+ str = strdup (str);
+ if (str == NULL) {
+ fprintf (stderr, "Error: Out of memory. Exiting.\n");
+ exit (1);
+ }
+
+ return (char *) str;
+}
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-system.h b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-system.h
new file mode 100644
index 0000000..2816567
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-system.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright © 2004 Red Hat, Inc.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Author: Carl D. Worth <cworth@cworth.org>
+ */
+
+#ifndef _XMALLOC_H_
+#define _XMALLOC_H_
+
+#include "cairo-boilerplate.h"
+
+#define xmalloc cairo_boilerplate_xmalloc
+void *
+xmalloc (size_t size);
+
+#define xcalloc cairo_boilerplate_xcalloc
+void *
+xcalloc (size_t nmemb,
+ size_t size);
+
+#define xrealloc cairo_boilerplate_xrealloc
+void *
+xrealloc (void *buf,
+ size_t size);
+
+#define xasprintf cairo_boilerplate_xasprintf
+void
+xasprintf (char **strp,
+ const char *fmt,
+ ...) CAIRO_BOILERPLATE_PRINTF_FORMAT(2, 3);
+
+#define xunlink cairo_boilerplate_xunlink
+void
+xunlink (const char *path);
+
+#define xstrdup cairo_boilerplate_xstrdup
+char *
+xstrdup (const char *str);
+
+#endif
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-test-surfaces.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-test-surfaces.c
new file mode 100644
index 0000000..293b77f
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-test-surfaces.c
@@ -0,0 +1,462 @@
+/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
+/*
+ * Copyright © 2004,2006 Red Hat, Inc.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Author: Carl D. Worth <cworth@cworth.org>
+ */
+
+#include "../cairo-version.h"
+
+#include "cairo-boilerplate-private.h"
+
+#include <cairo-types-private.h>
+
+#include <test-compositor-surface.h>
+#include <test-null-compositor-surface.h>
+#if CAIRO_HAS_TEST_PAGINATED_SURFACE
+#include <test-paginated-surface.h>
+#endif
+
+static cairo_surface_t *
+_cairo_boilerplate_test_base_compositor_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ *closure = NULL;
+ return _cairo_test_base_compositor_surface_create (content, ceil (width), ceil (height));
+}
+
+
+static cairo_surface_t *
+_cairo_boilerplate_test_fallback_compositor_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ *closure = NULL;
+ return _cairo_test_fallback_compositor_surface_create (content, ceil (width), ceil (height));
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_test_mask_compositor_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ *closure = NULL;
+ return _cairo_test_mask_compositor_surface_create (content, ceil (width), ceil (height));
+}
+
+
+static cairo_surface_t *
+_cairo_boilerplate_test_traps_compositor_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ *closure = NULL;
+ return _cairo_test_traps_compositor_surface_create (content, ceil (width), ceil (height));
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_test_spans_compositor_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ *closure = NULL;
+ return _cairo_test_spans_compositor_surface_create (content, ceil (width), ceil (height));
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_test_no_fallback_compositor_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ if (mode == CAIRO_BOILERPLATE_MODE_TEST)
+ return NULL;
+
+ *closure = NULL;
+ return _cairo_test_no_fallback_compositor_surface_create (content, ceil (width), ceil (height));
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_test_no_traps_compositor_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ if (mode == CAIRO_BOILERPLATE_MODE_TEST)
+ return NULL;
+
+ *closure = NULL;
+ return _cairo_test_no_traps_compositor_surface_create (content, ceil (width), ceil (height));
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_test_no_spans_compositor_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ if (mode == CAIRO_BOILERPLATE_MODE_TEST)
+ return NULL;
+
+ *closure = NULL;
+ return _cairo_test_no_spans_compositor_surface_create (content, ceil (width), ceil (height));
+}
+
+#if CAIRO_HAS_TEST_PAGINATED_SURFACE
+static const cairo_user_data_key_t test_paginated_closure_key;
+
+typedef struct {
+ cairo_surface_t *target;
+} test_paginated_closure_t;
+
+static cairo_surface_t *
+_cairo_boilerplate_test_paginated_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ test_paginated_closure_t *tpc;
+ cairo_format_t format;
+ cairo_surface_t *surface;
+ cairo_status_t status;
+
+ *closure = tpc = xmalloc (sizeof (test_paginated_closure_t));
+
+ format = cairo_boilerplate_format_from_content (content);
+ tpc->target = cairo_image_surface_create (format,
+ ceil (width), ceil (height));
+
+ surface = _cairo_test_paginated_surface_create (tpc->target);
+ if (cairo_surface_status (surface))
+ goto CLEANUP;
+
+ status = cairo_surface_set_user_data (surface,
+ &test_paginated_closure_key,
+ tpc, NULL);
+ if (status == CAIRO_STATUS_SUCCESS)
+ return surface;
+
+ cairo_surface_destroy (surface);
+ surface = cairo_boilerplate_surface_create_in_error (status);
+
+ cairo_surface_destroy (tpc->target);
+
+ CLEANUP:
+ free (tpc);
+ return surface;
+}
+
+/* The only reason we go through all these machinations to write a PNG
+ * image is to _really ensure_ that the data actually landed in our
+ * buffer through the paginated surface to the test_paginated_surface.
+ *
+ * If we didn't implement this function then the default
+ * cairo_surface_write_to_png would result in the paginated_surface's
+ * acquire_source_image function replaying the recording-surface to an
+ * intermediate image surface. And in that case the
+ * test_paginated_surface would not be involved and wouldn't be
+ * tested.
+ */
+static cairo_status_t
+_cairo_boilerplate_test_paginated_surface_write_to_png (cairo_surface_t *surface,
+ const char *filename)
+{
+ test_paginated_closure_t *tpc;
+ cairo_status_t status;
+
+ /* show page first. the automatic show_page is too late for us */
+ cairo_surface_show_page (surface);
+ status = cairo_surface_status (surface);
+ if (status)
+ return status;
+
+ tpc = cairo_surface_get_user_data (surface, &test_paginated_closure_key);
+ return cairo_surface_write_to_png (tpc->target, filename);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_test_paginated_get_image_surface (cairo_surface_t *surface,
+ int page,
+ int width,
+ int height)
+{
+ test_paginated_closure_t *tpc;
+ cairo_status_t status;
+
+ /* XXX separate finish as per PDF */
+ if (page != 0)
+ return cairo_boilerplate_surface_create_in_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH);
+
+ /* show page first. the automatic show_page is too late for us */
+ cairo_surface_show_page (surface);
+ status = cairo_surface_status (surface);
+ if (status)
+ return cairo_boilerplate_surface_create_in_error (status);
+
+ tpc = cairo_surface_get_user_data (surface, &test_paginated_closure_key);
+ return _cairo_boilerplate_get_image_surface (tpc->target, 0, width, height);
+}
+
+static void
+_cairo_boilerplate_test_paginated_cleanup (void *closure)
+{
+ test_paginated_closure_t *tpc = closure;
+
+ cairo_surface_destroy (tpc->target);
+ free (tpc);
+}
+#endif
+
+static const cairo_boilerplate_target_t targets[] = {
+ {
+ "test-base", "base", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE,
+ CAIRO_CONTENT_COLOR_ALPHA, 0,
+ "_cairo_test_base_compositor_surface_create",
+ _cairo_boilerplate_test_base_compositor_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL, NULL, TRUE, FALSE, FALSE
+ },
+ {
+ "test-base", "base", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE,
+ CAIRO_CONTENT_COLOR, 0,
+ "_cairo_test_base_compositor_surface_create",
+ _cairo_boilerplate_test_base_compositor_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL, NULL, FALSE, FALSE, FALSE
+ },
+
+ {
+ "test-fallback", "image", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE,
+ CAIRO_CONTENT_COLOR_ALPHA, 0,
+ "_cairo_test_fallback_compositor_surface_create",
+ _cairo_boilerplate_test_fallback_compositor_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL, NULL, FALSE, FALSE, FALSE
+ },
+ {
+ "test-fallback", "image", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE,
+ CAIRO_CONTENT_COLOR, 0,
+ "_cairo_test_fallback_compositor_surface_create",
+ _cairo_boilerplate_test_fallback_compositor_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL, NULL, FALSE, FALSE, FALSE
+ },
+
+ {
+ "test-mask", "mask", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE,
+ CAIRO_CONTENT_COLOR_ALPHA, 0,
+ "_cairo_test_mask_compositor_surface_create",
+ _cairo_boilerplate_test_mask_compositor_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL, NULL, TRUE, FALSE, FALSE
+ },
+ {
+ "test-mask", "mask", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE,
+ CAIRO_CONTENT_COLOR, 0,
+ "_cairo_test_mask_compositor_surface_create",
+ _cairo_boilerplate_test_mask_compositor_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL, NULL, FALSE, FALSE, FALSE
+ },
+
+ {
+ "test-traps", "traps", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE,
+ CAIRO_CONTENT_COLOR_ALPHA, 0,
+ "_cairo_test_traps_compositor_surface_create",
+ _cairo_boilerplate_test_traps_compositor_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL, NULL, TRUE, FALSE, FALSE
+ },
+ {
+ "test-traps", "traps", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE,
+ CAIRO_CONTENT_COLOR, 0,
+ "_cairo_test_traps_compositor_surface_create",
+ _cairo_boilerplate_test_traps_compositor_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL, NULL, FALSE, FALSE, FALSE
+ },
+
+ {
+ "test-spans", "spans", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE,
+ CAIRO_CONTENT_COLOR_ALPHA, 0,
+ "_cairo_test_spans_compositor_surface_create",
+ _cairo_boilerplate_test_spans_compositor_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL, NULL, TRUE, FALSE, FALSE
+ },
+ {
+ "test-spans", "spans", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE,
+ CAIRO_CONTENT_COLOR, 0,
+ "_cairo_test_spans_compositor_surface_create",
+ _cairo_boilerplate_test_spans_compositor_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL, NULL, FALSE, FALSE, FALSE
+ },
+
+ {
+ "no-fallback", "image", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE,
+ CAIRO_CONTENT_COLOR_ALPHA, 0,
+ "_cairo_test_no_fallback_compositor_surface_create",
+ _cairo_boilerplate_test_no_fallback_compositor_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL, NULL, FALSE, FALSE, FALSE
+ },
+ {
+ "no-traps", "traps", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE,
+ CAIRO_CONTENT_COLOR_ALPHA, 0,
+ "_cairo_test_no_traps_compositor_surface_create",
+ _cairo_boilerplate_test_no_traps_compositor_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL, NULL, TRUE, FALSE, FALSE
+ },
+ {
+ "no-spans", "spans", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE,
+ CAIRO_CONTENT_COLOR_ALPHA, 0,
+ "_cairo_test_no_spans_compositor_surface_create",
+ _cairo_boilerplate_test_no_spans_compositor_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL, NULL, TRUE, FALSE, FALSE
+ },
+#if CAIRO_HAS_TEST_PAGINATED_SURFACE
+ {
+ "test-paginated", "image", NULL, NULL,
+ CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED,
+ CAIRO_CONTENT_COLOR_ALPHA, 0,
+ "_cairo_test_paginated_surface_create",
+ _cairo_boilerplate_test_paginated_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_test_paginated_get_image_surface,
+ _cairo_boilerplate_test_paginated_surface_write_to_png,
+ _cairo_boilerplate_test_paginated_cleanup,
+ NULL, NULL, FALSE, TRUE, FALSE
+ },
+ {
+ "test-paginated", "image", NULL, NULL,
+ CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED,
+ CAIRO_CONTENT_COLOR, 0,
+ "_cairo_test_paginated_surface_create",
+ _cairo_boilerplate_test_paginated_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_test_paginated_get_image_surface,
+ _cairo_boilerplate_test_paginated_surface_write_to_png,
+ _cairo_boilerplate_test_paginated_cleanup,
+ NULL, NULL, FALSE, TRUE, FALSE
+ },
+#endif
+};
+CAIRO_BOILERPLATE (test, targets)
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-vg.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-vg.c
new file mode 100644
index 0000000..6927657
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-vg.c
@@ -0,0 +1,363 @@
+/* Cairo - a vector graphics library with display and print output
+ *
+ * Copyright © 2009 Chris Wilson
+ *
+ * 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, 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 Chris Wilson.
+ */
+
+#include "cairo-boilerplate-private.h"
+
+#include <cairo-vg.h>
+
+ /* XXX Not sure how to handle library specific context initialization */
+//#define USE_SHIVA
+//#define USE_AMANITH
+
+#if CAIRO_HAS_GLX_FUNCTIONS
+
+#include <X11/Xlib.h>
+#include <GL/glx.h>
+
+typedef struct _vg_closure {
+ Display *dpy;
+ int screen;
+ Window win;
+
+ GLXContext ctx;
+ cairo_surface_t *surface;
+} vg_closure_glx_t;
+
+static void
+_cairo_boilerplate_vg_cleanup_glx (void *closure)
+{
+ vg_closure_glx_t *vgc = closure;
+
+#ifdef USE_AMANITH
+ vgDestroyContextAM ();
+#endif
+#ifdef USE_SHIVA
+ vgDestroyContextSH ();
+#endif
+
+ glXDestroyContext (vgc->dpy, vgc->ctx);
+ XDestroyWindow (vgc->dpy, vgc->win);
+ XCloseDisplay (vgc->dpy);
+ free (vgc);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_vg_create_surface_glx (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ int rgba_attribs[] = {
+ GLX_RGBA,
+ GLX_RED_SIZE, 1,
+ GLX_GREEN_SIZE, 1,
+ GLX_BLUE_SIZE, 1,
+ GLX_ALPHA_SIZE, 1,
+ GLX_DOUBLEBUFFER,
+ GLX_NONE
+ };
+ int rgb_attribs[] = {
+ GLX_RGBA,
+ GLX_RED_SIZE, 1,
+ GLX_GREEN_SIZE, 1,
+ GLX_BLUE_SIZE, 1,
+ GLX_DOUBLEBUFFER,
+ GLX_NONE
+ };
+ XVisualInfo *vi;
+ Display *dpy;
+ Colormap cmap;
+ XSetWindowAttributes swa;
+ cairo_surface_t *surface;
+ cairo_vg_context_t *context;
+ vg_closure_glx_t *vgc;
+
+ vgc = malloc (sizeof (vg_closure_glx_t));
+ *closure = vgc;
+
+ if (width == 0)
+ width = 1;
+ if (height == 0)
+ height = 1;
+
+ dpy = XOpenDisplay (NULL);
+ vgc->dpy = dpy;
+ if (vgc->dpy == NULL) {
+ fprintf (stderr, "Failed to open display: %s\n", XDisplayName(0));
+ free (vgc);
+ return NULL;
+ }
+
+ if (content == CAIRO_CONTENT_COLOR)
+ vi = glXChooseVisual (dpy, DefaultScreen (dpy), rgb_attribs);
+ else
+ vi = glXChooseVisual (dpy, DefaultScreen (dpy), rgba_attribs);
+
+ if (vi == NULL) {
+ fprintf (stderr, "Failed to create RGB, double-buffered visual\n");
+ XCloseDisplay (dpy);
+ free (vgc);
+ return NULL;
+ }
+
+ vgc->ctx = glXCreateContext (dpy, vi, NULL, True);
+ cmap = XCreateColormap (dpy,
+ RootWindow (dpy, vi->screen),
+ vi->visual,
+ AllocNone);
+ swa.colormap = cmap;
+ swa.border_pixel = 0;
+ vgc->win = XCreateWindow (dpy, RootWindow (dpy, vi->screen),
+ -1, -1, 1, 1, 0,
+ vi->depth,
+ InputOutput,
+ vi->visual,
+ CWBorderPixel | CWColormap, &swa);
+ XFreeColormap (dpy, cmap);
+ XFree (vi);
+
+ XMapWindow (dpy, vgc->win);
+
+ /* we need an active context to initialise VG */
+ glXMakeContextCurrent (dpy, vgc->win, vgc->win, vgc->ctx);
+
+#ifdef USE_AMANITH
+ vgInitContextAM (width, height, VG_FALSE, VG_TRUE);
+#endif
+#ifdef USE_SHIVA
+ vgCreateContextSH (width, height);
+#endif
+
+ context = cairo_vg_context_create_for_glx (dpy, vgc->ctx);
+ vgc->surface = cairo_vg_surface_create (context, content, width, height);
+ cairo_vg_context_destroy (context);
+
+ surface = vgc->surface;
+ if (cairo_surface_status (surface))
+ _cairo_boilerplate_vg_cleanup_glx (vgc);
+
+ return surface;
+}
+#endif
+
+#if CAIRO_HAS_EGL_FUNCTIONS
+typedef struct _vg_closure_egl {
+ EGLDisplay *dpy;
+ EGLContext *ctx;
+ EGLSurface *dummy;
+} vg_closure_egl_t;
+
+static void
+_cairo_boilerplate_vg_cleanup_egl (void *closure)
+{
+ vg_closure_egl_t *vgc = closure;
+
+#ifdef USE_AMANITH
+ vgDestroyContextAM ();
+#endif
+#ifdef USE_SHIVA
+ vgDestroyContextSH ();
+#endif
+
+ eglDestroyContext (vgc->dpy, vgc->ctx);
+ eglDestroySurface (vgc->dpy, vgc->dummy);
+ eglTerminate (vgc->dpy);
+ free (vgc);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_vg_create_surface_egl (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ int rgba_attribs[] = {
+ EGL_RED_SIZE, 8,
+ EGL_GREEN_SIZE, 8,
+ EGL_BLUE_SIZE, 8,
+ EGL_ALPHA_SIZE, 8,
+ EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
+ EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
+ EGL_NONE
+ };
+ int rgb_attribs[] = {
+ EGL_RED_SIZE, 8,
+ EGL_GREEN_SIZE, 8,
+ EGL_BLUE_SIZE, 8,
+ EGL_ALPHA_SIZE, 8,
+ EGL_VG_ALPHA_FORMAT, EGL_VG_ALPHA_FORMAT_PRE_BIT,
+ EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
+ EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
+ EGL_NONE
+ };
+ int dummy_attribs[] = {
+ EGL_WIDTH, 8, EGL_HEIGHT, 8,
+ EGL_NONE
+ };
+ EGLDisplay *dpy;
+ int major, minor;
+ EGLConfig config;
+ int num_configs;
+ EGLContext *egl_context;
+ EGLSurface *dummy;
+ cairo_vg_context_t *context;
+ cairo_surface_t *surface;
+ vg_closure_egl_t *vgc;
+
+ dpy = eglGetDisplay (EGL_DEFAULT_DISPLAY);
+
+ if (! eglInitialize (dpy, &major, &minor))
+ return NULL;
+
+ eglBindAPI (EGL_OPENVG_API);
+
+ if (! eglChooseConfig (dpy,
+ content == CAIRO_CONTENT_COLOR_ALPHA ?
+ rgba_attribs : rgb_attribs,
+ &config, 1, &num_configs) ||
+ num_configs != 1)
+ {
+ return NULL;
+ }
+
+ egl_context = eglCreateContext (dpy, config, NULL, NULL);
+ if (egl_context == NULL)
+ return NULL;
+
+ /* Create a dummy surface in order to enable a context to initialise VG */
+ dummy = eglCreatePbufferSurface (dpy, config, dummy_attribs);
+ if (dummy == NULL)
+ return NULL;
+ if (! eglMakeCurrent (dpy, dummy, dummy, egl_context))
+ return NULL;
+
+#ifdef USE_AMANITH
+ vgInitContextAM (width, height, VG_FALSE, VG_TRUE);
+#endif
+#ifdef USE_SHIVA
+ vgCreateContextSH (width, height);
+#endif
+
+ vgc = xmalloc (sizeof (vg_closure_egl_t));
+ vgc->dpy = dpy;
+ vgc->ctx = egl_context;
+ vgc->dummy = dummy;
+ *closure = vgc;
+
+ context = cairo_vg_context_create_for_egl (vgc->dpy, vgc->ctx);
+ surface = cairo_vg_surface_create (context, content, width, height);
+ cairo_vg_context_destroy (context);
+
+ if (cairo_surface_status (surface))
+ _cairo_boilerplate_vg_cleanup_egl (vgc);
+
+ return surface;
+}
+#endif
+
+static void
+_cairo_boilerplate_vg_synchronize (void *closure)
+{
+ vgFinish ();
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+#if CAIRO_HAS_GLX_FUNCTIONS
+ {
+ "vg-glx", "vg", NULL, NULL,
+ CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_vg_context_create_for_glx",
+ _cairo_boilerplate_vg_create_surface_glx,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_vg_cleanup_glx,
+ _cairo_boilerplate_vg_synchronize,
+ NULL,
+ TRUE, FALSE, FALSE
+ },
+ {
+ "vg-glx", "vg", NULL, NULL,
+ CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR, 1,
+ "cairo_vg_context_create_for_glx",
+ _cairo_boilerplate_vg_create_surface_glx,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_vg_cleanup_glx,
+ _cairo_boilerplate_vg_synchronize,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+#endif
+#if CAIRO_HAS_EGL_FUNCTIONS
+ {
+ "vg-egl", "vg", NULL, NULL,
+ CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_vg_context_create_for_egl",
+ _cairo_boilerplate_vg_create_surface_egl,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_vg_cleanup_egl,
+ _cairo_boilerplate_vg_synchronize,
+ NULL,
+ TRUE, FALSE, FALSE
+ },
+ {
+ "vg-egl", "vg", NULL, NULL,
+ CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR, 1,
+ "cairo_vg_context_create_for_egl",
+ _cairo_boilerplate_vg_create_surface_egl,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_vg_cleanup_egl,
+ _cairo_boilerplate_vg_synchronize,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+#endif
+};
+CAIRO_BOILERPLATE (vg, targets)
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-wgl.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-wgl.c
new file mode 100644
index 0000000..9088177
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-wgl.c
@@ -0,0 +1,239 @@
+/* cairo - a vector graphics library with display and print output
+ *
+ * Copyright © 2009 Chris Wilson
+ *
+ * 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, 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 Chris Wilson.
+ *
+ * Contributor(s):
+ * Zoxc <zoxc32@gmail.com>
+ */
+
+#include "cairo-boilerplate-private.h"
+
+#include <cairo-gl.h>
+
+static const cairo_user_data_key_t gl_closure_key;
+
+typedef struct _wgl_target_closure {
+ HWND wnd;
+ HDC dc;
+ HGLRC rc;
+ cairo_device_t *device;
+ cairo_surface_t *surface;
+} wgl_target_closure_t;
+
+static void
+_cairo_boilerplate_wgl_cleanup (void *closure)
+{
+ wgl_target_closure_t *wgltc = closure;
+
+ cairo_device_finish (wgltc->device);
+ cairo_device_destroy (wgltc->device);
+
+ wglDeleteContext(wgltc->rc);
+
+ ReleaseDC(wgltc->wnd, wgltc->dc);
+ DestroyWindow (wgltc->wnd);
+
+ free (wgltc);
+}
+
+static void
+_cairo_boilerplate_wgl_create_window (int width,
+ int height,
+ wgl_target_closure_t *wgltc)
+{
+ WNDCLASSEXA wincl;
+ PIXELFORMATDESCRIPTOR pfd;
+ int format;
+ cairo_surface_t *surface;
+
+ ZeroMemory (&wincl, sizeof (WNDCLASSEXA));
+ wincl.cbSize = sizeof (WNDCLASSEXA);
+ wincl.hInstance = GetModuleHandle (0);
+ wincl.lpszClassName = "cairo_boilerplate_wgl_dummy";
+ wincl.lpfnWndProc = DefWindowProcA;
+ wincl.style = CS_OWNDC;
+
+ RegisterClassExA (&wincl);
+
+ wgltc->wnd = CreateWindow ("cairo_boilerplate_wgl_dummy", 0, WS_POPUP, 0, 0, width, height, 0, 0, 0, 0);
+ wgltc->dc = GetDC (wgltc->wnd);
+
+ ZeroMemory (&pfd, sizeof (PIXELFORMATDESCRIPTOR));
+ pfd.nSize = sizeof (PIXELFORMATDESCRIPTOR);
+ pfd.nVersion = 1;
+ pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
+ pfd.iPixelType = PFD_TYPE_RGBA;
+ pfd.cColorBits = 24;
+ pfd.cDepthBits = 16;
+ pfd.iLayerType = PFD_MAIN_PLANE;
+
+ format = ChoosePixelFormat (wgltc->dc, &pfd);
+ SetPixelFormat (wgltc->dc, format, &pfd);
+
+ wgltc->rc = wglCreateContext (wgltc->dc);
+ wgltc->device = cairo_wgl_device_create (wgltc->rc);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_wgl_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ wgl_target_closure_t *wgltc;
+ cairo_surface_t *surface;
+
+ wgltc = calloc (1, sizeof (wgl_target_closure_t));
+
+ *closure = wgltc;
+
+ _cairo_boilerplate_wgl_create_window(0, 0, wgltc);
+
+ if (width == 0)
+ width = 1;
+ if (height == 0)
+ height = 1;
+
+ wgltc->surface = surface = cairo_gl_surface_create (wgltc->device,
+ content,
+ ceil (width),
+ ceil (height));
+ if (cairo_surface_status (surface)) {
+ _cairo_boilerplate_wgl_cleanup (wgltc);
+ return NULL;
+ }
+
+ return surface;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_wgl_for_create_window (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ wgl_target_closure_t *wgltc;
+ cairo_surface_t *surface;
+
+ wgltc = calloc (1, sizeof (wgl_target_closure_t));
+
+ *closure = wgltc;
+
+ _cairo_boilerplate_wgl_create_window(width, height, wgltc);
+
+ wgltc->surface = surface = cairo_gl_surface_create_for_dc (wgltc->device,
+ wgltc->dc,
+ ceil (width),
+ ceil (height));
+
+ if (cairo_surface_status (surface)) {
+ _cairo_boilerplate_wgl_cleanup (wgltc);
+ return NULL;
+ }
+
+ return surface;
+}
+
+static cairo_status_t
+_cairo_boilerplate_wgl_finish_window (cairo_surface_t *surface)
+{
+ wgl_target_closure_t *wgltc = cairo_surface_get_user_data (surface,
+ &gl_closure_key);
+
+ if (wgltc != NULL && wgltc->surface != NULL) {
+ cairo_t *cr;
+
+ cr = cairo_create (wgltc->surface);
+ cairo_surface_set_device_offset (surface, 0, 0);
+ cairo_set_source_surface (cr, surface, 0, 0);
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+ cairo_paint (cr);
+ cairo_destroy (cr);
+
+ surface = wgltc->surface;
+ }
+
+ cairo_gl_surface_swapbuffers (surface);
+ return CAIRO_STATUS_SUCCESS;
+}
+
+static void
+_cairo_boilerplate_wgl_synchronize (void *closure)
+{
+ wgl_target_closure_t *wgltc = closure;
+
+ if (cairo_device_acquire (wgltc->device))
+ return;
+
+ glFinish ();
+
+ cairo_device_release (wgltc->device);
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+ {
+ "gl", "gl", NULL, NULL,
+ CAIRO_SURFACE_TYPE_GL, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_gl_surface_create",
+ _cairo_boilerplate_wgl_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_wgl_cleanup,
+ _cairo_boilerplate_wgl_synchronize,
+ NULL,
+ TRUE, FALSE, FALSE
+ },
+ {
+ "gl-dc", "gl", NULL, NULL,
+ CAIRO_SURFACE_TYPE_GL, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_gl_surface_create_for_dc",
+ _cairo_boilerplate_wgl_for_create_window,
+ NULL,
+ _cairo_boilerplate_wgl_finish_window,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_wgl_cleanup,
+ _cairo_boilerplate_wgl_synchronize,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+};
+
+CAIRO_BOILERPLATE (wgl, targets)
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-win32-printing.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-win32-printing.c
new file mode 100644
index 0000000..625d52c
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-win32-printing.c
@@ -0,0 +1,407 @@
+/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
+/*
+ * Copyright © 2004,2006 Red Hat, Inc.
+ * Copyright © 2007, Adrian Johnson
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Authors: Carl D. Worth <cworth@cworth.org>
+ * Adrian Johnson <ajohnson@redneon.com>
+ */
+
+/* We require Windows 2000 features such as GetDefaultPrinter() */
+#if !defined(WINVER) || (WINVER < 0x0500)
+# define WINVER 0x0500
+#endif
+#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
+# define _WIN32_WINNT 0x0500
+#endif
+
+#include "cairo-boilerplate-private.h"
+
+#if CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE
+
+#include <cairo-win32.h>
+#include <cairo-paginated-surface-private.h>
+
+#include <windows.h>
+
+#if !defined(POSTSCRIPT_IDENTIFY)
+# define POSTSCRIPT_IDENTIFY 0x1015
+#endif
+
+#if !defined(PSIDENT_GDICENTRIC)
+# define PSIDENT_GDICENTRIC 0x0000
+#endif
+
+#if !defined(GET_PS_FEATURESETTING)
+# define GET_PS_FEATURESETTING 0x1019
+#endif
+
+#if !defined(FEATURESETTING_PSLEVEL)
+# define FEATURESETTING_PSLEVEL 0x0002
+#endif
+
+static cairo_status_t
+_cairo_win32_print_gdi_error (const char *context)
+{
+ void *lpMsgBuf;
+ DWORD last_error = GetLastError ();
+
+ if (!FormatMessageW (FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL,
+ last_error,
+ MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPWSTR) &lpMsgBuf,
+ 0, NULL)) {
+ fprintf (stderr, "%s: Unknown GDI error", context);
+ } else {
+ fprintf (stderr, "%s: %S", context, (wchar_t *)lpMsgBuf);
+
+ LocalFree (lpMsgBuf);
+ }
+
+ fflush (stderr);
+
+ /* We should switch off of last_status, but we'd either return
+ * CAIRO_STATUS_NO_MEMORY or CAIRO_STATUS_UNKNOWN_ERROR and there
+ * is no CAIRO_STATUS_UNKNOWN_ERROR.
+ */
+ return CAIRO_STATUS_NO_MEMORY;
+}
+
+static cairo_user_data_key_t win32_closure_key;
+
+typedef struct _win32_target_closure {
+ char *filename;
+ int width;
+ int height;
+ cairo_surface_t *target;
+ HDC dc;
+ int left_margin;
+ int bottom_margin;
+} win32_target_closure_t;
+
+static cairo_bool_t
+printer_is_postscript_level_3 (HDC dc)
+{
+ DWORD word;
+ INT ps_feature, ps_level;
+
+ word = PSIDENT_GDICENTRIC;
+ if (ExtEscape (dc, POSTSCRIPT_IDENTIFY, sizeof(DWORD), (char *)&word, 0, (char *)NULL) <= 0)
+ return FALSE;
+
+ ps_feature = FEATURESETTING_PSLEVEL;
+ if (ExtEscape (dc, GET_PS_FEATURESETTING, sizeof(INT),
+ (char *)&ps_feature, sizeof(INT), (char *)&ps_level) <= 0)
+ return FALSE;
+
+ if (ps_level >= 3)
+ return TRUE;
+
+ return FALSE;
+}
+
+static void
+create_printer_dc (win32_target_closure_t *ptc)
+{
+ char *printer_name;
+ DWORD size;
+ int x_dpi, y_dpi, left_margin, top_margin, page_height, printable_height;
+ XFORM xform;
+
+ ptc->dc = NULL;
+ GetDefaultPrinter (NULL, &size);
+ printer_name = malloc (size);
+
+ if (printer_name == NULL)
+ return;
+
+ if (GetDefaultPrinter (printer_name, &size) == 0) {
+ free (printer_name);
+ return;
+ }
+
+ /* printf("\nPrinting to : %s\n", printer_name); */
+ ptc->dc = CreateDC (NULL, printer_name, NULL, NULL);
+ free (printer_name);
+
+ if (!printer_is_postscript_level_3 (ptc->dc)) {
+ printf("The default printer driver must be a color PostScript level 3 printer\n");
+ ptc->dc = NULL;
+ return;
+ }
+
+ /* The printer device units on win32 are 1 unit == 1 dot and the
+ * origin is the start of the printable area. We transform the
+ * cordinate space to 1 unit is 1 point as expected by the
+ * tests. As the page size is larger than the test surface, the
+ * origin is translated down so that the each test is drawn at the
+ * bottom left corner of the page. This is because the bottom left
+ * corner of the PNG image that ghostscript creates is positioned
+ * at origin of the PS coordinates (ie the bottom left of the
+ * page). The left and bottom margins are stored in
+ * win32_target_closure as size of the PNG image needs to be
+ * increased because the test output is offset from the bottom
+ * left by the non printable margins. After the PNG is created the
+ * margins will be chopped off so the image matches the reference
+ * image.
+ */
+ printable_height = GetDeviceCaps (ptc->dc, VERTRES);
+ x_dpi = GetDeviceCaps (ptc->dc, LOGPIXELSX);
+ y_dpi = GetDeviceCaps (ptc->dc, LOGPIXELSY);
+ left_margin = GetDeviceCaps (ptc->dc, PHYSICALOFFSETX);
+ top_margin = GetDeviceCaps (ptc->dc, PHYSICALOFFSETY);
+ page_height = GetDeviceCaps (ptc->dc, PHYSICALHEIGHT);
+
+ SetGraphicsMode (ptc->dc, GM_ADVANCED);
+ xform.eM11 = x_dpi/72.0;
+ xform.eM12 = 0;
+ xform.eM21 = 0;
+ xform.eM22 = y_dpi/72.0;
+ xform.eDx = 0;
+ xform.eDy = printable_height - ptc->height*y_dpi/72.0;
+ if (!SetWorldTransform (ptc->dc, &xform)) {
+ _cairo_win32_print_gdi_error ("cairo-boilerplate-win32-printing:SetWorldTransform");
+ return;
+ }
+
+ ptc->left_margin = 72.0*left_margin/x_dpi;
+ ptc->bottom_margin = 72.0*(page_height - printable_height - top_margin)/y_dpi;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_win32_printing_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ win32_target_closure_t *ptc;
+ cairo_surface_t *surface;
+ DOCINFO di;
+
+ if (content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED)
+ content = CAIRO_CONTENT_COLOR_ALPHA;
+
+ *closure = ptc = xmalloc (sizeof (win32_target_closure_t));
+
+ xasprintf (&ptc->filename, "%s.out.ps", name);
+ xunlink (ptc->filename);
+
+ memset (&di, 0, sizeof (DOCINFO));
+ di.cbSize = sizeof (DOCINFO);
+ di.lpszDocName = ptc->filename;
+ di.lpszOutput = ptc->filename;
+
+ ptc->width = width;
+ ptc->height = height;
+
+ create_printer_dc (ptc);
+ if (ptc->dc == NULL) {
+ printf("\nFailed to create printer\n");
+ free (ptc->filename);
+ free (ptc);
+ return NULL;
+ }
+ StartDoc (ptc->dc, &di);
+ StartPage (ptc->dc);
+ surface = cairo_win32_printing_surface_create (ptc->dc);
+ if (cairo_surface_status (surface)) {
+ free (ptc->filename);
+ free (ptc);
+ return NULL;
+ }
+ cairo_surface_set_fallback_resolution (surface, 72., 72.);
+
+ if (content == CAIRO_CONTENT_COLOR) {
+ ptc->target = surface;
+ surface = cairo_surface_create_similar (ptc->target,
+ CAIRO_CONTENT_COLOR,
+ width, height);
+ } else {
+ ptc->target = NULL;
+ }
+
+ if (cairo_surface_set_user_data (surface,
+ &win32_closure_key,
+ ptc,
+ NULL) != CAIRO_STATUS_SUCCESS) {
+ cairo_surface_destroy (surface);
+ if (ptc->target != NULL)
+ cairo_surface_destroy (ptc->target);
+ free (ptc->filename);
+ free (ptc);
+ return NULL;
+ }
+
+ return surface;
+}
+
+static cairo_status_t
+_cairo_boilerplate_win32_printing_surface_write_to_png (cairo_surface_t *surface,
+ const char *filename)
+{
+ win32_target_closure_t *ptc = cairo_surface_get_user_data (surface, &win32_closure_key);
+ char command[4096];
+ cairo_surface_t *src_image, *dst_image;
+ cairo_t *cr;
+ cairo_status_t status;
+
+ /* Both surface and ptc->target were originally created at the
+ * same dimensions. We want a 1:1 copy here, so we first clear any
+ * device offset on surface.
+ *
+ * In a more realistic use case of device offsets, the target of
+ * this copying would be of a different size than the source, and
+ * the offset would be desirable during the copy operation. */
+ cairo_surface_set_device_offset (surface, 0, 0);
+
+ if (ptc->target) {
+ cairo_t *cr;
+ cr = cairo_create (ptc->target);
+ cairo_set_source_surface (cr, surface, 0, 0);
+ cairo_paint (cr);
+ cairo_show_page (cr);
+ cairo_destroy (cr);
+
+ cairo_surface_finish (surface);
+ surface = ptc->target;
+ }
+
+ cairo_surface_finish (surface);
+ EndPage (ptc->dc);
+ EndDoc (ptc->dc);
+ sprintf (command, "gs -q -r72 -g%dx%d -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pngalpha -sOutputFile=%s %s",
+ ptc->width + ptc->left_margin, ptc->height + ptc->bottom_margin, filename, ptc->filename);
+
+ if (system (command) != 0)
+ return CAIRO_STATUS_WRITE_ERROR;
+
+ /* Create a new image from the ghostscript image that has the
+ * left and bottom margins removed */
+
+ src_image = cairo_image_surface_create_from_png (filename);
+ status = cairo_surface_status (src_image);
+ if (status)
+ return status;
+
+ dst_image = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
+ ptc->width,
+ ptc->height);
+ cr = cairo_create (dst_image);
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+ cairo_set_source_surface (cr, src_image, -ptc->left_margin, 0);
+ cairo_paint (cr);
+ cairo_destroy (cr);
+
+ cairo_surface_write_to_png (dst_image, filename);
+ status = cairo_surface_status (dst_image);
+ if (status)
+ return status;
+
+ cairo_surface_destroy (src_image);
+ cairo_surface_destroy (dst_image);
+
+ return CAIRO_STATUS_SUCCESS;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_win32_printing_get_image_surface (cairo_surface_t *surface,
+ int page,
+ int width,
+ int height)
+{
+ win32_target_closure_t *ptc = cairo_surface_get_user_data (surface,
+ &win32_closure_key);
+ char *filename;
+ cairo_status_t status;
+
+ /* XXX test paginated interface */
+ if (page != 0)
+ return cairo_boilerplate_surface_create_in_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH);
+
+ xasprintf (&filename, "%s.png", ptc->filename);
+ status = _cairo_boilerplate_win32_printing_surface_write_to_png (surface, filename);
+ if (status)
+ return cairo_boilerplate_surface_create_in_error (status);
+
+ surface = cairo_boilerplate_get_image_surface_from_png (filename,
+ width,
+ height,
+ ptc->target == NULL);
+
+ remove (filename);
+ free (filename);
+
+ return surface;
+}
+
+static void
+_cairo_boilerplate_win32_printing_cleanup (void *closure)
+{
+ win32_target_closure_t *ptc = closure;
+
+ if (ptc->target)
+ cairo_surface_destroy (ptc->target);
+ free (ptc->filename);
+ free (ptc);
+ DeleteDC (ptc->dc);
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+ {
+ "win32-printing", "win32", ".ps", NULL,
+ CAIRO_SURFACE_TYPE_WIN32_PRINTING,
+ CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0,
+ "cairo_win32_printing_surface_create",
+ _cairo_boilerplate_win32_printing_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_win32_printing_get_image_surface,
+ _cairo_boilerplate_win32_printing_surface_write_to_png,
+ _cairo_boilerplate_win32_printing_cleanup,
+ NULL, NULL, FALSE, TRUE, TRUE
+ },
+ {
+ "win32-printing", "win32", ".ps", NULL,
+ CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 0,
+ "cairo_win32_printing_surface_create",
+ _cairo_boilerplate_win32_printing_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_win32_printing_get_image_surface,
+ _cairo_boilerplate_win32_printing_surface_write_to_png,
+ _cairo_boilerplate_win32_printing_cleanup,
+ NULL, NULL, FALSE, TRUE, TRUE
+ },
+};
+CAIRO_BOILERPLATE (win32_printing, targets)
+
+#else
+
+CAIRO_NO_BOILERPLATE (win32_printing)
+
+#endif
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-win32.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-win32.c
new file mode 100644
index 0000000..4b3eda9
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-win32.c
@@ -0,0 +1,294 @@
+/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
+/*
+ * Copyright © 2004,2006 Red Hat, Inc.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Author: Carl D. Worth <cworth@cworth.org>
+ */
+
+#include "cairo-boilerplate-private.h"
+
+#include <cairo-win32.h>
+
+#include <errno.h>
+#include <limits.h>
+
+static const cairo_user_data_key_t win32_closure_key;
+
+typedef struct _win32_target_closure {
+ HWND wnd;
+ HDC dc;
+ ATOM bpl_atom;
+ cairo_surface_t *surface;
+} win32_target_closure_t;
+
+static void
+_cairo_boilerplate_win32_cleanup_window_surface (void *closure)
+{
+ win32_target_closure_t *win32tc = closure;
+
+ if (win32tc != NULL)
+ {
+ if (win32tc->wnd != NULL &&
+ ReleaseDC (win32tc->wnd, win32tc->dc) != 1)
+ fprintf (stderr,
+ "Failed to release DC of a test window when cleaning up.\n");
+ if (win32tc->wnd != NULL &&
+ DestroyWindow (win32tc->wnd) == 0)
+ fprintf (stderr,
+ "Failed to destroy a test window when cleaning up, GLE is %lu.\n",
+ GetLastError ());
+ if (win32tc->bpl_atom != 0 &&
+ UnregisterClassA ((LPCSTR) MAKELPARAM (win32tc->bpl_atom, 0), GetModuleHandle (NULL)) == 0 &&
+ GetLastError () != ERROR_CLASS_DOES_NOT_EXIST)
+ fprintf (stderr,
+ "Failed to unregister boilerplate window class, GLE is %lu.\n",
+ GetLastError ());
+
+ free (win32tc);
+ }
+}
+
+static win32_target_closure_t *
+_cairo_boilerplate_win32_create_window (int width,
+ int height)
+{
+ WNDCLASSEXA wincl;
+ win32_target_closure_t *win32tc;
+ LPCSTR window_class_name;
+
+ ZeroMemory (&wincl, sizeof (WNDCLASSEXA));
+ wincl.cbSize = sizeof (WNDCLASSEXA);
+ wincl.hInstance = GetModuleHandle (0);
+ wincl.lpszClassName = "cairo_boilerplate_win32_dummy";
+ wincl.lpfnWndProc = DefWindowProcA;
+ wincl.style = CS_OWNDC;
+
+ win32tc = calloc (1, sizeof (win32_target_closure_t));
+
+ if (win32tc == NULL)
+ {
+ int error = errno;
+ fprintf (stderr, "Ran out of memory: %d.\n", error);
+ return NULL;
+ }
+
+ ZeroMemory (win32tc, sizeof (win32_target_closure_t));
+
+ win32tc->bpl_atom = RegisterClassExA (&wincl);
+
+ if (win32tc->bpl_atom == 0 && GetLastError () != ERROR_CLASS_ALREADY_EXISTS)
+ {
+ fprintf (stderr,
+ "Failed to register a boilerplate window class, GLE is %lu.\n",
+ GetLastError ());
+ _cairo_boilerplate_win32_cleanup_window_surface (win32tc);
+ return NULL;
+ }
+
+ if (win32tc->bpl_atom == 0)
+ window_class_name = wincl.lpszClassName;
+ else
+ window_class_name = (LPCSTR) MAKELPARAM (win32tc->bpl_atom, 0);
+
+ win32tc->wnd = CreateWindowExA (WS_EX_TOOLWINDOW,
+ window_class_name,
+ 0,
+ WS_POPUP,
+ 0,
+ 0,
+ width,
+ height,
+ 0,
+ 0,
+ 0,
+ 0);
+
+ if (win32tc->wnd == NULL)
+ {
+ fprintf (stderr,
+ "Failed to create a test window, GLE is %lu.\n",
+ GetLastError ());
+ _cairo_boilerplate_win32_cleanup_window_surface (win32tc);
+ return NULL;
+ }
+
+ win32tc->dc = GetDC (win32tc->wnd);
+
+ if (win32tc->dc == NULL)
+ {
+ fprintf (stderr, "Failed to get test window DC.\n");
+ _cairo_boilerplate_win32_cleanup_window_surface (win32tc);
+ return NULL;
+ }
+
+ SetWindowPos (win32tc->wnd,
+ HWND_BOTTOM,
+ INT_MIN,
+ INT_MIN,
+ width,
+ height,
+ SWP_NOACTIVATE | SWP_SHOWWINDOW);
+
+ return win32tc;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_win32_create_window_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ win32_target_closure_t *win32tc;
+ cairo_surface_t *surface;
+ cairo_format_t format;
+ cairo_status_t status;
+
+ win32tc = _cairo_boilerplate_win32_create_window (width, height);
+
+ if (win32tc == NULL)
+ return NULL;
+
+ format = cairo_boilerplate_format_from_content (content);
+
+ surface = cairo_win32_surface_create_with_format (win32tc->dc, format);
+
+ win32tc->surface = surface;
+
+ status = cairo_surface_status (surface);
+
+ if (status != CAIRO_STATUS_SUCCESS)
+ {
+ fprintf (stderr,
+ "Failed to create the test surface: %s [%d].\n",
+ cairo_status_to_string (status), status);
+ _cairo_boilerplate_win32_cleanup_window_surface (win32tc);
+ return NULL;
+ }
+
+ status = cairo_surface_set_user_data (surface, &win32_closure_key, win32tc, NULL);
+
+ if (status != CAIRO_STATUS_SUCCESS)
+ {
+ fprintf (stderr,
+ "Failed to set surface userdata: %s [%d].\n",
+ cairo_status_to_string (status), status);
+
+ cairo_surface_destroy (surface);
+ _cairo_boilerplate_win32_cleanup_window_surface (win32tc);
+
+ return NULL;
+ }
+
+ *closure = win32tc;
+
+ return surface;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_win32_create_dib_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ cairo_format_t format;
+
+ format = cairo_boilerplate_format_from_content (content);
+
+ *closure = NULL;
+
+ return cairo_win32_surface_create_with_dib (format, width, height);
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+ {
+ "win32", "win32", NULL, NULL,
+ CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR, 0,
+ "cairo_win32_surface_create_with_dib",
+ _cairo_boilerplate_win32_create_dib_surface,
+ cairo_surface_create_similar,
+ NULL,
+ NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL,
+ NULL,
+ NULL,
+ TRUE, FALSE, FALSE
+ },
+ /* Testing the win32 surface isn't interesting, since for
+ * ARGB images it just chains to the image backend
+ */
+ {
+ "win32", "win32", NULL, NULL,
+ CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR_ALPHA, 0,
+ "cairo_win32_surface_create_with_dib",
+ _cairo_boilerplate_win32_create_dib_surface,
+ cairo_surface_create_similar,
+ NULL,
+ NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL,
+ NULL,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+ {
+ "win32-window-color", "win32", NULL, NULL,
+ CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR, 1,
+ "cairo_win32_surface_create",
+ _cairo_boilerplate_win32_create_window_surface,
+ cairo_surface_create_similar,
+ NULL,
+ NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_win32_cleanup_window_surface,
+ NULL,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+ {
+ "win32-window-coloralpha", "win32", NULL, NULL,
+ CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_win32_surface_create_with_format",
+ _cairo_boilerplate_win32_create_window_surface,
+ cairo_surface_create_similar,
+ NULL,
+ NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_win32_cleanup_window_surface,
+ NULL,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+};
+CAIRO_BOILERPLATE (win32, targets)
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-xcb.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-xcb.c
new file mode 100644
index 0000000..cc9b422
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-xcb.c
@@ -0,0 +1,876 @@
+/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
+/*
+ * Copyright © 2004,2006 Red Hat, Inc.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Author: Carl D. Worth <cworth@cworth.org>
+ */
+
+#include "cairo-boilerplate-private.h"
+
+#include <cairo-xcb.h>
+
+#include <assert.h>
+
+/* Errors have response_type == 0 */
+#define CAIRO_XCB_ERROR 0
+
+static const cairo_user_data_key_t xcb_closure_key;
+
+typedef struct _xcb_target_closure {
+ xcb_connection_t *c;
+ cairo_device_t *device;
+ uint32_t drawable;
+ cairo_bool_t is_pixmap;
+ cairo_surface_t *surface;
+} xcb_target_closure_t;
+
+static cairo_status_t
+_cairo_boilerplate_xcb_handle_errors (xcb_target_closure_t *xtc)
+{
+ xcb_generic_event_t *ev = NULL;
+
+ /* Ignore all MappingNotify events; those might happen without us causing them */
+ do {
+ free(ev);
+ ev = xcb_poll_for_event(xtc->c);
+ } while (ev != NULL && ev->response_type == XCB_MAPPING_NOTIFY);
+
+ if (ev != NULL) {
+ if (ev->response_type == CAIRO_XCB_ERROR) {
+ xcb_generic_error_t *error = (xcb_generic_error_t *) ev;
+
+ fprintf (stderr,
+ "Detected error during xcb run: error=%d, "
+ "seqno=0x%02x, major=%d, minor=%d\n",
+ error->error_code, error->sequence,
+ error->major_code, error->minor_code);
+ } else {
+ fprintf (stderr,
+ "Detected unexpected event during xcb run: type=%d, seqno=0x%02x\n",
+ ev->response_type, ev->sequence);
+ }
+ free (ev);
+
+ /* Silently discard all following errors */
+ while ((ev = xcb_poll_for_event (xtc->c)) != NULL)
+ free (ev);
+
+ return CAIRO_STATUS_WRITE_ERROR;
+ }
+
+ return CAIRO_STATUS_SUCCESS;
+}
+
+static void
+_cairo_boilerplate_xcb_sync_server (xcb_target_closure_t *xtc)
+{
+ free (xcb_get_input_focus_reply (xtc->c,
+ xcb_get_input_focus (xtc->c), NULL));
+}
+
+static void
+_cairo_boilerplate_xcb_setup_test_surface (cairo_surface_t *surface)
+{
+
+ /* For testing purposes, tell the X server to strictly adhere to the
+ * Render specification.
+ */
+ cairo_xcb_device_debug_set_precision(cairo_surface_get_device(surface),
+ XCB_RENDER_POLY_MODE_PRECISE);
+}
+
+static void
+_cairo_boilerplate_xcb_cleanup (void *closure)
+{
+ xcb_target_closure_t *xtc = closure;
+ cairo_status_t status;
+
+ cairo_surface_finish (xtc->surface);
+ if (xtc->is_pixmap)
+ xcb_free_pixmap (xtc->c, xtc->drawable);
+ else
+ xcb_destroy_window (xtc->c, xtc->drawable);
+ cairo_surface_destroy (xtc->surface);
+
+ cairo_device_finish (xtc->device);
+ cairo_device_destroy (xtc->device);
+
+ /* First synchronize with the X server to make sure there are no more errors
+ * in-flight which we would miss otherwise */
+ _cairo_boilerplate_xcb_sync_server (xtc);
+ status = _cairo_boilerplate_xcb_handle_errors (xtc);
+ assert (status == CAIRO_STATUS_SUCCESS);
+
+ xcb_disconnect (xtc->c);
+
+ free (xtc);
+}
+
+static void
+_cairo_boilerplate_xcb_synchronize (void *closure)
+{
+ xcb_target_closure_t *xtc = closure;
+ cairo_status_t status;
+ free (xcb_get_image_reply (xtc->c,
+ xcb_get_image (xtc->c, XCB_IMAGE_FORMAT_Z_PIXMAP,
+ xtc->drawable, 0, 0, 1, 1, /* AllPlanes */ -1),
+ 0));
+
+ status = _cairo_boilerplate_xcb_handle_errors (xtc);
+ assert (status == CAIRO_STATUS_SUCCESS);
+}
+
+static xcb_render_pictforminfo_t *
+find_depth (xcb_connection_t *connection,
+ int depth,
+ void **formats_out)
+{
+ xcb_render_query_pict_formats_reply_t *formats;
+ xcb_render_query_pict_formats_cookie_t cookie;
+ xcb_render_pictforminfo_iterator_t i;
+
+ cookie = xcb_render_query_pict_formats (connection);
+ xcb_flush (connection);
+
+ formats = xcb_render_query_pict_formats_reply (connection, cookie, 0);
+ if (formats == NULL)
+ return NULL;
+
+ for (i = xcb_render_query_pict_formats_formats_iterator (formats);
+ i.rem;
+ xcb_render_pictforminfo_next (&i))
+ {
+ if (XCB_RENDER_PICT_TYPE_DIRECT != i.data->type)
+ continue;
+
+ if (depth != i.data->depth)
+ continue;
+
+ *formats_out = formats;
+ return i.data;
+ }
+
+ free (formats);
+ return NULL;
+}
+
+static const cairo_user_data_key_t key;
+
+struct similar {
+ xcb_connection_t *connection;
+ xcb_drawable_t pixmap;
+};
+
+static void _destroy_similar (void *closure)
+{
+ struct similar *similar = closure;
+
+ xcb_free_pixmap (similar->connection, similar->pixmap);
+ free (similar);
+}
+
+struct xcb_info {
+ xcb_render_query_pict_formats_reply_t *formats;
+ xcb_render_pictforminfo_t *render_format[3];
+};
+
+static cairo_surface_t *
+_cairo_boilerplate_xcb_create_similar (cairo_surface_t *other,
+ cairo_content_t content,
+ int width, int height)
+{
+ cairo_device_t *device = cairo_surface_get_device (other);
+ struct xcb_info *info = cairo_device_get_user_data (device, &key);
+ xcb_screen_t *root;
+ cairo_surface_t *surface;
+ struct similar *similar;
+ xcb_render_pictforminfo_t *render_format;
+ int depth;
+
+ similar = malloc (sizeof (*similar));
+
+ switch (content) {
+ default:
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ depth = 32;
+ render_format = info->render_format[0];
+ break;
+ case CAIRO_CONTENT_COLOR:
+ depth = 24;
+ render_format = info->render_format[1];
+ break;
+ case CAIRO_CONTENT_ALPHA:
+ depth = 8;
+ render_format = info->render_format[2];
+ break;
+ }
+
+ similar->connection =
+ cairo_xcb_device_get_connection (cairo_surface_get_device(other));
+ similar->pixmap = xcb_generate_id (similar->connection);
+
+ root = xcb_setup_roots_iterator(xcb_get_setup(similar->connection)).data;
+ xcb_create_pixmap (similar->connection, depth,
+ similar->pixmap, root->root,
+ width, height);
+
+ surface = cairo_xcb_surface_create_with_xrender_format (similar->connection,
+ root,
+ similar->pixmap,
+ render_format,
+ width, height);
+ cairo_surface_set_user_data (surface, &key, similar, _destroy_similar);
+
+ return surface;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_xcb_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ xcb_screen_t *root;
+ xcb_target_closure_t *xtc;
+ xcb_connection_t *c;
+ xcb_render_query_pict_formats_cookie_t formats_cookie;
+ xcb_render_pictforminfo_t *render_format;
+ xcb_render_pictforminfo_iterator_t i;
+ struct xcb_info *info;
+ int depth;
+ xcb_void_cookie_t cookie;
+ cairo_surface_t *surface;
+ cairo_status_t status;
+
+ *closure = xtc = xmalloc (sizeof (xcb_target_closure_t));
+ info = xcalloc (1, sizeof (struct xcb_info));
+
+ if (width == 0)
+ width = 1;
+ if (height == 0)
+ height = 1;
+
+ xtc->c = c = xcb_connect(NULL,NULL);
+ if (c == NULL || xcb_connection_has_error(c)) {
+ free (xtc);
+ return NULL;
+ }
+
+ root = xcb_setup_roots_iterator(xcb_get_setup(c)).data;
+ formats_cookie = xcb_render_query_pict_formats (c);
+
+ xtc->surface = NULL;
+ xtc->is_pixmap = TRUE;
+ xtc->drawable = xcb_generate_id (c);
+ switch (content) {
+ case CAIRO_CONTENT_COLOR:
+ depth = 24;
+ break;
+
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ depth = 32;
+ break;
+
+ case CAIRO_CONTENT_ALPHA: /* would be XCB_PICT_STANDARD_A_8 */
+ default:
+ xcb_disconnect (c);
+ free (xtc);
+ return NULL;
+ }
+
+ cookie = xcb_create_pixmap_checked (c, depth,
+ xtc->drawable, root->root,
+ width, height);
+
+ /* slow, but sure */
+ if (xcb_request_check (c, cookie) != NULL) {
+ xcb_disconnect (c);
+ free (xtc);
+ return NULL;
+ }
+
+ info->formats = xcb_render_query_pict_formats_reply (c, formats_cookie, 0);
+ if (info->formats == NULL)
+ return NULL;
+
+ for (i = xcb_render_query_pict_formats_formats_iterator (info->formats);
+ i.rem;
+ xcb_render_pictforminfo_next (&i))
+ {
+ if (XCB_RENDER_PICT_TYPE_DIRECT != i.data->type)
+ continue;
+
+ if (i.data->depth == 32) {
+ if (info->render_format[0] == 0)
+ info->render_format[0] = i.data;
+ } else if (i.data->depth == 24) {
+ if (info->render_format[1] == 0)
+ info->render_format[1] = i.data;
+ } else if (i.data->depth == 8) {
+ if (info->render_format[2] == 0)
+ info->render_format[2] = i.data;
+ }
+ }
+
+ assert (info->render_format[0]);
+ assert (info->render_format[1]);
+ assert (info->render_format[2]);
+
+ switch (content) {
+ default:
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ render_format = info->render_format[0];
+ break;
+
+ case CAIRO_CONTENT_COLOR:
+ render_format = info->render_format[1];
+ break;
+
+ case CAIRO_CONTENT_ALPHA: /* would be XCB_PICT_STANDARD_A_8 */
+ render_format = info->render_format[2];
+ break;
+ }
+
+ surface = cairo_xcb_surface_create_with_xrender_format (c, root,
+ xtc->drawable,
+ render_format,
+ width, height);
+ cairo_device_set_user_data (cairo_surface_get_device (surface), &key, info, free);
+ if (mode != CAIRO_BOILERPLATE_MODE_PERF)
+ _cairo_boilerplate_xcb_setup_test_surface(surface);
+
+ xtc->device = cairo_device_reference (cairo_surface_get_device (surface));
+ status = cairo_surface_set_user_data (surface, &xcb_closure_key, xtc, NULL);
+ if (status == CAIRO_STATUS_SUCCESS)
+ return surface;
+
+ cairo_surface_destroy (surface);
+
+ _cairo_boilerplate_xcb_cleanup (xtc);
+ return cairo_boilerplate_surface_create_in_error (status);
+}
+
+static xcb_visualtype_t *
+lookup_visual (xcb_screen_t *s,
+ xcb_visualid_t visual)
+{
+ xcb_depth_iterator_t d;
+
+ d = xcb_screen_allowed_depths_iterator (s);
+ for (; d.rem; xcb_depth_next (&d)) {
+ xcb_visualtype_iterator_t v = xcb_depth_visuals_iterator (d.data);
+ for (; v.rem; xcb_visualtype_next (&v)) {
+ if (v.data->visual_id == visual)
+ return v.data;
+ }
+ }
+
+ return 0;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_xcb_create_window (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ xcb_target_closure_t *xtc;
+ xcb_connection_t *c;
+ xcb_screen_t *s;
+ xcb_void_cookie_t cookie;
+ cairo_surface_t *surface;
+ cairo_status_t status;
+ uint32_t values[] = { 1 };
+
+ *closure = xtc = xmalloc (sizeof (xcb_target_closure_t));
+
+ if (width == 0)
+ width = 1;
+ if (height == 0)
+ height = 1;
+
+ xtc->c = c = xcb_connect(NULL,NULL);
+ if (xcb_connection_has_error(c)) {
+ free (xtc);
+ return NULL;
+ }
+
+ xtc->surface = NULL;
+
+ s = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
+ if (width > s->width_in_pixels || height > s->height_in_pixels) {
+ xcb_disconnect (c);
+ free (xtc);
+ return NULL;
+ }
+
+ xtc->is_pixmap = FALSE;
+ xtc->drawable = xcb_generate_id (c);
+ cookie = xcb_create_window_checked (c,
+ s->root_depth,
+ xtc->drawable,
+ s->root,
+ 0, 0, width, height, 0,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ s->root_visual,
+ XCB_CW_OVERRIDE_REDIRECT,
+ values);
+ xcb_map_window (c, xtc->drawable);
+
+ /* slow, but sure */
+ if (xcb_request_check (c, cookie) != NULL) {
+ xcb_disconnect (c);
+ free (xtc);
+ return NULL;
+ }
+
+ surface = cairo_xcb_surface_create (c,
+ xtc->drawable,
+ lookup_visual (s, s->root_visual),
+ width, height);
+
+ xtc->device = cairo_device_reference (cairo_surface_get_device (surface));
+ status = cairo_surface_set_user_data (surface, &xcb_closure_key, xtc, NULL);
+ if (status == CAIRO_STATUS_SUCCESS)
+ return surface;
+
+ cairo_surface_destroy (surface);
+
+ _cairo_boilerplate_xcb_cleanup (xtc);
+ return cairo_boilerplate_surface_create_in_error (status);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_xcb_create_window_db (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ xcb_target_closure_t *xtc;
+ xcb_connection_t *c;
+ xcb_screen_t *s;
+ xcb_void_cookie_t cookie;
+ cairo_surface_t *surface;
+ cairo_status_t status;
+ uint32_t values[] = { 1 };
+
+ *closure = xtc = xmalloc (sizeof (xcb_target_closure_t));
+
+ if (width == 0)
+ width = 1;
+ if (height == 0)
+ height = 1;
+
+ xtc->c = c = xcb_connect(NULL,NULL);
+ if (xcb_connection_has_error(c)) {
+ free (xtc);
+ return NULL;
+ }
+
+ xtc->surface = NULL;
+
+ s = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
+ if (width > s->width_in_pixels || height > s->height_in_pixels) {
+ xcb_disconnect (c);
+ free (xtc);
+ return NULL;
+ }
+
+ xtc->is_pixmap = FALSE;
+ xtc->drawable = xcb_generate_id (c);
+ cookie = xcb_create_window_checked (c,
+ s->root_depth,
+ xtc->drawable,
+ s->root,
+ 0, 0, width, height, 0,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ s->root_visual,
+ XCB_CW_OVERRIDE_REDIRECT,
+ values);
+ xcb_map_window (c, xtc->drawable);
+
+ /* slow, but sure */
+ if (xcb_request_check (c, cookie) != NULL) {
+ xcb_disconnect (c);
+ free (xtc);
+ return NULL;
+ }
+
+ xtc->surface = cairo_xcb_surface_create (c,
+ xtc->drawable,
+ lookup_visual (s, s->root_visual),
+ width, height);
+ surface = cairo_surface_create_similar (xtc->surface, content, width, height);
+
+ xtc->device = cairo_device_reference (cairo_surface_get_device (surface));
+ status = cairo_surface_set_user_data (surface, &xcb_closure_key, xtc, NULL);
+ if (status == CAIRO_STATUS_SUCCESS)
+ return surface;
+
+ cairo_surface_destroy (surface);
+
+ _cairo_boilerplate_xcb_cleanup (xtc);
+ return cairo_boilerplate_surface_create_in_error (status);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_xcb_create_render_0_0 (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ xcb_screen_t *root;
+ xcb_target_closure_t *xtc;
+ xcb_connection_t *c;
+ xcb_render_pictforminfo_t *render_format;
+ int depth;
+ xcb_void_cookie_t cookie;
+ cairo_surface_t *surface;
+ cairo_status_t status;
+ void *formats;
+
+ *closure = xtc = xmalloc (sizeof (xcb_target_closure_t));
+
+ if (width == 0)
+ width = 1;
+ if (height == 0)
+ height = 1;
+
+ xtc->c = c = xcb_connect(NULL,NULL);
+ if (xcb_connection_has_error(c)) {
+ free (xtc);
+ return NULL;
+ }
+
+ root = xcb_setup_roots_iterator(xcb_get_setup(c)).data;
+
+ xtc->surface = NULL;
+ xtc->is_pixmap = TRUE;
+ xtc->drawable = xcb_generate_id (c);
+ switch (content) {
+ case CAIRO_CONTENT_COLOR:
+ depth = 24;
+ cookie = xcb_create_pixmap_checked (c, depth,
+ xtc->drawable, root->root,
+ width, height);
+ break;
+
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ depth = 32;
+ cookie = xcb_create_pixmap_checked (c, depth,
+ xtc->drawable, root->root,
+ width, height);
+ break;
+
+ case CAIRO_CONTENT_ALPHA: /* would be XCB_PICT_STANDARD_A_8 */
+ default:
+ xcb_disconnect (c);
+ free (xtc);
+ return NULL;
+ }
+
+ /* slow, but sure */
+ if (xcb_request_check (c, cookie) != NULL) {
+ xcb_disconnect (c);
+ free (xtc);
+ return NULL;
+ }
+ xcb_flush (c);
+
+ render_format = find_depth (c, depth, &formats);
+ if (render_format == NULL) {
+ xcb_disconnect (c);
+ free (xtc);
+ return NULL;
+ }
+
+ surface = cairo_xcb_surface_create_with_xrender_format (c, root,
+ xtc->drawable,
+ render_format,
+ width, height);
+ if (cairo_surface_status (surface)) {
+ free (formats);
+ xcb_disconnect (c);
+ free (xtc);
+ return surface;
+ }
+
+ xtc->device = cairo_device_reference (cairo_surface_get_device (surface));
+ cairo_xcb_device_debug_cap_xrender_version (xtc->device, 0, 0);
+
+ assert (cairo_surface_get_device (surface) == xtc->device);
+
+ status = cairo_surface_set_user_data (surface, &xcb_closure_key, xtc, NULL);
+ if (status == CAIRO_STATUS_SUCCESS)
+ return surface;
+
+ cairo_surface_destroy (surface);
+
+ _cairo_boilerplate_xcb_cleanup (xtc);
+ return cairo_boilerplate_surface_create_in_error (status);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_xcb_create_fallback (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ xcb_target_closure_t *xtc;
+ xcb_connection_t *c;
+ xcb_screen_t *s;
+ xcb_void_cookie_t cookie;
+ cairo_surface_t *surface;
+ cairo_status_t status;
+ uint32_t values[] = { 1 };
+
+ *closure = xtc = xmalloc (sizeof (xcb_target_closure_t));
+
+ if (width == 0)
+ width = 1;
+ if (height == 0)
+ height = 1;
+
+ xtc->c = c = xcb_connect (NULL,NULL);
+ if (xcb_connection_has_error(c)) {
+ free (xtc);
+ return NULL;
+ }
+
+ s = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
+ if (width > s->width_in_pixels || height > s->height_in_pixels) {
+ xcb_disconnect (c);
+ free (xtc);
+ return NULL;
+ }
+
+ xtc->surface = NULL;
+ xtc->is_pixmap = FALSE;
+ xtc->drawable = xcb_generate_id (c);
+ cookie = xcb_create_window_checked (c,
+ s->root_depth,
+ xtc->drawable,
+ s->root,
+ 0, 0, width, height, 0,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ s->root_visual,
+ XCB_CW_OVERRIDE_REDIRECT,
+ values);
+ xcb_map_window (c, xtc->drawable);
+
+ /* slow, but sure */
+ if (xcb_request_check (c, cookie) != NULL) {
+ xcb_disconnect (c);
+ free (xtc);
+ return NULL;
+ }
+
+ surface = cairo_xcb_surface_create (c,
+ xtc->drawable,
+ lookup_visual (s, s->root_visual),
+ width, height);
+ if (cairo_surface_status (surface)) {
+ xcb_disconnect (c);
+ free (xtc);
+ return surface;
+ }
+
+ cairo_xcb_device_debug_cap_xrender_version (cairo_surface_get_device (surface),
+ -1, -1);
+
+ xtc->device = cairo_device_reference (cairo_surface_get_device (surface));
+ status = cairo_surface_set_user_data (surface, &xcb_closure_key, xtc, NULL);
+ if (status == CAIRO_STATUS_SUCCESS)
+ return surface;
+
+ cairo_surface_destroy (surface);
+
+ _cairo_boilerplate_xcb_cleanup (xtc);
+ return cairo_boilerplate_surface_create_in_error (status);
+}
+
+static cairo_status_t
+_cairo_boilerplate_xcb_finish_surface (cairo_surface_t *surface)
+{
+ xcb_target_closure_t *xtc = cairo_surface_get_user_data (surface,
+ &xcb_closure_key);
+ cairo_status_t status;
+
+ if (xtc->surface != NULL) {
+ cairo_t *cr;
+
+ cr = cairo_create (xtc->surface);
+ cairo_set_source_surface (cr, surface, 0, 0);
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+ cairo_paint (cr);
+ cairo_destroy (cr);
+
+ surface = xtc->surface;
+ }
+
+ cairo_surface_flush (surface);
+ if (cairo_surface_status (surface))
+ return cairo_surface_status (surface);
+
+ /* First synchronize with the X server to make sure there are no more errors
+ * in-flight which we would miss otherwise */
+ _cairo_boilerplate_xcb_sync_server (xtc);
+ status = _cairo_boilerplate_xcb_handle_errors (xtc);
+ if (status)
+ return status;
+
+ if (xcb_connection_has_error (xtc->c))
+ return CAIRO_STATUS_WRITE_ERROR;
+
+ return CAIRO_STATUS_SUCCESS;
+}
+
+static const cairo_boilerplate_target_t targets[] = {
+ /* Acceleration architectures may make the results differ by a
+ * bit, so we set the error tolerance to 1. */
+ {
+ "xcb", "traps", NULL, NULL,
+ CAIRO_SURFACE_TYPE_XCB, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_xcb_surface_create_with_xrender_format",
+ _cairo_boilerplate_xcb_create_surface,
+ _cairo_boilerplate_xcb_create_similar,
+ NULL,
+ _cairo_boilerplate_xcb_finish_surface,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_xcb_cleanup,
+ _cairo_boilerplate_xcb_synchronize,
+ NULL,
+ TRUE, FALSE, FALSE
+ },
+ {
+ "xcb", "traps", NULL, NULL,
+ CAIRO_SURFACE_TYPE_XCB, CAIRO_CONTENT_COLOR, 1,
+ "cairo_xcb_surface_create_with_xrender_format",
+ _cairo_boilerplate_xcb_create_surface,
+ _cairo_boilerplate_xcb_create_similar,
+ NULL,
+ _cairo_boilerplate_xcb_finish_surface,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_xcb_cleanup,
+ _cairo_boilerplate_xcb_synchronize,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+ {
+ "xcb-window", "traps", NULL, NULL,
+ CAIRO_SURFACE_TYPE_XCB, CAIRO_CONTENT_COLOR, 1,
+ "cairo_xcb_surface_create_with_xrender_format",
+ _cairo_boilerplate_xcb_create_window,
+ _cairo_boilerplate_xcb_create_similar,
+ NULL,
+ _cairo_boilerplate_xcb_finish_surface,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_xcb_cleanup,
+ _cairo_boilerplate_xcb_synchronize,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+ {
+ "xcb-window&", "traps", NULL, NULL,
+ CAIRO_SURFACE_TYPE_XCB, CAIRO_CONTENT_COLOR, 1,
+ "cairo_xcb_surface_create_with_xrender_format",
+ _cairo_boilerplate_xcb_create_window_db,
+ _cairo_boilerplate_xcb_create_similar,
+ NULL,
+ _cairo_boilerplate_xcb_finish_surface,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_xcb_cleanup,
+ _cairo_boilerplate_xcb_synchronize,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+ {
+ "xcb-render-0_0", "xlib-fallback", NULL, NULL,
+ CAIRO_SURFACE_TYPE_XCB, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_xcb_surface_create_with_xrender_format",
+ _cairo_boilerplate_xcb_create_render_0_0,
+ cairo_surface_create_similar,
+ NULL,
+ _cairo_boilerplate_xcb_finish_surface,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_xcb_cleanup,
+ _cairo_boilerplate_xcb_synchronize,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+ {
+ "xcb-render-0_0", "xlib-fallback", NULL, NULL,
+ CAIRO_SURFACE_TYPE_XCB, CAIRO_CONTENT_COLOR, 1,
+ "cairo_xcb_surface_create_with_xrender_format",
+ _cairo_boilerplate_xcb_create_render_0_0,
+ cairo_surface_create_similar,
+ NULL,
+ _cairo_boilerplate_xcb_finish_surface,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_xcb_cleanup,
+ _cairo_boilerplate_xcb_synchronize,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+ {
+ "xcb-fallback", "xlib-fallback", NULL, NULL,
+ CAIRO_SURFACE_TYPE_XCB, CAIRO_CONTENT_COLOR, 1,
+ "cairo_xcb_surface_create_with_xrender_format",
+ _cairo_boilerplate_xcb_create_fallback,
+ cairo_surface_create_similar,
+ NULL,
+ _cairo_boilerplate_xcb_finish_surface,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_xcb_cleanup,
+ _cairo_boilerplate_xcb_synchronize,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+};
+CAIRO_BOILERPLATE (xcb, targets)
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-xlib.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-xlib.c
new file mode 100644
index 0000000..f3d5598
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-xlib.c
@@ -0,0 +1,638 @@
+/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
+/*
+ * Copyright © 2004,2006 Red Hat, Inc.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Author: Carl D. Worth <cworth@cworth.org>
+ */
+
+#include "cairo-boilerplate-private.h"
+#include "cairo-boilerplate-xlib.h"
+
+#include <cairo-xlib.h>
+#if CAIRO_HAS_XLIB_XRENDER_SURFACE
+#include <cairo-xlib-xrender.h>
+#endif
+
+#include <X11/Xutil.h> /* for XDestroyImage */
+
+#if !CAIRO_HAS_XLIB_XRENDER_SURFACE
+#define PolyModePrecise 0
+#endif
+
+static const cairo_user_data_key_t key;
+
+typedef struct _xlib_target_closure {
+ Display *dpy;
+ Drawable drawable;
+ cairo_bool_t drawable_is_pixmap;
+} xlib_target_closure_t;
+
+static void
+_cairo_boilerplate_xlib_cleanup (void *closure)
+{
+ xlib_target_closure_t *xtc = closure;
+
+ if (xtc->drawable) {
+ if (xtc->drawable_is_pixmap)
+ XFreePixmap (xtc->dpy, xtc->drawable);
+ else
+ XDestroyWindow (xtc->dpy, xtc->drawable);
+ }
+ XCloseDisplay (xtc->dpy);
+ free (xtc);
+}
+
+static void
+_cairo_boilerplate_xlib_synchronize (void *closure)
+{
+ xlib_target_closure_t *xtc = closure;
+ XImage *ximage;
+
+ ximage = XGetImage (xtc->dpy, xtc->drawable,
+ 0, 0, 1, 1, AllPlanes, ZPixmap);
+ if (ximage != NULL)
+ XDestroyImage (ximage);
+}
+
+static cairo_bool_t
+_cairo_boilerplate_xlib_check_screen_size (Display *dpy,
+ int screen,
+ int width,
+ int height)
+{
+ Screen *scr = XScreenOfDisplay (dpy, screen);
+ return width <= WidthOfScreen (scr) && height <= HeightOfScreen (scr);
+}
+
+static void
+_cairo_boilerplate_xlib_setup_test_surface (cairo_surface_t *surface)
+{
+
+ /* For testing purposes, tell the X server to strictly adhere to the
+ * Render specification.
+ */
+ cairo_xlib_device_debug_set_precision(cairo_surface_get_device(surface),
+ PolyModePrecise);
+}
+
+
+#if CAIRO_HAS_XLIB_XRENDER_SURFACE
+/* For the xlib backend we distinguish between TEST and PERF mode in a
+ * couple of ways.
+ *
+ * For TEST, we always test against pixmaps of depth 32 (for
+ * COLOR_ALPHA) or 24 (for COLOR) and we use XSynchronize to make it
+ * easier to debug problems.
+ *
+ * For PERF, we test against 32-bit pixmaps for COLOR_ALPHA, but for
+ * COLOR we test against _windows_ at the depth of the default visual.
+ * For obvious reasons, we don't use XSynchronize.
+ */
+static cairo_surface_t *
+_cairo_boilerplate_xlib_test_create_surface (Display *dpy,
+ cairo_content_t content,
+ int width,
+ int height,
+ xlib_target_closure_t *xtc)
+{
+ XRenderPictFormat *xrender_format;
+ cairo_surface_t *surface;
+
+ /* This kills performance, but it makes debugging much
+ * easier. That's why we have it here when in TEST mode, but not
+ * over in PERF mode. */
+ XSynchronize (xtc->dpy, 1);
+
+ /* XXX: Currently we don't do any xlib testing when the X server
+ * doesn't have the Render extension. We could do better here,
+ * (perhaps by converting the tests from ARGB32 to RGB24). One
+ * step better would be to always test the non-Render fallbacks
+ * for each test even if the server does have the Render
+ * extension. That would probably be through another
+ * cairo_boilerplate_target which would use an extended version of
+ * cairo_test_xlib_disable_render. */
+ switch (content) {
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ xrender_format = XRenderFindStandardFormat (dpy, PictStandardARGB32);
+ break;
+ case CAIRO_CONTENT_COLOR:
+ xrender_format = XRenderFindStandardFormat (dpy, PictStandardRGB24);
+ break;
+ case CAIRO_CONTENT_ALPHA:
+ default:
+ CAIRO_BOILERPLATE_DEBUG (("Invalid content for xlib test: %d\n", content));
+ return NULL;
+ }
+ if (xrender_format == NULL) {
+ CAIRO_BOILERPLATE_DEBUG (("X server does not have the Render extension.\n"));
+ return NULL;
+ }
+
+ xtc->drawable = XCreatePixmap (dpy, DefaultRootWindow (dpy),
+ width, height, xrender_format->depth);
+ xtc->drawable_is_pixmap = TRUE;
+
+ surface = cairo_xlib_surface_create_with_xrender_format (dpy, xtc->drawable,
+ DefaultScreenOfDisplay (dpy),
+ xrender_format,
+ width, height);
+
+ _cairo_boilerplate_xlib_setup_test_surface(surface);
+
+ return surface;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_xlib_perf_create_surface (Display *dpy,
+ cairo_content_t content,
+ int width,
+ int height,
+ xlib_target_closure_t *xtc)
+{
+ XSetWindowAttributes attr;
+ XRenderPictFormat *xrender_format;
+ Visual *visual;
+
+ switch (content) {
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ xrender_format = XRenderFindStandardFormat (dpy, PictStandardARGB32);
+ if (xrender_format == NULL) {
+ CAIRO_BOILERPLATE_DEBUG (("X server does not have the Render extension.\n"));
+ return NULL;
+ }
+
+ xtc->drawable = XCreatePixmap (dpy, DefaultRootWindow (dpy),
+ width, height, xrender_format->depth);
+ xtc->drawable_is_pixmap = TRUE;
+ break;
+
+ case CAIRO_CONTENT_COLOR:
+ if (! _cairo_boilerplate_xlib_check_screen_size (dpy,
+ DefaultScreen (dpy),
+ width, height)) {
+ CAIRO_BOILERPLATE_DEBUG (("Surface is larger than the Screen.\n"));
+ return NULL;
+ }
+
+ visual = DefaultVisual (dpy, DefaultScreen (dpy));
+ xrender_format = XRenderFindVisualFormat (dpy, visual);
+ if (xrender_format == NULL) {
+ CAIRO_BOILERPLATE_DEBUG (("X server does not have the Render extension.\n"));
+ return NULL;
+ }
+
+ attr.override_redirect = True;
+ xtc->drawable = XCreateWindow (dpy, DefaultRootWindow (dpy), 0, 0,
+ width, height, 0, xrender_format->depth,
+ InputOutput, visual, CWOverrideRedirect, &attr);
+ XMapWindow (dpy, xtc->drawable);
+ xtc->drawable_is_pixmap = FALSE;
+ break;
+
+ case CAIRO_CONTENT_ALPHA:
+ default:
+ CAIRO_BOILERPLATE_DEBUG (("Invalid content for xlib test: %d\n", content));
+ return NULL;
+ }
+
+ return cairo_xlib_surface_create_with_xrender_format (dpy, xtc->drawable,
+ DefaultScreenOfDisplay (dpy),
+ xrender_format,
+ width, height);
+}
+
+struct similar {
+ Display *dpy;
+ Pixmap pixmap;
+};
+
+static void _destroy_similar (void *closure)
+{
+ struct similar *similar = closure;
+
+ XFreePixmap (similar->dpy, similar->pixmap);
+ free (similar);
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_xlib_create_similar (cairo_surface_t *other,
+ cairo_content_t content,
+ int width,
+ int height)
+{
+ XRenderPictFormat *xrender_format;
+ uint32_t format;
+ struct similar *similar;
+ cairo_surface_t *surface;
+
+ similar = malloc (sizeof (*similar));
+ similar->dpy = cairo_xlib_surface_get_display (other);
+
+ switch (content) {
+ case CAIRO_CONTENT_COLOR:
+ format = PictStandardRGB24;
+ break;
+ case CAIRO_CONTENT_ALPHA:
+ format = PictStandardA8;
+ break;
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ default:
+ format = PictStandardARGB32;
+ break;
+ }
+
+ xrender_format = XRenderFindStandardFormat (similar->dpy, format);
+ similar->pixmap = XCreatePixmap (similar->dpy,
+ DefaultRootWindow (similar->dpy),
+ width, height,
+ xrender_format->depth);
+
+ surface =
+ cairo_xlib_surface_create_with_xrender_format (similar->dpy,
+ similar->pixmap,
+ DefaultScreenOfDisplay (similar->dpy),
+ xrender_format,
+ width, height);
+
+ cairo_surface_set_user_data (surface, &key, similar, _destroy_similar);
+
+ return surface;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_xlib_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ xlib_target_closure_t *xtc;
+ Display *dpy;
+ cairo_surface_t *surface;
+
+ *closure = xtc = xcalloc (1, sizeof (xlib_target_closure_t));
+
+ width = ceil (width);
+ if (width < 1)
+ width = 1;
+
+ height = ceil (height);
+ if (height < 1)
+ height = 1;
+
+ xtc->dpy = dpy = XOpenDisplay (NULL);
+ if (xtc->dpy == NULL) {
+ free (xtc);
+ CAIRO_BOILERPLATE_DEBUG (("Failed to open display: %s\n", XDisplayName(0)));
+ return NULL;
+ }
+
+ if (mode == CAIRO_BOILERPLATE_MODE_TEST)
+ surface = _cairo_boilerplate_xlib_test_create_surface (dpy, content, width, height, xtc);
+ else /* mode == CAIRO_BOILERPLATE_MODE_PERF */
+ surface = _cairo_boilerplate_xlib_perf_create_surface (dpy, content, width, height, xtc);
+
+ if (surface == NULL || cairo_surface_status (surface))
+ _cairo_boilerplate_xlib_cleanup (xtc);
+
+ return surface;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_xlib_render_0_0_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ xlib_target_closure_t *xtc;
+ Display *dpy;
+ int screen;
+ Pixmap pixmap;
+ cairo_surface_t *surface, *dummy;
+
+ *closure = xtc = xcalloc (1, sizeof (xlib_target_closure_t));
+
+ width = ceil (width);
+ if (width < 1)
+ width = 1;
+
+ height = ceil (height);
+ if (height < 1)
+ height = 1;
+
+ xtc->dpy = dpy = XOpenDisplay (NULL);
+ if (xtc->dpy == NULL) {
+ free (xtc);
+ CAIRO_BOILERPLATE_DEBUG (("Failed to open display: %s\n", XDisplayName(0)));
+ return NULL;
+ }
+
+
+ screen = DefaultScreen (dpy);
+ pixmap = XCreatePixmap (dpy, DefaultRootWindow (dpy), 1, 1,
+ DefaultDepth (dpy, screen));
+ dummy = cairo_xlib_surface_create (dpy, pixmap,
+ DefaultVisual (dpy, screen),
+ 1, 1);
+ cairo_xlib_device_debug_cap_xrender_version (cairo_surface_get_device (dummy),
+ 0, 0);
+
+ if (mode == CAIRO_BOILERPLATE_MODE_TEST)
+ surface = _cairo_boilerplate_xlib_test_create_surface (dpy, content, width, height, xtc);
+ else /* mode == CAIRO_BOILERPLATE_MODE_PERF */
+ surface = _cairo_boilerplate_xlib_perf_create_surface (dpy, content, width, height, xtc);
+
+ cairo_surface_destroy (dummy);
+ XFreePixmap (dpy, pixmap);
+
+ if (surface == NULL || cairo_surface_status (surface))
+ _cairo_boilerplate_xlib_cleanup (xtc);
+
+ return surface;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_xlib_window_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ xlib_target_closure_t *xtc;
+ Display *dpy;
+ int screen;
+ XSetWindowAttributes attr;
+ cairo_surface_t *surface;
+
+ /* We're not yet bothering to support perf mode for the
+ * xlib-fallback surface. */
+ if (mode == CAIRO_BOILERPLATE_MODE_PERF)
+ return NULL;
+
+ /* We also don't support drawing with destination-alpha in the
+ * xlib-fallback surface. */
+ if (content == CAIRO_CONTENT_COLOR_ALPHA)
+ return NULL;
+
+ *closure = xtc = xmalloc (sizeof (xlib_target_closure_t));
+
+ width = ceil (width);
+ if (width < 1)
+ width = 1;
+
+ height = ceil (height);
+ if (height < 1)
+ height = 1;
+
+ xtc->dpy = dpy = XOpenDisplay (NULL);
+ if (xtc->dpy == NULL) {
+ CAIRO_BOILERPLATE_DEBUG (("Failed to open display: %s\n", XDisplayName(0)));
+ free (xtc);
+ return NULL;
+ }
+
+ /* This kills performance, but it makes debugging much
+ * easier. That's why we have it here only after explicitly not
+ * supporting PERF mode.*/
+ XSynchronize (dpy, 1);
+
+ screen = DefaultScreen (dpy);
+ if (! _cairo_boilerplate_xlib_check_screen_size (dpy, screen,
+ width, height)) {
+ CAIRO_BOILERPLATE_DEBUG (("Surface is larger than the Screen.\n"));
+ XCloseDisplay (dpy);
+ free (xtc);
+ return NULL;
+ }
+
+ attr.override_redirect = True;
+ xtc->drawable = XCreateWindow (dpy, DefaultRootWindow (dpy),
+ 0, 0,
+ width, height, 0,
+ DefaultDepth (dpy, screen),
+ InputOutput,
+ DefaultVisual (dpy, screen),
+ CWOverrideRedirect, &attr);
+ XMapWindow (dpy, xtc->drawable);
+ xtc->drawable_is_pixmap = FALSE;
+
+ surface = cairo_xlib_surface_create (dpy, xtc->drawable,
+ DefaultVisual (dpy, screen),
+ width, height);
+ if (cairo_surface_status (surface))
+ _cairo_boilerplate_xlib_cleanup (xtc);
+
+ _cairo_boilerplate_xlib_setup_test_surface(surface);
+
+ return surface;
+}
+#endif
+
+
+#if CAIRO_HAS_XLIB_SURFACE
+/* The xlib-fallback target differs from the xlib target in two ways:
+ *
+ * 1. It creates its surfaces without relying on the Render extension
+ *
+ * 2. It disables use of the Render extension for its surfaces
+ *
+ * This provides testing of the non-Render fallback paths we have in
+ * cairo-xlib-surface.c
+ */
+static cairo_surface_t *
+_cairo_boilerplate_xlib_fallback_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ xlib_target_closure_t *xtc;
+ Display *dpy;
+ int screen;
+ XSetWindowAttributes attr;
+ cairo_surface_t *surface, *dummy;
+
+ /* We're not yet bothering to support perf mode for the
+ * xlib-fallback surface. */
+ if (mode == CAIRO_BOILERPLATE_MODE_PERF)
+ return NULL;
+
+ /* We also don't support drawing with destination-alpha in the
+ * xlib-fallback surface. */
+ if (content == CAIRO_CONTENT_COLOR_ALPHA)
+ return NULL;
+
+ *closure = xtc = xmalloc (sizeof (xlib_target_closure_t));
+
+ width = ceil (width);
+ if (width < 1)
+ width = 1;
+
+ height = ceil (height);
+ if (height < 1)
+ height = 1;
+
+ xtc->dpy = dpy = XOpenDisplay (NULL);
+ if (xtc->dpy == NULL) {
+ CAIRO_BOILERPLATE_DEBUG (("Failed to open display: %s\n", XDisplayName(0)));
+ free (xtc);
+ return NULL;
+ }
+
+ /* This kills performance, but it makes debugging much
+ * easier. That's why we have it here only after explicitly not
+ * supporting PERF mode.*/
+ XSynchronize (dpy, 1);
+
+ screen = DefaultScreen (dpy);
+ if (! _cairo_boilerplate_xlib_check_screen_size (dpy, screen,
+ width, height)) {
+ CAIRO_BOILERPLATE_DEBUG (("Surface is larger than the Screen.\n"));
+ XCloseDisplay (dpy);
+ free (xtc);
+ return NULL;
+ }
+
+ attr.override_redirect = True;
+ xtc->drawable = XCreateWindow (dpy, DefaultRootWindow (dpy),
+ 0, 0,
+ width, height, 0,
+ DefaultDepth (dpy, screen),
+ InputOutput,
+ DefaultVisual (dpy, screen),
+ CWOverrideRedirect, &attr);
+ XMapWindow (dpy, xtc->drawable);
+ xtc->drawable_is_pixmap = FALSE;
+
+ dummy = cairo_xlib_surface_create (dpy, xtc->drawable,
+ DefaultVisual (dpy, screen),
+ width, height);
+ cairo_xlib_device_debug_cap_xrender_version (cairo_surface_get_device (dummy),
+ -1, -1);
+
+ surface = cairo_xlib_surface_create (dpy, xtc->drawable,
+ DefaultVisual (dpy, screen),
+ width, height);
+ cairo_surface_destroy (dummy);
+ if (cairo_surface_status (surface))
+ _cairo_boilerplate_xlib_cleanup (xtc);
+
+ _cairo_boilerplate_xlib_setup_test_surface(surface);
+
+ return surface;
+}
+#endif
+
+static const cairo_boilerplate_target_t targets[] = {
+#if CAIRO_HAS_XLIB_XRENDER_SURFACE
+ /* Acceleration architectures may make the results differ by a
+ * bit, so we set the error tolerance to 1. */
+ {
+ "xlib", "traps", NULL, "xlib-fallback",
+ CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_xlib_surface_create_with_xrender_format",
+ _cairo_boilerplate_xlib_create_surface,
+ _cairo_boilerplate_xlib_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_xlib_cleanup,
+ _cairo_boilerplate_xlib_synchronize,
+ NULL,
+ TRUE, FALSE, FALSE
+ },
+ {
+ "xlib", "traps", NULL, "xlib-fallback",
+ CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR, 1,
+ "cairo_xlib_surface_create_with_xrender_format",
+ _cairo_boilerplate_xlib_create_surface,
+ _cairo_boilerplate_xlib_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_xlib_cleanup,
+ _cairo_boilerplate_xlib_synchronize,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+ {
+ "xlib-window", "traps", NULL, NULL,
+ CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR, 1,
+ "cairo_xlib_surface_create",
+ _cairo_boilerplate_xlib_window_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_xlib_cleanup,
+ _cairo_boilerplate_xlib_synchronize,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+ {
+ "xlib-render-0_0", "mask", NULL, NULL,
+ CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR, 1,
+ "cairo_xlib_surface_create",
+ _cairo_boilerplate_xlib_render_0_0_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_xlib_cleanup,
+ _cairo_boilerplate_xlib_synchronize,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+#endif
+#if CAIRO_HAS_XLIB_SURFACE
+ /* This is a fallback surface which uses xlib fallbacks instead of
+ * the Render extension. */
+ {
+ "xlib-fallback", "image", NULL, NULL,
+ CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR, 1,
+ "cairo_xlib_surface_create",
+ _cairo_boilerplate_xlib_fallback_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_xlib_cleanup,
+ _cairo_boilerplate_xlib_synchronize,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+#endif
+};
+CAIRO_BOILERPLATE (xlib, targets)
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-xlib.h b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-xlib.h
new file mode 100644
index 0000000..9a63918
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate-xlib.h
@@ -0,0 +1,33 @@
+/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
+/*
+ * Copyright © 2007 Red Hat, Inc.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Author: Behdad Esfahbod <behdad@behdad.org>
+ */
+
+#ifndef _CAIRO_BOILERPLATE_XLIB_H_
+#define _CAIRO_BOILERPLATE_XLIB_H_
+
+cairo_status_t
+cairo_boilerplate_xlib_surface_disable_render (cairo_surface_t *surface);
+
+#endif
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate.c b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate.c
new file mode 100644
index 0000000..4804dea
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate.c
@@ -0,0 +1,1103 @@
+/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
+/*
+ * Copyright © 2004,2006 Red Hat, Inc.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Author: Carl D. Worth <cworth@cworth.org>
+ */
+
+#define CAIRO_VERSION_H 1
+
+#include "cairo-boilerplate-private.h"
+#include "cairo-boilerplate-scaled-font.h"
+
+#include <pixman.h>
+
+#include <cairo-types-private.h>
+#include <cairo-scaled-font-private.h>
+
+#if CAIRO_HAS_SCRIPT_SURFACE
+#include <cairo-script.h>
+#endif
+
+/* get the "real" version info instead of dummy cairo-version.h */
+#undef CAIRO_VERSION_H
+#include "../cairo-version.h"
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <assert.h>
+#include <errno.h>
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#if HAVE_UNISTD_H && HAVE_FCNTL_H && HAVE_SIGNAL_H && HAVE_SYS_STAT_H && HAVE_SYS_SOCKET_H && HAVE_SYS_UN_H
+#include <unistd.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+
+#define HAS_DAEMON 1
+#define SOCKET_PATH "./.any2ppm"
+#endif
+
+cairo_content_t
+cairo_boilerplate_content (cairo_content_t content)
+{
+ if (content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED)
+ content = CAIRO_CONTENT_COLOR_ALPHA;
+
+ return content;
+}
+
+const char *
+cairo_boilerplate_content_name (cairo_content_t content)
+{
+ /* For the purpose of the content name, we don't distinguish the
+ * flattened content value.
+ */
+ switch (cairo_boilerplate_content (content)) {
+ case CAIRO_CONTENT_COLOR:
+ return "rgb24";
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ return "argb32";
+ case CAIRO_CONTENT_ALPHA:
+ default:
+ assert (0); /* not reached */
+ return "---";
+ }
+}
+
+static const char *
+_cairo_boilerplate_content_visible_name (cairo_content_t content)
+{
+ switch (cairo_boilerplate_content (content)) {
+ case CAIRO_CONTENT_COLOR:
+ return "rgb";
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ return "rgba";
+ case CAIRO_CONTENT_ALPHA:
+ return "a";
+ default:
+ assert (0); /* not reached */
+ return "---";
+ }
+}
+
+cairo_format_t
+cairo_boilerplate_format_from_content (cairo_content_t content)
+{
+ cairo_format_t format;
+
+ switch (content) {
+ case CAIRO_CONTENT_COLOR:
+ format = CAIRO_FORMAT_RGB24;
+ break;
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ format = CAIRO_FORMAT_ARGB32;
+ break;
+ case CAIRO_CONTENT_ALPHA:
+ format = CAIRO_FORMAT_A8;
+ break;
+ default:
+ assert (0); /* not reached */
+ format = CAIRO_FORMAT_INVALID;
+ break;
+ }
+
+ return format;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_image_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ cairo_format_t format;
+
+ *closure = NULL;
+
+ if (content == CAIRO_CONTENT_COLOR_ALPHA) {
+ format = CAIRO_FORMAT_ARGB32;
+ } else if (content == CAIRO_CONTENT_COLOR) {
+ format = CAIRO_FORMAT_RGB24;
+ } else {
+ assert (0); /* not reached */
+ return NULL;
+ }
+
+ return cairo_image_surface_create (format, ceil (width), ceil (height));
+}
+
+static const cairo_user_data_key_t key;
+
+static cairo_surface_t *
+_cairo_boilerplate_image_create_similar (cairo_surface_t *other,
+ cairo_content_t content,
+ int width, int height)
+{
+ cairo_format_t format;
+ cairo_surface_t *surface;
+ int stride;
+ void *ptr;
+
+ switch (content) {
+ case CAIRO_CONTENT_ALPHA:
+ format = CAIRO_FORMAT_A8;
+ break;
+ case CAIRO_CONTENT_COLOR:
+ format = CAIRO_FORMAT_RGB24;
+ break;
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ default:
+ format = CAIRO_FORMAT_ARGB32;
+ break;
+ }
+
+ stride = cairo_format_stride_for_width(format, width);
+ ptr = malloc (stride* height);
+
+ surface = cairo_image_surface_create_for_data (ptr, format,
+ width, height, stride);
+ cairo_surface_set_user_data (surface, &key, ptr, free);
+
+ return surface;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_image16_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ *closure = NULL;
+
+ /* XXX force CAIRO_CONTENT_COLOR */
+ return cairo_image_surface_create (CAIRO_FORMAT_RGB16_565, ceil (width), ceil (height));
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_image16_create_similar (cairo_surface_t *other,
+ cairo_content_t content,
+ int width, int height)
+{
+ cairo_format_t format;
+ cairo_surface_t *surface;
+ int stride;
+ void *ptr;
+
+ switch (content) {
+ case CAIRO_CONTENT_ALPHA:
+ format = CAIRO_FORMAT_A8;
+ break;
+ case CAIRO_CONTENT_COLOR:
+ format = CAIRO_FORMAT_RGB16_565;
+ break;
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ default:
+ format = CAIRO_FORMAT_ARGB32;
+ break;
+ }
+
+ stride = cairo_format_stride_for_width(format, width);
+ ptr = malloc (stride* height);
+
+ surface = cairo_image_surface_create_for_data (ptr, format,
+ width, height, stride);
+ cairo_surface_set_user_data (surface, &key, ptr, free);
+
+ return surface;
+}
+
+static char *
+_cairo_boilerplate_image_describe (void *closure)
+{
+ char *s;
+
+ xasprintf (&s, "pixman %s", pixman_version_string ());
+
+ return s;
+}
+
+#if CAIRO_HAS_RECORDING_SURFACE
+static cairo_surface_t *
+_cairo_boilerplate_recording_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ cairo_rectangle_t extents;
+
+ extents.x = 0;
+ extents.y = 0;
+ extents.width = width;
+ extents.height = height;
+ return *closure = cairo_surface_reference (cairo_recording_surface_create (content, &extents));
+}
+
+static void
+_cairo_boilerplate_recording_surface_cleanup (void *closure)
+{
+ cairo_surface_finish (closure);
+ cairo_surface_destroy (closure);
+}
+#endif
+
+const cairo_user_data_key_t cairo_boilerplate_output_basename_key;
+
+cairo_surface_t *
+_cairo_boilerplate_get_image_surface (cairo_surface_t *src,
+ int page,
+ int width,
+ int height)
+{
+ cairo_surface_t *surface, *image;
+ cairo_t *cr;
+ cairo_status_t status;
+ cairo_format_t format;
+
+ if (cairo_surface_status (src))
+ return cairo_surface_reference (src);
+
+ if (page != 0)
+ return cairo_boilerplate_surface_create_in_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH);
+
+ /* extract sub-surface */
+ switch (cairo_surface_get_content (src)) {
+ case CAIRO_CONTENT_ALPHA:
+ format = CAIRO_FORMAT_A8;
+ break;
+ case CAIRO_CONTENT_COLOR:
+ format = CAIRO_FORMAT_RGB24;
+ break;
+ default:
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ format = CAIRO_FORMAT_ARGB32;
+ break;
+ }
+ surface = cairo_image_surface_create (format, width, height);
+ assert (cairo_surface_get_content (surface) == cairo_surface_get_content (src));
+ image = cairo_surface_reference (surface);
+
+ /* open a logging channel (only interesting for recording surfaces) */
+#if CAIRO_HAS_SCRIPT_SURFACE && CAIRO_HAS_RECORDING_SURFACE
+ if (cairo_surface_get_type (src) == CAIRO_SURFACE_TYPE_RECORDING) {
+ const char *test_name;
+
+ test_name = cairo_surface_get_user_data (src,
+ &cairo_boilerplate_output_basename_key);
+ if (test_name != NULL) {
+ cairo_device_t *ctx;
+ char *filename;
+
+ cairo_surface_destroy (surface);
+
+ xasprintf (&filename, "%s.out.trace", test_name);
+ ctx = cairo_script_create (filename);
+ surface = cairo_script_surface_create_for_target (ctx, image);
+ cairo_device_destroy (ctx);
+ free (filename);
+ }
+ }
+#endif
+
+ cr = cairo_create (surface);
+ cairo_surface_destroy (surface);
+ cairo_set_source_surface (cr, src, 0, 0);
+ cairo_paint (cr);
+
+ status = cairo_status (cr);
+ if (status) {
+ cairo_surface_destroy (image);
+ image = cairo_surface_reference (cairo_get_target (cr));
+ }
+ cairo_destroy (cr);
+
+ return image;
+}
+
+cairo_surface_t *
+cairo_boilerplate_get_image_surface_from_png (const char *filename,
+ int width,
+ int height,
+ cairo_bool_t flatten)
+{
+ cairo_surface_t *surface;
+
+ surface = cairo_image_surface_create_from_png (filename);
+ if (cairo_surface_status (surface))
+ return surface;
+
+ if (flatten) {
+ cairo_t *cr;
+ cairo_surface_t *flattened;
+
+ flattened = cairo_image_surface_create (cairo_image_surface_get_format (surface),
+ width,
+ height);
+ cr = cairo_create (flattened);
+ cairo_surface_destroy (flattened);
+
+ cairo_set_source_rgb (cr, 1, 1, 1);
+ cairo_paint (cr);
+
+ cairo_set_source_surface (cr, surface,
+ width - cairo_image_surface_get_width (surface),
+ height - cairo_image_surface_get_height (surface));
+ cairo_paint (cr);
+
+ cairo_surface_destroy (surface);
+ surface = cairo_surface_reference (cairo_get_target (cr));
+ cairo_destroy (cr);
+ } else if (cairo_image_surface_get_width (surface) != width ||
+ cairo_image_surface_get_height (surface) != height)
+ {
+ cairo_t *cr;
+ cairo_surface_t *sub;
+
+ sub = cairo_image_surface_create (cairo_image_surface_get_format (surface),
+ width,
+ height);
+ cr = cairo_create (sub);
+ cairo_surface_destroy (sub);
+
+ cairo_set_source_surface (cr, surface,
+ width - cairo_image_surface_get_width (surface),
+ height - cairo_image_surface_get_height (surface));
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+ cairo_paint (cr);
+
+ cairo_surface_destroy (surface);
+ surface = cairo_surface_reference (cairo_get_target (cr));
+ cairo_destroy (cr);
+ }
+
+ return surface;
+}
+
+static const cairo_boilerplate_target_t builtin_targets[] = {
+ /* I'm uncompromising about leaving the image backend as 0
+ * for tolerance. There shouldn't ever be anything that is out of
+ * our control here. */
+ {
+ "image", "image", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE, CAIRO_CONTENT_COLOR_ALPHA, 0,
+ NULL,
+ _cairo_boilerplate_image_create_surface,
+ _cairo_boilerplate_image_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL,
+ _cairo_boilerplate_image_describe,
+ TRUE, FALSE, FALSE
+ },
+ {
+ "image", "image", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE, CAIRO_CONTENT_COLOR, 0,
+ NULL,
+ _cairo_boilerplate_image_create_surface,
+ _cairo_boilerplate_image_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL,
+ _cairo_boilerplate_image_describe,
+ FALSE, FALSE, FALSE
+ },
+ {
+ "image16", "image", NULL, NULL,
+ CAIRO_SURFACE_TYPE_IMAGE, CAIRO_CONTENT_COLOR, 0,
+ NULL,
+ _cairo_boilerplate_image16_create_surface,
+ _cairo_boilerplate_image16_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL, NULL,
+ _cairo_boilerplate_image_describe,
+ TRUE, FALSE, FALSE
+ },
+#if CAIRO_HAS_RECORDING_SURFACE
+ {
+ "recording", "image", NULL, NULL,
+ CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR_ALPHA, 0,
+ "cairo_recording_surface_create",
+ _cairo_boilerplate_recording_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_recording_surface_cleanup,
+ NULL, NULL,
+ FALSE, FALSE, TRUE
+ },
+ {
+ "recording", "image", NULL, NULL,
+ CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 0,
+ "cairo_recording_surface_create",
+ _cairo_boilerplate_recording_create_surface,
+ cairo_surface_create_similar,
+ NULL, NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_recording_surface_cleanup,
+ NULL, NULL,
+ FALSE, FALSE, TRUE
+ },
+#endif
+};
+CAIRO_BOILERPLATE (builtin, builtin_targets)
+
+static struct cairo_boilerplate_target_list {
+ struct cairo_boilerplate_target_list *next;
+ const cairo_boilerplate_target_t *target;
+} *cairo_boilerplate_targets;
+
+static cairo_bool_t
+probe_target (const cairo_boilerplate_target_t *target)
+{
+ if (target->probe == NULL)
+ return TRUE;
+
+#if HAVE_DLSYM
+ return dlsym (NULL, target->probe) != NULL;
+#else
+ return TRUE;
+#endif
+}
+
+void
+_cairo_boilerplate_register_backend (const cairo_boilerplate_target_t *targets,
+ unsigned int count)
+{
+ targets += count;
+ while (count--) {
+ struct cairo_boilerplate_target_list *list;
+
+ --targets;
+ if (! probe_target (targets))
+ continue;
+
+ list = xmalloc (sizeof (*list));
+ list->next = cairo_boilerplate_targets;
+ list->target = targets;
+ cairo_boilerplate_targets = list;
+ }
+}
+
+static cairo_bool_t
+_cairo_boilerplate_target_format_matches_name (const cairo_boilerplate_target_t *target,
+ const char *tcontent_name,
+ const char *tcontent_end)
+{
+ char const *content_name;
+ const char *content_end = tcontent_end;
+ size_t content_len;
+
+ content_name = _cairo_boilerplate_content_visible_name (target->content);
+ if (tcontent_end)
+ content_len = content_end - tcontent_name;
+ else
+ content_len = strlen(tcontent_name);
+ if (strlen(content_name) != content_len)
+ return FALSE;
+ if (0 == strncmp (content_name, tcontent_name, content_len))
+ return TRUE;
+
+ return FALSE;
+}
+
+static cairo_bool_t
+_cairo_boilerplate_target_matches_name (const cairo_boilerplate_target_t *target,
+ const char *tname,
+ const char *end)
+{
+ char const *content_name;
+ const char *content_start = strpbrk (tname, ".");
+ const char *content_end = end;
+ size_t name_len;
+ size_t content_len;
+
+ if (content_start >= end)
+ content_start = NULL;
+ if (content_start != NULL)
+ end = content_start++;
+
+ name_len = end - tname;
+
+ /* Check name. */
+ if (! (name_len == 1 && 0 == strncmp (tname, "?", 1))) { /* wildcard? */
+ if (0 != strncmp (target->name, tname, name_len)) /* exact match? */
+ return FALSE;
+ if (isalnum (target->name[name_len]))
+ return FALSE;
+ }
+
+ /* Check optional content. */
+ if (content_start == NULL) /* none given? */
+ return TRUE;
+
+ /* Exact content match? */
+ content_name = _cairo_boilerplate_content_visible_name (target->content);
+ content_len = content_end - content_start;
+ if (strlen(content_name) != content_len)
+ return FALSE;
+ if (0 == strncmp (content_name, content_start, content_len))
+ return TRUE;
+
+ return FALSE;
+}
+
+const cairo_boilerplate_target_t **
+cairo_boilerplate_get_targets (int *pnum_targets,
+ cairo_bool_t *plimited_targets)
+{
+ size_t i, num_targets;
+ cairo_bool_t limited_targets = FALSE;
+ const char *tname;
+ const cairo_boilerplate_target_t **targets_to_test;
+ struct cairo_boilerplate_target_list *list;
+
+ if (cairo_boilerplate_targets == NULL)
+ _cairo_boilerplate_register_all ();
+
+ if ((tname = getenv ("CAIRO_TEST_TARGET")) != NULL && *tname) {
+ /* check the list of targets specified by the user */
+ limited_targets = TRUE;
+
+ num_targets = 0;
+ targets_to_test = NULL;
+
+ while (*tname) {
+ int found = 0;
+ const char *end = strpbrk (tname, " \t\r\n;:,");
+ if (!end)
+ end = tname + strlen (tname);
+
+ if (end == tname) {
+ tname = end + 1;
+ continue;
+ }
+
+ for (list = cairo_boilerplate_targets;
+ list != NULL;
+ list = list->next)
+ {
+ const cairo_boilerplate_target_t *target = list->target;
+ const char *tcontent_name;
+ const char *tcontent_end;
+ if (_cairo_boilerplate_target_matches_name (target, tname, end)) {
+ if ((tcontent_name = getenv ("CAIRO_TEST_TARGET_FORMAT")) != NULL && *tcontent_name) {
+ while(tcontent_name) {
+ tcontent_end = strpbrk (tcontent_name, " \t\r\n;:,");
+ if (tcontent_end == tcontent_name) {
+ tcontent_name = tcontent_end + 1;
+ continue;
+ }
+ if(_cairo_boilerplate_target_format_matches_name (target,
+ tcontent_name, tcontent_end)) {
+ /* realloc isn't exactly the best thing here, but meh. */
+ targets_to_test = xrealloc (targets_to_test,
+ sizeof(cairo_boilerplate_target_t *) * (num_targets+1));
+ targets_to_test[num_targets++] = target;
+ found = 1;
+ }
+
+ if (tcontent_end)
+ tcontent_end++;
+ tcontent_name = tcontent_end;
+ }
+ } else {
+ /* realloc isn't exactly the best thing here, but meh. */
+ targets_to_test = xrealloc (targets_to_test,
+ sizeof(cairo_boilerplate_target_t *) * (num_targets+1));
+ targets_to_test[num_targets++] = target;
+ found = 1;
+ }
+ }
+ }
+
+ if (!found) {
+ const char *last_name = NULL;
+
+ fprintf (stderr, "Cannot find target '%.*s'.\n",
+ (int)(end - tname), tname);
+ fprintf (stderr, "Known targets:");
+ for (list = cairo_boilerplate_targets;
+ list != NULL;
+ list = list->next)
+ {
+ const cairo_boilerplate_target_t *target = list->target;
+ if (last_name != NULL) {
+ if (strcmp (target->name, last_name) == 0) {
+ /* filter out repeats that differ in content */
+ continue;
+ }
+ fprintf (stderr, ",");
+ }
+ fprintf (stderr, " %s", target->name);
+ last_name = target->name;
+ }
+ fprintf (stderr, "\n");
+ exit(-1);
+ }
+
+ if (*end)
+ end++;
+ tname = end;
+ }
+ } else {
+ int found = 0;
+ int not_found_targets = 0;
+ num_targets = 0;
+ targets_to_test = xmalloc (sizeof(cairo_boilerplate_target_t*) * num_targets);
+ for (list = cairo_boilerplate_targets; list != NULL; list = list->next)
+ {
+ const cairo_boilerplate_target_t *target = list->target;
+ const char *tcontent_name;
+ const char *tcontent_end;
+ if ((tcontent_name = getenv ("CAIRO_TEST_TARGET_FORMAT")) != NULL && *tcontent_name) {
+ while(tcontent_name) {
+ tcontent_end = strpbrk (tcontent_name, " \t\r\n;:,");
+ if (tcontent_end == tcontent_name) {
+ tcontent_name = tcontent_end + 1;
+ continue;
+ }
+ if (_cairo_boilerplate_target_format_matches_name (target,
+ tcontent_name, tcontent_end)) {
+ /* realloc isn't exactly the best thing here, but meh. */
+ targets_to_test = xrealloc (targets_to_test,
+ sizeof(cairo_boilerplate_target_t *) * (num_targets+1));
+ targets_to_test[num_targets++] = target;
+ found =1;
+ }
+ else
+ {
+ not_found_targets++;
+ }
+
+ if (tcontent_end)
+ tcontent_end++;
+
+ tcontent_name = tcontent_end;
+ }
+ }
+ else
+ {
+ num_targets++;
+ }
+ }
+ if (!found)
+ {
+ /* check all compiled in targets */
+ num_targets = num_targets + not_found_targets;
+ targets_to_test = xrealloc (targets_to_test,
+ sizeof(cairo_boilerplate_target_t*) * num_targets);
+ num_targets = 0;
+ for (list = cairo_boilerplate_targets;
+ list != NULL;
+ list = list->next)
+ {
+ const cairo_boilerplate_target_t *target = list->target;
+ targets_to_test[num_targets++] = target;
+ }
+ }
+
+ }
+
+ /* exclude targets as specified by the user */
+ if ((tname = getenv ("CAIRO_TEST_TARGET_EXCLUDE")) != NULL && *tname) {
+ limited_targets = TRUE;
+
+ while (*tname) {
+ int j;
+ const char *end = strpbrk (tname, " \t\r\n;:,");
+ if (!end)
+ end = tname + strlen (tname);
+
+ if (end == tname) {
+ tname = end + 1;
+ continue;
+ }
+
+ for (i = j = 0; i < num_targets; i++) {
+ const cairo_boilerplate_target_t *target = targets_to_test[i];
+ if (! _cairo_boilerplate_target_matches_name (target,
+ tname, end))
+ {
+ targets_to_test[j++] = targets_to_test[i];
+ }
+ }
+ num_targets = j;
+
+ if (*end)
+ end++;
+ tname = end;
+ }
+ }
+
+ if (pnum_targets)
+ *pnum_targets = num_targets;
+
+ if (plimited_targets)
+ *plimited_targets = limited_targets;
+
+ return targets_to_test;
+}
+
+const cairo_boilerplate_target_t *
+cairo_boilerplate_get_image_target (cairo_content_t content)
+{
+ if (cairo_boilerplate_targets == NULL)
+ _cairo_boilerplate_register_all ();
+
+ switch (content) {
+ case CAIRO_CONTENT_COLOR:
+ return &builtin_targets[1];
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ return &builtin_targets[0];
+ case CAIRO_CONTENT_ALPHA:
+ default:
+ return NULL;
+ }
+}
+
+const cairo_boilerplate_target_t *
+cairo_boilerplate_get_target_by_name (const char *name,
+ cairo_content_t content)
+{
+ struct cairo_boilerplate_target_list *list;
+
+ if (cairo_boilerplate_targets == NULL)
+ _cairo_boilerplate_register_all ();
+
+ /* first return an exact match */
+ for (list = cairo_boilerplate_targets; list != NULL; list = list->next) {
+ const cairo_boilerplate_target_t *target = list->target;
+ if (strcmp (target->name, name) == 0 &&
+ target->content == content)
+ {
+ return target;
+ }
+ }
+
+ /* otherwise just return a match that may differ in content */
+ for (list = cairo_boilerplate_targets; list != NULL; list = list->next) {
+ const cairo_boilerplate_target_t *target = list->target;
+ if (strcmp (target->name, name) == 0)
+ return target;
+ }
+
+ return NULL;
+}
+
+void
+cairo_boilerplate_free_targets (const cairo_boilerplate_target_t **targets)
+{
+ free (targets);
+}
+
+cairo_surface_t *
+cairo_boilerplate_surface_create_in_error (cairo_status_t status)
+{
+ cairo_surface_t *surface = NULL;
+ int loop = 5;
+
+ do {
+ cairo_surface_t *intermediate;
+ cairo_t *cr;
+ cairo_path_t path;
+
+ intermediate = cairo_image_surface_create (CAIRO_FORMAT_A8, 0, 0);
+ cr = cairo_create (intermediate);
+ cairo_surface_destroy (intermediate);
+
+ path.status = status;
+ cairo_append_path (cr, &path);
+
+ cairo_surface_destroy (surface);
+ surface = cairo_surface_reference (cairo_get_target (cr));
+ cairo_destroy (cr);
+ } while (cairo_surface_status (surface) != status && --loop);
+
+ return surface;
+}
+
+void
+cairo_boilerplate_scaled_font_set_max_glyphs_cached (cairo_scaled_font_t *scaled_font,
+ int max_glyphs)
+{
+ /* XXX CAIRO_DEBUG */
+}
+
+#if HAS_DAEMON
+static int
+any2ppm_daemon_exists (void)
+{
+ struct stat st;
+ int fd;
+ char buf[80];
+ int pid;
+ int ret;
+
+ if (stat (SOCKET_PATH, &st) < 0)
+ return 0;
+
+ fd = open (SOCKET_PATH ".pid", O_RDONLY);
+ if (fd < 0)
+ return 0;
+
+ pid = 0;
+ ret = read (fd, buf, sizeof (buf) - 1);
+ if (ret > 0) {
+ buf[ret] = '\0';
+ pid = atoi (buf);
+ }
+ close (fd);
+
+ return pid > 0 && kill (pid, 0) != -1;
+}
+#endif
+
+FILE *
+cairo_boilerplate_open_any2ppm (const char *filename,
+ int page,
+ unsigned int flags,
+ int (**close_cb) (FILE *))
+{
+ char command[4096];
+ const char *any2ppm;
+#if HAS_DAEMON
+ int sk;
+ struct sockaddr_un addr;
+ int len;
+#endif
+
+ any2ppm = getenv ("ANY2PPM");
+ if (any2ppm == NULL)
+ any2ppm = "./any2ppm";
+
+#if HAS_DAEMON
+ if (flags & CAIRO_BOILERPLATE_OPEN_NO_DAEMON)
+ goto POPEN;
+
+ if (! any2ppm_daemon_exists ()) {
+ if (system (any2ppm) != 0)
+ goto POPEN;
+ }
+
+ sk = socket (PF_UNIX, SOCK_STREAM, 0);
+ if (sk == -1)
+ goto POPEN;
+
+ memset (&addr, 0, sizeof (addr));
+ addr.sun_family = AF_UNIX;
+ strcpy (addr.sun_path, SOCKET_PATH);
+
+ if (connect (sk, (struct sockaddr *) &addr, sizeof (addr)) == -1) {
+ close (sk);
+ goto POPEN;
+ }
+
+ len = sprintf (command, "%s %d\n", filename, page);
+ if (write (sk, command, len) != len) {
+ close (sk);
+ goto POPEN;
+ }
+
+ *close_cb = fclose;
+ return fdopen (sk, "rb");
+
+POPEN:
+#endif
+
+ *close_cb = pclose;
+ sprintf (command, "%s %s %d", any2ppm, filename, page);
+ return popen (command, "rb");
+}
+
+static cairo_bool_t
+freadn (unsigned char *buf,
+ int len,
+ FILE *file)
+{
+ int ret;
+
+ while (len) {
+ ret = fread (buf, 1, len, file);
+ if (ret != len) {
+ if (ferror (file) || feof (file))
+ return FALSE;
+ }
+ len -= ret;
+ buf += len;
+ }
+
+ return TRUE;
+}
+
+cairo_surface_t *
+cairo_boilerplate_image_surface_create_from_ppm_stream (FILE *file)
+{
+ char format;
+ int width, height;
+ ptrdiff_t stride;
+ int x, y;
+ unsigned char *data;
+ cairo_surface_t *image = NULL;
+
+ if (fscanf (file, "P%c %d %d 255\n", &format, &width, &height) != 3)
+ goto FAIL;
+
+ switch (format) {
+ case '7': /* XXX */
+ image = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
+ break;
+ case '6':
+ image = cairo_image_surface_create (CAIRO_FORMAT_RGB24, width, height);
+ break;
+ case '5':
+ image = cairo_image_surface_create (CAIRO_FORMAT_A8, width, height);
+ break;
+ default:
+ goto FAIL;
+ }
+ if (cairo_surface_status (image))
+ return image;
+
+ data = cairo_image_surface_get_data (image);
+ stride = cairo_image_surface_get_stride (image);
+ for (y = 0; y < height; y++) {
+ unsigned char *buf = data + y*stride;
+ switch (format) {
+ case '7':
+ if (! freadn (buf, 4 * width, file))
+ goto FAIL;
+ break;
+ case '6':
+ if (! freadn (buf, 3*width, file))
+ goto FAIL;
+ buf += 3*width;
+ for (x = width; x--; ) {
+ buf -= 3;
+ ((uint32_t *) (data + y*stride))[x] =
+ (buf[0] << 16) | (buf[1] << 8) | (buf[2] << 0);
+ }
+ break;
+ case '5':
+ if (! freadn (buf, width, file))
+ goto FAIL;
+ break;
+ }
+ }
+ cairo_surface_mark_dirty (image);
+
+ return image;
+
+FAIL:
+ cairo_surface_destroy (image);
+ return cairo_boilerplate_surface_create_in_error (CAIRO_STATUS_READ_ERROR);
+}
+
+cairo_surface_t *
+cairo_boilerplate_convert_to_image (const char *filename,
+ int page)
+{
+ FILE *file;
+ unsigned int flags = 0;
+ cairo_surface_t *image;
+ int (*close_cb) (FILE *);
+ int ret;
+
+ RETRY:
+ file = cairo_boilerplate_open_any2ppm (filename, page, flags, &close_cb);
+ if (file == NULL) {
+ switch (errno) {
+ case ENOMEM:
+ return cairo_boilerplate_surface_create_in_error (CAIRO_STATUS_NO_MEMORY);
+ default:
+ return cairo_boilerplate_surface_create_in_error (CAIRO_STATUS_READ_ERROR);
+ }
+ }
+
+ image = cairo_boilerplate_image_surface_create_from_ppm_stream (file);
+ ret = close_cb (file);
+ /* check for fatal errors from the interpreter */
+ if (ret) { /* any2pmm should never die... */
+ cairo_surface_destroy (image);
+ return cairo_boilerplate_surface_create_in_error (CAIRO_STATUS_INVALID_STATUS);
+ }
+
+ if (ret == 0 && cairo_surface_status (image) == CAIRO_STATUS_READ_ERROR) {
+ if (flags == 0) {
+ /* Try again in a standalone process. */
+ cairo_surface_destroy (image);
+ flags = CAIRO_BOILERPLATE_OPEN_NO_DAEMON;
+ goto RETRY;
+ }
+ }
+
+ return image;
+}
+
+int
+cairo_boilerplate_version (void)
+{
+ return CAIRO_VERSION;
+}
+
+const char*
+cairo_boilerplate_version_string (void)
+{
+ return CAIRO_VERSION_STRING;
+}
+
+void
+cairo_boilerplate_fini (void)
+{
+ while (cairo_boilerplate_targets != NULL) {
+ struct cairo_boilerplate_target_list *next;
+
+ next = cairo_boilerplate_targets->next;
+
+ free (cairo_boilerplate_targets);
+ cairo_boilerplate_targets = next;
+ }
+}
diff --git a/libs/cairo-1.16.0/boilerplate/cairo-boilerplate.h b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate.h
new file mode 100644
index 0000000..515bb03
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/cairo-boilerplate.h
@@ -0,0 +1,252 @@
+/*
+ * Copyright © 2004,2006 Red Hat, Inc.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * Author: Carl D. Worth <cworth@cworth.org>
+ */
+
+#ifndef _CAIRO_BOILERPLATE_H_
+#define _CAIRO_BOILERPLATE_H_
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <cairo.h>
+#include <string.h>
+
+#include "cairo-compiler-private.h"
+
+#if HAVE_STDINT_H
+# include <stdint.h>
+#elif HAVE_INTTYPES_H
+# include <inttypes.h>
+#elif HAVE_SYS_INT_TYPES_H
+# include <sys/int_types.h>
+#elif defined(_MSC_VER)
+# include <stdint.h>
+ typedef __int8 int8_t;
+ typedef unsigned __int8 uint8_t;
+ typedef __int16 int16_t;
+ typedef unsigned __int16 uint16_t;
+ typedef __int32 int32_t;
+ typedef unsigned __int32 uint32_t;
+ typedef __int64 int64_t;
+ typedef unsigned __int64 uint64_t;
+#else
+#error Cannot find definitions for fixed-width integral types (uint8_t, uint32_t, etc.)
+#endif
+
+#ifndef HAVE_UINT64_T
+# define HAVE_UINT64_T 1
+#endif
+#ifndef INT16_MIN
+# define INT16_MIN (-32767-1)
+#endif
+#ifndef INT16_MAX
+# define INT16_MAX (32767)
+#endif
+#ifndef UINT16_MAX
+# define UINT16_MAX (65535)
+#endif
+
+#ifndef CAIRO_BOILERPLATE_DEBUG
+#define CAIRO_BOILERPLATE_DEBUG(x)
+#endif
+
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+#define CAIRO_BOILERPLATE_PRINTF_FORMAT(fmt_index, va_index) \
+ __attribute__((__format__(__printf__, fmt_index, va_index)))
+#else
+#define CAIRO_BOILERPLATE_PRINTF_FORMAT(fmt_index, va_index)
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+#ifndef ARRAY_LENGTH
+#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
+#endif
+
+CAIRO_BEGIN_DECLS
+
+/* A fake format we use for the flattened ARGB output of the PS and
+ * PDF surfaces. */
+#define CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED ((unsigned int) -1)
+
+extern const cairo_user_data_key_t cairo_boilerplate_output_basename_key;
+
+cairo_content_t
+cairo_boilerplate_content (cairo_content_t content);
+
+const char *
+cairo_boilerplate_content_name (cairo_content_t content);
+
+cairo_format_t
+cairo_boilerplate_format_from_content (cairo_content_t content);
+
+typedef enum {
+ CAIRO_BOILERPLATE_MODE_TEST,
+ CAIRO_BOILERPLATE_MODE_PERF,
+
+ /* This will allow running performance test with threads. The
+ * GL backend is very slow on some drivers when run with thread
+ * awareness turned on. */
+ CAIRO_BOILERPLATE_MODE_PERF_THREADS,
+} cairo_boilerplate_mode_t;
+
+typedef cairo_surface_t *
+(*cairo_boilerplate_create_surface_t) (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure);
+
+typedef cairo_surface_t *
+(*cairo_boilerplate_create_similar_t) (cairo_surface_t *other,
+ cairo_content_t content,
+ int width,
+ int height);
+
+typedef void
+(*cairo_boilerplate_force_fallbacks_t) (cairo_surface_t *surface,
+ double x_pixels_per_inch,
+ double y_pixels_per_inch);
+
+typedef cairo_status_t
+(*cairo_boilerplate_finish_surface_t) (cairo_surface_t *surface);
+
+typedef cairo_surface_t *
+(*cairo_boilerplate_get_image_surface_t) (cairo_surface_t *surface,
+ int page,
+ int width,
+ int height);
+
+typedef cairo_status_t
+(*cairo_boilerplate_write_to_png_t) (cairo_surface_t *surface,
+ const char *filename);
+
+typedef void
+(*cairo_boilerplate_cleanup_t) (void *closure);
+
+typedef void
+(*cairo_boilerplate_wait_t) (void *closure);
+
+typedef char *
+(*cairo_boilerplate_describe_t) (void *closure);
+
+typedef struct _cairo_boilerplate_target {
+ const char *name;
+ const char *basename;
+ const char *file_extension;
+ const char *reference_target;
+ cairo_surface_type_t expected_type;
+ cairo_content_t content;
+ unsigned int error_tolerance;
+ const char *probe; /* runtime dl check */
+ cairo_boilerplate_create_surface_t create_surface;
+ cairo_boilerplate_create_similar_t create_similar;
+ cairo_boilerplate_force_fallbacks_t force_fallbacks;
+ cairo_boilerplate_finish_surface_t finish_surface;
+ cairo_boilerplate_get_image_surface_t get_image_surface;
+ cairo_boilerplate_write_to_png_t write_to_png;
+ cairo_boilerplate_cleanup_t cleanup;
+ cairo_boilerplate_wait_t synchronize;
+ cairo_boilerplate_describe_t describe;
+ cairo_bool_t is_measurable;
+ cairo_bool_t is_vector;
+ cairo_bool_t is_recording;
+} cairo_boilerplate_target_t;
+
+const cairo_boilerplate_target_t *
+cairo_boilerplate_get_image_target (cairo_content_t content);
+
+const cairo_boilerplate_target_t *
+cairo_boilerplate_get_target_by_name (const char *name,
+ cairo_content_t content);
+
+const cairo_boilerplate_target_t **
+cairo_boilerplate_get_targets (int *num_targets,
+ cairo_bool_t *limited_targets);
+
+void
+cairo_boilerplate_free_targets (const cairo_boilerplate_target_t **targets);
+
+cairo_surface_t *
+_cairo_boilerplate_get_image_surface (cairo_surface_t *src,
+ int page,
+ int width,
+ int height);
+cairo_surface_t *
+cairo_boilerplate_get_image_surface_from_png (const char *filename,
+ int width,
+ int height,
+ cairo_bool_t flatten);
+
+cairo_surface_t *
+cairo_boilerplate_surface_create_in_error (cairo_status_t status);
+
+enum {
+ CAIRO_BOILERPLATE_OPEN_NO_DAEMON = 0x1,
+};
+
+FILE *
+cairo_boilerplate_open_any2ppm (const char *filename,
+ int page,
+ unsigned int flags,
+ int (**close_cb) (FILE *));
+
+cairo_surface_t *
+cairo_boilerplate_image_surface_create_from_ppm_stream (FILE *file);
+
+cairo_surface_t *
+cairo_boilerplate_convert_to_image (const char *filename,
+ int page);
+
+int
+cairo_boilerplate_version (void);
+
+const char*
+cairo_boilerplate_version_string (void);
+
+void
+cairo_boilerplate_fini (void);
+
+#include "cairo-boilerplate-system.h"
+
+CAIRO_END_DECLS
+
+#endif
diff --git a/libs/cairo-1.16.0/boilerplate/check-link.c b/libs/cairo-1.16.0/boilerplate/check-link.c
new file mode 100644
index 0000000..f164448
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/check-link.c
@@ -0,0 +1,24 @@
+#define CAIRO_VERSION_H 1
+
+#include <cairo-boilerplate.h>
+
+/* get the "real" version info instead of dummy cairo-version.h */
+#undef CAIRO_VERSION_H
+#include "../cairo-version.h"
+
+#include <stdio.h>
+
+int
+main (void)
+{
+ printf ("Check linking to the just built cairo boilerplate library\n");
+ if (cairo_boilerplate_version () == CAIRO_VERSION) {
+ return 0;
+ } else {
+ fprintf (stderr,
+ "Error: linked to cairo boilerplate version %s instead of %s\n",
+ cairo_boilerplate_version_string (),
+ CAIRO_VERSION_STRING);
+ return 1;
+ }
+}
diff --git a/libs/cairo-1.16.0/boilerplate/make-cairo-boilerplate-constructors.sh b/libs/cairo-1.16.0/boilerplate/make-cairo-boilerplate-constructors.sh
new file mode 100644
index 0000000..09716ca
--- /dev/null
+++ b/libs/cairo-1.16.0/boilerplate/make-cairo-boilerplate-constructors.sh
@@ -0,0 +1,29 @@
+#! /bin/sh
+
+if test $# -eq 0; then
+ echo "$0: no input files." >&2
+ exit 0
+fi
+
+cat <<HERE
+/* WARNING: Autogenerated file - see $0! */
+
+#include "cairo-boilerplate-private.h"
+
+void _cairo_boilerplate_register_all (void);
+
+HERE
+
+cat "$@" | sed '/^CAIRO_BOILERPLATE/!d; s/CAIRO_BOILERPLATE.*(\(.*\),.*/extern void _register_\1 (void);/'
+
+cat <<HERE
+
+void
+_cairo_boilerplate_register_all (void)
+{
+HERE
+
+cat "$@" | sed '/^CAIRO_BOILERPLATE/!d; s/CAIRO_BOILERPLATE.*(\(.*\),.*/ _register_\1 ();/'
+
+echo "}"
+