Ignore:
Timestamp:
11/18/07 22:44:10 (6 years ago)
Author:
pterjan
Message:
  • Update README to talk about Caca
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/ruby/README

    r2009 r2021  
    11/* $Id$ */ /** \page libcaca-ruby Libcaca ruby bindings 
    22 
    3 This a Ruby binding for libcucul, libcaca will be added later. 
     3This a Ruby binding for libcucul and libcaca. 
    44 
    55There is no real documentation but "methods" on any object should help you :) 
    66 
    7 The objects available are : 
     7The classes available for libcucul are : 
    88 
    99- Cucul::Canvas (functions that have a cucul_canvas_t* as first argument) 
     
    1313- Cucul::Font (functions that have a cucul_font_t* as first argument) 
    1414 * The constructor can currently only accept the name of a builtin font 
     15 
     16The classes available for libcaca are : 
     17 
     18- Caca::Display 
     19- Caca::Event 
     20- Caca::Event::Key 
     21- Caca::Event::Key::Press 
     22- Caca::Event::Key::Release 
     23- Caca::Event::Mouse 
     24- Caca::Event::Mouse::Press 
     25- Caca::Event::Mouse::Release 
     26- Caca::Event::Mouse::Motion 
     27- Caca::Event::Resize 
     28- Caca::Event::Quit 
    1529 
    1630The character set conversion functions are not available yet in the binding. 
     
    4357Cucul::Canvas.ancestors[1].instance_methods 
    4458=> ["attr=", "blit", "clear", "create_frame", "cursor_x", "cursor_y", 
    45 "draw_box", "draw_circle", "draw_cp437_box", "draw_ellipse", 
     59"dither_bitmap", "draw_box", "draw_circle", "draw_cp437_box", "draw_ellipse", 
    4660"draw_line", "draw_polyline", "draw_thin_box", "draw_thin_ellipse", 
    4761"draw_thin_line", "draw_thin_polyline", "draw_thin_triangle", 
     
    7993\endcode 
    8094 
     95\code 
     96irb(main):007:0> Caca::Display.instance_methods.sort - 
     97Caca::Display.ancestors[1].instance_methods 
     98=> ["get_event", "height", "mouse=", "mouse_x", "mouse_y", "refresh", 
     99"set_mouse", "set_time", "set_title", "time", "time=", "title=", "width"] 
     100\endcode 
     101 
     102\code 
     103irb(main):008:0> Caca::Event.constants 
     104=> ["Key", "Quit", "TYPE", "Mouse", "Resize"] 
     105\endcode 
     106 
     107\code 
     108irb(main):009:0> Caca::Event::Key.instance_methods - Caca::Event::Key.ancestors[1].instance_methods 
     109=> ["ch", "utf32", "utf8"] 
     110\endcode 
     111 
     112\code 
     113irb(main):010:0> Caca::Event::Key.instance_methods - Caca::Event::Mouse.ancestors[1].instance_methods 
     114=> ["ch", "utf32", "utf8"] 
     115\endcode 
     116 
     117\code 
     118irb(main):011:0> Caca::Event::Mouse.instance_methods - Caca::Event::Mouse.ancestors[1].instance_methods 
     119=> ["button", "x", "y"] 
     120\endcode 
     121 
     122\code 
     123irb(main):018:0> Caca::Event::Resize.instance_methods - Caca::Event::Resize.ancestors[1].instance_methods 
     124=> ["w", "h"] 
     125\endcode 
     126 
    81127And here are sample uses : 
    82128 
     
    112158\endcode 
    113159 
     160And now a real one: 
     161 
     162\code 
     163require 'caca' 
     164d = Caca::Display.new(Cucul::Canvas.new(20,10)) 
     165d.title = "Test !" 
     166while((e = d.get_event(Caca::Event, -1)) && 
     167       ! e.kind_of?(Caca::Event::Quit)) 
     168    p e 
     169    d.refresh 
     170end 
     171\endcode 
     172 
    114173*/ 
Note: See TracChangeset for help on using the changeset viewer.