You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

caca.rb 908 B

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