/*
- * $Id: rb_edje.c 31 2004-07-10 14:06:07Z tilman $
+ * $Id: rb_edje.c 37 2004-07-25 11:19:48Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
#include "rb_edje_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; \
}
Evas_Object **edje;
CHECK_CLASS (evas, cEvas);
- GET_OBJ (evas, Evas, e);
+ GET_OBJ (evas, Evas *, e);
edje_init ();
static VALUE c_load (VALUE self, VALUE eet, VALUE group)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (eet, T_STRING);
Check_Type (group, T_STRING);
{
int w = 0, h = 0;
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
edje_object_size_min_get (*e, &w, &h);
{
int w = 0, h = 0;
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
edje_object_size_max_get (*e, &w, &h);
{
int r;
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (part, T_STRING);
static VALUE c_part_swallow (VALUE self, VALUE part, VALUE target)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (part, T_STRING);
CHECK_CLASS (target, cEvasObject);
- GET_OBJ (target, Evas_Object, target2);
+ GET_OBJ (target, Evas_Object *, target2);
edje_object_part_swallow (*e, StringValuePtr (part), *target2);
static VALUE c_part_unswallow (VALUE self, VALUE target)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
CHECK_CLASS (target, cEvasObject);
- GET_OBJ (target, Evas_Object, target2);
+ GET_OBJ (target, Evas_Object *, target2);
edje_object_part_unswallow (*e, *target2);
Evas_Object *o;
void *obj;
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (part, T_STRING);
{
const char *s;
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (part, T_STRING);
static VALUE c_set_part_text (VALUE self, VALUE part, VALUE text)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (part, T_STRING);
Check_Type (text, T_STRING);
static VALUE c_on_text_changed (VALUE self)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
if (!rb_block_given_p ())
return Qnil;
static VALUE c_signal_emit (VALUE self, VALUE emission, VALUE source)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (emission, T_STRING);
Check_Type (source, T_STRING);
static VALUE c_on_signal (VALUE self, VALUE signal, VALUE src)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
Check_Type (signal, T_STRING);
Check_Type (src, T_STRING);
static VALUE c_play_get (VALUE self)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
return edje_object_play_get (*e) ? Qtrue : Qfalse;
}
static VALUE c_play_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
CHECK_BOOL(val);
static VALUE c_animation_get (VALUE self)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
return edje_object_animation_get (*e) ? Qtrue : Qfalse;
}
static VALUE c_animation_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Evas_Object, e);
+ GET_OBJ (self, Evas_Object *, e);
CHECK_BOOL(val);
void Init_Edje (void)
{
- VALUE cEdje = rb_define_class_under (mEdje, "Edje", cEvasObject);
-
- rb_define_singleton_method (cEdje, "new", c_new, 1);
- rb_define_method (cEdje, "load", c_load, 2);
- rb_define_method (cEdje, "get_size_min", c_get_size_min, 0);
- rb_define_method (cEdje, "get_size_max", c_get_size_max, 0);
- rb_define_method (cEdje, "part_exists?", c_part_exists_get, 1);
- rb_define_method (cEdje, "part_swallow", c_part_swallow, 2);
- rb_define_method (cEdje, "part_unswallow", c_part_unswallow, 1);
- rb_define_method (cEdje, "get_part_swallow", c_get_part_swallow, 1);
- rb_define_method (cEdje, "get_part_text", c_get_part_text, 1);
- rb_define_method (cEdje, "set_part_text", c_set_part_text, 2);
- rb_define_method (cEdje, "on_text_changed", c_on_text_changed, 0);
- rb_define_method (cEdje, "signal_emit", c_signal_emit, 1);
- rb_define_method (cEdje, "on_signal", c_on_signal, 2);
- rb_define_method (cEdje, "play?", c_play_get, 0);
- rb_define_method (cEdje, "play=", c_play_set, 1);
- rb_define_method (cEdje, "animation?", c_animation_get, 0);
- rb_define_method (cEdje, "animation=", c_animation_set, 1);
+ VALUE c = rb_define_class_under (mEdje, "Edje", cEvasObject);
+
+ rb_define_singleton_method (c, "new", c_new, 1);
+ rb_define_method (c, "load", c_load, 2);
+ rb_define_method (c, "get_size_min", c_get_size_min, 0);
+ rb_define_method (c, "get_size_max", c_get_size_max, 0);
+ rb_define_method (c, "part_exists?", c_part_exists_get, 1);
+ rb_define_method (c, "part_swallow", c_part_swallow, 2);
+ rb_define_method (c, "part_unswallow", c_part_unswallow, 1);
+ rb_define_method (c, "get_part_swallow", c_get_part_swallow, 1);
+ rb_define_method (c, "get_part_text", c_get_part_text, 1);
+ rb_define_method (c, "set_part_text", c_set_part_text, 2);
+ rb_define_method (c, "on_text_changed", c_on_text_changed, 0);
+ rb_define_method (c, "signal_emit", c_signal_emit, 1);
+ rb_define_method (c, "on_signal", c_on_signal, 2);
+ rb_define_method (c, "play?", c_play_get, 0);
+ rb_define_method (c, "play=", c_play_set, 1);
+ rb_define_method (c, "animation?", c_animation_get, 0);
+ rb_define_method (c, "animation=", c_animation_set, 1);
}