source: libcaca/trunk/cucul/cucul_internals.h @ 734

Last change on this file since 734 was 734, checked in by Sam Hocevar, 15 years ago
  • Renamed *bitmap to *dither. Ben ouais connard, je fais ce que je veux.
  • Property svn:keywords set to Id
File size: 2.4 KB
Line 
1/*
2 *  libcucul      Canvas for ultrafast compositing of Unicode letters
3 *  Copyright (c) 2002-2006 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 Do What The Fuck You Want To
8 *  Public License, Version 2, as published by Sam Hocevar. See
9 *  http://sam.zoy.org/wtfpl/COPYING for more details.
10 */
11
12/** \file cucul_internals.h
13 *  \version \$Id: cucul_internals.h 734 2006-04-10 20:02:38Z sam $
14 *  \author Sam Hocevar <sam@zoy.org>
15 *  \brief The \e libcucul private header.
16 *
17 *  This header contains the private types and functions used by \e libcucul.
18 */
19
20#ifndef __CUCUL_INTERNALS_H__
21#define __CUCUL_INTERNALS_H__
22
23#if defined(HAVE_INTTYPES_H) && !defined(__KERNEL__)
24#   include <inttypes.h>
25#elif !defined(CUSTOM_INTTYPES) && !defined(_DOXYGEN_SKIP_ME)
26#   define CUSTOM_INTTYPES
27typedef unsigned char uint8_t;
28typedef unsigned short uint16_t;
29typedef unsigned long int uint32_t;
30typedef long int intptr_t;
31typedef long unsigned int uintptr_t;
32#endif
33
34struct cucul_context
35{
36    /* Context size */
37    unsigned int width, height;
38
39    uint32_t *chars;
40    uint32_t *attr;
41    char *empty_line, *scratch_line;
42
43    uint16_t fgcolor;
44    uint16_t bgcolor;
45
46    unsigned int refcount;
47};
48
49/* Bitmap functions */
50extern int _cucul_init_dither(void);
51extern int _cucul_end_dither(void);
52
53/* Canvas functions */
54extern void _cucul_set_size(cucul_t *, unsigned int, unsigned int);
55extern void _cucul_putchar32(cucul_t *qq, int x, int y, uint32_t c);
56
57/* Charset functions */
58extern unsigned int _cucul_strlen_utf8(char const *);
59extern char const *_cucul_skip_utf8(char const *, unsigned int);
60extern uint32_t _cucul_utf8_to_utf32(char const *);
61extern uint8_t _cucul_utf32_to_cp437(uint32_t);
62extern uint32_t _cucul_cp437_to_utf32(uint8_t);
63
64/* Colour functions */
65uint8_t _cucul_argb32_to_ansi8(uint32_t);
66uint8_t _cucul_argb32_to_ansi4fg(uint32_t);
67uint8_t _cucul_argb32_to_ansi4bg(uint32_t);
68
69/* Export functions */
70extern void _cucul_get_ansi(cucul_t *, struct cucul_export *);
71extern void _cucul_get_html(cucul_t *, struct cucul_export *);
72extern void _cucul_get_html3(cucul_t *, struct cucul_export *);
73extern void _cucul_get_irc(cucul_t *, struct cucul_export *);
74extern void _cucul_get_ps(cucul_t *, struct cucul_export *);
75extern void _cucul_get_svg(cucul_t *, struct cucul_export *);
76
77#endif /* __CUCUL_INTERNALS_H__ */
Note: See TracBrowser for help on using the repository browser.