Changeset 4292


Ignore:
Timestamp:
Jan 21, 2010, 12:14:24 PM (7 years ago)
Author:
pterjan
Message:
  • Add back some missing spaces
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/ruby/ruby-caca.dox

    r3587 r4292  
    2424
    2525\code
    26 $irb -rcaca
    27 irb(main):001:0>class Object
    28 irb(main):002:1>def Object.my_instance_methods
    29 irb(main):003:2>instance_methods.sort - ancestors[1].instance_methods
    30 irb(main):004:2>end
    31 irb(main):005:1>def Object.my_methods
    32 irb(main):006:2>methods.sort - ancestors[1].methods
    33 irb(main):007:2>end
    34 irb(main):008:1>end
     26$ irb -rcaca
     27irb(main):001:0> class Object
     28irb(main):002:1> def Object.my_instance_methods
     29irb(main):003:2> instance_methods.sort - ancestors[1].instance_methods
     30irb(main):004:2> end
     31irb(main):005:1> def Object.my_methods
     32irb(main):006:2> methods.sort - ancestors[1].methods
     33irb(main):007:2> end
     34irb(main):008:1> end
    3535\endcode
    3636
    3737\code
    38 irb(main):009:0>Caca.constants
    39 =>["BROWN", "BOLD", "GREEN", "LIGHTMAGENTA", "LIGHTBLUE", "BLINK",
     38irb(main):009:0> Caca.constants
     39=> ["BROWN", "BOLD", "GREEN", "LIGHTMAGENTA", "LIGHTBLUE", "BLINK",
    4040"MAGENTA", "DEFAULT", "TRANSPARENT", "BLUE", "LIGHTRED", "DARKGRAY",
    4141"UNDERLINE", "RED", "WHITE", "BLACK", "LIGHTCYAN", "LIGHTGRAY",
     
    4444
    4545\code
    46 irb(main):010:0>Caca.my_methods
    47 =>["version"]
     46irb(main):010:0> Caca.my_methods
     47=> ["version"]
    4848\endcode
    4949
    5050\code
    51 irb(main):011:0>Caca::Canvas.my_methods
    52 =>["export_list", "import_list"]
     51irb(main):011:0> Caca::Canvas.my_methods
     52=> ["export_list", "import_list"]
    5353\endcode
    5454
    5555\code
    56 irb(main):012:0>Caca::Canvas.my_instance_methods
    57 =>["attr=", "blit", "clear", "create_frame",
     56irb(main):012:0> Caca::Canvas.my_instance_methods
     57=> ["attr=", "blit", "clear", "create_frame",
    5858"dither_bitmap", "draw_box", "draw_circle", "draw_cp437_box", "draw_ellipse",
    5959"draw_line", "draw_polyline", "draw_thin_box", "draw_thin_ellipse",
     
    7171
    7272\code
    73 irb(main):013:0>Caca::Font.my_methods
    74 =>["list"]
     73irb(main):013:0> Caca::Font.my_methods
     74=> ["list"]
    7575\endcode
    7676
    7777\code
    78 irb(main):014:0>Caca::Font.my_instance_methods
    79 =>["blocks", "height", "width"]
     78irb(main):014:0> Caca::Font.my_instance_methods
     79=> ["blocks", "height", "width"]
    8080\endcode
    8181
    8282\code
    83 irb(main):015:0>Caca::Dither.my_instance_methods
    84 =>["algorithm=", "algorithm_list", "antialias=", "antialias_list",
     83irb(main):015:0> Caca::Dither.my_instance_methods
     84=> ["algorithm=", "algorithm_list", "antialias=", "antialias_list",
    8585"brightness=", "charset=", "charset_list", "color=", "color_list",
    8686"contrast=", "gamma=", "palette=", "set_algorithm", "set_antialias",
     
    9090
    9191\code
    92 irb(main):010:0>Caca::Display.my_instance_methods
    93 =>["canvas", "get_event", "height", "mouse=", "mouse_x", "mouse_y", "refresh",
     92irb(main):010:0> Caca::Display.my_instance_methods
     93=> ["canvas", "get_event", "height", "mouse=", "mouse_x", "mouse_y", "refresh",
    9494"set_mouse", "set_time", "set_title", "time", "time=", "title=", "width"]
    9595\endcode
    9696
    9797\code
    98 irb(main):011:0>Caca::Event.constants
    99 =>["Key", "Quit", "TYPE", "Mouse", "Resize"]
     98irb(main):011:0> Caca::Event.constants
     99=> ["Key", "Quit", "TYPE", "Mouse", "Resize"]
    100100\endcode
    101101
    102102\code
    103 irb(main):012:0>Caca::Event.my_instance_methods
    104 =>["quit?"]
     103irb(main):012:0> Caca::Event.my_instance_methods
     104=> ["quit?"]
    105105\endcode
    106106
    107107\code
    108 irb(main):013:0>Caca::Event::Key.my_instance_methods
    109 =>["ch", "utf32", "utf8"]
     108irb(main):013:0> Caca::Event::Key.my_instance_methods
     109=> ["ch", "utf32", "utf8"]
    110110\endcode
    111111
    112112\code
    113 irb(main):014:0>Caca::Event::Mouse.my_instance_methods
    114 =>["button", "x", "y"]
     113irb(main):014:0> Caca::Event::Mouse.my_instance_methods
     114=> ["button", "x", "y"]
    115115\endcode
    116116
    117117\code
    118 irb(main):015:0>Caca::Event::Resize.my_instance_methods
    119 =>["w", "h"]
     118irb(main):015:0> Caca::Event::Resize.my_instance_methods
     119=> ["w", "h"]
    120120\endcode
    121121
     
    123123
    124124\code
    125 $ruby -rcaca -e 'c=Caca::Canvas.new(6, 3).fill_box(0,0,2,2,"#"[0]);
     125$ ruby -rcaca -e 'c=Caca::Canvas.new(6, 3).fill_box(0,0,2,2,"#"[0]);
    126126c2=Caca::Canvas.new(1,1).put_str(0,0,"x"); c.blit(1,1,c2); puts
    127127c.export_to_memory("irc")'
     
    132132
    133133\code
    134 $ruby -e 'puts Caca::Canvas.new(6,3).draw_thin_polyline([[0,0], [0,2],
     134$ ruby -e 'puts Caca::Canvas.new(6,3).draw_thin_polyline([[0,0], [0,2],
    135135[5,2],[0,0]]).export_to_memory("irc")'
    136136-.
     
    140140
    141141\code
    142 $ruby -rcaca -e 'p Caca::Canvas.export_list'
     142$ ruby -rcaca -e 'p Caca::Canvas.export_list'
    143143[["caca", "native libcaca format"], ["ansi", "ANSI"], ["utf8", "UTF-8
    144144withANSI escape codes"], ["utf8cr", "UTF-8 with ANSI escape codes and
     
    149149
    150150\code
    151 $ruby -rcaca -e 'p Caca::Font.list'
     151$ ruby -rcaca -e 'p Caca::Font.list'
    152152["Monospace9", "Monospace Bold 12"]
    153153\endcode
    154154
    155155\code
    156 require'caca'
    157 c= Caca::Canvas.new(20,10)
     156require 'caca'
     157c = Caca::Canvas.new(20,10)
    158158c.put_str(2,3, "plop!")
    159159c.draw_thin_polyline([[0,0],[0,2], [5,2], [0,0]])
    160 d= Caca::Display.new(c)
     160d = Caca::Display.new(c)
    161161d.title= "Test !"
    162162d.refresh
    163163
    164164#Redefine Event::Key#quit? so that q, Q, and Esc become exit keys
    165 moduleCaca
    166 class Event::Key
    167 def quit?
    168 "qQ^[".split('').member?(@ch.chr)
    169 end
    170 end
     165module Caca
     166  class Event::Key
     167    def quit?
     168      "qQ^[".split('').member?(@ch.chr)
     169    end
     170  end
    171171end
    172172
    173173while((e= d.get_event(Caca::Event, -1)) && ! e.quit?)
    174 p e
    175 d.refresh
     174  p e
     175  d.refresh
    176176end
    177177\endcode
Note: See TracChangeset for help on using the changeset viewer.