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

Last change on this file since 1462 was 1462, checked in by Sam Hocevar, 13 years ago
  • Bwarf, typo in the no warranty clause.
  • Property svn:keywords set to Id
File size: 1.9 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 *  $Id: cucul_internals.h 1462 2006-12-12 01:53:54Z sam $
7 *
8 *  This library is free software. It comes without any warranty, to
9 *  the extent permitted by applicable law. You can redistribute it
10 *  and/or modify it under the terms of the Do What The Fuck You Want
11 *  To Public License, Version 2, as published by Sam Hocevar. See
12 *  http://sam.zoy.org/wtfpl/COPYING for more details.
13 */
14
15#ifndef __CUCUL_INTERNALS_H__
16#define __CUCUL_INTERNALS_H__
17
18#if defined(HAVE_INTTYPES_H) && !defined(__KERNEL__)
19#   include <inttypes.h>
20#endif
21
22struct cucul_frame
23{
24    /* Frame size */
25    unsigned int width, height;
26
27    /* Cell information */
28    uint32_t *chars;
29    uint32_t *attrs;
30
31    /* Painting context */
32    int x, y;
33    int handlex, handley;
34    uint32_t curattr;
35
36    /* Frame name */
37    char *name;
38};
39
40struct cucul_canvas
41{
42    /* Frame information */
43    unsigned int frame, framecount;
44    struct cucul_frame *frames;
45
46    unsigned int refcount;
47    unsigned int autoinc;
48
49    /* Shortcut to the active frame information */
50    unsigned int width, height;
51    uint32_t *chars;
52    uint32_t *attrs;
53    uint32_t curattr;
54};
55
56struct cucul_buffer
57{
58    unsigned long int size;
59    char *data;
60    int user_data;
61};
62
63/* Canvas functions */
64extern int _cucul_set_canvas_size(cucul_canvas_t *, unsigned int, unsigned int);
65
66/* Colour functions */
67extern uint16_t _cucul_attr_to_rgb12fg(uint32_t);
68extern uint16_t _cucul_attr_to_rgb12bg(uint32_t);
69extern uint32_t _cucul_attr_to_rgb24fg(uint32_t);
70extern uint32_t _cucul_attr_to_rgb24bg(uint32_t);
71extern void _cucul_attr_to_argb4(uint32_t, uint8_t[8]);
72
73/* Frames functions */
74extern void _cucul_save_frame_info(cucul_canvas_t *);
75extern void _cucul_load_frame_info(cucul_canvas_t *);
76
77#endif /* __CUCUL_INTERNALS_H__ */
Note: See TracBrowser for help on using the repository browser.