From fde67dfa8d874cd0bfac6c7cb56ada2008a43af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 3 May 2011 17:39:50 +0200 Subject: add REvasObject #geometry, #size, #size= #color, add block handling in #object_add --- lib/efl/evas.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/efl/evas.rb b/lib/efl/evas.rb index cba94ce..0dcbd86 100644 --- a/lib/efl/evas.rb +++ b/lib/efl/evas.rb @@ -68,7 +68,9 @@ module Efl @ptr=nil end def object_add t - Efl::Evas::REvasObject.new Efl::Evas.send "evas_object_#{t}_add", @ptr + r = Efl::Evas::REvasObject.new Efl::Evas.send "evas_object_#{t.to_s}_add", @ptr + yield r if block_given? + r end def output_size_get x = FFI::MemoryPointer.new :int @@ -132,6 +134,13 @@ module Efl Efl::Evas.evas_object_geometry_get @ptr, x, y, w, h [ x.read_int, y.read_int, w.read_int, h.read_int ] end + alias :geometry :geometry_get + def size + geometry_get[2..-1] + end + def size= wh + Efl::Evas.evas_object_resize @ptr, *wh + end def color_get r = FFI::MemoryPointer.new :int g = FFI::MemoryPointer.new :int @@ -140,6 +149,7 @@ module Efl Efl::Evas.evas_object_color_get @ptr, r, g, b, a [ r.read_int, g.read_int, b.read_int, a.read_int ] end + alias :color :color_get end end end -- cgit v1.1-2-g2b99