1 | /* |
---|
2 | * libcaca++ C++ bindings for libcaca |
---|
3 | * Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org> |
---|
4 | * All Rights Reserved |
---|
5 | * |
---|
6 | * $Id: caca++.h 1462 2006-12-12 01:53:54Z sam $ |
---|
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 | |
---|
15 | /** \file caca++.h |
---|
16 | * \version \$Id: caca++.h 1462 2006-12-12 01:53:54Z sam $ |
---|
17 | * \author Jean-Yves Lamoureux <jylam@lnxscene.org> |
---|
18 | * \brief The \e libcaca++ public header. |
---|
19 | * |
---|
20 | * This header contains the public types and functions that applications |
---|
21 | * using \e libcaca++ may use. |
---|
22 | */ |
---|
23 | #ifndef _CACA_PP_H |
---|
24 | #define _CACA_PP_H |
---|
25 | |
---|
26 | #include <cucul.h> |
---|
27 | #include <caca.h> |
---|
28 | |
---|
29 | #include <cucul++.h> |
---|
30 | |
---|
31 | class Event |
---|
32 | { |
---|
33 | friend class Caca; |
---|
34 | public: |
---|
35 | enum caca_event_type |
---|
36 | { |
---|
37 | CACA_EVENT_NONE = 0x0000, /**< No event. */ |
---|
38 | |
---|
39 | CACA_EVENT_KEY_PRESS = 0x0001, /**< A key was pressed. */ |
---|
40 | CACA_EVENT_KEY_RELEASE = 0x0002, /**< A key was released. */ |
---|
41 | CACA_EVENT_MOUSE_PRESS = 0x0004, /**< A mouse button was pressed. */ |
---|
42 | CACA_EVENT_MOUSE_RELEASE = 0x0008, /**< A mouse button was released. */ |
---|
43 | CACA_EVENT_MOUSE_MOTION = 0x0010, /**< The mouse was moved. */ |
---|
44 | CACA_EVENT_RESIZE = 0x0020, /**< The window was resized. */ |
---|
45 | |
---|
46 | CACA_EVENT_ANY = 0xffff /**< Bitmask for any event. */ |
---|
47 | } type; |
---|
48 | |
---|
49 | protected: |
---|
50 | caca_event e; |
---|
51 | }; |
---|
52 | |
---|
53 | class Caca |
---|
54 | { |
---|
55 | public: |
---|
56 | Caca(); |
---|
57 | Caca(Cucul *cv); |
---|
58 | ~Caca(); |
---|
59 | |
---|
60 | void Attach(Cucul *cv); |
---|
61 | void Detach(); |
---|
62 | void setDisplayTime(unsigned int); |
---|
63 | |
---|
64 | void Display(); |
---|
65 | unsigned int getDisplayTime(); |
---|
66 | unsigned int getWidth(); |
---|
67 | unsigned int getHeight(); |
---|
68 | int setTitle(char const *); |
---|
69 | int getEvent(unsigned int, Event*, int); |
---|
70 | unsigned int getMouseX(); |
---|
71 | unsigned int getMouseY(); |
---|
72 | void setMouse(int); |
---|
73 | |
---|
74 | private: |
---|
75 | caca_display_t *dp; |
---|
76 | }; |
---|
77 | |
---|
78 | #endif /* _CACA_PP_H */ |
---|