| 1 | /* |
|---|
| 2 | * libcaca Colour ASCII-Art library |
|---|
| 3 | * Copyright (c) 2002-2010 Sam Hocevar <sam@hocevar.net> |
|---|
| 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 | |
|---|
| 15 | /** \file caca.h |
|---|
| 16 | * \version \$Id$ |
|---|
| 17 | * \author Sam Hocevar <sam@hocevar.net> |
|---|
| 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 | |
|---|
| 24 | #ifndef __CACA_H__ |
|---|
| 25 | #define __CACA_H__ |
|---|
| 26 | |
|---|
| 27 | #include <caca_types.h> |
|---|
| 28 | |
|---|
| 29 | #if !defined(__KERNEL__) |
|---|
| 30 | # include <stdarg.h> |
|---|
| 31 | #endif |
|---|
| 32 | |
|---|
| 33 | #undef __extern |
|---|
| 34 | #if defined _DOXYGEN_SKIP_ME |
|---|
| 35 | #elif defined _WIN32 && defined __LIBCACA__ && defined DLL_EXPORT |
|---|
| 36 | # define __extern extern __declspec(dllexport) |
|---|
| 37 | #elif defined _WIN32 && !defined __LIBCACA__ |
|---|
| 38 | # define __extern extern __declspec(dllimport) |
|---|
| 39 | #else |
|---|
| 40 | # define __extern extern |
|---|
| 41 | #endif |
|---|
| 42 | |
|---|
| 43 | /** libcaca API version */ |
|---|
| 44 | #define CACA_API_VERSION_1 |
|---|
| 45 | |
|---|
| 46 | #ifdef __cplusplus |
|---|
| 47 | extern "C" |
|---|
| 48 | { |
|---|
| 49 | #endif |
|---|
| 50 | |
|---|
| 51 | /** \e libcaca canvas */ |
|---|
| 52 | typedef struct caca_canvas caca_canvas_t; |
|---|
| 53 | /** dither structure */ |
|---|
| 54 | typedef struct caca_dither caca_dither_t; |
|---|
| 55 | /** font structure */ |
|---|
| 56 | typedef struct caca_font caca_font_t; |
|---|
| 57 | /** file handle structure */ |
|---|
| 58 | typedef struct caca_file caca_file_t; |
|---|
| 59 | /** \e libcaca display context */ |
|---|
| 60 | typedef struct caca_display caca_display_t; |
|---|
| 61 | /** \e libcaca event structure */ |
|---|
| 62 | typedef struct caca_event caca_event_t; |
|---|
| 63 | |
|---|
| 64 | /** \defgroup caca_attr libcaca attribute definitions |
|---|
| 65 | * |
|---|
| 66 | * Colours and styles that can be used with caca_set_attr(). |
|---|
| 67 | * |
|---|
| 68 | * @{ */ |
|---|
| 69 | /** \e libcaca colour keyword */ |
|---|
| 70 | enum caca_color |
|---|
| 71 | { |
|---|
| 72 | CACA_BLACK = 0x00, /**< The colour index for black. */ |
|---|
| 73 | CACA_BLUE = 0x01, /**< The colour index for blue. */ |
|---|
| 74 | CACA_GREEN = 0x02, /**< The colour index for green. */ |
|---|
| 75 | CACA_CYAN = 0x03, /**< The colour index for cyan. */ |
|---|
| 76 | CACA_RED = 0x04, /**< The colour index for red. */ |
|---|
| 77 | CACA_MAGENTA = 0x05, /**< The colour index for magenta. */ |
|---|
| 78 | CACA_BROWN = 0x06, /**< The colour index for brown. */ |
|---|
| 79 | CACA_LIGHTGRAY = 0x07, /**< The colour index for light gray. */ |
|---|
| 80 | CACA_DARKGRAY = 0x08, /**< The colour index for dark gray. */ |
|---|
| 81 | CACA_LIGHTBLUE = 0x09, /**< The colour index for blue. */ |
|---|
| 82 | CACA_LIGHTGREEN = 0x0a, /**< The colour index for light green. */ |
|---|
| 83 | CACA_LIGHTCYAN = 0x0b, /**< The colour index for light cyan. */ |
|---|
| 84 | CACA_LIGHTRED = 0x0c, /**< The colour index for light red. */ |
|---|
| 85 | CACA_LIGHTMAGENTA = 0x0d, /**< The colour index for light magenta. */ |
|---|
| 86 | CACA_YELLOW = 0x0e, /**< The colour index for yellow. */ |
|---|
| 87 | CACA_WHITE = 0x0f, /**< The colour index for white. */ |
|---|
| 88 | CACA_DEFAULT = 0x10, /**< The output driver's default colour. */ |
|---|
| 89 | CACA_TRANSPARENT = 0x20, /**< The transparent colour. */ |
|---|
| 90 | }; |
|---|
| 91 | |
|---|
| 92 | /** \e libcaca style keyword */ |
|---|
| 93 | enum caca_style |
|---|
| 94 | { |
|---|
| 95 | CACA_BOLD = 0x01, /**< The style mask for bold. */ |
|---|
| 96 | CACA_ITALICS = 0x02, /**< The style mask for italics. */ |
|---|
| 97 | CACA_UNDERLINE = 0x04, /**< The style mask for underline. */ |
|---|
| 98 | CACA_BLINK = 0x08, /**< The style mask for blink. */ |
|---|
| 99 | }; |
|---|
| 100 | /* @} */ |
|---|
| 101 | |
|---|
| 102 | /** \brief User event type enumeration. |
|---|
| 103 | * |
|---|
| 104 | * This enum serves two purposes: |
|---|
| 105 | * - Build listening masks for caca_get_event(). |
|---|
| 106 | * - Define the type of a \e caca_event_t. |
|---|
| 107 | */ |
|---|
| 108 | enum caca_event_type |
|---|
| 109 | { |
|---|
| 110 | CACA_EVENT_NONE = 0x0000, /**< No event. */ |
|---|
| 111 | |
|---|
| 112 | CACA_EVENT_KEY_PRESS = 0x0001, /**< A key was pressed. */ |
|---|
| 113 | CACA_EVENT_KEY_RELEASE = 0x0002, /**< A key was released. */ |
|---|
| 114 | CACA_EVENT_MOUSE_PRESS = 0x0004, /**< A mouse button was pressed. */ |
|---|
| 115 | CACA_EVENT_MOUSE_RELEASE = 0x0008, /**< A mouse button was released. */ |
|---|
| 116 | CACA_EVENT_MOUSE_MOTION = 0x0010, /**< The mouse was moved. */ |
|---|
| 117 | CACA_EVENT_RESIZE = 0x0020, /**< The window was resized. */ |
|---|
| 118 | CACA_EVENT_QUIT = 0x0040, /**< The user requested to quit. */ |
|---|
| 119 | |
|---|
| 120 | CACA_EVENT_ANY = 0xffff /**< Bitmask for any event. */ |
|---|
| 121 | }; |
|---|
| 122 | |
|---|
| 123 | /** \brief Handling of user events. |
|---|
| 124 | * |
|---|
| 125 | * This structure is filled by caca_get_event() when an event is received. |
|---|
| 126 | * It is an opaque structure that should only be accessed through |
|---|
| 127 | * caca_event_get_type() and similar functions. The struct members may no |
|---|
| 128 | * longer be directly accessible in future versions. |
|---|
| 129 | */ |
|---|
| 130 | struct caca_event |
|---|
| 131 | { |
|---|
| 132 | enum caca_event_type type; /**< The event type. */ |
|---|
| 133 | union |
|---|
| 134 | { |
|---|
| 135 | struct { int x, y, button; } mouse; |
|---|
| 136 | struct { int w, h; } resize; |
|---|
| 137 | struct { int ch; uint32_t utf32; char utf8[8]; } key; |
|---|
| 138 | } data; /**< The event information data */ |
|---|
| 139 | #if !defined(_DOXYGEN_SKIP_ME) |
|---|
| 140 | uint8_t padding[16]; |
|---|
| 141 | #endif |
|---|
| 142 | }; |
|---|
| 143 | |
|---|
| 144 | /** \brief Special key values. |
|---|
| 145 | * |
|---|
| 146 | * Special key values returned by caca_get_event() for which there is no |
|---|
| 147 | * printable ASCII equivalent. |
|---|
| 148 | */ |
|---|
| 149 | enum caca_key |
|---|
| 150 | { |
|---|
| 151 | CACA_KEY_UNKNOWN = 0x00, /**< Unknown key. */ |
|---|
| 152 | |
|---|
| 153 | /* The following keys have ASCII equivalents */ |
|---|
| 154 | CACA_KEY_CTRL_A = 0x01, /**< The Ctrl-A key. */ |
|---|
| 155 | CACA_KEY_CTRL_B = 0x02, /**< The Ctrl-B key. */ |
|---|
| 156 | CACA_KEY_CTRL_C = 0x03, /**< The Ctrl-C key. */ |
|---|
| 157 | CACA_KEY_CTRL_D = 0x04, /**< The Ctrl-D key. */ |
|---|
| 158 | CACA_KEY_CTRL_E = 0x05, /**< The Ctrl-E key. */ |
|---|
| 159 | CACA_KEY_CTRL_F = 0x06, /**< The Ctrl-F key. */ |
|---|
| 160 | CACA_KEY_CTRL_G = 0x07, /**< The Ctrl-G key. */ |
|---|
| 161 | CACA_KEY_BACKSPACE = 0x08, /**< The backspace key. */ |
|---|
| 162 | CACA_KEY_TAB = 0x09, /**< The tabulation key. */ |
|---|
| 163 | CACA_KEY_CTRL_J = 0x0a, /**< The Ctrl-J key. */ |
|---|
| 164 | CACA_KEY_CTRL_K = 0x0b, /**< The Ctrl-K key. */ |
|---|
| 165 | CACA_KEY_CTRL_L = 0x0c, /**< The Ctrl-L key. */ |
|---|
| 166 | CACA_KEY_RETURN = 0x0d, /**< The return key. */ |
|---|
| 167 | CACA_KEY_CTRL_N = 0x0e, /**< The Ctrl-N key. */ |
|---|
| 168 | CACA_KEY_CTRL_O = 0x0f, /**< The Ctrl-O key. */ |
|---|
| 169 | CACA_KEY_CTRL_P = 0x10, /**< The Ctrl-P key. */ |
|---|
| 170 | CACA_KEY_CTRL_Q = 0x11, /**< The Ctrl-Q key. */ |
|---|
| 171 | CACA_KEY_CTRL_R = 0x12, /**< The Ctrl-R key. */ |
|---|
| 172 | CACA_KEY_PAUSE = 0x13, /**< The pause key. */ |
|---|
| 173 | CACA_KEY_CTRL_T = 0x14, /**< The Ctrl-T key. */ |
|---|
| 174 | CACA_KEY_CTRL_U = 0x15, /**< The Ctrl-U key. */ |
|---|
| 175 | CACA_KEY_CTRL_V = 0x16, /**< The Ctrl-V key. */ |
|---|
| 176 | CACA_KEY_CTRL_W = 0x17, /**< The Ctrl-W key. */ |
|---|
| 177 | CACA_KEY_CTRL_X = 0x18, /**< The Ctrl-X key. */ |
|---|
| 178 | CACA_KEY_CTRL_Y = 0x19, /**< The Ctrl-Y key. */ |
|---|
| 179 | CACA_KEY_CTRL_Z = 0x1a, /**< The Ctrl-Z key. */ |
|---|
| 180 | CACA_KEY_ESCAPE = 0x1b, /**< The escape key. */ |
|---|
| 181 | CACA_KEY_DELETE = 0x7f, /**< The delete key. */ |
|---|
| 182 | |
|---|
| 183 | /* The following keys do not have ASCII equivalents but have been |
|---|
| 184 | * chosen to match the SDL equivalents */ |
|---|
| 185 | CACA_KEY_UP = 0x111, /**< The up arrow key. */ |
|---|
| 186 | CACA_KEY_DOWN = 0x112, /**< The down arrow key. */ |
|---|
| 187 | CACA_KEY_LEFT = 0x113, /**< The left arrow key. */ |
|---|
| 188 | CACA_KEY_RIGHT = 0x114, /**< The right arrow key. */ |
|---|
| 189 | |
|---|
| 190 | CACA_KEY_INSERT = 0x115, /**< The insert key. */ |
|---|
| 191 | CACA_KEY_HOME = 0x116, /**< The home key. */ |
|---|
| 192 | CACA_KEY_END = 0x117, /**< The end key. */ |
|---|
| 193 | CACA_KEY_PAGEUP = 0x118, /**< The page up key. */ |
|---|
| 194 | CACA_KEY_PAGEDOWN = 0x119, /**< The page down key. */ |
|---|
| 195 | |
|---|
| 196 | CACA_KEY_F1 = 0x11a, /**< The F1 key. */ |
|---|
| 197 | CACA_KEY_F2 = 0x11b, /**< The F2 key. */ |
|---|
| 198 | CACA_KEY_F3 = 0x11c, /**< The F3 key. */ |
|---|
| 199 | CACA_KEY_F4 = 0x11d, /**< The F4 key. */ |
|---|
| 200 | CACA_KEY_F5 = 0x11e, /**< The F5 key. */ |
|---|
| 201 | CACA_KEY_F6 = 0x11f, /**< The F6 key. */ |
|---|
| 202 | CACA_KEY_F7 = 0x120, /**< The F7 key. */ |
|---|
| 203 | CACA_KEY_F8 = 0x121, /**< The F8 key. */ |
|---|
| 204 | CACA_KEY_F9 = 0x122, /**< The F9 key. */ |
|---|
| 205 | CACA_KEY_F10 = 0x123, /**< The F10 key. */ |
|---|
| 206 | CACA_KEY_F11 = 0x124, /**< The F11 key. */ |
|---|
| 207 | CACA_KEY_F12 = 0x125, /**< The F12 key. */ |
|---|
| 208 | CACA_KEY_F13 = 0x126, /**< The F13 key. */ |
|---|
| 209 | CACA_KEY_F14 = 0x127, /**< The F14 key. */ |
|---|
| 210 | CACA_KEY_F15 = 0x128 /**< The F15 key. */ |
|---|
| 211 | }; |
|---|
| 212 | |
|---|
| 213 | /** \defgroup libcaca libcaca basic functions |
|---|
| 214 | * |
|---|
| 215 | * These functions provide the basic \e libcaca routines for library |
|---|
| 216 | * initialisation, system information retrieval and configuration. |
|---|
| 217 | * |
|---|
| 218 | * @{ */ |
|---|
| 219 | __extern caca_canvas_t * caca_create_canvas(int, int); |
|---|
| 220 | __extern int caca_manage_canvas(caca_canvas_t *, int (*)(void *), void *); |
|---|
| 221 | __extern int caca_unmanage_canvas(caca_canvas_t *, int (*)(void *), void *); |
|---|
| 222 | __extern int caca_set_canvas_size(caca_canvas_t *, int, int); |
|---|
| 223 | __extern int caca_get_canvas_width(caca_canvas_t const *); |
|---|
| 224 | __extern int caca_get_canvas_height(caca_canvas_t const *); |
|---|
| 225 | __extern uint32_t const * caca_get_canvas_chars(caca_canvas_t const *); |
|---|
| 226 | __extern uint32_t const * caca_get_canvas_attrs(caca_canvas_t const *); |
|---|
| 227 | __extern int caca_free_canvas(caca_canvas_t *); |
|---|
| 228 | __extern int caca_rand(int, int); |
|---|
| 229 | __extern char const * caca_get_version(void); |
|---|
| 230 | /* @} */ |
|---|
| 231 | |
|---|
| 232 | /** \defgroup caca_canvas libcaca canvas drawing |
|---|
| 233 | * |
|---|
| 234 | * These functions provide low-level character printing routines and |
|---|
| 235 | * higher level graphics functions. |
|---|
| 236 | * |
|---|
| 237 | * @{ */ |
|---|
| 238 | #define CACA_MAGIC_FULLWIDTH 0x000ffffe /**< Used to indicate that the previous character was a fullwidth glyph. */ |
|---|
| 239 | __extern int caca_gotoxy(caca_canvas_t *, int, int); |
|---|
| 240 | __extern int caca_wherex(caca_canvas_t const *); |
|---|
| 241 | __extern int caca_wherey(caca_canvas_t const *); |
|---|
| 242 | __extern int caca_put_char(caca_canvas_t *, int, int, uint32_t); |
|---|
| 243 | __extern uint32_t caca_get_char(caca_canvas_t const *, int, int); |
|---|
| 244 | __extern int caca_put_str(caca_canvas_t *, int, int, char const *); |
|---|
| 245 | __extern int caca_printf(caca_canvas_t *, int, int, char const *, ...); |
|---|
| 246 | __extern int caca_vprintf(caca_canvas_t *, int, int, char const *, va_list); |
|---|
| 247 | __extern int caca_clear_canvas(caca_canvas_t *); |
|---|
| 248 | __extern int caca_set_canvas_handle(caca_canvas_t *, int, int); |
|---|
| 249 | __extern int caca_get_canvas_handle_x(caca_canvas_t const *); |
|---|
| 250 | __extern int caca_get_canvas_handle_y(caca_canvas_t const *); |
|---|
| 251 | __extern int caca_blit(caca_canvas_t *, int, int, caca_canvas_t const *, |
|---|
| 252 | caca_canvas_t const *); |
|---|
| 253 | __extern int caca_set_canvas_boundaries(caca_canvas_t *, int, int, int, int); |
|---|
| 254 | /* @} */ |
|---|
| 255 | |
|---|
| 256 | /** \defgroup caca_dirty libcaca dirty rectangle manipulation |
|---|
| 257 | * |
|---|
| 258 | * These functions manipulate dirty rectangles for optimised blitting. |
|---|
| 259 | * @{ */ |
|---|
| 260 | __extern int caca_disable_dirty_rect(caca_canvas_t *); |
|---|
| 261 | __extern int caca_enable_dirty_rect(caca_canvas_t *); |
|---|
| 262 | __extern int caca_get_dirty_rect_count(caca_canvas_t *); |
|---|
| 263 | __extern int caca_get_dirty_rect(caca_canvas_t *, int, int *, int *, |
|---|
| 264 | int *, int *); |
|---|
| 265 | __extern int caca_add_dirty_rect(caca_canvas_t *, int, int, int, int); |
|---|
| 266 | __extern int caca_remove_dirty_rect(caca_canvas_t *, int, int, int, int); |
|---|
| 267 | __extern int caca_clear_dirty_rect_list(caca_canvas_t *); |
|---|
| 268 | /* @} */ |
|---|
| 269 | |
|---|
| 270 | /** \defgroup caca_transform libcaca canvas transformation |
|---|
| 271 | * |
|---|
| 272 | * These functions perform horizontal and vertical canvas flipping. |
|---|
| 273 | * |
|---|
| 274 | * @{ */ |
|---|
| 275 | __extern int caca_invert(caca_canvas_t *); |
|---|
| 276 | __extern int caca_flip(caca_canvas_t *); |
|---|
| 277 | __extern int caca_flop(caca_canvas_t *); |
|---|
| 278 | __extern int caca_rotate_180(caca_canvas_t *); |
|---|
| 279 | __extern int caca_rotate_left(caca_canvas_t *); |
|---|
| 280 | __extern int caca_rotate_right(caca_canvas_t *); |
|---|
| 281 | __extern int caca_stretch_left(caca_canvas_t *); |
|---|
| 282 | __extern int caca_stretch_right(caca_canvas_t *); |
|---|
| 283 | /* @} */ |
|---|
| 284 | |
|---|
| 285 | /** \defgroup caca_attributes libcaca attribute conversions |
|---|
| 286 | * |
|---|
| 287 | * These functions perform conversions between attribute values. |
|---|
| 288 | * |
|---|
| 289 | * @{ */ |
|---|
| 290 | __extern uint32_t caca_get_attr(caca_canvas_t const *, int, int); |
|---|
| 291 | __extern int caca_set_attr(caca_canvas_t *, uint32_t); |
|---|
| 292 | __extern int caca_unset_attr(caca_canvas_t *, uint32_t); |
|---|
| 293 | __extern int caca_toggle_attr(caca_canvas_t *, uint32_t); |
|---|
| 294 | __extern int caca_put_attr(caca_canvas_t *, int, int, uint32_t); |
|---|
| 295 | __extern int caca_set_color_ansi(caca_canvas_t *, uint8_t, uint8_t); |
|---|
| 296 | __extern int caca_set_color_argb(caca_canvas_t *, uint16_t, uint16_t); |
|---|
| 297 | __extern uint8_t caca_attr_to_ansi(uint32_t); |
|---|
| 298 | __extern uint8_t caca_attr_to_ansi_fg(uint32_t); |
|---|
| 299 | __extern uint8_t caca_attr_to_ansi_bg(uint32_t); |
|---|
| 300 | __extern uint16_t caca_attr_to_rgb12_fg(uint32_t); |
|---|
| 301 | __extern uint16_t caca_attr_to_rgb12_bg(uint32_t); |
|---|
| 302 | __extern void caca_attr_to_argb64(uint32_t, uint8_t[8]); |
|---|
| 303 | /* @} */ |
|---|
| 304 | |
|---|
| 305 | /** \defgroup caca_charset libcaca character set conversions |
|---|
| 306 | * |
|---|
| 307 | * These functions perform conversions between usual character sets. |
|---|
| 308 | * |
|---|
| 309 | * @{ */ |
|---|
| 310 | __extern uint32_t caca_utf8_to_utf32(char const *, size_t *); |
|---|
| 311 | __extern size_t caca_utf32_to_utf8(char *, uint32_t); |
|---|
| 312 | __extern uint8_t caca_utf32_to_cp437(uint32_t); |
|---|
| 313 | __extern uint32_t caca_cp437_to_utf32(uint8_t); |
|---|
| 314 | __extern char caca_utf32_to_ascii(uint32_t); |
|---|
| 315 | __extern int caca_utf32_is_fullwidth(uint32_t); |
|---|
| 316 | /* @} */ |
|---|
| 317 | |
|---|
| 318 | /** \defgroup caca_primitives libcaca primitives drawing |
|---|
| 319 | * |
|---|
| 320 | * These functions provide routines for primitive drawing, such as lines, |
|---|
| 321 | * boxes, triangles and ellipses. |
|---|
| 322 | * |
|---|
| 323 | * @{ */ |
|---|
| 324 | __extern int caca_draw_line(caca_canvas_t *, int, int, int, int, uint32_t); |
|---|
| 325 | __extern int caca_draw_polyline(caca_canvas_t *, int const x[], |
|---|
| 326 | int const y[], int, uint32_t); |
|---|
| 327 | __extern int caca_draw_thin_line(caca_canvas_t *, int, int, int, int); |
|---|
| 328 | __extern int caca_draw_thin_polyline(caca_canvas_t *, int const x[], |
|---|
| 329 | int const y[], int); |
|---|
| 330 | |
|---|
| 331 | __extern int caca_draw_circle(caca_canvas_t *, int, int, int, uint32_t); |
|---|
| 332 | __extern int caca_draw_ellipse(caca_canvas_t *, int, int, int, int, uint32_t); |
|---|
| 333 | __extern int caca_draw_thin_ellipse(caca_canvas_t *, int, int, int, int); |
|---|
| 334 | __extern int caca_fill_ellipse(caca_canvas_t *, int, int, int, int, uint32_t); |
|---|
| 335 | |
|---|
| 336 | __extern int caca_draw_box(caca_canvas_t *, int, int, int, int, uint32_t); |
|---|
| 337 | __extern int caca_draw_thin_box(caca_canvas_t *, int, int, int, int); |
|---|
| 338 | __extern int caca_draw_cp437_box(caca_canvas_t *, int, int, int, int); |
|---|
| 339 | __extern int caca_fill_box(caca_canvas_t *, int, int, int, int, uint32_t); |
|---|
| 340 | |
|---|
| 341 | __extern int caca_draw_triangle(caca_canvas_t *, int, int, int, int, int, |
|---|
| 342 | int, uint32_t); |
|---|
| 343 | __extern int caca_draw_thin_triangle(caca_canvas_t *, int, int, int, int, |
|---|
| 344 | int, int); |
|---|
| 345 | __extern int caca_fill_triangle(caca_canvas_t *, int, int, int, int, int, |
|---|
| 346 | int, uint32_t); |
|---|
| 347 | __extern int caca_fill_triangle_textured(caca_canvas_t *cv, |
|---|
| 348 | int coords[6], |
|---|
| 349 | caca_canvas_t *tex, |
|---|
| 350 | float uv[6]); |
|---|
| 351 | /* @} */ |
|---|
| 352 | |
|---|
| 353 | /** \defgroup caca_frame libcaca canvas frame handling |
|---|
| 354 | * |
|---|
| 355 | * These functions provide high level routines for canvas frame insertion, |
|---|
| 356 | * removal, copying etc. |
|---|
| 357 | * |
|---|
| 358 | * @{ */ |
|---|
| 359 | __extern int caca_get_frame_count(caca_canvas_t const *); |
|---|
| 360 | __extern int caca_set_frame(caca_canvas_t *, int); |
|---|
| 361 | __extern char const *caca_get_frame_name(caca_canvas_t const *); |
|---|
| 362 | __extern int caca_set_frame_name(caca_canvas_t *, char const *); |
|---|
| 363 | __extern int caca_create_frame(caca_canvas_t *, int); |
|---|
| 364 | __extern int caca_free_frame(caca_canvas_t *, int); |
|---|
| 365 | /* @} */ |
|---|
| 366 | |
|---|
| 367 | /** \defgroup caca_dither libcaca bitmap dithering |
|---|
| 368 | * |
|---|
| 369 | * These functions provide high level routines for dither allocation and |
|---|
| 370 | * rendering. |
|---|
| 371 | * |
|---|
| 372 | * @{ */ |
|---|
| 373 | __extern caca_dither_t *caca_create_dither(int, int, int, int, |
|---|
| 374 | uint32_t, uint32_t, |
|---|
| 375 | uint32_t, uint32_t); |
|---|
| 376 | __extern int caca_set_dither_palette(caca_dither_t *, |
|---|
| 377 | uint32_t r[], uint32_t g[], |
|---|
| 378 | uint32_t b[], uint32_t a[]); |
|---|
| 379 | __extern int caca_set_dither_brightness(caca_dither_t *, float); |
|---|
| 380 | __extern float caca_get_dither_brightness(caca_dither_t const *); |
|---|
| 381 | __extern int caca_set_dither_gamma(caca_dither_t *, float); |
|---|
| 382 | __extern float caca_get_dither_gamma(caca_dither_t const *); |
|---|
| 383 | __extern int caca_set_dither_contrast(caca_dither_t *, float); |
|---|
| 384 | __extern float caca_get_dither_contrast(caca_dither_t const *); |
|---|
| 385 | __extern int caca_set_dither_antialias(caca_dither_t *, char const *); |
|---|
| 386 | __extern char const * const * caca_get_dither_antialias_list(caca_dither_t |
|---|
| 387 | const *); |
|---|
| 388 | __extern char const * caca_get_dither_antialias(caca_dither_t const *); |
|---|
| 389 | __extern int caca_set_dither_color(caca_dither_t *, char const *); |
|---|
| 390 | __extern char const * const * caca_get_dither_color_list(caca_dither_t |
|---|
| 391 | const *); |
|---|
| 392 | __extern char const * caca_get_dither_color(caca_dither_t const *); |
|---|
| 393 | __extern int caca_set_dither_charset(caca_dither_t *, char const *); |
|---|
| 394 | __extern char const * const * caca_get_dither_charset_list(caca_dither_t |
|---|
| 395 | const *); |
|---|
| 396 | __extern char const * caca_get_dither_charset(caca_dither_t const *); |
|---|
| 397 | __extern int caca_set_dither_algorithm(caca_dither_t *, char const *); |
|---|
| 398 | __extern char const * const * caca_get_dither_algorithm_list(caca_dither_t |
|---|
| 399 | const *); |
|---|
| 400 | __extern char const * caca_get_dither_algorithm(caca_dither_t const *); |
|---|
| 401 | __extern int caca_dither_bitmap(caca_canvas_t *, int, int, int, int, |
|---|
| 402 | caca_dither_t const *, void const *); |
|---|
| 403 | __extern int caca_free_dither(caca_dither_t *); |
|---|
| 404 | /* @} */ |
|---|
| 405 | |
|---|
| 406 | /** \defgroup caca_font libcaca font handling |
|---|
| 407 | * |
|---|
| 408 | * These functions provide font handling routines and high quality |
|---|
| 409 | * canvas to bitmap rendering. |
|---|
| 410 | * |
|---|
| 411 | * @{ */ |
|---|
| 412 | __extern caca_font_t *caca_load_font(void const *, size_t); |
|---|
| 413 | __extern char const * const * caca_get_font_list(void); |
|---|
| 414 | __extern int caca_get_font_width(caca_font_t const *); |
|---|
| 415 | __extern int caca_get_font_height(caca_font_t const *); |
|---|
| 416 | __extern uint32_t const *caca_get_font_blocks(caca_font_t const *); |
|---|
| 417 | __extern int caca_render_canvas(caca_canvas_t const *, caca_font_t const *, |
|---|
| 418 | void *, int, int, int); |
|---|
| 419 | __extern int caca_free_font(caca_font_t *); |
|---|
| 420 | /* @} */ |
|---|
| 421 | |
|---|
| 422 | /** \defgroup caca_figfont libcaca FIGfont handling |
|---|
| 423 | * |
|---|
| 424 | * These functions provide FIGlet and TOIlet font handling routines. |
|---|
| 425 | * |
|---|
| 426 | * @{ */ |
|---|
| 427 | __extern int caca_canvas_set_figfont(caca_canvas_t *, char const *); |
|---|
| 428 | __extern int caca_put_figchar(caca_canvas_t *, uint32_t); |
|---|
| 429 | __extern int caca_flush_figlet(caca_canvas_t *); |
|---|
| 430 | /* @} */ |
|---|
| 431 | |
|---|
| 432 | /** \defgroup caca_file libcaca file IO |
|---|
| 433 | * |
|---|
| 434 | * These functions allow to read and write files in a platform-independent |
|---|
| 435 | * way. |
|---|
| 436 | * @{ */ |
|---|
| 437 | __extern caca_file_t *caca_file_open(char const *, const char *); |
|---|
| 438 | __extern int caca_file_close(caca_file_t *); |
|---|
| 439 | __extern uint64_t caca_file_tell(caca_file_t *); |
|---|
| 440 | __extern size_t caca_file_read(caca_file_t *, void *, size_t); |
|---|
| 441 | __extern size_t caca_file_write(caca_file_t *, const void *, size_t); |
|---|
| 442 | __extern char * caca_file_gets(caca_file_t *, char *, int); |
|---|
| 443 | __extern int caca_file_eof(caca_file_t *); |
|---|
| 444 | /* @} */ |
|---|
| 445 | |
|---|
| 446 | /** \defgroup caca_importexport libcaca importers/exporters from/to various |
|---|
| 447 | * formats |
|---|
| 448 | * |
|---|
| 449 | * These functions import various file formats into a new canvas, or export |
|---|
| 450 | * the current canvas to various text formats. |
|---|
| 451 | * |
|---|
| 452 | * @{ */ |
|---|
| 453 | __extern ssize_t caca_import_canvas_from_memory(caca_canvas_t *, void const *, |
|---|
| 454 | size_t, char const *); |
|---|
| 455 | __extern ssize_t caca_import_canvas_from_file(caca_canvas_t *, char const *, |
|---|
| 456 | char const *); |
|---|
| 457 | __extern ssize_t caca_import_area_from_memory(caca_canvas_t *, int, int, |
|---|
| 458 | void const *, size_t, |
|---|
| 459 | char const *); |
|---|
| 460 | __extern ssize_t caca_import_area_from_file(caca_canvas_t *, int, int, |
|---|
| 461 | char const *, char const *); |
|---|
| 462 | __extern char const * const * caca_get_import_list(void); |
|---|
| 463 | __extern void *caca_export_canvas_to_memory(caca_canvas_t const *, |
|---|
| 464 | char const *, size_t *); |
|---|
| 465 | __extern void *caca_export_area_to_memory(caca_canvas_t const *, int, int, |
|---|
| 466 | int, int, char const *, size_t *); |
|---|
| 467 | __extern char const * const * caca_get_export_list(void); |
|---|
| 468 | /* @} */ |
|---|
| 469 | |
|---|
| 470 | /** \defgroup caca_display libcaca display functions |
|---|
| 471 | * |
|---|
| 472 | * These functions provide the basic \e libcaca routines for display |
|---|
| 473 | * initialisation, system information retrieval and configuration. |
|---|
| 474 | * |
|---|
| 475 | * @{ */ |
|---|
| 476 | __extern caca_display_t * caca_create_display(caca_canvas_t *); |
|---|
| 477 | __extern caca_display_t * caca_create_display_with_driver(caca_canvas_t *, |
|---|
| 478 | char const *); |
|---|
| 479 | __extern char const * const * caca_get_display_driver_list(void); |
|---|
| 480 | __extern char const * caca_get_display_driver(caca_display_t *); |
|---|
| 481 | __extern int caca_set_display_driver(caca_display_t *, char const *); |
|---|
| 482 | __extern int caca_free_display(caca_display_t *); |
|---|
| 483 | __extern caca_canvas_t * caca_get_canvas(caca_display_t *); |
|---|
| 484 | __extern int caca_refresh_display(caca_display_t *); |
|---|
| 485 | __extern int caca_set_display_time(caca_display_t *, int); |
|---|
| 486 | __extern int caca_get_display_time(caca_display_t const *); |
|---|
| 487 | __extern int caca_get_display_width(caca_display_t const *); |
|---|
| 488 | __extern int caca_get_display_height(caca_display_t const *); |
|---|
| 489 | __extern int caca_set_display_title(caca_display_t *, char const *); |
|---|
| 490 | __extern int caca_set_mouse(caca_display_t *, int); |
|---|
| 491 | __extern int caca_set_cursor(caca_display_t *, int); |
|---|
| 492 | /* @} */ |
|---|
| 493 | |
|---|
| 494 | /** \defgroup caca_event libcaca event handling |
|---|
| 495 | * |
|---|
| 496 | * These functions handle user events such as keyboard input and mouse |
|---|
| 497 | * clicks. |
|---|
| 498 | * |
|---|
| 499 | * @{ */ |
|---|
| 500 | __extern int caca_get_event(caca_display_t *, int, caca_event_t *, int); |
|---|
| 501 | __extern int caca_get_mouse_x(caca_display_t const *); |
|---|
| 502 | __extern int caca_get_mouse_y(caca_display_t const *); |
|---|
| 503 | __extern enum caca_event_type caca_get_event_type(caca_event_t const *); |
|---|
| 504 | __extern int caca_get_event_key_ch(caca_event_t const *); |
|---|
| 505 | __extern uint32_t caca_get_event_key_utf32(caca_event_t const *); |
|---|
| 506 | __extern int caca_get_event_key_utf8(caca_event_t const *, char *); |
|---|
| 507 | __extern int caca_get_event_mouse_button(caca_event_t const *); |
|---|
| 508 | __extern int caca_get_event_mouse_x(caca_event_t const *); |
|---|
| 509 | __extern int caca_get_event_mouse_y(caca_event_t const *); |
|---|
| 510 | __extern int caca_get_event_resize_width(caca_event_t const *); |
|---|
| 511 | __extern int caca_get_event_resize_height(caca_event_t const *); |
|---|
| 512 | /* @} */ |
|---|
| 513 | |
|---|
| 514 | /** \brief DOS colours |
|---|
| 515 | * |
|---|
| 516 | * This enum lists the colour values for the DOS conio.h compatibility |
|---|
| 517 | * layer. |
|---|
| 518 | */ |
|---|
| 519 | enum CACA_CONIO_COLORS |
|---|
| 520 | { |
|---|
| 521 | CACA_CONIO_BLINK = 128, |
|---|
| 522 | CACA_CONIO_BLACK = 0, |
|---|
| 523 | CACA_CONIO_BLUE = 1, |
|---|
| 524 | CACA_CONIO_GREEN = 2, |
|---|
| 525 | CACA_CONIO_CYAN = 3, |
|---|
| 526 | CACA_CONIO_RED = 4, |
|---|
| 527 | CACA_CONIO_MAGENTA = 5, |
|---|
| 528 | CACA_CONIO_BROWN = 6, |
|---|
| 529 | CACA_CONIO_LIGHTGRAY = 7, |
|---|
| 530 | CACA_CONIO_DARKGRAY = 8, |
|---|
| 531 | CACA_CONIO_LIGHTBLUE = 9, |
|---|
| 532 | CACA_CONIO_LIGHTGREEN = 10, |
|---|
| 533 | CACA_CONIO_LIGHTCYAN = 11, |
|---|
| 534 | CACA_CONIO_LIGHTRED = 12, |
|---|
| 535 | CACA_CONIO_LIGHTMAGENTA = 13, |
|---|
| 536 | CACA_CONIO_YELLOW = 14, |
|---|
| 537 | CACA_CONIO_WHITE = 15, |
|---|
| 538 | }; |
|---|
| 539 | |
|---|
| 540 | /** \brief DOS cursor modes |
|---|
| 541 | * |
|---|
| 542 | * This enum lists the cursor mode values for the DOS conio.h compatibility |
|---|
| 543 | * layer. |
|---|
| 544 | */ |
|---|
| 545 | enum CACA_CONIO_CURSOR |
|---|
| 546 | { |
|---|
| 547 | CACA_CONIO__NOCURSOR = 0, |
|---|
| 548 | CACA_CONIO__SOLIDCURSOR = 1, |
|---|
| 549 | CACA_CONIO__NORMALCURSOR = 2, |
|---|
| 550 | }; |
|---|
| 551 | |
|---|
| 552 | /** \brief DOS video modes |
|---|
| 553 | * |
|---|
| 554 | * This enum lists the video mode values for the DOS conio.h compatibility |
|---|
| 555 | * layer. |
|---|
| 556 | */ |
|---|
| 557 | enum CACA_CONIO_MODE |
|---|
| 558 | { |
|---|
| 559 | CACA_CONIO_LASTMODE = -1, |
|---|
| 560 | CACA_CONIO_BW40 = 0, |
|---|
| 561 | CACA_CONIO_C40 = 1, |
|---|
| 562 | CACA_CONIO_BW80 = 2, |
|---|
| 563 | CACA_CONIO_C80 = 3, |
|---|
| 564 | CACA_CONIO_MONO = 7, |
|---|
| 565 | CACA_CONIO_C4350 = 64, |
|---|
| 566 | }; |
|---|
| 567 | |
|---|
| 568 | /** \brief DOS text area information |
|---|
| 569 | * |
|---|
| 570 | * This structure stores text area information for the DOS conio.h |
|---|
| 571 | * compatibility layer. |
|---|
| 572 | */ |
|---|
| 573 | struct caca_conio_text_info |
|---|
| 574 | { |
|---|
| 575 | unsigned char winleft; /**< left window coordinate */ |
|---|
| 576 | unsigned char wintop; /**< top window coordinate */ |
|---|
| 577 | unsigned char winright; /**< right window coordinate */ |
|---|
| 578 | unsigned char winbottom; /**< bottom window coordinate */ |
|---|
| 579 | unsigned char attribute; /**< text attribute */ |
|---|
| 580 | unsigned char normattr; /**< normal attribute */ |
|---|
| 581 | unsigned char currmode; /**< current video mode: |
|---|
| 582 | BW40, BW80, C40, C80, or C4350 */ |
|---|
| 583 | unsigned char screenheight; /**< text screen's height */ |
|---|
| 584 | unsigned char screenwidth; /**< text screen's width */ |
|---|
| 585 | unsigned char curx; /**< x-coordinate in current window */ |
|---|
| 586 | unsigned char cury; /**< y-coordinate in current window */ |
|---|
| 587 | }; |
|---|
| 588 | |
|---|
| 589 | /** \brief DOS direct video control */ |
|---|
| 590 | __extern int caca_conio_directvideo; |
|---|
| 591 | |
|---|
| 592 | /** \brief DOS scrolling control */ |
|---|
| 593 | __extern int caca_conio__wscroll; |
|---|
| 594 | |
|---|
| 595 | /** \defgroup conio libcaca DOS conio.h compatibility layer |
|---|
| 596 | * |
|---|
| 597 | * These functions implement DOS-like functions for high-level text |
|---|
| 598 | * operations. |
|---|
| 599 | * |
|---|
| 600 | * @{ */ |
|---|
| 601 | __extern char * caca_conio_cgets(char *str); |
|---|
| 602 | __extern void caca_conio_clreol(void); |
|---|
| 603 | __extern void caca_conio_clrscr(void); |
|---|
| 604 | __extern int caca_conio_cprintf(const char *format, ...); |
|---|
| 605 | __extern int caca_conio_cputs(const char *str); |
|---|
| 606 | __extern int caca_conio_cscanf(char *format, ...); |
|---|
| 607 | __extern void caca_conio_delay(unsigned int); |
|---|
| 608 | __extern void caca_conio_delline(void); |
|---|
| 609 | __extern int caca_conio_getch(void); |
|---|
| 610 | __extern int caca_conio_getche(void); |
|---|
| 611 | __extern char * caca_conio_getpass(const char *prompt); |
|---|
| 612 | __extern int caca_conio_gettext(int left, int top, int right, int bottom, |
|---|
| 613 | void *destin); |
|---|
| 614 | __extern void caca_conio_gettextinfo(struct caca_conio_text_info *r); |
|---|
| 615 | __extern void caca_conio_gotoxy(int x, int y); |
|---|
| 616 | __extern void caca_conio_highvideo(void); |
|---|
| 617 | __extern void caca_conio_insline(void); |
|---|
| 618 | __extern int caca_conio_kbhit(void); |
|---|
| 619 | __extern void caca_conio_lowvideo(void); |
|---|
| 620 | __extern int caca_conio_movetext(int left, int top, int right, int bottom, |
|---|
| 621 | int destleft, int desttop); |
|---|
| 622 | __extern void caca_conio_normvideo(void); |
|---|
| 623 | __extern void caca_conio_nosound(void); |
|---|
| 624 | __extern int caca_conio_printf(const char *format, ...); |
|---|
| 625 | __extern int caca_conio_putch(int ch); |
|---|
| 626 | __extern int caca_conio_puttext(int left, int top, int right, int bottom, |
|---|
| 627 | void *destin); |
|---|
| 628 | __extern void caca_conio__setcursortype(int cur_t); |
|---|
| 629 | __extern void caca_conio_sleep(unsigned int); |
|---|
| 630 | __extern void caca_conio_sound(unsigned int); |
|---|
| 631 | __extern void caca_conio_textattr(int newattr); |
|---|
| 632 | __extern void caca_conio_textbackground(int newcolor); |
|---|
| 633 | __extern void caca_conio_textcolor(int newcolor); |
|---|
| 634 | __extern void caca_conio_textmode(int newmode); |
|---|
| 635 | __extern int caca_conio_ungetch(int ch); |
|---|
| 636 | __extern int caca_conio_wherex(void); |
|---|
| 637 | __extern int caca_conio_wherey(void); |
|---|
| 638 | __extern void caca_conio_window(int left, int top, int right, int bottom); |
|---|
| 639 | /* @} */ |
|---|
| 640 | |
|---|
| 641 | #if !defined(_DOXYGEN_SKIP_ME) |
|---|
| 642 | /* Legacy stuff from beta versions, will probably disappear in 1.0 */ |
|---|
| 643 | typedef struct cucul_buffer cucul_buffer_t; |
|---|
| 644 | |
|---|
| 645 | # if defined __GNUC__ && __GNUC__ >= 3 |
|---|
| 646 | # define CACA_DEPRECATED __attribute__ ((__deprecated__)) |
|---|
| 647 | # else |
|---|
| 648 | # define CACA_DEPRECATED |
|---|
| 649 | # endif |
|---|
| 650 | |
|---|
| 651 | # if defined __GNUC__ && __GNUC__ > 3 |
|---|
| 652 | # define CACA_ALIAS(x) __attribute__ ((weak, alias(#x))) |
|---|
| 653 | # else |
|---|
| 654 | # define CACA_ALIAS(x) |
|---|
| 655 | # endif |
|---|
| 656 | |
|---|
| 657 | |
|---|
| 658 | /* Aliases from old libcaca and libcucul functions */ |
|---|
| 659 | __extern int cucul_putchar(caca_canvas_t *, int, int, |
|---|
| 660 | unsigned long int) CACA_DEPRECATED; |
|---|
| 661 | __extern unsigned long int cucul_getchar(caca_canvas_t *, |
|---|
| 662 | int, int) CACA_DEPRECATED; |
|---|
| 663 | __extern int cucul_putstr(caca_canvas_t *, int, int, |
|---|
| 664 | char const *) CACA_DEPRECATED; |
|---|
| 665 | __extern int cucul_set_color(caca_canvas_t *, unsigned char, |
|---|
| 666 | unsigned char) CACA_DEPRECATED; |
|---|
| 667 | __extern int cucul_set_truecolor(caca_canvas_t *, unsigned int, |
|---|
| 668 | unsigned int) CACA_DEPRECATED; |
|---|
| 669 | __extern unsigned int cucul_get_canvas_frame_count(caca_canvas_t *) |
|---|
| 670 | CACA_DEPRECATED; |
|---|
| 671 | __extern int cucul_set_canvas_frame(caca_canvas_t *, |
|---|
| 672 | unsigned int) CACA_DEPRECATED; |
|---|
| 673 | __extern int cucul_create_canvas_frame(caca_canvas_t *, |
|---|
| 674 | unsigned int) CACA_DEPRECATED; |
|---|
| 675 | __extern int cucul_free_canvas_frame(caca_canvas_t *, |
|---|
| 676 | unsigned int) CACA_DEPRECATED; |
|---|
| 677 | __extern cucul_buffer_t *cucul_load_memory(void *, |
|---|
| 678 | unsigned long int) CACA_DEPRECATED; |
|---|
| 679 | __extern cucul_buffer_t *cucul_load_file(char const *) CACA_DEPRECATED; |
|---|
| 680 | __extern unsigned long int cucul_get_buffer_size(cucul_buffer_t *) |
|---|
| 681 | CACA_DEPRECATED; |
|---|
| 682 | __extern void * cucul_get_buffer_data(cucul_buffer_t *) CACA_DEPRECATED; |
|---|
| 683 | __extern int cucul_free_buffer(cucul_buffer_t *) CACA_DEPRECATED; |
|---|
| 684 | __extern cucul_buffer_t * cucul_export_canvas(caca_canvas_t *, |
|---|
| 685 | char const *) CACA_DEPRECATED; |
|---|
| 686 | __extern caca_canvas_t * cucul_import_canvas(cucul_buffer_t *, |
|---|
| 687 | char const *) CACA_DEPRECATED; |
|---|
| 688 | __extern ssize_t caca_import_memory(caca_canvas_t *, void const *, size_t, |
|---|
| 689 | char const *) CACA_DEPRECATED; |
|---|
| 690 | __extern ssize_t caca_import_file(caca_canvas_t *, char const *, |
|---|
| 691 | char const *) CACA_DEPRECATED; |
|---|
| 692 | __extern void *caca_export_memory(caca_canvas_t const *, char const *, |
|---|
| 693 | size_t *) CACA_DEPRECATED; |
|---|
| 694 | __extern int cucul_rotate(caca_canvas_t *) CACA_DEPRECATED; |
|---|
| 695 | __extern int cucul_set_dither_invert(caca_dither_t *, int) CACA_DEPRECATED; |
|---|
| 696 | __extern int cucul_set_dither_mode(caca_dither_t *, |
|---|
| 697 | char const *) CACA_DEPRECATED; |
|---|
| 698 | __extern char const * const * cucul_get_dither_mode_list(caca_dither_t const *) |
|---|
| 699 | CACA_DEPRECATED; |
|---|
| 700 | # define CUCUL_COLOR_BLACK CACA_BLACK |
|---|
| 701 | # define CUCUL_COLOR_BLUE CACA_BLUE |
|---|
| 702 | # define CUCUL_COLOR_GREEN CACA_GREEN |
|---|
| 703 | # define CUCUL_COLOR_CYAN CACA_CYAN |
|---|
| 704 | # define CUCUL_COLOR_RED CACA_RED |
|---|
| 705 | # define CUCUL_COLOR_MAGENTA CACA_MAGENTA |
|---|
| 706 | # define CUCUL_COLOR_BROWN CACA_BROWN |
|---|
| 707 | # define CUCUL_COLOR_LIGHTGRAY CACA_LIGHTGRAY |
|---|
| 708 | # define CUCUL_COLOR_DARKGRAY CACA_DARKGRAY |
|---|
| 709 | # define CUCUL_COLOR_LIGHTBLUE CACA_LIGHTBLUE |
|---|
| 710 | # define CUCUL_COLOR_LIGHTGREEN CACA_LIGHTGREEN |
|---|
| 711 | # define CUCUL_COLOR_LIGHTCYAN CACA_LIGHTCYAN |
|---|
| 712 | # define CUCUL_COLOR_LIGHTRED CACA_LIGHTRED |
|---|
| 713 | # define CUCUL_COLOR_LIGHTMAGENTA CACA_LIGHTMAGENTA |
|---|
| 714 | # define CUCUL_COLOR_YELLOW CACA_YELLOW |
|---|
| 715 | # define CUCUL_COLOR_WHITE CACA_YELLOW |
|---|
| 716 | # define CUCUL_COLOR_DEFAULT CACA_DEFAULT |
|---|
| 717 | # define CUCUL_COLOR_TRANSPARENT CACA_TRANSPARENT |
|---|
| 718 | |
|---|
| 719 | /* Aliases from the libcucul/libcaca merge */ |
|---|
| 720 | # define cucul_canvas_t caca_canvas_t |
|---|
| 721 | # define cucul_dither_t caca_dither_t |
|---|
| 722 | # define cucul_font_t caca_font_t |
|---|
| 723 | # define cucul_file_t caca_file_t |
|---|
| 724 | # define cucul_display_t caca_display_t |
|---|
| 725 | # define cucul_event_t caca_event_t |
|---|
| 726 | |
|---|
| 727 | # define CUCUL_BLACK CACA_BLACK |
|---|
| 728 | # define CUCUL_BLUE CACA_BLUE |
|---|
| 729 | # define CUCUL_GREEN CACA_GREEN |
|---|
| 730 | # define CUCUL_CYAN CACA_CYAN |
|---|
| 731 | # define CUCUL_RED CACA_RED |
|---|
| 732 | # define CUCUL_MAGENTA CACA_MAGENTA |
|---|
| 733 | # define CUCUL_BROWN CACA_BROWN |
|---|
| 734 | # define CUCUL_LIGHTGRAY CACA_LIGHTGRAY |
|---|
| 735 | # define CUCUL_DARKGRAY CACA_DARKGRAY |
|---|
| 736 | # define CUCUL_LIGHTBLUE CACA_LIGHTBLUE |
|---|
| 737 | # define CUCUL_LIGHTGREEN CACA_LIGHTGREEN |
|---|
| 738 | # define CUCUL_LIGHTCYAN CACA_LIGHTCYAN |
|---|
| 739 | # define CUCUL_LIGHTRED CACA_LIGHTRED |
|---|
| 740 | # define CUCUL_LIGHTMAGENTA CACA_LIGHTMAGENTA |
|---|
| 741 | # define CUCUL_YELLOW CACA_YELLOW |
|---|
| 742 | # define CUCUL_WHITE CACA_YELLOW |
|---|
| 743 | # define CUCUL_DEFAULT CACA_DEFAULT |
|---|
| 744 | # define CUCUL_TRANSPARENT CACA_TRANSPARENT |
|---|
| 745 | |
|---|
| 746 | # define CUCUL_BOLD CACA_BOLD |
|---|
| 747 | # define CUCUL_ITALICS CACA_ITALICS |
|---|
| 748 | # define CUCUL_UNDERLINE CACA_UNDERLINE |
|---|
| 749 | # define CUCUL_BLINK CACA_BLINK |
|---|
| 750 | |
|---|
| 751 | # if !defined __LIBCACA__ |
|---|
| 752 | # define caca_get_cursor_x caca_wherex |
|---|
| 753 | # define caca_get_cursor_y caca_wherey |
|---|
| 754 | # define cucul_draw_triangle caca_draw_triangle |
|---|
| 755 | # define cucul_draw_thin_triangle caca_draw_thin_triangle |
|---|
| 756 | # define cucul_fill_triangle caca_fill_triangle |
|---|
| 757 | # define cucul_load_font caca_load_font |
|---|
| 758 | # define cucul_get_font_list caca_get_font_list |
|---|
| 759 | # define cucul_get_font_width caca_get_font_width |
|---|
| 760 | # define cucul_get_font_height caca_get_font_height |
|---|
| 761 | # define cucul_get_font_blocks caca_get_font_blocks |
|---|
| 762 | # define cucul_render_canvas caca_render_canvas |
|---|
| 763 | # define cucul_free_font caca_free_font |
|---|
| 764 | # define cucul_gotoxy caca_gotoxy |
|---|
| 765 | # define cucul_get_cursor_x caca_wherex |
|---|
| 766 | # define cucul_get_cursor_y caca_wherey |
|---|
| 767 | # define cucul_put_char caca_put_char |
|---|
| 768 | # define cucul_get_char caca_get_char |
|---|
| 769 | # define cucul_put_str caca_put_str |
|---|
| 770 | # define cucul_printf caca_printf |
|---|
| 771 | # define cucul_clear_canvas caca_clear_canvas |
|---|
| 772 | # define cucul_set_canvas_handle caca_set_canvas_handle |
|---|
| 773 | # define cucul_get_canvas_handle_x caca_get_canvas_handle_x |
|---|
| 774 | # define cucul_get_canvas_handle_y caca_get_canvas_handle_y |
|---|
| 775 | # define cucul_blit caca_blit |
|---|
| 776 | # define cucul_set_canvas_boundaries caca_set_canvas_boundaries |
|---|
| 777 | # define cucul_import_memory caca_import_memory |
|---|
| 778 | # define cucul_import_file caca_import_file |
|---|
| 779 | # define cucul_get_import_list caca_get_import_list |
|---|
| 780 | # define cucul_create_canvas caca_create_canvas |
|---|
| 781 | # define cucul_manage_canvas caca_manage_canvas |
|---|
| 782 | # define cucul_unmanage_canvas caca_unmanage_canvas |
|---|
| 783 | # define cucul_set_canvas_size caca_set_canvas_size |
|---|
| 784 | # define cucul_get_canvas_width caca_get_canvas_width |
|---|
| 785 | # define cucul_get_canvas_height caca_get_canvas_height |
|---|
| 786 | # define cucul_get_canvas_chars caca_get_canvas_chars |
|---|
| 787 | # define cucul_get_canvas_attrs caca_get_canvas_attrs |
|---|
| 788 | # define cucul_free_canvas caca_free_canvas |
|---|
| 789 | # define cucul_rand caca_rand |
|---|
| 790 | # define cucul_export_memory caca_export_memory |
|---|
| 791 | # define cucul_get_export_list caca_get_export_list |
|---|
| 792 | # define cucul_get_version caca_get_version |
|---|
| 793 | # define cucul_utf8_to_utf32 caca_utf8_to_utf32 |
|---|
| 794 | # define cucul_utf32_to_utf8 caca_utf32_to_utf8 |
|---|
| 795 | # define cucul_utf32_to_cp437 caca_utf32_to_cp437 |
|---|
| 796 | # define cucul_cp437_to_utf32 caca_cp437_to_utf32 |
|---|
| 797 | # define cucul_utf32_to_ascii caca_utf32_to_ascii |
|---|
| 798 | # define cucul_utf32_is_fullwidth caca_utf32_is_fullwidth |
|---|
| 799 | # define cucul_draw_circle caca_draw_circle |
|---|
| 800 | # define cucul_draw_ellipse caca_draw_ellipse |
|---|
| 801 | # define cucul_draw_thin_ellipse caca_draw_thin_ellipse |
|---|
| 802 | # define cucul_fill_ellipse caca_fill_ellipse |
|---|
| 803 | # define cucul_canvas_set_figfont caca_canvas_set_figfont |
|---|
| 804 | # define cucul_put_figchar caca_put_figchar |
|---|
| 805 | # define cucul_flush_figlet caca_flush_figlet |
|---|
| 806 | # define cucul_putchar caca_putchar |
|---|
| 807 | # define cucul_getchar caca_getchar |
|---|
| 808 | # define cucul_get_attr caca_get_attr |
|---|
| 809 | # define cucul_set_attr caca_set_attr |
|---|
| 810 | # define cucul_put_attr caca_put_attr |
|---|
| 811 | # define cucul_set_color_ansi caca_set_color_ansi |
|---|
| 812 | # define cucul_set_color_argb caca_set_color_argb |
|---|
| 813 | # define cucul_attr_to_ansi caca_attr_to_ansi |
|---|
| 814 | # define cucul_attr_to_ansi_fg caca_attr_to_ansi_fg |
|---|
| 815 | # define cucul_attr_to_ansi_bg caca_attr_to_ansi_bg |
|---|
| 816 | # define cucul_attr_to_rgb12_fg caca_attr_to_rgb12_fg |
|---|
| 817 | # define cucul_attr_to_rgb12_bg caca_attr_to_rgb12_bg |
|---|
| 818 | # define cucul_attr_to_argb64 caca_attr_to_argb64 |
|---|
| 819 | # define cucul_invert caca_invert |
|---|
| 820 | # define cucul_flip caca_flip |
|---|
| 821 | # define cucul_flop caca_flop |
|---|
| 822 | # define cucul_rotate_180 caca_rotate_180 |
|---|
| 823 | # define cucul_rotate_left caca_rotate_left |
|---|
| 824 | # define cucul_rotate_right caca_rotate_right |
|---|
| 825 | # define cucul_stretch_left caca_stretch_left |
|---|
| 826 | # define cucul_stretch_right caca_stretch_right |
|---|
| 827 | # define cucul_file_open caca_file_open |
|---|
| 828 | # define cucul_file_close caca_file_close |
|---|
| 829 | # define cucul_file_tell caca_file_tell |
|---|
| 830 | # define cucul_file_read caca_file_read |
|---|
| 831 | # define cucul_file_write caca_file_write |
|---|
| 832 | # define cucul_file_gets caca_file_gets |
|---|
| 833 | # define cucul_file_eof caca_file_eof |
|---|
| 834 | # define cucul_create_dither caca_create_dither |
|---|
| 835 | # define cucul_set_dither_palette caca_set_dither_palette |
|---|
| 836 | # define cucul_set_dither_brightness caca_set_dither_brightness |
|---|
| 837 | # define cucul_get_dither_brightness caca_get_dither_brightness |
|---|
| 838 | # define cucul_set_dither_gamma caca_set_dither_gamma |
|---|
| 839 | # define cucul_get_dither_gamma caca_get_dither_gamma |
|---|
| 840 | # define cucul_set_dither_contrast caca_set_dither_contrast |
|---|
| 841 | # define cucul_get_dither_contrast caca_get_dither_contrast |
|---|
| 842 | # define cucul_set_dither_antialias caca_set_dither_antialias |
|---|
| 843 | # define cucul_get_dither_antialias_list caca_get_dither_antialias_list |
|---|
| 844 | # define cucul_get_dither_antialias caca_get_dither_antialias |
|---|
| 845 | # define cucul_set_dither_color caca_set_dither_color |
|---|
| 846 | # define cucul_get_dither_color_list caca_get_dither_color_list |
|---|
| 847 | # define cucul_get_dither_color caca_get_dither_color |
|---|
| 848 | # define cucul_set_dither_charset caca_set_dither_charset |
|---|
| 849 | # define cucul_get_dither_charset_list caca_get_dither_charset_list |
|---|
| 850 | # define cucul_get_dither_charset caca_get_dither_charset |
|---|
| 851 | # define cucul_set_dither_algorithm caca_set_dither_algorithm |
|---|
| 852 | # define cucul_get_dither_algorithm_list caca_get_dither_algorithm_list |
|---|
| 853 | # define cucul_get_dither_algorithm caca_get_dither_algorithm |
|---|
| 854 | # define cucul_dither_bitmap caca_dither_bitmap |
|---|
| 855 | # define cucul_free_dither caca_free_dither |
|---|
| 856 | # define cucul_draw_line caca_draw_line |
|---|
| 857 | # define cucul_draw_polyline caca_draw_polyline |
|---|
| 858 | # define cucul_draw_thin_line caca_draw_thin_line |
|---|
| 859 | # define cucul_draw_thin_polyline caca_draw_thin_polyline |
|---|
| 860 | # define cucul_draw_box caca_draw_box |
|---|
| 861 | # define cucul_draw_thin_box caca_draw_thin_box |
|---|
| 862 | # define cucul_draw_cp437_box caca_draw_cp437_box |
|---|
| 863 | # define cucul_fill_box caca_fill_box |
|---|
| 864 | # define cucul_get_frame_count caca_get_frame_count |
|---|
| 865 | # define cucul_set_frame caca_set_frame |
|---|
| 866 | # define cucul_get_frame_name caca_get_frame_name |
|---|
| 867 | # define cucul_set_frame_name caca_set_frame_name |
|---|
| 868 | # define cucul_create_frame caca_create_frame |
|---|
| 869 | # define cucul_free_frame caca_free_frame |
|---|
| 870 | # endif |
|---|
| 871 | #endif |
|---|
| 872 | |
|---|
| 873 | #ifdef __cplusplus |
|---|
| 874 | } |
|---|
| 875 | #endif |
|---|
| 876 | |
|---|
| 877 | #undef __extern |
|---|
| 878 | |
|---|
| 879 | #endif /* __CACA_H__ */ |
|---|