Class: Cairo::TextCluster
- Inherits:
-
Object
- Object
- Cairo::TextCluster
- Defined in:
- ext/cairo/rb_cairo_text_cluster.c
Instance Method Summary collapse
- #initialize ⇒ Object constructor
- #num_bytes ⇒ Object
- #num_glyphs ⇒ Object
- #set_num_bytes ⇒ Object
- #set_num_glyphs ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'ext/cairo/rb_cairo_text_cluster.c', line 69
static VALUE
cr_text_cluster_initialize (VALUE self, VALUE num_bytes, VALUE num_glyphs)
{
cairo_text_cluster_t *cluster;
cluster = ALLOC (cairo_text_cluster_t);
cluster->num_bytes = NUM2INT (num_bytes);
cluster->num_glyphs = NUM2INT (num_glyphs);
DATA_PTR (self) = cluster;
return Qnil;
}
|
Instance Method Details
#num_bytes ⇒ Object
82 83 84 85 86 |
# File 'ext/cairo/rb_cairo_text_cluster.c', line 82
static VALUE
cr_text_cluster_num_bytes (VALUE self)
{
return INT2NUM (_SELF(self)->num_bytes);
}
|
#num_glyphs ⇒ Object
88 89 90 91 92 |
# File 'ext/cairo/rb_cairo_text_cluster.c', line 88
static VALUE
cr_text_cluster_num_glyphs (VALUE self)
{
return INT2NUM (_SELF(self)->num_glyphs);
}
|
#set_num_bytes ⇒ Object
94 95 96 97 98 99 |
# File 'ext/cairo/rb_cairo_text_cluster.c', line 94
static VALUE
cr_text_cluster_set_num_bytes (VALUE self, VALUE num_bytes)
{
_SELF(self)->num_bytes = NUM2INT (num_bytes);
return self;
}
|
#set_num_glyphs ⇒ Object
101 102 103 104 105 106 |
# File 'ext/cairo/rb_cairo_text_cluster.c', line 101
static VALUE
cr_text_cluster_set_num_glyphs (VALUE self, VALUE num_glyphs)
{
_SELF(self)->num_glyphs = NUM2INT (num_glyphs);
return self;
}
|
#to_s ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'ext/cairo/rb_cairo_text_cluster.c', line 108
static VALUE
cr_text_cluster_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, "num_bytes=");
rb_str_concat (ret, rb_inspect (cr_text_cluster_num_bytes (self)));
rb_str_cat2 (ret, ", ");
rb_str_cat2 (ret, "num_glyphs=");
rb_str_concat (ret, rb_inspect (cr_text_cluster_num_glyphs (self)));
rb_str_cat2 (ret, ">");
return ret;
}
|