1 
2 //          Copyright 2019 - 2021 Michael D. Parker
3 // Distributed under the Boost Software License, Version 1.0.
4 //    (See accompanying file LICENSE_1_0.txt or copy at
5 //          http://www.boost.org/LICENSE_1_0.txt)
6 
7 module bindbc.freetype.bind.fttypes;
8 
9 import core.stdc.config;
10 import bindbc.freetype.config;
11 
12 alias FT_Bool = ubyte;
13 alias FT_FWord = short;
14 alias FT_UFWord = ushort;
15 alias FT_Char = char;
16 alias FT_Byte = ubyte;
17 alias FT_Bytes = FT_Byte*;
18 alias FT_Tag = FT_UInt32;
19 alias FT_String = char;
20 alias FT_Short = short;
21 alias FT_UShort = ushort;
22 alias FT_Int = int;
23 alias FT_UInt = uint;
24 alias FT_Long = c_long;
25 alias FT_ULong = c_ulong;
26 alias FT_F2Dot14 = short;
27 alias FT_F26Dot6 = c_long;
28 alias FT_Fixed = c_long;
29 alias FT_Error = int;
30 alias FT_Pointer = void*;
31 alias FT_Offset = size_t;
32 alias FT_PtrDist = ptrdiff_t;
33 
34 struct FT_UnitVector {
35     FT_F2Dot14 x;
36     FT_F2Dot14 y;
37 }
38 
39 struct FT_Matrix {
40     FT_Fixed xx, xy;
41     FT_Fixed yx, yy;
42 }
43 
44 struct FT_Data {
45     const(FT_Byte)* pointer;
46     FT_Int length;
47 }
48 
49 extern(C) nothrow alias FT_Generic_Finalizer = void function(void*);
50 
51 struct FT_Generic {
52     void* data;
53     FT_Generic_Finalizer finalizer;
54 }
55 
56 FT_Tag FT_MAKE_TAG(char x1, char x2, char x3, char x4) {
57     return cast(FT_UInt32)((x1 << 24) | (x2 << 16) | (x3 << 8) | x4);
58 }
59 
60 alias FT_ListNode = FT_ListNodeRec*;
61 alias FT_List = FT_ListRec*;
62 
63 struct FT_ListNodeRec {
64     FT_ListNode prev;
65     FT_ListNode next;
66     void* data;
67 }
68 
69 struct FT_ListRec {
70     FT_ListNode head;
71     FT_ListNode tail;
72 }