Added Ecore::Evas::EcoreEvas#has_alpha? and #has_alpha=.
[ruby-ecore.git] / src / ecore_evas / rb_ecore_evas.c
index e51a4f42b79f5a7cce78ce4847aec0ba8249b369..c2d17f0a7f7ee42eb1a5862aef021d40cb977ad4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_ecore_evas.c 385 2006-08-20 15:21:14Z tilman $
+ * $Id: rb_ecore_evas.c 386 2006-09-06 19:38:45Z tilman $
  *
  * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
  *
@@ -585,6 +585,35 @@ static VALUE c_iconified_set (VALUE self, VALUE val)
        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:
@@ -783,6 +812,8 @@ void Init_EcoreEvas (void)
        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);