ffi-efl 0.0.5 → 0.0.6
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 +10 -0
- data/Rakefile +1 -1
- data/lib/efl/ecore.rb +4 -0
- data/lib/efl/ecore_getopt.rb +8 -4
- data/lib/efl/edje.rb +4 -0
- data/lib/efl/eet.rb +4 -0
- data/lib/efl/eina.rb +4 -0
- data/lib/efl/eina_list.rb +2 -1
- data/lib/efl/eina_log.rb +68 -0
- data/lib/efl/elementary.rb +146 -14
- data/lib/efl/evas.rb +20 -7
- data/lib/efl/ffi.rb +18 -2
- data/lib/efl/native/ecore.rb +14 -8
- data/lib/efl/native/ecore_evas.rb +13 -12
- data/lib/efl/native/ecore_getopt.rb +7 -5
- data/lib/efl/native/ecore_input.rb +12 -10
- data/lib/efl/native/edje.rb +28 -29
- data/lib/efl/native/eet.rb +12 -13
- data/lib/efl/native/eina.rb +5 -2
- data/lib/efl/native/eina_hash.rb +2 -0
- data/lib/efl/native/eina_list.rb +2 -0
- data/lib/efl/native/eina_log.rb +102 -0
- data/lib/efl/native/eina_types.rb +2 -2
- data/lib/efl/native/elementary.rb +55 -58
- data/lib/efl/native/evas.rb +34 -39
- data/lib/efl.rb +3 -2
- data/spec/ecore_evas_spec.rb +64 -111
- data/spec/ecore_getopt_spec.rb +31 -13
- data/spec/ecore_spec.rb +3 -3
- data/spec/edje_spec.rb +21 -47
- data/spec/eet_spec.rb +3 -3
- data/spec/eina_hash_spec.rb +1 -1
- data/spec/eina_list_spec.rb +1 -1
- data/spec/eina_log_spec.rb +83 -0
- data/spec/eina_spec.rb +13 -7
- data/spec/elm_spec.rb +409 -0
- data/spec/evas_spec.rb +61 -93
- data/spec/helper.rb +72 -0
- data/test/test_edje.rb +4 -3
- data/test/{test_elm_win_class.rb → test_elm_win.rb} +13 -12
- metadata +10 -5
data/spec/evas_spec.rb
CHANGED
@@ -4,35 +4,20 @@
|
|
4
4
|
require 'efl/eina_list'
|
5
5
|
require 'efl/ecore'
|
6
6
|
require 'efl/evas'
|
7
|
+
require './spec/helper'
|
7
8
|
#
|
8
|
-
describe Efl::Evas do
|
9
|
-
#
|
10
|
-
def realize_evas
|
11
|
-
width = 800
|
12
|
-
height = 600
|
13
|
-
@pixels = FFI::MemoryPointer.new :int, width*height
|
14
|
-
@e = Evas::REvas.new
|
15
|
-
@e.output_method_set Evas::render_method_lookup("buffer")
|
16
|
-
@e.output_viewport_set 0, 0, width, height
|
17
|
-
@e.output_size_set width, height
|
18
|
-
einfo = Native::EngineInfoBufferStruct.new @e.engine_info
|
19
|
-
einfo[:info][:depth_type] = Evas::EVAS_ENGINE_BUFFER_DEPTH_ARGB32
|
20
|
-
einfo[:info][:dest_buffer] = @pixels
|
21
|
-
einfo[:info][:dest_buffer_row_bytes] = width * FFI::type_size(:int);
|
22
|
-
einfo[:info][:use_color_key] = 0;
|
23
|
-
einfo[:info][:alpha_threshold] = 0;
|
24
|
-
einfo[:info][:func][:new_update_region] = nil #FFI::Pointer::NULL;
|
25
|
-
einfo[:info][:func][:free_update_region] = nil #FFI::Pointer::NULL;
|
26
|
-
@e.engine_info_set einfo
|
27
|
-
end
|
9
|
+
describe "Efl::Evas #{Efl::Evas.version.full}" do
|
28
10
|
#
|
29
11
|
before(:all) {
|
30
12
|
Evas = Efl::Evas
|
31
13
|
Native = Efl::Native unless Kernel.const_defined? 'Native'
|
14
|
+
Evas.init.should == 1
|
15
|
+
}
|
16
|
+
after(:all) {
|
17
|
+
Evas.shutdown.should == 0
|
32
18
|
}
|
33
19
|
#
|
34
20
|
it "should init" do
|
35
|
-
Evas.init.should == 1
|
36
21
|
Evas.init.should == 2
|
37
22
|
Evas.init.should == 3
|
38
23
|
end
|
@@ -40,7 +25,6 @@ describe Efl::Evas do
|
|
40
25
|
it "should shutdown" do
|
41
26
|
Evas.shutdown.should == 2
|
42
27
|
Evas.shutdown.should == 1
|
43
|
-
Evas.shutdown.should == 0
|
44
28
|
end
|
45
29
|
#
|
46
30
|
it "evas alloc error enum is ok" do
|
@@ -56,9 +40,7 @@ describe Efl::Evas do
|
|
56
40
|
end
|
57
41
|
#
|
58
42
|
it "should have no memory allocation error occured" do
|
59
|
-
Evas.init
|
60
43
|
Evas.alloc_error.should == :evas_alloc_error_none
|
61
|
-
Evas.shutdown
|
62
44
|
end
|
63
45
|
#
|
64
46
|
it "should process async events" do
|
@@ -67,24 +49,20 @@ describe Efl::Evas do
|
|
67
49
|
type.should == :evas_callback_show
|
68
50
|
evt.read_string.should == "work"
|
69
51
|
end
|
70
|
-
Evas.init
|
71
52
|
target = FFI::MemoryPointer.from_string("target")
|
72
53
|
work = FFI::MemoryPointer.from_string("work")
|
73
54
|
Evas.async_events_put target, :evas_callback_show, work, cb
|
74
55
|
Evas.async_events_process.should == 1
|
75
56
|
Evas.async_events_process.should == 0
|
76
|
-
Evas.shutdown
|
77
57
|
end
|
78
58
|
#
|
79
59
|
describe Efl::Evas::REvas do
|
80
60
|
before(:all) do
|
81
|
-
Evas.init
|
82
61
|
realize_evas
|
83
62
|
end
|
84
63
|
after(:all) do
|
85
64
|
@e.free
|
86
65
|
@pixels.free
|
87
|
-
Evas.shutdown
|
88
66
|
end
|
89
67
|
#
|
90
68
|
it "should be able to create and destroy evas" do
|
@@ -109,7 +87,7 @@ describe Efl::Evas do
|
|
109
87
|
e4.to_ptr.should be_nil
|
110
88
|
end
|
111
89
|
#
|
112
|
-
it "focus
|
90
|
+
it "focus " do
|
113
91
|
Native.evas_focus_in @e.to_ptr
|
114
92
|
Native.evas_focus_state_get(@e.to_ptr).should be_true
|
115
93
|
Native.evas_focus_out @e.to_ptr
|
@@ -126,12 +104,12 @@ describe Efl::Evas do
|
|
126
104
|
@e.focus_state { |r| r.should be_false }
|
127
105
|
end
|
128
106
|
#
|
129
|
-
it "nochange
|
107
|
+
it "nochange " do
|
130
108
|
@e.nochange_push
|
131
109
|
@e.nochange_pop
|
132
110
|
end
|
133
111
|
#
|
134
|
-
it "attach data
|
112
|
+
it "attach data " do
|
135
113
|
data = FFI::MemoryPointer.from_string "my data"
|
136
114
|
@e.data_attach_set data
|
137
115
|
@e.data_attach.read_string.should == "my data"
|
@@ -150,7 +128,7 @@ describe Efl::Evas do
|
|
150
128
|
@e.render_dump
|
151
129
|
end
|
152
130
|
#
|
153
|
-
it "output method
|
131
|
+
it "output method " do
|
154
132
|
@e.output_method.should == Evas::render_method_lookup("buffer")
|
155
133
|
@e.output_method_get.should == Evas::render_method_lookup("buffer")
|
156
134
|
# output_method_set tested in before(:all)
|
@@ -158,12 +136,12 @@ describe Efl::Evas do
|
|
158
136
|
Evas::render_method_list_free l
|
159
137
|
end
|
160
138
|
#
|
161
|
-
it "engine info
|
139
|
+
it "engine info " do
|
162
140
|
# engine_info_get and engine_info_set tested in before(:all)
|
163
141
|
true.should be_true
|
164
142
|
end
|
165
143
|
#
|
166
|
-
it "output size
|
144
|
+
it "output size " do
|
167
145
|
@e.output_size_set 69, 666
|
168
146
|
@e.size.should == [69,666]
|
169
147
|
@e.output_size.should == [69,666]
|
@@ -172,7 +150,7 @@ describe Efl::Evas do
|
|
172
150
|
@e.size == [666,69]
|
173
151
|
end
|
174
152
|
#
|
175
|
-
it "output viewport
|
153
|
+
it "output viewport " do
|
176
154
|
@e.output_viewport_set 0, 0, 666, 69
|
177
155
|
@e.viewport.should == [0,0,666,69]
|
178
156
|
@e.output_viewport.should == [0,0,666,69]
|
@@ -181,7 +159,7 @@ describe Efl::Evas do
|
|
181
159
|
@e.viewport.should == [0,0,69,666]
|
182
160
|
end
|
183
161
|
#
|
184
|
-
it "coordinates evas<=>world
|
162
|
+
it "coordinates evas<=>world " do
|
185
163
|
@e.output_viewport_set 0, 0, 800, 600
|
186
164
|
x = @e.coord_screen_x_to_world 666
|
187
165
|
r = @e.coord_world_x_to_screen x
|
@@ -193,7 +171,7 @@ describe Efl::Evas do
|
|
193
171
|
r.should >= 67
|
194
172
|
end
|
195
173
|
#
|
196
|
-
it "freeze and thaw
|
174
|
+
it "freeze and thaw " do
|
197
175
|
@e.event_freeze?.should == 0
|
198
176
|
@e.event_freeze
|
199
177
|
@e.event_freeze?.should == 1
|
@@ -201,14 +179,14 @@ describe Efl::Evas do
|
|
201
179
|
@e.event_freeze_get.should == 0
|
202
180
|
end
|
203
181
|
#
|
204
|
-
it "up/down mouse event
|
182
|
+
it "up/down mouse event " do
|
205
183
|
@e.event_feed_mouse_down 2, :evas_button_double_click, Time.now.to_i, FFI::Pointer::NULL
|
206
184
|
@e.pointer_button_down_mask.should == 2
|
207
185
|
@e.event_feed_mouse_up 2, :evas_button_double_click, Time.now.to_i, FFI::Pointer::NULL
|
208
186
|
@e.pointer_button_down_mask_get.should == 0
|
209
187
|
end
|
210
188
|
#
|
211
|
-
it "move mouse event
|
189
|
+
it "move mouse event " do
|
212
190
|
@e.pointer_output.should == [0,0]
|
213
191
|
@e.pointer_output_xy_get.should == [0,0]
|
214
192
|
@e.pointer_canvas.should == [0,0]
|
@@ -220,7 +198,7 @@ describe Efl::Evas do
|
|
220
198
|
@e.pointer_canvas_xy_get.should == [6,6]
|
221
199
|
end
|
222
200
|
#
|
223
|
-
it "in/out mouse event
|
201
|
+
it "in/out mouse event " do
|
224
202
|
@e.pointer_inside_get.should be_false
|
225
203
|
@e.event_feed_mouse_in Time.now.to_i, FFI::Pointer::NULL
|
226
204
|
@e.pointer_inside.should be_true
|
@@ -238,7 +216,7 @@ describe Efl::Evas do
|
|
238
216
|
# evas_event_feed_key_up
|
239
217
|
# evas_event_feed_hold
|
240
218
|
#
|
241
|
-
it "add/del event callback
|
219
|
+
it "add/del event callback " do
|
242
220
|
@cb = false
|
243
221
|
kd_cb = Proc.new do |data, e, obj, event_info|
|
244
222
|
data.read_string.should eq "mouse_in"
|
@@ -259,7 +237,7 @@ describe Efl::Evas do
|
|
259
237
|
@bg.free
|
260
238
|
end
|
261
239
|
#
|
262
|
-
it "image cache functions
|
240
|
+
it "image cache functions " do
|
263
241
|
@e.image_cache_flush
|
264
242
|
@e.image_cache_reload
|
265
243
|
@e.image_cache_set 666
|
@@ -267,7 +245,7 @@ describe Efl::Evas do
|
|
267
245
|
@e.image_cache_get.should == 666
|
268
246
|
end
|
269
247
|
#
|
270
|
-
it "font functions
|
248
|
+
it "font functions " do
|
271
249
|
@e.font_hinting_set :evas_font_hinting_bytecode
|
272
250
|
@e.font_hinting.should == :evas_font_hinting_bytecode
|
273
251
|
@e.font_hinting_get.should == :evas_font_hinting_bytecode
|
@@ -288,7 +266,7 @@ describe Efl::Evas do
|
|
288
266
|
end
|
289
267
|
end
|
290
268
|
#
|
291
|
-
it "focus
|
269
|
+
it "focus " do
|
292
270
|
@e.focus.should == FFI::Pointer::NULL
|
293
271
|
@e.focus_get.should == FFI::Pointer::NULL
|
294
272
|
@o = @e.object_rectangle_add { |o|
|
@@ -303,7 +281,7 @@ describe Efl::Evas do
|
|
303
281
|
@o.free
|
304
282
|
end
|
305
283
|
#
|
306
|
-
it "object_name_find
|
284
|
+
it "object_name_find " do
|
307
285
|
@e.object_name_find("name").should == FFI::Pointer::NULL
|
308
286
|
@o = @e.object_rectangle_add
|
309
287
|
@o.name="name"
|
@@ -317,7 +295,6 @@ describe Efl::Evas do
|
|
317
295
|
describe Efl::Evas::REvasObject do
|
318
296
|
#
|
319
297
|
before(:all) do
|
320
|
-
Evas.init
|
321
298
|
realize_evas
|
322
299
|
@o = @e.object_rectangle_add { |o|
|
323
300
|
o.color = 200,200,200,200
|
@@ -330,10 +307,9 @@ describe Efl::Evas do
|
|
330
307
|
@e.free
|
331
308
|
@o.free
|
332
309
|
@pixels.free
|
333
|
-
Evas.shutdown
|
334
310
|
end
|
335
311
|
#
|
336
|
-
it "clipper
|
312
|
+
it "clipper " do
|
337
313
|
clipper = @e.object_rectangle_add
|
338
314
|
clipper.color = 255,255,255,255
|
339
315
|
clipper.move 25, 25
|
@@ -348,7 +324,7 @@ describe Efl::Evas do
|
|
348
324
|
|
349
325
|
end
|
350
326
|
#
|
351
|
-
it "focus functions
|
327
|
+
it "focus functions " do
|
352
328
|
@o.focus.should be_false
|
353
329
|
@o.focus_set true
|
354
330
|
@o.focus_get.should be_true
|
@@ -356,7 +332,7 @@ describe Efl::Evas do
|
|
356
332
|
@o.focus_get.should be_false
|
357
333
|
end
|
358
334
|
#
|
359
|
-
it "layer functions
|
335
|
+
it "layer functions " do
|
360
336
|
@o.layer.should == 0
|
361
337
|
@o.layer_set 2
|
362
338
|
@o.layer_get.should == 2
|
@@ -364,13 +340,13 @@ describe Efl::Evas do
|
|
364
340
|
@o.layer_get.should == 0
|
365
341
|
end
|
366
342
|
#
|
367
|
-
it "name functions
|
343
|
+
it "name functions " do
|
368
344
|
@o.name_set "My name"
|
369
345
|
@o.evas_name.should == "My name"
|
370
346
|
@o.name_get.should == "My name"
|
371
347
|
end
|
372
348
|
#
|
373
|
-
it "geometry functions
|
349
|
+
it "geometry functions " do
|
374
350
|
@o.geometry.should == [0,0,100,100]
|
375
351
|
@o.resize 50,50
|
376
352
|
@o.geometry.should == [0,0,50,50]
|
@@ -378,7 +354,7 @@ describe Efl::Evas do
|
|
378
354
|
@o.geometry_get.should == [10,10,50,50]
|
379
355
|
end
|
380
356
|
#
|
381
|
-
it "center
|
357
|
+
it "center " do
|
382
358
|
@o.geometry.should == [10,10,50,50]
|
383
359
|
@o.center_get.should == [35,35]
|
384
360
|
@o.center.should == [35,35]
|
@@ -387,7 +363,7 @@ describe Efl::Evas do
|
|
387
363
|
@o.geometry.should == [25,25,50,50]
|
388
364
|
end
|
389
365
|
#
|
390
|
-
it "show hide visible
|
366
|
+
it "show hide visible " do
|
391
367
|
@o.show
|
392
368
|
@o.visible?.should be_true
|
393
369
|
@o.hide
|
@@ -397,7 +373,7 @@ describe Efl::Evas do
|
|
397
373
|
@o.visible?.should be_true
|
398
374
|
end
|
399
375
|
#
|
400
|
-
it "color get/set
|
376
|
+
it "color get/set " do
|
401
377
|
@o.color.should == [200,200,200,200]
|
402
378
|
@o.color_get.should == [200,200,200,200]
|
403
379
|
@o.color_set 0,50,100,200
|
@@ -411,12 +387,12 @@ describe Efl::Evas do
|
|
411
387
|
@o.evas_get.should === @e
|
412
388
|
end
|
413
389
|
#
|
414
|
-
it "type_get
|
390
|
+
it "type_get " do
|
415
391
|
@o.evas_type.should == 'rectangle'
|
416
392
|
@o.type_get.should == 'rectangle'
|
417
393
|
end
|
418
394
|
# TODO raise, lower
|
419
|
-
it "raise, lower, stck_below, stack_above
|
395
|
+
it "raise, lower, stck_below, stack_above " do
|
420
396
|
os = []
|
421
397
|
0.upto(3) do
|
422
398
|
os << @e.object_rectangle_add
|
@@ -434,7 +410,7 @@ describe Efl::Evas do
|
|
434
410
|
os.each do |o| o.free; end
|
435
411
|
end
|
436
412
|
#
|
437
|
-
it "event_callback
|
413
|
+
it "event_callback " do
|
438
414
|
@o.move 0, 0 # FIXME why do I need this ?!?
|
439
415
|
count = 0
|
440
416
|
cb = Proc.new do |data,evas,evas_object,event_info|
|
@@ -447,7 +423,7 @@ describe Efl::Evas do
|
|
447
423
|
count.should==1
|
448
424
|
end
|
449
425
|
#
|
450
|
-
it "pass events
|
426
|
+
it "pass events " do
|
451
427
|
@o.pass_events.should be_false
|
452
428
|
@o.pass_events_set true
|
453
429
|
@o.pass_events.should be_true
|
@@ -459,7 +435,7 @@ describe Efl::Evas do
|
|
459
435
|
@o.pass_events_get.should be_false
|
460
436
|
end
|
461
437
|
#
|
462
|
-
it "repeat events
|
438
|
+
it "repeat events " do
|
463
439
|
@o.repeat_events.should be_false
|
464
440
|
@o.repeat_events_set true
|
465
441
|
@o.repeat_events.should be_true
|
@@ -471,7 +447,7 @@ describe Efl::Evas do
|
|
471
447
|
@o.repeat_events_get.should be_false
|
472
448
|
end
|
473
449
|
#
|
474
|
-
it "propagate event
|
450
|
+
it "propagate event " do
|
475
451
|
@o.propagate_events.should be_true
|
476
452
|
@o.propagate_events=false
|
477
453
|
@o.propagate_events.should be_false
|
@@ -483,7 +459,7 @@ describe Efl::Evas do
|
|
483
459
|
@o.propagate_events_get.should be_true
|
484
460
|
end
|
485
461
|
#
|
486
|
-
it "map enable
|
462
|
+
it "map enable " do
|
487
463
|
@o.map_enable.should be_false
|
488
464
|
@o.map_enable_set true
|
489
465
|
@o.map_enable.should be_true
|
@@ -495,7 +471,7 @@ describe Efl::Evas do
|
|
495
471
|
@o.map_enable_get.should be_false
|
496
472
|
end
|
497
473
|
#
|
498
|
-
it "size_hint_
|
474
|
+
it "size_hint_ " do
|
499
475
|
@o.size_hint_min_set 100, 150
|
500
476
|
@o.size_hint_min.should == [100,150]
|
501
477
|
@o.size_hint_min_get.should == [100,150]
|
@@ -519,7 +495,7 @@ describe Efl::Evas do
|
|
519
495
|
@o.size_hint_padding_get.should == [10,20,30,40]
|
520
496
|
end
|
521
497
|
#
|
522
|
-
it "data get/set
|
498
|
+
it "data get/set " do
|
523
499
|
@o.data_set "key", "val"
|
524
500
|
@o.data("key").should == "val"
|
525
501
|
@o.data_get("key").should == "val"
|
@@ -527,7 +503,7 @@ describe Efl::Evas do
|
|
527
503
|
@o.data_get("key").should == nil
|
528
504
|
end
|
529
505
|
#
|
530
|
-
it "pointer mode get/set
|
506
|
+
it "pointer mode get/set " do
|
531
507
|
@o.pointer_mode = :evas_object_pointer_mode_nograb
|
532
508
|
@o.pointer_mode.should == :evas_object_pointer_mode_nograb
|
533
509
|
@o.pointer_mode_get.should == :evas_object_pointer_mode_nograb
|
@@ -536,7 +512,7 @@ describe Efl::Evas do
|
|
536
512
|
@o.pointer_mode_get.should == :evas_object_pointer_mode_autograb
|
537
513
|
end
|
538
514
|
#
|
539
|
-
it "anti_alias get/set
|
515
|
+
it "anti_alias get/set " do
|
540
516
|
@o.anti_alias_set true
|
541
517
|
@o.anti_alias_get.should be_true
|
542
518
|
@o.anti_alias=false
|
@@ -544,7 +520,7 @@ describe Efl::Evas do
|
|
544
520
|
@o.anti_alias_get.should be_false
|
545
521
|
end
|
546
522
|
#
|
547
|
-
it "sccale set/get
|
523
|
+
it "sccale set/get " do
|
548
524
|
@o.scale_set 1.5
|
549
525
|
@o.scale_get.should == 1.5
|
550
526
|
@o.scale= 1.6
|
@@ -558,7 +534,7 @@ describe Efl::Evas do
|
|
558
534
|
@o.render_op.should == :evas_render_mask
|
559
535
|
end
|
560
536
|
#
|
561
|
-
it "precise_is_inside get/set
|
537
|
+
it "precise_is_inside get/set " do
|
562
538
|
@o.precise_is_inside_set true
|
563
539
|
@o.precise_is_inside?.should be_true
|
564
540
|
@o.precise_is_inside_get.should be_true
|
@@ -567,7 +543,7 @@ describe Efl::Evas do
|
|
567
543
|
@o.precise_is_inside.should be_false
|
568
544
|
end
|
569
545
|
#
|
570
|
-
it "static_clip get/set
|
546
|
+
it "static_clip get/set " do
|
571
547
|
@o.static_clip_set true
|
572
548
|
@o.static_clip?.should be_true
|
573
549
|
@o.static_clip_get.should be_true
|
@@ -581,16 +557,14 @@ describe Efl::Evas do
|
|
581
557
|
describe Efl::Evas::REvasLine do
|
582
558
|
#
|
583
559
|
before(:all) do
|
584
|
-
Evas.init
|
585
560
|
realize_evas
|
586
561
|
@l = @e.object_line_add
|
587
562
|
end
|
588
563
|
after(:all) do
|
589
564
|
@l.free
|
590
565
|
@e.free
|
591
|
-
Evas.shutdown
|
592
566
|
end
|
593
|
-
it "xy get/set
|
567
|
+
it "xy get/set " do
|
594
568
|
@l.line_xy_set 10, 20, 30, 40
|
595
569
|
@l.line_xy_get.should == [10, 20, 30, 40]
|
596
570
|
end
|
@@ -599,23 +573,21 @@ describe Efl::Evas do
|
|
599
573
|
describe Efl::Evas::REvasPolygon do
|
600
574
|
#
|
601
575
|
before(:all) do
|
602
|
-
Evas.init
|
603
576
|
realize_evas
|
604
577
|
@p = @e.object_polygon_add
|
605
578
|
end
|
606
579
|
after(:all) do
|
607
580
|
@p.free
|
608
581
|
@e.free
|
609
|
-
Evas.shutdown
|
610
582
|
end
|
611
|
-
it "xy point_add
|
583
|
+
it "xy point_add " do
|
612
584
|
@p.point_add 10, 20
|
613
585
|
@p.point_add 30, 40
|
614
586
|
@p.<< 50, 60
|
615
587
|
@p.<< 80, 80
|
616
588
|
end
|
617
589
|
#
|
618
|
-
it "point clear
|
590
|
+
it "point clear" do
|
619
591
|
@p.points_clear
|
620
592
|
end
|
621
593
|
end
|
@@ -623,31 +595,29 @@ describe Efl::Evas do
|
|
623
595
|
describe Efl::Evas::REvasText do
|
624
596
|
#
|
625
597
|
before(:all) do
|
626
|
-
Evas.init
|
627
598
|
realize_evas
|
628
599
|
@t = @e.object_text_add
|
629
600
|
end
|
630
601
|
after(:all) do
|
631
602
|
@t.free
|
632
603
|
@e.free
|
633
|
-
Evas.shutdown
|
634
604
|
end
|
635
605
|
#
|
636
|
-
it "font_source get/set
|
606
|
+
it "font_source get/set " do
|
637
607
|
@t.font_source_set "myFont"
|
638
608
|
@t.font_source_get.should == "myFont"
|
639
609
|
@t.font_source = "myFont2"
|
640
610
|
@t.font_source.should == "myFont2"
|
641
611
|
end
|
642
612
|
#
|
643
|
-
it "font get/set
|
613
|
+
it "font get/set " do
|
644
614
|
@t.font_set "Arial", 12
|
645
615
|
@t.font_get.should == ["Arial",12]
|
646
616
|
@t.font = "Ariall", 16
|
647
617
|
@t.font_get.should == ["Ariall",16]
|
648
618
|
end
|
649
619
|
#
|
650
|
-
it "text set/get
|
620
|
+
it "text set/get " do
|
651
621
|
@t.text_set "hello"
|
652
622
|
@t.text_get.should == "hello"
|
653
623
|
@t.text="hello world"
|
@@ -675,14 +645,14 @@ describe Efl::Evas do
|
|
675
645
|
@t.style_pad.length.should == 4
|
676
646
|
end
|
677
647
|
#
|
678
|
-
it "bidi_delimiters set/get
|
648
|
+
it "bidi_delimiters set/get " do
|
679
649
|
@t.bidi_delimiters_set "@"
|
680
650
|
@t.bidi_delimiters_get.should == "@"
|
681
651
|
@t.bidi_delimiters= "#"
|
682
652
|
@t.bidi_delimiters.should == "#"
|
683
653
|
end
|
684
654
|
#
|
685
|
-
it "char_pos_get char_coords_get last_up_to_pos
|
655
|
+
it "char_pos_get char_coords_get last_up_to_pos " do
|
686
656
|
@t.text="hello world"
|
687
657
|
coords = @t.char_pos_get 6
|
688
658
|
@t.char_coords(coords[0], coords[1])[0].should == 6
|
@@ -693,35 +663,35 @@ describe Efl::Evas do
|
|
693
663
|
@t.last_up_to_pos(coords[0], coords[1]).should == 3
|
694
664
|
end
|
695
665
|
#
|
696
|
-
it "style ste/get
|
666
|
+
it "style ste/get " do
|
697
667
|
@t.style_set :evas_text_style_shadow
|
698
668
|
@t.style_get.should == :evas_text_style_shadow
|
699
669
|
@t.style= :evas_text_style_outline
|
700
670
|
@t.style.should == :evas_text_style_outline
|
701
671
|
end
|
702
672
|
#
|
703
|
-
it "shadow_color set/get
|
673
|
+
it "shadow_color set/get " do
|
704
674
|
@t.shadow_color_set 100, 150, 200, 50
|
705
675
|
@t.shadow_color_get.should == [100, 150, 200, 50]
|
706
676
|
@t.shadow_color = 100, 150, 200, 50
|
707
677
|
@t.shadow_color.should == [100, 150, 200, 50]
|
708
678
|
end
|
709
679
|
#
|
710
|
-
it "glow_color set/get
|
680
|
+
it "glow_color set/get " do
|
711
681
|
@t.glow_color_set 100, 150, 200, 50
|
712
682
|
@t.glow_color_get.should == [100, 150, 200, 50]
|
713
683
|
@t.glow_color = 100, 150, 200, 50
|
714
684
|
@t.glow_color.should == [100, 150, 200, 50]
|
715
685
|
end
|
716
686
|
#
|
717
|
-
it "glow2_color set/get
|
687
|
+
it "glow2_color set/get " do
|
718
688
|
@t.glow2_color_set 100, 150, 200, 50
|
719
689
|
@t.glow2_color_get.should == [100, 150, 200, 50]
|
720
690
|
@t.glow2_color = 100, 150, 200, 50
|
721
691
|
@t.glow2_color.should == [100, 150, 200, 50]
|
722
692
|
end
|
723
693
|
#
|
724
|
-
it "outline_color set/get
|
694
|
+
it "outline_color set/get " do
|
725
695
|
@t.outline_color_set 100, 150, 200, 50
|
726
696
|
@t.outline_color_get.should == [100, 150, 200, 50]
|
727
697
|
@t.outline_color = 100, 150, 200, 50
|
@@ -733,7 +703,6 @@ describe Efl::Evas do
|
|
733
703
|
describe Efl::Evas::REvasBox do
|
734
704
|
#
|
735
705
|
before(:all) do
|
736
|
-
Evas.init
|
737
706
|
realize_evas
|
738
707
|
@b = @e.object_box_add
|
739
708
|
@os = []
|
@@ -744,10 +713,9 @@ describe Efl::Evas do
|
|
744
713
|
after(:all) do
|
745
714
|
@b.free
|
746
715
|
@e.free
|
747
|
-
Evas.shutdown
|
748
716
|
end
|
749
717
|
#
|
750
|
-
it "append, prepend, insert_before, insert_after, insert_at, remove, remove_at, remove_all and children_get
|
718
|
+
it "append, prepend, insert_before, insert_after, insert_at, remove, remove_at, remove_all and children_get " do
|
751
719
|
@b.append @os[4]
|
752
720
|
@b.prepend @os[0]
|
753
721
|
@b.insert_before @os[1], @os[4]
|
@@ -768,14 +736,14 @@ describe Efl::Evas do
|
|
768
736
|
@b.children.to_a.length.should == 0
|
769
737
|
end
|
770
738
|
#
|
771
|
-
it "align set/get
|
739
|
+
it "align set/get " do
|
772
740
|
@b.align_set 0.2, 0.3
|
773
741
|
@b.align_get.should == [0.2,0.3]
|
774
742
|
@b.align = 0.3, 0.2
|
775
743
|
@b.align.should == [0.3,0.2]
|
776
744
|
end
|
777
745
|
#
|
778
|
-
it "padding set/get
|
746
|
+
it "padding set/get " do
|
779
747
|
@b.padding_set 20, 30
|
780
748
|
@b.padding_get.should == [20,30]
|
781
749
|
@b.padding = 30, 20
|
data/spec/helper.rb
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
# -*- coding: UTF-8 -*-
|
3
|
+
#
|
4
|
+
require 'efl/eina'
|
5
|
+
require 'efl/evas'
|
6
|
+
require 'efl/ecore'
|
7
|
+
#
|
8
|
+
def realize_evas
|
9
|
+
width = 300
|
10
|
+
height = 200
|
11
|
+
@pixels = FFI::MemoryPointer.new :int, width*height
|
12
|
+
@e = Efl::Evas::REvas.new
|
13
|
+
@e.output_method_set Efl::Evas::render_method_lookup("buffer")
|
14
|
+
@e.output_viewport_set 0, 0, width, height
|
15
|
+
@e.output_size_set width, height
|
16
|
+
einfo = Efl::Native::EngineInfoBufferStruct.new @e.engine_info
|
17
|
+
einfo[:info][:depth_type] = Efl::Evas::EVAS_ENGINE_BUFFER_DEPTH_ARGB32
|
18
|
+
einfo[:info][:dest_buffer] = @pixels
|
19
|
+
einfo[:info][:dest_buffer_row_bytes] = width * FFI::type_size(:int);
|
20
|
+
einfo[:info][:use_color_key] = 0;
|
21
|
+
einfo[:info][:alpha_threshold] = 0;
|
22
|
+
einfo[:info][:func][:new_update_region] = nil #FFI::Pointer::NULL;
|
23
|
+
einfo[:info][:func][:free_update_region] = nil #FFI::Pointer::NULL;
|
24
|
+
@e.engine_info_set einfo
|
25
|
+
end
|
26
|
+
#
|
27
|
+
def ecore_loop n
|
28
|
+
n.downto(0) do
|
29
|
+
sleep 0.1
|
30
|
+
Efl::Ecore.main_loop_iterate
|
31
|
+
end
|
32
|
+
end
|
33
|
+
#
|
34
|
+
def bool_check t, fct, delay=nil
|
35
|
+
t.send fct+'_set', true
|
36
|
+
ecore_loop delay if delay
|
37
|
+
t.send(fct).should be_true
|
38
|
+
t.send(fct+'?').should be_true
|
39
|
+
t.send(fct+'_get').should be_true
|
40
|
+
t.send fct+'=', false
|
41
|
+
ecore_loop delay if delay
|
42
|
+
t.send(fct).should be_false
|
43
|
+
t.send(fct+'?').should be_false
|
44
|
+
t.send(fct+'_get').should be_false
|
45
|
+
end
|
46
|
+
#
|
47
|
+
def char_check t, fct, delay=nil
|
48
|
+
t.send fct+'_set', "char1"
|
49
|
+
ecore_loop delay if delay
|
50
|
+
t.send(fct).should == "char1"
|
51
|
+
t.send(fct+'?').should == "char1"
|
52
|
+
t.send(fct+'_get').should == "char1"
|
53
|
+
t.send fct+'=', "char2"
|
54
|
+
ecore_loop delay if delay
|
55
|
+
t.send(fct).should == "char2"
|
56
|
+
t.send(fct+'?').should == "char2"
|
57
|
+
t.send(fct+'_get').should == "char2"
|
58
|
+
end
|
59
|
+
#
|
60
|
+
def realize_win
|
61
|
+
@win = Elm::ElmWin.new(nil, 'TEST') do |w|
|
62
|
+
w.title= 'spec win'
|
63
|
+
w.move 100, 100
|
64
|
+
w.resize 100, 100
|
65
|
+
end
|
66
|
+
@bg = Elm::ElmBg.new(@win) do |bg|
|
67
|
+
bg.size_hint_weight_set 1.0, 1.0
|
68
|
+
bg.evas_object_color_set 200,255,100,150
|
69
|
+
bg.show
|
70
|
+
end
|
71
|
+
@win.show
|
72
|
+
end
|
data/test/test_edje.rb
CHANGED
@@ -5,9 +5,6 @@ require 'efl/ecore'
|
|
5
5
|
require 'efl/ecore_evas'
|
6
6
|
require 'efl/edje'
|
7
7
|
#
|
8
|
-
Efl::EcoreEvas::init
|
9
|
-
Efl::Edje::init
|
10
|
-
#
|
11
8
|
WIDTH=320
|
12
9
|
HEIGHT=240
|
13
10
|
#
|
@@ -41,9 +38,13 @@ def create_my_group canvas, txt
|
|
41
38
|
end
|
42
39
|
#
|
43
40
|
def del_cb ecore_evas
|
41
|
+
puts "delete request callback"
|
44
42
|
Efl::Ecore.main_loop_quit
|
45
43
|
end
|
46
44
|
#
|
45
|
+
Efl::EcoreEvas::init
|
46
|
+
Efl::Edje::init
|
47
|
+
#
|
47
48
|
window = Efl::EcoreEvas::REcoreEvas.new { |w|
|
48
49
|
w.resize WIDTH, HEIGHT
|
49
50
|
w.move 100, 100
|