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