diff options
| author | Jérémy Zurcher <jeremy@asynk.ch> | 2011-05-05 08:44:16 +0200 | 
|---|---|---|
| committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-05-05 08:44:16 +0200 | 
| commit | 67da13a4f7ddfad59c70df26e85152543c43c22f (patch) | |
| tree | dac7733988d029475dee4ff84c0f872ffdd52399 | |
| parent | e07b6f598ad470399dcd967a9171a8d3c1fa2cfe (diff) | |
| download | ffi-efl-67da13a4f7ddfad59c70df26e85152543c43c22f.zip ffi-efl-67da13a4f7ddfad59c70df26e85152543c43c22f.tar.gz  | |
REvas#viewport + specs
| -rw-r--r-- | lib/efl/evas.rb | 4 | ||||
| -rw-r--r-- | spec/evas_spec.rb | 4 | 
2 files changed, 8 insertions, 0 deletions
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  | 
