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 | |
---|
20 | typedef struct cucul_figfont cucul_figfont_t; |
---|
21 | |
---|
22 | struct 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 | |
---|
40 | struct 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 | |
---|
65 | struct cucul_buffer |
---|
66 | { |
---|
67 | size_t size; |
---|
68 | char *data; |
---|
69 | int user_data; |
---|
70 | }; |
---|
71 | |
---|
72 | /* Colour functions */ |
---|
73 | extern uint32_t _cucul_attr_to_rgb24fg(uint32_t); |
---|
74 | extern uint32_t _cucul_attr_to_rgb24bg(uint32_t); |
---|
75 | |
---|
76 | /* Frames functions */ |
---|
77 | extern void _cucul_save_frame_info(cucul_canvas_t *); |
---|
78 | extern void _cucul_load_frame_info(cucul_canvas_t *); |
---|
79 | |
---|
80 | /* File functions */ |
---|
81 | extern cucul_file_t *_cucul_file_open(const char *, const char *); |
---|
82 | extern int _cucul_file_close(cucul_file_t *); |
---|
83 | extern int _cucul_file_eof(cucul_file_t *); |
---|
84 | extern char *_cucul_file_gets(char *, int, cucul_file_t *); |
---|
85 | |
---|
86 | #endif /* __CUCUL_INTERNALS_H__ */ |
---|