From 67da13a4f7ddfad59c70df26e85152543c43c22f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 5 May 2011 08:44:16 +0200 Subject: REvas#viewport + specs --- lib/efl/evas.rb | 4 ++++ spec/evas_spec.rb | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/efl/evas.rb b/lib/efl/evas.rb index 1dcc1a4..d18cec8 100644 --- a/lib/efl/evas.rb +++ b/lib/efl/evas.rb @@ -72,6 +72,7 @@ module Efl @ptr=nil end def object_add t + # TODO should return Objects r = Evas::REvasObject.new Native.send "evas_object_#{t.to_s}_add", @ptr yield r if block_given? r @@ -91,18 +92,21 @@ module Efl Native.evas_output_viewport_get @ptr, x, y, w, h [ x.read_int, y.read_int, w.read_int, h.read_int ] end + alias :viewport :output_viewport_get def pointer_output_xy_get x = FFI::MemoryPointer.new :int y = FFI::MemoryPointer.new :int Native.evas_pointer_output_xy_get @ptr, x, y [ x.read_int, y.read_int ] end + alias :pointer_output :pointer_output_xy_get def pointer_canvas_xy_get x = FFI::MemoryPointer.new :int y = FFI::MemoryPointer.new :int Native.evas_pointer_canvas_xy_get @ptr, x, y [ x.read_int, y.read_int ] end + alias :pointer_canvas :pointer_canvas_xy_get end # class REvasObject diff --git a/spec/evas_spec.rb b/spec/evas_spec.rb index 135e8bf..622714a 100644 --- a/spec/evas_spec.rb +++ b/spec/evas_spec.rb @@ -157,10 +157,14 @@ describe Efl::Evas do it "output size should work" do @e.output_size_set 69, 666 @e.output_size_get.should == [69,666] + @e.output_size = 666, 69 + @e.size == [666,69] end it "output viewport should work" do @e.output_viewport_set 0, 0, 666, 69 @e.output_viewport_get.should == [0,0,666,69] + @e.output_viewport = 0, 0, 69, 666 + @e.viewport.should == [0,0,69,666] end # it "coordinates evas<=>world should work" do -- cgit v1.1-2-g2b99