Logo Search packages:      
Sourcecode: libcaca version File versions  Download package

caca.h File Reference


Detailed Description

The libcaca public header.

Version:
$Id: caca.h 249 2004-01-17 22:32:39Z sam $
Author:
Sam Hocevar <sam@zoy.org> This header contains the public types and functions that applications using libcaca may use.

Definition in file caca.h.

Go to the source code of this file.

Defines

#define CACA_ANTIALIASING_MAX   0x22
#define CACA_ANTIALIASING_MIN   0x21
#define CACA_BACKGROUND_MAX   0x12
#define CACA_BACKGROUND_MIN   0x11
#define CACA_DITHER_NONE   CACA_DITHERING_NONE
#define CACA_DITHER_ORDERED   CACA_DITHERING_ORDERED8
#define CACA_DITHER_RANDOM   CACA_DITHERING_RANDOM
#define caca_dithering   caca_feature
#define CACA_DITHERING_MAX   0x35
#define CACA_DITHERING_MIN   0x31
#define caca_get_dithering_name   caca_get_feature_name
#define caca_set_dithering   caca_set_feature

Enumerations

enum  caca_color {
  CACA_COLOR_BLACK = 0, CACA_COLOR_BLUE = 1, CACA_COLOR_GREEN = 2, CACA_COLOR_CYAN = 3,
  CACA_COLOR_RED = 4, CACA_COLOR_MAGENTA = 5, CACA_COLOR_BROWN = 6, CACA_COLOR_LIGHTGRAY = 7,
  CACA_COLOR_DARKGRAY = 8, CACA_COLOR_LIGHTBLUE = 9, CACA_COLOR_LIGHTGREEN = 10, CACA_COLOR_LIGHTCYAN = 11,
  CACA_COLOR_LIGHTRED = 12, CACA_COLOR_LIGHTMAGENTA = 13, CACA_COLOR_YELLOW = 14, CACA_COLOR_WHITE = 15
}
 Colour definitions. More...
enum  caca_event {
  CACA_EVENT_NONE = 0x00000000, CACA_EVENT_KEY_PRESS = 0x01000000, CACA_EVENT_KEY_RELEASE = 0x02000000, CACA_EVENT_MOUSE_PRESS = 0x04000000,
  CACA_EVENT_MOUSE_RELEASE = 0x08000000, CACA_EVENT_MOUSE_MOTION = 0x10000000, CACA_EVENT_RESIZE = 0x20000000, CACA_EVENT_ANY = 0xff000000
}
 User events. More...
enum  caca_feature {
  CACA_BACKGROUND = 0x10, CACA_BACKGROUND_BLACK = 0x11, CACA_BACKGROUND_SOLID = 0x12, CACA_ANTIALIASING = 0x20,
  CACA_ANTIALIASING_NONE = 0x21, CACA_ANTIALIASING_PREFILTER = 0x22, CACA_DITHERING = 0x30, CACA_DITHERING_NONE = 0x31,
  CACA_DITHERING_ORDERED2 = 0x32, CACA_DITHERING_ORDERED4 = 0x33, CACA_DITHERING_ORDERED8 = 0x34, CACA_DITHERING_RANDOM = 0x35,
  CACA_FEATURE_UNKNOWN = 0xffff
}
 Internal features. More...
enum  caca_key {
  CACA_KEY_UNKNOWN = 0, CACA_KEY_BACKSPACE = 8, CACA_KEY_TAB = 9, CACA_KEY_RETURN = 13,
  CACA_KEY_PAUSE = 19, CACA_KEY_ESCAPE = 27, CACA_KEY_DELETE = 127, CACA_KEY_UP = 273,
  CACA_KEY_DOWN = 274, CACA_KEY_LEFT = 275, CACA_KEY_RIGHT = 276, CACA_KEY_INSERT = 277,
  CACA_KEY_HOME = 278, CACA_KEY_END = 279, CACA_KEY_PAGEUP = 280, CACA_KEY_PAGEDOWN = 281,
  CACA_KEY_F1 = 282, CACA_KEY_F2 = 283, CACA_KEY_F3 = 284, CACA_KEY_F4 = 285,
  CACA_KEY_F5 = 286, CACA_KEY_F6 = 287, CACA_KEY_F7 = 288, CACA_KEY_F8 = 289,
  CACA_KEY_F9 = 290, CACA_KEY_F10 = 291, CACA_KEY_F11 = 292, CACA_KEY_F12 = 293,
  CACA_KEY_F13 = 294, CACA_KEY_F14 = 295, CACA_KEY_F15 = 296
}
 Special key values. More...

Functions

void caca_clear (void)
 Clear the screen.
struct caca_bitmap * caca_create_bitmap (unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)
 Create an internal bitmap object.
void caca_draw_bitmap (int, int, int, int, struct caca_bitmap const *, void *)
 Draw a bitmap on the screen.
void caca_draw_box (int, int, int, int, char)
 Draw a box on the screen using the given character.
void caca_draw_circle (int, int, int, char)
 Draw a circle on the screen using the given character.
void caca_draw_ellipse (int, int, int, int, char)
 Draw an ellipse on the screen using the given character.
void caca_draw_line (int, int, int, int, char)
 Draw a line on the screen using the given character.
void caca_draw_polyline (int const x[], int const y[], int, char)
 Draw a polyline on the screen using the given character and coordinate arrays. The first and last points are not connected, so in order to draw a polygon you need to specify the starting point at the end of the list as well.
void caca_draw_sprite (int, int, struct caca_sprite const *, int)
 Draw a sprite's specific frame at the given coordinates. If the frame does not exist, nothing is displayed.
void caca_draw_thin_box (int, int, int, int)
 Draw a thin box on the screen.
void caca_draw_thin_ellipse (int, int, int, int)
 Draw a thin ellipse on the screen.
void caca_draw_thin_line (int, int, int, int)
 Draw a thin line on the screen, using ASCII art.
void caca_draw_thin_polyline (int const x[], int const y[], int)
 Draw a thin polyline on the screen using the given coordinate arrays and with ASCII art. The first and last points are not connected, so in order to draw a polygon you need to specify the starting point at the end of the list as well.
void caca_draw_thin_triangle (int, int, int, int, int, int)
 Draw a thin triangle on the screen.
void caca_draw_triangle (int, int, int, int, int, int, char)
 Draw a triangle on the screen using the given character.
void caca_end (void)
 Uninitialise libcaca.
void caca_fill_box (int, int, int, int, char)
 Fill a box on the screen using the given character.
void caca_fill_ellipse (int, int, int, int, char)
 Fill an ellipse on the screen using the given character.
void caca_fill_triangle (int, int, int, int, int, int, char)
 Fill a triangle on the screen using the given character.
void caca_free_bitmap (struct caca_bitmap *)
 Free the memory associated with a bitmap.
void caca_free_sprite (struct caca_sprite *)
 Free the memory associated with a sprite.
enum caca_color caca_get_bg_color (void)
 Get the current background colour.
char const * caca_get_color_name (enum caca_color)
 Translate a colour index into the colour's name.
unsigned int caca_get_event (unsigned int)
 Get the next mouse or keyboard input event.
enum caca_feature caca_get_feature (enum caca_feature)
 Get the current value of a feature.
char const * caca_get_feature_name (enum caca_feature)
 Translate a feature value into the feature's name.
enum caca_color caca_get_fg_color (void)
 Get the current foreground colour.
unsigned int caca_get_height (void)
 Get the screen height.
unsigned int caca_get_mouse_x (void)
 Return the X mouse coordinate.
unsigned int caca_get_mouse_y (void)
 Return the Y mouse coordinate.
unsigned int caca_get_rendertime (void)
 Get the average rendering time.
int caca_get_sprite_dx (struct caca_sprite const *, int)
 Return the X coordinate of a sprite's handle.
int caca_get_sprite_dy (struct caca_sprite const *, int)
 Return the Y coordinate of a sprite's handle.
int caca_get_sprite_frames (struct caca_sprite const *)
 Return the number of frames in a sprite.
int caca_get_sprite_height (struct caca_sprite const *, int)
 Return the height of a sprite.
int caca_get_sprite_width (struct caca_sprite const *, int)
 Return the width of a sprite.
unsigned int caca_get_width (void)
 Get the screen width.
unsigned int caca_get_window_height (void)
 Get the window height.
unsigned int caca_get_window_width (void)
 Get the window width.
int caca_init (void)
 Initialise libcaca.
struct caca_sprite * caca_load_sprite (char const *)
 Allocate a sprite loaded from a file.
void caca_printf (int, int, char const *,...)
 Format a string.
void caca_putchar (int, int, char)
 Print a character.
void caca_putstr (int, int, char const *)
 Print a string.
int caca_rand (int, int)
 Generate a random integer within a range.
void caca_refresh (void)
 Flush pending changes and redraw the screen.
void caca_set_bitmap_palette (struct caca_bitmap *, unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[])
 Set the palette of an 8bpp bitmap object.
void caca_set_color (enum caca_color, enum caca_color)
 Set the default colour pair.
void caca_set_delay (unsigned int)
 Set the refresh delay.
void caca_set_feature (enum caca_feature)
 Set a feature.
int caca_set_window_title (char const *)
 Set the window title.
unsigned int caca_sqrt (unsigned int)
 Approximate a square root, using Newton's method to avoid costly floating point calculations.
unsigned int caca_wait_event (unsigned int)
 Wait for the next mouse or keyboard input event.


Generated by  Doxygen 1.6.0   Back to index