Class: Efl::EcoreEvas::REcoreEvas

Inherits:
Object
  • Object
show all
Includes:
ClassHelper
Defined in:
lib/efl/ecore_evas.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ClassHelper

#===, #address, included, #method_missing, #null?, #to_a, #to_ary, #to_ptr, #to_s

Constructor Details

#initialize(o = nil, &block) ⇒ REcoreEvas

Returns a new instance of REcoreEvas.


22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/efl/ecore_evas.rb', line 22

def initialize o=nil, &block
    @ptr = (
        case o
        when NilClass
            FFI::AutoPointer.new Native.ecore_evas_new(nil, 0, 0, 0, 0, nil), REcoreEvas.method(:release)
        when Hash
            FFI::AutoPointer.new Native.ecore_evas_new(o[:engine_name], o[:x], o[:y], o[:w], o[:h], o[:extra_options]), REcoreEvas.method(:release)
        when FFI::Pointer
            o
        else
            raise ArgumentError.new "wrong argument #{o.class.name}"
        end
    )
    instance_eval &block if block
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Efl::ClassHelper

Class Method Details

.release(p) ⇒ Object


37
38
39
# File 'lib/efl/ecore_evas.rb', line 37

def self.release p
    Native.ecore_evas_free p
end

Instance Method Details

#evasObject Also known as: get


90
91
92
93
# File 'lib/efl/ecore_evas.rb', line 90

def evas    # EAPI Evas *ecore_evas_get(const Ecore_Evas *ee);

    Evas::REvas.new Native.ecore_evas_get @ptr
end

#free(p = nil) ⇒ Object


40
41
42
43
44
# File 'lib/efl/ecore_evas.rb', line 40

def free p=nil
    @ptr.autorelease=false
    REcoreEvas.release @ptr
    @ptr=nil
end

#geometry_getObject Also known as: geometry


45
46
47
48
49
50
51
52
# File 'lib/efl/ecore_evas.rb', line 45

def geometry_get
    x = FFI::MemoryPointer.new :int
    y = FFI::MemoryPointer.new :int
    w = FFI::MemoryPointer.new :int
    h = FFI::MemoryPointer.new :int
    Native.ecore_evas_geometry_get @ptr, x, y, w, h
    [ x.read_int, y.read_int, w.read_int, h.read_int ]
end

#name_class_getObject


60
61
62
63
64
65
# File 'lib/efl/ecore_evas.rb', line 60

def name_class_get
    n = FFI::MemoryPointer.new :pointer
    c = FFI::MemoryPointer.new :pointer
    Native.ecore_evas_name_class_get @ptr, n, c
    [ n.read_pointer.read_string, c.read_pointer.read_string ]
end

#object_associate_getObject


99
100
101
102
# File 'lib/efl/ecore_evas.rb', line 99

def object_associate_get    # EAPI Evas_Object *ecore_evas_object_associate_get(const Ecore_Evas *ee);

    Evas::REvasObject.new Native.ecore_evas_object_associate_get @prt
end

#object_image_newObject


95
96
97
98
# File 'lib/efl/ecore_evas.rb', line 95

def object_image_new    # EAPI Evas_Object *ecore_evas_object_image_new(Ecore_Evas *ee_target);

    Evas::REvasObject.new Native.ecore_evas_object_image_new @prt
end

#sizeObject


54
55
56
# File 'lib/efl/ecore_evas.rb', line 54

def size
    geometry_get[2..-1]
end

#size=(wh) ⇒ Object


57
58
59
# File 'lib/efl/ecore_evas.rb', line 57

def size= wh
    Native.evas_object_resize @ptr, *wh
end

#size_base_getObject


78
79
80
81
82
83
# File 'lib/efl/ecore_evas.rb', line 78

def size_base_get
    w = FFI::MemoryPointer.new :int
    h = FFI::MemoryPointer.new :int
    Native.ecore_evas_size_base_get @ptr, w, h
    [ w.read_int, h.read_int ]
end

#size_max_getObject


72
73
74
75
76
77
# File 'lib/efl/ecore_evas.rb', line 72

def size_max_get
    w = FFI::MemoryPointer.new :int
    h = FFI::MemoryPointer.new :int
    Native.ecore_evas_size_max_get @ptr, w, h
    [ w.read_int, h.read_int ]
end

#size_min_getObject


66
67
68
69
70
71
# File 'lib/efl/ecore_evas.rb', line 66

def size_min_get
    w = FFI::MemoryPointer.new :int
    h = FFI::MemoryPointer.new :int
    Native.ecore_evas_size_min_get @ptr, w, h
    [ w.read_int, h.read_int ]
end

#size_step_getObject


84
85
86
87
88
89
# File 'lib/efl/ecore_evas.rb', line 84

def size_step_get
    w = FFI::MemoryPointer.new :int
    h = FFI::MemoryPointer.new :int
    Native.ecore_evas_size_step_get @ptr, w, h
    [ w.read_int, h.read_int ]
end