+/*
+ * call-seq:
+ * e.set_color(r, g, b, a) => nil
+ *
+ * Sets the color of <i>e</i>.
+ *
+ * e.set_color(128, 128, 128, 0) #=> nil
+ */
+static VALUE c_set_color (VALUE self, VALUE r, VALUE g, VALUE b,
+ VALUE a)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ Check_Type (r, T_FIXNUM);
+ Check_Type (g, T_FIXNUM);
+ Check_Type (b, T_FIXNUM);
+ Check_Type (a, T_FIXNUM);
+
+ evas_object_color_set (e->real, FIX2INT (r), FIX2INT (g),
+ FIX2INT (b), FIX2INT (a));
+
+ return Qnil;
+}
+
+static VALUE c_get_clip (VALUE self)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ return TO_EVAS_OBJECT (evas_object_clip_get (e->real));
+}
+
+static VALUE c_set_clip (VALUE self, VALUE clip)
+{
+ GET_OBJ (self, RbEvasObject, e);
+ GET_OBJ (clip, RbEvasObject, e2);
+
+ evas_object_clip_set (e->real, e2->real);
+
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * e.pass_events? => true or false
+ *
+ * Returns true if <i>e</i> passes events on to EvasObjects that are
+ * below itself, else returns false.
+ */
+static VALUE c_pass_events_get (VALUE self)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ return evas_object_pass_events_get (e->real) ? Qtrue : Qfalse;
+}
+
+/*
+ * call-seq:
+ * e.pass_events(true or false)
+ *
+ * Sets whether <i>e</i> passes events on to EvasObjects that are
+ * below itself.
+ */
+static VALUE c_pass_events_set (VALUE self, VALUE val)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ CHECK_BOOL (val);
+
+ evas_object_pass_events_set (e->real, val == Qtrue);
+
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * e.repeat_events? => true or false
+ *
+ * Returns true if <i>e</i> repeats events to EvasObjects that are
+ * below itself, else returns false.
+ */
+static VALUE c_repeat_events_get (VALUE self)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ return evas_object_repeat_events_get (e->real) ? Qtrue : Qfalse;
+}
+
+/*
+ * call-seq:
+ * e.repeat_events(true or false)
+ *
+ * Sets whether <i>e</i> repeats events to EvasObjects that are
+ * below itself.
+ */
+static VALUE c_repeat_events_set (VALUE self, VALUE val)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ CHECK_BOOL (val);
+
+ evas_object_repeat_events_set (e->real, val == Qtrue);
+
+ return Qnil;
+}
+
+static VALUE c_anti_alias_get (VALUE self)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ return evas_object_anti_alias_get (e->real) ? Qtrue : Qfalse;
+}
+
+static VALUE c_anti_alias_set (VALUE self, VALUE val)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ CHECK_BOOL (val);
+
+ evas_object_anti_alias_set (e->real, val == Qtrue);
+
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * e.raise => nil
+ *
+ * Raises <i>e</i>.
+ */
+static VALUE c_raise (VALUE self)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ evas_object_raise (e->real);
+
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * e.lower => nil
+ *
+ * Lowers <i>e</i>.
+ */
+static VALUE c_lower (VALUE self)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ evas_object_lower (e->real);
+
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * e.stack_above(evasobject) => nil
+ *
+ * Positions <i>e</i> above <i>evasobject</i>.
+ */
+static VALUE c_stack_above (VALUE self, VALUE target)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ CHECK_CLASS (target, cEvasObject);
+ GET_OBJ (target, RbEvasObject, t);
+
+ evas_object_stack_above (e->real, t->real);
+
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * e.stack_below(evasobject) => nil
+ *
+ * Positions <i>e</i> below <i>evasobject</i>.
+ */
+static VALUE c_stack_below (VALUE self, VALUE target)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ CHECK_CLASS (target, cEvasObject);
+ GET_OBJ (target, RbEvasObject, t);
+
+ evas_object_stack_below (e->real, t->real);
+
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * e.above => evasobject
+ *
+ * Returns the <code>Evas::EvasObject</code> that's positioned above
+ * <i>e</i>.
+ */
+static VALUE c_above_get (VALUE self)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ return TO_EVAS_OBJECT (evas_object_above_get (e->real));
+}
+
+/*
+ * call-seq:
+ * e.below => evasobject
+ *
+ * Returns the <code>Evas::EvasObject</code> that's positioned below
+ * <i>e</i>.
+ */
+static VALUE c_below_get (VALUE self)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ return TO_EVAS_OBJECT (evas_object_below_get (e->real));
+}
+
+static VALUE c_userdata_get (VALUE self)
+{
+ GET_OBJ (self, RbEvasObject, e);
+
+ if (NIL_P (e->userdata))
+ e->userdata = rb_hash_new ();
+
+ return e->userdata;
+}
+
+void Init_EvasObject (void)
+{
+ cEvasObject = rb_define_class_under (mEvas, "EvasObject",
+ rb_cObject);
+
+ rb_define_alloc_func (cEvasObject, c_alloc);