/*
- * $Id: rb_evas.c 32 2004-07-10 14:07:49Z tilman $
+ * $Id: rb_evas.c 38 2004-07-25 11:27:25Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
static void c_free (Evas **e)
{
/* do NOT call evas_free() here, since the Evas is freed
- * by ecore_evas_free() eventually */
+ * by ecore_evas_free() eventually
+ */
rb_hash_aset (parents, INT2NUM ((long) e), Qnil);
free (e);
static VALUE c_inspect (VALUE self)
{
- INSPECT (self, Evas);
+ INSPECT (self, Evas *);
}
static VALUE c_render (VALUE self)
{
- GET_OBJ (self, Evas, e);
+ GET_OBJ (self, Evas *, e);
evas_render (*e);
static VALUE c_font_path_clear (VALUE self)
{
- GET_OBJ (self, Evas, e);
+ GET_OBJ (self, Evas *, e);
evas_font_path_clear (*e);
static VALUE c_font_path_append (VALUE self, VALUE path)
{
- GET_OBJ (self, Evas, e);
+ GET_OBJ (self, Evas *, e);
Check_Type (path, T_STRING);
static VALUE c_font_path_prepend (VALUE self, VALUE path)
{
- GET_OBJ (self, Evas, e);
+ GET_OBJ (self, Evas *, e);
Check_Type (path, T_STRING);
VALUE ary;
const Evas_List *list, *l;
- GET_OBJ (self, Evas, e);
+ GET_OBJ (self, Evas *, e);
if (!(list = evas_font_path_list (*e)))
return rb_ary_new ();
static VALUE c_font_cache_get (VALUE self)
{
- GET_OBJ (self, Evas, e);
+ GET_OBJ (self, Evas *, e);
return INT2FIX (evas_font_cache_get (*e));
}
static VALUE c_font_cache_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Evas, e);
+ GET_OBJ (self, Evas *, e);
Check_Type (val, T_FIXNUM);
static VALUE c_font_cache_flush (VALUE self)
{
- GET_OBJ (self, Evas, e);
+ GET_OBJ (self, Evas *, e);
evas_font_cache_flush (*e);
static VALUE c_image_cache_get (VALUE self)
{
- GET_OBJ (self, Evas, e);
+ GET_OBJ (self, Evas *, e);
return INT2FIX (evas_image_cache_get (*e));
}
static VALUE c_image_cache_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Evas, e);
+ GET_OBJ (self, Evas *, e);
Check_Type (val, T_FIXNUM);
static VALUE c_image_cache_reload (VALUE self)
{
- GET_OBJ (self, Evas, e);
+ GET_OBJ (self, Evas *, e);
evas_image_cache_reload (*e);
static VALUE c_image_cache_flush (VALUE self)
{
- GET_OBJ (self, Evas, e);
+ GET_OBJ (self, Evas *, e);
evas_image_cache_flush (*e);
Evas_Object *o;
void *obj;
- GET_OBJ (self, Evas, e);
+ GET_OBJ (self, Evas *, e);
if (!(o = evas_object_top_get (*e)))
return Qnil;
Evas_Object *o;
void *obj;
- GET_OBJ (self, Evas, e);
+ GET_OBJ (self, Evas *, e);
if (!(o = evas_object_bottom_get (*e)))
return Qnil;
Evas_Object *o;
void *obj;
- GET_OBJ (self, Evas, e);
+ GET_OBJ (self, Evas *, e);
Check_Type (name, T_STRING);
/*
- * $Id: rb_evas_main.h 32 2004-07-10 14:07:49Z tilman $
+ * $Id: rb_evas_main.h 38 2004-07-25 11:27:25Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
#define __RB_EVAS_MAIN_H
#define GET_OBJ(obj, type, o) \
- type **(o) = NULL; \
+ type *(o) = NULL; \
\
- Data_Get_Struct ((obj), type *, (o)); \
+ Data_Get_Struct ((obj), type, (o)); \
\
if (!*(o)) { \
rb_raise (rb_eException, \
rb_raise (rb_eTypeError, \
"wrong argument type %s (expected %s)", \
rb_obj_classname ((val)), \
- rb_obj_classname ((klass))); \
+ rb_class2name ((klass))); \
return Qnil; \
}
/*
- * $Id: rb_evas_object.c 32 2004-07-10 14:07:49Z tilman $
+ * $Id: rb_evas_object.c 38 2004-07-25 11:27:25Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
static VALUE c_init (VALUE self, VALUE parent)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
evas_object_data_set (*e, RUBY_EVAS_OBJECT_KEY, (void *) self);
static VALUE c_inspect (VALUE self)
{
- INSPECT (self, Evas_Object);
+ INSPECT (self, Evas_Object *);
}
static VALUE c_delete (VALUE self)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
evas_object_del (*e);
*e = NULL;
static VALUE c_resize (VALUE self, VALUE w, VALUE h)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (w, T_FIXNUM);
Check_Type (h, T_FIXNUM);
static VALUE c_move (VALUE self, VALUE x, VALUE y)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (x, T_FIXNUM);
Check_Type (y, T_FIXNUM);
{
int x = 0, y = 0, w = 0, h = 0;
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
evas_object_geometry_get (*e, (Evas_Coord *) &x, (Evas_Coord *) &y,
(Evas_Coord *) & w, (Evas_Coord *) &h);
static VALUE c_show (VALUE self)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
evas_object_show (*e);
static VALUE c_hide (VALUE self)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
evas_object_hide (*e);
static VALUE c_visible_get (VALUE self)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
return evas_object_visible_get (*e) ? Qtrue : Qfalse;
}
static VALUE c_evas_get (VALUE self)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
return rb_hash_aref (parents, INT2NUM ((long) (e)));
}
{
const char *name;
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
if (!(name = evas_object_name_get (*e)))
return Qnil;
static VALUE c_name_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (val, T_STRING);
static VALUE c_layer_get (VALUE self)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
return INT2FIX (evas_object_layer_get (*e));
}
static VALUE c_layer_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (val, T_FIXNUM);
{
int r = 0, g = 0, b = 0, a = 0;
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
evas_object_color_get (*e, &r, &g, &b, &a);
static VALUE c_set_color (VALUE self, VALUE r, VALUE g, VALUE b,
VALUE a)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (r, T_FIXNUM);
Check_Type (g, T_FIXNUM);
static VALUE c_pass_events_get (VALUE self)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
return evas_object_pass_events_get (*e) ? Qtrue : Qfalse;
}
static VALUE c_pass_events_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
CHECK_BOOL (val);
static VALUE c_raise (VALUE self)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
evas_object_raise (*e);
static VALUE c_lower (VALUE self)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
evas_object_lower (*e);
static VALUE c_stack_above (VALUE self, VALUE target)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
if (!rb_obj_is_kind_of (target, cEvasObject)) {
rb_raise (rb_eTypeError,
return Qnil;
}
- GET_OBJ (target, Evas_Object, target2);
+ GET_OBJ (target, Evas_Object *, target2);
evas_object_stack_above (*e, *target2);
static VALUE c_stack_below (VALUE self, VALUE target)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
if (!rb_obj_is_kind_of (target, cEvasObject)) {
rb_raise (rb_eTypeError,
return Qnil;
}
- GET_OBJ (target, Evas_Object, target2);
+ GET_OBJ (target, Evas_Object *, target2);
evas_object_stack_below (*e, *target2);
Evas_Object *o;
void *obj;
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
if (!(evas_object_above_get (*e)))
return Qnil;
Evas_Object *o;
void *obj;
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
if (!(evas_object_below_get (*e)))
return Qnil;
/*
- * $Id: rb_gradient.c 32 2004-07-10 14:07:49Z tilman $
+ * $Id: rb_gradient.c 38 2004-07-25 11:27:25Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
Evas_Object **rect;
CHECK_CLASS (evas, cEvas);
- GET_OBJ (evas, Evas, e);
+ GET_OBJ (evas, Evas *, e);
self = Data_Make_Struct (klass, Evas_Object *, c_evas_object_mark,
c_evas_object_free, rect);
static VALUE c_color_add (VALUE self, VALUE r, VALUE g, VALUE b,
VALUE a, VALUE distance)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (r, T_FIXNUM);
Check_Type (g, T_FIXNUM);
static VALUE c_colors_clear (VALUE self)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
evas_object_gradient_colors_clear (*e);
static VALUE c_angle_get (VALUE self)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
return INT2FIX (evas_object_gradient_angle_get (*e));
}
static VALUE c_angle_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (val, T_FIXNUM);
void Init_Gradient (void)
{
- VALUE cGradient = rb_define_class_under (mEvas, "Gradient",
- cEvasObject);
-
- rb_define_singleton_method (cGradient, "new", c_new, 1);
- rb_define_method (cGradient, "color_add", c_color_add, 5);
- rb_define_method (cGradient, "colors_clear", c_colors_clear, 0);
- rb_define_method (cGradient, "angle", c_angle_get, 0);
- rb_define_method (cGradient, "angle=", c_angle_set, 1);
+ VALUE c = rb_define_class_under (mEvas, "Gradient", cEvasObject);
+
+ rb_define_singleton_method (c, "new", c_new, 1);
+ rb_define_method (c, "color_add", c_color_add, 5);
+ rb_define_method (c, "colors_clear", c_colors_clear, 0);
+ rb_define_method (c, "angle", c_angle_get, 0);
+ rb_define_method (c, "angle=", c_angle_set, 1);
}
/*
- * $Id: rb_image.c 32 2004-07-10 14:07:49Z tilman $
+ * $Id: rb_image.c 38 2004-07-25 11:27:25Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
Evas_Object **rect;
CHECK_CLASS (evas, cEvas);
- GET_OBJ (evas, Evas, e);
+ GET_OBJ (evas, Evas *, e);
self = Data_Make_Struct (klass, Evas_Object *, c_evas_object_mark,
c_evas_object_free, rect);
void Init_Image (void)
{
- VALUE cImage = rb_define_class_under (mEvas, "Image", cEvasObject);
+ VALUE c = rb_define_class_under (mEvas, "Image", cEvasObject);
- rb_define_singleton_method (cImage, "new", c_new, 1);
+ rb_define_singleton_method (c, "new", c_new, 1);
}
/*
- * $Id: rb_line.c 32 2004-07-10 14:07:49Z tilman $
+ * $Id: rb_line.c 38 2004-07-25 11:27:25Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
Evas_Object **rect;
CHECK_CLASS (evas, cEvas);
- GET_OBJ (evas, Evas, e);
+ GET_OBJ (evas, Evas *, e);
self = Data_Make_Struct (klass, Evas_Object *, c_evas_object_mark,
c_evas_object_free, rect);
{
int coord[4] = {0, 0, 0, 0};
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
evas_object_line_xy_get (*e, &coord[0], &coord[1],
&coord[2], &coord[3]);
static VALUE c_set_xy (VALUE self, VALUE x1, VALUE y1,
VALUE x2, VALUE y2)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (x1, T_FIXNUM);
Check_Type (y1, T_FIXNUM);
void Init_Line (void)
{
- VALUE cLine = rb_define_class_under (mEvas, "Line", cEvasObject);
+ VALUE c = rb_define_class_under (mEvas, "Line", cEvasObject);
- rb_define_singleton_method (cLine, "new", c_new, 1);
- rb_define_method (cLine, "get_xy", c_get_xy, 0);
- rb_define_method (cLine, "set_xy", c_set_xy, 4);
+ rb_define_singleton_method (c, "new", c_new, 1);
+ rb_define_method (c, "get_xy", c_get_xy, 0);
+ rb_define_method (c, "set_xy", c_set_xy, 4);
}
/*
- * $Id: rb_polygon.c 32 2004-07-10 14:07:49Z tilman $
+ * $Id: rb_polygon.c 38 2004-07-25 11:27:25Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
Evas_Object **rect;
CHECK_CLASS (evas, cEvas);
- GET_OBJ (evas, Evas, e);
+ GET_OBJ (evas, Evas *, e);
self = Data_Make_Struct (klass, Evas_Object *, c_evas_object_mark,
c_evas_object_free, rect);
static VALUE c_point_add (VALUE self, VALUE x, VALUE y)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (x, T_FIXNUM);
Check_Type (y, T_FIXNUM);
static VALUE c_points_clear (VALUE self)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
evas_object_polygon_points_clear (*e);
void Init_Polygon (void)
{
- VALUE cPolygon = rb_define_class_under (mEvas, "Polygon",
- cEvasObject);
+ VALUE c = rb_define_class_under (mEvas, "Polygon", cEvasObject);
- rb_define_singleton_method (cPolygon, "new", c_new, 1);
- rb_define_method (cPolygon, "point_add", c_point_add, 2);
- rb_define_method (cPolygon, "points_clear", c_points_clear, 0);
+ rb_define_singleton_method (c, "new", c_new, 1);
+ rb_define_method (c, "point_add", c_point_add, 2);
+ rb_define_method (c, "points_clear", c_points_clear, 0);
}
/*
- * $Id: rb_rectangle.c 32 2004-07-10 14:07:49Z tilman $
+ * $Id: rb_rectangle.c 38 2004-07-25 11:27:25Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
VALUE self, argv[1];
Evas_Object **rect;
- CHECK_CLASS(evas, cEvas);
- GET_OBJ (evas, Evas, e);
+ CHECK_CLASS (evas, cEvas);
+ GET_OBJ (evas, Evas *, e);
self = Data_Make_Struct (klass, Evas_Object *, c_evas_object_mark,
c_evas_object_free, rect);
void Init_Rectangle (void)
{
- VALUE cRect = rb_define_class_under (mEvas, "Rectangle",
- cEvasObject);
+ VALUE c = rb_define_class_under (mEvas, "Rectangle", cEvasObject);
- rb_define_singleton_method (cRect, "new", c_new, 1);
+ rb_define_singleton_method (c, "new", c_new, 1);
}
/*
- * $Id: rb_text.c 32 2004-07-10 14:07:49Z tilman $
+ * $Id: rb_text.c 38 2004-07-25 11:27:25Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
VALUE self, argv[1];
Evas_Object **rect;
- CHECK_CLASS(evas, cEvas);
- GET_OBJ (evas, Evas, e);
+ CHECK_CLASS (evas, cEvas);
+ GET_OBJ (evas, Evas *, e);
self = Data_Make_Struct (klass, Evas_Object *, c_evas_object_mark,
c_evas_object_free, rect);
{
const char *tmp;
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
if (!(tmp = evas_object_text_font_source_get (*e)))
return Qnil;
static VALUE c_font_source_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (val, T_STRING);
char *font = NULL;
Evas_Font_Size size = 0;
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
evas_object_text_font_get (*e, &font, &size);
static VALUE c_set_font (VALUE self, VALUE font, VALUE size)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (font, T_STRING);
Check_Type (font, T_FIXNUM);
{
const char *tmp;
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
if (!(tmp = evas_object_text_text_get (*e)))
return Qnil;
static VALUE c_text_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (val, T_STRING);
void Init_Text (void)
{
- VALUE cText = rb_define_class_under (mEvas, "Text", cEvasObject);
-
- rb_define_singleton_method (cText, "new", c_new, 1);
- rb_define_method (cText, "font_source", c_font_source_get, 0);
- rb_define_method (cText, "font_source=", c_font_source_set, 1);
- rb_define_method (cText, "get_font", c_get_font, 0);
- rb_define_method (cText, "set_font", c_set_font, 2);
- rb_define_method (cText, "text", c_text_get, 0);
- rb_define_method (cText, "text=", c_text_set, 1);
+ VALUE c = rb_define_class_under (mEvas, "Text", cEvasObject);
+
+ rb_define_singleton_method (c, "new", c_new, 1);
+ rb_define_method (c, "font_source", c_font_source_get, 0);
+ rb_define_method (c, "font_source=", c_font_source_set, 1);
+ rb_define_method (c, "get_font", c_get_font, 0);
+ rb_define_method (c, "set_font", c_set_font, 2);
+ rb_define_method (c, "text", c_text_get, 0);
+ rb_define_method (c, "text=", c_text_set, 1);
}