class Cairo::Glyph
Public Class Methods
new(p1, p2, p3)
click to toggle source
static VALUE
cr_glyph_initialize (VALUE self, VALUE index, VALUE x, VALUE y)
{
cairo_glyph_t *glyph;
glyph = ALLOC (cairo_glyph_t);
glyph->index = NUM2ULONG (index);
glyph->x = NUM2DBL (x);
glyph->y = NUM2DBL (y);
DATA_PTR (self) = glyph;
return Qnil;
}
Public Instance Methods
index()
click to toggle source
static VALUE
cr_glyph_index (VALUE self)
{
return ULONG2NUM (_SELF(self)->index);
}
set_index(p1)
click to toggle source
static VALUE
cr_glyph_set_index (VALUE self, VALUE index)
{
_SELF(self)->index = NUM2ULONG (index);
return self;
}
set_x(p1)
click to toggle source
static VALUE
cr_glyph_set_x (VALUE self, VALUE x)
{
_SELF(self)->x = NUM2DBL (x);
return self;
}
set_y(p1)
click to toggle source
static VALUE
cr_glyph_set_y (VALUE self, VALUE y)
{
_SELF(self)->y = NUM2DBL (y);
return self;
}
to_s()
click to toggle source
static VALUE
cr_glyph_to_s (VALUE self)
{
VALUE ret;
ret = rb_str_new2 ("#<");
rb_str_cat2 (ret, rb_class2name (CLASS_OF (self)));
rb_str_cat2 (ret, ": ");
rb_str_cat2 (ret, "index=");
rb_str_concat (ret, rb_inspect (cr_glyph_index (self)));
rb_str_cat2 (ret, ", ");
rb_str_cat2 (ret, "x=");
rb_str_concat (ret, rb_inspect (cr_glyph_x (self)));
rb_str_cat2 (ret, ", ");
rb_str_cat2 (ret, "y=");
rb_str_concat (ret, rb_inspect (cr_glyph_y (self)));
rb_str_cat2 (ret, ">");
return ret;
}
x()
click to toggle source
static VALUE
cr_glyph_x (VALUE self)
{
return rb_float_new (_SELF(self)->x);
}
y()
click to toggle source
static VALUE
cr_glyph_y (VALUE self)
{
return rb_float_new (_SELF(self)->y);
}