/*
- * $Id: rb_ecore_evas.c 9 2004-06-19 19:53:47Z tilman $
+ * $Id: rb_ecore_evas.c 12 2004-06-19 20:15:40Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
#include "rb_ecore_evas_main.h"
#include "rb_ecore_evas.h"
-#define GET_OBJ(obj, ee) \
- Ecore_Evas **(ee) = NULL; \
+#define GET_OBJ(obj, type, o, desc) \
+ type **(o) = NULL; \
\
- Data_Get_Struct ((obj), Ecore_Evas *, (ee)); \
+ Data_Get_Struct ((obj), type *, (o)); \
\
- if (!*(ee)) { \
- rb_raise (rb_eException, "EcoreEvas destroyed already"); \
+ if (!*(o)) { \
+ rb_raise (rb_eException, desc " destroyed already"); \
return Qnil; \
}
static VALUE c_show (VALUE self)
{
- GET_OBJ (self, ee);
+ GET_OBJ (self, Ecore_Evas, ee, "EcoreEvas");
ecore_evas_show (*ee);
static VALUE c_hide (VALUE self)
{
- GET_OBJ (self, ee);
+ GET_OBJ (self, Ecore_Evas, ee, "EcoreEvas");
ecore_evas_hide (*ee);
static VALUE c_is_visible (VALUE self)
{
- GET_OBJ (self, ee);
+ GET_OBJ (self, Ecore_Evas, ee, "EcoreEvas");
return ecore_evas_visibility_get (*ee) ? Qtrue : Qfalse;
}
static VALUE c_evas (VALUE self)
{
- GET_OBJ (self, ee);
+ GET_OBJ (self, Ecore_Evas, ee, "EcoreEvas");
return TO_EVAS (self, ecore_evas_get (*ee));
}
static VALUE c_resize (VALUE self, VALUE w, VALUE h)
{
- GET_OBJ (self, ee);
+ GET_OBJ (self, Ecore_Evas, ee, "EcoreEvas");
Check_Type (w, T_FIXNUM);
Check_Type (h, T_FIXNUM);
{
const char *tmp;
- GET_OBJ (self, ee);
+ GET_OBJ (self, Ecore_Evas, ee, "EcoreEvas");
if (!(tmp = ecore_evas_title_get (*ee)))
return Qnil;
static VALUE c_title_set (VALUE self, VALUE val)
{
- GET_OBJ (self, ee);
+ GET_OBJ (self, Ecore_Evas, ee, "EcoreEvas");
Check_Type (val, T_STRING);
static VALUE c_borderless_get (VALUE self)
{
- GET_OBJ (self, ee);
+ GET_OBJ (self, Ecore_Evas, ee, "EcoreEvas");
return ecore_evas_borderless_get (*ee) ? Qtrue : Qfalse;
}
static VALUE c_borderless_set (VALUE self, VALUE val)
{
- GET_OBJ (self, ee);
+ GET_OBJ (self, Ecore_Evas, ee, "EcoreEvas");
/* make sure we're passed a boolean */
if (TYPE (val) != T_TRUE && TYPE (val) != T_FALSE) {
static VALUE c_delete (VALUE self)
{
- GET_OBJ (self, ee);
+ GET_OBJ (self, Ecore_Evas, ee, "EcoreEvas");
/* reap our children */
rb_gc_start ();