25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

66 satır
1.6 KiB

  1. /* $Id$ */ /** \page libcaca-ruby-api Libcaca Ruby API
  2. The classes available for libcaca are :
  3. \li \b Caca::Display
  4. \li \b Caca::Event
  5. \li \b Caca::Event::Key
  6. \li \b Caca::Event::Key::Press
  7. \li \b Caca::Event::Key::Release
  8. \li \b Caca::Event::Mouse
  9. \li \b Caca::Event::Mouse::Press
  10. \li \b Caca::Event::Mouse::Release
  11. \li \b Caca::Event::Mouse::Motion
  12. \li \b Caca::Event::Resize
  13. \li \b Caca::Event::Quit
  14. \code
  15. irb(main):007:0> Caca::Display.instance_methods.sort -
  16. Caca::Display.ancestors[1].instance_methods
  17. => ["get_event", "height", "mouse=", "mouse_x", "mouse_y", "refresh",
  18. "set_mouse", "set_time", "set_title", "time", "time=", "title=", "width"]
  19. \endcode
  20. \code
  21. irb(main):008:0> Caca::Event.constants
  22. => ["Key", "Quit", "TYPE", "Mouse", "Resize"]
  23. \endcode
  24. \code
  25. irb(main):009:0> Caca::Event::Key.instance_methods - Caca::Event::Key.ancestors[1].instance_methods
  26. => ["ch", "utf32", "utf8"]
  27. \endcode
  28. \code
  29. irb(main):010:0> Caca::Event::Key.instance_methods - Caca::Event::Mouse.ancestors[1].instance_methods
  30. => ["ch", "utf32", "utf8"]
  31. \endcode
  32. \code
  33. irb(main):011:0> Caca::Event::Mouse.instance_methods - Caca::Event::Mouse.ancestors[1].instance_methods
  34. => ["button", "x", "y"]
  35. \endcode
  36. \code
  37. irb(main):018:0> Caca::Event::Resize.instance_methods - Caca::Event::Resize.ancestors[1].instance_methods
  38. => ["w", "h"]
  39. \endcode
  40. \section Samples
  41. \code
  42. require 'caca'
  43. c = Cucul::Canvas.new(20,10)
  44. c.put_str(2, 3, "plop!")
  45. c.draw_thin_polyline([[0,0], [0,2], [5,2], [0,0]])
  46. d = Caca::Display.new(c)
  47. d.title = "Test !"
  48. d.refresh
  49. while((e = d.get_event(Caca::Event, -1)) && ! e.quit?)
  50. p e
  51. d.refresh
  52. end
  53. \endcode
  54. */