From 0fb177e534197d351ccb091027f8416feb93e3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 3 May 2011 23:24:37 +0200 Subject: add EcoreEvas#ecore_evas_list and EcoreEvas#engines_list, increase EcoreEvas specs --- lib/efl/ecore_evas.rb | 7 +++++++ spec/ecore_evas_spec.rb | 39 +++++++++++++++++++++++++++------------ 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/lib/efl/ecore_evas.rb b/lib/efl/ecore_evas.rb index c1372f6..d37d341 100644 --- a/lib/efl/ecore_evas.rb +++ b/lib/efl/ecore_evas.rb @@ -7,6 +7,13 @@ module Efl # module EcoreEvas # + def self.ecore_evas_list + Efl::EinaList::REinaList.new Efl::EcoreEvas.ecore_evas_ecore_evas_list_get + end + def self.engines_list + Efl::EinaList::REinaList.new Efl::EcoreEvas.engines_get + end + # class REcoreEvas include Efl::ClassHelper proxy_list [Efl::EcoreEvas,'ecore_evas_'].freeze diff --git a/spec/ecore_evas_spec.rb b/spec/ecore_evas_spec.rb index afb1b48..dea6b79 100644 --- a/spec/ecore_evas_spec.rb +++ b/spec/ecore_evas_spec.rb @@ -1,6 +1,7 @@ #! /usr/bin/env ruby # -*- coding: UTF-8 -*- # +require 'efl/eina_list' require 'efl/evas' require 'efl/ecore' require 'efl/ecore_evas' @@ -34,10 +35,24 @@ describe Efl::EcoreEvas do # it "should work" do EcoreEvas.engines_free EcoreEvas.engines_get -# require 'efl/eina_list' -# l = Efl::EinaList::REinaList.new EcoreEvas.engines_get -# l.each do |e| puts e.read_string end -# EcoreEvas.engines_free l + l = EcoreEvas.engines_list + r = l.inject("\t") do |s,e| s+=e.read_string+' ' end + puts r + EcoreEvas.engines_free l + end + # + it "ecore_evas_list should work" do + el = EcoreEvas.ecore_evas_list + el.to_ary.length.should == 0 + el.free + r=[] + 0.upto(3) do + r << EcoreEvas::REcoreEvas.new + end + el = EcoreEvas.ecore_evas_list + el.to_ary.length.should == 4 + el.free + r.each do |e| e.free end end # describe Efl::EcoreEvas::REcoreEvas do @@ -46,13 +61,14 @@ describe Efl::EcoreEvas do } before(:each) do @e = EcoreEvas::REcoreEvas.new :engine_name=>"software_x11", :x=>10, :y=>10, :w=>100, :h=>120 - @e.move 10, 10 @canvas = @e.evas @bg = @canvas.object_add(:rectangle) { |o| o.color = 100, 100, 255, 255 o.size = @e.size } @bg.show + @e.object_associate @bg, :ecore_evas_object_associate_base + @e.move 10, 10 @e.show end after(:each) do @@ -71,17 +87,21 @@ describe Efl::EcoreEvas do @e.data_get('key').read_string.should == '666' end # - it "move, resize move_resize and geometry_get should work" do + it "move, resize move_resize and geometry_get should work (and check association)" do @e.geometry_get.should == [10,10,100,120] + @bg.geometry_get.should == [0,0,100,120] @e.move 20, 17 # w+23 window bar height ecore_loop 3 @e.geometry_get.should == [20,40,100,120] + @bg.geometry_get.should == [0,0,100,120] @e.resize 200,150 ecore_loop 3 @e.geometry_get.should == [20,40,200,150] + @bg.geometry_get.should == [0,0,200,150] @e.move_resize 10, 0, 130, 100 ecore_loop 3 @e.geometry_get.should == [10,23,130,100] + @bg.geometry_get.should == [0,0,130,100] g = @e.geometry_get end # @@ -168,8 +188,6 @@ describe Efl::EcoreEvas do @e.size_step_get.should == [20, 30] end # - # TODO : 3 * cursor - # it "layer set/get should work" do @e.layer_set 2 @e.layer_get.should == 2 @@ -259,9 +277,6 @@ describe Efl::EcoreEvas do @e.ignore_events?.should be_false end # -# it "object_associate dissociate should work" do -# @e.object_associate_set true -# @e.object_associate_set true -# end + # TODO ecore_evas_callback_* end end -- cgit v1.1-2-g2b99