summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-05-03 17:39:50 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-05-03 17:39:50 +0200
commitfde67dfa8d874cd0bfac6c7cb56ada2008a43af8 (patch)
tree700e8f3f153bb2399214b4426ca855636a3d7c6d /lib
parent376c0c5913681370b38e5f44ceb7847a7e8dee03 (diff)
downloadffi-efl-fde67dfa8d874cd0bfac6c7cb56ada2008a43af8.zip
ffi-efl-fde67dfa8d874cd0bfac6c7cb56ada2008a43af8.tar.gz
add REvasObject #geometry, #size, #size= #color, add block handling in #object_add
Diffstat (limited to 'lib')
-rw-r--r--lib/efl/evas.rb12
1 files changed, 11 insertions, 1 deletions
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