summaryrefslogtreecommitdiffstats
path: root/spec/evas_spec.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-04-27 23:34:54 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-04-27 23:34:54 +0200
commitb077f09c6dfa118a508d994f6d42ff6cf8558101 (patch)
tree03b0bdd5da3d24d37403b917410d91efa73cede8 /spec/evas_spec.rb
parentf8b18a867772830403b5ffdf98c373bbcc2d37d0 (diff)
downloadffi-efl-b077f09c6dfa118a508d994f6d42ff6cf8558101.zip
ffi-efl-b077f09c6dfa118a508d994f6d42ff6cf8558101.tar.gz
add more evas specs
Diffstat (limited to 'spec/evas_spec.rb')
-rw-r--r--spec/evas_spec.rb30
1 files changed, 28 insertions, 2 deletions
diff --git a/spec/evas_spec.rb b/spec/evas_spec.rb
index 3d579f1..1d35814 100644
--- a/spec/evas_spec.rb
+++ b/spec/evas_spec.rb
@@ -216,7 +216,7 @@ describe Efl::Evas do
# evas_event_feed_key_up
# evas_event_feed_hold
#
- it "event callback should work" do
+ it "add/del event callback should work" do
@cb = false
kd_cb = Proc.new do |data, e, obj, event_info|
data.read_string.should eq "mouse_in"
@@ -230,11 +230,37 @@ describe Efl::Evas do
@bg.move 0, 0
@bg.resize 20, 20
@bg.show
- @bg.event_callback_add 0, kd_cb, kd_d
+ @bg.event_callback_add :evas_callback_mouse_in, kd_cb, kd_d
@e.event_feed_mouse_in Time.now.to_i, FFI::Pointer::NULL
+ @bg.event_callback_del(:evas_callback_mouse_in, kd_cb).address.should eql kd_d.address
@db.should be_true
end
#
+ it "image cache functions should work" do
+ @e.image_cache_flush
+ @e.image_cache_reload
+ @e.image_cache_set 666
+ @e.image_cache_get.should eql 666
+ end
+ #
+ it "font functions should work" do
+ @e.evas_font_hinting_set :evas_font_hinting_bytecode
+ @e.evas_font_hinting_get.should eql :evas_font_hinting_bytecode
+ @e.evas_font_hinting_can_hint(:evas_font_hinting_none).should be_true
+ @e.evas_font_cache_flush
+ @e.evas_font_cache_set 666
+ @e.evas_font_cache_get.should eql 666
+ l = @e.evas_font_available_list
+ @e.evas_font_available_list_free l
+ @e.evas_font_path_clear
+ a = ['/tmp1','/tmp2']
+ @e.evas_font_path_append a[1]
+ @e.evas_font_path_prepend a[0]
+ require 'efl/eina_list'
+ Efl::Eina::EinaList.new(@e.evas_font_path_list).each_with_index do |p,i|
+ p.read_string.should eql a[i]
+ end
+ end
end
#
end