| @@ -92,6 +92,6 @@ unsigned int Caca::getMouseY() | |||||
| void Caca::setMouse(int v) | void Caca::setMouse(int v) | ||||
| { | { | ||||
| caca_set_mouse(dp, v); | |||||
| caca_set_mouse(dp, v); | |||||
| } | } | ||||
| @@ -30,28 +30,28 @@ | |||||
| class Event | class Event | ||||
| { | { | ||||
| friend class Caca; | friend class Caca; | ||||
| public: | |||||
| public: | |||||
| enum caca_event_type | enum caca_event_type | ||||
| { | |||||
| CACA_EVENT_NONE = 0x0000, /**< No event. */ | |||||
| { | |||||
| CACA_EVENT_NONE = 0x0000, /**< No event. */ | |||||
| CACA_EVENT_KEY_PRESS = 0x0001, /**< A key was pressed. */ | |||||
| CACA_EVENT_KEY_RELEASE = 0x0002, /**< A key was released. */ | |||||
| CACA_EVENT_MOUSE_PRESS = 0x0004, /**< A mouse button was pressed. */ | |||||
| CACA_EVENT_MOUSE_RELEASE = 0x0008, /**< A mouse button was released. */ | |||||
| CACA_EVENT_MOUSE_MOTION = 0x0010, /**< The mouse was moved. */ | |||||
| CACA_EVENT_RESIZE = 0x0020, /**< The window was resized. */ | |||||
| CACA_EVENT_KEY_PRESS = 0x0001, /**< A key was pressed. */ | |||||
| CACA_EVENT_KEY_RELEASE = 0x0002, /**< A key was released. */ | |||||
| CACA_EVENT_MOUSE_PRESS = 0x0004, /**< A mouse button was pressed. */ | |||||
| CACA_EVENT_MOUSE_RELEASE = 0x0008, /**< A mouse button was released. */ | |||||
| CACA_EVENT_MOUSE_MOTION = 0x0010, /**< The mouse was moved. */ | |||||
| CACA_EVENT_RESIZE = 0x0020, /**< The window was resized. */ | |||||
| CACA_EVENT_ANY = 0xffff /**< Bitmask for any event. */ | |||||
| } type; | |||||
| CACA_EVENT_ANY = 0xffff /**< Bitmask for any event. */ | |||||
| } type; | |||||
| protected: | |||||
| protected: | |||||
| caca_event e; | caca_event e; | ||||
| }; | }; | ||||
| class Caca | class Caca | ||||
| { | { | ||||
| public: | |||||
| public: | |||||
| Caca(); | Caca(); | ||||
| Caca(Cucul *cv); | Caca(Cucul *cv); | ||||
| ~Caca(); | ~Caca(); | ||||
| @@ -69,7 +69,7 @@ class Caca | |||||
| unsigned int getMouseY(); | unsigned int getMouseY(); | ||||
| void setMouse(int); | void setMouse(int); | ||||
| private: | |||||
| private: | |||||
| caca_display_t *dp; | caca_display_t *dp; | ||||
| }; | }; | ||||
| @@ -38,10 +38,10 @@ class Font | |||||
| unsigned int getWidth(); | unsigned int getWidth(); | ||||
| unsigned int getHeight(); | unsigned int getHeight(); | ||||
| void renderCanvas(Cucul *, unsigned char *, unsigned int, unsigned int, unsigned int); | void renderCanvas(Cucul *, unsigned char *, unsigned int, unsigned int, unsigned int); | ||||
| private: | private: | ||||
| cucul_font *font; | cucul_font *font; | ||||
| }; | }; | ||||
| class Dither | class Dither | ||||
| @@ -92,7 +92,7 @@ class Cucul | |||||
| friend class Dither; | friend class Dither; | ||||
| friend class Font; | friend class Font; | ||||
| friend class Buffer; | friend class Buffer; | ||||
| public: | |||||
| public: | |||||
| Cucul(); | Cucul(); | ||||
| Cucul(int width, int height); | Cucul(int width, int height); | ||||
| Cucul(Buffer *, char const *); | Cucul(Buffer *, char const *); | ||||
| @@ -128,10 +128,10 @@ class Cucul | |||||
| void fillTriangle(int, int, int, int, int, int, char const *); | void fillTriangle(int, int, int, int, int, int, char const *); | ||||
| int Rand(int, int); | int Rand(int, int); | ||||
| protected: | |||||
| protected: | |||||
| cucul_canvas_t *get_cucul_canvas_t(); | cucul_canvas_t *get_cucul_canvas_t(); | ||||
| private: | |||||
| private: | |||||
| cucul_canvas_t *cv; | cucul_canvas_t *cv; | ||||
| }; | }; | ||||
| @@ -90,8 +90,8 @@ int main(int argc, char **argv) | |||||
| case CACA_KEY_RIGHT: x += 2; refresh = 1; goto stopevents; | case CACA_KEY_RIGHT: x += 2; refresh = 1; goto stopevents; | ||||
| case CACA_KEY_UP: y--; refresh = 1; goto stopevents; | case CACA_KEY_UP: y--; refresh = 1; goto stopevents; | ||||
| case CACA_KEY_DOWN: y++; refresh = 1; goto stopevents; | case CACA_KEY_DOWN: y++; refresh = 1; goto stopevents; | ||||
| case CACA_KEY_PAGEUP: y-=25; refresh = 1; goto stopevents; | |||||
| case CACA_KEY_PAGEDOWN: y+=25; refresh = 1; goto stopevents; | |||||
| case CACA_KEY_PAGEUP: y-=25; refresh = 1; goto stopevents; | |||||
| case CACA_KEY_PAGEDOWN: y+=25; refresh = 1; goto stopevents; | |||||
| case CACA_KEY_ESCAPE: | case CACA_KEY_ESCAPE: | ||||
| case 'q': | case 'q': | ||||
| goto quit; | goto quit; | ||||