Module: Efl::Elm

Defined in:
lib/efl/elementary.rb,
lib/efl/native/elementary.rb

Defined Under Namespace

Classes: ElmBg, ElmBox, ElmDiskSelector, ElmIcon, ElmInWin, ElmLabel, ElmLayout, ElmList, ElmNotify, ElmPager, ElmPanel, ElmWin

Class Method Summary (collapse)

Class Method Details

+ (Object) init(*args)



15
16
17
18
19
20
21
22
23
# File 'lib/efl/elementary.rb', line 15

def init *args
    a = args.select { |e| e.is_a? String }
    return Native.elm_init 0, FFI::MemoryPointer::NULL if a.length==0
    ptr = FFI::MemoryPointer.new :pointer, a.length
    a.each_with_index do |s,i|
        ptr[i].write_pointer FFI::MemoryPointer.from_string(s)
    end
    Native.elm_init a.length, ptr
end

+ (Object) method_missing(m, *args, &block)



11
12
13
14
15
16
# File 'lib/efl/native/elementary.rb', line 11

def self.method_missing m, *args, &block
    sym = 'elm_'+m.to_s
    raise NameError.new "#{self.name}.#{sym} (#{m})" if not Efl::Native.respond_to? sym
    self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(*args); yield r if block_given?; r; end"
    self.send m, *args, &block
end

+ (Object) version



10
11
12
# File 'lib/efl/elementary.rb', line 10

def self.version
    Native::VersionStruct.new(Native.elm_version)
end