From: Tilman Sauerbeck Date: Wed, 6 Sep 2006 19:38:45 +0000 (+0000) Subject: Added Ecore::Evas::EcoreEvas#has_alpha? and #has_alpha=. X-Git-Url: http://git.code-monkey.de/?p=ruby-ecore.git;a=commitdiff_plain;h=d907bd016f15dc5be72d12ee1742047eafc2abae Added Ecore::Evas::EcoreEvas#has_alpha? and #has_alpha=. --- diff --git a/src/ecore_evas/rb_ecore_evas.c b/src/ecore_evas/rb_ecore_evas.c index e51a4f4..c2d17f0 100644 --- a/src/ecore_evas/rb_ecore_evas.c +++ b/src/ecore_evas/rb_ecore_evas.c @@ -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 ee 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 ee 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);