Browse Source

* 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.
tags/v0.99.beta14
Sam Hocevar sam 21 years ago
parent
commit
20cc8d8d4c
14 changed files with 81 additions and 36 deletions
  1. +5
    -1
      NEWS
  2. +5
    -6
      debian/control
  3. +3
    -0
      debian/rules
  4. +2
    -0
      doc/Makefile.am
  5. +16
    -7
      doc/cacademo.1
  6. +7
    -6
      libcaca.spec
  7. +18
    -7
      src/bitmap.c
  8. +5
    -3
      src/caca.c
  9. +2
    -2
      src/caca.h
  10. +1
    -1
      src/conic.c
  11. +10
    -2
      src/graphics.c
  12. +2
    -0
      src/io.c
  13. +3
    -1
      src/line.c
  14. +2
    -0
      src/sprite.c

+ 5
- 1
NEWS View File

@@ -1,5 +1,10 @@
$Id$ $Id$


Changes between 0.6 and 0.7:
----------------------------

* cacaball, a metaball animation example

Changes between 0.5 and 0.6: 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 * arbitrary color depth and bitmasks in the bitmap renderer
* cacaview, an image viewer based on libcaca * cacaview, an image viewer based on libcaca



New in 0.1 New in 0.1
---------- ----------




+ 5
- 6
debian/control View File

@@ -32,9 +32,8 @@ Description: text mode graphics utilities
ASCII art. The user can zoom and scroll the image, set the dithering method ASCII art. The user can zoom and scroll the image, set the dithering method
or enable anti-aliasing. 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.

+ 3
- 0
debian/rules View File

@@ -42,12 +42,15 @@ install: build


DESTDIR=`pwd`/debian/libcaca-dev/ $(MAKE) install prefix=/usr 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/cacademo debian/caca-utils/usr/bin
mv debian/libcaca-dev/usr/bin/cacaview 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/cacafire debian/caca-utils/usr/bin
mv debian/libcaca-dev/usr/bin/caca-spritedit 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/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 \ mv debian/libcaca-dev/usr/share/man/man1/cacademo.1 \
debian/caca-utils/usr/share/man/man1/ debian/caca-utils/usr/share/man/man1/
mv debian/libcaca-dev/usr/share/man/man1/cacafire.1 \ mv debian/libcaca-dev/usr/share/man/man1/cacafire.1 \


+ 2
- 0
doc/Makefile.am View File

@@ -47,5 +47,7 @@ if DOXYGEN
$(mkinstalldirs) $(DESTDIR)$(mandir)/man1 $(mkinstalldirs) $(DESTDIR)$(mandir)/man1
rm -f $(DESTDIR)$(mandir)/man1/cacafire.1 rm -f $(DESTDIR)$(mandir)/man1/cacafire.1
ln -s cacademo.1 $(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 endif



+ 16
- 7
doc/cacademo.1 View File

@@ -1,13 +1,16 @@
.TH libcaca 1 "2003-11-22" "libcaca"
.TH libcaca 1 "2004-1-6" "libcaca"
.SH NAME .SH NAME
cacademo, cacafire \- libcaca's demonstration applications
cacademo, cacafire, cacaball \- libcaca's demonstration applications
.SH SYNOPSIS .SH SYNOPSIS
cacademo cacademo
.PP .PP
cacafire cacafire
.PP
cacaball
.RI .RI
.SH DESCRIPTION .SH DESCRIPTION
This manual page documents briefly the cacademo and cacafire programs.
This manual page documents briefly the cacademo, cacafire and cacaball
programs.
.PP .PP
.B cacademo .B cacademo
is a simple demo which demonstrates some features of the libcaca is a simple demo which demonstrates some features of the libcaca
@@ -16,18 +19,24 @@ exit a particular demo, press any key.
.PP .PP
.B cacafire .B cacafire
displays burning ASCII art flames. displays burning ASCII art flames.
.PP
.B cacaball
displays ASCII art metaballs.
.SH BUGS .SH BUGS
Please report any bugs you find to <libcaca@lists.zoy.org>. Please report any bugs you find to <libcaca@lists.zoy.org>.
.SH LICENSE .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 .SH AUTHORS
.B cacademo
and this manual page were written by Sam Hocevar <sam@zoy.org>.
.PP
.B cacafire .B cacafire
is a port of AAlib's is a port of AAlib's
.B aafire .B aafire
written by Jan Hubicka <hubicka@freesoft.cz>. written by Jan Hubicka <hubicka@freesoft.cz>.
.PP .PP
.B cacademo
and this manual page were written by Sam Hocevar <sam@zoy.org>
.B cacaball
was written by Jean-Yves Lamoureux <jylam@lnxscene.org>.
.SH SEE ALSO .SH SEE ALSO
cacaview(1), aafire(1) cacaview(1), aafire(1)

+ 7
- 6
libcaca.spec View File

@@ -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 ASCII art. The user can zoom and scroll the image, set the dithering method
or enable anti-aliasing. 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 %prep
case "${RPM_COMMAND:-all}" in case "${RPM_COMMAND:-all}" in
@@ -93,12 +92,14 @@ rm -rf %{buildroot}


%files -n caca-utils %files -n caca-utils
%defattr(-,root,root) %defattr(-,root,root)
%{_prefix}/bin/cacaball
%{_prefix}/bin/cacademo %{_prefix}/bin/cacademo
%{_prefix}/bin/cacafire %{_prefix}/bin/cacafire
%{_prefix}/bin/cacaview %{_prefix}/bin/cacaview
%{_prefix}/bin/caca-spritedit %{_prefix}/bin/caca-spritedit
%{_prefix}/share/doc/caca-utils-%{version}/* %{_prefix}/share/doc/caca-utils-%{version}/*
%{_prefix}/share/libcaca/* %{_prefix}/share/libcaca/*
%{_prefix}/share/man/man1/cacaball.1*
%{_prefix}/share/man/man1/cacademo.1* %{_prefix}/share/man/man1/cacademo.1*
%{_prefix}/share/man/man1/cacafire.1* %{_prefix}/share/man/man1/cacafire.1*
%{_prefix}/share/man/man1/cacaview.1* %{_prefix}/share/man/man1/cacaview.1*


+ 18
- 7
src/bitmap.c View File

@@ -29,7 +29,7 @@


#include "config.h" #include "config.h"


#if defined(HAVE_INTTYPES_H)
#if defined(HAVE_INTTYPES_H) || defined(_DOXYGEN_SKIP_ME)
# include <inttypes.h> # include <inttypes.h>
#else #else
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
@@ -49,16 +49,20 @@ typedef unsigned int uint32_t;
/* /*
* Global variables * Global variables
*/ */
#if !defined(_DOXYGEN_SKIP_ME)
enum caca_feature _caca_background; enum caca_feature _caca_background;
enum caca_feature _caca_dithering; enum caca_feature _caca_dithering;
enum caca_feature _caca_antialiasing; enum caca_feature _caca_antialiasing;
#endif


/* /*
* Local variables * 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 unsigned char hsv_distances[LOOKUP_VAL][LOOKUP_SAT][LOOKUP_HUE];
static enum caca_color lookup_colors[8]; static enum caca_color lookup_colors[8];


@@ -75,6 +79,7 @@ static int const hsv_palette[] =
2, 0x0, 0xfff, 0xfff /* light red */ 2, 0x0, 0xfff, 0xfff /* light red */
}; };


#if !defined(_DOXYGEN_SKIP_ME)
#define HSV_XRATIO 6 #define HSV_XRATIO 6
#define HSV_YRATIO 3 #define HSV_YRATIO 3
#define HSV_HRATIO 3 #define HSV_HRATIO 3
@@ -91,6 +96,7 @@ static int const hsv_palette[] =
? (HSV_HRATIO * ((h) - hsv_palette[index * 4 + 1]) \ ? (HSV_HRATIO * ((h) - hsv_palette[index * 4 + 1]) \
* ((h) - hsv_palette[index * 4 + 1])) \ * ((h) - hsv_palette[index * 4 + 1])) \
: 0))) : 0)))
#endif


/* /*
* Local prototypes * Local prototypes
@@ -123,6 +129,7 @@ static void init_random_dither(int);
static unsigned int get_random_dither(void); static unsigned int get_random_dither(void);
static void increment_random_dither(void); static void increment_random_dither(void);


#if !defined(_DOXYGEN_SKIP_ME)
struct caca_bitmap struct caca_bitmap
{ {
int bpp, has_palette, has_alpha; int bpp, has_palette, has_alpha;
@@ -133,6 +140,7 @@ struct caca_bitmap
void (*get_hsv)(struct caca_bitmap *, char *, int, int); void (*get_hsv)(struct caca_bitmap *, char *, int, int);
int red[256], green[256], blue[256], alpha[256]; int red[256], green[256], blue[256], alpha[256];
}; };
#endif


static void mask2shift(unsigned int mask, int *right, int *left) 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. * \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 red An array of 256 red values.
* \param green An array of 256 green values. * \param green An array of 256 green values.
* \param blue An array of 256 blue values. * \param blue An array of 256 blue values.
* \param alpha An array of 256 alpha values. * \param alpha An array of 256 alpha values.
* \return void
*/ */
void caca_set_bitmap_palette(struct caca_bitmap *bitmap, void caca_set_bitmap_palette(struct caca_bitmap *bitmap,
unsigned int red[], unsigned int green[], 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! */ /* 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[] = 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) int _caca_init_bitmap(void)
{ {
unsigned int v, s, h; unsigned int v, s, h;
@@ -667,6 +677,7 @@ int _caca_end_bitmap(void)
{ {
return 0; return 0;
} }
#endif /* _DOXYGEN_SKIP_ME */


/* /*
* XXX: The following functions are local. * XXX: The following functions are local.


+ 5
- 3
src/caca.c View File

@@ -59,7 +59,9 @@ static void caca_init_driver(void);
static void caca_init_features(void); static void caca_init_features(void);
static void caca_init_terminal(void); static void caca_init_terminal(void);


#if !defined(_DOXYGEN_SKIP_ME)
enum caca_driver _caca_driver; enum caca_driver _caca_driver;
#endif


#if defined(USE_NCURSES) #if defined(USE_NCURSES)
static mmask_t oldmask; 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. * generic feature value is expected, such as CACA_ANTIALIASING.
* *
* \param feature The requested feature. * \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.. * error occurred..
*/ */
enum caca_feature caca_get_feature(enum caca_feature feature) 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; return _caca_dithering;


default: default:
return CACA_UNKNOWN_FEATURE;
return CACA_FEATURE_UNKNOWN;
} }
} }


@@ -285,7 +287,7 @@ void caca_set_feature(enum caca_feature feature)
_caca_dithering = feature; _caca_dithering = feature;
break; break;


case CACA_UNKNOWN_FEATURE:
case CACA_FEATURE_UNKNOWN:
break; break;
} }
} }


+ 2
- 2
src/caca.h View File

@@ -154,13 +154,13 @@ enum caca_feature
#define CACA_DITHERING_MIN 0x31 /**< First dithering feature. */ #define CACA_DITHERING_MIN 0x31 /**< First dithering feature. */
#define CACA_DITHERING_MAX 0x35 /**< Last 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 * Backwards compatibility macros
*/ */
#ifndef _DOXYGEN_SKIP_ME
#if !defined(_DOXYGEN_SKIP_ME)
#define caca_dithering caca_feature #define caca_dithering caca_feature
#define caca_set_dithering caca_set_feature #define caca_set_dithering caca_set_feature
#define caca_get_dithering_name caca_get_feature_name #define caca_get_dithering_name caca_get_feature_name


+ 1
- 1
src/conic.c View File

@@ -30,7 +30,7 @@


#include "config.h" #include "config.h"


#if defined(HAVE_INTTYPES_H)
#if defined(HAVE_INTTYPES_H) || defined(_DOXYGEN_SKIP_ME)
# include <inttypes.h> # include <inttypes.h>
#else #else
typedef unsigned char uint8_t; typedef unsigned char uint8_t;


+ 10
- 2
src/graphics.c View File

@@ -49,8 +49,10 @@
# include <X11/Xlib.h> # include <X11/Xlib.h>
#endif #endif


#if defined(HAVE_INTTYPES_H)
#if defined(HAVE_INTTYPES_H) || defined(_DOXYGEN_SKIP_ME)
# include <inttypes.h> # include <inttypes.h>
#else
typedef unsigned char uint8_t;
#endif #endif


#include <stdio.h> /* BUFSIZ */ #include <stdio.h> /* BUFSIZ */
@@ -67,8 +69,10 @@
/* /*
* Global variables * Global variables
*/ */
#if !defined(_DOXYGEN_SKIP_ME)
unsigned int _caca_width = 0; unsigned int _caca_width = 0;
unsigned int _caca_height = 0; unsigned int _caca_height = 0;
#endif


/* /*
* Local variables * Local variables
@@ -141,7 +145,7 @@ static struct text_info conio_ti;
static char *conio_screen; static char *conio_screen;
#endif #endif


#if defined(USE_X11)
#if defined(USE_X11) && !defined(_DOXYGEN_SKIP_ME)
Display *x11_dpy; Display *x11_dpy;
Window x11_window; Window x11_window;
int x11_font_width, x11_font_height; int x11_font_width, x11_font_height;
@@ -478,6 +482,7 @@ void caca_clear(void)
caca_set_color(oldfg, oldbg); caca_set_color(oldfg, oldbg);
} }


#if !defined(_DOXYGEN_SKIP_ME)
int _caca_init_graphics(void) int _caca_init_graphics(void)
{ {
#if defined(USE_SLANG) #if defined(USE_SLANG)
@@ -776,6 +781,7 @@ int _caca_end_graphics(void)


return 0; return 0;
} }
#endif /* _DOXYGEN_SKIP_ME */


/** \brief Set the refresh delay. /** \brief Set the refresh delay.
* *
@@ -850,7 +856,9 @@ static unsigned int _caca_getticks(void)
*/ */
void caca_refresh(void) void caca_refresh(void)
{ {
#if !defined(_DOXYGEN_SKIP_ME)
#define IDLE_USEC 10000 #define IDLE_USEC 10000
#endif
static int lastticks = 0; static int lastticks = 0;
int ticks = lastticks + _caca_getticks(); int ticks = lastticks + _caca_getticks();




+ 2
- 0
src/io.c View File

@@ -58,7 +58,9 @@ static void _push_key(unsigned int);
static unsigned int _pop_key(void); static unsigned int _pop_key(void);
static unsigned int _read_key(void); static unsigned int _read_key(void);


#if !defined(_DOXYGEN_SKIP_ME)
#define KEY_BUFLEN 10 #define KEY_BUFLEN 10
#endif
static unsigned int keybuf[KEY_BUFLEN + 1]; /* zero-terminated */ static unsigned int keybuf[KEY_BUFLEN + 1]; /* zero-terminated */
static int keys = 0; static int keys = 0;




+ 3
- 1
src/line.c View File

@@ -30,7 +30,7 @@


#include "config.h" #include "config.h"


#if defined(HAVE_INTTYPES_H)
#if defined(HAVE_INTTYPES_H) || defined(_DOXYGEN_SKIP_ME)
# include <inttypes.h> # include <inttypes.h>
#else #else
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
@@ -41,6 +41,7 @@ typedef unsigned char uint8_t;
#include "caca.h" #include "caca.h"
#include "caca_internals.h" #include "caca_internals.h"


#if !defined(_DOXYGEN_SKIP_ME)
struct line struct line
{ {
int x1, y1; int x1, y1;
@@ -48,6 +49,7 @@ struct line
char c; char c;
void (*draw) (struct line*); void (*draw) (struct line*);
}; };
#endif


static void clip_line(struct line*); static void clip_line(struct line*);
static uint8_t clip_bits(int, int); static uint8_t clip_bits(int, int);


+ 2
- 0
src/sprite.c View File

@@ -36,6 +36,7 @@
#include "caca.h" #include "caca.h"
#include "caca_internals.h" #include "caca_internals.h"


#if !defined(_DOXYGEN_SKIP_ME)
struct caca_frame struct caca_frame
{ {
int w, h; int w, h;
@@ -49,6 +50,7 @@ struct caca_sprite
int nf; int nf;
struct caca_frame *frames; struct caca_frame *frames;
}; };
#endif


/** /**
* \brief Allocate a sprite loaded from a file. * \brief Allocate a sprite loaded from a file.


Loading…
Cancel
Save