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

Last change on this file since 2305 was 2305, checked in by Sam Hocevar, 15 years ago
  • Remove all unsigned ints from exported functions. Signed arithmetic is far better for error checking.
  • Property svn:keywords set to Id
File size: 2.0 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 2305 2008-04-19 19:25:52Z 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#include "stubs.h"
19
20typedef struct cucul_figfont cucul_figfont_t;
21
22struct cucul_frame
23{
24    /* Frame size */
25    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    /* XXX: look at cucul_set_canvas_boundaries() before adding anything
43     * to this structure. The function is quite hacky. */
44
45    /* Frame information */
46    int frame, framecount;
47    struct cucul_frame *frames;
48
49    /* Canvas management */
50    int refcount;
51    int autoinc;
52    int (*resize_callback)(void *);
53    void *resize_data;
54
55    /* Shortcut to the active frame information */
56    int width, height;
57    uint32_t *chars;
58    uint32_t *attrs;
59    uint32_t curattr;
60
61    /* FIGfont management */
62    cucul_figfont_t *ff;
63};
64
65struct cucul_buffer
66{
67    size_t size;
68    char *data;
69    int user_data;
70};
71
72/* Colour functions */
73extern uint32_t _cucul_attr_to_rgb24fg(uint32_t);
74extern uint32_t _cucul_attr_to_rgb24bg(uint32_t);
75
76/* Frames functions */
77extern void _cucul_save_frame_info(cucul_canvas_t *);
78extern void _cucul_load_frame_info(cucul_canvas_t *);
79
80/* File functions */
81extern cucul_file_t *_cucul_file_open(const char *, const char *);
82extern int _cucul_file_close(cucul_file_t *);
83extern int _cucul_file_eof(cucul_file_t *);
84extern char *_cucul_file_gets(char *, int, cucul_file_t *);
85
86#endif /* __CUCUL_INTERNALS_H__ */
Note: See TracBrowser for help on using the repository browser.