Class: Cairo::Glyph

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

Instance Method Summary collapse

Constructor Details

#initializeObject



70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'ext/cairo/rb_cairo_glyph.c', line 70

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

  RTYPEDDATA_DATA (self) = glyph;
  return Qnil;
}

Instance Method Details

#indexObject



84
85
86
87
88
# File 'ext/cairo/rb_cairo_glyph.c', line 84

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

#set_indexObject



102
103
104
105
106
107
# File 'ext/cairo/rb_cairo_glyph.c', line 102

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

#set_xObject



109
110
111
112
113
114
# File 'ext/cairo/rb_cairo_glyph.c', line 109

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

#set_yObject



116
117
118
119
120
121
# File 'ext/cairo/rb_cairo_glyph.c', line 116

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

#to_sObject



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

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



90
91
92
93
94
# File 'ext/cairo/rb_cairo_glyph.c', line 90

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

#yObject



96
97
98
99
100
# File 'ext/cairo/rb_cairo_glyph.c', line 96

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