From 20cc8d8d4cae7daff71f0bb619c46bdd7cc03059 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Wed, 7 Jan 2004 12:45:02 +0000 Subject: [PATCH] * libcaca.spec debian/control: + Updated the package descriptions to include cacaball. * doc/cacademo.1 doc/Makefile.am: + Use the cacademo manpage as the cacaball manpage. * src/: + Added #ifdef _DOXYGEN_SKIP_ME here and there to prvent Doxygen from documenting bizarre stuff. --- NEWS | 6 +++++- debian/control | 11 +++++------ debian/rules | 3 +++ doc/Makefile.am | 2 ++ doc/cacademo.1 | 23 ++++++++++++++++------- libcaca.spec | 13 +++++++------ src/bitmap.c | 25 ++++++++++++++++++------- src/caca.c | 8 +++++--- src/caca.h | 4 ++-- src/conic.c | 2 +- src/graphics.c | 12 ++++++++++-- src/io.c | 2 ++ src/line.c | 4 +++- src/sprite.c | 2 ++ 14 files changed, 81 insertions(+), 36 deletions(-) diff --git a/NEWS b/NEWS index 9c86316..bbcccfd 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,10 @@ $Id$ +Changes between 0.6 and 0.7: +---------------------------- + + * cacaball, a metaball animation example + Changes between 0.5 and 0.6: ---------------------------- @@ -44,7 +49,6 @@ Changes between 0.1 and 0.2: * arbitrary color depth and bitmasks in the bitmap renderer * cacaview, an image viewer based on libcaca - New in 0.1 ---------- diff --git a/debian/control b/debian/control index 55554f1..ae3396c 100644 --- a/debian/control +++ b/debian/control @@ -32,9 +32,8 @@ Description: text mode graphics utilities ASCII art. The user can zoom and scroll the image, set the dithering method or enable anti-aliasing. . - cacafire is a port of AALib's aafire and displays burning ASCII art flames. - . - cacademo is a simple application that shows the libcaca rendering features - such as line and ellipses drawing, triangle filling, and sprite blitting. - . - caca-spritedit is a simple sprite viewer for libcaca. + cacaball is a tiny graphic program that renders animated ASCII metaballs on + the screen, cacafire is a port of AALib's aafire and displays burning ASCII + art flames, cacademo is a simple application that shows the libcaca rendering + features such as line and ellipses drawing, triangle filling and sprite + blitting, and caca-spritedit is a simple sprite viewer for libcaca. diff --git a/debian/rules b/debian/rules index c8f8a65..058eb71 100755 --- a/debian/rules +++ b/debian/rules @@ -42,12 +42,15 @@ install: build DESTDIR=`pwd`/debian/libcaca-dev/ $(MAKE) install prefix=/usr + mv debian/libcaca-dev/usr/bin/cacaball debian/caca-utils/usr/bin mv debian/libcaca-dev/usr/bin/cacademo debian/caca-utils/usr/bin mv debian/libcaca-dev/usr/bin/cacaview debian/caca-utils/usr/bin mv debian/libcaca-dev/usr/bin/cacafire debian/caca-utils/usr/bin mv debian/libcaca-dev/usr/bin/caca-spritedit debian/caca-utils/usr/bin mv debian/libcaca-dev/usr/share/libcaca debian/caca-utils/usr/share + mv debian/libcaca-dev/usr/share/man/man1/cacaball.1 \ + debian/caca-utils/usr/share/man/man1/ mv debian/libcaca-dev/usr/share/man/man1/cacademo.1 \ debian/caca-utils/usr/share/man/man1/ mv debian/libcaca-dev/usr/share/man/man1/cacafire.1 \ diff --git a/doc/Makefile.am b/doc/Makefile.am index 97622a0..b93bb5b 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -47,5 +47,7 @@ if DOXYGEN $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 rm -f $(DESTDIR)$(mandir)/man1/cacafire.1 ln -s cacademo.1 $(DESTDIR)$(mandir)/man1/cacafire.1 + rm -f $(DESTDIR)$(mandir)/man1/cacaball.1 + ln -s cacademo.1 $(DESTDIR)$(mandir)/man1/cacaball.1 endif diff --git a/doc/cacademo.1 b/doc/cacademo.1 index dd606d1..d37fd53 100644 --- a/doc/cacademo.1 +++ b/doc/cacademo.1 @@ -1,13 +1,16 @@ -.TH libcaca 1 "2003-11-22" "libcaca" +.TH libcaca 1 "2004-1-6" "libcaca" .SH NAME -cacademo, cacafire \- libcaca's demonstration applications +cacademo, cacafire, cacaball \- libcaca's demonstration applications .SH SYNOPSIS cacademo .PP cacafire +.PP +cacaball .RI .SH DESCRIPTION -This manual page documents briefly the cacademo and cacafire programs. +This manual page documents briefly the cacademo, cacafire and cacaball +programs. .PP .B cacademo is a simple demo which demonstrates some features of the libcaca @@ -16,18 +19,24 @@ exit a particular demo, press any key. .PP .B cacafire displays burning ASCII art flames. +.PP +.B cacaball +displays ASCII art metaballs. .SH BUGS Please report any bugs you find to . .SH LICENSE -cacademo and cacafire are all covered by the GNU Lesser General Public -License (LGPL). +cacademo, cacafire and cacaball are covered by the GNU Lesser General +Public License (LGPL). .SH AUTHORS +.B cacademo +and this manual page were written by Sam Hocevar . +.PP .B cacafire is a port of AAlib's .B aafire written by Jan Hubicka . .PP -.B cacademo -and this manual page were written by Sam Hocevar +.B cacaball +was written by Jean-Yves Lamoureux . .SH SEE ALSO cacaview(1), aafire(1) diff --git a/libcaca.spec b/libcaca.spec index 9d6a855..bf87067 100644 --- a/libcaca.spec +++ b/libcaca.spec @@ -47,12 +47,11 @@ formats such as JPEG, PNG, GIF etc. and renders them on the terminal using ASCII art. The user can zoom and scroll the image, set the dithering method or enable anti-aliasing. -cacafire is a port of AALib's aafire and displays burning ASCII art flames. - -cacademo is a simple application that shows the libcaca rendering features -such as line and ellipses drawing, triangle filling, and sprite blitting. - -caca-spritedit is a simple sprite viewer for libcaca. +cacaball is a tiny graphic program that renders animated ASCII metaballs on +the screen, cacafire is a port of AALib's aafire and displays burning ASCII +art flames, cacademo is a simple application that shows the libcaca rendering +features such as line and ellipses drawing, triangle filling and sprite +blitting, and caca-spritedit is a simple sprite viewer for libcaca. %prep case "${RPM_COMMAND:-all}" in @@ -93,12 +92,14 @@ rm -rf %{buildroot} %files -n caca-utils %defattr(-,root,root) +%{_prefix}/bin/cacaball %{_prefix}/bin/cacademo %{_prefix}/bin/cacafire %{_prefix}/bin/cacaview %{_prefix}/bin/caca-spritedit %{_prefix}/share/doc/caca-utils-%{version}/* %{_prefix}/share/libcaca/* +%{_prefix}/share/man/man1/cacaball.1* %{_prefix}/share/man/man1/cacademo.1* %{_prefix}/share/man/man1/cacafire.1* %{_prefix}/share/man/man1/cacaview.1* diff --git a/src/bitmap.c b/src/bitmap.c index 2ab4bcd..f537177 100644 --- a/src/bitmap.c +++ b/src/bitmap.c @@ -29,7 +29,7 @@ #include "config.h" -#if defined(HAVE_INTTYPES_H) +#if defined(HAVE_INTTYPES_H) || defined(_DOXYGEN_SKIP_ME) # include #else typedef unsigned char uint8_t; @@ -49,16 +49,20 @@ typedef unsigned int uint32_t; /* * Global variables */ +#if !defined(_DOXYGEN_SKIP_ME) enum caca_feature _caca_background; enum caca_feature _caca_dithering; enum caca_feature _caca_antialiasing; +#endif /* * Local variables */ -#define LOOKUP_VAL 32 -#define LOOKUP_SAT 32 -#define LOOKUP_HUE 16 +#if !defined(_DOXYGEN_SKIP_ME) +# define LOOKUP_VAL 32 +# define LOOKUP_SAT 32 +# define LOOKUP_HUE 16 +#endif static unsigned char hsv_distances[LOOKUP_VAL][LOOKUP_SAT][LOOKUP_HUE]; static enum caca_color lookup_colors[8]; @@ -75,6 +79,7 @@ static int const hsv_palette[] = 2, 0x0, 0xfff, 0xfff /* light red */ }; +#if !defined(_DOXYGEN_SKIP_ME) #define HSV_XRATIO 6 #define HSV_YRATIO 3 #define HSV_HRATIO 3 @@ -91,6 +96,7 @@ static int const hsv_palette[] = ? (HSV_HRATIO * ((h) - hsv_palette[index * 4 + 1]) \ * ((h) - hsv_palette[index * 4 + 1])) \ : 0))) +#endif /* * Local prototypes @@ -123,6 +129,7 @@ static void init_random_dither(int); static unsigned int get_random_dither(void); static void increment_random_dither(void); +#if !defined(_DOXYGEN_SKIP_ME) struct caca_bitmap { int bpp, has_palette, has_alpha; @@ -133,6 +140,7 @@ struct caca_bitmap void (*get_hsv)(struct caca_bitmap *, char *, int, int); int red[256], green[256], blue[256], alpha[256]; }; +#endif static void mask2shift(unsigned int mask, int *right, int *left) { @@ -229,12 +237,11 @@ struct caca_bitmap *caca_create_bitmap(unsigned int bpp, unsigned int w, /** * \brief Set the palette of an 8bpp bitmap object. * - * \param bpp The bitmap object. + * \param bitmap The bitmap object. * \param red An array of 256 red values. * \param green An array of 256 green values. * \param blue An array of 256 blue values. * \param alpha An array of 256 alpha values. - * \return void */ void caca_set_bitmap_palette(struct caca_bitmap *bitmap, unsigned int red[], unsigned int green[], @@ -418,7 +425,9 @@ void caca_draw_bitmap(int x1, int y1, int x2, int y2, }; /* FIXME: choose better characters! */ -# define DENSITY_CHARS 13 +#if !defined(_DOXYGEN_SKIP_ME) +# define DENSITY_CHARS ((sizeof(density_chars)/sizeof(char const))-1) +#endif static char const density_chars[] = " " ". " @@ -605,6 +614,7 @@ void caca_draw_bitmap(int x1, int y1, int x2, int y2, } } +#if !defined(_DOXYGEN_SKIP_ME) int _caca_init_bitmap(void) { unsigned int v, s, h; @@ -667,6 +677,7 @@ int _caca_end_bitmap(void) { return 0; } +#endif /* _DOXYGEN_SKIP_ME */ /* * XXX: The following functions are local. diff --git a/src/caca.c b/src/caca.c index 77ea9be..f923cb4 100644 --- a/src/caca.c +++ b/src/caca.c @@ -59,7 +59,9 @@ static void caca_init_driver(void); static void caca_init_features(void); static void caca_init_terminal(void); +#if !defined(_DOXYGEN_SKIP_ME) enum caca_driver _caca_driver; +#endif #if defined(USE_NCURSES) static mmask_t oldmask; @@ -229,7 +231,7 @@ char const *caca_get_color_name(enum caca_color color) * generic feature value is expected, such as CACA_ANTIALIASING. * * \param feature The requested feature. - * \return The current value of the feature or CACA_UNKNOWN_FEATURE if an + * \return The current value of the feature or CACA_FEATURE_UNKNOWN if an * error occurred.. */ enum caca_feature caca_get_feature(enum caca_feature feature) @@ -244,7 +246,7 @@ enum caca_feature caca_get_feature(enum caca_feature feature) return _caca_dithering; default: - return CACA_UNKNOWN_FEATURE; + return CACA_FEATURE_UNKNOWN; } } @@ -285,7 +287,7 @@ void caca_set_feature(enum caca_feature feature) _caca_dithering = feature; break; - case CACA_UNKNOWN_FEATURE: + case CACA_FEATURE_UNKNOWN: break; } } diff --git a/src/caca.h b/src/caca.h index fd2f413..d1cb0e3 100644 --- a/src/caca.h +++ b/src/caca.h @@ -154,13 +154,13 @@ enum caca_feature #define CACA_DITHERING_MIN 0x31 /**< First dithering feature. */ #define CACA_DITHERING_MAX 0x35 /**< Last dithering feature. */ - CACA_UNKNOWN_FEATURE = 0xffff /**< Unknown feature. */ + CACA_FEATURE_UNKNOWN = 0xffff /**< Unknown feature. */ }; /* * Backwards compatibility macros */ -#ifndef _DOXYGEN_SKIP_ME +#if !defined(_DOXYGEN_SKIP_ME) #define caca_dithering caca_feature #define caca_set_dithering caca_set_feature #define caca_get_dithering_name caca_get_feature_name diff --git a/src/conic.c b/src/conic.c index 7e2394c..337c15e 100644 --- a/src/conic.c +++ b/src/conic.c @@ -30,7 +30,7 @@ #include "config.h" -#if defined(HAVE_INTTYPES_H) +#if defined(HAVE_INTTYPES_H) || defined(_DOXYGEN_SKIP_ME) # include #else typedef unsigned char uint8_t; diff --git a/src/graphics.c b/src/graphics.c index 3b8c99f..fbfa24c 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -49,8 +49,10 @@ # include #endif -#if defined(HAVE_INTTYPES_H) +#if defined(HAVE_INTTYPES_H) || defined(_DOXYGEN_SKIP_ME) # include +#else +typedef unsigned char uint8_t; #endif #include /* BUFSIZ */ @@ -67,8 +69,10 @@ /* * Global variables */ +#if !defined(_DOXYGEN_SKIP_ME) unsigned int _caca_width = 0; unsigned int _caca_height = 0; +#endif /* * Local variables @@ -141,7 +145,7 @@ static struct text_info conio_ti; static char *conio_screen; #endif -#if defined(USE_X11) +#if defined(USE_X11) && !defined(_DOXYGEN_SKIP_ME) Display *x11_dpy; Window x11_window; int x11_font_width, x11_font_height; @@ -478,6 +482,7 @@ void caca_clear(void) caca_set_color(oldfg, oldbg); } +#if !defined(_DOXYGEN_SKIP_ME) int _caca_init_graphics(void) { #if defined(USE_SLANG) @@ -776,6 +781,7 @@ int _caca_end_graphics(void) return 0; } +#endif /* _DOXYGEN_SKIP_ME */ /** \brief Set the refresh delay. * @@ -850,7 +856,9 @@ static unsigned int _caca_getticks(void) */ void caca_refresh(void) { +#if !defined(_DOXYGEN_SKIP_ME) #define IDLE_USEC 10000 +#endif static int lastticks = 0; int ticks = lastticks + _caca_getticks(); diff --git a/src/io.c b/src/io.c index 6fbfefd..2775c3e 100644 --- a/src/io.c +++ b/src/io.c @@ -58,7 +58,9 @@ static void _push_key(unsigned int); static unsigned int _pop_key(void); static unsigned int _read_key(void); +#if !defined(_DOXYGEN_SKIP_ME) #define KEY_BUFLEN 10 +#endif static unsigned int keybuf[KEY_BUFLEN + 1]; /* zero-terminated */ static int keys = 0; diff --git a/src/line.c b/src/line.c index b94deee..2c44fda 100644 --- a/src/line.c +++ b/src/line.c @@ -30,7 +30,7 @@ #include "config.h" -#if defined(HAVE_INTTYPES_H) +#if defined(HAVE_INTTYPES_H) || defined(_DOXYGEN_SKIP_ME) # include #else typedef unsigned char uint8_t; @@ -41,6 +41,7 @@ typedef unsigned char uint8_t; #include "caca.h" #include "caca_internals.h" +#if !defined(_DOXYGEN_SKIP_ME) struct line { int x1, y1; @@ -48,6 +49,7 @@ struct line char c; void (*draw) (struct line*); }; +#endif static void clip_line(struct line*); static uint8_t clip_bits(int, int); diff --git a/src/sprite.c b/src/sprite.c index 9333a0e..7e8c702 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -36,6 +36,7 @@ #include "caca.h" #include "caca_internals.h" +#if !defined(_DOXYGEN_SKIP_ME) struct caca_frame { int w, h; @@ -49,6 +50,7 @@ struct caca_sprite int nf; struct caca_frame *frames; }; +#endif /** * \brief Allocate a sprite loaded from a file.