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

Last change on this file since 2109 was 2109, checked in by Sam Hocevar, 13 years ago
  • Import io.c from TOIlet directly into libcucul. Can you see where this is going?
  • 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 2109 2007-12-01 17:57:50Z 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    /* Canvas management */
47    unsigned int refcount;
48    unsigned int autoinc;
49    int (*resize_callback)(void *);
50    void *resize_data;
51
52    /* Shortcut to the active frame information */
53    unsigned int width, height;
54    uint32_t *chars;
55    uint32_t *attrs;
56    uint32_t curattr;
57};
58
59struct cucul_buffer
60{
61    unsigned long int size;
62    char *data;
63    int user_data;
64};
65
66/* Colour functions */
67extern uint32_t _cucul_attr_to_rgb24fg(uint32_t);
68extern uint32_t _cucul_attr_to_rgb24bg(uint32_t);
69
70/* Frames functions */
71extern void _cucul_save_frame_info(cucul_canvas_t *);
72extern void _cucul_load_frame_info(cucul_canvas_t *);
73
74/* File functions */
75extern cucul_file_t *_cucul_file_open(const char *, const char *);
76extern int _cucul_file_close(cucul_file_t *);
77extern int _cucul_file_eof(cucul_file_t *);
78extern char *_cucul_file_gets(char *, int, cucul_file_t *);
79
80#endif /* __CUCUL_INTERNALS_H__ */
Note: See TracBrowser for help on using the repository browser.