[cairo-commit] cairo-demo/cairo_snippets/snippets clip.cairo, 1.1, 1.2 clip_image.cairo, 1.2, 1.3 curve_rectangle.cairo, 1.4, 1.5 fill_and_stroke.cairo, 1.2, 1.3 fill_and_stroke2.cairo, 1.2, 1.3 gradient.cairo, 1.1, 1.2 image.cairo, 1.2, 1.3 imagepattern.cairo, 1.2, 1.3 operator_add.cairo, 1.2, 1.3 operator_atop.cairo, 1.2, 1.3 operator_atop_reverse.cairo, 1.2, 1.3 operator_in.cairo, 1.2, 1.3 operator_in_reverse.cairo, 1.2, 1.3 operator_out.cairo, 1.2, 1.3 operator_out_reverse.cairo, 1.2, 1.3 operator_over.cairo, 1.2, 1.3 operator_over_reverse.cairo, 1.2, 1.3 operator_saturate.cairo, 1.2, 1.3 operator_xor.cairo, 1.2, 1.3 pattern_fill.cairo, 1.1, 1.2 set_line_cap.cairo, 1.1, 1.2 text.cairo, 1.3, 1.4 text_align_center.cairo, 1.2, 1.3 text_extents.cairo, 1.2, 1.3 xxx_long_lines.cairo, 1.1, 1.2

Owen Taylor commit at pdx.freedesktop.org
Wed May 11 14:15:33 PDT 2005


Committed by: otaylor

Update of /cvs/cairo/cairo-demo/cairo_snippets/snippets
In directory gabe:/tmp/cvs-serv1278/snippets

Modified Files:
	clip.cairo clip_image.cairo curve_rectangle.cairo 
	fill_and_stroke.cairo fill_and_stroke2.cairo gradient.cairo 
	image.cairo imagepattern.cairo operator_add.cairo 
	operator_atop.cairo operator_atop_reverse.cairo 
	operator_in.cairo operator_in_reverse.cairo operator_out.cairo 
	operator_out_reverse.cairo operator_over.cairo 
	operator_over_reverse.cairo operator_saturate.cairo 
	operator_xor.cairo pattern_fill.cairo set_line_cap.cairo 
	text.cairo text_align_center.cairo text_extents.cairo 
	xxx_long_lines.cairo 
Log Message:
2005-05-11  Owen Taylor  <otaylor at redhat.com>

	* cairo_snippets_png.c cairo_snippets_ps.c cairo_snippets_win32.c
	snippets/*.cairo: Cairo API updates.

	* snippets.h: Remove a stray png-io.h include.

	* snippets/pattern_fill.cairo: Remove some unused extern 

Index: clip.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/clip.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- clip.cairo	1 Feb 2005 22:58:09 -0000	1.1
+++ clip.cairo	11 May 2005 21:15:31 -0000	1.2
@@ -7,7 +7,7 @@
                          consumed by cairo_clip() */
 cairo_rectangle (cr, 0, 0, 1, 1);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0, 1, 0);
+cairo_set_source_rgb (cr, 0, 1, 0);
 cairo_move_to (cr, 0, 0);
 cairo_line_to (cr, 1, 1);
 cairo_move_to (cr, 1, 0);

Index: clip_image.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/clip_image.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- clip_image.cairo	3 May 2005 02:22:48 -0000	1.2
+++ clip_image.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -13,7 +13,7 @@
 
 cairo_scale (cr, 1.0/w, 1.0/h);
 
-cairo_move_to (cr, 0, 0);
-cairo_show_surface (cr, image, w, h);
+cairo_set_source_surface (cr, image, 0, 0);
+cairo_paint (cr);
 
 cairo_surface_destroy (image);

Index: curve_rectangle.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/curve_rectangle.cairo,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- curve_rectangle.cairo	3 May 2005 02:22:48 -0000	1.4
+++ curve_rectangle.cairo	11 May 2005 21:15:31 -0000	1.5
@@ -50,7 +50,7 @@
 }
 cairo_close_path (cr);
 
-cairo_set_rgb_color (cr, 0.5,0.5,1);
+cairo_set_source_rgb (cr, 0.5,0.5,1);
 cairo_fill_preserve (cr);
 cairo_set_source_rgba (cr, 0.5, 0, 0, 0.5);
 cairo_stroke (cr);

Index: fill_and_stroke.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/fill_and_stroke.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- fill_and_stroke.cairo	3 May 2005 02:22:48 -0000	1.2
+++ fill_and_stroke.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -6,7 +6,7 @@
 cairo_curve_to (cr, 0.2, 0.9, 0.2, 0.5, 0.5, 0.5);
 cairo_close_path (cr);
 
-cairo_set_rgb_color (cr, 0, 0, 1);
+cairo_set_source_rgb (cr, 0, 0, 1);
 cairo_fill_preserve (cr);
-cairo_set_rgb_color (cr, 0, 0, 0);
+cairo_set_source_rgb (cr, 0, 0, 0);
 cairo_stroke (cr);

Index: fill_and_stroke2.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/fill_and_stroke2.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- fill_and_stroke2.cairo	3 May 2005 02:22:48 -0000	1.2
+++ fill_and_stroke2.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -12,7 +12,7 @@
 cairo_rel_line_to (cr, -0.2, -0.2);
 cairo_close_path (cr);
 
-cairo_set_rgb_color (cr, 0, 0, 1);
+cairo_set_source_rgb (cr, 0, 0, 1);
 cairo_fill_preserve (cr);
-cairo_set_rgb_color (cr, 0, 0, 0);
+cairo_set_source_rgb (cr, 0, 0, 0);
 cairo_stroke (cr);

Index: gradient.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/gradient.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gradient.cairo	1 Feb 2005 22:58:09 -0000	1.1
+++ gradient.cairo	11 May 2005 21:15:31 -0000	1.2
@@ -3,18 +3,18 @@
 snippet_normalize (cr, width, height);
 
 pat = cairo_pattern_create_linear (0.0, 0.0,  0.0, 1.0);
-cairo_pattern_add_color_stop (pat, 1, 0, 0, 0, 1);
-cairo_pattern_add_color_stop (pat, 0, 1, 1, 1, 1);
+cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 0, 1);
+cairo_pattern_add_color_stop_rgba (pat, 0, 1, 1, 1, 1);
 cairo_rectangle (cr, 0,0,1,1);
-cairo_set_pattern (cr, pat);
+cairo_set_source (cr, pat);
 cairo_fill (cr);
 
 cairo_pattern_destroy (pat);
 pat = cairo_pattern_create_radial (0.45, 0.4, 0.1,
                                    0.4,  0.4, 0.5);
-cairo_pattern_add_color_stop (pat, 0, 1, 1, 1, 1);
-cairo_pattern_add_color_stop (pat, 1, 0, 0, 0, 1);
-cairo_set_pattern (cr, pat);
+cairo_pattern_add_color_stop_rgba (pat, 0, 1, 1, 1, 1);
+cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 0, 1);
+cairo_set_source (cr, pat);
 cairo_arc (cr, 0.5, 0.5, 0.3, 0, 2 * M_PI);
 cairo_fill (cr);
 cairo_pattern_destroy (pat);

Index: image.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/image.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- image.cairo	3 May 2005 02:22:48 -0000	1.2
+++ image.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -12,7 +12,7 @@
 cairo_scale  (cr, 1.0/w, 1.0/h);
 cairo_translate (cr, -0.5*w, -0.5*h);
 
-cairo_move_to (cr, 0,0);
-cairo_show_surface (cr, image, w, h);
+cairo_set_source_surface (cr, image, 0, 0);
+cairo_paint (cr);
 cairo_surface_destroy (image);
 

Index: imagepattern.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/imagepattern.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- imagepattern.cairo	3 May 2005 02:22:48 -0000	1.2
+++ imagepattern.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -1,7 +1,7 @@
 int              w, h;
 cairo_surface_t *image;
 cairo_pattern_t *pattern;
-cairo_matrix_t  *matrix;
+cairo_matrix_t   matrix;
 
 snippet_normalize (cr, width, height);
 
@@ -9,20 +9,18 @@
 w = cairo_image_surface_get_width (image);
 h = cairo_image_surface_get_height (image);
 
-cairo_surface_set_repeat (image, 1);
 pattern = cairo_pattern_create_for_surface (image);
+cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
 
 cairo_translate (cr, 0.5, 0.5);
 cairo_rotate (cr, M_PI / 4);
 cairo_scale (cr, 1 / sqrt (2), 1 / sqrt (2));
 cairo_translate (cr, - 0.5, - 0.5);
 
-matrix = cairo_matrix_create ();
-cairo_matrix_scale (matrix, w * 5., h * 5.); 
-cairo_pattern_set_matrix (pattern, matrix);
-cairo_matrix_destroy (matrix);
+cairo_matrix_init_scale (&matrix, w * 5., h * 5.); 
+cairo_pattern_set_matrix (pattern, &matrix);
 
-cairo_set_pattern (cr, pattern);
+cairo_set_source (cr, pattern);
 
 cairo_rectangle (cr, 0, 0, 1.0, 1.0);
 cairo_fill (cr);

Index: operator_add.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/operator_add.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- operator_add.cairo	21 Apr 2005 21:05:22 -0000	1.2
+++ operator_add.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -5,10 +5,10 @@
 cairo_set_source_rgba (cr, 1,0,0,0.5);
 cairo_rectangle (cr, 0.2,0.2, 0.5,0.5);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,1,0);
+cairo_set_source_rgb (cr, 0,1,0);
 cairo_rectangle (cr, 0.4,0.4, 0.4,0.4);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,0,1);
+cairo_set_source_rgb (cr, 0,0,1);
 cairo_rectangle (cr, 0.6,0.6, 0.3,0.3);
 cairo_fill (cr);
 

Index: operator_atop.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/operator_atop.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- operator_atop.cairo	21 Apr 2005 21:05:22 -0000	1.2
+++ operator_atop.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -5,9 +5,9 @@
 cairo_set_source_rgba (cr, 1,0,0,0.5);
 cairo_rectangle (cr, 0.2,0.2, 0.5,0.5);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,1,0);
+cairo_set_source_rgb (cr, 0,1,0);
 cairo_rectangle (cr, 0.4,0.4, 0.4,0.4);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,0,1);
+cairo_set_source_rgb (cr, 0,0,1);
 cairo_rectangle (cr, 0.6,0.6, 0.3,0.3);
 cairo_fill (cr);

Index: operator_atop_reverse.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/operator_atop_reverse.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- operator_atop_reverse.cairo	21 Apr 2005 21:05:22 -0000	1.2
+++ operator_atop_reverse.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -1,13 +1,13 @@
 snippet_normalize (cr, width, height);
 snippet_set_bg_svg (cr, "data/freedesktop.svg");
-cairo_set_operator (cr, CAIRO_OPERATOR_ATOP_REVERSE);
+cairo_set_operator (cr, CAIRO_OPERATOR_DEST_ATOP);
 cairo_set_source_rgba (cr, 1,0,0,0.5);
 cairo_rectangle (cr, 0.2,0.2, 0.5,0.5);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,1,0);
+cairo_set_source_rgb (cr, 0,1,0);
 cairo_rectangle (cr, 0.4,0.4, 0.4,0.4);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,0,1);
+cairo_set_source_rgb (cr, 0,0,1);
 cairo_rectangle (cr, 0.6,0.6, 0.3,0.3);
 cairo_fill (cr);
 

Index: operator_in.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/operator_in.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- operator_in.cairo	21 Apr 2005 21:05:22 -0000	1.2
+++ operator_in.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -4,10 +4,10 @@
 cairo_set_source_rgba (cr, 1,0,0,0.5);
 cairo_rectangle (cr, 0.2,0.2, 0.5,0.5);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,1,0);
+cairo_set_source_rgb (cr, 0,1,0);
 cairo_rectangle (cr, 0.4,0.4, 0.4,0.4);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,0,1);
+cairo_set_source_rgb (cr, 0,0,1);
 cairo_rectangle (cr, 0.6,0.6, 0.3,0.3);
 cairo_fill (cr);
 

Index: operator_in_reverse.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/operator_in_reverse.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- operator_in_reverse.cairo	21 Apr 2005 21:05:22 -0000	1.2
+++ operator_in_reverse.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -1,13 +1,13 @@
 snippet_normalize (cr, width, height);
 snippet_set_bg_svg (cr, "data/freedesktop.svg");
-cairo_set_operator (cr, CAIRO_OPERATOR_IN_REVERSE);
+cairo_set_operator (cr, CAIRO_OPERATOR_DEST_IN);
 cairo_set_source_rgba (cr, 1,0,0,0.5);
 cairo_rectangle (cr, 0.2,0.2, 0.5,0.5);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,1,0);
+cairo_set_source_rgb (cr, 0,1,0);
 cairo_rectangle (cr, 0.4,0.4, 0.4,0.4);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,0,1);
+cairo_set_source_rgb (cr, 0,0,1);
 cairo_rectangle (cr, 0.6,0.6, 0.3,0.3);
 cairo_fill (cr);
 

Index: operator_out.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/operator_out.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- operator_out.cairo	21 Apr 2005 21:05:22 -0000	1.2
+++ operator_out.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -4,10 +4,10 @@
 cairo_set_source_rgba (cr, 1,0,0,0.5);
 cairo_rectangle (cr, 0.2,0.2, 0.5,0.5);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,1,0);
+cairo_set_source_rgb (cr, 0,1,0);
 cairo_rectangle (cr, 0.4,0.4, 0.4,0.4);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,0,1);
+cairo_set_source_rgb (cr, 0,0,1);
 cairo_rectangle (cr, 0.6,0.6, 0.3,0.3);
 cairo_fill (cr);
 

Index: operator_out_reverse.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/operator_out_reverse.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- operator_out_reverse.cairo	21 Apr 2005 21:05:22 -0000	1.2
+++ operator_out_reverse.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -1,13 +1,13 @@
 snippet_normalize (cr, width, height);
 snippet_set_bg_svg (cr, "data/freedesktop.svg");
-cairo_set_operator (cr, CAIRO_OPERATOR_OUT_REVERSE);
+cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OUT);
 cairo_set_source_rgba (cr, 1,0,0,0.5);
 cairo_rectangle (cr, 0.2,0.2, 0.5,0.5);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,1,0);
+cairo_set_source_rgb (cr, 0,1,0);
 cairo_rectangle (cr, 0.4,0.4, 0.4,0.4);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,0,1);
+cairo_set_source_rgb (cr, 0,0,1);
 cairo_rectangle (cr, 0.6,0.6, 0.3,0.3);
 cairo_fill (cr);
 

Index: operator_over.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/operator_over.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- operator_over.cairo	21 Apr 2005 21:05:22 -0000	1.2
+++ operator_over.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -4,10 +4,10 @@
 cairo_set_source_rgba (cr, 1,0,0,0.5);
 cairo_rectangle (cr, 0.2,0.2, 0.5,0.5);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,1,0);
+cairo_set_source_rgb (cr, 0,1,0);
 cairo_rectangle (cr, 0.4,0.4, 0.4,0.4);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,0,1);
+cairo_set_source_rgb (cr, 0,0,1);
 cairo_rectangle (cr, 0.6,0.6, 0.3,0.3);
 cairo_fill (cr);
 

Index: operator_over_reverse.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/operator_over_reverse.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- operator_over_reverse.cairo	21 Apr 2005 21:05:22 -0000	1.2
+++ operator_over_reverse.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -1,13 +1,13 @@
 snippet_normalize (cr, width, height);
 snippet_set_bg_svg (cr, "data/freedesktop.svg");
-cairo_set_operator (cr, CAIRO_OPERATOR_OVER_REVERSE);
+cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OVER);
 cairo_set_source_rgba (cr, 1,0,0, 0.5);
 cairo_rectangle (cr, 0.2,0.2, 0.5,0.5);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,1,0);
+cairo_set_source_rgb (cr, 0,1,0);
 cairo_rectangle (cr, 0.4,0.4, 0.4,0.4);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,0,1);
+cairo_set_source_rgb (cr, 0,0,1);
 cairo_rectangle (cr, 0.6,0.6, 0.3,0.3);
 cairo_fill (cr);
 

Index: operator_saturate.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/operator_saturate.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- operator_saturate.cairo	21 Apr 2005 21:05:22 -0000	1.2
+++ operator_saturate.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -4,10 +4,10 @@
 cairo_set_source_rgba (cr, 1,0,0, 0.5);
 cairo_rectangle (cr, 0.2,0.2, 0.5,0.5);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,1,0);
+cairo_set_source_rgb (cr, 0,1,0);
 cairo_rectangle (cr, 0.4,0.4, 0.4,0.4);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,0,1);
+cairo_set_source_rgb (cr, 0,0,1);
 cairo_rectangle (cr, 0.6,0.6, 0.3,0.3);
 cairo_fill (cr);
 

Index: operator_xor.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/operator_xor.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- operator_xor.cairo	21 Apr 2005 21:05:22 -0000	1.2
+++ operator_xor.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -4,10 +4,10 @@
 cairo_set_source_rgba (cr, 1,0,0, 0.5);
 cairo_rectangle (cr, 0.2,0.2, 0.5,0.5);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,1,0);
+cairo_set_source_rgb (cr, 0,1,0);
 cairo_rectangle (cr, 0.4,0.4, 0.4,0.4);
 cairo_fill (cr);
-cairo_set_rgb_color (cr, 0,0,1);
+cairo_set_source_rgb (cr, 0,0,1);
 cairo_rectangle (cr, 0.6,0.6, 0.3,0.3);
 cairo_fill (cr);
 

Index: pattern_fill.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/pattern_fill.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pattern_fill.cairo	1 Feb 2005 22:58:09 -0000	1.1
+++ pattern_fill.cairo	11 May 2005 21:15:31 -0000	1.2
@@ -46,38 +46,26 @@
 cairo_stroke (cr);
 
 
-cairo_select_font (cr, "Sans",
+cairo_select_font_face (cr, "Sans",
     CAIRO_FONT_SLANT_NORMAL,
     CAIRO_FONT_WEIGHT_BOLD);
 
 cairo_move_to (cr, x, y);
 cairo_text_path (cr, text);
 
-extern void
-cairo_current_path_flat (cairo_t			*cr,
-			 cairo_move_to_func_t		*move_to,
-			 cairo_line_to_func_t		*line_to,
-			 cairo_close_path_func_t	*close_path,
-			 void				*closure);
-
 
 
-cairo_scale_font (cr, 0.2);
+cairo_set_font_size (cr, 0.2);
 cairo_text_extents (cr, text, &extents);
 x = 0.5-(extents.width/2 + extents.x_bearing);
 y = 0.5-(extents.height/2 + extents.y_bearing);
 
 
-#if 0
-void
-cairo_set_pattern (cairo_t *cr, cairo_pattern_t *pattern);
-#endif
-
-cairo_set_rgb_color (cr, 1 , 1, 0.5);
+cairo_set_source_rgb (cr, 1 , 1, 0.5);
 cairo_fill (cr);
 
 cairo_move_to (cr, x, y);
 cairo_text_path (cr, text);
-cairo_set_rgb_color (cr, 0 , 0, 0);
+cairo_set_source_rgb (cr, 0 , 0, 0);
 cairo_stroke (cr);
 

Index: set_line_cap.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/set_line_cap.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- set_line_cap.cairo	1 Feb 2005 22:58:09 -0000	1.1
+++ set_line_cap.cairo	11 May 2005 21:15:31 -0000	1.2
@@ -11,7 +11,7 @@
 cairo_stroke (cr);
 
 /* draw helping lines */
-cairo_set_rgb_color (cr, 1,0.2,0.2);
+cairo_set_source_rgb (cr, 1,0.2,0.2);
 cairo_set_line_width (cr, 0.01);
 cairo_move_to (cr, 0.25, 0.2); cairo_line_to (cr, 0.25, 0.8);
 cairo_move_to (cr, 0.5, 0.2);  cairo_line_to (cr, 0.5, 0.8);

Index: text.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/text.cairo,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- text.cairo	3 May 2005 02:22:48 -0000	1.3
+++ text.cairo	11 May 2005 21:15:31 -0000	1.4
@@ -1,16 +1,16 @@
 snippet_normalize (cr, width, height);
-cairo_select_font (cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
+cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
                                CAIRO_FONT_WEIGHT_BOLD);
-cairo_scale_font (cr, 0.35);
+cairo_set_font_size (cr, 0.35);
 
 cairo_move_to (cr, 0.04, 0.53);
 cairo_show_text (cr, "Hello");
 
 cairo_move_to (cr, 0.27, 0.65);
 cairo_text_path (cr, "void");
-cairo_set_rgb_color (cr, 0.5, 0.5, 1);
+cairo_set_source_rgb (cr, 0.5, 0.5, 1);
 cairo_fill_preserve (cr);
-cairo_set_rgb_color (cr, 0, 0, 0);
+cairo_set_source_rgb (cr, 0, 0, 0);
 cairo_set_line_width (cr, 0.01);
 cairo_stroke (cr);
 

Index: text_align_center.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/text_align_center.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- text_align_center.cairo	21 Apr 2005 21:05:22 -0000	1.2
+++ text_align_center.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -5,11 +5,11 @@
 
 snippet_normalize (cr, width, height);
 
-cairo_select_font (cr, "Sans",
+cairo_select_font_face (cr, "Sans",
     CAIRO_FONT_SLANT_NORMAL,
     CAIRO_FONT_WEIGHT_NORMAL);
 
-cairo_scale_font (cr, 0.2);
+cairo_set_font_size (cr, 0.2);
 cairo_text_extents (cr, utf8, &extents);
 x = 0.5-(extents.width/2 + extents.x_bearing);
 y = 0.5-(extents.height/2 + extents.y_bearing);

Index: text_extents.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/text_extents.cairo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- text_extents.cairo	21 Apr 2005 21:05:22 -0000	1.2
+++ text_extents.cairo	11 May 2005 21:15:31 -0000	1.3
@@ -5,11 +5,11 @@
 
 snippet_normalize (cr, width, height);
 
-cairo_select_font (cr, "Sans",
+cairo_select_font_face (cr, "Sans",
     CAIRO_FONT_SLANT_NORMAL,
     CAIRO_FONT_WEIGHT_NORMAL);
 
-cairo_scale_font (cr, 0.4);
+cairo_set_font_size (cr, 0.4);
 cairo_text_extents (cr, utf8, &extents);
 
 x=0.1;

Index: xxx_long_lines.cairo
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/snippets/xxx_long_lines.cairo,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- xxx_long_lines.cairo	1 Feb 2005 22:58:09 -0000	1.1
+++ xxx_long_lines.cairo	11 May 2005 21:15:31 -0000	1.2
@@ -2,20 +2,20 @@
 
 cairo_move_to (cr, 0.1, -50);
 cairo_line_to (cr, 0.1,  50);
-cairo_set_rgb_color (cr, 1, 0 ,0);
+cairo_set_source_rgb (cr, 1, 0 ,0);
 cairo_stroke (cr);
 
 cairo_move_to (cr, 0.2, -60);
 cairo_line_to (cr, 0.2,  60);
-cairo_set_rgb_color (cr, 1, 1 ,0);
+cairo_set_source_rgb (cr, 1, 1 ,0);
 cairo_stroke (cr);
 
 cairo_move_to (cr, 0.3, -70);
 cairo_line_to (cr, 0.3,  70);
-cairo_set_rgb_color (cr, 0, 1 ,0);
+cairo_set_source_rgb (cr, 0, 1 ,0);
 cairo_stroke (cr);
 
 cairo_move_to (cr, 0.4, -80);
 cairo_line_to (cr, 0.4,  80);
-cairo_set_rgb_color (cr, 0, 0 ,1);
+cairo_set_source_rgb (cr, 0, 0 ,1);
 cairo_stroke (cr);




More information about the cairo-commit mailing list