diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efl/evas.rb | 5 | ||||
-rw-r--r-- | lib/efl/ffi.rb | 20 |
2 files changed, 20 insertions, 5 deletions
diff --git a/lib/efl/evas.rb b/lib/efl/evas.rb index d18cec8..bc4b0e4 100644 --- a/lib/efl/evas.rb +++ b/lib/efl/evas.rb @@ -83,6 +83,7 @@ module Efl Native.evas_output_size_get @ptr, x, y [ x.read_int, y.read_int ] end + alias :output_size :output_size_get alias :size :output_size_get def output_viewport_get x = FFI::MemoryPointer.new :int @@ -92,6 +93,7 @@ module Efl Native.evas_output_viewport_get @ptr, x, y, w, h [ x.read_int, y.read_int, w.read_int, h.read_int ] end + alias :output_viewport :output_viewport_get alias :viewport :output_viewport_get def pointer_output_xy_get x = FFI::MemoryPointer.new :int @@ -135,6 +137,9 @@ module Efl REvasObject.release @ptr @ptr=nil end + def name + Native.evas_object_name_get @ptr + end def geometry_get x = FFI::MemoryPointer.new :int y = FFI::MemoryPointer.new :int diff --git a/lib/efl/ffi.rb b/lib/efl/ffi.rb index 0f8e8e9..35ba31c 100644 --- a/lib/efl/ffi.rb +++ b/lib/efl/ffi.rb @@ -97,11 +97,21 @@ module Efl end self.class.search_prefixes.each do |p| sym = p+m_s - if Efl::Native.respond_to? sym - self.class.class_eval "def #{m} *args, █ r=#{Efl::Native.name}.#{sym}(@ptr,#{args_s}); yield r if block_given?; r; end" - return self.send m, *args, &block - elsif Efl::Native.respond_to? m - self.class.class_eval "def #{m} *args, █ r=#{Efl::Native.name}.#{m}(@ptr,#{args_s}); yield r if block_given?; r; end" + meth = ( + if Efl::Native.respond_to? sym + sym + elsif Efl::Native.respond_to? m + m + elsif Efl::Native.respond_to? sym+'_get' + sym+'_get' + elsif Efl::Native.respond_to? m+'_get' + m+'_get' + else + nil + end + ) + if not meth.nil? + self.class.class_eval "def #{m} *args, █ r=Efl::Native.#{meth}(@ptr,#{args_s}); yield r if block_given?; r; end" return self.send m, *args, &block end end |