Changeset 268


Ignore:
Timestamp:
Dec 23, 2003, 2:27:40 PM (16 years ago)
Author:
Sam Hocevar
Message:
  • src/io.c: + Added caca_wait_event(), a blocking caca_get_event().
  • src/ examples/: + More documentation.
  • doc/doxygen.cfg.in: + doc/doxygen.cfg is now generated by configure, so that we can use

@top_srcdir@ and we no longer need to hardcode PROJECT_NUMBER.

+ Create manpages.

Location:
libcaca/trunk
Files:
18 edited
1 moved

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/configure.ac

    r265 r268  
    117117  examples/Makefile
    118118  doc/Makefile
     119  doc/doxygen.cfg
    119120  autotools/Makefile
    120121  debian/Makefile
  • libcaca/trunk/doc/Makefile.am

    r215 r268  
    1 EXTRA_DIST = doxygen.cfg footer.html header.html $(man_MANS)
     1EXTRA_DIST = doxygen.cfg.in footer.html header.html $(man_MANS)
    22
    33man_MANS = caca-config.1 cacademo.1 caca-spritedit.1 cacaview.1
     
    2121clean: clean-local
    2222clean-local:
    23         -rm -Rf html latex
     23        -rm -Rf html latex man
    2424        -rm -f stamp-latex stamp-doxygen
    2525
  • libcaca/trunk/doc/doxygen.cfg.in

    r267 r268  
    44# Project related configuration options
    55#---------------------------------------------------------------------------
    6 PROJECT_NAME           = libcaca
    7 PROJECT_NUMBER         = 0.3
     6PROJECT_NAME           = @PACKAGE@
     7PROJECT_NUMBER         = @VERSION@
    88OUTPUT_DIRECTORY       = .
    99OUTPUT_LANGUAGE        = English
     
    6262# configuration options related to the input files
    6363#---------------------------------------------------------------------------
    64 INPUT                  = ../src
     64INPUT                  = @top_srcdir@/src
    6565FILE_PATTERNS          = *.c \
    6666                         *.h
     
    9696HTML_OUTPUT            = html
    9797HTML_FILE_EXTENSION    = .html
    98 HTML_HEADER            = header.html
    99 HTML_FOOTER            = footer.html
     98HTML_HEADER            = @srcdir@/header.html
     99HTML_FOOTER            = @srcdir@/footer.html
    100100HTML_STYLESHEET        =
    101101HTML_ALIGN_MEMBERS     = YES
     
    140140MAN_OUTPUT             = man
    141141MAN_EXTENSION          = .3caca
    142 MAN_LINKS              = NO
     142MAN_LINKS              = YES
    143143#---------------------------------------------------------------------------
    144144# configuration options related to the XML output
  • libcaca/trunk/examples/aafire.c

    r262 r268  
    11/*
    2  *   cacafire      fire demo using 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
     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
    2626 */
    2727
  • libcaca/trunk/examples/demo.c

    r249 r268  
    11/*
    2  *   demo          demo using libcaca
    3  *   Copyright (c) 2003 Sam Hocevar <sam@zoy.org>
    4  *                 All Rights Reserved
     2 *  demo          demo for libcaca
     3 *  Copyright (c) 2003 Sam Hocevar <sam@zoy.org>
     4 *                All Rights Reserved
    55 *
    6  *   $Id$
     6 *  $Id$
    77 *
    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.
     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.
    1212 *
    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.
     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.
    1717 *
    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
     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
    2222 */
    2323
  • libcaca/trunk/examples/spritedit.c

    r226 r268  
    11/*
    2  *   spritedit     sprite editor using libcaca
    3  *   Copyright (c) 2003 Sam Hocevar <sam@zoy.org>
    4  *                 All Rights Reserved
     2 *  spritedit     sprite editor for libcaca
     3 *  Copyright (c) 2003 Sam Hocevar <sam@zoy.org>
     4 *                All Rights Reserved
    55 *
    6  *   $Id$
     6 *  $Id$
    77 *
    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.
     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.
    1212 *
    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.
     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.
    1717 *
    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
     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
    2222 */
    2323
  • libcaca/trunk/examples/view.c

    r255 r268  
    11/*
    2  *   view          image viewer for libcaca
    3  *   Copyright (c) 2003 Sam Hocevar <sam@zoy.org>
    4  *                 All Rights Reserved
     2 *  view          image viewer for libcaca
     3 *  Copyright (c) 2003 Sam Hocevar <sam@zoy.org>
     4 *                All Rights Reserved
    55 *
    6  *   $Id$
     6 *  $Id$
    77 *
    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.
     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.
    1212 *
    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.
     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.
    1717 *
    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
     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
    2222 */
    2323
  • libcaca/trunk/src/bitmap.c

    r267 r268  
    11/*
    2  *   libcaca       ASCII-Art library
    3  *   Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org>
    4  *                 All Rights Reserved
     2 *  libcaca       ASCII-Art library
     3 *  Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org>
     4 *                All Rights Reserved
    55 *
    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.
     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.
    1010 *
    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.
     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.
    1515 *
    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
     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
    2626 *
    27  *   This file contains bitmap blitting functions.
     27 *  This file contains bitmap blitting functions.
    2828 */
    2929
  • libcaca/trunk/src/box.c

    r257 r268  
    11/*
    2  *   libcaca       ASCII-Art library
    3  *   Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org>
    4  *                 All Rights Reserved
     2 *  libcaca       ASCII-Art library
     3 *  Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org>
     4 *                All Rights Reserved
    55 *
    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.
     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.
    1010 *
    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.
     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.
    1515 *
    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
     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
    2020 */
    2121
    22 /**  \file box.c
    23  *   \version \$Id$
    24  *   \author Sam Hocevar <sam@zoy.org>
    25  *   \brief Simple box drawing functions
     22/** \file box.c
     23 *  \version \$Id$
     24 *  \author Sam Hocevar <sam@zoy.org>
     25 *  \brief Simple box drawing functions
    2626 *
    27  *   This file contains box drawing functions, both filled and outline.
     27 *  This file contains box drawing functions, both filled and outline.
    2828 */
    2929
  • libcaca/trunk/src/caca.c

    r267 r268  
    11/*
    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.
     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.
    3030 */
    3131
     
    6262#endif
    6363
    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.
    6872 */
    6973int caca_init(void)
     
    154158}
    155159
    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.
    160165 */
    161166unsigned int caca_get_width(void)
     
    164169}
    165170
    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.
    170176 */
    171177unsigned int caca_get_height(void)
     
    210216}
    211217
    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..
    217226 */
    218227enum caca_feature caca_get_feature(enum caca_feature feature)
     
    232241}
    233242
    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.
    239251 */
    240252void caca_set_feature(enum caca_feature feature)
     
    299311}
    300312
    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.
    305318 */
    306319void caca_end(void)
     
    346359#endif
    347360}
     361
     362/*
     363 * XXX: The following functions are local.
     364 */
    348365
    349366static void caca_init_driver(void)
  • libcaca/trunk/src/caca.h

    r267 r268  
    11/*
    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.
    8687 */
    8788
     
    118119};
    119120
    120 /** \ingroup convenience */
    121 const char *caca_get_color_name(enum caca_color);
    122 
    123121/** \brief Internal features.
    124122 *
     
    151149    CACA_UNKNOWN_FEATURE = 0xffff /**< Unknown feature. */
    152150};
    153 
    154 /** \ingroup convenience */
    155 const char *caca_get_feature_name(enum caca_feature);
    156151
    157152/*
     
    209204
    210205/** \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 *  @{ */
    212211int caca_init(void);
    213212void caca_set_delay(unsigned int);
    214213enum caca_feature caca_get_feature(enum caca_feature);
    215214void caca_set_feature(enum caca_feature);
     215const char *caca_get_feature_name(enum caca_feature);
    216216unsigned int caca_get_rendertime(void);
    217217unsigned int caca_get_width(void);
     
    219219void caca_refresh(void);
    220220void caca_end(void);
    221 /** \@} */
     221/*  @} */
    222222
    223223/** \defgroup event Event handling functions
    224  *  \@{ */
     224 *
     225 *  These functions handle user events such as keyboard input and mouse
     226 *  clicks.
     227 *
     228 *  @{ */
    225229unsigned int caca_get_event(void);
    226 /** \@} */
     230unsigned int caca_wait_event(void);
     231/*  @} */
    227232
    228233/** \defgroup char Character printing functions
    229  *  \@{ */
     234 *
     235 *  These functions provide low-level character printing routines.
     236 *
     237 *  @{ */
    230238void caca_set_color(enum caca_color, enum caca_color);
    231239enum caca_color caca_get_fg_color(void);
    232240enum caca_color caca_get_bg_color(void);
     241const char *caca_get_color_name(enum caca_color);
    233242void caca_putchar(int, int, char);
    234243void caca_putstr(int, int, const char *);
    235244void caca_printf(int, int, const char *, ...);
    236245void caca_clear(void);
    237 /** \@} */
     246/*  @} */
    238247
    239248/** \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 *  @{ */
    241254void caca_draw_line(int, int, int, int, char);
    242255void caca_draw_polyline(const int x[], const int y[], int, char);
     
    256269void caca_draw_thin_triangle(int, int, int, int, int, int);
    257270void caca_fill_triangle(int, int, int, int, int, int, char);
    258 /** \@} */
     271/*  @} */
    259272
    260273/** \defgroup math Mathematical functions
    261  *  \@{ */
     274 *
     275 *  These functions provide a few useful math-related routines.
     276 *
     277 *  @{ */
    262278int caca_rand(int, int);
    263279unsigned int caca_sqrt(unsigned int);
    264 /** \@} */
     280/*  @} */
    265281
    266282/** \defgroup sprite Sprite handling functions
    267  *  \@{ */
     283 *
     284 *  These functions provide high level routines for sprite loading, animation
     285 *  and rendering.
     286 *
     287 *  @{ */
    268288struct caca_sprite;
    269289struct caca_sprite * caca_load_sprite(const char *);
     
    275295void caca_draw_sprite(int, int, const struct caca_sprite *, int);
    276296void caca_free_sprite(struct caca_sprite *);
    277 /** \@} */
     297/*  @} */
    278298
    279299/** \defgroup bitmap Bitmap handling functions
    280  *  \@{ */
     300 *
     301 *  These functions provide high level routines for bitmap allocation and
     302 *  rendering.
     303 *
     304 *  @{ */
    281305struct caca_bitmap;
    282306struct caca_bitmap *caca_create_bitmap(unsigned int, unsigned int,
     
    289313void caca_draw_bitmap(int, int, int, int, const struct caca_bitmap *, void *);
    290314void caca_free_bitmap(struct caca_bitmap *);
    291 /** \@} */
    292 
    293 /** \defgroup convenience Convenience functions */
     315/*  @} */
    294316
    295317#ifdef __cplusplus
  • libcaca/trunk/src/caca_internals.h

    r265 r268  
    11/*
    2  *   libcaca       ASCII-Art library
    3  *   Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org>
    4  *                 All Rights Reserved
     2 *  libcaca       ASCII-Art library
     3 *  Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org>
     4 *                All Rights Reserved
    55 *
    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.
     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.
    1010 *
    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.
     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.
    1515 *
    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
     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
    2020 */
    2121
    22 /**  \file caca_internals.h
    23  *   \version \$Id$
    24  *   \author Sam Hocevar <sam@zoy.org>
    25  *   \brief The \e libcaca private header.
     22/** \file caca_internals.h
     23 *  \version \$Id$
     24 *  \author Sam Hocevar <sam@zoy.org>
     25 *  \brief The \e libcaca private header.
    2626 *
    27  *   This header contains the private types and functions used by \e libcaca.
     27 *  This header contains the private types and functions used by \e libcaca.
    2828 */
    2929
  • libcaca/trunk/src/conic.c

    r265 r268  
    11/*
    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.
     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.
    2929 */
    3030
  • libcaca/trunk/src/graphics.c

    r265 r268  
    11/*
    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.
     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.
    2828 */
    2929
     
    100100static enum caca_color _caca_bgcolor = CACA_COLOR_BLACK;
    101101
    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.
    108110 */
    109111void caca_set_color(enum caca_color fgcolor, enum caca_color bgcolor)
     
    142144}
    143145
    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.
    148152 */
    149153enum caca_color caca_get_fg_color(void)
     
    152156}
    153157
    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.
    158164 */
    159165enum caca_color caca_get_bg_color(void)
     
    162168}
    163169
    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.
    171179 */
    172180void caca_putchar(int x, int y, char c)
     
    213221}
    214222
    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.
    222233 */
    223234void caca_putstr(int x, int y, const char *s)
     
    291302}
    292303
    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.
    301316 */
    302317void caca_printf(int x, int y, const char *format, ...)
     
    327342}
    328343
    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.
    333347 */
    334348void caca_clear(void)
     
    638652}
    639653
    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.
    645664 */
    646665void caca_set_delay(unsigned int usec)
     
    649668}
    650669
    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.
    655679 */
    656680unsigned int caca_get_rendertime(void)
     
    679703}
    680704
    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.
    685715 */
    686716void caca_refresh(void)
  • libcaca/trunk/src/io.c

    r265 r268  
    11/*
    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.
     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.
    2828 */
    2929
     
    5555static int keys = 0;
    5656
    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.
    5963 *
    6064 * \return The next event in the queue, or 0 if no event is pending.
     
    187191}
    188192
     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 */
     201unsigned 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
    189218static void _push_key(unsigned int key)
    190219{
  • libcaca/trunk/src/line.c

    r265 r268  
    11/*
    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.
     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.
    2929 */
    3030
     
    7979/**
    8080 * \brief Draw a polyline on the screen using the given character and
    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.
     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.
    8484 *
    8585 * \param x Array of X coordinates. Must have \p n + 1 elements.
     
    128128/**
    129129 * \brief Draw a thin polyline on the screen using the given coordinate
    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.
     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.
    133133 *
    134134 * \param x Array of X coordinates. Must have \p n + 1 elements.
     
    240240/**
    241241 * \brief Solid line drawing function, using Bresenham's mid-point line
    242  *        scan-conversion algorithm.
     242 *       scan-conversion algorithm.
    243243 *
    244244 * \param s a line structure
  • libcaca/trunk/src/math.c

    r257 r268  
    11/*
    2  *   libcaca       ASCII-Art library
    3  *   Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org>
    4  *                 All Rights Reserved
     2 *  libcaca       ASCII-Art library
     3 *  Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org>
     4 *                All Rights Reserved
    55 *
    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.
     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.
    1010 *
    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.
     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.
    1515 *
    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
     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
    2020 */
    2121
    22 /**  \file math.c
    23  *   \version \$Id$
    24  *   \author Sam Hocevar <sam@zoy.org>
    25  *   \brief Math functions
     22/** \file math.c
     23 *  \version \$Id$
     24 *  \author Sam Hocevar <sam@zoy.org>
     25 *  \brief Math functions
    2626 *
    27  *   This file contains simple mathematical routines.
     27 *  This file contains simple mathematical routines.
    2828 */
    2929
  • libcaca/trunk/src/sprite.c

    r257 r268  
    11/*
    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.
     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.
    2828 */
    2929
  • libcaca/trunk/src/triangle.c

    r257 r268  
    11/*
    2  *   libcaca       ASCII-Art library
    3  *   Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org>
    4  *                 All Rights Reserved
     2 *  libcaca       ASCII-Art library
     3 *  Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org>
     4 *                All Rights Reserved
    55 *
    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.
     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.
    1010 *
    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.
     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.
    1515 *
    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
     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
    2020 */
    2121
    22 /**  \file triangle.c
    23  *   \version \$Id$
    24  *   \author Sam Hocevar <sam@zoy.org>
    25  *   \brief Triangle drawing functions
     22/** \file triangle.c
     23 *  \version \$Id$
     24 *  \author Sam Hocevar <sam@zoy.org>
     25 *  \brief Triangle drawing functions
    2626 *
    27  *   This file contains triangle drawing functions, both filled and outline.
     27 *  This file contains triangle drawing functions, both filled and outline.
    2828 */
    2929
Note: See TracChangeset for help on using the changeset viewer.