Line | |
---|
1 | require 'cucul' |
---|
2 | require 'caca.so' |
---|
3 | |
---|
4 | module Caca |
---|
5 | class Display |
---|
6 | attr_reader :canvas |
---|
7 | end |
---|
8 | class Event |
---|
9 | def Event.to_i |
---|
10 | const_get("TYPE") |
---|
11 | end |
---|
12 | def Event.|(i) |
---|
13 | i = i.to_i |
---|
14 | const_get("TYPE")|i |
---|
15 | end |
---|
16 | def quit? |
---|
17 | false |
---|
18 | end |
---|
19 | class Key |
---|
20 | attr_reader :ch, :utf32, :utf8 |
---|
21 | def initialize(ch, utf32, utf8) |
---|
22 | @ch, @utf32, @utf8 = ch, utf32, utf8 |
---|
23 | end |
---|
24 | end |
---|
25 | class Mouse |
---|
26 | attr_reader :x, :y, :button |
---|
27 | def initialize(x, y, button) |
---|
28 | @x, @y, @button = x, y, button |
---|
29 | end |
---|
30 | end |
---|
31 | class Resize |
---|
32 | attr_reader :w, :h |
---|
33 | def initialize(w, h) |
---|
34 | @w, @h = w, h |
---|
35 | end |
---|
36 | end |
---|
37 | class Quit |
---|
38 | def quit? |
---|
39 | true |
---|
40 | end |
---|
41 | end |
---|
42 | end |
---|
43 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.