[cairo-commit] 22 commits - autogen.sh boilerplate/cairo-boilerplate.c boilerplate/cairo-boilerplate.h boilerplate/.gitignore boilerplate/Makefile.am boilerplate/xmalloc.c ChangeLog.mk CODING_STYLE configure.in doc/public HACKING Makefile.am perf/cairo-perf.c perf/cairo-perf-posix.c perf/.gitignore perf/Makefile.am RELEASING src/cairo-cff-subset.c src/cairo-clip-private.h src/cairo-compiler-private.h src/cairo-freelist-private.h src/cairoint.h src/cairo-misc.c src/cairo-mutex-impl-private.h src/cairo-mutex-private.h src/cairo-mutex-type-private.h src/cairo-output-stream-private.h src/cairo-path-fixed-private.h src/cairo-pdf-operators.c src/cairo-pdf-operators-private.h src/cairo-ps-surface-private.h src/cairo-reference-count-private.h src/cairo-region-private.h src/cairo-scaled-font-subsets.c src/cairo-scaled-font-subsets-private.h src/cairo-truetype-subset.c src/cairo-truetype-subset-private.h src/cairo-type1-fallback.c src/cairo-type1-private.h src/cairo-type1-subset.c src/cairo-type3-glyph-surface.c src/cairo-type3-glyph-surface-private.h src/cairo-types-private.h src/cairo-user-font-private.h src/cairo-win32.c src/cairo-xlib-xrender-private.h src/check-cairoint.sh src/check-doc-syntax.sh src/check-link.c src/.gitignore src/Makefile.am src/Makefile.win32 src/README src/Sources.mk test/cairo-test.c test/.gitignore test/invalid-matrix.c test/Makefile.am test/pdiff util/README
Behdad Esfahbod
behdad at kemper.freedesktop.org
Tue Sep 2 19:00:59 PDT 2008
CODING_STYLE | 9
ChangeLog.mk | 3
HACKING | 165 ++++++++++++
Makefile.am | 1
RELEASING | 2
autogen.sh | 3
boilerplate/.gitignore | 2
boilerplate/Makefile.am | 22 -
boilerplate/cairo-boilerplate.c | 18 +
boilerplate/cairo-boilerplate.h | 6
boilerplate/xmalloc.c | 2
configure.in | 388 ++++++++++++++++--------------
doc/public/Headers.mk | 52 ----
doc/public/Makefile.am | 35 --
doc/public/README | 37 ++
doc/public/cairo-docs.xml | 12
doc/public/cairo-sections.txt | 52 ++--
doc/public/tmpl/cairo-version.sgml | 3
perf/.gitignore | 2
perf/Makefile.am | 5
perf/cairo-perf-posix.c | 2
perf/cairo-perf.c | 2
src/.gitignore | 6
src/Makefile.am | 411 +++++---------------------------
src/Makefile.win32 | 3
src/README | 58 ++++
src/Sources.mk | 246 +++++++++++++++++++
src/cairo-cff-subset.c | 5
src/cairo-clip-private.h | 3
src/cairo-compiler-private.h | 6
src/cairo-freelist-private.h | 1
src/cairo-misc.c | 68 +++++
src/cairo-mutex-impl-private.h | 6
src/cairo-mutex-private.h | 4
src/cairo-mutex-type-private.h | 6
src/cairo-output-stream-private.h | 4
src/cairo-path-fixed-private.h | 2
src/cairo-pdf-operators-private.h | 1
src/cairo-pdf-operators.c | 5
src/cairo-ps-surface-private.h | 2
src/cairo-reference-count-private.h | 4
src/cairo-region-private.h | 1
src/cairo-scaled-font-subsets-private.h | 10
src/cairo-scaled-font-subsets.c | 5
src/cairo-truetype-subset-private.h | 4
src/cairo-truetype-subset.c | 4
src/cairo-type1-fallback.c | 5
src/cairo-type1-private.h | 6
src/cairo-type1-subset.c | 10
src/cairo-type3-glyph-surface-private.h | 6
src/cairo-type3-glyph-surface.c | 5
src/cairo-types-private.h | 29 +-
src/cairo-user-font-private.h | 1
src/cairo-win32.c | 98 -------
src/cairo-xlib-xrender-private.h | 7
src/cairoint.h | 14 -
src/check-cairoint.sh | 2
src/check-doc-syntax.sh | 2
src/check-link.c | 24 +
test/.gitignore | 1
test/Makefile.am | 9
test/cairo-test.c | 2
test/invalid-matrix.c | 5
test/pdiff/.gitignore | 2
util/README | 69 +++++
65 files changed, 1185 insertions(+), 800 deletions(-)
New commits:
commit 0234fb9197edbba14a4cb8cc7dda1778f49e3fed
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Sep 2 22:00:05 2008 -0400
[boilerplate/check-link.c] Check that we can link to the built boilerplate
diff --git a/boilerplate/.gitignore b/boilerplate/.gitignore
index e761d78..befd40a 100644
--- a/boilerplate/.gitignore
+++ b/boilerplate/.gitignore
@@ -14,3 +14,4 @@ tags
*.pdb
*~
.*.sw?
+check-link
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am
index 513edf3..a42179b 100644
--- a/boilerplate/Makefile.am
+++ b/boilerplate/Makefile.am
@@ -96,8 +96,16 @@ INCLUDES = \
CLEANFILES = \
$(EXTRA_LTLIBRARIES)
-# Delete intermediate files as well
-clean-local:
- -${FIND} . -name '*.[is]' -print | ${XARGS} ${RM}
+CLEANFILES += *.i *.s
-check test: libcairoboilerplate.la
+test: check
+
+TESTS =
+if CROSS_COMPILING
+else
+TESTS += check-link
+endif
+
+EXTRA_PROGRAMS = check-link
+check_link_LDADD = libcairoboilerplate.la
+CLEANFILES += check-link
commit 7e45937e21101648fd8dc01e1684a0515c10715b
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Sep 2 21:56:37 2008 -0400
[boilerplate] Add cairo_boilerplate_version[_string]() functions
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 0a86107..c32b09b 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -24,6 +24,8 @@
* Author: Carl D. Worth <cworth at cworth.org>
*/
+#define CAIRO_VERSION_H 1
+
#include "cairo-boilerplate.h"
#include "cairo-boilerplate-scaled-font.h"
@@ -64,6 +66,10 @@
#include <cairo-types-private.h>
#include <cairo-scaled-font-private.h>
+/* get the "real" version info instead of dummy cairo-version.h */
+#undef CAIRO_VERSION_H
+#include "../cairo-version.h"
+
#include <stdlib.h>
#include <ctype.h>
#include <assert.h>
@@ -796,3 +802,15 @@ FAIL:
cairo_surface_destroy (image);
return cairo_boilerplate_surface_create_in_error (CAIRO_STATUS_READ_ERROR);
}
+
+int
+cairo_boilerplate_version (void)
+{
+ return CAIRO_VERSION;
+}
+
+const char*
+cairo_boilerplate_version_string (void)
+{
+ return CAIRO_VERSION_STRING;
+}
diff --git a/boilerplate/cairo-boilerplate.h b/boilerplate/cairo-boilerplate.h
index ba1c03b..d2fa470 100644
--- a/boilerplate/cairo-boilerplate.h
+++ b/boilerplate/cairo-boilerplate.h
@@ -181,6 +181,12 @@ cairo_boilerplate_open_any2ppm (const char *filename,
cairo_surface_t *
cairo_boilerplate_image_surface_create_from_ppm_stream (FILE *file);
+int
+cairo_boilerplate_version (void);
+
+const char*
+cairo_boilerplate_version_string (void);
+
#include "xmalloc.h"
#endif
commit a7951081f153934cbf93215c5e255b99ec3e1157
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Sep 2 21:50:08 2008 -0400
Move _GNU_SOURCE declarations to where it's used
Such that we don't rely on more GNU extensions accidentally.
diff --git a/perf/Makefile.am b/perf/Makefile.am
index 319d82e..aba38a3 100644
--- a/perf/Makefile.am
+++ b/perf/Makefile.am
@@ -1,9 +1,4 @@
-# We're using _GNU_SOURCE to get the prototype for asprintf. This may
-# not be the most portable approach, but it is pragmatic and I'm
-# willing to do something cleaner as soon as it causes someone a
-# problem.
INCLUDES = \
- -D_GNU_SOURCE \
-I$(srcdir) \
-I$(top_srcdir)/boilerplate \
-I$(top_srcdir)/src \
diff --git a/perf/cairo-perf-posix.c b/perf/cairo-perf-posix.c
index b1b1a2a..8bf78ce 100644
--- a/perf/cairo-perf-posix.c
+++ b/perf/cairo-perf-posix.c
@@ -53,6 +53,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#define _XOPEN_SOURCE 600 /* for round() */
+
#include <signal.h>
#include <sys/time.h>
#include <unistd.h>
diff --git a/perf/cairo-perf.c b/perf/cairo-perf.c
index abeab21..38c7119 100644
--- a/perf/cairo-perf.c
+++ b/perf/cairo-perf.c
@@ -26,6 +26,8 @@
* Carl Worth <cworth at cworth.org>
*/
+#define _GNU_SOURCE 1 /* for sched_getaffinity() */
+
#include "cairo-perf.h"
#include "cairo-boilerplate-getopt.h"
diff --git a/test/Makefile.am b/test/Makefile.am
index 7f83713..fcc1601 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -825,16 +825,10 @@ check-local:
check_PROGRAMS =
EXTRA_PROGRAMS =
-# We're using _GNU_SOURCE to get the prototype for asprintf. This may
-# not be the most portable approach, but it is pragmatic and I'm
-# willing to do something cleaner as soon as it causes someone a
-# problem.
INCLUDES = \
- -D_GNU_SOURCE \
-I$(srcdir) \
-I$(srcdir)/pdiff \
-I$(top_srcdir)/boilerplate \
- -I$(top_srcdir)/pixman/src \
-I$(top_srcdir)/src \
-I$(top_builddir)/src \
$(CAIRO_CFLAGS)
diff --git a/test/cairo-test.c b/test/cairo-test.c
index 6c04f8c..b29ffb9 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -23,6 +23,8 @@
* Author: Carl D. Worth <cworth at cworth.org>
*/
+#define _GNU_SOURCE 1 /* for feenableexcept() et al */
+
#if HAVE_CONFIG_H
#include "config.h"
#endif
diff --git a/test/invalid-matrix.c b/test/invalid-matrix.c
index 8db3df1..be11336 100644
--- a/test/invalid-matrix.c
+++ b/test/invalid-matrix.c
@@ -24,9 +24,12 @@
* Author: Carl Worth <cworth at cworth.org>
*/
+#define _ISOC99_SOURCE /* for INFINITY */
+#define _GNU_SOURCE 1 /* for fedisableeexcept() et al */
+
#include "cairo-test.h"
-#if _XOPEN_SOURCE >= 600 || defined (_ISOC99_SOURCE)
+#ifdef INFINITY
#define HAVE_INFINITY 1
#endif
commit b4cee2bd88f36b2eddacfe91726b698ae61c819b
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Sep 2 21:35:53 2008 -0400
[boilerplate] Remove obsolete reference to pixman
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am
index 7efb56f..513edf3 100644
--- a/boilerplate/Makefile.am
+++ b/boilerplate/Makefile.am
@@ -89,7 +89,6 @@ endif
INCLUDES = \
-I$(srcdir) \
- -I$(top_srcdir)/pixman/src \
-I$(top_builddir)/src \
-I$(top_srcdir)/src \
$(CAIRO_CFLAGS)
commit e3d190c92f16c3b6cd3bf3791959c247b7aaa7ac
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Sep 2 21:35:18 2008 -0400
[boilerplate] Cleanup
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am
index 79cb444..7efb56f 100644
--- a/boilerplate/Makefile.am
+++ b/boilerplate/Makefile.am
@@ -87,12 +87,7 @@ libcairoboilerplate_la_SOURCES += cairo-boilerplate-xlib.h
libcairoboilerplate_la_SOURCES += cairo-boilerplate-xlib-private.h
endif
-# We're using _GNU_SOURCE to get the prototype for asprintf. This may
-# not be the most portable approach, but it is pragmatic and I'm
-# willing to do something cleaner as soon as it causes someone a
-# problem.
INCLUDES = \
- -D_GNU_SOURCE \
-I$(srcdir) \
-I$(top_srcdir)/pixman/src \
-I$(top_builddir)/src \
diff --git a/boilerplate/xmalloc.c b/boilerplate/xmalloc.c
index 5b91108..12f12e9 100644
--- a/boilerplate/xmalloc.c
+++ b/boilerplate/xmalloc.c
@@ -23,6 +23,8 @@
* Author: Carl D. Worth <cworth at cworth.org>
*/
+#define _GNU_SOURCE 1 /* for vasprintf */
+
#include "cairo-boilerplate.h"
#include "xmalloc.h"
commit af0069c1c4599a93b1f55a0a4aa0b67d8d754c0d
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Sep 2 21:31:47 2008 -0400
[autogen.sh] Create dummy src/Config.mk so we can bootstrap
diff --git a/autogen.sh b/autogen.sh
index 7e1e2fa..a69007e 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -182,6 +182,9 @@ do_cmd $ACLOCAL $ACLOCAL_FLAGS
do_cmd $AUTOHEADER
+# create dummy src/Config.mk, which will later be created by configure
+echo > src/Config.mk
+
do_cmd $AUTOMAKE $AUTOMAKE_FLAGS
do_cmd $AUTOCONF
commit 2823ebaa6e0a14c4270ec973467fc0f76dc34fd5
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Sep 2 20:59:38 2008 -0400
[src/check-link.c] Simple test to check we can link to the built cairo.so
diff --git a/configure.in b/configure.in
index bcd74cf..f261267 100644
--- a/configure.in
+++ b/configure.in
@@ -81,6 +81,7 @@ AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL dnl required version (1.4) DON'T REMOVE!
AC_STDC_HEADERS
AC_C_INLINE
+AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = "xyes")
case $host_os in
darwin*)
diff --git a/src/.gitignore b/src/.gitignore
index 128bcc7..3a51a8a 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -28,3 +28,4 @@ cairo.def
TAGS
tags
check-has-hidden-symbols.i
+check-link
diff --git a/src/Makefile.am b/src/Makefile.am
index c292cad..a310a4b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -34,7 +34,8 @@ libcairo_la_SOURCES = \
$(enabled_cairo_sources) \
$(NULL)
libcairo_la_LDFLAGS = -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols)
-libcairo_la_CFLAGS = -I$(srcdir) $(CAIRO_CFLAGS)
+#libcairo_la_CFLAGS = -I$(srcdir) $(CAIRO_CFLAGS)
+INCLUDES = -I$(srcdir) $(CAIRO_CFLAGS)
libcairo_la_LIBADD = $(CAIRO_LIBS) $(CAIRO_LDADD)
libcairo_la_DEPENDENCIES = $(cairo_def_dependency)
@@ -64,9 +65,30 @@ cairo.def: cairo-features.h $(enabled_cairo_headers)
) >$@
@ ! grep -q cairo_ERROR $@ || ($(RM) $@; false)
-TESTS_ENVIRONMENT = srcdir="$(srcdir)" MAKE="$(MAKE)" all_cairo_files="$(all_cairo_files)" enabled_cairo_files="$(enabled_cairo_files)"
-TESTS = check-def.sh check-plt.sh check-headers.sh check-cairoint.sh check-doc-syntax.sh
-EXTRA_DIST += $(TESTS) check-has-hidden-symbols.c
+TESTS_ENVIRONMENT = \
+ srcdir="$(srcdir)" \
+ MAKE="$(MAKE) $(AM_MAKEFLAGS)" \
+ all_cairo_files="$(all_cairo_files)" \
+ enabled_cairo_files="$(enabled_cairo_files)" \
+ $(NULL)
+TESTS =
+TESTS_SH = \
+ check-def.sh \
+ check-plt.sh \
+ check-headers.sh \
+ check-cairoint.sh \
+ check-doc-syntax.sh\
+ $(NULL)
+TESTS += TESTS_SH
+if CROSS_COMPILING
+else
+TESTS += check-link
+endif
+
+EXTRA_DIST += $(TESTS_SH) check-has-hidden-symbols.c
+EXTRA_PROGRAMS = check-link
+check_link_LDADD = libcairo.la
+CLEANFILES += check-link
# The pre-processed result is used by check-{def,plt}.sh to determine whether
diff --git a/src/check-cairoint.sh b/src/check-cairoint.sh
index 7bc2603..2809af8 100755
--- a/src/check-cairoint.sh
+++ b/src/check-cairoint.sh
@@ -7,7 +7,7 @@ stat=0
echo 'Checking source files for missing or misplaced #include "cairoint.h"'
-find "$srcdir" -name '*.c' -or -name '*.cpp' |
+find "$srcdir" \( -name '*.c' -or -name '*.cpp' \) -and ! -name 'check-*.c' |
while read x; do
grep '\<include\>' "$x" /dev/null | head -n 1
done |
diff --git a/src/check-link.c b/src/check-link.c
new file mode 100644
index 0000000..66ca1b2
--- /dev/null
+++ b/src/check-link.c
@@ -0,0 +1,24 @@
+#define CAIRO_VERSION_H 1
+
+#include <cairo.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 library\n");
+ if (cairo_version () == CAIRO_VERSION) {
+ return 0;
+ } else {
+ fprintf (stderr,
+ "Error: linked to cairo version %s instead of %s\n",
+ cairo_version_string (),
+ CAIRO_VERSION_STRING);
+ return 1;
+ }
+}
commit 59262577708ddb656851624377efb2a671fa8ca3
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Sep 2 20:20:49 2008 -0400
Revamp the build system.
Quick summary of changes:
- Move list of cairo source files out of src/Makefile.am and into
src/Sources.mk,
- Generate files src/Config.mk and src/Config.mk.win32 that choose
the right set of source files and headers based on configured
backends and features. This drastically simplifies building
using other build systems. The src/Makefile.win32 file needs
to be updated to reflect these changes.
- Add README files to various directories,
- Add toplevel HACKING file.
diff --git a/CODING_STYLE b/CODING_STYLE
index 73fe2a9..92536a4 100644
--- a/CODING_STYLE
+++ b/CODING_STYLE
@@ -267,4 +267,11 @@ for overflow and will return NULL in that case.
In general, be wary of performing any arithmetic operations in an
argument to malloc. You should explicitly check for integer overflow
-yourself in any more complex situations.
\ No newline at end of file
+yourself in any more complex situations.
+
+
+TODO
+----
+
+Write rules for common editors to use this style. Also cleanup/unify
+the modlines in the source files.
diff --git a/ChangeLog.mk b/ChangeLog.mk
index a0275a5..d93cd89 100644
--- a/ChangeLog.mk
+++ b/ChangeLog.mk
@@ -42,7 +42,8 @@ $(srcdir)/ChangeLog:
after=$(srcdir)/ChangeLog.cache-$$nearest_tag..; \
$(MAKE) $(AM_MAKEFLAGS) $$before $$after && \
echo Creating $@ && \
- { cat $$after; echo; cat $$before; } > $@; \
+ { echo '# Generated by configure. Do not edit.'; echo; \
+ cat $$after; echo; cat $$before; } > $@; \
else \
test -f $@ || \
(echo A git checkout is required to generate $@ >&2 && \
diff --git a/HACKING b/HACKING
new file mode 100644
index 0000000..a69c450
--- /dev/null
+++ b/HACKING
@@ -0,0 +1,165 @@
+Hacking Cairo
+=============
+
+This is a high-level guide to how the cairo distribution is organized
+and how to get started hacking on it. Make sure you read through the
+file README before continuing.
+
+
+Coding Style
+------------
+
+The easiest way to write code in the cairo style is to follow code close
+to the place you are hacking, but if you want a written down set of
+rules, see file CODING_STYLE.
+
+Files for backends that depend on languages other than C (C++ or
+Objective C for example) may use features specific to those languages.
+For example, "//" comments are allowed, though discouraged, in those files.
+
+
+Contact
+-------
+
+Various ways to get in touch with other cairo developers and maintainers
+have been enumerated at:
+
+ http://cairographics.org/contact/
+
+Most of that information is also reflected in the following sections.
+
+
+Mailing Lists
+-------------
+
+There are various mailing lists that are useful when developing cairo
+code. A complete list is always available at:
+
+ http://cairographics.org/lists/
+
+It is recommended that cairo developers subscribe to all those lists.
+The cairo list by itself generates much more traffic than the others
+combined, so developers and contributors should not be intimidated by
+the -commit and -bugs lists.
+
+
+Bug Tracking System
+-------------------
+
+We use a standard bugzilla bug tracking system available at:
+
+ http://bugs.freedesktop.org/
+
+For straight bug reports, it's best to report them there such that they
+are not lost or forgotten. For discussion of new features or
+complicated issues, use the mailing list.
+
+
+IRC
+---
+
+It's a great idea to hang around the cairo IRC channel if you have any
+interest in cairo. We use the #cairo channel on irc.freenode.net.
+
+Make sure you introduce yourself if your nick is not easy to match to
+the name you use on the mailing list.
+
+
+Version Control System
+----------------------
+
+We use /git/ for version control. See:
+
+ http://cairographics.org/download/
+
+TODO:
+Add links to some git tutorials or better, right a few paragraphs
+about how to use git to efficiently hack on cairo.
+
+
+Build System
+------------
+
+We use the autotools build system with cairo, but with various
+customizations and advanced features. Reading configure.in is your
+best bet to understanding it, or just ask on IRC.
+
+To bootstrap the build system run ./autogen.sh. After that the
+regular "./configure; make; make install" sequence can be used.
+
+There is limited support for a win32 build system.
+See src/Makefile.win32.
+
+
+ChangeLog
+---------
+
+We generate ChangeLog files automatically from the git commit log.
+No manual ChangeLog writing is necessary.
+
+
+Source Code
+-----------
+
+The library source code and headers live in the src/ directory.
+See src/README for more information.
+
+
+Regression Test Suite
+---------------------
+
+Cairo has a fairly extensive regression-testing suite. Indeed, without
+these tests it would be impossible to make a cairo release without
+introducing tens of regressions. We still manage to introduce
+regressions with each release even with the hundreds of tests we already
+have.
+
+The regression test suite is located under the test/ directory.
+See test/README for more information.
+
+
+Performance Test Suite
+----------------------
+
+There is a small performance-testing suite for cairo.
+
+The performance test suite is located under the perf/ directory.
+See perf/README for more information.
+
+
+Boilerplate
+-----------
+
+The cairo-boilerplate is a small private library used by the regression
+and performance test suites. It includes the boilerplace code needed
+to initialize various backends for the test suites, as well as allow
+tweaking some of the internal workings of the backends for more testing.
+
+The boilerplate code is localted under the boilerplate/ directory.
+See boilerplate/README for more information.
+
+
+Documentation
+-------------
+
+Cairo uses the gtk-doc system for reference API documentation.
+
+The reference documentation is located under doc/public.
+See doc/public/README for more information.
+
+For more documentation including frequently asked questions, tutorials,
+samples, roadmap, todo list, etc visit:
+
+ http://cairographics.org/documentation/
+
+Some of those should gradually be moved to doc/.
+
+
+Utilities
+---------
+
+There are a few useful utilities we have developed that are either
+useful when writing code using cairo, or writing cairo, or useful in
+general. These tools can be found under the util/ directory.
+See util/README for more information.
+
diff --git a/Makefile.am b/Makefile.am
index a47cee4..aff120e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -66,6 +66,7 @@ EXTRA_DIST = \
COPYING \
COPYING-LGPL-2.1 \
COPYING-MPL-1.1 \
+ HACKING \
INSTALL \
NEWS \
PORTING_GUIDE \
diff --git a/RELEASING b/RELEASING
index 1672f46..5630818 100644
--- a/RELEASING
+++ b/RELEASING
@@ -51,7 +51,7 @@ Here are the steps to follow to create a new cairo release:
the following command will show each patch that has changed a
public header file since the given version:
- find src/ -name '*.h' ! -name '*-private.h' ! -name 'cairoint.h' ! -name 'cairo-features-win32.h' | \
+ find src/ -name '*.h' ! -name '*-private.h' ! -name 'cairoint.h' ! -name 'cairo-*features*.h' | \
xargs git diff X.Y.Z.. --
4) Increment cairo_version_{minor|micro} in cairo-version.h:
diff --git a/boilerplate/.gitignore b/boilerplate/.gitignore
index 49c76a3..e761d78 100644
--- a/boilerplate/.gitignore
+++ b/boilerplate/.gitignore
@@ -1,4 +1,5 @@
TAGS
+tags
*.lo
*.la
*.exe
diff --git a/configure.in b/configure.in
index 98a3f23..bcd74cf 100644
--- a/configure.in
+++ b/configure.in
@@ -330,7 +330,8 @@ AC_DEFUN([CAIRO_BACKEND_ENABLE],
CAIRO_LIBS="$$1_NONPKGCONFIG_LIBS$$1_LIBS$CAIRO_LIBS"
CAIRO_NONPKGCONFIG_CFLAGS="$$1_NONPKGCONFIG_CFLAGS$CAIRO_NONPKGCONFIG_CFLAGS"
CAIRO_NONPKGCONFIG_LIBS="$$1_NONPKGCONFIG_LIBS$CAIRO_NONPKGCONFIG_LIBS"
- CAIRO_CONFIG_COMMANDS(m4_bpatsubst(src/cairo-$1.pc,_,-),
+ m4_define([cairo_backend_pc], m4_bpatsubst(src/cairo-$1.pc,_,-))
+ AC_CONFIG_FILES(cairo_backend_pc():src/cairo-backend.pc.in,
[sed \
-e "s, at backend_name@,$1,g" \
-e "s, at Backend_Name@,$2,g" \
@@ -338,29 +339,62 @@ AC_DEFUN([CAIRO_BACKEND_ENABLE],
-e "s, at BACKEND_REQUIRES@,$$1_REQUIRES,g" \
-e "s%@BACKEND_NONPKGCONFIG_LIBS@%$$1_NONPKGCONFIG_LIBS%g" \
-e "s, at BACKEND_NONPKGCONFIG_CFLAGS@,$$1_NONPKGCONFIG_CFLAGS,g" \
- -e "s, at prefix@,$prefix,g" \
- -e "s, at exec_prefix@,$exec_prefix,g" \
- -e "s, at libdir@,$libdir,g" \
- -e "s, at includedir@,$includedir,g" \
- -e "s, at VERSION@,$VERSION,g" \
- $srcdir/src/cairo-backend.pc.in
+ -i ]cairo_backend_pc()[ ||
+ AC_MSG_ERROR(failed to update cairo_backend_pc())
],
[
$1_BASE='$$1_BASE'
$1_REQUIRES='$$1_REQUIRES'
$1_NONPKGCONFIG_LIBS='$$1_NONPKGCONFIG_LIBS'
$1_NONPKGCONFIG_CFLAGS='$$1_NONPKGCONFIG_CFLAGS'
- prefix='$prefix'
- exec_prefix='$exec_prefix'
- libdir='$libdir'
- includedir='$includedir'
- VERSION='$VERSION'
])
else
- CAIRO_NO_FEATURES="$4 $CAIRO_NO_FEATURES"
+ # Collect list of all supported but disabled features
+ AS_IF([test "x$5" = xno],,[
+ CAIRO_NO_FEATURES="$4 $CAIRO_NO_FEATURES"
+ ])
fi
fi
AM_CONDITIONAL(CAIRO_HAS_$4, test "x$use_$1" = xyes)
+ # Collect list of all supported features and cairo headers
+ AS_IF([test "x$5" = xno],[
+ CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
+unsupported_cairo_headers += $(cairo_$1_headers)'
+ CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'
+unsupported_cairo_headers += $(cairo_$1_headers)'
+ ],[
+ CAIRO_SUPPORTED_FEATURES="$4 $CAIRO_SUPPORTED_FEATURES"
+ CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
+supported_cairo_headers += $(cairo_$1_headers)'
+ CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'
+supported_cairo_headers += $(cairo_$1_headers)'
+ ])
+ # Collect list of all/enabled cairo source files
+ CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
+all_cairo_pkgconf += $(cairo_$1_pkgconf)
+all_cairo_headers += $(cairo_$1_headers)
+all_cairo_private += $(cairo_$1_private)
+all_cairo_sources += $(cairo_$1_sources)
+if CAIRO_HAS_$4
+enabled_cairo_pkgconf += $(cairo_$1_pkgconf)
+enabled_cairo_headers += $(cairo_$1_headers)
+enabled_cairo_private += $(cairo_$1_private)
+enabled_cairo_sources += $(cairo_$1_sources)
+endif
+'
+ CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'
+all_cairo_pkgconf += $(cairo_$1_pkgconf)
+all_cairo_headers += $(cairo_$1_headers)
+all_cairo_private += $(cairo_$1_private)
+all_cairo_sources += $(cairo_$1_sources)
+ifeq ($(CAIRO_HAS_$4),1)
+enabled_cairo_pkgconf += $(cairo_$1_pkgconf)
+enabled_cairo_headers += $(cairo_$1_headers)
+enabled_cairo_private += $(cairo_$1_private)
+enabled_cairo_sources += $(cairo_$1_sources)
+endif
+'
+ # Collect warning message for enabled unsupported backends
AS_IF([test "x$use_[]$1" = xyes && test "x$5" = xno],[
CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE
*** The $2 backend is still under active development and
@@ -374,24 +408,31 @@ AC_DEFUN([CAIRO_BACKEND_ENABLE],
CAIRO_WARNING_MESSAGE=""
CAIRO_FEATURES=""
CAIRO_NO_FEATURES=""
+CAIRO_SUPPORTED_FEATURES=""
CAIRO_REQUIRES=""
CAIRO_NONPKGCONFIG_CFLAGS=""
CAIRO_NONPKGCONFIG_LIBS="$LIBM"
CAIRO_LDADD=""
CAIRO_CFLAGS=$CAIRO_NONPKGCONFIG_CFLAGS
CAIRO_LIBS=$CAIRO_NONPKGCONFIG_LIBS
-
-dnl ===========================================================================
-
-PIXMAN_VERSION="0.11.2"
-PIXMAN_REQUIRES="pixman-1 >= $PIXMAN_VERSION"
-PKG_CHECK_MODULES(pixman, $PIXMAN_REQUIRES, ,
- [AC_MSG_ERROR([pixman >= $PIXMAN_VERSION is required
-(http://cairographics.org/releases/)])])
-
-CAIRO_REQUIRES="$PIXMAN_REQUIRES $CAIRO_REQUIRES"
-CAIRO_CFLAGS="$pixman_CFLAGS $CAIRO_CFLAGS"
-CAIRO_LIBS="$pixman_LIBS $CAIRO_LIBS"
+CAIRO_CONFIG_AMAKE='# Generated by configure. Do not edit.
+
+include $(top_srcdir)/src/Sources.mk
+
+enabled_cairo_pkgconf = cairo.pc
+enabled_cairo_headers = $(cairo_headers)
+enabled_cairo_private = $(cairo_private)
+enabled_cairo_sources = $(cairo_sources)
+all_cairo_pkgconf =
+all_cairo_headers = $(cairo_headers)
+all_cairo_private = $(cairo_private)
+all_cairo_sources = $(cairo_sources)
+supported_cairo_headers = $(cairo_headers)
+unsupported_cairo_headers =
+'
+CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_AMAKE'
+enabled_cairo_headers += $(_cairo_nodist_headers) $(_cairo_extra_headers)
+'
dnl ===========================================================================
@@ -793,6 +834,23 @@ AC_SUBST(LIBRSVG_CFLAGS)
AC_SUBST(LIBRSVG_LIBS)
dnl ===========================================================================
+
+dnl XXX make this a private feature?
+CAIRO_BACKEND_ENABLE(test_surfaces, test surfaces, test-surfaces, TEST_SURFACES, no)
+
+dnl ===========================================================================
+
+PIXMAN_VERSION="0.11.2"
+PIXMAN_REQUIRES="pixman-1 >= $PIXMAN_VERSION"
+PKG_CHECK_MODULES(pixman, $PIXMAN_REQUIRES, ,
+ [AC_MSG_ERROR([pixman >= $PIXMAN_VERSION is required
+(http://cairographics.org/releases/)])])
+
+CAIRO_REQUIRES="$PIXMAN_REQUIRES $CAIRO_REQUIRES"
+CAIRO_CFLAGS="$pixman_CFLAGS $CAIRO_CFLAGS"
+CAIRO_LIBS="$pixman_LIBS $CAIRO_LIBS"
+
+dnl ===========================================================================
dnl Build the external converter if we have any of the test backends
AM_CONDITIONAL(BUILD_ANY2PPM,
test "x$test_svg" = "xyes" \
@@ -1013,18 +1071,6 @@ AM_CONDITIONAL(CAIRO_HAS_LCOV, test "x$cairo_has_lcov" = "xyes")
dnl ===========================================================================
-AC_ARG_ENABLE(test-surfaces,
- AS_HELP_STRING([--enable-test-surfaces],
- [Add backends for more test suite coverage (no additional public functionality)]),
- [use_test_surfaces=$enableval], [use_test_surfaces=no])
-
-AM_CONDITIONAL(CAIRO_HAS_TEST_SURFACES, test "x$use_test_surfaces" = "xyes")
-if test "x$use_test_surfaces" = "xyes"; then
- AC_DEFINE(CAIRO_HAS_TEST_SURFACES, 1, [define in the extra test surface have been built into cairo for the test suite])
-fi
-
-dnl ===========================================================================
-
AC_ARG_ENABLE(some-floating-point,
AS_HELP_STRING([--disable-some-floating-point],
[Disable certain code paths that rely heavily on double precision
@@ -1048,6 +1094,12 @@ fi
dnl ===========================================================================
+CAIRO_CONFIG_COMMANDS([$srcdir/src/Config.mk],
+ [echo "$CAIRO_CONFIG_AMAKE"],
+ [CAIRO_CONFIG_AMAKE='$CAIRO_CONFIG_AMAKE'])
+CAIRO_CONFIG_COMMANDS([$srcdir/src/Config.mk.win32],
+ [echo "$CAIRO_CONFIG_WIN32"],
+ [CAIRO_CONFIG_WIN32='$CAIRO_CONFIG_WIN32'])
CAIRO_CONFIG_COMMANDS([src/cairo-features.h],
[
echo '/* Generated by configure. Do not edit. */'
@@ -1067,21 +1119,21 @@ CAIRO_CONFIG_COMMANDS([src/cairo-features.h],
CAIRO_FEATURES='$CAIRO_FEATURES'
CAIRO_NO_FEATURES='$CAIRO_NO_FEATURES'
])
-CAIRO_CONFIG_COMMANDS([src/cairo-no-features.h],
+CAIRO_CONFIG_COMMANDS([src/cairo-supported-features.h],
[
echo '/* Generated by configure. Do not edit. */'
- echo '#ifndef CAIRO_NO_FEATURES_H'
- echo '#define CAIRO_NO_FEATURES_H'
+ echo '#ifndef CAIRO_SUPPORTED_FEATURES_H'
+ echo '#define CAIRO_SUPPORTED_FEATURES_H'
echo ''
echo '/* This is a dummy header, to trick gtk-doc only */'
echo ''
- for FEATURE in $CAIRO_NO_FEATURES; do
+ for FEATURE in $CAIRO_SUPPORTED_FEATURES; do
echo "#define CAIRO_HAS_$FEATURE 1"
done
echo ''
echo '#endif'
],[
- CAIRO_NO_FEATURES='$CAIRO_NO_FEATURES'
+ CAIRO_SUPPORTED_FEATURES='$CAIRO_SUPPORTED_FEATURES'
])
AC_CONFIG_FILES([
Makefile
diff --git a/doc/public/Headers.mk b/doc/public/Headers.mk
deleted file mode 100644
index 7b9edff..0000000
--- a/doc/public/Headers.mk
+++ /dev/null
@@ -1,52 +0,0 @@
-PRIVATE_TEST_HFILES = \
- cairo-analysis-surface-private.h \
- cairo-arc-private.h \
- cairo-atomic-private.h \
- cairo-cache-private.h \
- cairo-clip-private.h \
- cairo-compiler-private.h \
- cairo-fixed-private.h \
- cairo-fixed-type-private.h \
- cairo-freelist-private.h \
- cairo-ft-private.h \
- cairo-glitz-private.h \
- cairo-gstate-private.h \
- cairo-hash-private.h \
- cairo-malloc-private.h \
- cairo-meta-surface-private.h \
- cairo-mutex-impl-private.h \
- cairo-mutex-list-private.h \
- cairo-mutex-private.h \
- cairo-mutex-type-private.h \
- cairo-os2-private.h \
- cairo-output-stream-private.h \
- cairo-paginated-private.h \
- cairo-paginated-surface-private.h \
- cairo-path-fixed-private.h \
- cairo-path-private.h \
- cairo-pdf-operators-private.h \
- cairo-pdf-surface-private.h \
- cairo-private.h \
- cairo-ps-surface-private.h \
- cairo-quartz-private.h \
- cairo-reference-count-private.h \
- cairo-region-private.h \
- cairo-scaled-font-private.h \
- cairo-scaled-font-subsets-private.h \
- cairo-skiplist-private.h \
- cairo-surface-fallback-private.h \
- cairo-surface-private.h \
- cairo-svg-surface-private.h \
- cairo-truetype-subset-private.h \
- cairo-type1-private.h \
- cairo-type3-glyph-surface-private.h \
- cairo-types-private.h \
- cairo-user-font-private.h \
- cairo-wideint-private.h \
- cairo-wideint-type-private.h \
- cairo-win32-private.h \
- cairo-xlib-private.h \
- cairo-xlib-surface-private.h \
- cairo-xlib-xrender-private.h \
- cairo-features-win32.h \
- cairoint.h
diff --git a/doc/public/Makefile.am b/doc/public/Makefile.am
index 2bab45b..2b6af97 100644
--- a/doc/public/Makefile.am
+++ b/doc/public/Makefile.am
@@ -16,31 +16,15 @@ DOC_SOURCE_DIR=../../src
HFILE_GLOB=$(top_srcdir)/src/cairo-*.h
CFILE_GLOB=$(top_srcdir)/src/cairo-*.c $(top_srcdir)/src/cairo-*.h
-include $(srcdir)/Headers.mk
-
-UNSUPPORTED_HFILES= \
- cairo-atsui.h \
- cairo-beos.h \
- cairo-directfb.h \
- cairo-glitz.h \
- cairo-os2.h \
- cairo-xcb.h \
- cairo-xcb-xrender.h
+include $(top_srcdir)/src/Config.mk
# Headers to ignore
-IGNORE_HFILES= \
- $(PRIVATE_TEST_HFILES) \
- $(UNSUPPORTED_HFILES)
-
-Headers.mk:
- ( echo "PRIVATE_TEST_HFILES = \\"; \
- find $(top_srcdir)/src \
- -name '*-private.h' | \
- sed 's at .*/@ @; s@$$@ \\@' | \
- LANG=C sort; \
- echo ' cairo-features-win32.h \'; \
- echo ' cairoint.h' ) > $@.tmp
- mv $@.tmp $@
+IGNORE_HFILES= \
+ cairo-features.h \
+ cairo-features-win32.h \
+ $(all_cairo_private) \
+ $(unsupported_cairo_headers) \
+ $(NULL)
# CFLAGS and LDFLAGS for compiling scan program. Only needed
# if $(DOC_MODULE).types is non-empty.
diff --git a/doc/public/README b/doc/public/README
new file mode 100644
index 0000000..f3d157b
--- /dev/null
+++ b/doc/public/README
@@ -0,0 +1,37 @@
+Cairo Reference Documentation
+=============================
+
+The API documentation is generated using gtk-doc.
+
+
+Building
+--------
+
+The documentation is not built by default. To build it you need to
+configure with gtk-doc enabled (--enable-gtk-doc), and run:
+
+ make doc
+
+
+Adding New API
+--------------
+
+When adding new symbols and macros to the public API, modify
+cairo-section.txt and add new symbols to the right place.
+
+When adding whole new features, you also need to modify cairo-docs.xml
+and add a new file under tmpl/. Beware that the files are tmpl/ are
+both manually edited AND modified by gtk-doc, gathering documentation
+stub from source files.
+
+
+Tests
+-----
+
+There are some tests in this directory, ensuring proper documentation
+syntax as well as checking that all public symbols are fully documented.
+
+After adding any new API, just run:
+
+ make check
+
diff --git a/perf/.gitignore b/perf/.gitignore
index d9d3b65..858e28a 100644
--- a/perf/.gitignore
+++ b/perf/.gitignore
@@ -1,3 +1,5 @@
+TAGS
+tags
cairo-perf
cairo-perf-diff-files
valgrind-log
diff --git a/src/.gitignore b/src/.gitignore
index 04dcae3..128bcc7 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -8,8 +8,10 @@ Makefile.in
*.lo
*.loT
*.pc
+Config.mk
+Config.mk.win32
cairo-features.h
-cairo-no-features.h
+cairo-supported-features.h
cairo.def
*.i
*.s
@@ -24,4 +26,5 @@ cairo.def
*~
.*.sw?
TAGS
+tags
check-has-hidden-symbols.i
diff --git a/src/Makefile.am b/src/Makefile.am
index 444714b..c292cad 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,348 +1,60 @@
-backend_pkgconfigs =
+include $(srcdir)/Config.mk
-cairo_base_headers = cairo.h
+EXTRA_DIST =
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
+BUILT_SOURCES =
-cairo_base_sources = \
- cairo.c \
- cairo.h \
- cairo-private.h \
- cairo-arc.c \
- cairo-arc-private.h \
- cairo-array.c \
- cairo-atomic.c \
- cairo-atomic-private.h \
- cairo-base85-stream.c \
- cairo-bentley-ottmann.c \
- cairo-cache.c \
- cairo-clip.c \
- cairo-clip-private.h \
- cairo-color.c \
- cairo-compiler-private.h \
- cairo-debug.c \
- cairo-fixed.c \
- cairo-font-face.c \
- cairo-font-options.c \
- cairo-freelist.c \
- cairo-freelist-private.h \
- cairo-gstate.c \
- cairo-gstate-private.h \
- cairo-hash.c \
- cairo-hash-private.h \
- cairo-hull.c \
- cairo-image-surface.c \
- cairo-lzw.c \
- cairo-misc.c \
- cairo-malloc-private.h \
- cairo-matrix.c \
- cairo-mutex.c \
- cairo-mutex-private.h \
- cairo-mutex-impl-private.h \
- cairo-mutex-type-private.h \
- cairo-path.c \
- cairo-path-private.h \
- cairo-path-bounds.c \
- cairo-path-fill.c \
- cairo-path-fixed.c \
- cairo-path-fixed-private.h \
- cairo-path-stroke.c \
- cairo-pattern.c \
- cairo-pen.c \
- cairo-polygon.c \
- cairo-rectangle.c \
- cairo-reference-count-private.h \
- cairo-region.c \
- cairo-region-private.h \
- cairo-scaled-font.c \
- cairo-scaled-font-private.h \
- cairo-skiplist.c \
- cairo-skiplist-private.h \
- cairo-slope.c \
- cairo-spline.c \
- cairo-stroke-style.c \
- cairo-surface.c \
- cairo-surface-fallback.c \
- cairo-surface-fallback-private.h \
- cairo-surface-private.h \
- cairo-traps.c \
- cairo-user-font.c \
- cairo-user-font-private.h \
- cairo-unicode.c \
- cairo-output-stream.c \
- cairo-output-stream-private.h \
- cairo-wideint.c \
- cairo-wideint-private.h \
- cairo-wideint-type-private.h \
- cairo-meta-surface.c \
- cairo-meta-surface-private.h \
- cairo-paginated-private.h \
- cairo-paginated-surface.c \
- cairo-paginated-surface-private.h \
- cairo-analysis-surface.c \
- cairo-analysis-surface-private.h \
- cairo-version.c \
- cairo-version.h \
- cairoint.h
-cairo_all_sources = $(cairo_base_sources) $(cairo_base_headers)
-cairo_headers = $(cairo_base_headers)
-cairo_sources = $(cairo_base_sources)
-
-font_subset_sources_base = \
- cairo-cff-subset.c \
- cairo-truetype-subset.c \
- cairo-type1-fallback.c \
- cairo-type1-private.h \
- cairo-truetype-subset-private.h \
- cairo-type3-glyph-surface.c \
- cairo-type3-glyph-surface-private.h \
- cairo-scaled-font-subsets.c \
- cairo-scaled-font-subsets-private.h
-cairo_all_sources += $(font_subset_sources_base)
-
-font_subset_sources_ft = cairo-type1-subset.c
-cairo_all_sources += $(font_subset_sources_ft)
-font_subset_sources = $(font_subset_sources_base)
-if CAIRO_HAS_FT_FONT
-font_subset_sources += $(font_subset_sources_ft)
-endif
-
-pdf_operators_sources = cairo-pdf-operators.c cairo-pdf-operators-private.h
-
-ps_headers = cairo-ps.h
-ps_sources = cairo-ps-surface.c cairo-ps-surface-private.h
-cairo_all_sources += $(ps_headers) $(ps_sources)
-if CAIRO_HAS_PS_SURFACE
-libcairo_pdf_operators_sources = $(pdf_operators_sources)
-libcairo_font_subset_sources = $(font_subset_sources)
-cairo_headers += $(ps_headers)
-cairo_sources += $(ps_sources)
-backend_pkgconfigs += cairo-ps.pc
-endif
-
-pdf_headers = cairo-pdf.h
-pdf_sources = cairo-pdf-surface.c cairo-pdf-surface-private.h \
- cairo-deflate-stream.c
-cairo_all_sources += $(pdf_headers) $(pdf_sources)
-if CAIRO_HAS_PDF_SURFACE
-libcairo_pdf_operators_sources = $(pdf_operators_sources)
-libcairo_font_subset_sources = $(font_subset_sources)
-cairo_headers += $(pdf_headers)
-cairo_sources += $(pdf_sources)
-backend_pkgconfigs += cairo-pdf.pc
-endif
-
-png_sources = cairo-png.c
-cairo_all_sources += $(png_sources)
-if CAIRO_HAS_PNG_FUNCTIONS
-cairo_sources += $(png_sources)
-backend_pkgconfigs += cairo-png.pc
-endif
-
-svg_headers = cairo-svg.h
-svg_sources = cairo-svg-surface.c cairo-svg-surface-private.h
-cairo_all_sources += $(svg_headers) $(svg_sources)
-if CAIRO_HAS_SVG_SURFACE
-libcairo_font_subset_sources = $(font_subset_sources)
-cairo_headers += $(svg_headers)
-cairo_sources += $(svg_sources)
-backend_pkgconfigs += cairo-svg.pc
-endif
-
-cairo_sources += $(libcairo_pdf_operators_sources)
-cairo_sources += $(libcairo_font_subset_sources)
-
-test_sources = test-fallback-surface.c test-fallback-surface.h \
- test-meta-surface.c test-meta-surface.h \
- test-paginated-surface.c test-paginated-surface.h
-cairo_all_sources += $(test_sources)
-if CAIRO_HAS_TEST_SURFACES
-cairo_sources += $(test_sources)
-endif
-
-xlib_headers = cairo-xlib.h
-xlib_sources = cairo-xlib-surface.c \
- cairo-xlib-surface-private.h \
- cairo-xlib-display.c \
- cairo-xlib-screen.c \
- cairo-xlib-visual.c \
- cairo-xlib-private.h \
- cairo-xlib-xrender-private.h
-cairo_all_sources += $(xlib_headers) $(xlib_sources)
-if CAIRO_HAS_XLIB_SURFACE
-cairo_headers += $(xlib_headers)
-cairo_sources += $(xlib_sources)
-backend_pkgconfigs += cairo-xlib.pc
-endif
-
-xlib_xrender_headers = cairo-xlib-xrender.h
-cairo_all_sources += $(xlib_xrender_headers)
-if CAIRO_HAS_XLIB_XRENDER_SURFACE
-cairo_headers += $(xlib_xrender_headers)
-backend_pkgconfigs += cairo-xlib-xrender.pc
-endif
-
-xcb_headers = cairo-xcb.h cairo-xcb-xrender.h
-xcb_sources = cairo-xcb-surface.c
-cairo_all_sources += $(xcb_headers) $(xcb_sources)
-if CAIRO_HAS_XCB_SURFACE
-cairo_headers += $(xcb_headers)
-cairo_sources += $(xcb_sources)
-backend_pkgconfigs += cairo-xcb.pc
-endif
-
-quartz_headers = cairo-quartz.h
-quartz_sources = cairo-quartz-surface.c cairo-quartz-image-surface.c cairo-quartz-private.h
-cairo_all_sources += $(quartz_headers) $(quartz_sources)
-if CAIRO_HAS_QUARTZ_SURFACE
-cairo_headers += $(quartz_headers)
-cairo_sources += $(quartz_sources)
-backend_pkgconfigs += cairo-quartz.pc
-endif
-if CAIRO_HAS_QUARTZ_IMAGE_SURFACE
-cairo_headers += cairo-quartz-image.h
-backend_pkgconfigs += cairo-quartz-image.pc
-endif
-
-quartz_font_sources = cairo-quartz-font.c
-cairo_all_sources += $(quartz_font_sources)
-if CAIRO_HAS_QUARTZ_FONT
-cairo_sources += $(quartz_font_sources)
-backend_pkgconfigs += cairo-quartz-font.pc
-endif
-
-os_win32_sources = cairo-win32.c
-cairo_all_sources += $(os_win32_sources)
if OS_WIN32
-cairo_sources += $(os_win32_sources)
export_symbols = -export-symbols cairo.def
cairo_def_dependency = cairo.def
endif
-win32_headers = cairo-win32.h
-win32_sources = cairo-win32-surface.c cairo-win32-printing-surface.c cairo-win32-private.h
-cairo_all_sources += $(win32_headers) $(win32_sources)
-if CAIRO_HAS_WIN32_SURFACE
-cairo_headers += $(win32_headers)
-cairo_sources += $(win32_sources)
-backend_pkgconfigs += cairo-win32.pc
-endif
+EXTRA_DIST += cairo-features-win32.h Config.mk.win32
+MAINTAINERCLEANFILES += cairo-features-win32.h Config.mk.win32
-win32_font_sources = cairo-win32-font.c
-cairo_all_sources += $(win32_font_sources)
-if CAIRO_HAS_WIN32_FONT
-cairo_sources += $(win32_font_sources)
-backend_pkgconfigs += cairo-win32-font.pc
-endif
-
-os2_headers = cairo-os2.h
-os2_sources = cairo-os2-surface.c cairo-os2-private.h
-cairo_all_sources += $(os2_headers) $(os2_sources)
-if CAIRO_HAS_OS2_SURFACE
-cairo_headers += $(os2_headers)
-cairo_sources += $(os2_sources)
-backend_pkgconfigs += cairo-os2.pc
-endif
-
-beos_headers = cairo-beos.h
-beos_sources = cairo-beos-surface.cpp
-cairo_all_sources += $(beos_headers) $(beos_sources)
-if CAIRO_HAS_BEOS_SURFACE
-cairo_headers += $(beos_headers)
-# automake is stupid enough to always use c++ linker if we enable the
-# following line, even if beos surface is not enabled. Disable it for now.
-#cairo_sources += $(beos_sources)
-backend_pkgconfigs += cairo-beos.pc
-endif
-
-glitz_headers = cairo-glitz.h
-glitz_sources = cairo-glitz-surface.c cairo-glitz-private.h
-cairo_all_sources += $(glitz_headers) $(glitz_sources)
-if CAIRO_HAS_GLITZ_SURFACE
-cairo_headers += $(glitz_headers)
-cairo_sources += $(glitz_sources)
-backend_pkgconfigs += cairo-glitz.pc
-endif
-
-directfb_headers = cairo-directfb.h
-directfb_sources = cairo-directfb-surface.c
-cairo_all_sources += $(directfb_headers) $(directfb_sources)
-if CAIRO_HAS_DIRECTFB_SURFACE
-cairo_headers += $(directfb_headers)
-cairo_sources += $(directfb_sources)
-backend_pkgconfigs += cairo-directfb.pc
-endif
-
-ft_headers = cairo-ft.h
-ft_sources = cairo-ft-font.c cairo-ft-private.h
-cairo_all_sources += $(ft_headers) $(ft_sources)
-if CAIRO_HAS_FT_FONT
-cairo_headers += $(ft_headers)
-cairo_sources += $(ft_sources)
-backend_pkgconfigs += cairo-ft.pc
-endif
+$(top_builddir)/config.h: $(top_srcdir)/config.h.in
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) config.h
-# These names match automake style variable definition conventions so
-# without these lines, automake will complain during the handling of
-# the libcairo_la_LIBADD below. (The INCLUDES is an autoconf only
-# term and automake does not care about it)
-FONTCONFIG_LIBS=@FONTCONFIG_LIBS@
-XRENDER_LIBS=@XRENDER_LIBS@
+all_cairo_files = \
+ $(cairo_all_headers) \
+ $(cairo_all_private) \
+ $(cairo_all_sources) \
+ $(NULL)
cairoincludedir = $(includedir)/cairo
-cairoinclude_HEADERS = \
- cairo-deprecated.h \
- $(top_srcdir)/cairo-version.h \
- $(cairo_headers)
-
-nodist_cairoinclude_HEADERS = \
- cairo-features.h
+cairoinclude_HEADERS = $(enabled_cairo_headers)
lib_LTLIBRARIES = libcairo.la
-# source files that cannot be passed to compiler directly.
-# mostly when they depend recursively on cairoint.h. that is,
-# cairoint.h includes them in the middle.
-cairo_special_sources = \
- cairo-cache-private.h \
- cairo-fixed-private.h \
- cairo-fixed-type-private.h \
- cairo-mutex-list-private.h \
- cairo-types-private.h
-
-libcairo_la_SOURCES = \
- $(cairo_sources) \
- $(cairo_special_sources)
-
-cairo_all_source_files = \
- $(cairo_all_sources) \
- $(cairo_special_sources)
-
+libcairo_la_SOURCES = \
+ $(enabled_cairo_headers) \
+ $(enabled_cairo_private) \
+ $(enabled_cairo_sources) \
+ $(NULL)
libcairo_la_LDFLAGS = -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols)
-
libcairo_la_CFLAGS = -I$(srcdir) $(CAIRO_CFLAGS)
-
-libcairo_la_LIBADD = $(CAIRO_LIBS) $(noinst_LTLIBRARIES) $(CAIRO_LDADD)
-
-libcairo_la_DEPENDENCIES = $(cairo_def_dependency) $(noinst_LTLIBRARIES)
+libcairo_la_LIBADD = $(CAIRO_LIBS) $(CAIRO_LDADD)
+libcairo_la_DEPENDENCIES = $(cairo_def_dependency)
+
+# Special headers
+cairoinclude_HEADERS += $(top_srcdir)/cairo-version.h
+nodist_cairoinclude_HEADERS = cairo-features.h
+libcairo_la_SOURCES += cairo-version.h cairo-features.h
+BUILT_SOURCES += cairo-features.h cairo-supported-features.h
+DISTCLEANFILES += cairo-features.h cairo-supported-features.h
+cairo-features.h cairo-supported-features.h:
+ cd $(top_builddir) && ./config.status src/$@
pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = cairo.pc $(backend_pkgconfigs)
-DISTCLEANFILES = $(backend_pkgconfigs)
-EXTRA_DIST = cairo-backend.pc.in cairo-features-win32.h
-$(backend_pkgconfigs): $(top_srcdir)/configure
- cd $(top_builddir) && ./config.status --recheck
+pkgconfig_DATA = $(enabled_cairo_pkgconf)
-$(top_builddir)/config.h: $(top_srcdir)/config.h.in
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) config.h
-
-DISTCLEANFILES += cairo-features.h cairo-no-features.h
-cairo-features.h cairo-no-features.h:
- cd $(top_builddir) && ./config.status src/$@
-
-CLEANFILES = cairo.def
-cairo.def: $(cairo_headers) cairo-features.h
+CLEANFILES += cairo.def
+cairo.def: cairo-features.h $(enabled_cairo_headers)
@echo Generating $@
@(echo EXPORTS; \
- (cd $(srcdir); cat $(cairo_headers) || echo 'cairo_ERROR ()' ) | \
+ (cd $(srcdir); cat $(enabled_cairo_headers) || echo 'cairo_ERROR ()' ) | \
grep -v -E '^# *include' | \
( cat cairo-features.h - | $(CPP) - || echo 'cairo_ERROR ()' ) | \
grep -E '^cairo_.* \(' | \
@@ -352,40 +64,27 @@ cairo.def: $(cairo_headers) cairo-features.h
) >$@
@ ! grep -q cairo_ERROR $@ || ($(RM) $@; false)
-install-data-local:
- @if test -f "$(DESTDIR)$(includedir)/cairo.h" || test -f "$(DESTDIR)$(includedir)/cairo-features.h" ; then \
- echo "****************************************************************" ; \
- echo "*** Error: Old headers found. You should remove the following" ; \
- echo "*** files and then type 'make install' again." ; \
- ls $(includedir)/cairo*.h ; \
- echo "****************************************************************" ; \
- false ; \
- fi
-
-TESTS_ENVIRONMENT = srcdir="$(srcdir)" MAKE="$(MAKE)" cairo_all_source_files="$(cairo_all_source_files)"
+TESTS_ENVIRONMENT = srcdir="$(srcdir)" MAKE="$(MAKE)" all_cairo_files="$(all_cairo_files)" enabled_cairo_files="$(enabled_cairo_files)"
TESTS = check-def.sh check-plt.sh check-headers.sh check-cairoint.sh check-doc-syntax.sh
EXTRA_DIST += $(TESTS) check-has-hidden-symbols.c
-DISTCLEANFILES += check-has-hidden-symbols.i
-# Delete intermediate files as well
-clean-local:
- -${FIND} . -name '*.[is]' -print | ${XARGS} ${RM}
# The pre-processed result is used by check-{def,plt}.sh to determine whether
# cairo has been compiled with symbol hiding.
.c.i: $(cairoinclude_HEADERS) $(nodist_cairoinclude_HEADERS) cairoint.h $(top_builddir)/config.h
$(CPP) -DHAVE_CONFIG_H -I$(top_builddir) -I. $(libcairo_la_CFLAGS) $< -o $@
+CLEANFILES += *.i *.s
SPARSE = sparse
sparse:
- @status=true; for f in $(cairo_sources); do \
+ @status=true; for f in $(enabled_cairo_sources); do \
echo sparse $$f; \
$(SPARSE) -I$(top_builddir) $(libcairo_la_CFLAGS) -DHAVE_CONFIG_H $$f || status=false; \
done; $$status
SPLINT = splint -badflag
splint:
- @status=true; for f in $(cairo_sources); do \
+ @status=true; for f in $(enabled_cairo_sources); do \
test "$$f" = "`echo "$$f" | sed 's/[.]h$$//'`" || continue; \
echo sparse $$f; \
$(SPLINT) -I$(top_builddir) $(libcairo_la_CFLAGS) -DHAVE_CONFIG_H $$f || status=false; \
@@ -394,7 +93,7 @@ splint:
UNO = uno
uno:
@cpp_flags=`echo $(libcairo_la_CFLAGS) | sed 's/\(-I.*\) /\1 /g'`; \
- files=`echo $(cairo_sources) | sed 's/[^ ]*\.h//g'`; \
+ files=`echo $(enabled_cairo_sources) | sed 's/[^ ]*\.h//g'`; \
$(UNO) -I$(top_builddir) $$cpp_flags -DHAVE_CONFIG_H -U__GNUC__ $$files
EXTRA_DIST += Makefile.win32
diff --git a/src/Makefile.win32 b/src/Makefile.win32
index 5fcf605..753fb9a 100644
--- a/src/Makefile.win32
+++ b/src/Makefile.win32
@@ -1,8 +1,9 @@
-
SUBMAKEFILE = 1
include ../Makefile.win32
+include Config.mk.win32
+
srcdir = `pwd`
SOURCES = \
diff --git a/src/README b/src/README
new file mode 100644
index 0000000..f29dd3a
--- /dev/null
+++ b/src/README
@@ -0,0 +1,58 @@
+Cairo Library Source Code
+=========================
+
+This directory contains the source code to the cairo library.
+
+
+Source Code Listing
+-------------------
+
+The canonical list of source files is the file Source.mk. See that
+file for how it works.
+
+
+New Backends
+------------
+
+The rule of the thumb for adding new backends is to see how other
+backends are integrated. Pick one of the simpler, unsupported, backends
+and search the entire tree for it, and go from there.
+
+To add new backends you need to basically:
+
+ * Modify $(top_srcdir)/configure.in to add checks for your backend.
+
+ * Modify Sources.mk to add source files for your backend,
+
+ * Modify $(top_srcdir)/boilerplate/ to add boilerplate code for
+ testing your new backend.
+
+
+New API
+-------
+
+After adding new API, run "make check" in this directory and fix any
+reported issues. Also add new API to the right location in
+$(top_srcdir)/doc/public/cairo-sections.txt and run "make check"
+in $(top_builddir)/doc/public to make sure that any newly added
+documentation is correctly hooked up.
+
+Do not forget to add tests for the new API. See next section.
+
+
+Tests
+-----
+
+There are some tests in this directory that check the source code and
+the build for various issues. The tests are very quick to run, and
+particularly should be run after any documentation or API changes. It
+does not hurt to run them after any source modification either. Run
+them simply by calling:
+
+ make check
+
+There are also extensive regression tests in $(top_srcdir)/test. It is
+a good idea to run that test suite for any changes made to the source
+code. Moreover, for any new feature, API, or bug fix, new tests should
+be added to the regression test suite to test the new code.
+
diff --git a/src/Sources.mk b/src/Sources.mk
new file mode 100644
index 0000000..8652dad
--- /dev/null
+++ b/src/Sources.mk
@@ -0,0 +1,246 @@
+# Sources.mk
+#
+# This file is the canonical location listing all the source files used
+# to build the cairo library. Every source file is categorized as one of:
+#
+# * public header file
+# * private header file (must end in -private.h except for cairoint.h)
+# * source code file
+#
+# Every source file should be specified exactly once, grouped with the
+# backend/feature that uses the source file. If more than one
+# backend/feature use the file (like pdf_operators or font_subset files),
+# the files should be appended to to the base cairo files, and the code
+# inside them enabled/disabled using C preprocessor macros defined in
+# cairoint.h. See how pdf_operators or font_subset are handled.
+#
+# The sources are picked up according to the configured backends/features
+# by the generated file Config.mk or Config.mk.win32.
+#
+# These are a few special source files. Those are not included in this
+# file to not confuse build systems. Each build system must handle them
+# separately. These files include:
+#
+# * cairo-features.h:
+# This file is generated by configure and includes macros signifying
+# which backends/features are enabled. This file should be installed
+# like other public headers, but should NOT be distributed in the
+# cairo distribution.
+#
+# * cairo-features-win32.h:
+# This is a dummy file for use as cairo-featurs.h when building on
+# win32. This file is not used during the build and should NOT be
+# installed.
+#
+# * cairo-version.h:
+# This is a dummy header file used during the build, but it should
+# NOT be installed. Its sole purpose is to make sure changes in the
+# cairo version do not trigger a full rebuild of the library, but
+# just the functions actually using the version information.
+#
+# * $(top_srcdir)/cairo-version.h:
+# This is the real file holding the cairo version number. This file
+# should be installed like other public headers. This is used during
+# the build by cairo-version.c only.
+#
+# * cairo-supported-features.h:
+# This file is generated by configure and includes macros signifying
+# all supported supported backends/features. This is used by gtk-doc
+# to generate documentation for all those macros, enabled or not.
+# This file is NOT used during the build of the library and should NOT
+# be installed or distributed.
+#
+# Please follow the strict syntax of this file, including keeping file
+# lists sorted.
+#
+
+cairo_headers = cairo.h cairo-deprecated.h
+cairo_private = \
+ cairoint.h \
+ cairo-analysis-surface-private.h \
+ cairo-arc-private.h \
+ cairo-atomic-private.h \
+ cairo-cache-private.h \
+ cairo-clip-private.h \
+ cairo-compiler-private.h \
+ cairo-fixed-private.h \
+ cairo-fixed-type-private.h \
+ cairo-freelist-private.h \
+ cairo-gstate-private.h \
+ cairo-hash-private.h \
+ cairo-malloc-private.h \
+ cairo-meta-surface-private.h \
+ cairo-mutex-impl-private.h \
+ cairo-mutex-list-private.h \
+ cairo-mutex-private.h \
+ cairo-mutex-type-private.h \
+ cairo-output-stream-private.h \
+ cairo-paginated-private.h \
+ cairo-paginated-surface-private.h \
+ cairo-path-fixed-private.h \
+ cairo-path-private.h \
+ cairo-private.h \
+ cairo-reference-count-private.h \
+ cairo-region-private.h \
+ cairo-scaled-font-private.h \
+ cairo-skiplist-private.h \
+ cairo-surface-fallback-private.h \
+ cairo-surface-private.h \
+ cairo-types-private.h \
+ cairo-user-font-private.h \
+ cairo-wideint-private.h \
+ cairo-wideint-type-private.h \
+ $(NULL)
+cairo_sources = \
+ cairo-analysis-surface.c \
+ cairo-arc.c \
+ cairo-array.c \
+ cairo-atomic.c \
+ cairo-base85-stream.c \
+ cairo-bentley-ottmann.c \
+ cairo.c \
+ cairo-cache.c \
+ cairo-clip.c \
+ cairo-color.c \
+ cairo-debug.c \
+ cairo-fixed.c \
+ cairo-font-face.c \
+ cairo-font-options.c \
+ cairo-freelist.c \
+ cairo-gstate.c \
+ cairo-hash.c \
+ cairo-hull.c \
+ cairo-image-surface.c \
+ cairo-lzw.c \
+ cairo-matrix.c \
+ cairo-meta-surface.c \
+ cairo-misc.c \
+ cairo-mutex.c \
+ cairo-output-stream.c \
+ cairo-paginated-surface.c \
+ cairo-path-bounds.c \
+ cairo-path.c \
+ cairo-path-fill.c \
+ cairo-path-fixed.c \
+ cairo-path-stroke.c \
+ cairo-pattern.c \
+ cairo-pen.c \
+ cairo-polygon.c \
+ cairo-rectangle.c \
+ cairo-region.c \
+ cairo-scaled-font.c \
+ cairo-skiplist.c \
+ cairo-slope.c \
+ cairo-spline.c \
+ cairo-stroke-style.c \
+ cairo-surface.c \
+ cairo-surface-fallback.c \
+ cairo-traps.c \
+ cairo-unicode.c \
+ cairo-user-font.c \
+ cairo-version.c \
+ cairo-wideint.c \
+ $(NULL)
+
+_cairo_font_subset_private = \
+ cairo-scaled-font-subsets-private.h \
+ cairo-truetype-subset-private.h \
+ cairo-type1-private.h \
+ cairo-type3-glyph-surface-private.h \
+ $(NULL)
+_cairo_font_subset_sources = \
+ cairo-cff-subset.c \
+ cairo-scaled-font-subsets.c \
+ cairo-truetype-subset.c \
+ cairo-type1-fallback.c \
+ cairo-type1-subset.c \
+ cairo-type3-glyph-surface.c \
+ $(NULL)
+cairo_private += $(_cairo_font_subset_private)
+cairo_sources += $(_cairo_font_subset_sources)
+
+_cairo_pdf_operators_private = cairo-pdf-operators-private.h
+_cairo_pdf_operators_sources = cairo-pdf-operators.c
+cairo_private += $(_cairo_pdf_operators_private)
+cairo_sources += $(_cairo_pdf_operators_sources)
+
+cairo_png_sources = cairo-png.c
+
+cairo_ps_headers = cairo-ps.h
+cairo_ps_private = cairo-ps-surface-private.h
+cairo_ps_sources = cairo-ps-surface.c
+
+cairo_pdf_headers = cairo-pdf.h
+cairo_pdf_private = cairo-pdf-surface-private.h
+cairo_pdf_sources = cairo-pdf-surface.c cairo-deflate-stream.c
+
+cairo_svg_headers = cairo-svg.h
+cairo_svg_private = cairo-svg-surface-private.h
+cairo_svg_sources = cairo-svg-surface.c
+
+cairo_ft_headers = cairo-ft.h
+cairo_ft_private = cairo-ft-private.h
+cairo_ft_sources = cairo-ft-font.c
+
+# These are private, even though they look like public headers
+cairo_test_surfaces_private = \
+ test-fallback-surface.h \
+ test-meta-surface.h \
+ test-paginated-surface.h \
+ $(NULL)
+cairo_test_surfaces_sources = \
+ test-fallback-surface.c \
+ test-meta-surface.c \
+ test-paginated-surface.c \
+ $(NULL)
+
+cairo_xlib_headers = cairo-xlib.h
+cairo_xlib_private = \
+ cairo-xlib-private.h \
+ cairo-xlib-surface-private.h \
+ cairo-xlib-xrender-private.h \
+ $(NULL)
+cairo_xlib_sources = \
+ cairo-xlib-display.c \
+ cairo-xlib-screen.c \
+ cairo-xlib-surface.c \
+ cairo-xlib-visual.c \
+ $(NULL)
+
+cairo_xlib_xrender_headers = cairo-xlib-xrender.h
+
+# XXX split xcb-xrender. or better yet, merge it into xcb. xcb is so recent
+# that it's hard to imagine having xcb but not render.
+cairo_xcb_headers = cairo-xcb.h cairo-xcb-xrender.h
+cairo_xcb_sources = cairo-xcb-surface.c
+
+cairo_quartz_headers = cairo-quartz.h
+cairo_quartz_private = cairo-quartz-private.h
+cairo_quartz_sources = cairo-quartz-surface.c
+
+cairo_quratz_image_headers = cairo-quartz-image.h
+cairo_quratz_image_sources = cairo-quartz-image-surface.c
+
+cairo_quartz_font_sources = cairo-quartz-font.c
+
+cairo_win32_headers = cairo-win32.h
+cairo_win32_private = cairo-win32-private.h
+cairo_win32_sources = cairo-win32-surface.c cairo-win32-printing-surface.c
+
+cairo_win32_font_sources = cairo-win32-font.c
+
+cairo_os2_headers = cairo-os2.h
+cairo_os2_private = cairo-os2-private.h
+cairo_os2_sources = cairo-os2-surface.c
+
+# automake is stupid enough to always use c++ linker if we enable the
+# following lines, even if beos surface is not enabled. Disable it for now.
+cairo_beos_headers = cairo-beos.h
+#cairo_beos_sources = cairo-beos-surface.cpp
+
+cairo_glitz_headers = cairo-glitz.h
+cairo_glitz_private = cairo-glitz-private.h
+cairo_glitz_sources = cairo-glitz-surface.c
+
+cairo_directfb_headers = cairo-directfb.h
+cairo_directfb_sources = cairo-directfb-surface.c
diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c
index 53c5a17..008cc68 100644
--- a/src/cairo-cff-subset.c
+++ b/src/cairo-cff-subset.c
@@ -41,6 +41,9 @@
#define _BSD_SOURCE /* for snprintf(), strdup() */
#include "cairoint.h"
+
+#if CAIRO_HAS_FONT_SUBSET
+
#include "cairo-scaled-font-subsets-private.h"
#include "cairo-truetype-subset-private.h"
#include <string.h>
@@ -2282,3 +2285,5 @@ _cairo_cff_fallback_fini (cairo_cff_subset_t *subset)
free (subset->widths);
free (subset->data);
}
+
+#endif /* CAIRO_HAS_FONT_SUBSET */
diff --git a/src/cairo-clip-private.h b/src/cairo-clip-private.h
index 2e1eabd..36c0fbd 100644
--- a/src/cairo-clip-private.h
+++ b/src/cairo-clip-private.h
@@ -36,8 +36,11 @@
#ifndef CAIRO_CLIP_PRIVATE_H
#define CAIRO_CLIP_PRIVATE_H
+#include "cairo-types-private.h"
#include "cairo-compiler-private.h"
#include "cairo-path-fixed-private.h"
+#include "cairo-reference-count-private.h"
+#include "cairo-region-private.h"
extern const cairo_private cairo_rectangle_list_t _cairo_rectangles_nil;
diff --git a/src/cairo-compiler-private.h b/src/cairo-compiler-private.h
index 6c14048..295b587 100644
--- a/src/cairo-compiler-private.h
+++ b/src/cairo-compiler-private.h
@@ -38,7 +38,9 @@
#ifndef CAIRO_COMPILER_PRIVATE_H
#define CAIRO_COMPILER_PRIVATE_H
-CAIRO_BEGIN_DECLS
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
#if __GNUC__ >= 3 && defined(__ELF__) && !defined(__sun)
# define slim_hidden_proto(name) slim_hidden_proto1(name, slim_hidden_int_name(name)) cairo_private
@@ -126,6 +128,4 @@ CAIRO_BEGIN_DECLS
#define inline __inline__
#endif
-CAIRO_END_DECLS
-
#endif
diff --git a/src/cairo-freelist-private.h b/src/cairo-freelist-private.h
index 218c4c0..48791c2 100644
--- a/src/cairo-freelist-private.h
+++ b/src/cairo-freelist-private.h
@@ -23,6 +23,7 @@
#define CAIRO_FREELIST_H
#include "cairo-types-private.h"
+#include "cairo-compiler-private.h"
/* Opaque implementation types. */
typedef struct _cairo_freelist cairo_freelist_t;
diff --git a/src/cairo-misc.c b/src/cairo-misc.c
index 9a0ede0..b927c94 100644
--- a/src/cairo-misc.c
+++ b/src/cairo-misc.c
@@ -3,6 +3,7 @@
*
* Copyright © 2002 University of Southern California
* Copyright © 2005 Red Hat, Inc.
+ * Copyright © 2007 Adrian Johnson
*
* This library is free software; you can redistribute it and/or
* modify it either under the terms of the GNU Lesser General Public
@@ -34,6 +35,7 @@
*
* Contributor(s):
* Carl D. Worth <cworth at cworth.org>
+ * Adrian Johnson <ajohnson at redneon.com>
*/
#include "cairoint.h"
@@ -599,3 +601,69 @@ _cairo_lround (double d)
#undef MSW
#undef LSW
}
+
+
+#ifdef _WIN32
+
+#define WIN32_LEAN_AND_MEAN
+/* We require Windows 2000 features such as ETO_PDY */
+#if !defined(WINVER) || (WINVER < 0x0500)
+# define WINVER 0x0500
+#endif
+#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
+# define _WIN32_WINNT 0x0500
+#endif
+
+#include <windows.h>
+#include <io.h>
+
+/* tmpfile() replacment for Windows.
+ *
+ * On Windows tmpfile() creates the file in the root directory. This
+ * may fail due to unsufficient privileges.
+ */
+FILE *
+_cairo_win32_tmpfile (void)
+{
+ DWORD path_len;
+ WCHAR path_name[MAX_PATH + 1];
+ WCHAR file_name[MAX_PATH + 1];
+ HANDLE handle;
+ int fd;
+ FILE *fp;
+
+ path_len = GetTempPathW (MAX_PATH, path_name);
+ if (path_len <= 0 || path_len >= MAX_PATH)
+ return NULL;
+
+ if (GetTempFileNameW (path_name, L"ps_", 0, file_name) == 0)
+ return NULL;
+
+ handle = CreateFileW (file_name,
+ GENERIC_READ | GENERIC_WRITE,
+ 0,
+ NULL,
+ CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE,
+ NULL);
+ if (handle == INVALID_HANDLE_VALUE) {
+ DeleteFileW (file_name);
+ return NULL;
+ }
+
+ fd = _open_osfhandle((intptr_t) handle, 0);
+ if (fd < 0) {
+ CloseHandle (handle);
+ return NULL;
+ }
+
+ fp = fdopen(fd, "w+b");
+ if (fp == NULL) {
+ _close(fd);
+ return NULL;
+ }
+
+ return fp;
+}
+
+#endif /* _WIN32 */
diff --git a/src/cairo-mutex-impl-private.h b/src/cairo-mutex-impl-private.h
index db3393a..db65bd1 100644
--- a/src/cairo-mutex-impl-private.h
+++ b/src/cairo-mutex-impl-private.h
@@ -45,10 +45,6 @@
#include "config.h"
#endif
-#include "cairo-features.h"
-
-CAIRO_BEGIN_DECLS
-
/* A fully qualified no-operation statement */
#define CAIRO_MUTEX_IMPL_NOOP do {/*no-op*/} while (0)
@@ -221,6 +217,4 @@ CAIRO_BEGIN_DECLS
#endif
-CAIRO_END_DECLS
-
#endif
diff --git a/src/cairo-mutex-private.h b/src/cairo-mutex-private.h
index 61b87d7..d4bf68b 100644
--- a/src/cairo-mutex-private.h
+++ b/src/cairo-mutex-private.h
@@ -41,6 +41,10 @@
#ifndef CAIRO_MUTEX_PRIVATE_H
#define CAIRO_MUTEX_PRIVATE_H
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "cairo-mutex-type-private.h"
CAIRO_BEGIN_DECLS
diff --git a/src/cairo-mutex-type-private.h b/src/cairo-mutex-type-private.h
index d8079a3..2314be1 100644
--- a/src/cairo-mutex-type-private.h
+++ b/src/cairo-mutex-type-private.h
@@ -41,12 +41,6 @@
#ifndef CAIRO_MUTEX_TYPE_PRIVATE_H
#define CAIRO_MUTEX_TYPE_PRIVATE_H
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "cairo-features.h"
-
#include "cairo-compiler-private.h"
#include "cairo-mutex-impl-private.h"
diff --git a/src/cairo-output-stream-private.h b/src/cairo-output-stream-private.h
index 15cd2c0..37239f2 100644
--- a/src/cairo-output-stream-private.h
+++ b/src/cairo-output-stream-private.h
@@ -39,6 +39,10 @@
#include "cairo-compiler-private.h"
#include "cairo-types-private.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+
typedef cairo_status_t (*cairo_output_stream_write_func_t) (cairo_output_stream_t *output_stream,
const unsigned char *data,
unsigned int length);
diff --git a/src/cairo-path-fixed-private.h b/src/cairo-path-fixed-private.h
index 9fcb2e1..4a5990d 100644
--- a/src/cairo-path-fixed-private.h
+++ b/src/cairo-path-fixed-private.h
@@ -36,6 +36,8 @@
#ifndef CAIRO_PATH_FIXED_PRIVATE_H
#define CAIRO_PATH_FIXED_PRIVATE_H
+#include "cairo-types-private.h"
+
enum cairo_path_op {
CAIRO_PATH_OP_MOVE_TO = 0,
CAIRO_PATH_OP_LINE_TO = 1,
diff --git a/src/cairo-pdf-operators-private.h b/src/cairo-pdf-operators-private.h
index 1c23da5..a85839b 100644
--- a/src/cairo-pdf-operators-private.h
+++ b/src/cairo-pdf-operators-private.h
@@ -162,5 +162,4 @@ _cairo_pdf_operators_show_text_glyphs (cairo_pdf_operators_t *pdf_operators,
cairo_bool_t backward,
cairo_scaled_font_t *scaled_font);
-
#endif /* CAIRO_PDF_OPERATORS_H */
diff --git a/src/cairo-pdf-operators.c b/src/cairo-pdf-operators.c
index 4729375..435503c 100644
--- a/src/cairo-pdf-operators.c
+++ b/src/cairo-pdf-operators.c
@@ -40,6 +40,9 @@
*/
#include "cairoint.h"
+
+#if CAIRO_HAS_PDF_OPERATORS
+
#include "cairo-pdf-operators-private.h"
#include "cairo-path-fixed-private.h"
#include "cairo-output-stream-private.h"
@@ -1425,3 +1428,5 @@ _cairo_pdf_operators_show_text_glyphs (cairo_pdf_operators_t *pdf_operators,
return _cairo_output_stream_get_status (pdf_operators->stream);
}
+
+#endif /* CAIRO_HAS_PDF_OPERATORS */
diff --git a/src/cairo-ps-surface-private.h b/src/cairo-ps-surface-private.h
index 95a5dc5..79ac983 100644
--- a/src/cairo-ps-surface-private.h
+++ b/src/cairo-ps-surface-private.h
@@ -46,6 +46,8 @@
#include "cairo-surface-private.h"
#include "cairo-pdf-operators-private.h"
+#include <time.h>
+
typedef struct cairo_ps_surface {
cairo_surface_t base;
diff --git a/src/cairo-reference-count-private.h b/src/cairo-reference-count-private.h
index aef8a1f..8dbc1ab 100644
--- a/src/cairo-reference-count-private.h
+++ b/src/cairo-reference-count-private.h
@@ -37,6 +37,10 @@
#ifndef CAIRO_REFRENCE_COUNT_PRIVATE_H
#define CAIRO_REFRENCE_COUNT_PRIVATE_H
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "cairo-atomic-private.h"
CAIRO_BEGIN_DECLS
diff --git a/src/cairo-region-private.h b/src/cairo-region-private.h
index 53c1e8a..1902500 100644
--- a/src/cairo-region-private.h
+++ b/src/cairo-region-private.h
@@ -40,6 +40,7 @@
#include <pixman.h>
#include "cairo-compiler-private.h"
+#include "cairo-types-private.h"
/* #cairo_region_t is defined in cairoint.h */
diff --git a/src/cairo-scaled-font-subsets-private.h b/src/cairo-scaled-font-subsets-private.h
index e877318..c7991a7 100644
--- a/src/cairo-scaled-font-subsets-private.h
+++ b/src/cairo-scaled-font-subsets-private.h
@@ -39,6 +39,8 @@
#include "cairoint.h"
+#if CAIRO_HAS_FONT_SUBSET
+
typedef struct _cairo_scaled_font_subsets_glyph {
unsigned int font_id;
unsigned int subset_id;
@@ -421,6 +423,9 @@ typedef struct _cairo_type1_subset {
unsigned long trailer_length;
} cairo_type1_subset_t;
+
+#if CAIRO_HAS_FT_FONT
+
/**
* _cairo_type1_subset_init:
* @type1_subset: a #cairo_type1_subset_t to initialize
@@ -454,6 +459,9 @@ _cairo_type1_subset_init (cairo_type1_subset_t *type_subset,
cairo_private void
_cairo_type1_subset_fini (cairo_type1_subset_t *subset);
+#endif /* CAIRO_HAS_FT_FONT */
+
+
/**
* _cairo_type1_scaled_font_is_type1:
* @scaled_font: a #cairo_scaled_font_t
@@ -592,4 +600,6 @@ _cairo_truetype_index_to_ucs4 (cairo_scaled_font_t *scaled_font,
unsigned long index,
uint32_t *ucs4);
+#endif /* CAIRO_HAS_FONT_SUBSET */
+
#endif /* CAIRO_SCALED_FONT_SUBSETS_PRIVATE_H */
diff --git a/src/cairo-scaled-font-subsets.c b/src/cairo-scaled-font-subsets.c
index f4ba926..9d95144 100644
--- a/src/cairo-scaled-font-subsets.c
+++ b/src/cairo-scaled-font-subsets.c
@@ -42,6 +42,9 @@
#define _BSD_SOURCE /* for snprintf(), strdup() */
#include "cairoint.h"
+
+#if CAIRO_HAS_FONT_SUBSET
+
#include "cairo-scaled-font-subsets-private.h"
#include "cairo-user-font-private.h"
@@ -1014,3 +1017,5 @@ CLEANUP_HASH:
return status;
}
+
+#endif /* CAIRO_HAS_FONT_SUBSET */
diff --git a/src/cairo-truetype-subset-private.h b/src/cairo-truetype-subset-private.h
index e4be77c..397a9f3 100644
--- a/src/cairo-truetype-subset-private.h
+++ b/src/cairo-truetype-subset-private.h
@@ -39,6 +39,8 @@
#include "cairoint.h"
+#if CAIRO_HAS_FONT_SUBSET
+
/* The structs defined here should strictly follow the TrueType
* specification and not be padded. We use only 16-bit integer
* in their definition to guarantee that. The fields of type
@@ -192,4 +194,6 @@ typedef struct _tt_glyph_data {
tt_composite_glyph_t glyph;
} tt_glyph_data_t;
+#endif /* CAIRO_HAS_FONT_SUBSET */
+
#endif /* CAIRO_TRUETYPE_SUBSET_PRIVATE_H */
diff --git a/src/cairo-truetype-subset.c b/src/cairo-truetype-subset.c
index 892ce41..20bb7c6 100644
--- a/src/cairo-truetype-subset.c
+++ b/src/cairo-truetype-subset.c
@@ -43,6 +43,8 @@
#define _BSD_SOURCE /* for snprintf(), strdup() */
#include "cairoint.h"
+#if CAIRO_HAS_FONT_SUBSET
+
#include "cairo-scaled-font-subsets-private.h"
#include "cairo-truetype-subset-private.h"
@@ -1323,3 +1325,5 @@ cleanup:
return status;
}
+
+#endif /* CAIRO_HAS_FONT_SUBSET */
diff --git a/src/cairo-type1-fallback.c b/src/cairo-type1-fallback.c
index 539ddf2..7550310 100644
--- a/src/cairo-type1-fallback.c
+++ b/src/cairo-type1-fallback.c
@@ -35,6 +35,9 @@
#define _BSD_SOURCE /* for snprintf(), strdup() */
#include "cairoint.h"
+
+#if CAIRO_HAS_FONT_SUBSET
+
#include "cairo-type1-private.h"
#include "cairo-scaled-font-subsets-private.h"
#include "cairo-path-fixed-private.h"
@@ -873,3 +876,5 @@ _cairo_type2_charstrings_fini (cairo_type2_charstrings_t *type2_subset)
free (type2_subset->widths);
}
+
+#endif /* CAIRO_HAS_FONT_SUBSET */
diff --git a/src/cairo-type1-private.h b/src/cairo-type1-private.h
index ae28e05..171c224 100644
--- a/src/cairo-type1-private.h
+++ b/src/cairo-type1-private.h
@@ -36,10 +36,16 @@
#ifndef CAIRO_TYPE1_PRIVATE_H
#define CAIRO_TYPE1_PRIVATE_H
+#include "cairoint.h"
+
+#if CAIRO_HAS_FONT_SUBSET
+
/* Magic constants for the type1 eexec encryption */
#define CAIRO_TYPE1_ENCRYPT_C1 ((unsigned short) 52845)
#define CAIRO_TYPE1_ENCRYPT_C2 ((unsigned short) 22719)
#define CAIRO_TYPE1_PRIVATE_DICT_KEY ((unsigned short) 55665)
#define CAIRO_TYPE1_CHARSTRING_KEY ((unsigned short) 4330)
+#endif /* CAIRO_HAS_FONT_SUBSET */
+
#endif /* CAIRO_TYPE1_PRIVATE_H */
diff --git a/src/cairo-type1-subset.c b/src/cairo-type1-subset.c
index b514181..8e1d329 100644
--- a/src/cairo-type1-subset.c
+++ b/src/cairo-type1-subset.c
@@ -38,13 +38,19 @@
* http://partners.adobe.com/public/developer/en/font/T1_SPEC.PDF
*/
+
#define _BSD_SOURCE /* for snprintf(), strdup() */
#include "cairoint.h"
+
+#if CAIRO_HAS_FONT_SUBSET
+
#include "cairo-type1-private.h"
#include "cairo-scaled-font-subsets-private.h"
#include "cairo-output-stream-private.h"
/* XXX: Eventually, we need to handle other font backends */
+#if CAIRO_HAS_FT_FONT
+
#include "cairo-ft-private.h"
#include <ft2build.h>
@@ -1405,3 +1411,7 @@ _cairo_type1_scaled_font_is_type1 (cairo_scaled_font_t *scaled_font)
return is_type1;
}
+
+#endif /* CAIRO_HAS_FT_FONT */
+
+#endif /* CAIRO_HAS_FONT_SUBSET */
diff --git a/src/cairo-type3-glyph-surface-private.h b/src/cairo-type3-glyph-surface-private.h
index 6981988..47aba01 100644
--- a/src/cairo-type3-glyph-surface-private.h
+++ b/src/cairo-type3-glyph-surface-private.h
@@ -37,6 +37,10 @@
#ifndef CAIRO_TYPE3_GLYPH_SURFACE_PRIVATE_H
#define CAIRO_TYPE3_GLYPH_SURFACE_PRIVATE_H
+#include "cairoint.h"
+
+#if CAIRO_HAS_FONT_SUBSET
+
#include "cairo-surface-private.h"
#include "cairo-pdf-operators-private.h"
@@ -71,4 +75,6 @@ _cairo_type3_glyph_surface_emit_glyph (void *abstract_surface,
cairo_box_t *bbox,
double *width);
+#endif /* CAIRO_HAS_FONT_SUBSET */
+
#endif /* CAIRO_TYPE3_GLYPH_SURFACE_PRIVATE_H */
diff --git a/src/cairo-type3-glyph-surface.c b/src/cairo-type3-glyph-surface.c
index eab756e..4c3afb4 100644
--- a/src/cairo-type3-glyph-surface.c
+++ b/src/cairo-type3-glyph-surface.c
@@ -35,6 +35,9 @@
*/
#include "cairoint.h"
+
+#if CAIRO_HAS_FONT_SUBSET
+
#include "cairo-type3-glyph-surface-private.h"
#include "cairo-output-stream-private.h"
#include "cairo-meta-surface-private.h"
@@ -443,3 +446,5 @@ _cairo_type3_glyph_surface_emit_glyph (void *abstract_surface,
return status;
}
+
+#endif /* CAIRO_HAS_FONT_SUBSET */
diff --git a/src/cairo-types-private.h b/src/cairo-types-private.h
index f2a6f63..91bfa8a 100644
--- a/src/cairo-types-private.h
+++ b/src/cairo-types-private.h
@@ -45,17 +45,27 @@
#include "cairo-fixed-type-private.h"
typedef struct _cairo_array cairo_array_t;
-typedef struct _cairo_hash_table cairo_hash_table_t;
typedef struct _cairo_cache cairo_cache_t;
-typedef struct _cairo_hash_entry cairo_hash_entry_t;
-typedef struct _cairo_surface_backend cairo_surface_backend_t;
typedef struct _cairo_clip cairo_clip_t;
+typedef struct _cairo_clip_path cairo_clip_path_t;
+typedef struct _cairo_color cairo_color_t;
+typedef struct _cairo_font_face_backend cairo_font_face_backend_t;
+typedef struct _cairo_gstate cairo_gstate_t;
+typedef struct _cairo_hash_entry cairo_hash_entry_t;
+typedef struct _cairo_hash_table cairo_hash_table_t;
+typedef struct _cairo_image_surface cairo_image_surface_t;
typedef struct _cairo_output_stream cairo_output_stream_t;
-typedef struct _cairo_scaled_font_subsets cairo_scaled_font_subsets_t;
typedef struct _cairo_paginated_surface_backend cairo_paginated_surface_backend_t;
+typedef struct _cairo_path_fixed cairo_path_fixed_t;
+typedef struct _cairo_rectangle_int16 cairo_glyph_size_t;
+typedef struct _cairo_region cairo_region_t;
typedef struct _cairo_scaled_font_backend cairo_scaled_font_backend_t;
-typedef struct _cairo_font_face_backend cairo_font_face_backend_t;
+typedef struct _cairo_scaled_font_subsets cairo_scaled_font_subsets_t;
+typedef struct _cairo_solid_pattern cairo_solid_pattern_t;
+typedef struct _cairo_surface_backend cairo_surface_backend_t;
+typedef struct _cairo_unscaled_font_backend cairo_unscaled_font_backend_t;
typedef struct _cairo_xlib_screen_info cairo_xlib_screen_info_t;
+
typedef cairo_array_t cairo_user_data_array_t;
/**
@@ -156,8 +166,6 @@ typedef enum _cairo_internal_surface_type {
CAIRO_INTERNAL_SURFACE_TYPE_TYPE3_GLYPH
} cairo_internal_surface_type_t;
-typedef struct _cairo_region cairo_region_t;
-
typedef struct _cairo_point {
cairo_fixed_t x;
cairo_fixed_t y;
@@ -199,8 +207,6 @@ struct _cairo_rectangle_int32 {
uint32_t width, height;
};
-typedef struct _cairo_rectangle_int16 cairo_glyph_size_t;
-
struct _cairo_point_int16 {
int16_t x, y;
};
@@ -233,13 +239,11 @@ typedef enum _cairo_direction {
CAIRO_DIRECTION_REVERSE
} cairo_direction_t;
-typedef struct _cairo_path_fixed cairo_path_fixed_t;
typedef enum _cairo_clip_mode {
CAIRO_CLIP_MODE_PATH,
CAIRO_CLIP_MODE_REGION,
CAIRO_CLIP_MODE_MASK
} cairo_clip_mode_t;
-typedef struct _cairo_clip_path cairo_clip_path_t;
typedef struct _cairo_edge {
cairo_line_t edge;
@@ -292,9 +296,6 @@ typedef struct _cairo_pen {
cairo_pen_vertex_t vertices_embedded[32];
} cairo_pen_t;
-typedef struct _cairo_color cairo_color_t;
-typedef struct _cairo_image_surface cairo_image_surface_t;
-
typedef struct _cairo_stroke_style {
double line_width;
cairo_line_cap_t line_cap;
diff --git a/src/cairo-user-font-private.h b/src/cairo-user-font-private.h
index d75c24b..2a39ff9 100644
--- a/src/cairo-user-font-private.h
+++ b/src/cairo-user-font-private.h
@@ -38,6 +38,7 @@
#define CAIRO_USER_FONT_PRIVATE_H
#include "cairo.h"
+#include "cairo-compiler-private.h"
cairo_private cairo_bool_t
_cairo_font_face_is_user (cairo_font_face_t *font_face);
diff --git a/src/cairo-win32.c b/src/cairo-win32.c
deleted file mode 100644
index a656ff8..0000000
--- a/src/cairo-win32.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: c; tab-width: 8; c-basic-offset: 4; indent-tabs-mode: t; -*- */
-/* Cairo - a vector graphics library with display and print output
- *
- * Copyright © 2007 Adrian Johnson
- *
- * This library is free software; you can redistribute it and/or
- * modify it either under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation
- * (the "LGPL") or, at your option, under the terms of the Mozilla
- * Public License Version 1.1 (the "MPL"). If you do not alter this
- * notice, a recipient may use your version of this file under either
- * the MPL or the LGPL.
- *
- * You should have received a copy of the LGPL along with this library
- * in the file COPYING-LGPL-2.1; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * You should have received a copy of the MPL along with this library
- * in the file COPYING-MPL-1.1
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.1 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
- * OF ANY KIND, either express or implied. See the LGPL or the MPL for
- * the specific language governing rights and limitations.
- *
- * The Original Code is the cairo graphics library.
- *
- * The Initial Developer of the Original Code is Adrian Johnson.
- *
- * Contributor(s):
- * Adrian Johnson <ajohnson at redneon.com>
- */
-
-#define WIN32_LEAN_AND_MEAN
-/* We require Windows 2000 features such as ETO_PDY */
-#if !defined(WINVER) || (WINVER < 0x0500)
-# define WINVER 0x0500
-#endif
-#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
-# define _WIN32_WINNT 0x0500
-#endif
-
-#include "cairoint.h"
-
-#include <windows.h>
-#include <io.h>
-
-/* tmpfile() replacment for Windows.
- *
- * On Windows tmpfile() creates the file in the root directory. This
- * may fail due to unsufficient privileges.
- */
-FILE *
-_cairo_win32_tmpfile (void)
-{
- DWORD path_len;
- WCHAR path_name[MAX_PATH + 1];
- WCHAR file_name[MAX_PATH + 1];
- HANDLE handle;
- int fd;
- FILE *fp;
-
- path_len = GetTempPathW (MAX_PATH, path_name);
- if (path_len <= 0 || path_len >= MAX_PATH)
- return NULL;
-
- if (GetTempFileNameW (path_name, L"ps_", 0, file_name) == 0)
- return NULL;
-
- handle = CreateFileW (file_name,
- GENERIC_READ | GENERIC_WRITE,
- 0,
- NULL,
- CREATE_ALWAYS,
- FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE,
- NULL);
- if (handle == INVALID_HANDLE_VALUE) {
- DeleteFileW (file_name);
- return NULL;
- }
-
- fd = _open_osfhandle((intptr_t) handle, 0);
- if (fd < 0) {
- CloseHandle (handle);
- return NULL;
- }
-
- fp = fdopen(fd, "w+b");
- if (fp == NULL) {
- _close(fd);
- return NULL;
- }
-
- return fp;
-}
diff --git a/src/cairo-xlib-xrender-private.h b/src/cairo-xlib-xrender-private.h
index a61a67e..329262c 100644
--- a/src/cairo-xlib-xrender-private.h
+++ b/src/cairo-xlib-xrender-private.h
@@ -33,6 +33,11 @@
#ifndef CAIRO_XLIB_XRENDER_PRIVATE_H
#define CAIRO_XLIB_XRENDER_PRIVATE_H
+#include "cairo-features.h"
+#include "cairo-compiler-private.h"
+
+#include <X11/Xlib.h>
+
#if CAIRO_HAS_XLIB_XRENDER_SURFACE
#include "cairo-xlib-xrender.h"
@@ -52,7 +57,7 @@
* take a pointer as first argument */
__attribute__((__unused__)) static void _void_consume (void *p, ...) { }
-__attribute__((__unused__)) static void * _voidp_consume (void *p, ...) { return NULL; }
+__attribute__((__unused__)) static void * _voidp_consume (void *p, ...) { return (void *)0; }
__attribute__((__unused__)) static int _int_consume (void *p, ...) { return 0; }
__attribute__((__unused__)) static void _void_consume_free (Display *p, XID n) { }
diff --git a/src/cairoint.h b/src/cairoint.h
index 6986546..bffceb3 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -75,6 +75,14 @@
#include "cairo-compiler-private.h"
+#if defined(CAIRO_HAS_PS_SURFACE) || defined(CAIRO_HAS_PDF_SURFACE) || defined(CAIRO_HAS_SVG_SURFACE)
+#define CAIRO_HAS_FONT_SUBSET 1
+#endif
+
+#if defined(CAIRO_HAS_PS_SURFACE) || defined(CAIRO_HAS_PDF_SURFACE)
+#define CAIRO_HAS_PDF_OPERATORS 1
+#endif
+
CAIRO_BEGIN_DECLS
#ifdef _WIN32
@@ -316,8 +324,6 @@ _cairo_user_data_array_set_data (cairo_user_data_array_t *array,
cairo_private unsigned long
_cairo_hash_string (const char *c);
-typedef struct _cairo_unscaled_font_backend cairo_unscaled_font_backend_t;
-
/*
* A #cairo_unscaled_font_t is just an opaque handle we use in the
* glyph cache.
@@ -504,8 +510,6 @@ extern const cairo_private struct _cairo_scaled_font_backend _cairo_quartz_scale
#endif
-typedef struct _cairo_solid_pattern cairo_solid_pattern_t;
-
struct _cairo_surface_backend {
cairo_surface_type_t type;
@@ -972,8 +976,6 @@ typedef struct _cairo_traps {
#define CAIRO_SURFACE_RESOLUTION_DEFAULT 72.0
#define CAIRO_SURFACE_FALLBACK_RESOLUTION_DEFAULT 300.0
-typedef struct _cairo_gstate cairo_gstate_t;
-
typedef struct _cairo_stroke_face {
cairo_point_t ccw;
cairo_point_t point;
diff --git a/src/check-doc-syntax.sh b/src/check-doc-syntax.sh
index bd07c4d..98ea61e 100755
--- a/src/check-doc-syntax.sh
+++ b/src/check-doc-syntax.sh
@@ -17,7 +17,7 @@ echo Checking documentation for incorrect syntax
# Note: this test is also run from doc/public/ to check the SGML files
if test "x$SGML_DOCS" = x; then
- FILES=$cairo_all_source_files
+ FILES=$all_cairo_files
if test "x$FILES" = x; then
FILES=`find "$srcdir" -name '*.h' -or -name '*.c' -or -name '*.cpp'`
fi
diff --git a/test/.gitignore b/test/.gitignore
index 3011930..14cc7df 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -1,4 +1,5 @@
TAGS
+tags
.deps
.libs
Makefile
diff --git a/test/Makefile.am b/test/Makefile.am
index 002f578..7f83713 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -914,6 +914,9 @@ CLEANFILES = \
index.html \
ref.hash \
png-test.png \
+ svg-surface-source.svg \
+ pdf-surface-source.pdf \
+ ps-surface-source.ps \
$(EXTRA_LTLIBRARIES) \
$(EXTRA_PROGRAMS)
diff --git a/test/pdiff/.gitignore b/test/pdiff/.gitignore
index d2e5a94..f44ed65 100644
--- a/test/pdiff/.gitignore
+++ b/test/pdiff/.gitignore
@@ -1 +1,3 @@
+TAGS
+tags
perceptualdiff
diff --git a/util/README b/util/README
new file mode 100644
index 0000000..62527dd
--- /dev/null
+++ b/util/README
@@ -0,0 +1,69 @@
+Cairo Utilities
+===============
+
+There are a varieties of utilities we use with cairo.
+
+
+backtrace-symbols
+-----------------
+
+This is a small shared library designed to be preloaded by the
+linker and its purpose is to make the backtrace_symbols() function
+of glibc produce more useful source reference information.
+
+Build by:
+
+ make backtrace-symbols.so
+
+and use by:
+
+ LD_PRELOAD=$PWD/backtrace-symbols.so app-to-run
+
+This code should be contributed back to glibc at some point.
+
+
+malloc-stats
+------------
+
+This is a small shared library designed to be preloaded by the
+linker and its purpose is to make the malloc_stats() function
+of glibc produce more useful information.
+
+Build by:
+
+ make malloc-stats.so
+
+and use by:
+
+ LD_PRELOAD=$PWD/malloc-stats.so app-to-run
+
+This works best when backtrace-symbols is in use. That is:
+
+ LD_PRELOAD="$PWD/backtrace-symbols.so $PWD/malloc-stats.so" app-to-run
+
+
+cairo-trace
+-----------
+
+This tool can be used to trace all the cairo function calls made by an
+applications. This is useful for either extracting a test case triggering
+a bug from an application, or simply to get a general idea of how an
+application is using cairo.
+
+This tool lives outside the cairo source distribution right now and can
+be found in a git repository at:
+
+ http://cgit.freedesktop.org/~ickle/cairo-trace/
+
+There are plans to move it to this directory in the future, and possibly
+install it on the system.
+
+
+cairo-api-update and xr2cairo
+-----------------------------
+
+These two scripts were used to convert source code written for pre-1.0
+cairo to newer API. See $(top_srcdir)/PORTING_GUIDE for more information.
+
+These files are obsolete now and may be removed in a future version.
+
commit 5cb3e66305b25a3380f2ca5829ac81e4a27e76d0
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Sep 2 15:32:54 2008 -0400
[configure.in] Create temp file in current dir
Such that we can use the CAIRO_CONFIG_COMMANDS macro to regenerate
files in $srcdir and still be readonly-source-tree happy if nothing
changed in the target file.
diff --git a/configure.in b/configure.in
index 7b9e049..98a3f23 100644
--- a/configure.in
+++ b/configure.in
@@ -216,7 +216,7 @@ AC_DEFUN([CAIRO_CONFIG_COMMANDS], [
AC_CONFIG_COMMANDS($1,
[
_config_file=$1
- _tmp_file=$1.tmp
+ _tmp_file=cairoconf.tmp
AC_MSG_NOTICE([creating $_config_file])
{
$2
@@ -225,7 +225,8 @@ AC_DEFUN([CAIRO_CONFIG_COMMANDS], [
AC_MSG_NOTICE([$_config_file is unchanged])
rm -f "$_tmp_file"
else
- mv "$_tmp_file" "$_config_file"
+ mv "$_tmp_file" "$_config_file" ||
+ AC_MSG_ERROR([failed to update $_config_file])
fi
], $3)
])
commit e977f32346a602b9644a2c59e612896f34af2c74
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Sep 2 00:14:46 2008 -0400
[configure.in] Create backend .pc files using CAIRO_CONFIG_COMMANDS
diff --git a/configure.in b/configure.in
index 600af2f..7b9e049 100644
--- a/configure.in
+++ b/configure.in
@@ -219,7 +219,6 @@ AC_DEFUN([CAIRO_CONFIG_COMMANDS], [
_tmp_file=$1.tmp
AC_MSG_NOTICE([creating $_config_file])
{
- echo "/* Generated by configure. Do not edit */"
$2
} >> "$_tmp_file"
if cmp -s "$_tmp_file" "$_config_file"; then
@@ -330,10 +329,8 @@ AC_DEFUN([CAIRO_BACKEND_ENABLE],
CAIRO_LIBS="$$1_NONPKGCONFIG_LIBS$$1_LIBS$CAIRO_LIBS"
CAIRO_NONPKGCONFIG_CFLAGS="$$1_NONPKGCONFIG_CFLAGS$CAIRO_NONPKGCONFIG_CFLAGS"
CAIRO_NONPKGCONFIG_LIBS="$$1_NONPKGCONFIG_LIBS$CAIRO_NONPKGCONFIG_LIBS"
- outfile=`echo src/cairo-$1.pc | sed -e s/_/-/g`
- AC_MSG_NOTICE([creating $outfile])
- mkdir -p src
- AS_IF([sed \
+ CAIRO_CONFIG_COMMANDS(m4_bpatsubst(src/cairo-$1.pc,_,-),
+ [sed \
-e "s, at backend_name@,$1,g" \
-e "s, at Backend_Name@,$2,g" \
-e "s, at BACKEND_BASE@,$$1_BASE,g" \
@@ -345,10 +342,19 @@ AC_DEFUN([CAIRO_BACKEND_ENABLE],
-e "s, at libdir@,$libdir,g" \
-e "s, at includedir@,$includedir,g" \
-e "s, at VERSION@,$VERSION,g" \
- $srcdir/src/cairo-backend.pc.in > $outfile],,[
- rm -f "$outfile"
- AC_MSG_ERROR([failed creating $outfile])
- ])
+ $srcdir/src/cairo-backend.pc.in
+ ],
+ [
+ $1_BASE='$$1_BASE'
+ $1_REQUIRES='$$1_REQUIRES'
+ $1_NONPKGCONFIG_LIBS='$$1_NONPKGCONFIG_LIBS'
+ $1_NONPKGCONFIG_CFLAGS='$$1_NONPKGCONFIG_CFLAGS'
+ prefix='$prefix'
+ exec_prefix='$exec_prefix'
+ libdir='$libdir'
+ includedir='$includedir'
+ VERSION='$VERSION'
+ ])
else
CAIRO_NO_FEATURES="$4 $CAIRO_NO_FEATURES"
fi
@@ -1043,6 +1049,7 @@ dnl ===========================================================================
CAIRO_CONFIG_COMMANDS([src/cairo-features.h],
[
+ echo '/* Generated by configure. Do not edit. */'
echo '#ifndef CAIRO_FEATURES_H'
echo '#define CAIRO_FEATURES_H'
echo ''
@@ -1061,6 +1068,7 @@ CAIRO_CONFIG_COMMANDS([src/cairo-features.h],
])
CAIRO_CONFIG_COMMANDS([src/cairo-no-features.h],
[
+ echo '/* Generated by configure. Do not edit. */'
echo '#ifndef CAIRO_NO_FEATURES_H'
echo '#define CAIRO_NO_FEATURES_H'
echo ''
commit 1bdd6110f6d5df6556f201e06e519e68640e6215
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Sep 1 23:35:03 2008 -0400
[configure.in] Consistently use _save_cflags/libs
diff --git a/configure.in b/configure.in
index d6e3b5d..600af2f 100644
--- a/configure.in
+++ b/configure.in
@@ -123,13 +123,13 @@ dnl Like AC_CHECK_FUNCS but with additional CFLAGS and LIBS
dnl --------------------------------------------------------------------
AC_DEFUN([_CHECK_FUNCS_WITH_FLAGS],
[
- save_cflags="$CFLAGS"
- save_libs="$LIBS"
+ _save_cflags="$CFLAGS"
+ _save_libs="$LIBS"
CFLAGS="$CFLAGS $2"
LIBS="$LIBS $3"
AC_CHECK_FUNCS($1, $4, $5)
- CFLAGS="$save_cflags"
- LIBS="$save_libs"
+ CFLAGS="$_save_cflags"
+ LIBS="$_save_libs"
])
dnl ===========================================================================
@@ -667,8 +667,8 @@ CAIRO_BACKEND_ENABLE(ft, FreeType font, freetype, FT_FONT, auto, [
])
if test "x$use_ft" = "xyes"; then
- temp_save_libs="$LIBS"
- temp_save_cflags="$CFLAGS"
+ _save_libs="$LIBS"
+ _save_cflags="$CFLAGS"
LIBS="$LIBS $ft_LIBS"
CFLAGS="$CFLAGS $ft_CFLAGS"
AC_CHECK_MEMBER(FT_Bitmap_Size.y_ppem,
@@ -681,8 +681,8 @@ if test "x$use_ft" = "xyes"; then
AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Library_SetLcdFilter)
- LIBS="$temp_save_libs"
- CFLAGS="$temp_save_cflags"
+ LIBS="$_save_libs"
+ CFLAGS="$_save_cflags"
fi
dnl ===========================================================================
@@ -824,11 +824,11 @@ dnl check compiler flags
AC_DEFUN([CAIRO_CC_TRY_FLAG], [
AC_MSG_CHECKING([whether $CC supports $1])
- cairo_save_CFLAGS="$CFLAGS"
+ _save_cflags="$CFLAGS"
CFLAGS="$CFLAGS -Werror $1"
AC_COMPILE_IFELSE([ ], [cairo_cc_flag=yes], [cairo_cc_flag=no])
- CFLAGS="$cairo_save_CFLAGS"
+ CFLAGS="$_save_cflags"
if test "x$cairo_cc_flag" = "xyes"; then
ifelse([$2], , :, [$2])
commit 004012f1bc2b5c359e3c00bb3c2e893c73fd5471
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Sep 1 23:28:39 2008 -0400
[configure.in] Cache WARN_UNUSED_RESULT test results
diff --git a/configure.in b/configure.in
index 8facc38..d6e3b5d 100644
--- a/configure.in
+++ b/configure.in
@@ -886,23 +886,26 @@ AC_CACHE_CHECK([for supported warning flags], cairo_cv_warn_cflags, [
cairo_cv_warn_cflags=$WARN_CFLAGS
cairo_cv_warn_maybe=$MAYBE_WARN
- AC_MSG_CHECKING([which warning flags were supported])])
+ AC_MSG_CHECKING([which warning flags were supported])
+])
WARN_CFLAGS="$cairo_cv_warn_cflags"
CAIRO_CFLAGS="$CAIRO_CFLAGS $WARN_CFLAGS"
# We only wish to enable attribute(warn_unused_result) if we can prevent
# gcc from generating thousands of warnings about the misapplication of the
# attribute to void functions and variables.
-AC_MSG_CHECKING([how to enable unused result warnings])
-warn_unused_result=""
-if echo $WARN_CFLAGS | grep -e '-Wno-attributes' >/dev/null; then
- AC_TRY_COMPILE([__attribute__((__warn_unused_result__))
- int f (int i) { return i; }], [],
- [warn_unused_result="__attribute__((__warn_unused_result__))"])
-fi
-AC_DEFINE_UNQUOTED([WARN_UNUSED_RESULT], [$warn_unused_result],
+AC_CACHE_CHECK([how to enable unused result warnings], cairo_cv_warn_unused_result, [
+ cairo_cv_warn_unused_result=""
+ if echo $WARN_CFLAGS | grep -e '-Wno-attributes' >/dev/null; then
+ AC_TRY_COMPILE([__attribute__((__warn_unused_result__))
+ int f (int i) { return i; }], [],
+ [cairo_cv_warn_unused_result="__attribute__((__warn_unused_result__))"])
+ fi
+])
+AC_DEFINE_UNQUOTED([WARN_UNUSED_RESULT], [$cairo_cv_warn_unused_result],
[Define to the value your compiler uses to support the warn-unused-result attribute])
-AC_MSG_RESULT([$warn_unused_result])
+
+dnl ===========================================================================
AC_SUBST(CAIRO_REQUIRES)
AC_SUBST(CAIRO_NONPKGCONFIG_CFLAGS)
commit ac246426148ddf9b33aa2b03cbafec867509e814
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Sep 1 22:58:57 2008 -0400
[configure.in] Use warning-flag facilities for -fno-strict-aliasing
diff --git a/configure.in b/configure.in
index 4604622..8facc38 100644
--- a/configure.in
+++ b/configure.in
@@ -856,6 +856,9 @@ MAYBE_WARN="-Wall -Wextra \
-Wno-missing-field-initializers -Wno-unused-parameter \
-Wno-attributes -Wno-long-long -Winline"
+dnl We also abuse the warning-flag facility to enable other compiler
+dnl options. Namely, the following:
+MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing"
# invalidate cached value if MAYBE_WARN has changed
if test "x$cairo_cv_warn_maybe" != "x$MAYBE_WARN"; then
@@ -901,9 +904,6 @@ AC_DEFINE_UNQUOTED([WARN_UNUSED_RESULT], [$warn_unused_result],
[Define to the value your compiler uses to support the warn-unused-result attribute])
AC_MSG_RESULT([$warn_unused_result])
-CAIRO_CC_TRY_FLAG([-fno-strict-aliasing],
- [CAIRO_CFLAGS="$CAIRO_CFLAGS -fno-strict-aliasing"])
-
AC_SUBST(CAIRO_REQUIRES)
AC_SUBST(CAIRO_NONPKGCONFIG_CFLAGS)
AC_SUBST(CAIRO_NONPKGCONFIG_LIBS)
commit d28243785a234648c4c4c60faa44658041400f81
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Sep 1 22:52:44 2008 -0400
[configure.in] Remove unused MMX checks
Leftover from pixman days
diff --git a/configure.in b/configure.in
index 9d4736b..4604622 100644
--- a/configure.in
+++ b/configure.in
@@ -928,29 +928,6 @@ esac
AC_SUBST(PKGCONFIG_REQUIRES)
dnl ===========================================================================
-dnl Check for MMX
-
-MMX_CFLAGS="-mmmx -Winline --param inline-unit-growth=10000 --param large-function-growth=10000"
-
-have_mmx_intrinsics=no
-AC_MSG_CHECKING(for MMX/SSE intrinsics in the compiler)
-xserver_save_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS $MMX_CFLAGS"
-AC_COMPILE_IFELSE([
-#if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
-#error "Need GCC >= 3.4 for MMX intrinsics"
-#endif
-#include <mmintrin.h>
-int main () {
- __m64 v = _mm_cvtsi32_si64 (1);
- __m64 w = _mm_slli_si64 (v, 1);
- v = _mm_or_si64 (v, w);
- return _mm_cvtsi64_si32 (v);
-}], have_mmx_intrinsics=yes)
-CFLAGS=$xserver_save_CFLAGS
-AC_MSG_RESULT($have_mmx_intrinsics)
-
-dnl ===========================================================================
cairo_has_lcov=no
AC_ARG_ENABLE(gcov,
commit 74cd03be7085bf33dc122387df3e2fb25ee35c53
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Sep 1 22:49:16 2008 -0400
[configure.in] Cache atomic-ops check results
diff --git a/configure.in b/configure.in
index dd56915..9d4736b 100644
--- a/configure.in
+++ b/configure.in
@@ -158,36 +158,37 @@ dnl ===========================================================================
dnl
dnl Test for native atomic operations.
dnl
-AC_MSG_CHECKING([for native atomic primitives])
-cairo_atomic_primitives="none"
+AC_CACHE_CHECK([for native atomic primitives], cairo_cv_atomic_primitives, [
+cairo_cv_atomic_primitives="none"
AC_TRY_LINK([int atomic_add(int i) { return __sync_fetch_and_add (&i, 1); }], [],
- AC_DEFINE(CAIRO_HAS_INTEL_ATOMIC_PRIMITIVES, 1, [Enable if your compiler supports the Intel __sync_* atomic primitives])
- cairo_atomic_primitives="Intel"
+ cairo_cv_atomic_primitives="Intel"
)
+])
+if test "x$cairo_cv_atomic_primitives" = xIntel; then
+ AC_DEFINE(CAIRO_HAS_INTEL_ATOMIC_PRIMITIVES, 1, [Enable if your compiler supports the Intel __sync_* atomic primitives])
+fi
-AC_MSG_RESULT([$cairo_atomic_primitives])
-
-AC_MSG_CHECKING([whether atomic ops require a memory barrier])
+AC_CACHE_CHECK([whether atomic ops require a memory barrier], cairo_cv_atomic_op_needs_memory_barrier, [
case $host_cpu in
i?86)
- cairo_atomic_op_needs_memory_barrier="no"
+ cairo_cv_atomic_op_needs_memory_barrier="no"
;;
x86_64)
- cairo_atomic_op_needs_memory_barrier="no"
+ cairo_cv_atomic_op_needs_memory_barrier="no"
;;
arm*)
- cairo_atomic_op_needs_memory_barrier="no"
+ cairo_cv_atomic_op_needs_memory_barrier="no"
;;
*)
- cairo_atomic_op_needs_memory_barrier="yes"
+ cairo_cv_atomic_op_needs_memory_barrier="yes"
;;
esac
-if test "x$cairo_atomic_op_needs_memory_barrier" = "xyes"; then
+])
+if test "x$cairo_cv_atomic_op_needs_memory_barrier" = "xyes"; then
AC_DEFINE_UNQUOTED(CAIRO_ATOMIC_OP_NEEDS_MEMORY_BARRIER, 1,
[whether Cairo needs memory barriers around atomic ops])
fi
-AC_MSG_RESULT([$cairo_atomic_op_needs_memory_barrier])
dnl ===========================================================================
commit 7af228ab836d1871160c3b89079bcd660bac2074
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Sep 1 22:37:28 2008 -0400
[configure.in] Make unsupported-backend warning generation automatic
diff --git a/configure.in b/configure.in
index 04667dc..dd56915 100644
--- a/configure.in
+++ b/configure.in
@@ -353,8 +353,17 @@ AC_DEFUN([CAIRO_BACKEND_ENABLE],
fi
fi
AM_CONDITIONAL(CAIRO_HAS_$4, test "x$use_$1" = xyes)
+ AS_IF([test "x$use_[]$1" = xyes && test "x$5" = xno],[
+ CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE
+*** The $2 backend is still under active development and
+*** is included in this release only as a preview. It does not
+*** fully work yet and incompatible changes may yet be made
+*** to $2-backend specific API.
+"
+ ],)
])
+CAIRO_WARNING_MESSAGE=""
CAIRO_FEATURES=""
CAIRO_NO_FEATURES=""
CAIRO_REQUIRES=""
@@ -1153,33 +1162,4 @@ if test x"$use_ft" != "xyes" && \
])
fi
-WARNING_MESSAGE='
-*** The @BACKEND@ backend is still under active development and
-*** is included in this release only as a preview. It does not
-*** fully work yet and incompatible changes may yet be made
-*** to @BACKEND at -backend specific API.
-'
-
-if test x"$use_glitz" = "xyes" ; then
- echo "$WARNING_MESSAGE" | sed 's/@BACKEND@/Glitz/'
-fi
-
-if test x"$use_xcb" = "xyes" ; then
- echo "$WARNING_MESSAGE" | sed 's/@BACKEND@/XCB/'
-fi
-
-if test x"$use_quartz_image" = "xyes" ; then
- echo "$WARNING_MESSAGE" | sed 's/@BACKEND@/Quartz Image/'
-fi
-
-if test x"$use_os2" = "xyes" ; then
- echo "$WARNING_MESSAGE" | sed 's, at BACKEND@,OS/2,'
-fi
-
-if test x"$use_beos" = "xyes" ; then
- echo "$WARNING_MESSAGE" | sed 's/@BACKEND@/BeOS/'
-fi
-
-if test x"$use_directfb" = "xyes" ; then
- echo "$WARNING_MESSAGE" | sed 's/@BACKEND@/DirectFB/'
-fi
+echo "$CAIRO_WARNING_MESSAGE"
commit 7510aa803355faae3c8abe9fb79238185cb2ce95
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Sep 1 22:15:03 2008 -0400
[configure.in] Define CAIRO_CONFIG_COMMANDS for easier file creation
diff --git a/configure.in b/configure.in
index 61b13f0..04667dc 100644
--- a/configure.in
+++ b/configure.in
@@ -206,6 +206,32 @@ fi
dnl ===========================================================================
dnl
+dnl CAIRO_CONFIG_COMMANDS is like AC_CONFIG_COMMANDS, except that:
+dnl
+dnl 1) It redirects the stdout of the command to the file.
+dnl 2) It does not recreate the file if contents didn't change.
+dnl
+AC_DEFUN([CAIRO_CONFIG_COMMANDS], [
+ AC_CONFIG_COMMANDS($1,
+ [
+ _config_file=$1
+ _tmp_file=$1.tmp
+ AC_MSG_NOTICE([creating $_config_file])
+ {
+ echo "/* Generated by configure. Do not edit */"
+ $2
+ } >> "$_tmp_file"
+ if cmp -s "$_tmp_file" "$_config_file"; then
+ AC_MSG_NOTICE([$_config_file is unchanged])
+ rm -f "$_tmp_file"
+ else
+ mv "$_tmp_file" "$_config_file"
+ fi
+ ], $3)
+])
+
+dnl ===========================================================================
+dnl
dnl cairo_cache_version should be increased every time that the backend
dnl detection stuff changes in a way that removing the config.cache file may be
dnl needed for correct operation. (this is only for the backend detection
@@ -1025,64 +1051,36 @@ fi
dnl ===========================================================================
-AC_CONFIG_COMMANDS([src/cairo-features.h],
+CAIRO_CONFIG_COMMANDS([src/cairo-features.h],
[
- featuresfile=src/cairo-features.h
- outfile=$featuresfile.tmp
- AC_MSG_NOTICE([creating $featuresfile])
- cat > $outfile <<_EOF
-/* Generated by configure. Do not edit */
-#ifndef CAIRO_FEATURES_H
-#define CAIRO_FEATURES_H
-
-_EOF
+ echo '#ifndef CAIRO_FEATURES_H'
+ echo '#define CAIRO_FEATURES_H'
+ echo ''
for FEATURE in $CAIRO_FEATURES; do
- echo "#define CAIRO_HAS_$FEATURE 1" >> $outfile
- done
- echo '' >> $outfile
+ echo "#define CAIRO_HAS_$FEATURE 1"
+ done | LANG=C sort
+ echo ''
for FEATURE in $CAIRO_NO_FEATURES; do
- echo "/*#undef CAIRO_HAS_$FEATURE */" >> $outfile
- done
-
- echo '' >> $outfile
- echo '#endif' >> $outfile
-
- if cmp -s $outfile $featuresfile; then
- AC_MSG_NOTICE([$featuresfile is unchanged])
- rm -f $outfile
- else
- mv $outfile $featuresfile
- fi
+ echo "/*#undef CAIRO_HAS_$FEATURE */"
+ done | LANG=C sort
+ echo ''
+ echo '#endif'
],[
CAIRO_FEATURES='$CAIRO_FEATURES'
CAIRO_NO_FEATURES='$CAIRO_NO_FEATURES'
])
-AC_CONFIG_COMMANDS([src/cairo-no-features.h],
+CAIRO_CONFIG_COMMANDS([src/cairo-no-features.h],
[
- nofeaturesfile=src/cairo-no-features.h
- outfile=$nofeaturesfile.tmp
- AC_MSG_NOTICE([creating $nofeaturesfile])
- cat > $outfile <<_EOF
-/* Generated by configure. Do not edit */
-#ifndef CAIRO_NO_FEATURES_H
-#define CAIRO_NO_FEATURES_H
-
-/* This is a dummy header, to trick gtk-doc only */
-
-_EOF
+ echo '#ifndef CAIRO_NO_FEATURES_H'
+ echo '#define CAIRO_NO_FEATURES_H'
+ echo ''
+ echo '/* This is a dummy header, to trick gtk-doc only */'
+ echo ''
for FEATURE in $CAIRO_NO_FEATURES; do
- echo "#define CAIRO_HAS_$FEATURE 1" >> $outfile
+ echo "#define CAIRO_HAS_$FEATURE 1"
done
-
- echo '' >> $outfile
- echo '#endif' >> $outfile
-
- if cmp -s $outfile $nofeaturesfile; then
- AC_MSG_NOTICE([$nofeaturesfile is unchanged])
- rm -f $outfile
- else
- mv $outfile $nofeaturesfile
- fi
+ echo ''
+ echo '#endif'
],[
CAIRO_NO_FEATURES='$CAIRO_NO_FEATURES'
])
commit 5f1993c53a11d87ee0506287f206bd0e400b76e9
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Sep 1 21:51:05 2008 -0400
[configure] Add user-fonts to list of configured components
diff --git a/configure.in b/configure.in
index d34e42f..61b13f0 100644
--- a/configure.in
+++ b/configure.in
@@ -1107,7 +1107,7 @@ dnl ===========================================================================
V="$CAIRO_VERSION_MAJOR.$CAIRO_VERSION_MINOR.$CAIRO_VERSION_MICRO"
echo ""
echo "cairo (version $V [[$CAIRO_RELEASE_STATUS]]) will be compiled with the following surface backends:"
-echo " image: yes (always builtin)"
+echo " Image: yes (always builtin)"
echo " Xlib: $use_xlib"
echo " Xlib Xrender: $use_xlib_xrender"
echo " Quartz: $use_quartz"
@@ -1123,6 +1123,7 @@ echo " BeOS: $use_beos"
echo " DirectFB: $use_directfb"
echo ""
echo "the following font backends:"
+echo " User: yes (always builtin)"
echo " FreeType: $use_ft"
echo " Win32: $use_win32_font"
echo " Quartz: $use_quartz_font"
commit 33859070975ebc164f4f02093a2fe3335ccdb855
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Sep 1 21:50:31 2008 -0400
[configure.in] Don't include cairo-features.h in cairo-no-features.h
No idea why I did before.
diff --git a/configure.in b/configure.in
index d90d246..d34e42f 100644
--- a/configure.in
+++ b/configure.in
@@ -1067,8 +1067,6 @@ AC_CONFIG_COMMANDS([src/cairo-no-features.h],
#ifndef CAIRO_NO_FEATURES_H
#define CAIRO_NO_FEATURES_H
-#include <cairo-features.h>
-
/* This is a dummy header, to trick gtk-doc only */
_EOF
commit 5f571290db05858133634f3d075030e1b3a3d121
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Sep 1 21:49:59 2008 -0400
[configure.in] Add CAIRO_BEGIN/END_DECLS to config.h
diff --git a/configure.in b/configure.in
index 7ab6d53..d90d246 100644
--- a/configure.in
+++ b/configure.in
@@ -103,6 +103,16 @@ AX_C_FLOAT_WORDS_BIGENDIAN
;;
esac
+AH_BOTTOM([
+#ifdef __cplusplus
+# define CAIRO_BEGIN_DECLS extern "C" {
+# define CAIRO_END_DECLS }
+#else
+# define CAIRO_BEGIN_DECLS
+# define CAIRO_END_DECLS
+#endif
+])
+
dnl ===========================================================================
dnl === Local macros
dnl ===========================================================================
commit 2553579cc89d2ea2084983efd41b60ae5e32816b
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Sep 1 21:48:07 2008 -0400
[doc] Clean up doc file names
diff --git a/doc/public/cairo-docs.xml b/doc/public/cairo-docs.xml
index 7e44131..487f8a8 100644
--- a/doc/public/cairo-docs.xml
+++ b/doc/public/cairo-docs.xml
@@ -9,7 +9,7 @@
<title>Cairo: A Vector Graphics Library</title>
<releaseinfo>for Cairo &version;</releaseinfo>
</bookinfo>
- <chapter id="Drawing">
+ <chapter id="cairo-drawing">
<title>Drawing</title>
<xi:include href="xml/cairo.xml"/>
<xi:include href="xml/cairo-paths.xml"/>
@@ -17,7 +17,7 @@
<xi:include href="xml/cairo-transforms.xml"/>
<xi:include href="xml/cairo-text.xml"/>
</chapter>
- <chapter id="Fonts">
+ <chapter id="cairo-fonts">
<title>Fonts</title>
<xi:include href="xml/cairo-font-face.xml"/>
<xi:include href="xml/cairo-scaled-font.xml"/>
@@ -27,7 +27,7 @@
<xi:include href="xml/cairo-quartz-fonts.xml"/>
<xi:include href="xml/cairo-user-fonts.xml"/>
</chapter>
- <chapter id="Surfaces">
+ <chapter id="cairo-surfaces">
<title>Surfaces</title>
<xi:include href="xml/cairo-surface.xml"/>
<xi:include href="xml/cairo-image.xml"/>
@@ -43,15 +43,15 @@
<!--xi:include href="xml/cairo-xcb.xml"/-->
<xi:include href="xml/cairo-xlib.xml"/>
</chapter>
- <chapter id="Support">
+ <chapter id="cairo-support">
<title>Utilities</title>
<xi:include href="xml/cairo-matrix.xml"/>
<xi:include href="xml/cairo-status.xml"/>
<xi:include href="xml/cairo-version.xml"/>
<xi:include href="xml/cairo-types.xml"/>
</chapter>
- <index>
- <title id="index-all">Index</title>
+ <index id="index-all">
+ <title>Index</title>
</index>
<index id="index-1.2" role="1.2">
<title>Index of new symbols in 1.2</title>
diff --git a/doc/public/cairo-sections.txt b/doc/public/cairo-sections.txt
index 9a49e42..b2bb1f1 100644
--- a/doc/public/cairo-sections.txt
+++ b/doc/public/cairo-sections.txt
@@ -1,6 +1,6 @@
<SECTION>
<FILE>cairo-ft</FILE>
-<TITLE>FreeType Fonts</TITLE>
+<TITLE>ft-font</TITLE>
CAIRO_HAS_FT_FONT
cairo_ft_font_face_create_for_ft_face
cairo_ft_font_face_create_for_pattern
@@ -11,7 +11,7 @@ cairo_ft_scaled_font_unlock_face
<SECTION>
<FILE>cairo-win32-fonts</FILE>
-<TITLE>Win32 Fonts</TITLE>
+<TITLE>win32-font</TITLE>
CAIRO_HAS_WIN32_FONT
cairo_win32_font_face_create_for_logfontw
cairo_win32_font_face_create_for_hfont
@@ -25,7 +25,7 @@ cairo_win32_scaled_font_get_device_to_logical
<SECTION>
<FILE>cairo-quartz-fonts</FILE>
-<TITLE>Quartz Fonts</TITLE>
+<TITLE>quartz-font</TITLE>
CAIRO_HAS_QUARTZ_FONT
cairo_quartz_font_face_create_for_cgfont
cairo_quartz_font_face_create_for_atsu_font_id
@@ -33,7 +33,7 @@ cairo_quartz_font_face_create_for_atsu_font_id
<SECTION>
<FILE>cairo-user-fonts</FILE>
-<TITLE>User Fonts</TITLE>
+<TITLE>user-font</TITLE>
cairo_user_scaled_font_init_func_t
cairo_user_scaled_font_render_glyph_func_t
cairo_user_scaled_font_text_to_glyphs_func_t
@@ -51,7 +51,7 @@ cairo_user_font_face_get_text_to_glyphs_func
<SECTION>
<FILE>cairo-image</FILE>
-<TITLE>Image Surfaces</TITLE>
+<TITLE>image-surface</TITLE>
cairo_format_t
cairo_format_stride_for_width
cairo_image_surface_create
@@ -65,7 +65,7 @@ cairo_image_surface_get_stride
<SECTION>
<FILE>cairo-pdf</FILE>
-<TITLE>PDF Surfaces</TITLE>
+<TITLE>pdf-surface</TITLE>
CAIRO_HAS_PDF_SURFACE
cairo_pdf_surface_create
cairo_pdf_surface_create_for_stream
@@ -74,7 +74,7 @@ cairo_pdf_surface_set_size
<SECTION>
<FILE>cairo-png</FILE>
-<TITLE>PNG Support</TITLE>
+<TITLE>png-functions</TITLE>
CAIRO_HAS_PNG_FUNCTIONS
cairo_image_surface_create_from_png
cairo_read_func_t
@@ -86,7 +86,7 @@ cairo_surface_write_to_png_stream
<SECTION>
<FILE>cairo-ps</FILE>
-<TITLE>PostScript Surfaces</TITLE>
+<TITLE>ps-surface</TITLE>
CAIRO_HAS_PS_SURFACE
cairo_ps_surface_create
cairo_ps_surface_create_for_stream
@@ -104,7 +104,7 @@ cairo_ps_surface_dsc_comment
<SECTION>
<FILE>cairo-win32</FILE>
-<TITLE>Win32 Surfaces</TITLE>
+<TITLE>win32-surface</TITLE>
CAIRO_HAS_WIN32_SURFACE
cairo_win32_surface_create
cairo_win32_surface_create_with_dib
@@ -116,7 +116,7 @@ cairo_win32_surface_get_image
<SECTION>
<FILE>cairo-quartz</FILE>
-<TITLE>Quartz Surfaces</TITLE>
+<TITLE>quartz-surface</TITLE>
CAIRO_HAS_QUARTZ_SURFACE
cairo_quartz_surface_create
cairo_quartz_surface_create_for_cg_context
@@ -128,7 +128,7 @@ cairo_quartz_image_surface_get_image
<SECTION>
<FILE>cairo-xlib</FILE>
-<TITLE>XLib Surfaces</TITLE>
+<TITLE>xlib-surface</TITLE>
CAIRO_HAS_XLIB_SURFACE
cairo_xlib_surface_create
cairo_xlib_surface_create_for_bitmap
@@ -145,7 +145,7 @@ cairo_xlib_surface_get_depth
<SECTION>
<FILE>cairo-xlib-xrender</FILE>
-<TITLE>XLib/Xrender Backend</TITLE>
+<TITLE>xlib-xrender-surface</TITLE>
CAIRO_HAS_XLIB_XRENDER_SURFACE
cairo_xlib_surface_create_with_xrender_format
cairo_xlib_surface_get_xrender_format
@@ -153,7 +153,7 @@ cairo_xlib_surface_get_xrender_format
<SECTION>
<FILE>cairo-svg</FILE>
-<TITLE>SVG Surfaces</TITLE>
+<TITLE>svg-surface</TITLE>
CAIRO_HAS_SVG_SURFACE
cairo_svg_surface_create
cairo_svg_surface_create_for_stream
@@ -165,7 +165,7 @@ cairo_svg_version_to_string
<SECTION>
<FILE>cairo-surface</FILE>
-<TITLE>cairo_surface_t</TITLE>
+<TITLE>surface</TITLE>
cairo_surface_t
cairo_content_t
cairo_surface_create_similar
@@ -194,7 +194,7 @@ cairo_surface_has_show_text_glyphs
<SECTION>
<FILE>cairo-version</FILE>
-<TITLE>Version Information</TITLE>
+<TITLE>version-info</TITLE>
CAIRO_VERSION
CAIRO_VERSION_MAJOR
CAIRO_VERSION_MINOR
@@ -210,7 +210,7 @@ CAIRO_VERSION_STRINGIZE_
<SECTION>
<FILE>cairo-pattern</FILE>
-<TITLE>Patterns</TITLE>
+<TITLE>pattern</TITLE>
cairo_pattern_t
cairo_pattern_add_color_stop_rgb
cairo_pattern_add_color_stop_rgba
@@ -245,7 +245,7 @@ cairo_pattern_get_user_data
<SECTION>
<FILE>cairo-matrix</FILE>
-<TITLE>cairo_matrix_t</TITLE>
+<TITLE>matrix</TITLE>
cairo_matrix_t
cairo_matrix_init
cairo_matrix_init_identity
@@ -263,7 +263,7 @@ cairo_matrix_transform_point
<SECTION>
<FILE>cairo-status</FILE>
-<TITLE>Error Handling</TITLE>
+<TITLE>error-status</TITLE>
cairo_status_t
cairo_status_to_string
cairo_debug_reset_static_data
@@ -271,7 +271,7 @@ cairo_debug_reset_static_data
<SECTION>
<FILE>cairo-font-face</FILE>
-<TITLE>cairo_font_face_t</TITLE>
+<TITLE>font-face</TITLE>
cairo_font_face_t
cairo_font_face_reference
cairo_font_face_destroy
@@ -285,7 +285,7 @@ cairo_font_face_get_user_data
<SECTION>
<FILE>cairo-scaled-font</FILE>
-<TITLE>Scaled Fonts</TITLE>
+<TITLE>scaled-font</TITLE>
cairo_scaled_font_t
cairo_scaled_font_create
cairo_scaled_font_reference
@@ -310,7 +310,7 @@ cairo_scaled_font_get_user_data
<SECTION>
<FILE>cairo-font-options</FILE>
-<TITLE>Font Options</TITLE>
+<TITLE>font-options</TITLE>
cairo_font_options_t
cairo_font_options_create
cairo_font_options_copy
@@ -337,7 +337,7 @@ cairo_font_options_get_hint_metrics
<SECTION>
<FILE>cairo-types</FILE>
-<TITLE>Types</TITLE>
+<TITLE>types</TITLE>
cairo_bool_t
cairo_user_data_key_t
cairo_destroy_func_t
@@ -345,7 +345,7 @@ cairo_destroy_func_t
<SECTION>
<FILE>cairo-transforms</FILE>
-<TITLE>Transformations</TITLE>
+<TITLE>transformations</TITLE>
cairo_translate
cairo_scale
cairo_rotate
@@ -362,7 +362,7 @@ cairo_device_to_user_distance
<SECTION>
<FILE>cairo-paths</FILE>
-<TITLE>Paths</TITLE>
+<TITLE>paths</TITLE>
cairo_path_t
cairo_path_data_t
cairo_path_data_type_t
@@ -391,7 +391,7 @@ cairo_path_extents
<SECTION>
<FILE>cairo-text</FILE>
-<TITLE>Text</TITLE>
+<TITLE>text</TITLE>
cairo_glyph_t
cairo_font_slant_t
cairo_font_weight_t
@@ -425,7 +425,7 @@ cairo_text_cluster_free
<SECTION>
<FILE>cairo</FILE>
-<TITLE>cairo_t</TITLE>
+<TITLE>context</TITLE>
cairo_t
cairo_create
cairo_reference
commit a5a896aae831e5224dd5bd4bc711f3212f738ba1
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Aug 28 19:36:12 2008 -0400
Update header glob
diff --git a/doc/public/Makefile.am b/doc/public/Makefile.am
index 952ded3..2bab45b 100644
--- a/doc/public/Makefile.am
+++ b/doc/public/Makefile.am
@@ -13,8 +13,8 @@ SCAN_OPTIONS=--deprecated-guards="CAIRO_DISABLE_DEPRECATED" --ignore-decorators=
DOC_SOURCE_DIR=../../src
# Used for dependencies
-HFILE_GLOB=$(top_srcdir)/src/*.h
-CFILE_GLOB=$(top_srcdir)/src/*.c $(top_srcdir)/src/*.h
+HFILE_GLOB=$(top_srcdir)/src/cairo-*.h
+CFILE_GLOB=$(top_srcdir)/src/cairo-*.c $(top_srcdir)/src/cairo-*.h
include $(srcdir)/Headers.mk
@@ -35,8 +35,7 @@ IGNORE_HFILES= \
Headers.mk:
( echo "PRIVATE_TEST_HFILES = \\"; \
find $(top_srcdir)/src \
- -name '*-private.h' -o \
- -name '*-test.h' | \
+ -name '*-private.h' | \
sed 's at .*/@ @; s@$$@ \\@' | \
LANG=C sort; \
echo ' cairo-features-win32.h \'; \
diff --git a/doc/public/tmpl/cairo-version.sgml b/doc/public/tmpl/cairo-version.sgml
index 836c9b8..2e4acd6 100644
--- a/doc/public/tmpl/cairo-version.sgml
+++ b/doc/public/tmpl/cairo-version.sgml
@@ -165,9 +165,9 @@ that later versions compare greater than earlier versions.
@major: the major component of the version number
@minor: the minor component of the version number
@micro: the micro component of the version number
-
@Returns: the encoded version.
+
<!-- ##### MACRO CAIRO_VERSION_STRINGIZE ##### -->
<para>
This macro encodes the given cairo version into an string. The numbers
@@ -178,7 +178,6 @@ The parameters to this macro must expand to numerical literals.
@major: the major component of the version number
@minor: the minor component of the version number
@micro: the micro component of the version number
-
@Returns: a string literal containing the version.
@Since: 1.8
More information about the cairo-commit
mailing list