caca.h File Reference

The libcaca public header. More...


Data Structures

struct  caca_event
 Handling of user events. More...

Defines

#define CACA_API_VERSION_1

Typedefs

typedef struct caca_display caca_display_t
typedef struct caca_event caca_event_t

Enumerations

enum  caca_event_type {
  CACA_EVENT_NONE = 0x0000, CACA_EVENT_KEY_PRESS = 0x0001, CACA_EVENT_KEY_RELEASE = 0x0002, CACA_EVENT_MOUSE_PRESS = 0x0004,
  CACA_EVENT_MOUSE_RELEASE = 0x0008, CACA_EVENT_MOUSE_MOTION = 0x0010, CACA_EVENT_RESIZE = 0x0020, CACA_EVENT_QUIT = 0x0040,
  CACA_EVENT_ANY = 0xffff
}
 User event type enumeration. More...
enum  caca_key {
  CACA_KEY_UNKNOWN = 0x00, CACA_KEY_CTRL_A = 0x01, CACA_KEY_CTRL_B = 0x02, CACA_KEY_CTRL_C = 0x03,
  CACA_KEY_CTRL_D = 0x04, CACA_KEY_CTRL_E = 0x05, CACA_KEY_CTRL_F = 0x06, CACA_KEY_CTRL_G = 0x07,
  CACA_KEY_BACKSPACE = 0x08, CACA_KEY_TAB = 0x09, CACA_KEY_CTRL_J = 0x0a, CACA_KEY_CTRL_K = 0x0b,
  CACA_KEY_CTRL_L = 0x0c, CACA_KEY_RETURN = 0x0d, CACA_KEY_CTRL_N = 0x0e, CACA_KEY_CTRL_O = 0x0f,
  CACA_KEY_CTRL_P = 0x10, CACA_KEY_CTRL_Q = 0x11, CACA_KEY_CTRL_R = 0x12, CACA_KEY_PAUSE = 0x13,
  CACA_KEY_CTRL_T = 0x14, CACA_KEY_CTRL_U = 0x15, CACA_KEY_CTRL_V = 0x16, CACA_KEY_CTRL_W = 0x17,
  CACA_KEY_CTRL_X = 0x18, CACA_KEY_CTRL_Y = 0x19, CACA_KEY_CTRL_Z = 0x1a, CACA_KEY_ESCAPE = 0x1b,
  CACA_KEY_DELETE = 0x7f, CACA_KEY_UP = 0x111, CACA_KEY_DOWN = 0x112, CACA_KEY_LEFT = 0x113,
  CACA_KEY_RIGHT = 0x114, CACA_KEY_INSERT = 0x115, CACA_KEY_HOME = 0x116, CACA_KEY_END = 0x117,
  CACA_KEY_PAGEUP = 0x118, CACA_KEY_PAGEDOWN = 0x119, CACA_KEY_F1 = 0x11a, CACA_KEY_F2 = 0x11b,
  CACA_KEY_F3 = 0x11c, CACA_KEY_F4 = 0x11d, CACA_KEY_F5 = 0x11e, CACA_KEY_F6 = 0x11f,
  CACA_KEY_F7 = 0x120, CACA_KEY_F8 = 0x121, CACA_KEY_F9 = 0x122, CACA_KEY_F10 = 0x123,
  CACA_KEY_F11 = 0x124, CACA_KEY_F12 = 0x125, CACA_KEY_F13 = 0x126, CACA_KEY_F14 = 0x127,
  CACA_KEY_F15 = 0x128
}
 Special key values. More...

Functions

__extern caca_display_tcaca_create_display (cucul_canvas_t *)
 Attach a caca graphical context to a cucul canvas.
__extern caca_display_tcaca_create_display_with_driver (cucul_canvas_t *, char const *)
 Attach a specific caca graphical context to a cucul canvas.
__extern char const *const * caca_get_display_driver_list (void)
 Get available display drivers.
__extern char const * caca_get_display_driver (caca_display_t *)
 Return a caca graphical context's current output driver.
__extern int caca_set_display_driver (caca_display_t *, char const *)
 Set the output driver.
__extern int caca_free_display (caca_display_t *)
 Detach a caca graphical context from a cucul backend context.
__extern cucul_canvas_tcaca_get_canvas (caca_display_t *)
 Get the canvas attached to a caca graphical context.
__extern int caca_refresh_display (caca_display_t *)
 Flush pending changes and redraw the screen.
__extern int caca_set_display_time (caca_display_t *, int)
 Set the refresh delay.
__extern int caca_get_display_time (caca_display_t const *)
 Get the display's average rendering time.
__extern int caca_get_display_width (caca_display_t const *)
 Get the display width.
__extern int caca_get_display_height (caca_display_t const *)
 Get the display height.
__extern int caca_set_display_title (caca_display_t *, char const *)
 Set the display title.
__extern int caca_set_mouse (caca_display_t *, int)
 Show or hide the mouse pointer.
__extern int caca_set_cursor (caca_display_t *, int)
 Show or hide the cursor.
__extern char const * caca_get_version (void)
 Return the libcaca version.
__extern int caca_get_event (caca_display_t *, int, caca_event_t *, int)
 Get the next mouse or keyboard input event.
__extern int caca_get_mouse_x (caca_display_t const *)
 Return the X mouse coordinate.
__extern int caca_get_mouse_y (caca_display_t const *)
 Return the Y mouse coordinate.
__extern enum caca_event_type caca_get_event_type (caca_event_t const *)
 Return an event's type.
__extern int caca_get_event_key_ch (caca_event_t const *)
 Return a key press or key release event's value.
__extern uint32_t caca_get_event_key_utf32 (caca_event_t const *)
 Return a key press or key release event's Unicode value.
__extern int caca_get_event_key_utf8 (caca_event_t const *, char *)
 Return a key press or key release event's UTF-8 value.
__extern int caca_get_event_mouse_button (caca_event_t const *)
 Return a mouse press or mouse release event's button.
__extern int caca_get_event_mouse_x (caca_event_t const *)
 Return a mouse motion event's X coordinate.
__extern int caca_get_event_mouse_y (caca_event_t const *)
 Return a mouse motion event's Y coordinate.
__extern int caca_get_event_resize_width (caca_event_t const *)
 Return a resize event's display width value.
__extern int caca_get_event_resize_height (caca_event_t const *)
 Return a resize event's display height value.


Detailed Description

Version:
$Id$
Author:
Sam Hocevar <sam@zoy.org> This header contains the public types and functions that applications using libcaca may use.

Define Documentation

#define CACA_API_VERSION_1

libcaca API version


Typedef Documentation

typedef struct caca_display caca_display_t

libcaca display context

typedef struct caca_event caca_event_t

libcaca event structure


Enumeration Type Documentation

This enum serves two purposes:

Enumerator:
CACA_EVENT_NONE  No event.
CACA_EVENT_KEY_PRESS  A key was pressed.
CACA_EVENT_KEY_RELEASE  A key was released.
CACA_EVENT_MOUSE_PRESS  A mouse button was pressed.
CACA_EVENT_MOUSE_RELEASE  A mouse button was released.
CACA_EVENT_MOUSE_MOTION  The mouse was moved.
CACA_EVENT_RESIZE  The window was resized.
CACA_EVENT_QUIT  The user requested to quit.
CACA_EVENT_ANY  Bitmask for any event.

enum caca_key

Special key values returned by caca_get_event() for which there is no printable ASCII equivalent.

Enumerator:
CACA_KEY_UNKNOWN  Unknown key.
CACA_KEY_CTRL_A  The Ctrl-A key.
CACA_KEY_CTRL_B  The Ctrl-B key.
CACA_KEY_CTRL_C  The Ctrl-C key.
CACA_KEY_CTRL_D  The Ctrl-D key.
CACA_KEY_CTRL_E  The Ctrl-E key.
CACA_KEY_CTRL_F  The Ctrl-F key.
CACA_KEY_CTRL_G  The Ctrl-G key.
CACA_KEY_BACKSPACE  The backspace key.
CACA_KEY_TAB  The tabulation key.
CACA_KEY_CTRL_J  The Ctrl-J key.
CACA_KEY_CTRL_K  The Ctrl-K key.
CACA_KEY_CTRL_L  The Ctrl-L key.
CACA_KEY_RETURN  The return key.
CACA_KEY_CTRL_N  The Ctrl-N key.
CACA_KEY_CTRL_O  The Ctrl-O key.
CACA_KEY_CTRL_P  The Ctrl-P key.
CACA_KEY_CTRL_Q  The Ctrl-Q key.
CACA_KEY_CTRL_R  The Ctrl-R key.
CACA_KEY_PAUSE  The pause key.
CACA_KEY_CTRL_T  The Ctrl-T key.
CACA_KEY_CTRL_U  The Ctrl-U key.
CACA_KEY_CTRL_V  The Ctrl-V key.
CACA_KEY_CTRL_W  The Ctrl-W key.
CACA_KEY_CTRL_X  The Ctrl-X key.
CACA_KEY_CTRL_Y  The Ctrl-Y key.
CACA_KEY_CTRL_Z  The Ctrl-Z key.
CACA_KEY_ESCAPE  The escape key.
CACA_KEY_DELETE  The delete key.
CACA_KEY_UP  The up arrow key.
CACA_KEY_DOWN  The down arrow key.
CACA_KEY_LEFT  The left arrow key.
CACA_KEY_RIGHT  The right arrow key.
CACA_KEY_INSERT  The insert key.
CACA_KEY_HOME  The home key.
CACA_KEY_END  The end key.
CACA_KEY_PAGEUP  The page up key.
CACA_KEY_PAGEDOWN  The page down key.
CACA_KEY_F1  The F1 key.
CACA_KEY_F2  The F2 key.
CACA_KEY_F3  The F3 key.
CACA_KEY_F4  The F4 key.
CACA_KEY_F5  The F5 key.
CACA_KEY_F6  The F6 key.
CACA_KEY_F7  The F7 key.
CACA_KEY_F8  The F8 key.
CACA_KEY_F9  The F9 key.
CACA_KEY_F10  The F10 key.
CACA_KEY_F11  The F11 key.
CACA_KEY_F12  The F12 key.
CACA_KEY_F13  The F13 key.
CACA_KEY_F14  The F14 key.
CACA_KEY_F15  The F15 key.