Class: Efl::Evas::REvas

Inherits:
Object
  • Object
show all
Includes:
ClassHelper
Defined in:
lib/efl/evas.rb,
lib/efl/edje.rb,
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

- (REvas) initialize(o = nil) {|_self| ... }

Returns a new instance of REvas

Yields:

  • (_self)

Yield Parameters:



60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/efl/evas.rb', line 60

def initialize o=nil
    @ptr = (
        case o
        when NilClass
            FFI::AutoPointer.new Native.evas_new, REvas.method(:release)
        when FFI::Pointer
            o
        else
            raise ArgumentError.new "wrong argument #{o.class.name}"
        end
    )
    yield self if block_given?
end

Dynamic Method Handling

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

Class Method Details

+ (Object) release(p)



73
74
75
# File 'lib/efl/evas.rb', line 73

def self.release p
    Native.evas_free p unless p.nil?
end

Instance Method Details

- (Object) ecore_evas_get



109
110
111
112
# File 'lib/efl/ecore_evas.rb', line 109

def ecore_evas_get
    # EAPI Ecore_Evas *ecore_evas_ecore_evas_get(const Evas *e);
    EcoreEvas::REcoreEvas.new Native.ecore_evas_ecore_evas_get @ptr
end

- (Object) edje_object_add



64
65
66
67
# File 'lib/efl/edje.rb', line 64

def edje_object_add
    # EAPI Evas_Object *edje_object_add (Evas *evas);
    Edje::REdje.new Native.edje_object_add @ptr
end

- (Object) free



76
77
78
79
80
# File 'lib/efl/evas.rb', line 76

def free
    @ptr.autorelease=false if @ptr.is_a? FFI::AutoPointer
    REvas.release @ptr
    @ptr=nil
end

- (Object) object_box_add(&block)



93
94
95
# File 'lib/efl/evas.rb', line 93

def object_box_add &block
    Evas::REvasBox.new Native.method(:evas_object_box_add), @ptr, &block
end

- (Object) object_line_add(&block)



84
85
86
# File 'lib/efl/evas.rb', line 84

def object_line_add &block
    Evas::REvasLine.new Native.method(:evas_object_line_add), @ptr, &block
end

- (Object) object_polygon_add(&block)



87
88
89
# File 'lib/efl/evas.rb', line 87

def object_polygon_add &block
    Evas::REvasPolygon.new Native.method(:evas_object_polygon_add), @ptr, &block
end

- (Object) object_rectangle_add(&block)



81
82
83
# File 'lib/efl/evas.rb', line 81

def object_rectangle_add &block
     REvasRectangle.new Native.method(:evas_object_rectangle_add), @ptr, &block
end

- (Object) object_text_add(&block)



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

def object_text_add &block
    Evas::REvasText.new Native.method(:evas_object_text_add), @ptr, &block
end

- (Object) output_size_get Also known as: output_size, size



96
97
98
99
100
101
# File 'lib/efl/evas.rb', line 96

def output_size_get
    x = FFI::MemoryPointer.new :int
    y = FFI::MemoryPointer.new :int
    Native.evas_output_size_get @ptr, x, y
    [ x.read_int, y.read_int ]
end

- (Object) output_viewport_get Also known as: output_viewport, viewport



104
105
106
107
108
109
110
111
# File 'lib/efl/evas.rb', line 104

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

- (Object) pointer_canvas_xy_get Also known as: pointer_canvas



121
122
123
124
125
126
# File 'lib/efl/evas.rb', line 121

def pointer_canvas_xy_get
    x = FFI::MemoryPointer.new :int
    y = FFI::MemoryPointer.new :int
    Native.evas_pointer_canvas_xy_get @ptr, x, y
    [ x.read_int, y.read_int ]
end

- (Object) pointer_output_xy_get Also known as: pointer_output



114
115
116
117
118
119
# File 'lib/efl/evas.rb', line 114

def pointer_output_xy_get
    x = FFI::MemoryPointer.new :int
    y = FFI::MemoryPointer.new :int
    Native.evas_pointer_output_xy_get @ptr, x, y
    [ x.read_int, y.read_int ]
end