/*
- * $Id$
+ * $Id: rb_evas_object.c 2 2004-06-19 18:55:39Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
#include "rb_evas_object.h"
-#define GET_OBJ(obj, e) \
- Evas_Object **(e) = NULL; \
+#define GET_OBJ(obj, type, o, desc) \
+ type **(o) = NULL; \
\
- Data_Get_Struct ((obj), Evas_Object *, (e)); \
+ Data_Get_Struct ((obj), type *, (o)); \
\
- if (!*(e)) { \
- rb_raise (rb_eException, "EvasObject destroyed already"); \
+ if (!*(o)) { \
+ rb_raise (rb_eException, desc " destroyed already"); \
return Qnil; \
}
static VALUE c_init (VALUE self, VALUE parent)
{
- GET_OBJ (self, e);
+ GET_OBJ (self, Evas_Object, e, "EvasObject");
rb_hash_aset (parents, INT2NUM ((long) e), parent);
static VALUE c_delete (VALUE self)
{
- GET_OBJ (self, e);
+ GET_OBJ (self, Evas_Object, e, "EvasObject");
if (*e) {
evas_object_del (*e);
static VALUE c_resize (VALUE self, VALUE w, VALUE h)
{
- GET_OBJ (self, e);
+ GET_OBJ (self, Evas_Object, e, "EvasObject");
Check_Type (w, T_FIXNUM);
Check_Type (h, T_FIXNUM);
static VALUE c_show (VALUE self)
{
- GET_OBJ (self, e);
+ GET_OBJ (self, Evas_Object, e, "EvasObject");
evas_object_show (*e);
static VALUE c_hide (VALUE self)
{
- GET_OBJ (self, e);
+ GET_OBJ (self, Evas_Object, e, "EvasObject");
evas_object_hide (*e);
static VALUE c_is_visible (VALUE self)
{
- GET_OBJ (self, e);
+ GET_OBJ (self, Evas_Object, e, "EvasObject");
return evas_object_visible_get (*e) ? Qtrue : Qfalse;
}