Class: Cairo::TextCluster

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

Instance Method Summary collapse

Constructor Details

#initializeObject



75
76
77
78
79
80
81
82
83
84
85
86
# File 'ext/cairo/rb_cairo_text_cluster.c', line 75

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

  RTYPEDDATA_DATA (self) = cluster;
  return Qnil;
}

Instance Method Details

#num_bytesObject



88
89
90
91
92
# File 'ext/cairo/rb_cairo_text_cluster.c', line 88

static VALUE
cr_text_cluster_num_bytes (VALUE self)
{
  return INT2NUM (_SELF(self)->num_bytes);
}

#num_glyphsObject



94
95
96
97
98
# File 'ext/cairo/rb_cairo_text_cluster.c', line 94

static VALUE
cr_text_cluster_num_glyphs (VALUE self)
{
  return INT2NUM (_SELF(self)->num_glyphs);
}

#set_num_bytesObject



100
101
102
103
104
105
# File 'ext/cairo/rb_cairo_text_cluster.c', line 100

static VALUE
cr_text_cluster_set_num_bytes (VALUE self, VALUE num_bytes)
{
  _SELF(self)->num_bytes = NUM2INT (num_bytes);
  return self;
}

#set_num_glyphsObject



107
108
109
110
111
112
# File 'ext/cairo/rb_cairo_text_cluster.c', line 107

static VALUE
cr_text_cluster_set_num_glyphs (VALUE self, VALUE num_glyphs)
{
  _SELF(self)->num_glyphs = NUM2INT (num_glyphs);
  return self;
}

#to_sObject



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'ext/cairo/rb_cairo_text_cluster.c', line 114

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