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.
 
 
 
 
 
 

79 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. It comes without any warranty, to
  9. * the extent permitted by applicable law. You can redistribute it
  10. * and/or modify it under the terms of the Do What The Fuck You Want
  11. * To Public License, Version 2, as published by Sam Hocevar. See
  12. * http://sam.zoy.org/wtfpl/COPYING for more details.
  13. */
  14. /** \file caca++.h
  15. * \version \$Id$
  16. * \author Jean-Yves Lamoureux <jylam@lnxscene.org>
  17. * \brief The \e libcaca++ public header.
  18. *
  19. * This header contains the public types and functions that applications
  20. * using \e libcaca++ may use.
  21. */
  22. #ifndef _CACA_PP_H
  23. #define _CACA_PP_H
  24. #include <cucul.h>
  25. #include <caca.h>
  26. #include <cucul++.h>
  27. class Event
  28. {
  29. friend class Caca;
  30. public:
  31. enum caca_event_type
  32. {
  33. CACA_EVENT_NONE = 0x0000, /**< No event. */
  34. CACA_EVENT_KEY_PRESS = 0x0001, /**< A key was pressed. */
  35. CACA_EVENT_KEY_RELEASE = 0x0002, /**< A key was released. */
  36. CACA_EVENT_MOUSE_PRESS = 0x0004, /**< A mouse button was pressed. */
  37. CACA_EVENT_MOUSE_RELEASE = 0x0008, /**< A mouse button was released. */
  38. CACA_EVENT_MOUSE_MOTION = 0x0010, /**< The mouse was moved. */
  39. CACA_EVENT_RESIZE = 0x0020, /**< The window was resized. */
  40. CACA_EVENT_ANY = 0xffff /**< Bitmask for any event. */
  41. } type;
  42. protected:
  43. caca_event_t e;
  44. };
  45. class Caca
  46. {
  47. public:
  48. Caca();
  49. Caca(Cucul *cv);
  50. ~Caca();
  51. void Attach(Cucul *cv);
  52. void Detach();
  53. void setDisplayTime(unsigned int);
  54. void Display();
  55. unsigned int getDisplayTime();
  56. unsigned int getWidth();
  57. unsigned int getHeight();
  58. int setTitle(char const *);
  59. int getEvent(unsigned int, Event*, int);
  60. unsigned int getMouseX();
  61. unsigned int getMouseY();
  62. void setMouse(int);
  63. private:
  64. caca_display_t *dp;
  65. };
  66. #endif /* _CACA_PP_H */