vx11 / fontconfig / types.c.v
187 lines · 142 sloc · 3.28 KB · 6de7c1113616d30335010eea79fd03d19722b474
Raw
1// Public types from fontconfig/fontconfig.h. The C header owns the ABI;
2// constants are generated into constants.v.
3module fontconfig
4
5#pkgconfig fontconfig
6#include <fontconfig/fontconfig.h>
7#include "@VMODROOT/fontconfig/types.h"
8#include "@VMODROOT/fontconfig/bridge.h"
9
10pub type FcChar8 = u8
11pub type FcChar16 = u16
12pub type FcChar32 = u32
13pub type FcBool = i32
14pub type FcObject = i32
15
16// C enums are int-sized; enum output pointers cross typed adapters in bridge.h.
17pub type FcType = i32
18pub type FcResult = i32
19pub type FcValueBinding = i32
20pub type FcMatchKind = i32
21pub type FcLangResult = i32
22pub type FcSetName = i32
23pub type FcEndian = i32
24
25// Callbacks for config_set_font_set_filter. Exact C widths: FcBool is C int.
26pub type FcDestroyFunc = fn (data voidptr)
27
28pub type FcFilterFontSetFunc = fn (font &FcPattern, user_data voidptr) FcBool
29
30@[typedef]
31pub struct C.FcMatrix {
32pub mut:
33 xx f64
34 xy f64
35 yx f64
36 yy f64
37}
38
39pub type FcMatrix = C.FcMatrix
40
41@[typedef]
42pub struct C.FcObjectType {
43pub mut:
44 object &char
45 @type FcType
46}
47
48pub type FcObjectType = C.FcObjectType
49
50@[typedef]
51pub struct C.FcConstant {
52pub mut:
53 name &u8
54 object &char
55 value i32
56}
57
58pub type FcConstant = C.FcConstant
59
60// Opaque handles; use them only through pointers.
61@[typedef]
62pub struct C.FcCharSet {}
63
64pub type FcCharSet = C.FcCharSet
65
66@[typedef]
67pub struct C.FcPattern {}
68
69pub type FcPattern = C.FcPattern
70
71@[typedef]
72pub struct C.FcLangSet {}
73
74pub type FcLangSet = C.FcLangSet
75
76@[typedef]
77pub struct C.FcRange {}
78
79pub type FcRange = C.FcRange
80
81@[typedef]
82pub struct C.FcAtomic {}
83
84pub type FcAtomic = C.FcAtomic
85
86@[typedef]
87pub struct C.FcConfig {}
88
89pub type FcConfig = C.FcConfig
90
91@[typedef]
92pub struct C.FcFileCache {}
93
94pub type FcFileCache = C.FcFileCache
95
96@[typedef]
97pub struct C.FcBlanks {}
98
99pub type FcBlanks = C.FcBlanks
100
101@[typedef]
102pub struct C.FcStrList {}
103
104pub type FcStrList = C.FcStrList
105
106@[typedef]
107pub struct C.FcStrSet {}
108
109pub type FcStrSet = C.FcStrSet
110
111@[typedef]
112pub struct C.FcCache {}
113
114pub type FcCache = C.FcCache
115
116// FcPatternIter is caller-allocated state for the pattern_iter_* calls.
117@[typedef]
118pub struct C.FcPatternIter {
119pub mut:
120 dummy1 voidptr
121 dummy2 voidptr
122}
123
124pub type FcPatternIter = C.FcPatternIter
125
126// FcValueUnion is FcValue's anonymous union, named in types.h. Read the member
127// that matches FcValue.type.
128@[typedef]
129pub union C.vx11_FcValueUnion {
130pub mut:
131 s &u8
132 i i32
133 b FcBool
134 d f64
135 m &FcMatrix
136 c &FcCharSet
137 f voidptr
138 l &FcLangSet
139 r &FcRange
140}
141
142pub type FcValueUnion = C.vx11_FcValueUnion
143
144// FcValue borrows the data its pointers reference, except values returned by
145// value_save, which value_destroy releases.
146@[typedef]
147pub struct C.FcValue {
148pub mut:
149 @type FcType
150 u FcValueUnion
151}
152
153pub type FcValue = C.FcValue
154
155@[typedef]
156pub struct C.FcFontSet {
157pub mut:
158 nfont i32
159 sfont i32
160 fonts &&FcPattern
161}
162
163pub type FcFontSet = C.FcFontSet
164
165// The object name fields are deprecated by Fontconfig.
166@[typedef]
167pub struct C.FcObjectSet {
168pub mut:
169 nobject i32
170 sobject i32
171 objects &&char
172 nobjIds i32
173 objIds &FcObject
174}
175
176pub type FcObjectSet = C.FcObjectSet
177
178// FcConfigFileInfoIter is caller-allocated state for config_file_info_iter_*.
179@[typedef]
180pub struct C.FcConfigFileInfoIter {
181pub mut:
182 dummy1 voidptr
183 dummy2 voidptr
184 dummy3 voidptr
185}
186
187pub type FcConfigFileInfoIter = C.FcConfigFileInfoIter
188