Changeset 2077


Ignore:
Timestamp:
Nov 26, 2007, 8:07:52 AM (13 years ago)
Author:
Pascal Terjan
Message:
  • Add Caca.version and Cucul.version
Location:
libcaca/trunk/ruby
Files:
4 edited

Legend:

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

    r2019 r2077  
    1616#include "caca-event.h"
    1717
     18static VALUE get_version(VALUE self)
     19{
     20    return rb_str_new2(caca_get_version());
     21}
     22
    1823void Init_caca()
    1924{
    2025    VALUE mCaca = rb_define_module("Caca");
    2126
     27    rb_define_singleton_method(mCaca, "version", get_version, 0);
     28
    2229    Init_caca_display(mCaca);
    2330    Init_caca_event(mCaca);
  • libcaca/trunk/ruby/cucul.c

    r2008 r2077  
    1717#include "cucul-font.h"
    1818
     19static VALUE get_version(VALUE self)
     20{
     21    return rb_str_new2(cucul_get_version());
     22}
     23
    1924void Init_cucul()
    2025{
    2126    VALUE mCucul = rb_define_module("Cucul");
     27
     28    rb_define_singleton_method(mCucul, "version", get_version, 0);
    2229
    2330    rb_define_const(mCucul, "BLACK", INT2FIX(CUCUL_BLACK));
  • libcaca/trunk/ruby/ruby-caca.dox

    r2048 r2077  
    2525irb(main):007:2>   end
    2626irb(main):008:1> end
     27\endcode
    2728
    28 irb(main):009:0> Caca::Display.my_instance_methods
     29\code
     30irb(main):009:0> Caca.my_methods
     31=> ["version"]
     32\endcode
     33
     34\code
     35irb(main):010:0> Caca::Display.my_instance_methods
    2936=> ["get_event", "height", "mouse=", "mouse_x", "mouse_y", "refresh",
    3037"set_mouse", "set_time", "set_title", "time", "time=", "title=", "width"]
     
    3239
    3340\code
    34 irb(main):010:0> Caca::Event.constants
     41irb(main):011:0> Caca::Event.constants
    3542=> ["Key", "Quit", "TYPE", "Mouse", "Resize"]
    3643\endcode
    3744
    3845\code
    39 irb(main):011:0> Caca::Event.my_instance_methods
     46irb(main):012:0> Caca::Event.my_instance_methods
    4047=> ["quit?"]
    4148\endcode
    4249
    4350\code
    44 irb(main):012:0> Caca::Event::Key.my_instance_methods
     51irb(main):013:0> Caca::Event::Key.my_instance_methods
    4552=> ["ch", "utf32", "utf8"]
    4653\endcode
    4754
    4855\code
    49 irb(main):013:0> Caca::Event::Mouse.my_instance_methods
     56irb(main):014:0> Caca::Event::Mouse.my_instance_methods
    5057=> ["button", "x", "y"]
    5158\endcode
    5259
    5360\code
    54 irb(main):014:0> Caca::Event::Resize.my_instance_methods
     61irb(main):015:0> Caca::Event::Resize.my_instance_methods
    5562=> ["w", "h"]
    5663\endcode
  • libcaca/trunk/ruby/ruby-cucul.dox

    r2048 r2077  
    2121irb(main):007:2>   end
    2222irb(main):008:1> end
     23\endcode
    2324
     25\code
    2426irb(main):009:0> Cucul.constants
    2527=> ["BROWN", "BOLD", "GREEN", "LIGHTMAGENTA", "LIGHTBLUE", "BLINK",
     
    3032
    3133\code
    32 irb(main):010:0> Cucul::Canvas.my_methods
     34irb(main):010:0> Cucul.my_methods
     35=> ["version"]
     36\endcode
     37
     38\code
     39irb(main):011:0> Cucul::Canvas.my_methods
    3340=> ["export_list", "import_list"]
    3441\endcode
    3542
    3643\code
    37 irb(main):003:0> Cucul::Canvas.my_instance_methods
     44irb(main):012:0> Cucul::Canvas.my_instance_methods
    3845=> ["attr=", "blit", "clear", "create_frame", "cursor_x", "cursor_y",
    3946"dither_bitmap", "draw_box", "draw_circle", "draw_cp437_box", "draw_ellipse",
     
    5259
    5360\code
    54 irb(main):004:0> Cucul::Font.my_methods
     61irb(main):013:0> Cucul::Font.my_methods
    5562=> ["list"]
    5663\endcode
    5764
    5865\code
    59 irb(main):005:0> Cucul::Font.my_instance_methods
     66irb(main):014:0> Cucul::Font.my_instance_methods
    6067=> ["blocks", "height", "width"]
    6168\endcode
    6269
    6370\code
    64 irb(main):006:0> Cucul::Dither.my_instance_methods
     71irb(main):015:0> Cucul::Dither.my_instance_methods
    6572=> ["algorithm=", "algorithm_list", "antialias=", "antialias_list",
    6673"brightness=", "charset=", "charset_list", "color=", "color_list",
Note: See TracChangeset for help on using the changeset viewer.