Changeset 268 for libcaca/trunk
- Timestamp:
- Dec 23, 2003, 2:27:40 PM (18 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 18 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/configure.ac
r265 r268 117 117 examples/Makefile 118 118 doc/Makefile 119 doc/doxygen.cfg 119 120 autotools/Makefile 120 121 debian/Makefile -
libcaca/trunk/doc/Makefile.am
r215 r268 1 EXTRA_DIST = doxygen.cfg footer.html header.html $(man_MANS)1 EXTRA_DIST = doxygen.cfg.in footer.html header.html $(man_MANS) 2 2 3 3 man_MANS = caca-config.1 cacademo.1 caca-spritedit.1 cacaview.1 … … 21 21 clean: clean-local 22 22 clean-local: 23 -rm -Rf html latex 23 -rm -Rf html latex man 24 24 -rm -f stamp-latex stamp-doxygen 25 25 -
libcaca/trunk/doc/doxygen.cfg.in
r267 r268 4 4 # Project related configuration options 5 5 #--------------------------------------------------------------------------- 6 PROJECT_NAME = libcaca7 PROJECT_NUMBER = 0.36 PROJECT_NAME = @PACKAGE@ 7 PROJECT_NUMBER = @VERSION@ 8 8 OUTPUT_DIRECTORY = . 9 9 OUTPUT_LANGUAGE = English … … 62 62 # configuration options related to the input files 63 63 #--------------------------------------------------------------------------- 64 INPUT = ../src64 INPUT = @top_srcdir@/src 65 65 FILE_PATTERNS = *.c \ 66 66 *.h … … 96 96 HTML_OUTPUT = html 97 97 HTML_FILE_EXTENSION = .html 98 HTML_HEADER = header.html99 HTML_FOOTER = footer.html98 HTML_HEADER = @srcdir@/header.html 99 HTML_FOOTER = @srcdir@/footer.html 100 100 HTML_STYLESHEET = 101 101 HTML_ALIGN_MEMBERS = YES … … 140 140 MAN_OUTPUT = man 141 141 MAN_EXTENSION = .3caca 142 MAN_LINKS = NO142 MAN_LINKS = YES 143 143 #--------------------------------------------------------------------------- 144 144 # configuration options related to the XML output -
libcaca/trunk/examples/aafire.c
r262 r268 1 1 /* 2 * cacafire fire demo usinglibcaca3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11 * 12 * 13 * 14 * 15 * 16 * 17 * 18 * 19 * 20 * 21 * 22 * 23 * 24 * 25 * 2 * cacafire fire demo for libcaca 3 * Copyright (c) 2003 Sam Hocevar <sam@zoy.org> 4 * Jan Hubicka (hubicka@freesoft.cz) 5 * Thomas A. K. Kjaer (takjaer@daimi.aau.dk) 6 * Tim Newsome (nuisance@cmu.edu) 7 * Kamil Toman (toman@artax.karlin.mff.cuni.cz) 8 * All Rights Reserved 9 * 10 * $Id$ 11 * 12 * This program is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU Lesser General Public 14 * License as published by the Free Software Foundation; either 15 * version 2 of the License, or (at your option) any later version. 16 * 17 * This program is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 * Lesser General Public License for more details. 21 * 22 * You should have received a copy of the GNU Lesser General Public 23 * License along with this program; if not, write to the Free Software 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 25 * 02111-1307 USA 26 26 */ 27 27 -
libcaca/trunk/examples/demo.c
r249 r268 1 1 /* 2 * demo demo usinglibcaca3 * 4 * 2 * demo demo for libcaca 3 * Copyright (c) 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 5 * 6 * 6 * $Id$ 7 7 * 8 * 9 * 10 * 11 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Lesser General Public 10 * License as published by the Free Software Foundation; either 11 * version 2 of the License, or (at your option) any later version. 12 12 * 13 * 14 * 15 * 16 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 17 * 18 * 19 * 20 * 21 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this program; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 21 * 02111-1307 USA 22 22 */ 23 23 -
libcaca/trunk/examples/spritedit.c
r226 r268 1 1 /* 2 * spritedit sprite editor usinglibcaca3 * 4 * 2 * spritedit sprite editor for libcaca 3 * Copyright (c) 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 5 * 6 * 6 * $Id$ 7 7 * 8 * 9 * 10 * 11 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Lesser General Public 10 * License as published by the Free Software Foundation; either 11 * version 2 of the License, or (at your option) any later version. 12 12 * 13 * 14 * 15 * 16 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 17 * 18 * 19 * 20 * 21 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this program; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 21 * 02111-1307 USA 22 22 */ 23 23 -
libcaca/trunk/examples/view.c
r255 r268 1 1 /* 2 * 3 * 4 * 2 * view image viewer for libcaca 3 * Copyright (c) 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 5 * 6 * 6 * $Id$ 7 7 * 8 * 9 * 10 * 11 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Lesser General Public 10 * License as published by the Free Software Foundation; either 11 * version 2 of the License, or (at your option) any later version. 12 12 * 13 * 14 * 15 * 16 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 17 * 18 * 19 * 20 * 21 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this program; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 21 * 02111-1307 USA 22 22 */ 23 23 -
libcaca/trunk/src/bitmap.c
r267 r268 1 1 /* 2 * 3 * 4 * 2 * libcaca ASCII-Art library 3 * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 5 * 6 * 7 * 8 * 9 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 10 * 11 * 12 * 13 * 14 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 15 * 16 * 17 * 18 * 19 * 20 */ 21 22 /** 23 * 24 * 25 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 * 02111-1307 USA 20 */ 21 22 /** \file bitmap.c 23 * \version \$Id$ 24 * \author Sam Hocevar <sam@zoy.org> 25 * \brief Bitmap functions 26 26 * 27 * 27 * This file contains bitmap blitting functions. 28 28 */ 29 29 -
libcaca/trunk/src/box.c
r257 r268 1 1 /* 2 * 3 * 4 * 2 * libcaca ASCII-Art library 3 * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 5 * 6 * 7 * 8 * 9 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 10 * 11 * 12 * 13 * 14 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 15 * 16 * 17 * 18 * 19 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 * 02111-1307 USA 20 20 */ 21 21 22 /** 23 * 24 * 25 * 22 /** \file box.c 23 * \version \$Id$ 24 * \author Sam Hocevar <sam@zoy.org> 25 * \brief Simple box drawing functions 26 26 * 27 * 27 * This file contains box drawing functions, both filled and outline. 28 28 */ 29 29 -
libcaca/trunk/src/caca.c
r267 r268 1 1 /* 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11 * 12 * 13 * 14 * 15 * 16 * 17 * 18 * 19 * 20 */ 21 22 /** 23 * 24 * 25 * 26 * 27 * 28 * 29 * 2 * libcaca ASCII-Art library 3 * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 * 02111-1307 USA 20 */ 21 22 /** \file caca.c 23 * \version \$Id$ 24 * \author Sam Hocevar <sam@zoy.org> 25 * \brief Main \e libcaca functions 26 * 27 * This file contains the main functions used by \e libcaca applications to 28 * initialise the library, get the screen properties, set the framerate and 29 * so on. 30 30 */ 31 31 … … 62 62 #endif 63 63 64 /** 65 * \brief Initialise libcaca. 66 * 67 * \return 0 upon success, a non-zero value if an error occurs. 64 /** \brief Initialise \e libcaca. 65 * 66 * This function initialises internal \e libcaca structures and the backend 67 * that will be used for subsequent graphical operations. It must be the 68 * first \e libcaca function to be called in a function. caca_end() should 69 * be called at the end of the program to free all allocated resources. 70 * 71 * \return 0 upon success, a non-zero value if an error occurs. 68 72 */ 69 73 int caca_init(void) … … 154 158 } 155 159 156 /** 157 * \brief Get the screen width. 158 * 159 * \return The screen width, in character cells. 160 /** \brief Get the screen width. 161 * 162 * This function returns the current screen width, in character cells. 163 * 164 * \return The screen width. 160 165 */ 161 166 unsigned int caca_get_width(void) … … 164 169 } 165 170 166 /** 167 * \brief Get the screen height. 168 * 169 * \return The screen height, in character cells. 171 /** \brief Get the screen height. 172 * 173 * This function returns the current screen height, in character cells. 174 * 175 * \return The screen height. 170 176 */ 171 177 unsigned int caca_get_height(void) … … 210 216 } 211 217 212 /** 213 * \brief Get the current value of a feature. 214 * 215 * \param feature The requested feature. 216 * \return The current value of the feature. 218 /** \brief Get the current value of a feature. 219 * 220 * This function retrieves the value of an internal \e libcaca feature. A 221 * generic feature value is expected, such as CACA_ANTIALIASING. 222 * 223 * \param feature The requested feature. 224 * \return The current value of the feature or CACA_UNKNOWN_FEATURE if an 225 * error occurred.. 217 226 */ 218 227 enum caca_feature caca_get_feature(enum caca_feature feature) … … 232 241 } 233 242 234 /** 235 * \brief Set a feature. 236 * 237 * \param feature The wanted feature. 238 * \return void 243 /** \brief Set a feature. 244 * 245 * This function sets an internal \e libcaca feature such as the antialiasing 246 * or dithering modes. If a specific feature such as CACA_DITHERING_RANDOM, 247 * caca_set_feature() will set it immediately. If a generic feature is given 248 * instead, such as CACA_DITHERING, the default value will be used instead. 249 * 250 * \param feature The requested feature. 239 251 */ 240 252 void caca_set_feature(enum caca_feature feature) … … 299 311 } 300 312 301 /** 302 * \brief Uninitialise libcaca. 303 * 304 * \return void 313 /** \brief Uninitialise \e libcaca. 314 * 315 * This function frees all resources allocated by caca_init(). After 316 * caca_end() has been called, no other \e libcaca functions may be used 317 * unless a new call to caca_init() is done. 305 318 */ 306 319 void caca_end(void) … … 346 359 #endif 347 360 } 361 362 /* 363 * XXX: The following functions are local. 364 */ 348 365 349 366 static void caca_init_driver(void) -
libcaca/trunk/src/caca.h
r267 r268 1 1 /* 2 * libcaca ASCII-Art library 3 * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 * 02111-1307 USA 20 */ 21 22 /** \file caca.h 23 * \version \$Id$ 24 * \author Sam Hocevar <sam@zoy.org> 25 * \brief The \e libcaca public header. 26 * 27 * This header contains the public types and functions that applications 28 * using \e libcaca may use. 29 */ 30 31 /** \mainpage libcaca developer documentation 32 * 33 * \section intro Introduction 34 * 35 * \e libcaca is a graphics library that outputs text instead of pixels, 36 * so that it can work on older video cards or text terminals. It is not 37 * unlike the famous AAlib library. libcaca needs a terminal to work, 38 * thus it should work on all Unix systems (including Mac OS X) using 39 * either the slang library or the ncurses library, on DOS using the conio 40 * library, and on Windows systems using either slang or ncurses (through 41 * Cygwin emulation) or conio. 42 * 43 * \e libcaca is free software, released under the GNU Lesser General 44 * Public License. This ensures that \e libcaca will always remain free 45 * software. 46 * 47 * \section api The libcaca API 48 * 49 * The complete \e libcaca programming interface is available from the 50 * caca.h header. 51 * 52 * \section env Environment variables 53 * 54 * Some environment variables can be used to change the behaviour of 55 * \e libcaca without having to modify the program which uses it. These 56 * variables are: 57 * 58 * \li \b CACA_DRIVER: set the backend video driver. In order of preference: 59 * - \c conio uses the DOS conio.h interface. 60 * - \c ncurses uses the ncurses library. 61 * - \c slang uses the S-Lang library. 62 * - \c x11 uses the native X11 driver. 63 * 64 * \li \b CACA_BACKGROUND: set the background type. 65 * - \c solid uses solid coloured backgrounds for all characters. This 66 * feature does not work with all terminal emulators. This is the 67 * default choice. 68 * - \c black uses only black backgrounds to render characters. 69 * 70 * \li \b CACA_ANTIALIASING: set the antialiasing mode. Antialiasing 71 * smoothens the rendered image and avoids the commonly seen staircase 72 * effect. 73 * - \c none disables antialiasing. 74 * - \c prefilter uses a simple prefilter antialiasing method. This is 75 * the default choice. 76 * 77 * \li \b CACA_DITHERING: set the dithering mode. Dithering is necessary 78 * when rendering a picture that has more colours than the usually 79 * available palette. 80 * - \c none disables dithering. 81 * - \c ordered2 uses a 2x2 Bayer matrix for dithering. 82 * - \c ordered4 uses a 4x4 Bayer matrix for dithering. This is the 83 * default choice. 84 * - \c ordered8 uses a 8x8 Bayer matrix for dithering. 85 * - \c random uses random dithering. 2 * libcaca ASCII-Art library 3 * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 * 02111-1307 USA 20 */ 21 22 /** \file caca.h 23 * \version \$Id$ 24 * \author Sam Hocevar <sam@zoy.org> 25 * \brief The \e libcaca public header. 26 * 27 * This header contains the public types and functions that applications 28 * using \e libcaca may use. 29 */ 30 31 /** \mainpage libcaca developer documentation 32 * 33 * \section intro Introduction 34 * 35 * \e libcaca is a graphics library that outputs text instead of pixels, 36 * so that it can work on older video cards or text terminals. It is not 37 * unlike the famous AAlib library. \e libcaca can use almost any virtual 38 * terminal to work, thus it should work on all Unix systems (including 39 * Mac OS X) using either the slang library or the ncurses library, on DOS 40 * using the conio library, and on Windows systems using either slang or 41 * ncurses (through Cygwin emulation) or conio. There is also a native X11 42 * driver that does not require a text terminal. 43 * 44 * \e libcaca is free software, released under the GNU Lesser General 45 * Public License. This ensures that \e libcaca will always remain free 46 * software. 47 * 48 * \section api The libcaca API 49 * 50 * The complete \e libcaca programming interface is available from the 51 * caca.h header. 52 * 53 * \section env Environment variables 54 * 55 * Some environment variables can be used to change the behaviour of 56 * \e libcaca without having to modify the program which uses it. These 57 * variables are: 58 * 59 * \li \b CACA_DRIVER: set the backend video driver. In order of preference: 60 * - \c conio uses the DOS conio.h interface. 61 * - \c ncurses uses the ncurses library. 62 * - \c slang uses the S-Lang library. 63 * - \c x11 uses the native X11 driver. 64 * 65 * \li \b CACA_BACKGROUND: set the background type. 66 * - \c solid uses solid coloured backgrounds for all characters. This 67 * feature does not work with all terminal emulators. This is the 68 * default choice. 69 * - \c black uses only black backgrounds to render characters. 70 * 71 * \li \b CACA_ANTIALIASING: set the antialiasing mode. Antialiasing 72 * smoothens the rendered image and avoids the commonly seen staircase 73 * effect. 74 * - \c none disables antialiasing. 75 * - \c prefilter uses a simple prefilter antialiasing method. This is 76 * the default choice. 77 * 78 * \li \b CACA_DITHERING: set the dithering mode. Dithering is necessary 79 * when rendering a picture that has more colours than the usually 80 * available palette. 81 * - \c none disables dithering. 82 * - \c ordered2 uses a 2x2 Bayer matrix for dithering. 83 * - \c ordered4 uses a 4x4 Bayer matrix for dithering. This is the 84 * default choice. 85 * - \c ordered8 uses a 8x8 Bayer matrix for dithering. 86 * - \c random uses random dithering. 86 87 */ 87 88 … … 118 119 }; 119 120 120 /** \ingroup convenience */121 const char *caca_get_color_name(enum caca_color);122 123 121 /** \brief Internal features. 124 122 * … … 151 149 CACA_UNKNOWN_FEATURE = 0xffff /**< Unknown feature. */ 152 150 }; 153 154 /** \ingroup convenience */155 const char *caca_get_feature_name(enum caca_feature);156 151 157 152 /* … … 209 204 210 205 /** \defgroup basic Basic functions 211 * \@{ */ 206 * 207 * These functions provide the basic \e libcaca routines for library 208 * initialisation, system information retrieval and configuration. 209 * 210 * @{ */ 212 211 int caca_init(void); 213 212 void caca_set_delay(unsigned int); 214 213 enum caca_feature caca_get_feature(enum caca_feature); 215 214 void caca_set_feature(enum caca_feature); 215 const char *caca_get_feature_name(enum caca_feature); 216 216 unsigned int caca_get_rendertime(void); 217 217 unsigned int caca_get_width(void); … … 219 219 void caca_refresh(void); 220 220 void caca_end(void); 221 /* * \@} */221 /* @} */ 222 222 223 223 /** \defgroup event Event handling functions 224 * \@{ */ 224 * 225 * These functions handle user events such as keyboard input and mouse 226 * clicks. 227 * 228 * @{ */ 225 229 unsigned int caca_get_event(void); 226 /** \@} */ 230 unsigned int caca_wait_event(void); 231 /* @} */ 227 232 228 233 /** \defgroup char Character printing functions 229 * \@{ */ 234 * 235 * These functions provide low-level character printing routines. 236 * 237 * @{ */ 230 238 void caca_set_color(enum caca_color, enum caca_color); 231 239 enum caca_color caca_get_fg_color(void); 232 240 enum caca_color caca_get_bg_color(void); 241 const char *caca_get_color_name(enum caca_color); 233 242 void caca_putchar(int, int, char); 234 243 void caca_putstr(int, int, const char *); 235 244 void caca_printf(int, int, const char *, ...); 236 245 void caca_clear(void); 237 /* * \@} */246 /* @} */ 238 247 239 248 /** \defgroup prim Primitives drawing functions 240 * \@{ */ 249 * 250 * These functions provide routines for primitive drawing, such as lines, 251 * boxes, triangles and ellipses. 252 * 253 * @{ */ 241 254 void caca_draw_line(int, int, int, int, char); 242 255 void caca_draw_polyline(const int x[], const int y[], int, char); … … 256 269 void caca_draw_thin_triangle(int, int, int, int, int, int); 257 270 void caca_fill_triangle(int, int, int, int, int, int, char); 258 /* * \@} */271 /* @} */ 259 272 260 273 /** \defgroup math Mathematical functions 261 * \@{ */ 274 * 275 * These functions provide a few useful math-related routines. 276 * 277 * @{ */ 262 278 int caca_rand(int, int); 263 279 unsigned int caca_sqrt(unsigned int); 264 /* * \@} */280 /* @} */ 265 281 266 282 /** \defgroup sprite Sprite handling functions 267 * \@{ */ 283 * 284 * These functions provide high level routines for sprite loading, animation 285 * and rendering. 286 * 287 * @{ */ 268 288 struct caca_sprite; 269 289 struct caca_sprite * caca_load_sprite(const char *); … … 275 295 void caca_draw_sprite(int, int, const struct caca_sprite *, int); 276 296 void caca_free_sprite(struct caca_sprite *); 277 /* * \@} */297 /* @} */ 278 298 279 299 /** \defgroup bitmap Bitmap handling functions 280 * \@{ */ 300 * 301 * These functions provide high level routines for bitmap allocation and 302 * rendering. 303 * 304 * @{ */ 281 305 struct caca_bitmap; 282 306 struct caca_bitmap *caca_create_bitmap(unsigned int, unsigned int, … … 289 313 void caca_draw_bitmap(int, int, int, int, const struct caca_bitmap *, void *); 290 314 void caca_free_bitmap(struct caca_bitmap *); 291 /** \@} */ 292 293 /** \defgroup convenience Convenience functions */ 315 /* @} */ 294 316 295 317 #ifdef __cplusplus -
libcaca/trunk/src/caca_internals.h
r265 r268 1 1 /* 2 * 3 * 4 * 2 * libcaca ASCII-Art library 3 * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 5 * 6 * 7 * 8 * 9 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 10 * 11 * 12 * 13 * 14 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 15 * 16 * 17 * 18 * 19 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 * 02111-1307 USA 20 20 */ 21 21 22 /** 23 * 24 * 25 * 22 /** \file caca_internals.h 23 * \version \$Id$ 24 * \author Sam Hocevar <sam@zoy.org> 25 * \brief The \e libcaca private header. 26 26 * 27 * 27 * This header contains the private types and functions used by \e libcaca. 28 28 */ 29 29 -
libcaca/trunk/src/conic.c
r265 r268 1 1 /* 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11 * 12 * 13 * 14 * 15 * 16 * 17 * 18 * 19 * 20 */ 21 22 /** 23 * 24 * 25 * 26 * 27 * 28 * 2 * libcaca ASCII-Art library 3 * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 * 02111-1307 USA 20 */ 21 22 /** \file conic.c 23 * \version \$Id$ 24 * \author Sam Hocevar <sam@zoy.org> 25 * \brief Ellipse and circle drawing functions 26 * 27 * This file contains ellipse and circle drawing functions, both filled 28 * and outline. 29 29 */ 30 30 -
libcaca/trunk/src/graphics.c
r265 r268 1 1 /* 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11 * 12 * 13 * 14 * 15 * 16 * 17 * 18 * 19 * 20 */ 21 22 /** 23 * 24 * 25 * 26 * 27 * 2 * libcaca ASCII-Art library 3 * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 * 02111-1307 USA 20 */ 21 22 /** \file graphics.c 23 * \version \$Id$ 24 * \author Sam Hocevar <sam@zoy.org> 25 * \brief Character drawing functions 26 * 27 * This file contains character and string drawing functions. 28 28 */ 29 29 … … 100 100 static enum caca_color _caca_bgcolor = CACA_COLOR_BLACK; 101 101 102 /** 103 * \brief Set the default colour pair. 104 * 105 * \param fgcolor The desired foreground colour. 106 * \param bgcolor The desired background colour. 107 * \return void 102 /** \brief Set the default colour pair. 103 * 104 * This function sets the default colour pair. String functions such as 105 * caca_printf() and graphical primitive functions such as caca_draw_line() 106 * will use these colour pairs. 107 * 108 * \param fgcolor The requested foreground colour. 109 * \param bgcolor The requested background colour. 108 110 */ 109 111 void caca_set_color(enum caca_color fgcolor, enum caca_color bgcolor) … … 142 144 } 143 145 144 /** 145 * \brief Get the current foreground colour. 146 * 147 * \return The current foreground colour. 146 /** \brief Get the current foreground colour. 147 * 148 * This function returns the current foreground colour that was set with 149 * caca_set_color(). 150 * 151 * \return The current foreground colour. 148 152 */ 149 153 enum caca_color caca_get_fg_color(void) … … 152 156 } 153 157 154 /** 155 * \brief Get the current background colour. 156 * 157 * \return The current background colour. 158 /** \brief Get the current background colour. 159 * 160 * This function returns the current background colour that was set with 161 * caca_set_color(). 162 * 163 * \return The current background colour. 158 164 */ 159 165 enum caca_color caca_get_bg_color(void) … … 162 168 } 163 169 164 /** 165 * \brief Print a character at given coordinates. 166 * 167 * \param x The X coordinate of the character. 168 * \param y The Y coordinate of the character. 169 * \param c The character to print. 170 * \return void 170 /** \brief Print a character. 171 * 172 * This function prints a character at the given coordinates, using the 173 * default foreground and background values. If the coordinates are outside 174 * the screen boundaries, nothing is printed. 175 * 176 * \param x X coordinate. 177 * \param y Y coordinate. 178 * \param c The character to print. 171 179 */ 172 180 void caca_putchar(int x, int y, char c) … … 213 221 } 214 222 215 /** 216 * \brief Print a string at given coordinates. 217 * 218 * \param x The X coordinate of the string. 219 * \param y The Y coordinate of the string. 220 * \param s The string to print. 221 * \return void 223 /** \brief Print a string. 224 * 225 * This function prints a string at the given coordinates, using the 226 * default foreground and background values. The coordinates may be outside 227 * the screen boundaries (eg. a negative Y coordinate) and the string will 228 * be cropped accordingly if it is too long. 229 * 230 * \param x X coordinate. 231 * \param y Y coordinate. 232 * \param s The string to print. 222 233 */ 223 234 void caca_putstr(int x, int y, const char *s) … … 291 302 } 292 303 293 /** 294 * \brief Format a string at given coordinates. 295 * 296 * \param x The X coordinate of the string. 297 * \param y The Y coordinate of the string. 298 * \param format The format string to print. 299 * \param ... Arguments to the format string. 300 * \return void 304 /** \brief Format a string. 305 * 306 * This function formats a string at the given coordinates, using the 307 * default foreground and background values. The coordinates may be outside 308 * the screen boundaries (eg. a negative Y coordinate) and the string will 309 * be cropped accordingly if it is too long. The syntax of the format 310 * string is the same as for the C printf() function. 311 * 312 * \param x X coordinate. 313 * \param y Y coordinate. 314 * \param format The format string to print. 315 * \param ... Arguments to the format string. 301 316 */ 302 317 void caca_printf(int x, int y, const char *format, ...) … … 327 342 } 328 343 329 /** 330 * \brief Clear the screen. 331 * 332 * \return void 344 /** \brief Clear the screen. 345 * 346 * This function clears the screen using a black background. 333 347 */ 334 348 void caca_clear(void) … … 638 652 } 639 653 640 /** 641 * \brief Set the refresh delay. 642 * 643 * \param usec The refresh delay in microseconds. 644 * \return void 654 /** \brief Set the refresh delay. 655 * 656 * This function sets the refresh delay in microseconds. The refresh delay 657 * is used by caca_refresh() to achieve constant framerate. See the 658 * caca_refresh() documentation for more details. 659 * 660 * If the argument is zero, constant framerate is disabled. This is the 661 * default behaviour. 662 * 663 * \param usec The refresh delay in microseconds. 645 664 */ 646 665 void caca_set_delay(unsigned int usec) … … 649 668 } 650 669 651 /** 652 * \brief Get the average rendering time. 653 * 654 * \return The render time in microseconds. 670 /** \brief Get the average rendering time. 671 * 672 * This function returns the average rendering time, which is the average 673 * measured time between two caca_refresh() calls, in microseconds. If 674 * constant framerate was activated by calling caca_set_delay(), the average 675 * rendering time will not be considerably shorter than the requested delay 676 * even if the real rendering time was shorter. 677 * 678 * \return The render time in microseconds. 655 679 */ 656 680 unsigned int caca_get_rendertime(void) … … 679 703 } 680 704 681 /** 682 * \brief Flush pending changes and redraw the screen. 683 * 684 * \return void 705 /** \brief Flush pending changes and redraw the screen. 706 * 707 * This function flushes all graphical operations and prints them to the 708 * screen. Nothing will show on the screen caca_refresh() is not called. 709 * 710 * If caca_set_delay() was called with a non-zero value, caca_refresh() 711 * will use that value to achieve constant framerate: if two consecutive 712 * calls to caca_refresh() are within a time range shorter than the value 713 * set with caca_set_delay(), the second call will wait a bit before 714 * performing the screen refresh. 685 715 */ 686 716 void caca_refresh(void) -
libcaca/trunk/src/io.c
r265 r268 1 1 /* 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11 * 12 * 13 * 14 * 15 * 16 * 17 * 18 * 19 * 20 */ 21 22 /** 23 * 24 * 25 * 26 * 27 * 2 * libcaca ASCII-Art library 3 * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 * 02111-1307 USA 20 */ 21 22 /** \file io.c 23 * \version \$Id$ 24 * \author Sam Hocevar <sam@zoy.org> 25 * \brief Event handling functions 26 * 27 * This file contains event handling functions for keyboard and mouse input. 28 28 */ 29 29 … … 55 55 static int keys = 0; 56 56 57 /** 58 * \brief Get the next mouse or keyboard input event. 57 /** \brief Get the next mouse or keyboard input event. 58 * 59 * This function polls the event queue for mouse or keyboard events and 60 * returns the event. It is non-blocking and returns zero if no event is 61 * pending in the queue. See also caca_wait_event() for a blocking version 62 * of this function. 59 63 * 60 64 * \return The next event in the queue, or 0 if no event is pending. … … 187 191 } 188 192 193 /** \brief Wait for the next mouse or keyboard input event. 194 * 195 * This function returns the first mouse or keyboard event in the queue. If 196 * no event is pending, it blocks until an event is received. See also 197 * caca_get_event() for a non-blocking version of this function. 198 * 199 * \return The next event in the queue. 200 */ 201 unsigned int caca_wait_event(void) 202 { 203 for( ; ; ) 204 { 205 unsigned int event = caca_get_event(); 206 207 if(event) 208 return event; 209 210 usleep(1000); 211 } 212 } 213 214 /* 215 * XXX: The following functions are local. 216 */ 217 189 218 static void _push_key(unsigned int key) 190 219 { -
libcaca/trunk/src/line.c
r265 r268 1 1 /* 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11 * 12 * 13 * 14 * 15 * 16 * 17 * 18 * 19 * 20 */ 21 22 /** 23 * 24 * 25 * 26 * 27 * 28 * 2 * libcaca ASCII-Art library 3 * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 * 02111-1307 USA 20 */ 21 22 /** \file line.c 23 * \version \$Id$ 24 * \author Sam Hocevar <sam@zoy.org> 25 * \brief Line drawing functions 26 * 27 * This file contains line and polyline drawing functions, with both thin 28 * and thick styles. 29 29 */ 30 30 … … 79 79 /** 80 80 * \brief Draw a polyline on the screen using the given character and 81 * 82 * 83 * 81 * coordinate arrays. The first and last points are not connected, 82 * so in order to draw a polygon you need to specify the starting 83 * point at the end of the list as well. 84 84 * 85 85 * \param x Array of X coordinates. Must have \p n + 1 elements. … … 128 128 /** 129 129 * \brief Draw a thin polyline on the screen using the given coordinate 130 * 131 * 132 * 130 * arrays and with ASCII art. The first and last points are not 131 * connected, so in order to draw a polygon you need to specify the 132 * starting point at the end of the list as well. 133 133 * 134 134 * \param x Array of X coordinates. Must have \p n + 1 elements. … … 240 240 /** 241 241 * \brief Solid line drawing function, using Bresenham's mid-point line 242 * 242 * scan-conversion algorithm. 243 243 * 244 244 * \param s a line structure -
libcaca/trunk/src/math.c
r257 r268 1 1 /* 2 * 3 * 4 * 2 * libcaca ASCII-Art library 3 * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 5 * 6 * 7 * 8 * 9 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 10 * 11 * 12 * 13 * 14 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 15 * 16 * 17 * 18 * 19 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 * 02111-1307 USA 20 20 */ 21 21 22 /** 23 * 24 * 25 * 22 /** \file math.c 23 * \version \$Id$ 24 * \author Sam Hocevar <sam@zoy.org> 25 * \brief Math functions 26 26 * 27 * 27 * This file contains simple mathematical routines. 28 28 */ 29 29 -
libcaca/trunk/src/sprite.c
r257 r268 1 1 /* 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11 * 12 * 13 * 14 * 15 * 16 * 17 * 18 * 19 * 20 */ 21 22 /** 23 * 24 * 25 * 26 * 27 * 2 * libcaca ASCII-Art library 3 * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 * 02111-1307 USA 20 */ 21 22 /** \file sprite.c 23 * \version \$Id$ 24 * \author Sam Hocevar <sam@zoy.org> 25 * \brief Sprite loading and blitting 26 * 27 * This file contains a small framework for sprite loading and blitting. 28 28 */ 29 29 -
libcaca/trunk/src/triangle.c
r257 r268 1 1 /* 2 * 3 * 4 * 2 * libcaca ASCII-Art library 3 * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> 4 * All Rights Reserved 5 5 * 6 * 7 * 8 * 9 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 10 * 11 * 12 * 13 * 14 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 15 * 16 * 17 * 18 * 19 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 * 02111-1307 USA 20 20 */ 21 21 22 /** 23 * 24 * 25 * 22 /** \file triangle.c 23 * \version \$Id$ 24 * \author Sam Hocevar <sam@zoy.org> 25 * \brief Triangle drawing functions 26 26 * 27 * 27 * This file contains triangle drawing functions, both filled and outline. 28 28 */ 29 29
Note: See TracChangeset
for help on using the changeset viewer.