Ignore:
Timestamp:
Nov 28, 2007, 5:39:10 PM (12 years ago)
Author:
Pascal Terjan
Message:
  • Add Caca::Display#canvas
Location:
libcaca/trunk/ruby
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/ruby/caca-display.c

    r2092 r2093  
    3434{
    3535    caca_display_t *display;
     36    cucul_canvas_t *canvas;
    3637    VALUE cv;
    3738
     
    4142    {
    4243        display = caca_create_display(NULL);
     44        canvas = caca_get_canvas(display);
     45        cv = canvas_create(canvas);
    4346    }
    4447    else
     
    5861
    5962    _SELF = display;
     63
     64    rb_iv_set(self, "@canvas", cv);
    6065
    6166    return self;
  • libcaca/trunk/ruby/cucul-canvas.c

    r2086 r2093  
    4848   
    4949    return obj;
     50}
     51
     52VALUE canvas_create(cucul_canvas_t *canvas)
     53{
     54    return Data_Wrap_Struct(cCanvas, 0, canvas_free, canvas);
    5055}
    5156
  • libcaca/trunk/ruby/cucul-canvas.h

    r1995 r2093  
    66extern VALUE cCanvas;
    77extern void Init_cucul_canvas(VALUE);
     8extern VALUE canvas_create(cucul_canvas_t *canvas);
    89
    910#endif
  • libcaca/trunk/ruby/lib/caca.rb

    r2042 r2093  
    33
    44module Caca
     5    class Display
     6        attr_reader :canvas
     7    end
    58    class Event
    69        def Event.to_i
  • libcaca/trunk/ruby/ruby-caca.dox

    r2077 r2093  
    3434\code
    3535irb(main):010:0> Caca::Display.my_instance_methods
    36 => ["get_event", "height", "mouse=", "mouse_x", "mouse_y", "refresh",
     36=> ["canvas", "get_event", "height", "mouse=", "mouse_x", "mouse_y", "refresh",
    3737"set_mouse", "set_time", "set_title", "time", "time=", "title=", "width"]
    3838\endcode
Note: See TracChangeset for help on using the changeset viewer.