[Commit] cairo-demo/X11 cairo-demo.c, 1.1, 1.2 cairo-freq.c, 1.1, 1.2 cairo-knockout.c, 1.6, 1.7 cairo-spline.c, 1.3, 1.4

Jamey Sharp commit at keithp.com
Tue Sep 30 20:04:51 PDT 2003


Committed by: jamey

Update of /local/src/CVS/cairo-demo/X11
In directory home.keithp.com:/tmp/cvs-serv19634/X11

Modified Files:
	cairo-demo.c cairo-freq.c cairo-knockout.c cairo-spline.c 
Log Message:
Added cairo-xlib.h include needed for new Cairo bits; added text demo to cairo-demo.


Index: cairo-demo.c
===================================================================
RCS file: /local/src/CVS/cairo-demo/X11/cairo-demo.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cairo-demo.c	18 Aug 2003 18:11:37 -0000	1.1
+++ cairo-demo.c	1 Oct 2003 02:04:48 -0000	1.2
@@ -3,6 +3,9 @@
 #include <math.h>
 
 #include <cairo.h>
+#include <cairo-xlib.h>
+
+#define PI 3.1415926535
 
 typedef struct win {
     Display *dpy;
@@ -204,6 +207,13 @@
     cairo_set_target_drawable (ct, dpy, drawable);
     cairo_set_rgb_color(ct, 1, 1, 1);
 
+    cairo_save(ct);
+    cairo_scale_font (ct, 20);
+    cairo_move_to (ct, 10, 10);
+    cairo_rotate(ct, PI / 2);
+    cairo_show_text (ct, "Hello World.");
+    cairo_restore(ct);
+
 /*
     cairo_scale(ct, 5, 5);
     inf(ct);
@@ -229,24 +239,38 @@
     cairo_set_dash(ct, dash, NUM_DASH, 0);
     stroke_shapes(ct, 0, 0);
 
+    cairo_translate(ct, 0, 4*SIZE);
+
     cairo_set_dash(ct, NULL, 0, 0);
-    stroke_shapes(ct, 0, 4*SIZE);
+    stroke_shapes(ct, 0, 0);
+
+    cairo_translate(ct, 0, 4*SIZE);
 
     cairo_set_line_join(ct, CAIRO_LINE_JOIN_BEVEL);
-    stroke_shapes(ct, 0, 8*SIZE);
+    stroke_shapes(ct, 0, 0);
+
+    cairo_translate(ct, 0, 4*SIZE);
 
     cairo_set_line_join(ct, CAIRO_LINE_JOIN_MITER);
-    stroke_shapes(ct, 0, 12*SIZE);
+    stroke_shapes(ct, 0, 0);
 
-    fill_shapes(ct, 0, 16*SIZE);
+    cairo_translate(ct, 0, 4*SIZE);
+
+    fill_shapes(ct, 0, 0);
+
+    cairo_translate(ct, 0, 4*SIZE);
 
     cairo_set_line_join(ct, CAIRO_LINE_JOIN_BEVEL);
-    fill_shapes(ct, 0, 20*SIZE);
+    fill_shapes(ct, 0, 0);
     cairo_set_rgb_color(ct, 1, 0, 0);
-    stroke_shapes(ct, 0, 20*SIZE);
+    stroke_shapes(ct, 0, 0);
 /*
     draw_broken_shapes(ct);
 */
+    if (cairo_status(ct)) {
+	printf("%s\n", cairo_status_string(ct));
+	exit(0);
+    }
 
     cairo_destroy(ct);
 }

Index: cairo-freq.c
===================================================================
RCS file: /local/src/CVS/cairo-demo/X11/cairo-freq.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cairo-freq.c	18 Aug 2003 18:11:37 -0000	1.1
+++ cairo-freq.c	1 Oct 2003 02:04:48 -0000	1.2
@@ -4,6 +4,7 @@
 #include <math.h>
 
 #include <cairo.h>
+#include <cairo-xlib.h>
 
 #define EPSILON (1.0 / (2<<16))
 #define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))

Index: cairo-knockout.c
===================================================================
RCS file: /local/src/CVS/cairo-demo/X11/cairo-knockout.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cairo-knockout.c	29 Sep 2003 15:23:34 -0000	1.6
+++ cairo-knockout.c	1 Oct 2003 02:04:48 -0000	1.7
@@ -13,6 +13,7 @@
  */
 #include <X11/Xlib.h>
 #include <cairo.h>
+#include <cairo-xlib.h>
 #include <math.h>
 #include <stdio.h>
 

Index: cairo-spline.c
===================================================================
RCS file: /local/src/CVS/cairo-demo/X11/cairo-spline.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cairo-spline.c	16 Sep 2003 17:26:19 -0000	1.3
+++ cairo-spline.c	1 Oct 2003 02:04:48 -0000	1.4
@@ -4,6 +4,7 @@
 #include <math.h>
 
 #include <cairo.h>
+#include <cairo-xlib.h>
 
 #define EPSILON (1.0 / (2<<16))
 #define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))




More information about the Commit mailing list