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.
 
 
 
 
 
 

80 rivejä
2.0 KiB

  1. /*
  2. * libcaca++ C++ bindings for libcaca
  3. * Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
  4. * All Rights Reserved
  5. *
  6. * $Id$
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the Do What The Fuck You Want To
  10. * Public License, Version 2, as published by Sam Hocevar. See
  11. * http://sam.zoy.org/wtfpl/COPYING for more details.
  12. */
  13. /** \file caca++.h
  14. * \version \$Id$
  15. * \author Jean-Yves Lamoureux <jylam@lnxscene.org>
  16. * \brief The \e libcaca++ public header.
  17. *
  18. * This header contains the public types and functions that applications
  19. * using \e libcaca++ may use.
  20. */
  21. #ifndef _CACA_PP_H
  22. #define _CACA_PP_H
  23. #include "cucul.h"
  24. #include "caca.h"
  25. #include "cucul++.h"
  26. class Event {
  27. friend class Caca;
  28. public:
  29. enum caca_event_type
  30. {
  31. CACA_EVENT_NONE = 0x0000, /**< No event. */
  32. CACA_EVENT_KEY_PRESS = 0x0001, /**< A key was pressed. */
  33. CACA_EVENT_KEY_RELEASE = 0x0002, /**< A key was released. */
  34. CACA_EVENT_MOUSE_PRESS = 0x0004, /**< A mouse button was pressed. */
  35. CACA_EVENT_MOUSE_RELEASE = 0x0008, /**< A mouse button was released. */
  36. CACA_EVENT_MOUSE_MOTION = 0x0010, /**< The mouse was moved. */
  37. CACA_EVENT_RESIZE = 0x0020, /**< The window was resized. */
  38. CACA_EVENT_ANY = 0xffff /**< Bitmask for any event. */
  39. } type;
  40. protected:
  41. caca_event *e;
  42. };
  43. class Caca {
  44. public:
  45. Caca();
  46. Caca(Cucul *qq);
  47. ~Caca();
  48. void attach (Cucul *qq);
  49. void detach ();
  50. void set_delay (unsigned int);
  51. void display ();
  52. unsigned int get_rendertime ();
  53. unsigned int get_window_width ();
  54. unsigned int get_window_height ();
  55. int set_window_title (char const *);
  56. int get_event (unsigned int, Event*, int);
  57. unsigned int get_mouse_x ();
  58. unsigned int get_mouse_y ();
  59. void set_mouse (int);
  60. private:
  61. caca_t *kk;
  62. };
  63. #endif /* _CACA_PP_H */