Class: Cairo::Glyph

Inherits:
Object
  • Object
show all
Defined in:
ext/cairo/rb_cairo_glyph.c

Instance Method Summary collapse

Constructor Details

#initializeObject



67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'ext/cairo/rb_cairo_glyph.c', line 67

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;
}

Instance Method Details

#indexObject



81
82
83
84
85
# File 'ext/cairo/rb_cairo_glyph.c', line 81

static VALUE
cr_glyph_index (VALUE self)
{
  return ULONG2NUM (_SELF(self)->index);
}

#set_indexObject



99
100
101
102
103
104
# File 'ext/cairo/rb_cairo_glyph.c', line 99

static VALUE
cr_glyph_set_index (VALUE self, VALUE index)
{
  _SELF(self)->index = NUM2ULONG (index);
  return self;
}

#set_xObject



106
107
108
109
110
111
# File 'ext/cairo/rb_cairo_glyph.c', line 106

static VALUE
cr_glyph_set_x (VALUE self, VALUE x)
{
  _SELF(self)->x = NUM2DBL (x);
  return self;
}

#set_yObject



113
114
115
116
117
118
# File 'ext/cairo/rb_cairo_glyph.c', line 113

static VALUE
cr_glyph_set_y (VALUE self, VALUE y)
{
  _SELF(self)->y = NUM2DBL (y);
  return self;
}

#to_sObject



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'ext/cairo/rb_cairo_glyph.c', line 120

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;
}

#xObject



87
88
89
90
91
# File 'ext/cairo/rb_cairo_glyph.c', line 87

static VALUE
cr_glyph_x (VALUE self)
{
  return rb_float_new (_SELF(self)->x);
}

#yObject



93
94
95
96
97
# File 'ext/cairo/rb_cairo_glyph.c', line 93

static VALUE
cr_glyph_y (VALUE self)
{
  return rb_float_new (_SELF(self)->y);
}