ffi-efl 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Changelog +5 -0
- data/MIT-LICENSE +2 -2
- data/README.rdoc +35 -10
- data/lib/efl/ecore_evas.rb +1 -1
- data/lib/efl/ecore_getopt.rb +183 -102
- data/lib/efl/edje.rb +7 -7
- data/lib/efl/eina_list.rb +10 -2
- data/lib/efl/elementary.rb +163 -28
- data/lib/efl/evas.rb +130 -123
- data/lib/efl/ffi.rb +33 -2
- data/lib/efl/native/ecore.rb +202 -157
- data/lib/efl/native/ecore_evas.rb +74 -71
- data/lib/efl/native/ecore_getopt.rb +4 -3
- data/lib/efl/native/ecore_input.rb +4 -3
- data/lib/efl/native/edje.rb +12 -4
- data/lib/efl/native/eet.rb +16 -3
- data/lib/efl/native/eina.rb +8 -3
- data/lib/efl/native/eina_hash.rb +6 -3
- data/lib/efl/native/eina_list.rb +4 -3
- data/lib/efl/native/eina_log.rb +4 -3
- data/lib/efl/native/eina_types.rb +4 -3
- data/lib/efl/native/elementary.rb +547 -407
- data/lib/efl/native/emap.rb +93 -0
- data/lib/efl/native/evas.rb +101 -63
- data/lib/efl.rb +1 -1
- data/spec/ecore_evas_spec.rb +2 -2
- data/spec/ecore_getopt_spec.rb +132 -145
- data/spec/ecore_input_spec.rb +10 -6
- data/spec/ecore_spec.rb +19 -13
- data/spec/edje_spec.rb +13 -11
- data/spec/eet_spec.rb +12 -10
- data/spec/eina_hash_spec.rb +6 -6
- data/spec/eina_list_spec.rb +36 -9
- data/spec/eina_log_spec.rb +12 -24
- data/spec/eina_spec.rb +22 -11
- data/spec/elm_spec.rb +17 -50
- data/spec/evas_spec.rb +14 -12
- data/tasks/gem.rake +1 -1
- data/tasks/helpers.rb +1 -1
- data/tasks/rdoc.rake +4 -4
- data/tasks/svn.rake +1 -1
- data/test/test_elm_win.rb +9 -8
- metadata +7 -6
data/spec/ecore_getopt_spec.rb
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
require 'efl/ecore'
|
5
5
|
require 'efl/ecore_evas'
|
6
6
|
require 'efl/eina_list'
|
7
|
+
require 'efl/eina_rectangle'
|
7
8
|
require 'efl/ecore_getopt'
|
8
9
|
#
|
9
10
|
describe Efl::EcoreGetopt do
|
@@ -13,247 +14,233 @@ describe Efl::EcoreGetopt do
|
|
13
14
|
end
|
14
15
|
before(:all) do
|
15
16
|
Efl::Ecore.init
|
17
|
+
end
|
18
|
+
#
|
19
|
+
before(:each) do
|
16
20
|
#
|
17
21
|
@p = Efl::EcoreGetopt::REcoreGetopt.new :prog =>"Prog", :usage => "Usage", :version => "0.0.0", :copyright => "less", :license => "MIT", :description => "description", :strict => 1
|
18
|
-
|
22
|
+
#
|
23
|
+
@callback = Proc.new do |parser, desc, string, data, storage|
|
19
24
|
parser.address.should == @p.to_ptr.address
|
20
|
-
|
25
|
+
Efl::Native::EcoreGetoptDesc.new(desc)[:shortname].chr.should == 'b'
|
26
|
+
string.should == "user_arg"
|
21
27
|
data.read_string.should == "cb_data"
|
22
|
-
|
28
|
+
storage.read_pointer.read_int.should == 69
|
29
|
+
storage.read_pointer.write_int 666
|
23
30
|
true
|
24
31
|
end
|
32
|
+
@g = Efl::Native::EinaRectangleStruct.new
|
33
|
+
@g[:x] = 100; @g[:y] = 200; @g[:w] = 300; @g[:h] = 400
|
25
34
|
#
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
:version => FFI::MemoryPointer.new(:uchar),
|
30
|
-
:help => FFI::MemoryPointer.new(:uchar),
|
31
|
-
:engines => FFI::MemoryPointer.new(:uchar),
|
32
|
-
:int => FFI::MemoryPointer.new(:int),
|
33
|
-
:double => FFI::MemoryPointer.new(:double),
|
34
|
-
:short => FFI::MemoryPointer.new(:short),
|
35
|
-
:long => FFI::MemoryPointer.new(:long),
|
36
|
-
:const => FFI::MemoryPointer.new(:int),
|
37
|
-
:true => FFI::MemoryPointer.new(:uchar),
|
38
|
-
:false => FFI::MemoryPointer.new(:uchar),
|
39
|
-
:choice => FFI::MemoryPointer.new(:pointer),
|
40
|
-
:append => FFI::MemoryPointer.new(:pointer),
|
41
|
-
:count => FFI::MemoryPointer.new(:int),
|
42
|
-
:callback => FFI::MemoryPointer.new(:int),
|
43
|
-
}
|
44
|
-
@meta1 = FFI::MemoryPointer.from_string "My pretty"
|
45
|
-
@meta2 = FFI::MemoryPointer.from_string "My precious"
|
46
|
-
@cb_data = FFI::MemoryPointer.from_string "cb_data"
|
47
|
-
#
|
48
|
-
@p.license 'L', 'license'
|
49
|
-
@p.value :boolp, @values[:license]
|
50
|
-
@p.copyright 'C', 'copyright'
|
51
|
-
@p.value :boolp, @values[:copyright]
|
35
|
+
# license and copyright share the same flag named quit
|
36
|
+
@p.license 'L', 'license', 'quit'
|
37
|
+
@p.copyright 'C', 'copyright', 'quit'
|
52
38
|
@p.version 'V', 'version'
|
53
|
-
@p.value :boolp, @values[:version]
|
54
39
|
@p.help 'H', 'help'
|
55
|
-
@p.
|
56
|
-
|
57
|
-
|
58
|
-
@p.
|
59
|
-
@p.
|
60
|
-
@p.store_type :int, 'i', 'int', 'store an integer'
|
61
|
-
@p.value :intp, @values[:int]
|
62
|
-
@p.store_meta_type :double, 'd', 'double', 'store an double+meta', @meta1
|
63
|
-
@p.value :doublep, @values[:double]
|
64
|
-
@p.store_def_type :short, 's', 'short', 'store an short+default', 6
|
65
|
-
@p.value :shortp, @values[:short]
|
66
|
-
@p.store_full_type :long, 'l', 'long', 'store a long+full', @meta2, :ecore_getopt_desc_arg_requirement_yes, 666
|
67
|
-
@p.value :longp, @values[:long]
|
68
|
-
@p.store_const 'c', 'const', 'store a constant', 123456
|
69
|
-
@p.value :intp, @values[:const]
|
40
|
+
@p.store 'i', 'int', 'store an integer', :int, 2
|
41
|
+
@p.store_meta 'd', 'double', 'store an double+meta', "My pretty meta", :double, 3.1415926
|
42
|
+
@p.store_def 's', 'string', 'store an string+default', :string, "default"
|
43
|
+
@p.store_full 'l', 'long', 'store a long+full', "My precious meta", :ecore_getopt_desc_arg_requirement_yes, :long, 666
|
44
|
+
@p.store_const 'c', 'const', 'store a constant', -666, 123456
|
70
45
|
@p.store_true 't', 'true', 'store true'
|
71
|
-
@p.value :boolp, @values[:false]
|
72
46
|
@p.store_false 'f', 'false', 'store false'
|
73
|
-
@p.
|
47
|
+
@p.count 'k', 'count', 'store count', 664
|
48
|
+
@p.append 'a', 'append', 'store append', :int, [1,2,3]
|
74
49
|
@p.choice 'm', 'many', 'store choice', ['ch1','ch2','ch3']
|
75
|
-
@p.
|
76
|
-
@p.
|
77
|
-
|
78
|
-
@p.
|
79
|
-
|
80
|
-
@p.callback_args 'b', 'callback', 'callback full', @meta1, @callback, @cb_data
|
81
|
-
@p.value :intp, @values[:callback]
|
50
|
+
@p.callback_args 'b', 'callback', 'callback full', "Another meta", @callback, "cb_data", :int, 69
|
51
|
+
@p.callback_noargs 'E', 'list-engines', 'list ecore-evas available engines',
|
52
|
+
Efl::Native.method(:ecore_getopt_callback_ecore_evas_list_engines)
|
53
|
+
@p.callback_args 'g', 'geometry', 'x:y:w:h', "X:Y:W:H",
|
54
|
+
Efl::Native.method(:ecore_getopt_callback_geometry_parse), nil, :pointer, @g
|
82
55
|
@p.create
|
83
|
-
# puts @p.debug
|
84
56
|
#
|
85
57
|
end
|
86
|
-
before(:each) do
|
87
|
-
[ :license, :copyright, :version, :help, :engines ].each do |sym|
|
88
|
-
@values[sym].write_char 0
|
89
|
-
end
|
90
|
-
@values[:int].write_int 0
|
91
|
-
@values[:double].write_double 3.1415926
|
92
|
-
@values[:short].write_short 9
|
93
|
-
@values[:long].write_long 666
|
94
|
-
@values[:const].write_int -666
|
95
|
-
@values[:true].write_uchar 1
|
96
|
-
@values[:false].write_uchar 0
|
97
|
-
@values[:choice].write_pointer FFI::Pointer::NULL
|
98
|
-
@values[:append].write_pointer FFI::Pointer::NULL
|
99
|
-
@values[:count].write_int 664
|
100
|
-
@values[:callback].write_int 99
|
101
|
-
end
|
102
58
|
#
|
103
59
|
describe "license copyright version help" do
|
60
|
+
if ENV['DEBUG']
|
61
|
+
it "DEBUG" do
|
62
|
+
puts @p.debug
|
63
|
+
end
|
64
|
+
end
|
104
65
|
it "should handle -L" do
|
105
66
|
args = @p.parse ["My lovely prog name","-L"]
|
106
|
-
@
|
67
|
+
@p['quit'].should == 1
|
107
68
|
end
|
108
69
|
it "should handle --license" do
|
109
70
|
args = @p.parse ["My lovely prog name","--license"]
|
110
|
-
@
|
71
|
+
@p['quit'].should == 1
|
111
72
|
end
|
112
73
|
it "should handle -C" do
|
113
74
|
args = @p.parse ["progname","-C"]
|
114
|
-
@
|
75
|
+
@p['quit'].should == 1
|
115
76
|
end
|
116
77
|
it "should handle --copyright" do
|
117
78
|
args = @p.parse ["My lovely prog name","--copyright"]
|
118
|
-
@
|
79
|
+
@p['quit'].should == 1
|
119
80
|
end
|
120
81
|
it "should handle -V" do
|
121
82
|
args = @p.parse ["My lovely prog name","-V"]
|
122
|
-
@
|
83
|
+
@p['V'].should == 1
|
123
84
|
end
|
124
85
|
it "should handle --version" do
|
125
86
|
args = @p.parse ["progname","--version"]
|
126
|
-
@
|
87
|
+
@p['V'].should == 1
|
127
88
|
end
|
128
89
|
it "should handle -H" do
|
129
90
|
args = @p.parse ["My lovely prog name","-H"]
|
130
|
-
@
|
91
|
+
@p['H'].should == 1
|
131
92
|
end
|
132
93
|
it "should handle --help" do
|
133
94
|
args = @p.parse ["progname","--help"]
|
134
|
-
@
|
135
|
-
end
|
136
|
-
it "should handle -E" do
|
137
|
-
args = @p.parse ["My lovely prog name","-E"]
|
138
|
-
@values[:engines].read_char.should == 1
|
139
|
-
end
|
140
|
-
it "should handle --list-engines" do
|
141
|
-
args = @p.parse ["My lovely prog name","--list-engines"]
|
142
|
-
@values[:engines].read_char.should == 1
|
95
|
+
@p['H'].should == 1
|
143
96
|
end
|
144
97
|
end
|
145
98
|
describe "simple short options" do
|
146
99
|
it "should handle -i" do
|
147
|
-
@
|
100
|
+
@p['i'].should == 2
|
148
101
|
args = @p.parse ["progname","-i 666"]
|
149
|
-
@
|
102
|
+
@p['i'].should == 666
|
150
103
|
end
|
151
104
|
it "should handle -d" do
|
152
|
-
@
|
105
|
+
@p['d'].should == 3.1415926
|
153
106
|
args = @p.parse ["progname","-d 6.66"]
|
154
|
-
@
|
107
|
+
@p['d'].should == 6.66
|
155
108
|
end
|
156
109
|
it "should handle -s" do
|
157
|
-
@
|
158
|
-
args = @p.parse ["progname","-
|
159
|
-
@
|
110
|
+
@p['s'].should == 'default'
|
111
|
+
args = @p.parse ["progname","-sset"]
|
112
|
+
@p['s'].should == 'set'
|
160
113
|
end
|
161
114
|
it "should handle -l" do
|
162
|
-
@
|
115
|
+
@p['l'].should == 666
|
163
116
|
args = @p.parse ["progname","-l 69"]
|
164
|
-
@
|
117
|
+
@p['l'].should == 69
|
165
118
|
end
|
166
119
|
it "should handle -c" do
|
167
|
-
@
|
120
|
+
@p['c'].should == -666
|
168
121
|
args = @p.parse ["progname","-c"]
|
169
|
-
@
|
122
|
+
@p['c'].should == 123456
|
170
123
|
end
|
171
124
|
it "should handle -t" do
|
172
|
-
@
|
125
|
+
@p['t'].should == 0
|
173
126
|
args = @p.parse ["progname","-t"]
|
174
|
-
@
|
127
|
+
@p['t'].should == 1
|
175
128
|
end
|
176
129
|
it "should handle -f" do
|
177
|
-
@
|
130
|
+
@p['f'].should == 1
|
178
131
|
args = @p.parse ["progname","-f"]
|
179
|
-
@
|
132
|
+
@p['f'].should == 0
|
180
133
|
end
|
181
|
-
it "should handle -
|
182
|
-
@
|
183
|
-
args = @p.parse ["progname","-
|
184
|
-
@
|
134
|
+
it "should handle -k" do
|
135
|
+
@p['k'].should == 664
|
136
|
+
args = @p.parse ["progname","-kk"]
|
137
|
+
@p['k'].should == 666
|
185
138
|
end
|
186
139
|
it "should handle -a" do
|
187
|
-
@
|
140
|
+
@p['a'].should == [1,2,3]
|
188
141
|
args = @p.parse ["progname","-a10", "-a20"]
|
189
|
-
|
190
|
-
l[0].read_int.should==10
|
191
|
-
l[1].read_int.should==20
|
142
|
+
@p['a'].should == [1,2,3,10,20]
|
192
143
|
end
|
193
|
-
it "should handle -
|
194
|
-
@
|
195
|
-
args = @p.parse ["progname","-
|
196
|
-
@
|
144
|
+
it "should handle -m" do
|
145
|
+
@p['m'].should == nil
|
146
|
+
args = @p.parse ["progname","-mch2"]
|
147
|
+
@p['m'].should == "ch2"
|
197
148
|
end
|
198
149
|
it "should handle -b" do
|
199
|
-
|
150
|
+
@p['b'].should == 69
|
151
|
+
args = @p.parse ["progname","-buser_arg"]
|
152
|
+
@p['b'].should == 666
|
153
|
+
end
|
154
|
+
it "should handle -E" do
|
155
|
+
args = @p.parse ["My lovely prog name","-E"]
|
156
|
+
@p['E'].should == 1
|
157
|
+
end
|
158
|
+
it "should handle -g" do
|
159
|
+
g = Efl::Native::EinaRectangleStruct.new @p['g']
|
160
|
+
g[:x].should == 100
|
161
|
+
g[:y].should == 200
|
162
|
+
g[:w].should == 300
|
163
|
+
g[:h].should == 400
|
164
|
+
args = @p.parse ["progname","-g=10:20:30:40"]
|
165
|
+
g = Efl::Native::EinaRectangleStruct.new @p['g']
|
166
|
+
g[:x].should == 10
|
167
|
+
g[:y].should == 20
|
168
|
+
g[:w].should == 30
|
169
|
+
g[:h].should == 40
|
200
170
|
end
|
201
171
|
end
|
202
172
|
describe "simple long options" do
|
203
173
|
it "should handle --int" do
|
204
|
-
@
|
174
|
+
@p['i'].should == 2
|
205
175
|
args = @p.parse ["progname","--int=666"]
|
206
|
-
@
|
176
|
+
@p['i'].should == 666
|
207
177
|
end
|
208
178
|
it "should handle --double" do
|
209
|
-
@
|
179
|
+
@p['d'].should == 3.1415926
|
210
180
|
args = @p.parse ["progname","--double=6.66"]
|
211
|
-
@
|
181
|
+
@p['d'].should == 6.66
|
212
182
|
end
|
213
|
-
it "should handle --
|
214
|
-
@
|
215
|
-
args = @p.parse ["progname","--
|
216
|
-
@
|
183
|
+
it "should handle --string" do
|
184
|
+
@p['s'].should == 'default'
|
185
|
+
args = @p.parse ["progname","--string=set"]
|
186
|
+
@p['s'].should == 'set'
|
217
187
|
end
|
218
188
|
it "should handle --long" do
|
219
|
-
@
|
189
|
+
@p['l'].should == 666
|
220
190
|
args = @p.parse ["progname","--long=69"]
|
221
|
-
@
|
191
|
+
@p['l'].should == 69
|
222
192
|
end
|
223
193
|
it "should handle --const" do
|
224
|
-
@
|
194
|
+
@p['c'].should == -666
|
225
195
|
args = @p.parse ["progname","--const"]
|
226
|
-
@
|
196
|
+
@p['c'].should == 123456
|
227
197
|
end
|
228
198
|
it "should handle --true" do
|
229
|
-
@
|
199
|
+
@p['t'].should == 0
|
230
200
|
args = @p.parse ["progname","--true"]
|
231
|
-
@
|
201
|
+
@p['t'].should == 1
|
232
202
|
end
|
233
203
|
it "should handle --false" do
|
234
|
-
@
|
204
|
+
@p['f'].should == 1
|
235
205
|
args = @p.parse ["progname","--false"]
|
236
|
-
@
|
206
|
+
@p['f'].should == 0
|
237
207
|
end
|
238
|
-
it "should handle --
|
239
|
-
@
|
240
|
-
args = @p.parse ["progname","--
|
241
|
-
@
|
208
|
+
it "should handle --count" do
|
209
|
+
@p['k'].should == 664
|
210
|
+
args = @p.parse ["progname","--count","--count"]
|
211
|
+
@p['k'].should == 666
|
242
212
|
end
|
243
|
-
it "should handle
|
244
|
-
@
|
213
|
+
it "should handle --append" do
|
214
|
+
@p['a'].should == [1,2,3]
|
245
215
|
args = @p.parse ["progname","--append=10", "--append=20"]
|
246
|
-
|
247
|
-
l[0].read_int.should==10
|
248
|
-
l[1].read_int.should==20
|
216
|
+
@p['a'].should == [1,2,3,10,20]
|
249
217
|
end
|
250
|
-
it "should handle --
|
251
|
-
@
|
252
|
-
args = @p.parse ["progname","--
|
253
|
-
@
|
218
|
+
it "should handle --many" do
|
219
|
+
@p['m'].should == nil
|
220
|
+
args = @p.parse ["progname","--many=ch3"]
|
221
|
+
@p['m'].should == "ch3"
|
254
222
|
end
|
255
223
|
it "should handle --callback" do
|
256
|
-
|
224
|
+
@p['b'].should == 69
|
225
|
+
args = @p.parse ["progname","--callback=user_arg"]
|
226
|
+
@p['b'].should == 666
|
227
|
+
end
|
228
|
+
it "should handle --list-engines" do
|
229
|
+
args = @p.parse ["My lovely prog name","--list-engines"]
|
230
|
+
@p['E'].should == 1
|
231
|
+
end
|
232
|
+
it "should handle --geometry" do
|
233
|
+
g = Efl::Native::EinaRectangleStruct.new @p['g']
|
234
|
+
g[:x].should == 100
|
235
|
+
g[:y].should == 200
|
236
|
+
g[:w].should == 300
|
237
|
+
g[:h].should == 400
|
238
|
+
args = @p.parse ["progname","--geometry=10:20:30:40"]
|
239
|
+
g = Efl::Native::EinaRectangleStruct.new @p['g']
|
240
|
+
g[:x].should == 10
|
241
|
+
g[:y].should == 20
|
242
|
+
g[:w].should == 30
|
243
|
+
g[:h].should == 40
|
257
244
|
end
|
258
245
|
end
|
259
246
|
end
|
data/spec/ecore_input_spec.rb
CHANGED
@@ -7,18 +7,22 @@ describe Efl::EcoreInput do
|
|
7
7
|
#
|
8
8
|
before(:all) do
|
9
9
|
EcoreInput = Efl::EcoreInput
|
10
|
+
@init = EcoreInput.init
|
11
|
+
end
|
12
|
+
after(:all) do
|
13
|
+
EcoreInput.shutdown
|
10
14
|
end
|
11
15
|
#
|
12
16
|
it "should init" do
|
13
|
-
EcoreInput.init.should == 1
|
14
|
-
EcoreInput.init.should == 2
|
15
|
-
EcoreInput.init.should == 3
|
17
|
+
EcoreInput.init.should == @init+1
|
18
|
+
EcoreInput.init.should == @init+2
|
19
|
+
EcoreInput.init.should == @init+3
|
16
20
|
end
|
17
21
|
#
|
18
22
|
it "should shutdown" do
|
19
|
-
EcoreInput.shutdown.should == 2
|
20
|
-
EcoreInput.shutdown.should == 1
|
21
|
-
EcoreInput.shutdown.should ==
|
23
|
+
EcoreInput.shutdown.should == @init+2
|
24
|
+
EcoreInput.shutdown.should == @init+1
|
25
|
+
EcoreInput.shutdown.should == @init
|
22
26
|
end
|
23
27
|
#
|
24
28
|
end
|
data/spec/ecore_spec.rb
CHANGED
@@ -22,22 +22,22 @@ describe "Efl::Ecore #{Efl::Ecore.version.full}" do
|
|
22
22
|
OK = FFI::MemoryPointer.from_string "ok"
|
23
23
|
KO = FFI::MemoryPointer.from_string "ko"
|
24
24
|
NONE = FFI::MemoryPointer.from_string "none"
|
25
|
+
@init = Ecore.init
|
26
|
+
end
|
27
|
+
after(:all) do
|
28
|
+
Ecore.shutdown
|
25
29
|
end
|
26
|
-
before(:each) {
|
27
|
-
Ecore.init==1
|
28
|
-
}
|
29
|
-
after(:each) {
|
30
|
-
Ecore.shutdown==0
|
31
|
-
}
|
32
30
|
#
|
33
31
|
it "should init" do
|
34
|
-
Ecore.init.should ==
|
35
|
-
Ecore.init.should ==
|
32
|
+
Ecore.init.should == @init+1
|
33
|
+
Ecore.init.should == @init+2
|
34
|
+
Ecore.init.should == @init+3
|
36
35
|
end
|
37
36
|
#
|
38
37
|
it "should shutdown" do
|
39
|
-
Ecore.shutdown.should == 2
|
40
|
-
Ecore.shutdown.should == 1
|
38
|
+
Ecore.shutdown.should == @init+2
|
39
|
+
Ecore.shutdown.should == @init+1
|
40
|
+
Ecore.shutdown.should == @init
|
41
41
|
end
|
42
42
|
#
|
43
43
|
it "should run a single iteration of the mainloop" do
|
@@ -60,6 +60,7 @@ describe "Efl::Ecore #{Efl::Ecore.version.full}" do
|
|
60
60
|
ecore_evt = Ecore.event_add Ecore::EVENT_SIGNAL_USER, evt, EVENT_FREE_CB, NONE
|
61
61
|
ecore_evt.null?.should be_false
|
62
62
|
Ecore.main_loop_begin # process event
|
63
|
+
Ecore.event_handler_del(evt_handler).address.should == OK.address
|
63
64
|
end
|
64
65
|
#
|
65
66
|
it "should be able to get and set event handler data" do
|
@@ -73,6 +74,7 @@ describe "Efl::Ecore #{Efl::Ecore.version.full}" do
|
|
73
74
|
ecore_evt = Ecore.event_add Ecore::EVENT_SIGNAL_USER, evt, EVENT_FREE_CB, NONE
|
74
75
|
ecore_evt.null?.should be_false
|
75
76
|
Ecore.main_loop_begin # process event
|
77
|
+
Ecore.event_handler_del(evt_handler).address.should == OK.address
|
76
78
|
end
|
77
79
|
#
|
78
80
|
it "should be able to create new event type" do
|
@@ -111,17 +113,21 @@ describe "Efl::Ecore #{Efl::Ecore.version.full}" do
|
|
111
113
|
loop_data.read_string.should == "loop_data"
|
112
114
|
end
|
113
115
|
filter = Ecore.event_filter_add start_cb, filter_cb, end_cb, OK
|
114
|
-
Ecore.event_handler_add Ecore::EVENT_SIGNAL_USER, USER_SIGNAL_CB, OK
|
116
|
+
evt_handler = Ecore.event_handler_add Ecore::EVENT_SIGNAL_USER, USER_SIGNAL_CB, OK
|
115
117
|
e1 = FFI::MemoryPointer.new(:int)
|
116
118
|
e1.write_int 69
|
117
119
|
evt1 = Ecore.event_add Ecore::EVENT_SIGNAL_USER, e1, event_free_cb, KO
|
118
120
|
e2 = FFI::MemoryPointer.new(:int)
|
119
121
|
e2.write_int 666
|
120
122
|
evt2 = Ecore.event_add Ecore::EVENT_SIGNAL_USER, e2, EVENT_FREE_CB, NONE
|
121
|
-
Ecore.main_loop_begin # process event
|
122
123
|
Ecore.event_filter_del(filter).address.should == OK.address
|
123
124
|
evt2 = Ecore.event_add Ecore::EVENT_SIGNAL_USER, e2, EVENT_FREE_CB, NONE
|
124
|
-
Ecore.
|
125
|
+
Ecore.event_handler_del(evt_handler).address.should == OK.address
|
126
|
+
Ecore.main_loop_iterate
|
127
|
+
Ecore.main_loop_iterate
|
128
|
+
Ecore.main_loop_iterate
|
129
|
+
e1.free
|
130
|
+
e2.free
|
125
131
|
end
|
126
132
|
#
|
127
133
|
describe Efl::Ecore::REcorePipe do
|
data/spec/edje_spec.rb
CHANGED
@@ -23,22 +23,24 @@ require './spec/helper'
|
|
23
23
|
#
|
24
24
|
describe "Efl::Edje #{Efl::Edje.version.full}" do
|
25
25
|
#
|
26
|
-
before(:all)
|
26
|
+
before(:all) do
|
27
27
|
Edje = Efl::Edje
|
28
|
-
Edje.init
|
29
|
-
|
30
|
-
after(:all)
|
31
|
-
Edje.shutdown
|
32
|
-
|
28
|
+
@init = Edje.init
|
29
|
+
end
|
30
|
+
after(:all) do
|
31
|
+
Edje.shutdown
|
32
|
+
end
|
33
33
|
#
|
34
34
|
it "should init" do
|
35
|
-
Edje.init.should ==
|
36
|
-
Edje.init.should ==
|
35
|
+
Edje.init.should == @init+1
|
36
|
+
Edje.init.should == @init+2
|
37
|
+
Edje.init.should == @init+3
|
37
38
|
end
|
38
39
|
#
|
39
40
|
it "should shutdown" do
|
40
|
-
Edje.shutdown.should == 2
|
41
|
-
Edje.shutdown.should == 1
|
41
|
+
Edje.shutdown.should == @init+2
|
42
|
+
Edje.shutdown.should == @init+1
|
43
|
+
Edje.shutdown.should == @init
|
42
44
|
end
|
43
45
|
#
|
44
46
|
it "frametime get/set " do
|
@@ -105,7 +107,7 @@ describe "Efl::Edje #{Efl::Edje.version.full}" do
|
|
105
107
|
after(:all) do
|
106
108
|
@e.free
|
107
109
|
@pixels.free
|
108
|
-
Efl::Evas.shutdown
|
110
|
+
Efl::Evas.shutdown
|
109
111
|
end
|
110
112
|
#
|
111
113
|
it "scale get/set " do
|
data/spec/eet_spec.rb
CHANGED
@@ -5,24 +5,28 @@ require 'efl/eet'
|
|
5
5
|
#
|
6
6
|
describe "Efl::Eet #{Efl::Eet.version.full}" do
|
7
7
|
#
|
8
|
-
before(:all)
|
8
|
+
before(:all) do
|
9
9
|
Eet = Efl::Eet
|
10
10
|
Native = Efl::Native unless Kernel.const_defined? 'Native'
|
11
11
|
REetFile = Efl::Eet::REetFile
|
12
|
-
|
12
|
+
@init = Eet.init
|
13
|
+
end
|
14
|
+
after(:all) do
|
15
|
+
Eet.shutdown
|
16
|
+
end
|
13
17
|
#
|
14
18
|
FP = '/tmp/_eet.cfg'
|
15
19
|
#
|
16
20
|
it "should init" do
|
17
|
-
Eet.init.should == 1
|
18
|
-
Eet.init.should == 2
|
19
|
-
Eet.init.should == 3
|
21
|
+
Eet.init.should == @init+1
|
22
|
+
Eet.init.should == @init+2
|
23
|
+
Eet.init.should == @init+3
|
20
24
|
end
|
21
25
|
#
|
22
26
|
it "should shutdown" do
|
23
|
-
Eet.shutdown.should == 2
|
24
|
-
Eet.shutdown.should == 1
|
25
|
-
Eet.shutdown.should ==
|
27
|
+
Eet.shutdown.should == @init+2
|
28
|
+
Eet.shutdown.should == @init+1
|
29
|
+
Eet.shutdown.should == @init
|
26
30
|
end
|
27
31
|
#
|
28
32
|
it "should clearcache" do
|
@@ -39,8 +43,6 @@ describe "Efl::Eet #{Efl::Eet.version.full}" do
|
|
39
43
|
end
|
40
44
|
#
|
41
45
|
describe Efl::Eet::REetFile do
|
42
|
-
before(:all) { Eet.init.should==1 }
|
43
|
-
after(:all) { Eet.shutdown.should==0 }
|
44
46
|
#
|
45
47
|
it "should open and close" do
|
46
48
|
f = REetFile.open FP, Native.enum_type(:eet_file_mode)[:eet_file_mode_write]
|
data/spec/eina_hash_spec.rb
CHANGED
@@ -6,17 +6,17 @@ require 'efl/eina_hash'
|
|
6
6
|
#
|
7
7
|
describe Efl::EinaHash do
|
8
8
|
#
|
9
|
-
before(:all)
|
9
|
+
before(:all) do
|
10
10
|
REinaHash = Efl::EinaHash::REinaHash
|
11
|
-
Efl::Eina.init
|
11
|
+
Efl::Eina.init
|
12
12
|
@d0 = FFI::MemoryPointer.from_string "D0"
|
13
13
|
@d1 = FFI::MemoryPointer.from_string "D1"
|
14
14
|
@d2 = FFI::MemoryPointer.from_string "D2"
|
15
15
|
@d3 = FFI::MemoryPointer.from_string "D3"
|
16
|
-
|
17
|
-
after(:all)
|
18
|
-
Efl::Eina.shutdown
|
19
|
-
|
16
|
+
end
|
17
|
+
after(:all) do
|
18
|
+
Efl::Eina.shutdown
|
19
|
+
end
|
20
20
|
#
|
21
21
|
it "should append prepend and fetch" do
|
22
22
|
h = REinaHash.new
|