|
|
@@ -1,3 +1,5 @@ |
|
|
|
/* $Id$ */ /** \page libcaca-ruby Libcaca ruby bindings |
|
|
|
|
|
|
|
This a Ruby binding for libcucul, libcaca will be added later. |
|
|
|
|
|
|
|
There is no real documentation but "methods" on any object should help you :) |
|
|
@@ -18,17 +20,22 @@ I tried to follow Ruby spirit meaning that : |
|
|
|
|
|
|
|
What is currently available is : |
|
|
|
|
|
|
|
\code |
|
|
|
$ irb -rcucul |
|
|
|
irb(main):001:0> Cucul.constants |
|
|
|
=> ["BROWN", "BOLD", "GREEN", "LIGHTMAGENTA", "LIGHTBLUE", "BLINK", |
|
|
|
"MAGENTA", "DEFAULT", "TRANSPARENT", "BLUE", "LIGHTRED", "DARKGRAY", |
|
|
|
"UNDERLINE", "RED", "WHITE", "BLACK", "LIGHTCYAN", "LIGHTGRAY", |
|
|
|
"ITALICS", "CYAN", "YELLOW", "LIGHTGREEN", "Canvas", "Font"] |
|
|
|
\endcode |
|
|
|
|
|
|
|
\code |
|
|
|
irb(main):002:0> Cucul::Canvas.methods.sort - |
|
|
|
Cucul::Canvas.ancestors[1].methods |
|
|
|
=> ["export_list", "import_list"] |
|
|
|
\endcode |
|
|
|
|
|
|
|
\code |
|
|
|
irb(main):003:0> Cucul::Canvas.instance_methods.sort - |
|
|
|
Cucul::Canvas.ancestors[1].instance_methods |
|
|
|
=> ["attr=", "blit", "clear", "create_frame", "cursor_x", "cursor_y", |
|
|
@@ -44,6 +51,7 @@ Cucul::Canvas.ancestors[1].instance_methods |
|
|
|
"set_boundaries", "set_color_ansi", "set_color_argb", "set_frame", |
|
|
|
"set_frame_name", "set_handle", "set_height", "set_size", "set_width", |
|
|
|
"stretch_left", "stretch_right", "width", "width="] |
|
|
|
\endcode |
|
|
|
|
|
|
|
irb(main):004:0> Cucul::Font.methods.sort - |
|
|
|
Cucul::Font.ancestors[1].methods |
|
|
@@ -55,25 +63,35 @@ Cucul::Font.ancestors[1].instance_methods |
|
|
|
|
|
|
|
And here are sample uses : |
|
|
|
|
|
|
|
\code |
|
|
|
$ ruby -rcucul -e 'c=Cucul::Canvas.new(6, 3).fill_box(0,0,2,2,"#"[0]); |
|
|
|
c2=Cucul::Canvas.new(1, 1).put_str(0,0,"x"); c.blit(1,1,c2); puts |
|
|
|
c.export_memory("irc")' |
|
|
|
### |
|
|
|
#x# |
|
|
|
### |
|
|
|
\endcode |
|
|
|
|
|
|
|
\code |
|
|
|
$ ruby -e 'puts Cucul::Canvas.new(6,3).draw_thin_polyline([[0,0], [2,0], |
|
|
|
[5,2],[0,0]]).export_memory("irc")' |
|
|
|
-. |
|
|
|
| `. |
|
|
|
----`- |
|
|
|
\endcode |
|
|
|
|
|
|
|
\code |
|
|
|
$ ruby -rcucul -e 'p Cucul::Canvas.export_list' |
|
|
|
[["caca", "native libcaca format"], ["ansi", "ANSI"], ["utf8", "UTF-8 |
|
|
|
with ANSI escape codes"], ["utf8cr", "UTF-8 with ANSI escape codes and |
|
|
|
MS-DOS \\r"], ["html", "HTML"], ["html3", "backwards-compatible HTML"], |
|
|
|
["irc", "IRC with mIRC colours"], ["ps", "PostScript document"], ["svg", |
|
|
|
"SVG vector image"], ["tga", "TGA image"]] |
|
|
|
\endcode |
|
|
|
|
|
|
|
\code |
|
|
|
$ ruby -rcucul -e 'p Cucul::Font.list' |
|
|
|
["Monospace 9", "Monospace Bold 12"] |
|
|
|
\endcode |
|
|
|
|
|
|
|
*/ |