Browse Source

* Slightly doxygenated ruby/README so that it appears in the manual (see

http://libcaca.zoy.org/manual/libcaca-ruby.html).
tags/v0.99.beta14
Sam Hocevar sam 17 years ago
parent
commit
b18d63c6d7
3 changed files with 26 additions and 2 deletions
  1. +4
    -2
      doc/doxygen.cfg.in
  2. +4
    -0
      doc/libcaca.dox
  3. +18
    -0
      ruby/README

+ 4
- 2
doc/doxygen.cfg.in View File

@@ -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



+ 4
- 0
doc/libcaca.dox View File

@@ -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


+ 18
- 0
ruby/README View File

@@ -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

*/

Loading…
Cancel
Save