-## $Id: Makefile.am 2 2004-06-19 18:55:39Z tilman $
+## $Id: Makefile.am 58 2004-08-10 14:10:02Z tilman $
SUBDIRS = m4 src
+DOC_INPUT = src/rb_evas_main.c \
+ src/rb_evas.c \
+ src/rb_evas_object.c \
+ src/rb_image.c \
+ src/rb_line.c \
+ src/rb_polygon.c \
+ src/rb_rectangle.c \
+ src/rb_text.c
+
+doc: $(DOC_INPUT)
+ rdoc $(DOC_INPUT)
+$Id: README 58 2004-08-10 14:10:02Z tilman $
+
+ruby-evas - Ruby bindings for Evas
+==================================
+
+
+About
+-----
+
+ruby-evas is a set of Ruby language bindings for Enlightenment's Canvas
+library, Evas.
+
+
+Installation
+------------
+
+Please see INSTALL.
+
+
+Documentation
+-------------
+
+To create the HTML documentation for ruby-evas, a patched version of
+rdoc is required. The necessary patches can be found at
+http://code-monkey.de/?patches
+
+After you've patched rdoc, please run "make doc" to create the HTML.
+The docs can also be found at
+http://code-monkey.de/ruby-efl-docs/evas
/*
- * $Id: rb_evas.c 49 2004-08-01 10:17:39Z tilman $
+ * $Id: rb_evas.c 58 2004-08-10 14:10:02Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
return self;
}
+/* :nodoc: */
static VALUE c_inspect (VALUE self)
{
INSPECT (self, RbEvas);
}
+/*
+ * call-seq:
+ * e.render => nil
+ *
+ * Forces a re-render of the Evas.
+ */
static VALUE c_render (VALUE self)
{
GET_OBJ (self, RbEvas, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.font_path_append(path) => nil
+ *
+ * Appends a path to the font path for <i>e</i>.
+ */
static VALUE c_font_path_append (VALUE self, VALUE path)
{
GET_OBJ (self, RbEvas, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.font_path_prepend(path) => nil
+ *
+ * Prepends a path to the font path for <i>e</i>.
+ */
static VALUE c_font_path_prepend (VALUE self, VALUE path)
{
GET_OBJ (self, RbEvas, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.font_path => array
+ *
+ * Returns the font path for <i>e</i>.
+ */
static VALUE c_font_path_get (VALUE self)
{
VALUE ary;
return ary;
}
-
+/*
+ * call-seq:
+ * e.font_cache => fixnum
+ *
+ * Returns the size of the font cache for <i>e</i>.
+ */
static VALUE c_font_cache_get (VALUE self)
{
GET_OBJ (self, RbEvas, e);
return INT2FIX (evas_font_cache_get (e->real));
}
+/*
+ * call-seq:
+ * e.font_cache(fixnum)
+ *
+ * Sets the size of the font cache for <i>e</i>.
+ */
static VALUE c_font_cache_set (VALUE self, VALUE val)
{
GET_OBJ (self, RbEvas, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.font_cache_reload => nil
+ *
+ * Flushes the font cache for <i>e</i>.
+ */
static VALUE c_font_cache_flush (VALUE self)
{
GET_OBJ (self, RbEvas, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.image_cache => fixnum
+ *
+ * Returns the size of the image cache for <i>e</i>.
+ */
static VALUE c_image_cache_get (VALUE self)
{
GET_OBJ (self, RbEvas, e);
return INT2FIX (evas_image_cache_get (e->real));
}
+/*
+ * call-seq:
+ * e.image_cache(fixnum)
+ *
+ * Sets the size of the image cache for <i>e</i>.
+ */
static VALUE c_image_cache_set (VALUE self, VALUE val)
{
GET_OBJ (self, RbEvas, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.image_cache_reload => nil
+ *
+ * Flushes the image cache for <i>e</i>.
+ */
static VALUE c_image_cache_reload (VALUE self)
{
GET_OBJ (self, RbEvas, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.image_cache_flush => nil
+ *
+ * Flushes the image cache for <i>e</i>.
+ */
static VALUE c_image_cache_flush (VALUE self)
{
GET_OBJ (self, RbEvas, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.top => evasobject
+ *
+ * Returns the <code>Evas::EvasObject</code> at the top of <i>e</i>.
+ */
static VALUE c_top_get (VALUE self)
{
Evas_Object *o;
return (VALUE) obj;
}
+/*
+ * call-seq:
+ * e.bottom => evasobject
+ *
+ * Returns the <code>Evas::EvasObject</code> at the bottom of <i>e</i>.
+ */
static VALUE c_bottom_get (VALUE self)
{
Evas_Object *o;
return (VALUE) obj;
}
+/*
+ * call-seq:
+ * e.find_object(name) => evasobject
+ *
+ * Returns the <code>Evas::EvasObject</code> with the name <i>name</i>.
+ */
static VALUE c_find_object (VALUE self, VALUE name)
{
Evas_Object *o;
/*
- * $Id: rb_evas_object.c 49 2004-08-01 10:17:39Z tilman $
+ * $Id: rb_evas_object.c 58 2004-08-10 14:10:02Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
free (e);
}
+/* :nodoc: */
static VALUE c_init (VALUE self, VALUE parent)
{
GET_OBJ (self, RbEvasObject, e);
return self;
}
+/* :nodoc: */
static VALUE c_inspect (VALUE self)
{
INSPECT (self, RbEvasObject);
}
+/*
+ * call-seq:
+ * e.delete => nil
+ *
+ * Deletes <i>e</i>.
+ */
static VALUE c_delete (VALUE self)
{
GET_OBJ (self, RbEvasObject, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.resize(width, height) => nil
+ *
+ * Resizes <i>e</i> to width x height.
+ *
+ * e.resize(100, 200) #=> nil
+ */
static VALUE c_resize (VALUE self, VALUE w, VALUE h)
{
GET_OBJ (self, RbEvasObject, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.move(x, y) => nil
+ *
+ * Moves <i>e</i> to the coordinates specified in
+ * <i>x</i> and <i>y</i>.
+ *
+ * e.move(100, 200) #=> nil
+ */
static VALUE c_move (VALUE self, VALUE x, VALUE y)
{
GET_OBJ (self, RbEvasObject, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.geometry => array
+ *
+ * Returns an array containing the geometry of <i>e</i>.
+ *
+ * e.move(150, 300) #=> nil
+ * e.resize(200, 200) #=> nil
+ * e.geometry #=> [150, 300, 200, 200]
+ */
static VALUE c_geometry_get (VALUE self)
{
int x = 0, y = 0, w = 0, h = 0;
INT2FIX (h));
}
+/*
+ * call-seq:
+ * e.show => nil
+ *
+ * Shows <i>e</i>.
+ */
static VALUE c_show (VALUE self)
{
GET_OBJ (self, RbEvasObject, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.hide => nil
+ *
+ * Hides <i>e</i>.
+ */
static VALUE c_hide (VALUE self)
{
GET_OBJ (self, RbEvasObject, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.visible? => true or false
+ *
+ * Returns true if <i>e</i> is visible, else false.
+ */
static VALUE c_visible_get (VALUE self)
{
GET_OBJ (self, RbEvasObject, e);
return evas_object_visible_get (e->real) ? Qtrue : Qfalse;
}
+/*
+ * call-seq:
+ * e.evas => evas
+ *
+ * Returns the <code>Evas::Evas</code> for <i>e</i>.
+ */
static VALUE c_evas_get (VALUE self)
{
GET_OBJ (self, RbEvasObject, e);
return e->parent;
}
+/*
+ * call-seq:
+ * e.name => string
+ *
+ * Returns the name of <i>e</i>.
+ */
static VALUE c_name_get (VALUE self)
{
const char *name;
return rb_str_new2 (name);
}
+/*
+ * call-seq:
+ * e.name(string)
+ *
+ * Sets the name of <i>e</i>.
+ */
static VALUE c_name_set (VALUE self, VALUE val)
{
GET_OBJ (self, RbEvasObject, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.layer => fixnum
+ *
+ * Returns the layer <i>e</i> is in.
+ */
static VALUE c_layer_get (VALUE self)
{
GET_OBJ (self, RbEvasObject, e);
return INT2FIX (evas_object_layer_get (e->real));
}
+/*
+ * call-seq:
+ * e.layer(fixnum)
+ *
+ * Sets the layer <i>e</i> is in.
+ */
static VALUE c_layer_set (VALUE self, VALUE val)
{
GET_OBJ (self, RbEvasObject, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.get_color => array
+ *
+ * Returns the color of <i>e</i>.
+ *
+ * e.set_color(128, 128, 128, 0) #=> nil
+ * e.get_color #=> [128, 128, 128, 0]
+ */
static VALUE c_get_color (VALUE self)
{
int r = 0, g = 0, b = 0, a = 0;
INT2FIX (a));
}
+/*
+ * 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)
{
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 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);
return Qnil;
}
+/*
+ * call-seq:
+ * e.raise => nil
+ *
+ * Raises <i>e</i>.
+ */
static VALUE c_raise (VALUE self)
{
GET_OBJ (self, RbEvasObject, e);
return Qnil;
}
+/*
+ * call-seq:
+ * e.lower => nil
+ *
+ * Lowers <i>e</i>.
+ */
static VALUE c_lower (VALUE self)
{
GET_OBJ (self, RbEvasObject, e);
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);
- if (!rb_obj_is_kind_of (target, cEvasObject)) {
- rb_raise (rb_eTypeError,
- "wrong argument type %s (expected EvasObject)",
- rb_obj_classname (target));
- return Qnil;
- }
-
+ 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);
- if (!rb_obj_is_kind_of (target, cEvasObject)) {
- rb_raise (rb_eTypeError,
- "wrong argument type %s (expected EvasObject)",
- rb_obj_classname (target));
- return Qnil;
- }
-
+ 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)
{
Evas_Object *o;
return (VALUE) obj;
}
+/*
+ * 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)
{
Evas_Object *o;
/*
- * $Id: rb_gradient.c 54 2004-08-09 10:51:39Z tilman $
+ * $Id: rb_gradient.c 58 2004-08-10 14:10:02Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
c_evas_object_free (e, true);
}
+/*
+ * call-seq:
+ * Evas::Gradient.new(evas) => gradient
+ *
+ * Creates an Evas::Gradient object.
+ */
static VALUE c_new (VALUE klass, VALUE evas)
{
VALUE self, argv[1];
return self;
}
+/*
+ * call-seq:
+ * gradient.add_color(r, g, b, a, distance) => nil
+ *
+ * Adds a color to <i>gradient</i>.
+ */
static VALUE c_add_color (VALUE self, VALUE r, VALUE g, VALUE b,
VALUE a, VALUE distance)
{
return Qnil;
}
+/*
+ * call-seq:
+ * gradient.clear_colors => nil
+ *
+ * Clears the colors of <i>gradient</i>.
+ */
static VALUE c_clear_colors (VALUE self)
{
GET_OBJ (self, RbEvasObject, e);
return Qnil;
}
+/*
+ * call-seq:
+ * gradient.angle => fixnum
+ *
+ * Returns the angle of <i>gradient</i>.
+ */
static VALUE c_angle_get (VALUE self)
{
GET_OBJ (self, RbEvasObject, e);
return INT2FIX (evas_object_gradient_angle_get (e->real));
}
+/*
+ * call-seq:
+ * gradient.angle(fixnum)
+ *
+ * Sets the angle of <i>gradient</i>.
+ */
static VALUE c_angle_set (VALUE self, VALUE val)
{
GET_OBJ (self, RbEvasObject, e);
/*
- * $Id: rb_polygon.c 54 2004-08-09 10:51:39Z tilman $
+ * $Id: rb_polygon.c 58 2004-08-10 14:10:02Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
c_evas_object_free (e, true);
}
+/*
+ * call-seq:
+ * Evas::Polygon.new(evas) => polygon
+ *
+ * Creates an new Evas::Polygon object.
+ */
static VALUE c_new (VALUE klass, VALUE evas)
{
VALUE self, argv[1];
return self;
}
+/*
+ * call-seq:
+ * polygon.add_point(x, y) => nil
+ *
+ * Adds a point to <i>polygon</i>.
+ */
static VALUE c_add_point (VALUE self, VALUE x, VALUE y)
{
GET_OBJ (self, RbEvasObject, e);
return Qnil;
}
+/*
+ * call-seq:
+ * polygon.clear_points => nil
+ *
+ * Clears the points of <i>polygon</i>.
+ */
static VALUE c_clear_points (VALUE self)
{
GET_OBJ (self, RbEvasObject, e);
/*
- * $Id: rb_rectangle.c 49 2004-08-01 10:17:39Z tilman $
+ * $Id: rb_rectangle.c 58 2004-08-10 14:10:02Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
c_evas_object_free (e, true);
}
+/*
+ * call-seq:
+ * Evas::Rectangle.new(evas) => rect
+ *
+ * Creates an Evas::Rectangle object.
+ */
static VALUE c_new (VALUE klass, VALUE evas)
{
VALUE self, argv[1];
/*
- * $Id: rb_text.c 49 2004-08-01 10:17:39Z tilman $
+ * $Id: rb_text.c 58 2004-08-10 14:10:02Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
c_evas_object_free (e, true);
}
+/*
+ * call-seq:
+ * Evas::Text.new(evas) => text
+ *
+ * Creates an Evas::Text object.
+ */
static VALUE c_new (VALUE klass, VALUE evas)
{
VALUE self, argv[1];
return self;
}
+/*
+ * call-seq:
+ * text.font_source => string or nil
+ *
+ * Returns the font source of <i>text</i>.
+ */
static VALUE c_font_source_get (VALUE self)
{
const char *tmp;
return rb_str_new2 (tmp);
}
+/*
+ * call-seq:
+ * text.font_source(source)
+ *
+ * Sets the font source of <i>text</i>.
+ */
static VALUE c_font_source_set (VALUE self, VALUE val)
{
GET_OBJ (self, RbEvasObject, e);
return Qnil;
}
+/*
+ * call-seq:
+ * text.get_font => array
+ *
+ * Returns the font name and font size of <i>text</i>.
+ *
+ * text.set_font("vera", 10) #=> nil
+ * text_get_font #=> ["vera", 10]
+ */
static VALUE c_get_font (VALUE self)
{
char *font = NULL;
INT2FIX (size));
}
+/*
+ * call-seq:
+ * text.set_font(font, size) => nil
+ *
+ * Sets the font name and font size of <i>text</i>.
+ *
+ * text.set_font("vera", 10) #=> nil
+ */
static VALUE c_set_font (VALUE self, VALUE font, VALUE size)
{
GET_OBJ (self, RbEvasObject, e);
return Qnil;
}
+/*
+ * call-seq:
+ * text.text => string
+ *
+ * Returns the text of <i>text</i>.
+ */
static VALUE c_text_get (VALUE self)
{
const char *tmp;
return rb_str_new2 (tmp);
}
+/*
+ * call-seq:
+ * text.text(string)
+ *
+ * Sets the text of <i>text</i>.
+ */
static VALUE c_text_set (VALUE self, VALUE val)
{
GET_OBJ (self, RbEvasObject, e);