[cairo-commit] rcairo/packages/cairo/ext rb_cairo.h, 1.17, 1.18 rb_cairo_constants.c, 1.14, 1.15 rb_cairo_context.c, 1.35, 1.36 rb_cairo_scaled_font.c, 1.4, 1.5

Kouhei Sutou commit at pdx.freedesktop.org
Sat Mar 3 05:53:36 PST 2007


Committed by: kou

Update of /cvs/cairo/rcairo/packages/cairo/ext
In directory kemper:/tmp/cvs-serv15294/packages/cairo/ext

Modified Files:
	rb_cairo.h rb_cairo_constants.c rb_cairo_context.c 
	rb_cairo_scaled_font.c 
Log Message:
* packages/cairo/ext/rb_cairo_context.c: supported cairo 1.3.16.
* packages/cairo/ext/rb_cairo.h: cleanup.
* packages/cairo/ext/rb_cairo_scaled_font.c
  (rb_cairo_scaled_font_to_ruby_object): fixed a conversion bug.
* packages/cairo/ext/rb_cairo_constants.c
  (Cairo::SURFACE_TYPE_OS2): added.


Index: rb_cairo.h
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- rb_cairo.h	27 Nov 2006 14:35:52 -0000	1.17
+++ rb_cairo.h	3 Mar 2007 13:53:29 -0000	1.18
@@ -85,10 +85,10 @@
 #define CRFONTEXTENTS2RVAL(ext) (rb_cairo_font_extents_to_ruby_object(ext))
 
 #define RVAL2CRFONTOPTIONS(obj) (rb_cairo_font_options_from_ruby_object(obj))
-#define CRFONTOPTIONS2RVAL(ext) (rb_cairo_font_options_to_ruby_object(ext))
+#define CRFONTOPTIONS2RVAL(opt) (rb_cairo_font_options_to_ruby_object(opt))
 
-#define RVAL2CRSCALEDFONT(obj) (rb_cairo_scaled_font_from_ruby_object(obj))
-#define CRSCALEDFONT2RVAL(ext) (rb_cairo_scaled_font_to_ruby_object(ext))
+#define RVAL2CRSCALEDFONT(obj)  (rb_cairo_scaled_font_from_ruby_object(obj))
+#define CRSCALEDFONT2RVAL(font) (rb_cairo_scaled_font_to_ruby_object(font))
 
 #define RVAL2CRTEXTEXTENTS(obj) (rb_cairo_text_extents_from_ruby_object(obj))
 #define CRTEXTEXTENTS2RVAL(ext) (rb_cairo_text_extents_to_ruby_object(ext))

Index: rb_cairo_constants.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo_constants.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- rb_cairo_constants.c	21 Dec 2006 15:34:36 -0000	1.14
+++ rb_cairo_constants.c	3 Mar 2007 13:53:29 -0000	1.15
@@ -277,6 +277,10 @@
                    INT2FIX (CAIRO_SURFACE_TYPE_DIRECTFB));
   rb_define_const (rb_mCairo, "SURFACE_TYPE_SVG",
                    INT2FIX (CAIRO_SURFACE_TYPE_SVG));
+#if CAIRO_CHECK_VERSION(1, 3, 0)
+  rb_define_const (rb_mCairo, "SURFACE_TYPE_OS2",
+                   INT2FIX (CAIRO_SURFACE_TYPE_OS2));
+#endif
 
   /* cairo_format_t */
   rb_define_const (rb_mCairo,    "FORMAT_ARGB32",

Index: rb_cairo_context.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo_context.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- rb_cairo_context.c	20 Jan 2007 15:10:39 -0000	1.35
+++ rb_cairo_context.c	3 Mar 2007 13:53:29 -0000	1.36
@@ -965,6 +965,12 @@
 }
 
 static VALUE
+cr_get_scaled_font (VALUE self)
+{
+  return CRSCALEDFONT2RVAL (cairo_get_scaled_font (_SELF));
+}
+
+static VALUE
 cr_show_text (VALUE self, VALUE utf8)
 {
   cairo_show_text (_SELF, StringValuePtr (utf8));
@@ -1351,18 +1357,18 @@
   rb_define_method (rb_cCairo_Context, "set_font_options",
                     cr_set_font_options, 1);
   rb_define_method (rb_cCairo_Context, "font_options", cr_get_font_options, 0);
+  rb_define_method (rb_cCairo_Context, "set_font_face", cr_set_font_face, 1);
+  rb_define_method (rb_cCairo_Context, "font_face", cr_get_font_face, 0);
   rb_define_method (rb_cCairo_Context, "set_scaled_font",
                     cr_set_scaled_font, 1);
+  rb_define_method (rb_cCairo_Context, "scaled_font", cr_get_scaled_font, 0);
   rb_define_method (rb_cCairo_Context, "show_text", cr_show_text, 1);
   rb_define_method (rb_cCairo_Context, "show_glyphs", cr_show_glyphs, 1);
-  rb_define_method (rb_cCairo_Context, "font_face", cr_get_font_face, 0);
-  rb_define_method (rb_cCairo_Context, "font_extents",
-                    cr_font_extents, 0);
-  rb_define_method (rb_cCairo_Context, "set_font_face", cr_set_font_face, 1);
-  rb_define_method (rb_cCairo_Context, "text_extents", cr_text_extents, 1);
-  rb_define_method (rb_cCairo_Context, "glyph_extents", cr_glyph_extents, 1);
   rb_define_method (rb_cCairo_Context, "text_path", cr_text_path, 1);
   rb_define_method (rb_cCairo_Context, "glyph_path", cr_glyph_path, 1);
+  rb_define_method (rb_cCairo_Context, "text_extents", cr_text_extents, 1);
+  rb_define_method (rb_cCairo_Context, "glyph_extents", cr_glyph_extents, 1);
+  rb_define_method (rb_cCairo_Context, "font_extents", cr_font_extents, 0);
 
   /* Query functions */
   rb_define_method (rb_cCairo_Context, "operator", cr_get_operator, 0);

Index: rb_cairo_scaled_font.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo_scaled_font.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- rb_cairo_scaled_font.c	2 May 2006 05:37:02 -0000	1.4
+++ rb_cairo_scaled_font.c	3 Mar 2007 13:53:29 -0000	1.5
@@ -52,7 +52,7 @@
   if (font)
     {
       cairo_scaled_font_reference (font);
-      return Data_Wrap_Struct (rb_cCairo_FontFace, NULL,
+      return Data_Wrap_Struct (rb_cCairo_ScaledFont, NULL,
                                cr_scaled_font_free, font);
     }
   else



More information about the cairo-commit mailing list