[cairo-commit] cairo-perl Cairo.xs, 1.5, 1.6 CairoFont.xs, 1.3, 1.4 CairoSurface.xs, 1.6, 1.7 ChangeLog, 1.7, 1.8 Makefile.PL, 1.5, 1.6 cairo-perl.typemap, 1.2, 1.3

Torsten Schoenfeld commit at pdx.freedesktop.org
Fri Jul 29 10:19:57 PDT 2005


Committed by: tsch

Update of /cvs/cairo/cairo-perl
In directory gabe:/tmp/cvs-serv15134

Modified Files:
	Cairo.xs CairoFont.xs CairoSurface.xs ChangeLog Makefile.PL 
	cairo-perl.typemap 
Log Message:
	* t/Cairo.t, xs/Cairo.xs: Wrap cairo_get_font_options.

	* t/CairoFont.t, xs/CairoFont.xs: Wrap cairo_font_face_status,
	cairo_scaled_font_status, cairo_font_options_*.  Update
	cairo_scaled_font_create.

	* t/CairoSurface.t, CairoSurface.xs: Wrap cairo_surface_status,
	cairo_surface_get_font_options.

	* Makefile.PL: Wrap the new cairo_font_options_t stuff.

	* Makefile.PL: Require cairo 0.6.0.  Add new and update the old
	enums.  Install all files necessary for other modules to use
	Cairo.

	* cairo-perl.typemap: Add a cairo_bool_t typemap.


Index: Cairo.xs
===================================================================
RCS file: /cvs/cairo/cairo-perl/Cairo.xs,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Cairo.xs	12 Jul 2005 20:29:47 -0000	1.5
+++ Cairo.xs	29 Jul 2005 17:19:55 -0000	1.6
@@ -313,6 +313,16 @@
     OUTPUT:
 	RETVAL
 
+void cairo_set_font_options (cairo_t *cr, const cairo_font_options_t *options);
+
+##void cairo_get_font_options (cairo_t *cr, cairo_font_options_t *options);
+cairo_font_options_t * cairo_get_font_options (cairo_t *cr)
+    CODE:
+	RETVAL = cairo_font_options_create ();
+	cairo_get_font_options (cr, RETVAL);
+    OUTPUT:
+	RETVAL
+
 void cairo_show_text (cairo_t * cr, const char * utf8);
 
 ##void cairo_show_glyphs (cairo_t * cr, cairo_glyph_t * glyphs, int num_glyphs);

Index: CairoFont.xs
===================================================================
RCS file: /cvs/cairo/cairo-perl/CairoFont.xs,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CairoFont.xs	12 Jul 2005 20:29:47 -0000	1.3
+++ CairoFont.xs	29 Jul 2005 17:19:55 -0000	1.4
@@ -8,7 +8,9 @@
 
 #include <cairo-perl.h>
 
-MODULE = Cairo::Font	PACKAGE = Cairo::FontFace
+MODULE = Cairo::Font	PACKAGE = Cairo::FontFace	PREFIX = cairo_font_face_
+
+cairo_status_t cairo_font_face_status (cairo_font_face_t * font);
 
 void DESTROY (cairo_font_face_t * font)
     CODE:
@@ -16,21 +18,20 @@
 
 MODULE = Cairo::Font	PACKAGE = Cairo::ScaledFont	PREFIX = cairo_scaled_font_
 
-##cairo_scaled_font_t* cairo_scaled_font_create (cairo_font_face_t *font_face, const cairo_matrix_t *font_matrix, const cairo_matrix_t *ctm);
-cairo_scaled_font_t_noinc * cairo_scaled_font_create (class, cairo_font_face_t *font_face, const cairo_matrix_t *font_matrix, const cairo_matrix_t *ctm)
+##cairo_scaled_font_t* cairo_scaled_font_create (cairo_font_face_t *font_face, const cairo_matrix_t *font_matrix, const cairo_matrix_t *ctm, const cairo_font_options_t *options);
+cairo_scaled_font_t_noinc * cairo_scaled_font_create (class, cairo_font_face_t *font_face, const cairo_matrix_t *font_matrix, const cairo_matrix_t *ctm, const cairo_font_options_t *options)
     C_ARGS:
-	font_face, font_matrix, ctm
+	font_face, font_matrix, ctm, options
+
+cairo_status_t cairo_scaled_font_status (cairo_scaled_font_t *scaled_font);
 
 ##cairo_status_t cairo_scaled_font_extents (cairo_scaled_font_t *scaled_font, cairo_font_extents_t *extents);
 cairo_font_extents_t * cairo_scaled_font_extents (cairo_scaled_font_t *scaled_font)
     PREINIT:
 	cairo_font_extents_t extents;
     CODE:
-	if (CAIRO_STATUS_SUCCESS !=
-	    cairo_scaled_font_extents (scaled_font, &extents))
-		RETVAL = NULL;
-	else
-		RETVAL = &extents;
+	cairo_scaled_font_extents (scaled_font, &extents);
+	RETVAL = &extents;
     OUTPUT:
 	RETVAL
 
@@ -54,3 +55,41 @@
 void DESTROY (cairo_scaled_font_t * font)
     CODE:
 	cairo_scaled_font_destroy (font);
+
+MODULE = Cairo::Font	PACKAGE = Cairo::FontOptions	PREFIX = cairo_font_options_
+
+##cairo_font_options_t * cairo_font_options_create (void);
+cairo_font_options_t * cairo_font_options_create (class)
+    C_ARGS:
+	/* void */
+
+# FIXME: Necessary?
+##cairo_font_options_t * cairo_font_options_copy (const cairo_font_options_t *original);
+
+cairo_status_t cairo_font_options_status (cairo_font_options_t *options);
+
+void cairo_font_options_merge (cairo_font_options_t *options, const cairo_font_options_t *other);
+
+cairo_bool_t cairo_font_options_equal (const cairo_font_options_t *options, const cairo_font_options_t *other);
+
+unsigned long cairo_font_options_hash (const cairo_font_options_t *options);
+
+void cairo_font_options_set_antialias (cairo_font_options_t *options, cairo_antialias_t antialias);
+
+cairo_antialias_t cairo_font_options_get_antialias (const cairo_font_options_t *options);
+
+void cairo_font_options_set_subpixel_order (cairo_font_options_t *options, cairo_subpixel_order_t subpixel_order);
+
+cairo_subpixel_order_t cairo_font_options_get_subpixel_order (const cairo_font_options_t *options);
+
+void cairo_font_options_set_hint_style (cairo_font_options_t *options, cairo_hint_style_t hint_style);
+
+cairo_hint_style_t cairo_font_options_get_hint_style (const cairo_font_options_t *options);
+
+void cairo_font_options_set_hint_metrics (cairo_font_options_t *options, cairo_hint_metrics_t hint_metrics);
+
+cairo_hint_metrics_t cairo_font_options_get_hint_metrics (const cairo_font_options_t *options);
+
+void DESTROY (cairo_font_options_t *options)
+    CODE:
+	cairo_font_options_destroy (options);

Index: CairoSurface.xs
===================================================================
RCS file: /cvs/cairo/cairo-perl/CairoSurface.xs,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- CairoSurface.xs	12 Jul 2005 20:29:47 -0000	1.6
+++ CairoSurface.xs	29 Jul 2005 17:19:55 -0000	1.7
@@ -31,10 +31,20 @@
     OUTPUT:
 	RETVAL
 
-cairo_status_t cairo_surface_finish (cairo_surface_t *surface);
+cairo_status_t cairo_surface_status (cairo_surface_t *surface);
+
+void cairo_surface_finish (cairo_surface_t *surface);
 
 void cairo_surface_set_device_offset (cairo_surface_t *surface, double x_offset, double y_offset);
 
+##void cairo_surface_get_font_options (cairo_surface_t *surface, cairo_font_options_t *options);
+cairo_font_options_t * cairo_surface_get_font_options (cairo_surface_t *surface)
+    CODE:
+	RETVAL = cairo_font_options_create ();
+	cairo_surface_get_font_options (surface, RETVAL);
+    OUTPUT:
+	RETVAL
+
 #ifdef CAIRO_HAS_PNG_FUNCTIONS
 
 cairo_status_t cairo_surface_write_to_png (cairo_surface_t *surface, const char *filename);

Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/cairo-perl/ChangeLog,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- ChangeLog	12 Jul 2005 20:29:47 -0000	1.7
+++ ChangeLog	29 Jul 2005 17:19:55 -0000	1.8
@@ -1,3 +1,22 @@
+2005/07/29	tsch
+
+	* t/Cairo.t, xs/Cairo.xs: Wrap cairo_get_font_options.
+
+	* t/CairoFont.t, xs/CairoFont.xs: Wrap cairo_font_face_status,
+	cairo_scaled_font_status, cairo_font_options_*.  Update
+	cairo_scaled_font_create.
+
+	* t/CairoSurface.t, CairoSurface.xs: Wrap cairo_surface_status,
+	cairo_surface_get_font_options.
+
+	* Makefile.PL: Wrap the new cairo_font_options_t stuff.
+
+	* Makefile.PL: Require cairo 0.6.0.  Add new and update the old
+	enums.  Install all files necessary for other modules to use
+	Cairo.
+
+	* cairo-perl.typemap: Add a cairo_bool_t typemap.
+
 2005/07/12	tsch
 
 	* Cairo.pm, Cairo.xs, t/Cairo.t: Replace the %backends hash with

Index: Makefile.PL
===================================================================
RCS file: /cvs/cairo/cairo-perl/Makefile.PL,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Makefile.PL	12 Jul 2005 20:29:47 -0000	1.5
+++ Makefile.PL	29 Jul 2005 17:19:55 -0000	1.6
@@ -18,7 +18,7 @@
 mkdir $autogen_dir unless (-d $autogen_dir);
 $MakeHelper::autogen_dir = $autogen_dir;
 
-my %cairo_cfg = ExtUtils::PkgConfig->find ('cairo');
+my %cairo_cfg = ExtUtils::PkgConfig->find ('cairo >= 0.6.0');
 
 my %objects = (
 	'cairo_t *' => 'Cairo::Context',
@@ -37,6 +37,7 @@
 
 my %structs = (
 	'cairo_matrix_t *' => 'Cairo::Matrix',
+	'cairo_font_options_t *' => 'Cairo::FontOptions',
 );
 
 my %enums = (
@@ -109,6 +110,9 @@
 			CAIRO_STATUS_SURFACE_FINISHED
 			CAIRO_STATUS_SURFACE_TYPE_MISMATCH
 			CAIRO_STATUS_PATTERN_TYPE_MISMATCH
+			CAIRO_STATUS_INVALID_CONTENT
+			CAIRO_STATUS_INVALID_FORMAT
+			CAIRO_STATUS_INVALID_VISUAL
 	/],
 	cairo_filter_t => [qw/
 			CAIRO_FILTER_
@@ -138,6 +142,35 @@
 			CAIRO_CONTENT_ALPHA
 			CAIRO_CONTENT_COLOR_ALPHA
 	/],
+	cairo_antialias_t => [qw/
+			CAIRO_ANTIALIAS_
+			CAIRO_ANTIALIAS_DEFAULT
+			CAIRO_ANTIALIAS_NONE
+			CAIRO_ANTIALIAS_GRAY
+			CAIRO_ANTIALIAS_SUBPIXEL
+	/],
+	cairo_subpixel_order_t => [qw/
+			CAIRO_SUBPIXEL_ORDER_
+			CAIRO_SUBPIXEL_ORDER_DEFAULT
+			CAIRO_SUBPIXEL_ORDER_RGB
+			CAIRO_SUBPIXEL_ORDER_BGR
+			CAIRO_SUBPIXEL_ORDER_VRGB
+			CAIRO_SUBPIXEL_ORDER_VBGR
+	/],
+	cairo_hint_style_t => [qw/
+			CAIRO_HINT_STYLE_
+			CAIRO_HINT_STYLE_DEFAULT
+			CAIRO_HINT_STYLE_NONE
+			CAIRO_HINT_STYLE_SLIGHT
+			CAIRO_HINT_STYLE_MEDIUM
+			CAIRO_HINT_STYLE_FULL
+	/],
+	cairo_hint_metrics_t => [qw/
+			CAIRO_HINT_METRICS_
+			CAIRO_HINT_METRICS_DEFAULT
+			CAIRO_HINT_METRICS_OFF
+			CAIRO_HINT_METRICS_ON
+	/],
 );
 
 MakeHelper::do_enums (\%enums);
@@ -160,7 +193,11 @@
 $dep->add_pm ('Cairo.pm' => '$(INST_LIBDIR)/Cairo.pm');
 $dep->add_typemaps (@typemaps);
 
-$dep->install (qw(cairo-perl.h));
+$dep->install (qw(cairo-perl.h
+                  cairo-perl.typemap
+                  build/cairo-perl-enums.h
+                  build/cairo-perl-auto.h
+                  build/cairo-perl-auto.typemap));
 $dep->save_config ('build/IFiles.pm');
 
 WriteMakefile (

Index: cairo-perl.typemap
===================================================================
RCS file: /cvs/cairo/cairo-perl/cairo-perl.typemap,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cairo-perl.typemap	12 Jul 2005 20:29:47 -0000	1.2
+++ cairo-perl.typemap	29 Jul 2005 17:19:55 -0000	1.3
@@ -8,6 +8,8 @@
 
 TYPEMAP
 
+cairo_bool_t		T_IV
+
 cairo_font_extents_t *	T_CAIRO_FONT_EXTENTS
 cairo_text_extents_t *	T_CAIRO_TEXT_EXTENTS
 cairo_glyph_t *		T_CAIRO_GLYPH




More information about the cairo-commit mailing list