summaryrefslogtreecommitdiffstats
path: root/lib/efl/evas.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/efl/evas.rb')
-rw-r--r--lib/efl/evas.rb15
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