summaryrefslogtreecommitdiffstats
path: root/lib/efl/evas.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-05-06 09:43:35 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-05-06 09:43:35 +0200
commite70f8fdfbb74919d38392123b26a764db3561192 (patch)
treede9aea7eba773ea6ff6e01dbc6f717dfb099976e /lib/efl/evas.rb
parentbe6a692686130aaed436812ac85eaf854e11c902 (diff)
downloadffi-efl-e70f8fdfbb74919d38392123b26a764db3561192.zip
ffi-efl-e70f8fdfbb74919d38392123b26a764db3561192.tar.gz
replace REvas.object_add with REvas.object_xxx_add
Diffstat (limited to 'lib/efl/evas.rb')
-rw-r--r--lib/efl/evas.rb36
1 files changed, 22 insertions, 14 deletions
diff --git a/lib/efl/evas.rb b/lib/efl/evas.rb
index 258efa6..942fc4e 100644
--- a/lib/efl/evas.rb
+++ b/lib/efl/evas.rb
@@ -71,20 +71,23 @@ module Efl
REvas.release @ptr
@ptr=nil
end
- def object_add t
- ts = t.to_s
- o = (
- case ts
- when 'rectangle'
- Evas::REvasRectangle.new Native.evas_object_rectangle_add @ptr
- when 'line'
- Evas::REvasLine.new Native.evas_object_line_add @ptr
- when 'polygon'
- Evas::REvasPolygon.new Native.evas_object_polygon_add @ptr
- else
- raise NameError.new "unknown or not implemented yet evas_object type #{ts}"
- end
- )
+ def object_rectangle_add
+ o = Evas::REvasRectangle.new FFI::AutoPointer.new Native.evas_object_rectangle_add(@ptr), REvasObject.method(:release)
+ yield o if block_given?
+ o
+ end
+ def object_line_add
+ o = Evas::REvasLine.new FFI::AutoPointer.new Native.evas_object_line_add(@ptr), REvasObject.method(:release)
+ yield o if block_given?
+ o
+ end
+ def object_polygon_add
+ o = Evas::REvasPolygon.new FFI::AutoPointer.new Native.evas_object_polygon_add(@ptr), REvasObject.method(:release)
+ yield o if block_given?
+ o
+ end
+ def object_text_add
+ o = Evas::REvasText.new FFI::AutoPointer.new Native.evas_object_text_add(@ptr), REvasObject.method(:release)
yield o if block_given?
o
end
@@ -273,6 +276,11 @@ module Efl
#
end
#
+ class REvasText < REvasObject
+ #
+ search_prefixes 'evas_object_text_'
+ #
+ end
end
end
#