Last change
on this file since 2042 was
2042,
checked in by Pascal Terjan, 13 years ago
|
- Add Caca::Event#quit? to make tests nicer
|
File size:
873 bytes
|
Line | |
---|
1 | require 'cucul' |
---|
2 | require 'caca.so' |
---|
3 | |
---|
4 | module Caca |
---|
5 | class Event |
---|
6 | def Event.to_i |
---|
7 | const_get("TYPE") |
---|
8 | end |
---|
9 | def Event.|(i) |
---|
10 | i = i.to_i |
---|
11 | const_get("TYPE")|i |
---|
12 | end |
---|
13 | def quit? |
---|
14 | false |
---|
15 | end |
---|
16 | class Key |
---|
17 | attr_reader :ch, :utf32, :utf8 |
---|
18 | def initialize(ch, utf32, utf8) |
---|
19 | @ch, @utf32, @utf8 = ch, utf32, utf8 |
---|
20 | end |
---|
21 | end |
---|
22 | class Mouse |
---|
23 | attr_reader :x, :y, :button |
---|
24 | def initialize(x, y, button) |
---|
25 | @x, @y, @button = x, y, button |
---|
26 | end |
---|
27 | end |
---|
28 | class Resize |
---|
29 | attr_reader :w, :h |
---|
30 | def initialize(w, h) |
---|
31 | @w, @h = w, h |
---|
32 | end |
---|
33 | end |
---|
34 | class Quit |
---|
35 | def quit? |
---|
36 | true |
---|
37 | end |
---|
38 | end |
---|
39 | end |
---|
40 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.