File: caca.rb

package info (click to toggle)
libcaca 0.99.beta20-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,264 kB
  • sloc: ansic: 25,091; php: 2,763; python: 2,637; cs: 1,213; cpp: 1,127; java: 916; objc: 836; makefile: 543; perl: 505; sh: 472; asm: 297; ruby: 215; xml: 33
file content (42 lines) | stat: -rw-r--r-- 908 bytes parent folder | download | duplicates (3)
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
41
42
require 'caca'

module Caca
    class Display
        attr_reader :canvas
    end
    class Event
        def Event.to_i
            const_get("TYPE")
        end
        def Event.|(i)
            i = i.to_i
            const_get("TYPE")|i
        end
        def quit?
            false
        end
        class Key
            attr_reader :ch, :utf32, :utf8
            def initialize(ch, utf32, utf8)
                @ch, @utf32, @utf8 = ch, utf32, utf8
            end
        end
        class Mouse
            attr_reader :x, :y, :button
            def initialize(x, y, button)
                @x, @y, @button = x, y, button
            end
        end
        class Resize
            attr_reader :w, :h
            def initialize(w, h)
                @w, @h = w, h
            end
        end
        class Quit
            def quit?
                true
            end
        end
    end
end