ffi-efl 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +2 -0
- data/MIT-LICENSE +18 -0
- data/README.rdoc +56 -0
- data/Rakefile +56 -0
- data/lib/efl/ecore/ecore-ffi.rb +390 -0
- data/lib/efl/ecore/ecore_evas-ffi.rb +378 -0
- data/lib/efl/ecore/ecore_getopt-ffi.rb +68 -0
- data/lib/efl/ecore/ecore_input-ffi.rb +78 -0
- data/lib/efl/ecore.rb +34 -0
- data/lib/efl/ecore_getopt.rb +43 -0
- data/lib/efl/edje/edje-ffi.rb +459 -0
- data/lib/efl/edje.rb +12 -0
- data/lib/efl/eet/eet-ffi.rb +333 -0
- data/lib/efl/eet.rb +58 -0
- data/lib/efl/eina/eina_types-ffi.rb +44 -0
- data/lib/efl/elementary/elementary-ffi.rb +3179 -0
- data/lib/efl/elementary.rb +43 -0
- data/lib/efl/evas/evas-ffi.rb +1294 -0
- data/lib/efl/evas.rb +108 -0
- data/lib/efl/ffi.rb +63 -0
- data/lib/efl.rb +14 -0
- data/spec/ecore_getopt_spec.rb +43 -0
- data/spec/ecore_spec.rb +151 -0
- data/spec/edje_spec.rb +22 -0
- data/spec/eet_spec.rb +107 -0
- data/spec/evas_spec.rb +103 -0
- data/tasks/ann.rake +83 -0
- data/tasks/constants.rb +114 -0
- data/tasks/ffi.rake +22 -0
- data/tasks/gem.rake +197 -0
- data/tasks/git.rake +38 -0
- data/tasks/helpers.rb +130 -0
- data/tasks/notes.rake +27 -0
- data/tasks/post_load.rake +35 -0
- data/tasks/rdoc.rake +46 -0
- data/tasks/rubyforge.rake +54 -0
- data/tasks/setup.rb +129 -0
- data/tasks/spec.rake +44 -0
- data/tasks/svn.rake +48 -0
- data/tasks/test.rake +41 -0
- data/test/test_elm_win.rb +38 -0
- data/test/test_elm_win_class.rb +49 -0
- metadata +124 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
# -*- coding: UTF-8 -*-
|
3
|
+
#
|
4
|
+
require 'efl/evas'
|
5
|
+
require 'efl/elementary/elementary-ffi'
|
6
|
+
#
|
7
|
+
module Efl
|
8
|
+
module Elm
|
9
|
+
#
|
10
|
+
class << self
|
11
|
+
def init *args
|
12
|
+
a = args.select { |e| e.is_a? String }
|
13
|
+
return Efl::API.elm_init 0, FFI::MemoryPointer::NULL if a.length==0
|
14
|
+
ptr = FFI::MemoryPointer.new :pointer, a.length
|
15
|
+
a.each_with_index do |s,i|
|
16
|
+
ptr[i].write_pointer FFI::MemoryPointer.from_string(s)
|
17
|
+
end
|
18
|
+
Efl::API.elm_init a.length, ptr
|
19
|
+
end
|
20
|
+
end
|
21
|
+
#
|
22
|
+
class ElmWin
|
23
|
+
include Efl::Helper
|
24
|
+
@func_prefixes = [ 'elm_win_', 'elm_' ].freeze
|
25
|
+
def initialize parent, title, type=:elm_win_basic
|
26
|
+
@evas_object = Evas::EvasObject.new Efl::API.elm_win_add parent, title, type
|
27
|
+
@ptr = @evas_object.ptr
|
28
|
+
yield self,@evas_object if block_given?
|
29
|
+
end
|
30
|
+
def add e
|
31
|
+
eo = Evas::EvasObject.new Efl::API.send "elm_#{e}_add", @ptr
|
32
|
+
yield eo if block_given?
|
33
|
+
eo
|
34
|
+
end
|
35
|
+
def smart_callback_add event_str, cb, data=FFI::MemoryPointer::NULL
|
36
|
+
Efl::API.evas_object_smart_callback_add @ptr, event_str, cb, data
|
37
|
+
end
|
38
|
+
end
|
39
|
+
#
|
40
|
+
end
|
41
|
+
end
|
42
|
+
#
|
43
|
+
# EOF
|