This file is indexed.

/usr/share/doc/libcaca-dev/html/libcaca-ruby-api.html is in libcaca-dev 0.99.beta19-2ubuntu0.18.04.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
    <title>libcaca documentation</title>
    <link href="doxygen.css" rel="stylesheet" type="text/css">
  </head>
  <body>
<!-- Generated by Doxygen 1.8.13 -->
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Libcaca Ruby API </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="classes"></a>
Classes</h1>
<p>The classes available for libcaca are :</p>
<ul>
<li><b>Caca::Canvas</b> : functions that have a caca_canvas_t* as first argument </li>
<li><b>Caca::Dither</b> : functions that have a caca_dither_t* as first argument </li>
<li><b>Caca::Font</b> : functions that have a caca_font_t* as first argument (The constructor can currently only accept the name of a builtin font) </li>
<li><b>Caca::Display</b> </li>
<li><b>Caca::Event</b> </li>
<li><b>Caca::Event::Key</b> </li>
<li><b>Caca::Event::Key::Press</b> </li>
<li><b>Caca::Event::Key::Release</b> </li>
<li><b>Caca::Event::Mouse</b> </li>
<li><b>Caca::Event::Mouse::Press</b> </li>
<li><b>Caca::Event::Mouse::Release</b> </li>
<li><b>Caca::Event::Mouse::Motion</b> </li>
<li><b>Caca::Event::Resize</b> </li>
<li><b>Caca::Event::Quit</b> </li>
</ul>
<p>The character set conversion functions are not available yet in the binding.</p>
<div class="fragment"><div class="line">$ irb -rcaca</div><div class="line">irb(main):001:0&gt; class Object</div><div class="line">irb(main):002:1&gt; def Object.my_instance_methods</div><div class="line">irb(main):003:2&gt; instance_methods.sort - ancestors[1].instance_methods</div><div class="line">irb(main):004:2&gt; end</div><div class="line">irb(main):005:1&gt; def Object.my_methods</div><div class="line">irb(main):006:2&gt; methods.sort - ancestors[1].methods</div><div class="line">irb(main):007:2&gt; end</div><div class="line">irb(main):008:1&gt; end</div></div><!-- fragment --><div class="fragment"><div class="line">irb(main):009:0&gt; Caca.constants</div><div class="line">=&gt; [<span class="stringliteral">&quot;BROWN&quot;</span>, <span class="stringliteral">&quot;BOLD&quot;</span>, <span class="stringliteral">&quot;GREEN&quot;</span>, <span class="stringliteral">&quot;LIGHTMAGENTA&quot;</span>, <span class="stringliteral">&quot;LIGHTBLUE&quot;</span>, <span class="stringliteral">&quot;BLINK&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;MAGENTA&quot;</span>, <span class="stringliteral">&quot;DEFAULT&quot;</span>, <span class="stringliteral">&quot;TRANSPARENT&quot;</span>, <span class="stringliteral">&quot;BLUE&quot;</span>, <span class="stringliteral">&quot;LIGHTRED&quot;</span>, <span class="stringliteral">&quot;DARKGRAY&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;UNDERLINE&quot;</span>, <span class="stringliteral">&quot;RED&quot;</span>, <span class="stringliteral">&quot;WHITE&quot;</span>, <span class="stringliteral">&quot;BLACK&quot;</span>, <span class="stringliteral">&quot;LIGHTCYAN&quot;</span>, <span class="stringliteral">&quot;LIGHTGRAY&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;ITALICS&quot;</span>, <span class="stringliteral">&quot;CYAN&quot;</span>, <span class="stringliteral">&quot;YELLOW&quot;</span>, <span class="stringliteral">&quot;LIGHTGREEN&quot;</span>, <span class="stringliteral">&quot;Canvas&quot;</span>, <span class="stringliteral">&quot;Dither&quot;</span>, <span class="stringliteral">&quot;Font&quot;</span>]</div></div><!-- fragment --><div class="fragment"><div class="line">irb(main):010:0&gt; Caca.my_methods</div><div class="line">=&gt; [<span class="stringliteral">&quot;version&quot;</span>]</div></div><!-- fragment --><div class="fragment"><div class="line">irb(main):011:0&gt; Caca::Canvas.my_methods</div><div class="line">=&gt; [<span class="stringliteral">&quot;export_list&quot;</span>, <span class="stringliteral">&quot;import_list&quot;</span>]</div></div><!-- fragment --><div class="fragment"><div class="line">irb(main):012:0&gt; Caca::Canvas.my_instance_methods</div><div class="line">=&gt; [<span class="stringliteral">&quot;attr=&quot;</span>, <span class="stringliteral">&quot;blit&quot;</span>, <span class="stringliteral">&quot;clear&quot;</span>, <span class="stringliteral">&quot;create_frame&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;dither_bitmap&quot;</span>, <span class="stringliteral">&quot;draw_box&quot;</span>, <span class="stringliteral">&quot;draw_circle&quot;</span>, <span class="stringliteral">&quot;draw_cp437_box&quot;</span>, <span class="stringliteral">&quot;draw_ellipse&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;draw_line&quot;</span>, <span class="stringliteral">&quot;draw_polyline&quot;</span>, <span class="stringliteral">&quot;draw_thin_box&quot;</span>, <span class="stringliteral">&quot;draw_thin_ellipse&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;draw_thin_line&quot;</span>, <span class="stringliteral">&quot;draw_thin_polyline&quot;</span>, <span class="stringliteral">&quot;draw_thin_triangle&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;draw_triangle&quot;</span>, <span class="stringliteral">&quot;export_to_memory&quot;</span>, <span class="stringliteral">&quot;fill_box&quot;</span>, <span class="stringliteral">&quot;fill_ellipse&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;fill_triangle&quot;</span>, <span class="stringliteral">&quot;flip&quot;</span>, <span class="stringliteral">&quot;flop&quot;</span>, <span class="stringliteral">&quot;frame=&quot;</span>, <span class="stringliteral">&quot;frame_count&quot;</span>, <span class="stringliteral">&quot;frame_name&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;frame_name=&quot;</span>, <span class="stringliteral">&quot;free_frame&quot;</span>, <span class="stringliteral">&quot;get_attr&quot;</span>, <span class="stringliteral">&quot;get_char&quot;</span>, <span class="stringliteral">&quot;gotoxy&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;handle_x&quot;</span>, <span class="stringliteral">&quot;handle_y&quot;</span>, <span class="stringliteral">&quot;height&quot;</span>, <span class="stringliteral">&quot;height=&quot;</span>, <span class="stringliteral">&quot;import_file&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;import_from_memory&quot;</span>, <span class="stringliteral">&quot;invert&quot;</span>, <span class="stringliteral">&quot;printf&quot;</span>, <span class="stringliteral">&quot;put_attr&quot;</span>, <span class="stringliteral">&quot;put_char&quot;</span>, <span class="stringliteral">&quot;put_str&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;rotate_180&quot;</span>, <span class="stringliteral">&quot;rotate_left&quot;</span>, <span class="stringliteral">&quot;rotate_right&quot;</span>, <span class="stringliteral">&quot;set_attr&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;set_boundaries&quot;</span>, <span class="stringliteral">&quot;set_color_ansi&quot;</span>, <span class="stringliteral">&quot;set_color_argb&quot;</span>, <span class="stringliteral">&quot;set_frame&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;set_frame_name&quot;</span>, <span class="stringliteral">&quot;set_handle&quot;</span>, <span class="stringliteral">&quot;set_height&quot;</span>, <span class="stringliteral">&quot;set_size&quot;</span>, <span class="stringliteral">&quot;set_width&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;stretch_left&quot;</span>, <span class="stringliteral">&quot;stretch_right&quot;</span>, <span class="stringliteral">&quot;wherex&quot;</span>, <span class="stringliteral">&quot;wherey&quot;</span>, <span class="stringliteral">&quot;width&quot;</span>, <span class="stringliteral">&quot;width=&quot;</span>]</div></div><!-- fragment --><div class="fragment"><div class="line">irb(main):013:0&gt; Caca::Font.my_methods</div><div class="line">=&gt; [<span class="stringliteral">&quot;list&quot;</span>]</div></div><!-- fragment --><div class="fragment"><div class="line">irb(main):014:0&gt; Caca::Font.my_instance_methods</div><div class="line">=&gt; [<span class="stringliteral">&quot;blocks&quot;</span>, <span class="stringliteral">&quot;height&quot;</span>, <span class="stringliteral">&quot;width&quot;</span>]</div></div><!-- fragment --><div class="fragment"><div class="line">irb(main):015:0&gt; Caca::Dither.my_instance_methods</div><div class="line">=&gt; [<span class="stringliteral">&quot;algorithm=&quot;</span>, <span class="stringliteral">&quot;algorithm_list&quot;</span>, <span class="stringliteral">&quot;antialias=&quot;</span>, <span class="stringliteral">&quot;antialias_list&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;brightness=&quot;</span>, <span class="stringliteral">&quot;charset=&quot;</span>, <span class="stringliteral">&quot;charset_list&quot;</span>, <span class="stringliteral">&quot;color=&quot;</span>, <span class="stringliteral">&quot;color_list&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;contrast=&quot;</span>, <span class="stringliteral">&quot;gamma=&quot;</span>, <span class="stringliteral">&quot;palette=&quot;</span>, <span class="stringliteral">&quot;set_algorithm&quot;</span>, <span class="stringliteral">&quot;set_antialias&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;set_brightness&quot;</span>, <span class="stringliteral">&quot;set_charset&quot;</span>, <span class="stringliteral">&quot;set_color&quot;</span>, <span class="stringliteral">&quot;set_contrast&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;set_gamma&quot;</span>, <span class="stringliteral">&quot;set_palette&quot;</span>]</div></div><!-- fragment --><div class="fragment"><div class="line">irb(main):010:0&gt; Caca::Display.my_instance_methods</div><div class="line">=&gt; [<span class="stringliteral">&quot;canvas&quot;</span>, <span class="stringliteral">&quot;get_event&quot;</span>, <span class="stringliteral">&quot;height&quot;</span>, <span class="stringliteral">&quot;mouse=&quot;</span>, <span class="stringliteral">&quot;mouse_x&quot;</span>, <span class="stringliteral">&quot;mouse_y&quot;</span>, <span class="stringliteral">&quot;refresh&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;set_mouse&quot;</span>, <span class="stringliteral">&quot;set_time&quot;</span>, <span class="stringliteral">&quot;set_title&quot;</span>, <span class="stringliteral">&quot;time&quot;</span>, <span class="stringliteral">&quot;time=&quot;</span>, <span class="stringliteral">&quot;title=&quot;</span>, <span class="stringliteral">&quot;width&quot;</span>]</div></div><!-- fragment --><div class="fragment"><div class="line">irb(main):011:0&gt; Caca::Event.constants</div><div class="line">=&gt; [<span class="stringliteral">&quot;Key&quot;</span>, <span class="stringliteral">&quot;Quit&quot;</span>, <span class="stringliteral">&quot;TYPE&quot;</span>, <span class="stringliteral">&quot;Mouse&quot;</span>, <span class="stringliteral">&quot;Resize&quot;</span>]</div></div><!-- fragment --><div class="fragment"><div class="line">irb(main):012:0&gt; Caca::Event.my_instance_methods</div><div class="line">=&gt; [<span class="stringliteral">&quot;quit?&quot;</span>]</div></div><!-- fragment --><div class="fragment"><div class="line">irb(main):013:0&gt; Caca::Event::Key.my_instance_methods</div><div class="line">=&gt; [<span class="stringliteral">&quot;ch&quot;</span>, <span class="stringliteral">&quot;utf32&quot;</span>, <span class="stringliteral">&quot;utf8&quot;</span>]</div></div><!-- fragment --><div class="fragment"><div class="line">irb(main):014:0&gt; Caca::Event::Mouse.my_instance_methods</div><div class="line">=&gt; [<span class="stringliteral">&quot;button&quot;</span>, <span class="stringliteral">&quot;x&quot;</span>, <span class="stringliteral">&quot;y&quot;</span>]</div></div><!-- fragment --><div class="fragment"><div class="line">irb(main):015:0&gt; Caca::Event::Resize.my_instance_methods</div><div class="line">=&gt; [<span class="stringliteral">&quot;w&quot;</span>, <span class="stringliteral">&quot;h&quot;</span>]</div></div><!-- fragment --><h1><a class="anchor" id="Samples"></a>
Samples</h1>
<div class="fragment"><div class="line">$ ruby -rcaca -e <span class="stringliteral">&#39;c=Caca::Canvas.new(6, 3).fill_box(0,0,2,2,&quot;#&quot;[0]);</span></div><div class="line"><span class="stringliteral">c2=Caca::Canvas.new(1,1).put_str(0,0,&quot;x&quot;); c.blit(1,1,c2); puts</span></div><div class="line"><span class="stringliteral">c.export_to_memory(&quot;irc&quot;)&#39;</span></div><div class="line"><span class="preprocessor">###</span></div><div class="line"><span class="preprocessor">#x#</span></div><div class="line"><span class="preprocessor">###</span></div></div><!-- fragment --><div class="fragment"><div class="line">$ ruby -e <span class="stringliteral">&#39;puts Caca::Canvas.new(6,3).draw_thin_polyline([[0,0], [0,2],</span></div><div class="line"><span class="stringliteral">[5,2],[0,0]]).export_to_memory(&quot;irc&quot;)&#39;</span></div><div class="line">-.</div><div class="line">| `.</div><div class="line">----`-</div></div><!-- fragment --><div class="fragment"><div class="line">$ ruby -rcaca -e <span class="stringliteral">&#39;p Caca::Canvas.export_list&#39;</span></div><div class="line">[[<span class="stringliteral">&quot;caca&quot;</span>, <span class="stringliteral">&quot;native libcaca format&quot;</span>], [<span class="stringliteral">&quot;ansi&quot;</span>, <span class="stringliteral">&quot;ANSI&quot;</span>], [<span class="stringliteral">&quot;utf8&quot;</span>, <span class="stringliteral">&quot;UTF-8</span></div><div class="line"><span class="stringliteral">withANSI escape codes&quot;</span>], [<span class="stringliteral">&quot;utf8cr&quot;</span>, <span class="stringliteral">&quot;UTF-8 with ANSI escape codes and</span></div><div class="line"><span class="stringliteral">MS-DOS\\r&quot;</span>], [<span class="stringliteral">&quot;html&quot;</span>, <span class="stringliteral">&quot;HTML&quot;</span>], [<span class="stringliteral">&quot;html3&quot;</span>, <span class="stringliteral">&quot;backwards-compatible HTML&quot;</span>],</div><div class="line">[<span class="stringliteral">&quot;irc&quot;</span>, <span class="stringliteral">&quot;IRC with mIRC colours&quot;</span>], [<span class="stringliteral">&quot;ps&quot;</span>, <span class="stringliteral">&quot;PostScript document&quot;</span>], [<span class="stringliteral">&quot;svg&quot;</span>,</div><div class="line"><span class="stringliteral">&quot;SVGvector image&quot;</span>], [<span class="stringliteral">&quot;tga&quot;</span>, <span class="stringliteral">&quot;TGA image&quot;</span>]]</div></div><!-- fragment --><div class="fragment"><div class="line">$ ruby -rcaca -e <span class="stringliteral">&#39;p Caca::Font.list&#39;</span></div><div class="line">[<span class="stringliteral">&quot;Monospace9&quot;</span>, <span class="stringliteral">&quot;Monospace Bold 12&quot;</span>]</div></div><!-- fragment --><div class="fragment"><div class="line">require <span class="stringliteral">&#39;caca&#39;</span></div><div class="line">c = Caca::Canvas.new(20,10)</div><div class="line">c.put_str(2,3, <span class="stringliteral">&quot;plop!&quot;</span>)</div><div class="line">c.draw_thin_polyline([[0,0],[0,2], [5,2], [0,0]])</div><div class="line">d = Caca::Display.new(c)</div><div class="line">d.title= <span class="stringliteral">&quot;Test !&quot;</span></div><div class="line">d.refresh</div><div class="line"></div><div class="line"><span class="preprocessor">#Redefine Event::Key#quit? so that q, Q, and Esc become exit keys</span></div><div class="line">module Caca</div><div class="line">  <span class="keyword">class </span>Event::Key</div><div class="line">    def quit?</div><div class="line">      &quot;qQ^[<span class="stringliteral">&quot;.split(&#39;&#39;).member?(@ch.chr)</span></div><div class="line"><span class="stringliteral">    end</span></div><div class="line"><span class="stringliteral">  end</span></div><div class="line"><span class="stringliteral">end</span></div><div class="line"><span class="stringliteral"></span></div><div class="line"><span class="stringliteral">while((e= d.get_event(Caca::Event, -1)) &amp;&amp; ! e.quit?)</span></div><div class="line"><span class="stringliteral">  p e</span></div><div class="line"><span class="stringliteral">  d.refresh</span></div><div class="line"><span class="stringliteral">end</span></div></div><!-- fragment --> </div></div><!-- contents -->
  </body>
</html>