Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

caca++.h 2.0 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 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 */