Class: Efl::Evas::REvasObject

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

- (REvasObject) initialize(a, *args) {|_self| ... }

Returns a new instance of REvasObject

Yields:

  • (_self)

Yield Parameters:



135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/efl/evas.rb', line 135

def initialize a, *args
    @ptr = (
        case a
        when FFI::Pointer
            a
        when Method
            FFI::AutoPointer.new a.call(*args), REvasObject.method(:release)
        else
            raise ArgumentError.new "wrong argument #{a.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)



148
149
150
# File 'lib/efl/evas.rb', line 148

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

Instance Method Details

- (Object) above_get Also known as: above



205
206
207
# File 'lib/efl/evas.rb', line 205

def above_get
    REvasObject.new Native.evas_object_above_get @ptr
end

- (Object) below_get Also known as: below



209
210
211
# File 'lib/efl/evas.rb', line 209

def below_get
    REvasObject.new Native.evas_object_below_get @ptr
end

- (Object) center_get Also known as: center



176
177
178
179
# File 'lib/efl/evas.rb', line 176

def center_get
    g = geometry_get
    [ g[0]+(g[2]/2.0), g[1]+(g[3]/2.0) ]
end

- (Object) center_set(x, y) Also known as: center=



181
182
183
184
# File 'lib/efl/evas.rb', line 181

def center_set x, y
    g = geometry_get
    move x-(g[2]/2.0), y-(g[3]/2.0)
end

- (Object) color_get Also known as: color



192
193
194
195
196
197
198
199
# File 'lib/efl/evas.rb', line 192

def color_get
    r = FFI::MemoryPointer.new :int
    g = FFI::MemoryPointer.new :int
    b = FFI::MemoryPointer.new :int
    a = FFI::MemoryPointer.new :int
    Native.evas_object_color_get @ptr, r, g, b, a
    [ r.read_int, g.read_int, b.read_int, a.read_int ]
end

- (Object) data_get(k) Also known as: data



273
274
275
276
277
# File 'lib/efl/evas.rb', line 273

def data_get k
    r = Native.evas_object_data_get @ptr, k
    return nil if r==FFI::Pointer::NULL
    r.read_string
end

- (Object) ecore_evas_get Also known as: ecore_evas



116
117
118
119
# File 'lib/efl/ecore_evas.rb', line 116

def ecore_evas_get
    # EAPI Ecore_Evas *ecore_evas_object_ecore_evas_get(Evas_Object *obj);
    EcoreEvas::REcoreEvas.new Native.ecore_evas_object_ecore_evas_get @ptr
end

- (Object) evas_get Also known as: evas



201
202
203
# File 'lib/efl/evas.rb', line 201

def evas_get
    REvas.new Native.evas_object_evas_get @ptr
end

- (Object) evas_name



161
162
163
# File 'lib/efl/evas.rb', line 161

def evas_name
    Native.evas_object_name_get @ptr
end

- (Object) evas_type



164
165
166
# File 'lib/efl/evas.rb', line 164

def evas_type
    Native.evas_object_type_get @ptr
end

- (Object) free



151
152
153
154
155
# File 'lib/efl/evas.rb', line 151

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

- (Object) geometry_get Also known as: geometry



167
168
169
170
171
172
173
174
# File 'lib/efl/evas.rb', line 167

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

- (Object) object_box_add {|o| ... }

Yields:

  • (o)


156
157
158
159
160
# File 'lib/efl/evas.rb', line 156

def object_box_add
    o = Evas::REvasBox.new FFI::AutoPointer.new Native.evas_object_box_add_to(@ptr), REvasObject.method(:release)
    yield o if block_given?
    o
end

- (Object) size



186
187
188
# File 'lib/efl/evas.rb', line 186

def size
    geometry_get[2..-1]
end

- (Object) size=(wh)



189
190
191
# File 'lib/efl/evas.rb', line 189

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

- (Object) size_hint_align_get Also known as: size_hint_align



246
247
248
249
250
251
# File 'lib/efl/evas.rb', line 246

def size_hint_align_get
    w = FFI::MemoryPointer.new :double
    h = FFI::MemoryPointer.new :double
    Native.evas_object_size_hint_align_get @ptr, w, h
    [ w.read_double, h.read_double ]
end

- (Object) size_hint_align_set_fill Also known as: size_hint_align_fill



242
243
244
# File 'lib/efl/evas.rb', line 242

def size_hint_align_set_fill
    Native.evas_object_size_hint_align_set @ptr, EVAS_HINT_FILL, EVAS_HINT_FILL
end

- (Object) size_hint_aspect_get Also known as: size_hint_aspect



234
235
236
237
238
239
240
# File 'lib/efl/evas.rb', line 234

def size_hint_aspect_get
    a = FFI::MemoryPointer.new :int
    w = FFI::MemoryPointer.new :int
    h = FFI::MemoryPointer.new :int
    Native.evas_object_size_hint_aspect_get @ptr, a, w, h
    [ Native.enum_type(:evas_aspect_control)[a.read_int], w.read_int, h.read_int ]
end

- (Object) size_hint_max_get Also known as: size_hint_max



220
221
222
223
224
225
# File 'lib/efl/evas.rb', line 220

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

- (Object) size_hint_min_get Also known as: size_hint_min



213
214
215
216
217
218
# File 'lib/efl/evas.rb', line 213

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

- (Object) size_hint_padding_get Also known as: size_hint_padding



264
265
266
267
268
269
270
271
# File 'lib/efl/evas.rb', line 264

def size_hint_padding_get
    l = FFI::MemoryPointer.new :int
    r = FFI::MemoryPointer.new :int
    t = FFI::MemoryPointer.new :int
    b = FFI::MemoryPointer.new :int
    Native.evas_object_size_hint_padding_get @ptr, l, r, t, b
    [ l.read_int, r.read_int, t.read_int, b.read_int ]
end

- (Object) size_hint_request_get Also known as: size_hint_request



227
228
229
230
231
232
# File 'lib/efl/evas.rb', line 227

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

- (Object) size_hint_weight_get Also known as: size_hint_weight



257
258
259
260
261
262
# File 'lib/efl/evas.rb', line 257

def size_hint_weight_get
    w = FFI::MemoryPointer.new :double
    h = FFI::MemoryPointer.new :double
    Native.evas_object_size_hint_weight_get @ptr, w, h
    [ w.read_double, h.read_double ]
end

- (Object) size_hint_weight_set_expand Also known as: size_hint_weight_expand



253
254
255
# File 'lib/efl/evas.rb', line 253

def size_hint_weight_set_expand
    Native.evas_object_size_hint_weight_set @ptr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
end