/*
- * $Id: rb_ecore_evas.c 352 2006-02-10 16:30:18Z tilman $
- *
* Copyright (C) 2004 ruby-ecore team (see AUTHORS)
*
* This library is free software; you can redistribute it and/or
#define CALLBACK_DEFINE_HANDLER(name) \
static void on_##name (Ecore_Evas *real) \
{ \
- VALUE self; \
- VALUE cb; \
+ VALUE self, cb; \
\
self = (VALUE) ecore_evas_data_get (real, \
RUBY_ECORE_EVAS_KEY); \
GET_OBJ (self, RbEcoreEvas, ee); \
\
- cb = rb_hash_aref (ee->callbacks, rb_str_new2 (#name)); \
+ cb = rb_hash_aref (ee->callbacks, \
+ LONG2NUM ((long) ecore_evas_callback_##name##_set)); \
rb_funcall (cb, rb_intern ("call"), 0); \
} \
if (NIL_P (ee->callbacks)) \
ee->callbacks = rb_hash_new (); \
\
- rb_hash_aset (ee->callbacks, rb_str_new2 (#name), \
+ rb_hash_aset (ee->callbacks, \
+ LONG2NUM ((long) ecore_evas_callback_##name##_set), \
rb_block_proc ()); \
\
ecore_evas_callback_##name##_set (ee->real, on_##name); \
return Qnil;
}
+/*
+ * call-seq:
+ * ee.iconified? => true or false
+ *
+ * Returns true if <i>ee</i> is iconified, else returns false.
+ */
+static VALUE c_iconified_get (VALUE self)
+{
+ GET_OBJ (self, RbEcoreEvas, ee);
+
+ return ecore_evas_iconified_get (ee->real) ? Qtrue : Qfalse;
+}
+
+/*
+ * call-seq:
+ * ee.iconified(true or false)
+ *
+ * Sets whether <i>ee</i> is iconified or not.
+ */
+static VALUE c_iconified_set (VALUE self, VALUE val)
+{
+ GET_OBJ (self, RbEcoreEvas, ee);
+
+ CHECK_BOOL (val);
+
+ ecore_evas_iconified_set (ee->real, val == Qtrue);
+
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * ee.has_alpha? => true or false
+ *
+ * Returns true if <i>ee</i> has an alpha channel, else returns false.
+ */
+static VALUE c_has_alpha_get (VALUE self)
+{
+ GET_OBJ (self, RbEcoreEvas, ee);
+
+ return ecore_evas_alpha_get (ee->real) ? Qtrue : Qfalse;
+}
+
+/*
+ * call-seq:
+ * ee.has_alpha(true or false)
+ *
+ * Sets whether <i>ee</i> has an alpha channel or not.
+ */
+static VALUE c_has_alpha_set (VALUE self, VALUE val)
+{
+ GET_OBJ (self, RbEcoreEvas, ee);
+
+ CHECK_BOOL (val);
+
+ ecore_evas_alpha_set (ee->real, val == Qtrue);
+
+ return Qnil;
+}
+
/* FIXME: this is unsafe!
* :nodoc:
*/
{
cEcoreEvas = rb_define_class_under (mEvas, "EcoreEvas", rb_cObject);
- rb_define_private_method (rb_singleton_class (cEcoreEvas),
- "new", rb_class_new_instance, -1);
rb_define_method (cEcoreEvas, "initialize", c_init, -1);
rb_define_method (cEcoreEvas, "inspect", c_inspect, 0);
rb_define_method (cEcoreEvas, "delete", c_delete, 0);
rb_define_method (cEcoreEvas, "rotation=", c_rotation_set, 1);
rb_define_method (cEcoreEvas, "name_class", c_name_class_get, 0);
rb_define_method (cEcoreEvas, "name_class=", c_name_class_set, 1);
+ rb_define_method (cEcoreEvas, "iconified?", c_iconified_get, 0);
+ rb_define_method (cEcoreEvas, "iconified=", c_iconified_set, 1);
+ rb_define_method (cEcoreEvas, "has_alpha?", c_has_alpha_get, 0);
+ rb_define_method (cEcoreEvas, "has_alpha=", c_has_alpha_set, 1);
rb_define_method (cEcoreEvas, "on_resize", c_on_resize, 0);
rb_define_method (cEcoreEvas, "on_move", c_on_move, 0);