選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

77 行
1.9 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 setDelay(unsigned int);
  53. void Display();
  54. unsigned int getRendertime();
  55. unsigned int getWidth();
  56. unsigned int getHeight();
  57. int setTitle(char const *);
  58. int getEvent(unsigned int, Event*, int);
  59. unsigned int getMouseX();
  60. unsigned int getMouseY();
  61. void setMouse(int);
  62. private:
  63. caca_display_t *dp;
  64. };
  65. #endif /* _CACA_PP_H */