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.
 
 
 
 
 
 

77 lines
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. {
  28. friend class Caca;
  29. public:
  30. enum caca_event_type
  31. {
  32. CACA_EVENT_NONE = 0x0000, /**< No event. */
  33. CACA_EVENT_KEY_PRESS = 0x0001, /**< A key was pressed. */
  34. CACA_EVENT_KEY_RELEASE = 0x0002, /**< A key was released. */
  35. CACA_EVENT_MOUSE_PRESS = 0x0004, /**< A mouse button was pressed. */
  36. CACA_EVENT_MOUSE_RELEASE = 0x0008, /**< A mouse button was released. */
  37. CACA_EVENT_MOUSE_MOTION = 0x0010, /**< The mouse was moved. */
  38. CACA_EVENT_RESIZE = 0x0020, /**< The window was resized. */
  39. CACA_EVENT_ANY = 0xffff /**< Bitmask for any event. */
  40. } type;
  41. protected:
  42. caca_event e;
  43. };
  44. class Caca
  45. {
  46. public:
  47. Caca();
  48. Caca(Cucul *cv);
  49. ~Caca();
  50. void attach(Cucul *cv);
  51. void detach();
  52. void set_delay(unsigned int);
  53. void display();
  54. unsigned int get_rendertime();
  55. unsigned int get_display_width();
  56. unsigned int get_display_height();
  57. int set_display_title(char const *);
  58. int get_event(unsigned int, Event*, int);
  59. unsigned int get_mouse_x();
  60. unsigned int get_mouse_y();
  61. void set_mouse(int);
  62. private:
  63. caca_display_t *dp;
  64. };
  65. #endif /* _CACA_PP_H */