From b18d63c6d7012aa0294c7ed13e78d0413584e140 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 17 Nov 2007 02:15:01 +0000 Subject: [PATCH] * Slightly doxygenated ruby/README so that it appears in the manual (see http://libcaca.zoy.org/manual/libcaca-ruby.html). --- doc/doxygen.cfg.in | 6 ++++-- doc/libcaca.dox | 4 ++++ ruby/README | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/doc/doxygen.cfg.in b/doc/doxygen.cfg.in index 4c8ac09..6e8424d 100644 --- a/doc/doxygen.cfg.in +++ b/doc/doxygen.cfg.in @@ -486,7 +486,8 @@ WARN_LOGFILE = INPUT = @top_srcdir@ \ @top_srcdir@/doc \ @top_srcdir@/cucul \ - @top_srcdir@/caca + @top_srcdir@/caca \ + @top_srcdir@/ruby # This tag can be used to specify the character encoding of the source files that # doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default @@ -506,8 +507,9 @@ FILE_PATTERNS = *.dox \ *.c \ cucul.h \ caca.h \ - NEWS \ AUTHORS \ + NEWS \ + README \ THANKS \ TODO diff --git a/doc/libcaca.dox b/doc/libcaca.dox index 5b40566..8155ca9 100644 --- a/doc/libcaca.dox +++ b/doc/libcaca.dox @@ -33,6 +33,10 @@ - cucul.h - caca.h + There is language-specific documentation for the various bindings: + + - \subpage libcaca-ruby + Some other topics are covered by specific sections: - \subpage libcaca-tutorial diff --git a/ruby/README b/ruby/README index ca6df1f..79f416c 100644 --- a/ruby/README +++ b/ruby/README @@ -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 + +*/