From dbce0a0e2f91510e365977b8a8c7a50ea54c212d Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 22 Nov 2003 12:45:25 +0000 Subject: [PATCH] * src/: + Doxygenated a few things. --- src/blit.c | 10 ++++++-- src/box.c | 10 ++++++-- src/caca.c | 12 ++++++++-- src/caca.h | 57 +++++++++++++++++++++++++++++++------------- src/caca_internals.h | 10 ++++++-- src/conic.c | 11 +++++++-- src/graphics.c | 10 ++++++-- src/io.c | 10 ++++++-- src/line.c | 21 ++++++++++------ src/math.c | 10 ++++++-- src/sprite.c | 10 ++++++-- src/triangle.c | 10 ++++++-- 12 files changed, 138 insertions(+), 43 deletions(-) diff --git a/src/blit.c b/src/blit.c index b3df1c2..f30d98f 100644 --- a/src/blit.c +++ b/src/blit.c @@ -3,8 +3,6 @@ * Copyright (c) 2002, 2003 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -21,6 +19,14 @@ * 02111-1307 USA */ +/** \file blit.c + * \version \$Id$ + * \author Sam Hocevar + * \brief Bitmap functions + * + * This file contains bitmap blitting functions. + */ + #include "config.h" #ifdef HAVE_INTTYPES_H diff --git a/src/box.c b/src/box.c index f6fb018..4b9a47d 100644 --- a/src/box.c +++ b/src/box.c @@ -3,8 +3,6 @@ * Copyright (c) 2002, 2003 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -21,6 +19,14 @@ * 02111-1307 USA */ +/** \file box.c + * \version \$Id$ + * \author Sam Hocevar + * \brief Simple box drawing functions + * + * This file contains box drawing functions, both filled and outline. + */ + #include "config.h" #include diff --git a/src/caca.c b/src/caca.c index 53f9874..d3cae94 100644 --- a/src/caca.c +++ b/src/caca.c @@ -3,8 +3,6 @@ * Copyright (c) 2002, 2003 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -21,6 +19,16 @@ * 02111-1307 USA */ +/** \file caca.c + * \version \$Id$ + * \author Sam Hocevar + * \brief Main \e libcaca functions + * + * This file contains the main functions used by \e libcaca applications to + * initialise the library, get the screen properties, set the framerate and + * so on. + */ + #include "config.h" #if defined(USE_SLANG) diff --git a/src/caca.h b/src/caca.h index b02a7e9..a1a2243 100644 --- a/src/caca.h +++ b/src/caca.h @@ -3,8 +3,6 @@ * Copyright (c) 2002, 2003 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -21,6 +19,37 @@ * 02111-1307 USA */ +/** \file caca.h + * \version \$Id$ + * \author Sam Hocevar + * \brief The \e libcaca public header. + * + * This header contains the public types and functions that applications + * using \e libcaca may use. + */ + +/** \mainpage libcaca developer documentation + * + * \section intro Introduction + * + * \e libcaca is a graphics library that outputs text instead of pixels, + * so that it can work on older video cards or text terminals. It is not + * unlike the famous AAlib library. libcaca needs a terminal to work, + * thus it should work on all Unix systems (including Mac OS X) using + * either the slang library or the ncurses library, on DOS using the conio + * library, and on Windows systems using either slang or ncurses (through + * Cygwin emulation) or conio. + * + * \e libcaca is free software, released under the GNU Lesser General + * Public License. This ensures that \e libcaca will always remain free + * software. + * + * \section api The libcaca API + * + * The complete \e libcaca programming interface is available from the + * caca.h file. + */ + #ifndef __CACA_H__ #define __CACA_H__ @@ -29,8 +58,8 @@ extern "C" { #endif -/* - * Colors +/** + * The colour definitions to be used with caca_set_color(). */ enum caca_color { @@ -52,8 +81,8 @@ enum caca_color CACA_COLOR_WHITE = 15 }; -/* - * Dithering modes +/** + * The dithering modes to be used with caca_set_dithering(). */ enum caca_dithering { @@ -62,8 +91,8 @@ enum caca_dithering CACA_DITHER_RANDOM }; -/* - * Events +/** + * The event types returned by caca_get_event(). */ enum caca_event { @@ -73,8 +102,8 @@ enum caca_event CACA_EVENT_MOUSE_CLICK = 0x04000000 }; -/* - * Keys +/** + * The special key values returned by caca_get_event(). */ enum caca_key { @@ -100,12 +129,6 @@ enum caca_key CACA_KEY_F15 = 296 }; -/* - * Internal types - */ -struct caca_sprite; -struct caca_bitmap; - /* * Basic functions */ @@ -164,6 +187,7 @@ unsigned int caca_sqrt(unsigned int); /* * Sprite handling */ +struct caca_sprite; struct caca_sprite * caca_load_sprite(const char *); int caca_get_sprite_frames(struct caca_sprite *); int caca_get_sprite_width(struct caca_sprite *, int); @@ -176,6 +200,7 @@ void caca_free_sprite(struct caca_sprite *); /* * Bitmap handling */ +struct caca_bitmap; struct caca_bitmap *caca_create_bitmap(int, int, int, int, int, int, int); void caca_draw_bitmap(int, int, int, int, struct caca_bitmap *, char *); void caca_free_bitmap(struct caca_bitmap *); diff --git a/src/caca_internals.h b/src/caca_internals.h index fdc3e6d..68f1f1f 100644 --- a/src/caca_internals.h +++ b/src/caca_internals.h @@ -3,8 +3,6 @@ * Copyright (c) 2002, 2003 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -21,6 +19,14 @@ * 02111-1307 USA */ +/** \file caca_internals.h + * \version \$Id$ + * \author Sam Hocevar + * \brief The \e libcaca private header. + * + * This header contains the private types and functions used by \e libcaca. + */ + #ifndef __CACA_INTERNALS_H__ #define __CACA_INTERNALS_H__ diff --git a/src/conic.c b/src/conic.c index ba17404..c28b62d 100644 --- a/src/conic.c +++ b/src/conic.c @@ -3,8 +3,6 @@ * Copyright (c) 2002, 2003 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -21,6 +19,15 @@ * 02111-1307 USA */ +/** \file conic.c + * \version \$Id$ + * \author Sam Hocevar + * \brief Ellipse and circle drawing functions + * + * This file contains ellipse and circle drawing functions, both filled + * and outline. + */ + #include "config.h" #ifdef HAVE_INTTYPES_H diff --git a/src/graphics.c b/src/graphics.c index dbc20dc..faf620d 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -3,8 +3,6 @@ * Copyright (c) 2002, 2003 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -21,6 +19,14 @@ * 02111-1307 USA */ +/** \file graphics.c + * \version \$Id$ + * \author Sam Hocevar + * \brief Character drawing functions + * + * This file contains character and string drawing functions. + */ + #include "config.h" #if defined(USE_SLANG) diff --git a/src/io.c b/src/io.c index bb10f5b..c4fccab 100644 --- a/src/io.c +++ b/src/io.c @@ -3,8 +3,6 @@ * Copyright (c) 2002, 2003 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -21,6 +19,14 @@ * 02111-1307 USA */ +/** \file io.c + * \version \$Id$ + * \author Sam Hocevar + * \brief Event handling functions + * + * This file contains event handling functions for keyboard and mouse input. + */ + #include "config.h" #if defined(USE_SLANG) diff --git a/src/line.c b/src/line.c index 842ebd3..3ba4f83 100644 --- a/src/line.c +++ b/src/line.c @@ -3,8 +3,6 @@ * Copyright (c) 2002, 2003 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -21,6 +19,15 @@ * 02111-1307 USA */ +/** \file line.c + * \version \$Id$ + * \author Sam Hocevar + * \brief Line drawing functions + * + * This file contains line and polyline drawing functions, with both thin + * and thick styles. + */ + #include "config.h" #ifdef HAVE_INTTYPES_H @@ -55,7 +62,7 @@ static void draw_thin_line(struct line*); * \param x2 X coordinate of the second point. * \param y2 Y coordinate of the second point. * \param c Character to draw the line with. - * \return nothing + * \return void */ void caca_draw_line(int x1, int y1, int x2, int y2, char c) { @@ -93,7 +100,7 @@ void caca_draw_polyline(const int x[], const int y[], int n, char c) * \param y1 Y coordinate of the first point. * \param x2 X coordinate of the second point. * \param y2 Y coordinate of the second point. - * \return nothing + * \return void */ void caca_draw_thin_line(int x1, int y1, int x2, int y2) { @@ -130,7 +137,7 @@ void caca_draw_thin_polyline(const int x[], const int y[], int n) * \brief Generic Cohen-Sutherland line clipping function. * * \param s a line structure - * \return nothing + * \return void */ static void clip_line(struct line* s) { @@ -212,7 +219,7 @@ static uint8_t clip_bits(int x, int y) * scan-conversion algorithm. * * \param s a line structure - * \return nothing + * \return void */ static void draw_solid_line(struct line* s) { @@ -279,7 +286,7 @@ static void draw_solid_line(struct line* s) * scan-conversion algorithm and ASCII art graphics. * * \param s a line structure - * \return nothing + * \return void */ static void draw_thin_line(struct line* s) { diff --git a/src/math.c b/src/math.c index 8318c6a..bd66bc0 100644 --- a/src/math.c +++ b/src/math.c @@ -3,8 +3,6 @@ * Copyright (c) 2002, 2003 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -21,6 +19,14 @@ * 02111-1307 USA */ +/** \file math.c + * \version \$Id$ + * \author Sam Hocevar + * \brief Math functions + * + * This file contains simple mathematical routines. + */ + #include "config.h" #include diff --git a/src/sprite.c b/src/sprite.c index 9c55ff6..d92112f 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -3,8 +3,6 @@ * Copyright (c) 2002, 2003 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -21,6 +19,14 @@ * 02111-1307 USA */ +/** \file sprite.c + * \version \$Id$ + * \author Sam Hocevar + * \brief Sprite loading and blitting + * + * This file contains a small framework for sprite loading and blitting. + */ + #include "config.h" #include diff --git a/src/triangle.c b/src/triangle.c index 9842911..8c57aec 100644 --- a/src/triangle.c +++ b/src/triangle.c @@ -3,8 +3,6 @@ * Copyright (c) 2002, 2003 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -21,6 +19,14 @@ * 02111-1307 USA */ +/** \file triangle.c + * \version \$Id$ + * \author Sam Hocevar + * \brief Triangle drawing functions + * + * This file contains triangle drawing functions, both filled and outline. + */ + #include "config.h" #include