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

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