/*
- * $Id: rb_text.c 38 2004-07-25 11:27:25Z tilman $
+ * $Id: rb_text.c 49 2004-08-01 10:17:39Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
#include "rb_evas.h"
#include "rb_evas_object.h"
+static void c_free (RbEvasObject *e)
+{
+ c_evas_object_free (e, true);
+}
+
static VALUE c_new (VALUE klass, VALUE evas)
{
VALUE self, argv[1];
- Evas_Object **rect;
+ RbEvasObject *text;
CHECK_CLASS (evas, cEvas);
- GET_OBJ (evas, Evas *, e);
+ GET_OBJ (evas, RbEvas, e);
- self = Data_Make_Struct (klass, Evas_Object *, c_evas_object_mark,
- c_evas_object_free, rect);
- *rect = evas_object_text_add (*e);
+ self = Data_Make_Struct (klass, RbEvasObject, c_evas_object_mark,
+ c_free, text);
+ text->real = evas_object_text_add (e->real);
argv[0] = evas;
rb_obj_call_init (self, 1, argv);
{
const char *tmp;
- GET_OBJ (self, Evas_Object *, e);
+ GET_OBJ (self, RbEvasObject, e);
- if (!(tmp = evas_object_text_font_source_get (*e)))
+ if (!(tmp = evas_object_text_font_source_get (e->real)))
return Qnil;
else
return rb_str_new2 (tmp);
static VALUE c_font_source_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Evas_Object *, e);
+ GET_OBJ (self, RbEvasObject, e);
Check_Type (val, T_STRING);
- evas_object_text_font_source_set (*e, StringValuePtr (val));
+ evas_object_text_font_source_set (e->real, StringValuePtr (val));
return Qnil;
}
char *font = NULL;
Evas_Font_Size size = 0;
- GET_OBJ (self, Evas_Object *, e);
+ GET_OBJ (self, RbEvasObject, e);
- evas_object_text_font_get (*e, &font, &size);
+ evas_object_text_font_get (e->real, &font, &size);
return rb_ary_new3 (2, font ? rb_str_new2 (font) : Qnil,
INT2FIX (size));
static VALUE c_set_font (VALUE self, VALUE font, VALUE size)
{
- GET_OBJ (self, Evas_Object *, e);
+ GET_OBJ (self, RbEvasObject, e);
Check_Type (font, T_STRING);
Check_Type (font, T_FIXNUM);
- evas_object_text_font_set (*e, StringValuePtr (font),
+ evas_object_text_font_set (e->real, StringValuePtr (font),
FIX2INT (size));
return Qnil;
{
const char *tmp;
- GET_OBJ (self, Evas_Object *, e);
+ GET_OBJ (self, RbEvasObject, e);
- if (!(tmp = evas_object_text_text_get (*e)))
+ if (!(tmp = evas_object_text_text_get (e->real)))
return Qnil;
else
return rb_str_new2 (tmp);
static VALUE c_text_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Evas_Object *, e);
+ GET_OBJ (self, RbEvasObject, e);
Check_Type (val, T_STRING);
- evas_object_text_text_set (*e, StringValuePtr (val));
+ evas_object_text_text_set (e->real, StringValuePtr (val));
return Qnil;
}