summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--boilerplate/Makefile.am10
-rw-r--r--boilerplate/make-cairo-boilerplate-constructors.c19
-rw-r--r--doc/public/tmpl/cairo-surface.sgml2
-rw-r--r--doc/public/tmpl/cairo.sgml15
-rw-r--r--test/Makefile.am9
-rw-r--r--test/make-cairo-test-constructors.c13
-rw-r--r--util/cairo-script/csi-bind.c76
7 files changed, 125 insertions, 19 deletions
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am
index 523453a4..763f9a61 100644
--- a/boilerplate/Makefile.am
+++ b/boilerplate/Makefile.am
@@ -49,15 +49,15 @@ endif
libcairoboilerplate_la_LIBADD += $(CAIROBOILERPLATE_LIBS)
make-cairo-boilerplate-constructors$(EXEEXT): make-cairo-boilerplate-constructors.c
- $(CC) -o $@ make-cairo-boilerplate-constructors.c
+ $(CC) $^ -o $@
cairo-boilerplate-constructors.c: Makefile $(enabled_cairo_boilerplate_sources) make-cairo-boilerplate-constructors$(EXEEXT)
- (cd $(srcdir) && ./make-cairo-boilerplate-constructors$(EXEEXT) $(enabled_cairo_boilerplate_sources)) > $@
+ echo '(cd $(srcdir) && $(top_builddir)/boilerplate/make-cairo-boilerplate-constructors$(EXEEXT) $(enabled_cairo_boilerplate_sources)) > $@'
+ ./make-cairo-boilerplate-constructors$(EXEEXT) $(srcdir) $(enabled_cairo_boilerplate_sources) > $@
BUILT_SOURCES += cairo-boilerplate-constructors.c
-EXTRA_DIST += $(BUILT_SOURCES)
-CLEANFILES += $(BUILT_SOURCES)
-CLEANFILES += make-cairo-boilerplate-constructors
+EXTRA_DIST += $(BUILT_SOURCES) make-cairo-boilerplate-constructors.c
+CLEANFILES += $(BUILT_SOURCES) make-cairo-boilerplate-constructors
test: check
diff --git a/boilerplate/make-cairo-boilerplate-constructors.c b/boilerplate/make-cairo-boilerplate-constructors.c
index 33068663..b954492c 100644
--- a/boilerplate/make-cairo-boilerplate-constructors.c
+++ b/boilerplate/make-cairo-boilerplate-constructors.c
@@ -33,6 +33,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#define NAME "make-cairo-boilerplate-constructors.c"
@@ -67,8 +68,8 @@ add_name (const char *name)
}
static int
-scan_file (const char *filename,
- FILE *fp)
+scan_file (const char *filename,
+ FILE *fp)
{
int line_num = 0;
char linebuf[1024];
@@ -116,16 +117,22 @@ scan_file (const char *filename,
int
main (int argc, char **argv)
{
+ char buf[PATH_MAX];
int i;
int fail = 0;
struct name *node;
- for (i=1; i<argc; i++) {
- FILE *fp = fopen (argv[i], "r");
- if (fp) {
+ for (i = 2; i < argc; i++) {
+ FILE *fp;
+
+ snprintf (buf, sizeof (buf), "%s/%s", argv[1], argv[i]);
+
+ fp = fopen (buf, "r");
+ if (fp != NULL) {
fail |= scan_file (argv[i], fp);
fclose (fp);
- }
+ } else
+ fail = 1;
}
if (fail)
exit(1);
diff --git a/doc/public/tmpl/cairo-surface.sgml b/doc/public/tmpl/cairo-surface.sgml
index f7df8296..00d5eff4 100644
--- a/doc/public/tmpl/cairo-surface.sgml
+++ b/doc/public/tmpl/cairo-surface.sgml
@@ -215,6 +215,8 @@ The Portable Network Graphics image file format (ISO/IEC 15948). Since 1.10
@CAIRO_SURFACE_TYPE_WIN32_PRINTING:
@CAIRO_SURFACE_TYPE_QUARTZ_IMAGE:
@CAIRO_SURFACE_TYPE_SCRIPT:
+@CAIRO_SURFACE_TYPE_QT:
+@CAIRO_SURFACE_TYPE_META:
<!-- ##### FUNCTION cairo_surface_get_type ##### -->
<para>
diff --git a/doc/public/tmpl/cairo.sgml b/doc/public/tmpl/cairo.sgml
index 6faef6ca..31f9d4e9 100644
--- a/doc/public/tmpl/cairo.sgml
+++ b/doc/public/tmpl/cairo.sgml
@@ -383,6 +383,21 @@ The cairo drawing context
@CAIRO_OPERATOR_XOR:
@CAIRO_OPERATOR_ADD:
@CAIRO_OPERATOR_SATURATE:
+@CAIRO_OPERATOR_MULTIPLY:
+@CAIRO_OPERATOR_SCREEN:
+@CAIRO_OPERATOR_OVERLAY:
+@CAIRO_OPERATOR_DARKEN:
+@CAIRO_OPERATOR_LIGHTEN:
+@CAIRO_OPERATOR_COLOR_DODGE:
+@CAIRO_OPERATOR_COLOR_BURN:
+@CAIRO_OPERATOR_HARD_LIGHT:
+@CAIRO_OPERATOR_SOFT_LIGHT:
+@CAIRO_OPERATOR_DIFFERENCE:
+@CAIRO_OPERATOR_EXCLUSION:
+@CAIRO_OPERATOR_HSL_HUE:
+@CAIRO_OPERATOR_HSL_SATURATION:
+@CAIRO_OPERATOR_HSL_COLOR:
+@CAIRO_OPERATOR_HSL_LUMINOSITY:
<!-- ##### FUNCTION cairo_set_operator ##### -->
<para>
diff --git a/test/Makefile.am b/test/Makefile.am
index 3b5f8958..887cd10a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -70,10 +70,10 @@ test_sources += $(test)
TESTS += cairo-test-suite$(EXEEXT)
make-cairo-test-constructors$(EXEEXT): make-cairo-test-constructors.c
- $(CC) -o $@ make-cairo-test-constructors.c
+ $(CC) $^ -o $@
cairo-test-constructors.c: Makefile $(test_sources) make-cairo-test-constructors$(EXEEXT)
- (cd $(srcdir) && ./make-cairo-test-constructors$(EXEEXT) $(test_sources)) > $@
+ ./make-cairo-test-constructors$(EXEEXT) $(srcdir) $(test_sources) > $@
cairo_test_suite_SOURCES = \
$(cairo_test_suite_sources) \
@@ -121,9 +121,8 @@ cairo_test_trace_DEPENDENCIES = \
endif
BUILT_SOURCES += cairo-test-constructors.c
-EXTRA_DIST += $(BUILT_SOURCES) $(noinst_SCRIPTS) COPYING
-CLEANFILES += $(BUILT_SOURCES)
-CLEANFILES += make-cairo-test-constructors
+EXTRA_DIST += $(BUILT_SOURCES) $(noinst_SCRIPTS) COPYING make-cairo-test-constructors.c
+CLEANFILES += $(BUILT_SOURCES) make-cairo-test-constructors
# All tests which have a reference image go here.
REFERENCE_IMAGES = \
diff --git a/test/make-cairo-test-constructors.c b/test/make-cairo-test-constructors.c
index e19de372..15c64705 100644
--- a/test/make-cairo-test-constructors.c
+++ b/test/make-cairo-test-constructors.c
@@ -32,6 +32,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#define NAME "make-cairo-test-constructors.c"
@@ -115,16 +116,22 @@ scan_file (const char *filename,
int
main (int argc, char **argv)
{
+ char buf[PATH_MAX];
int i;
int fail = 0;
struct name *node;
- for (i=1; i<argc; i++) {
- FILE *fp = fopen (argv[i], "r");
+ for (i = 2; i < argc; i++) {
+ FILE *fp;
+
+ snprintf (buf, sizeof (buf), "%s/%s", argv[1], argv[i]);
+
+ fp = fopen (buf, "r");
if (fp) {
fail |= scan_file (argv[i], fp);
fclose (fp);
- }
+ } else
+ fail = 1;
}
if (fail)
exit(1);
diff --git a/util/cairo-script/csi-bind.c b/util/cairo-script/csi-bind.c
new file mode 100644
index 00000000..91b58fb9
--- /dev/null
+++ b/util/cairo-script/csi-bind.c
@@ -0,0 +1,76 @@
+#include <cairo.h>
+#include <cairo-script-interpreter.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static cairo_status_t
+write_func (void *closure,
+ const unsigned char *data,
+ unsigned int length)
+{
+ if (fwrite (data, length, 1, closure) != 1)
+ return CAIRO_STATUS_WRITE_ERROR;
+
+ return CAIRO_STATUS_SUCCESS;
+}
+
+int
+main (int argc, char **argv)
+{
+ FILE *in = stdin, *out = stdout;
+ cairo_status_t status;
+ int i;
+
+ if (argc >= 3) {
+ if (strcmp (argv[argc-1], "-")) {
+ out = fopen (argv[argc-1], "w");
+ if (out == NULL) {
+ fprintf (stderr, "Failed to open output '%s'\n", argv[argc-1]);
+ return 1;
+ }
+ }
+ }
+
+ if (argc > 2) {
+ for (i = 1; i < argc - 1; i++) {
+ in = fopen (argv[i], "r");
+ if (in == NULL) {
+ fprintf (stderr, "Failed to open input '%s'\n", argv[i]);
+ return 1;
+ }
+
+ status = cairo_script_interpreter_translate_stream (in, write_func, out);
+ fclose (in);
+
+ if (status)
+ break;
+ }
+ } else {
+ if (argc > 1) {
+ if (strcmp (argv[1], "-")) {
+ in = fopen (argv[1], "r");
+ if (in == NULL) {
+ fprintf (stderr, "Failed to open input '%s'\n", argv[1]);
+ return 1;
+ }
+ }
+ }
+
+ status = cairo_script_interpreter_translate_stream (in, write_func, out);
+
+ if (in != stdin)
+ fclose (in);
+ }
+
+ if (out != stdout)
+ fclose (out);
+
+ if (status) {
+ fprintf (stderr, "Translation failed: %s\n",
+ cairo_status_to_string (status));
+ return status;
+ }
+
+ return status;
+}