[cairo-commit] rcairo/packages/cairo/ext rb_cairo.h, 1.4,
1.5 rb_cairo_context.c, 1.9, 1.10 rb_cairo_exception.c, 1.4,
1.5 rb_cairo_font_extents.c, 1.3, 1.4 rb_cairo_font_face.c,
1.3, 1.4 rb_cairo_glyph.c, 1.3, 1.4 rb_cairo_matrix.c, 1.7,
1.8 rb_cairo_pattern.c, 1.5, 1.6 rb_cairo_surface.c, 1.5,
1.6 rb_cairo_text_extents.c, 1.3, 1.4
Oeyvind Kolaas
commit at pdx.freedesktop.org
Tue Sep 13 09:22:32 PDT 2005
Committed by: pippin
Update of /cvs/cairo/rcairo/packages/cairo/ext
In directory gabe:/tmp/cvs-serv28319/packages/cairo/ext
Modified Files:
rb_cairo.h rb_cairo_context.c rb_cairo_exception.c
rb_cairo_font_extents.c rb_cairo_font_face.c rb_cairo_glyph.c
rb_cairo_matrix.c rb_cairo_pattern.c rb_cairo_surface.c
rb_cairo_text_extents.c
Log Message:
make the code more rubyish
Index: rb_cairo.h
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- rb_cairo.h 10 Sep 2005 18:29:03 -0000 1.4
+++ rb_cairo.h 13 Sep 2005 16:22:29 -0000 1.5
@@ -27,8 +27,8 @@
extern VALUE rb_cCairo_Glyph;
extern VALUE rb_cCairo_Surface;
-#define RVAL2CRCONTEXT(obj) (rb_cairo_from_ruby_object(obj))
-#define CRCONTEXT2RVAL(cr) (rb_cairo_to_ruby_object(cr))
+#define RVAL2CRCONTEXT(obj) (rb_cairo_context_from_ruby_object(obj))
+#define CRCONTEXT2RVAL(cr) (rb_cairo_context_to_ruby_object(cr))
#define RVAL2CRMATRIX(obj) (rb_cairo_matrix_from_ruby_object(obj))
#define CRMATRIX2RVAL(matrix) (rb_cairo_matrix_to_ruby_object(matrix))
@@ -51,8 +51,8 @@
#define RVAL2CRSURFACE(obj) (rb_cairo_surface_from_ruby_object(obj))
#define CRSURFACE2RVAL(surface) (rb_cairo_surface_to_ruby_object(surface))
-cairo_t *rb_cairo_from_ruby_object (VALUE obj);
-VALUE rb_cairo_to_ruby_object (cairo_t *cr);
+cairo_t *rb_cairo_context_from_ruby_object (VALUE obj);
+VALUE rb_cairo_context_to_ruby_object (cairo_t *cr);
cairo_matrix_t *rb_cairo_matrix_from_ruby_object (VALUE obj);
VALUE rb_cairo_matrix_to_ruby_object (cairo_matrix_t *matrix);
Index: rb_cairo_context.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo_context.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- rb_cairo_context.c 10 Sep 2005 18:29:03 -0000 1.9
+++ rb_cairo_context.c 13 Sep 2005 16:22:29 -0000 1.10
@@ -15,7 +15,7 @@
#define _SELF (RVAL2CRCONTEXT(self))
cairo_t *
-rb_cairo_from_ruby_object (VALUE obj)
+rb_cairo_context_from_ruby_object (VALUE obj)
{
cairo_t *context;
if (!RTEST (rb_obj_is_kind_of (obj, rb_cCairo_Context)))
@@ -41,8 +41,27 @@
return result;
}
[...1455 lines suppressed...]
rb_define_method (rb_cCairo_Context, "show_glyphs",
- RUBY_METHOD_FUNC (rb_cairo_show_glyphs), 1);
+ cr_show_glyphs, 1);
rb_define_method (rb_cCairo_Context, "text_path",
- RUBY_METHOD_FUNC (rb_cairo_text_path), 1);
+ cr_text_path, 1);
rb_define_method (rb_cCairo_Context, "glyph_path",
- RUBY_METHOD_FUNC (rb_cairo_glyph_path), 1);
- rb_define_method (rb_cCairo_Context, "get_target",
- RUBY_METHOD_FUNC (rb_cairo_get_target), 0);
+ cr_glyph_path, 1);
+ rb_define_method (rb_cCairo_Context, "target",
+ cr_get_target, 0);
+ rb_define_method (rb_cCairo_Context, "font_extents",
+ cr_font_extents, 0);
+ rb_define_method (rb_cCairo_Context, "glyph_extents",
+ cr_glyph_extents, 0);
}
-
-
Index: rb_cairo_exception.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo_exception.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- rb_cairo_exception.c 8 Sep 2005 09:16:59 -0000 1.4
+++ rb_cairo_exception.c 13 Sep 2005 16:22:29 -0000 1.5
@@ -36,6 +36,8 @@
switch (status)
{
+ case CAIRO_STATUS_SUCCESS:
+ break;
case CAIRO_STATUS_NO_MEMORY:
rb_raise (rb_eNoMemError, string);
break;
@@ -93,8 +95,6 @@
case CAIRO_STATUS_INVALID_DASH:
rb_raise (rb_eCairo_InvalidDashError, string);
break;
- case CAIRO_STATUS_SUCCESS:
- break;
}
}
Index: rb_cairo_font_extents.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo_font_extents.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- rb_cairo_font_extents.c 10 Sep 2005 18:29:03 -0000 1.3
+++ rb_cairo_font_extents.c 13 Sep 2005 16:22:29 -0000 1.4
@@ -43,9 +43,10 @@
}
static VALUE
-rb_cairo_font_extents_new (VALUE klass)
+cr_font_extents_new (int argc, VALUE *argv, VALUE klass)
{
cairo_font_extents_t font_extents;
+ VALUE self;
font_extents.ascent = 0.0;
font_extents.descent = 0.0;
@@ -53,35 +54,37 @@
font_extents.max_x_advance = 0.0;
font_extents.max_y_advance = 0.0;
- return CRFONTEXTENTS2RVAL (&font_extents);
+ self = CRFONTEXTENTS2RVAL (&font_extents);
+ rb_obj_call_init (self, argc, argv);
+ return self;
}
static VALUE
-rb_cairo_font_extents_ascent (VALUE self)
+cr_font_extents_ascent (VALUE self)
{
return rb_float_new (_SELF->ascent);
}
static VALUE
-rb_cairo_font_extents_descent (VALUE self)
+cr_font_extents_descent (VALUE self)
{
return rb_float_new (_SELF->descent);
}
static VALUE
-rb_cairo_font_extents_height (VALUE self)
+cr_font_extents_height (VALUE self)
{
return rb_float_new (_SELF->height);
}
static VALUE
-rb_cairo_font_extents_max_x_advance (VALUE self)
+cr_font_extents_max_x_advance (VALUE self)
{
return rb_float_new (_SELF->max_x_advance);
}
static VALUE
-rb_cairo_font_extents_max_y_advance (VALUE self)
+cr_font_extents_max_y_advance (VALUE self)
{
return rb_float_new (_SELF->max_y_advance);
}
@@ -92,15 +95,15 @@
rb_cCairo_FontExtents =
rb_define_class_under (rb_mCairo, "FontExtents", rb_cObject);
rb_define_singleton_method (rb_cCairo_FontExtents, "new",
- RUBY_METHOD_FUNC (rb_cairo_font_extents_new), 0);
+ cr_font_extents_new, -1);
rb_define_method (rb_cCairo_FontExtents, "ascent",
- RUBY_METHOD_FUNC (rb_cairo_font_extents_ascent), 0);
+ cr_font_extents_ascent, 0);
rb_define_method (rb_cCairo_FontExtents, "descent",
- RUBY_METHOD_FUNC (rb_cairo_font_extents_descent), 0);
+ cr_font_extents_descent, 0);
rb_define_method (rb_cCairo_FontExtents, "height",
- RUBY_METHOD_FUNC (rb_cairo_font_extents_height), 0);
+ cr_font_extents_height, 0);
rb_define_method (rb_cCairo_FontExtents, "max_x_advance",
- RUBY_METHOD_FUNC (rb_cairo_font_extents_max_x_advance), 0);
+ cr_font_extents_max_x_advance, 0);
rb_define_method (rb_cCairo_FontExtents, "max_y_advance",
- RUBY_METHOD_FUNC (rb_cairo_font_extents_max_y_advance), 0);
+ cr_font_extents_max_y_advance, 0);
}
Index: rb_cairo_font_face.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo_font_face.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- rb_cairo_font_face.c 10 Sep 2005 18:29:03 -0000 1.3
+++ rb_cairo_font_face.c 13 Sep 2005 16:22:29 -0000 1.4
@@ -43,51 +43,9 @@
}
-#if 0
-static VALUE
-rb_cairo_font_extents (VALUE self,
- VALUE font_matrix_v)
-{
- cairo_matrix_t *font_matrix = RVAL2CRAMTRIX (font_matrix_v);
- cairo_font_extents_t extents;
- cairo_status_t status;
-
- status = cairo_font_extents (_SELF, font_matrix, &extents);
- if (status)
- {
- rb_cairo_raise_exception (status);
- }
- else
- {
- return CRFONTEXTENTS2RVAL (&extents);
- }
-}
-
-static VALUE
-rb_cairo_font_glyph_extents (VALUE self,
- VALUE font_matrix_v,
- VALUE glyphs_v)
-{
- cairo_matrix_t *font_matrix = RVAL2CRMATRIX (font_matrix_v);
- cairo_text_extents_t extents;
- cairo_status_t status;
-
- /* XXX: unwrap glyph array */
- cairo_font_glyph_extents (_SELF, font_matrix, NULL, 0, &extents);
- return CRTEXTEXTENTS2RVAL (&extents);
-}
-#endif
-
-
void
Init_cairo_font (void)
{
rb_cCairo_FontFace =
rb_define_class_under (rb_mCairo, "FontFace", rb_cObject);
- /*
- rb_define_method (rb_cCairo_Font, "extents",
- RUBY_METHOD_FUNC (rb_cairo_font_extents), 1);
- rb_define_method (rb_cCairo_Font, "glyph_extents",
- RUBY_METHOD_FUNC (rb_cairo_font_extents), 2);
- */
}
Index: rb_cairo_glyph.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo_glyph.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- rb_cairo_glyph.c 10 Sep 2005 18:29:03 -0000 1.3
+++ rb_cairo_glyph.c 13 Sep 2005 16:22:29 -0000 1.4
@@ -43,56 +43,59 @@
}
static VALUE
-rb_cairo_glyph_new (VALUE klass)
+cr_glyph_new (int argc, VALUE *argv, VALUE klass)
{
cairo_glyph_t glyph;
+ VALUE rb_glyph;
glyph.index = 0;
glyph.x = 0.0;
glyph.y = 0.0;
- return CRGLYPH2RVAL (&glyph);
+ rb_glyph = CRGLYPH2RVAL (&glyph);
+ rb_obj_call_init (rb_glyph, argc, argv);
+ return rb_glyph;
}
static VALUE
-rb_cairo_glyph_index (VALUE self)
+cr_glyph_index (VALUE self)
{
return INT2NUM(_SELF->index);
}
static VALUE
-rb_cairo_glyph_x (VALUE self)
+cr_glyph_x (VALUE self)
{
return rb_float_new (_SELF->x);
}
static VALUE
-rb_cairo_glyph_y (VALUE self)
+cr_glyph_y (VALUE self)
{
return rb_float_new (_SELF->y);
}
static VALUE
-rb_cairo_glyph_set_index (VALUE self,
- VALUE index_v)
+cr_glyph_set_index (VALUE self,
+ VALUE rb_index)
{
- _SELF->index = NUM2ULONG (index_v);
+ _SELF->index = NUM2ULONG (rb_index);
return self;
}
static VALUE
-rb_cairo_glyph_set_x (VALUE self,
- VALUE x_v)
+cr_glyph_set_x (VALUE self,
+ VALUE rb_x)
{
- _SELF->x = NUM2DBL (x_v);
+ _SELF->x = NUM2DBL (rb_x);
return self;
}
static VALUE
-rb_cairo_glyph_set_y (VALUE self,
- VALUE y_v)
+cr_glyph_set_y (VALUE self,
+ VALUE rb_y)
{
- _SELF->y = NUM2DBL (y_v);
+ _SELF->y = NUM2DBL (rb_y);
return self;
}
@@ -104,17 +107,17 @@
rb_cCairo_Glyph =
rb_define_class_under (rb_mCairo, "Glyph", rb_cObject);
rb_define_singleton_method (rb_cCairo_Glyph, "new",
- RUBY_METHOD_FUNC (rb_cairo_glyph_new), 0);
+ cr_glyph_new, -1);
rb_define_method (rb_cCairo_Glyph, "index",
- RUBY_METHOD_FUNC (rb_cairo_glyph_index), 0);
+ cr_glyph_index, 0);
rb_define_method (rb_cCairo_Glyph, "x",
- RUBY_METHOD_FUNC (rb_cairo_glyph_x), 0);
+ cr_glyph_x, 0);
rb_define_method (rb_cCairo_Glyph, "y",
- RUBY_METHOD_FUNC (rb_cairo_glyph_y), 0);
- rb_define_method (rb_cCairo_Glyph, "index=",
- RUBY_METHOD_FUNC (rb_cairo_glyph_set_index), 1);
- rb_define_method (rb_cCairo_Glyph, "x=",
- RUBY_METHOD_FUNC (rb_cairo_glyph_set_x), 1);
- rb_define_method (rb_cCairo_Glyph, "y=",
- RUBY_METHOD_FUNC (rb_cairo_glyph_set_y), 1);
+ cr_glyph_y, 0);
+ rb_define_method (rb_cCairo_Glyph, "set_index",
+ cr_glyph_set_index, 1);
+ rb_define_method (rb_cCairo_Glyph, "set_x",
+ cr_glyph_set_x, 1);
+ rb_define_method (rb_cCairo_Glyph, "set_y",
+ cr_glyph_set_y, 1);
}
Index: rb_cairo_matrix.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo_matrix.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- rb_cairo_matrix.c 10 Sep 2005 18:29:03 -0000 1.7
+++ rb_cairo_matrix.c 13 Sep 2005 16:22:29 -0000 1.8
@@ -66,16 +66,19 @@
static VALUE
-rb_cairo_matrix_new (VALUE klass)
+cr_matrix_new (VALUE klass)
{
cairo_matrix_t matrix;
+ VALUE rb_matrix;
cairo_matrix_init_identity (&matrix);
- return CRMATRIX2RVAL (&matrix);
+ rb_matrix = CRMATRIX2RVAL (&matrix);
+ rb_obj_call_init (rb_matrix, 0, NULL);
+ return rb_matrix;
}
static VALUE
-rb_cairo_matrix_copy (VALUE self, VALUE other)
+cr_matrix_copy (VALUE self, VALUE other)
{
cairo_matrix_t *matrix = RVAL2CRMATRIX (other);
@@ -87,17 +90,17 @@
}
static VALUE
-rb_cairo_matrix_init_identity (VALUE self)
+cr_matrix_init_identity (VALUE self)
{
cairo_matrix_init_identity (_SELF);
return self;
}
static VALUE
-rb_cairo_matrix_set (VALUE self,
- VALUE a, VALUE b,
- VALUE c, VALUE d,
- VALUE tx, VALUE ty)
+cr_matrix_set (VALUE self,
+ VALUE a, VALUE b,
+ VALUE c, VALUE d,
+ VALUE tx, VALUE ty)
{
cairo_matrix_init (_SELF,
NUM2DBL (a), NUM2DBL (b),
@@ -107,7 +110,7 @@
}
static VALUE
-rb_cairo_matrix_get (VALUE self)
+cr_matrix_get (VALUE self)
{
cairo_matrix_t *matrix = _SELF;
double affine[6];
@@ -121,8 +124,8 @@
}
static VALUE
-rb_cairo_matrix_translate (VALUE self,
- VALUE tx, VALUE ty)
+cr_matrix_translate (VALUE self,
+ VALUE tx, VALUE ty)
{
cairo_matrix_translate (_SELF,
NUM2DBL (tx), NUM2DBL (ty));
@@ -130,8 +133,8 @@
}
static VALUE
-rb_cairo_matrix_scale (VALUE self,
- VALUE sx, VALUE sy)
+cr_matrix_scale (VALUE self,
+ VALUE sx, VALUE sy)
{
cairo_matrix_scale (_SELF,
NUM2DBL (sx), NUM2DBL (sy));
@@ -139,8 +142,8 @@
}
static VALUE
-rb_cairo_matrix_rotate (VALUE self,
- VALUE radians)
+cr_matrix_rotate (VALUE self,
+ VALUE radians)
{
cairo_matrix_rotate (_SELF,
NUM2DBL (radians));
@@ -148,7 +151,7 @@
}
static VALUE
-rb_cairo_matrix_invert (VALUE self)
+cr_matrix_invert (VALUE self)
{
cairo_status_t status;
status = cairo_matrix_invert (_SELF);
@@ -161,9 +164,9 @@
}
static VALUE
-rb_cairo_matrix_multiply (VALUE self,
- VALUE a,
- VALUE b)
+cr_matrix_multiply (VALUE self,
+ VALUE a,
+ VALUE b)
{
cairo_matrix_multiply (_SELF,
RVAL2CRMATRIX (a),
@@ -172,8 +175,8 @@
}
static VALUE
-rb_cairo_matrix_transform_distance (VALUE self,
- VALUE dx, VALUE dy)
+cr_matrix_transform_distance (VALUE self,
+ VALUE dx, VALUE dy)
{
double pair[2];
pair[0] = NUM2DBL (dx);
@@ -184,8 +187,8 @@
}
static VALUE
-rb_cairo_matrix_transform_point (VALUE self,
- VALUE x, VALUE y)
+cr_matrix_transform_point (VALUE self,
+ VALUE x, VALUE y)
{
double pair[2];
pair[0] = NUM2DBL (x);
@@ -202,27 +205,27 @@
rb_cCairo_Matrix =
rb_define_class_under (rb_mCairo, "Matrix", rb_cObject);
rb_define_singleton_method (rb_cCairo_Matrix, "new",
- RUBY_METHOD_FUNC (rb_cairo_matrix_new), 0);
+ cr_matrix_new, 0);
rb_define_method (rb_cCairo_Matrix, "copy",
- RUBY_METHOD_FUNC (rb_cairo_matrix_copy), 1);
+ cr_matrix_copy, 1);
rb_define_method (rb_cCairo_Matrix, "set",
- RUBY_METHOD_FUNC (rb_cairo_matrix_set), 6);
- rb_define_method (rb_cCairo_Matrix, "get",
- RUBY_METHOD_FUNC (rb_cairo_matrix_get), 0);
+ cr_matrix_set, 6);
+ rb_define_method (rb_cCairo_Matrix, "to_a",
+ cr_matrix_get, 0);
rb_define_method (rb_cCairo_Matrix, "init_identity",
- RUBY_METHOD_FUNC (rb_cairo_matrix_init_identity), 1);
+ cr_matrix_init_identity, 1);
rb_define_method (rb_cCairo_Matrix, "translate!",
- RUBY_METHOD_FUNC (rb_cairo_matrix_translate), 2);
+ cr_matrix_translate, 2);
rb_define_method (rb_cCairo_Matrix, "scale!",
- RUBY_METHOD_FUNC (rb_cairo_matrix_scale), 2);
+ cr_matrix_scale, 2);
rb_define_method (rb_cCairo_Matrix, "rotate!",
- RUBY_METHOD_FUNC (rb_cairo_matrix_rotate), 2);
+ cr_matrix_rotate, 2);
rb_define_method (rb_cCairo_Matrix, "invert!",
- RUBY_METHOD_FUNC (rb_cairo_matrix_invert), 0);
+ cr_matrix_invert, 0);
rb_define_method (rb_cCairo_Matrix, "multiply!",
- RUBY_METHOD_FUNC (rb_cairo_matrix_multiply), 3);
+ cr_matrix_multiply, 3);
rb_define_method (rb_cCairo_Matrix, "transform_point",
- RUBY_METHOD_FUNC (rb_cairo_matrix_transform_point), 2);
+ cr_matrix_transform_point, 2);
rb_define_method (rb_cCairo_Matrix, "matrix_distance",
- RUBY_METHOD_FUNC (rb_cairo_matrix_transform_distance), 2);
+ cr_matrix_transform_distance, 2);
}
Index: rb_cairo_pattern.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo_pattern.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- rb_cairo_pattern.c 10 Sep 2005 18:29:03 -0000 1.5
+++ rb_cairo_pattern.c 13 Sep 2005 16:22:29 -0000 1.6
@@ -27,7 +27,7 @@
}
static void
-rb_free_pattern (void *ptr)
+cr_pattern_free (void *ptr)
{
if (ptr)
{
@@ -41,7 +41,7 @@
if (pat)
{
cairo_pattern_reference (pat);
- return Data_Wrap_Struct (rb_cCairo_Pattern, NULL, rb_free_pattern, pat);
+ return Data_Wrap_Struct (rb_cCairo_Pattern, NULL, cr_pattern_free, pat);
}
else
{
Index: rb_cairo_surface.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo_surface.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- rb_cairo_surface.c 10 Sep 2005 18:29:03 -0000 1.5
+++ rb_cairo_surface.c 13 Sep 2005 16:22:29 -0000 1.6
@@ -64,7 +64,7 @@
}
static void
-rb_free_surface (void *ptr)
+cr_surface_free (void *ptr)
{
if (ptr)
{
@@ -78,7 +78,7 @@
if (surface)
{
cairo_surface_reference (surface);
- return Data_Wrap_Struct (rb_cCairo_Surface, NULL, rb_free_surface, surface);
+ return Data_Wrap_Struct (rb_cCairo_Surface, NULL, cr_surface_free, surface);
}
else
{
Index: rb_cairo_text_extents.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo_text_extents.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- rb_cairo_text_extents.c 10 Sep 2005 18:29:03 -0000 1.3
+++ rb_cairo_text_extents.c 13 Sep 2005 16:22:29 -0000 1.4
@@ -42,7 +42,7 @@
}
static VALUE
-rb_cairo_text_extents_new (VALUE klass)
+cr_text_extents_new (VALUE klass)
{
cairo_text_extents_t text_extents;
@@ -57,37 +57,37 @@
}
static VALUE
-rb_cairo_text_extents_x_bearing (VALUE self)
+cr_text_extents_x_bearing (VALUE self)
{
return rb_float_new (_SELF->x_bearing);
}
static VALUE
-rb_cairo_text_extents_y_bearing (VALUE self)
+cr_text_extents_y_bearing (VALUE self)
{
return rb_float_new (_SELF->y_bearing);
}
static VALUE
-rb_cairo_text_extents_width (VALUE self)
+cr_text_extents_width (VALUE self)
{
return rb_float_new (_SELF->width);
}
static VALUE
-rb_cairo_text_extents_height (VALUE self)
+cr_text_extents_height (VALUE self)
{
return rb_float_new (_SELF->height);
}
static VALUE
-rb_cairo_text_extents_x_advance (VALUE self)
+cr_text_extents_x_advance (VALUE self)
{
return rb_float_new (_SELF->x_advance);
}
static VALUE
-rb_cairo_text_extents_y_advance (VALUE self)
+cr_text_extents_y_advance (VALUE self)
{
return rb_float_new (_SELF->y_advance);
}
@@ -98,17 +98,17 @@
rb_cCairo_TextExtents =
rb_define_class_under (rb_mCairo, "TextExtents", rb_cObject);
rb_define_singleton_method (rb_cCairo_TextExtents, "new",
- RUBY_METHOD_FUNC (rb_cairo_text_extents_new), 0);
+ cr_text_extents_new, 0);
rb_define_method (rb_cCairo_TextExtents, "x_bearing",
- RUBY_METHOD_FUNC (rb_cairo_text_extents_x_bearing), 0);
+ cr_text_extents_x_bearing, 0);
rb_define_method (rb_cCairo_TextExtents, "y_bearing",
- RUBY_METHOD_FUNC (rb_cairo_text_extents_y_bearing), 0);
+ cr_text_extents_y_bearing, 0);
rb_define_method (rb_cCairo_TextExtents, "width",
- RUBY_METHOD_FUNC (rb_cairo_text_extents_width), 0);
+ cr_text_extents_width, 0);
rb_define_method (rb_cCairo_TextExtents, "height",
- RUBY_METHOD_FUNC (rb_cairo_text_extents_height), 0);
+ cr_text_extents_height, 0);
rb_define_method (rb_cCairo_TextExtents, "x_advance",
- RUBY_METHOD_FUNC (rb_cairo_text_extents_x_advance), 0);
+ cr_text_extents_x_advance, 0);
rb_define_method (rb_cCairo_TextExtents, "y_advance",
- RUBY_METHOD_FUNC (rb_cairo_text_extents_y_advance), 0);
+ cr_text_extents_y_advance, 0);
}
More information about the cairo-commit
mailing list