diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-02-27 15:48:45 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-02-27 15:48:45 +0100 |
commit | ef44077310b4ebf8d3cb31ccb57d15b96a94c9d3 (patch) | |
tree | c2bb690ccc1be37c03f6dcdcf892fbf3e17f5067 /lib/efl/evas.rb | |
parent | dbb2c5713e11489dfaeb318a82785017f1794dde (diff) | |
parent | b030c490265bb13ee98a650da419a033495042ed (diff) | |
download | ffi-efl-ef44077310b4ebf8d3cb31ccb57d15b96a94c9d3.zip ffi-efl-ef44077310b4ebf8d3cb31ccb57d15b96a94c9d3.tar.gz |
Merge branch 'wip'
Conflicts:
tools/genruby.rb
Diffstat (limited to 'lib/efl/evas.rb')
-rw-r--r-- | lib/efl/evas.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/efl/evas.rb b/lib/efl/evas.rb index aaebc4d..e65a710 100644 --- a/lib/efl/evas.rb +++ b/lib/efl/evas.rb @@ -1,13 +1,14 @@ #! /usr/bin/env ruby # -*- coding: UTF-8 -*- # +require 'efl' require 'efl/native/evas' # module Efl # module Native # - callback :new_update_region_cb, [:int, :int, :int, :int, :int_p], :pointer + callback :new_update_region_cb, [:int, :int, :int, :int, :pointer], :pointer callback :free_update_region_cb, [:int, :int, :int, :int, :pointer], :void # class EngineInfoStruct < FFI::Struct @@ -57,7 +58,7 @@ module Efl include Efl::ClassHelper search_prefixes 'evas_' # - def initialize o=nil + def initialize o=nil, &block @ptr = ( case o when NilClass @@ -68,7 +69,7 @@ module Efl raise ArgumentError.new "wrong argument #{o.class.name}" end ) - yield self if block_given? + instance_eval &block if block end def self.release p Native.evas_free p @@ -132,7 +133,7 @@ module Efl include Efl::ClassHelper search_prefixes 'evas_object_', 'evas_' # - def initialize a, *args + def initialize a, *args, &block @ptr = ( case a when FFI::Pointer @@ -143,7 +144,7 @@ module Efl raise ArgumentError.new "wrong argument #{a.class.name}" end ) - yield self if block_given? + instance_eval &block if block end def self.release p Native.evas_object_del p unless p.nil? @@ -160,9 +161,9 @@ module Efl REvasObject.release @ptr @ptr=nil end - def object_box_add + def object_box_add &block o = Evas::REvasBox.new FFI::AutoPointer.new Native.evas_object_box_add_to(@ptr), REvasObject.method(:release) - yield o if block_given? + o.instance_eval &block if block o end def evas_name |