/*
- * $Id: rb_text.c 382 2006-05-25 09:20:31Z tilman $
+ * $Id: rb_text.c 388 2006-10-07 14:39:24Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
SET_COLOR_METHOD (outline);
}
+static VALUE c_ascent_get (VALUE self)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ return INT2FIX ((int) evas_object_text_ascent_get (e->real));
+}
+
+static VALUE c_descent_get (VALUE self)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ return INT2FIX ((int) evas_object_text_descent_get (e->real));
+}
+
+static VALUE c_max_ascent_get (VALUE self)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ return INT2FIX ((int) evas_object_text_max_ascent_get (e->real));
+}
+
+static VALUE c_max_descent_get (VALUE self)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ return INT2FIX ((int) evas_object_text_max_descent_get (e->real));
+}
+
+static VALUE c_advance_get (VALUE self)
+{
+ int h = 0, v = 0;
+
+ GET_OBJ (self, RbEvasObject, e);
+
+ h = (int) evas_object_text_horiz_advance_get (e->real);
+ v = (int) evas_object_text_vert_advance_get (e->real);
+
+ return rb_ary_new3 (2, INT2FIX (h), INT2FIX (v));
+}
+
+static VALUE c_inset_get (VALUE self)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ return INT2FIX ((int) evas_object_text_inset_get (e->real));
+}
+
void Init_Text (void)
{
VALUE c, c2;
rb_define_method (c, "get_outline_color", c_get_outline_color, 0);
rb_define_method (c, "set_outline_color", c_set_outline_color, 4);
+ rb_define_method (c, "ascent", c_ascent_get, 0);
+ rb_define_method (c, "descent", c_descent_get, 0);
+ rb_define_method (c, "max_ascent", c_max_ascent_get, 0);
+ rb_define_method (c, "max_descent", c_max_descent_get, 0);
+ rb_define_method (c, "advance", c_advance_get, 0);
+ rb_define_method (c, "inset", c_inset_get, 0);
+
c2 = rb_define_class_under (mEvas, "Style", c);
DEF_CONST (c2, EVAS_TEXT_STYLE_, PLAIN);