1 
2 //          Copyright Ahmet Sait Koçak 2020.
3 // Distributed under the Boost Software License, Version 1.0.
4 //    (See accompanying file LICENSE_1_0.txt or copy at
5 //          https://www.boost.org/LICENSE_1_0.txt)
6 
7 module bindbc.hb.bind.shape_plan;
8 
9 import bindbc.hb.bind.buffer;
10 import bindbc.hb.bind.common;
11 import bindbc.hb.bind.font;
12 import bindbc.hb.bind.face;
13 
14 extern(C) @nogc nothrow:
15 
16 struct hb_shape_plan_t;
17 
18 version(BindHB_Static)
19     hb_shape_plan_t* hb_shape_plan_create (
20         hb_face_t* face,
21         const(hb_segment_properties_t)* props,
22         const(hb_feature_t)* user_features,
23         uint num_user_features,
24         const(char*)* shaper_list);
25 else
26 {
27     private alias fp_hb_shape_plan_create = hb_shape_plan_t* function (
28         hb_face_t* face,
29         const(hb_segment_properties_t)* props,
30         const(hb_feature_t)* user_features,
31         uint num_user_features,
32         const(char*)* shaper_list);
33     __gshared fp_hb_shape_plan_create hb_shape_plan_create;
34 }
35 
36 version(BindHB_Static)
37     hb_shape_plan_t* hb_shape_plan_create_cached (
38         hb_face_t* face,
39         const(hb_segment_properties_t)* props,
40         const(hb_feature_t)* user_features,
41         uint num_user_features,
42         const(char*)* shaper_list);
43 else
44 {
45     private alias fp_hb_shape_plan_create_cached = hb_shape_plan_t* function (
46         hb_face_t* face,
47         const(hb_segment_properties_t)* props,
48         const(hb_feature_t)* user_features,
49         uint num_user_features,
50         const(char*)* shaper_list);
51     __gshared fp_hb_shape_plan_create_cached hb_shape_plan_create_cached;
52 }
53 
54 version(BindHB_Static)
55     hb_shape_plan_t* hb_shape_plan_create2 (
56         hb_face_t* face,
57         const(hb_segment_properties_t)* props,
58         const(hb_feature_t)* user_features,
59         uint num_user_features,
60         const(int)* coords,
61         uint num_coords,
62         const(char*)* shaper_list);
63 else
64 {
65     private alias fp_hb_shape_plan_create2 = hb_shape_plan_t* function (
66         hb_face_t* face,
67         const(hb_segment_properties_t)* props,
68         const(hb_feature_t)* user_features,
69         uint num_user_features,
70         const(int)* coords,
71         uint num_coords,
72         const(char*)* shaper_list);
73     __gshared fp_hb_shape_plan_create2 hb_shape_plan_create2;
74 }
75 
76 version(BindHB_Static)
77     hb_shape_plan_t* hb_shape_plan_create_cached2 (
78         hb_face_t* face,
79         const(hb_segment_properties_t)* props,
80         const(hb_feature_t)* user_features,
81         uint num_user_features,
82         const(int)* coords,
83         uint num_coords,
84         const(char*)* shaper_list);
85 else
86 {
87     private alias fp_hb_shape_plan_create_cached2 = hb_shape_plan_t* function (
88         hb_face_t* face,
89         const(hb_segment_properties_t)* props,
90         const(hb_feature_t)* user_features,
91         uint num_user_features,
92         const(int)* coords,
93         uint num_coords,
94         const(char*)* shaper_list);
95     __gshared fp_hb_shape_plan_create_cached2 hb_shape_plan_create_cached2;
96 }
97 
98 version(BindHB_Static)
99     hb_shape_plan_t* hb_shape_plan_get_empty ();
100 else
101 {
102     private alias fp_hb_shape_plan_get_empty = hb_shape_plan_t* function ();
103     __gshared fp_hb_shape_plan_get_empty hb_shape_plan_get_empty;
104 }
105 
106 version(BindHB_Static)
107     hb_shape_plan_t* hb_shape_plan_reference (hb_shape_plan_t* shape_plan);
108 else
109 {
110     private alias fp_hb_shape_plan_reference = hb_shape_plan_t* function (hb_shape_plan_t* shape_plan);
111     __gshared fp_hb_shape_plan_reference hb_shape_plan_reference;
112 }
113 
114 version(BindHB_Static)
115     void hb_shape_plan_destroy (hb_shape_plan_t* shape_plan);
116 else
117 {
118     private alias fp_hb_shape_plan_destroy = void function (hb_shape_plan_t* shape_plan);
119     __gshared fp_hb_shape_plan_destroy hb_shape_plan_destroy;
120 }
121 
122 version(BindHB_Static)
123     hb_bool_t hb_shape_plan_set_user_data (
124         hb_shape_plan_t* shape_plan,
125         hb_user_data_key_t* key,
126         void* data,
127         hb_destroy_func_t destroy,
128         hb_bool_t replace);
129 else
130 {
131     private alias fp_hb_shape_plan_set_user_data = hb_bool_t function (
132         hb_shape_plan_t* shape_plan,
133         hb_user_data_key_t* key,
134         void* data,
135         hb_destroy_func_t destroy,
136         hb_bool_t replace);
137     __gshared fp_hb_shape_plan_set_user_data hb_shape_plan_set_user_data;
138 }
139 
140 version(BindHB_Static)
141     void* hb_shape_plan_get_user_data (
142         hb_shape_plan_t* shape_plan,
143         hb_user_data_key_t* key);
144 else
145 {
146     private alias fp_hb_shape_plan_get_user_data = void* function (
147         hb_shape_plan_t* shape_plan,
148         hb_user_data_key_t* key);
149     __gshared fp_hb_shape_plan_get_user_data hb_shape_plan_get_user_data;
150 }
151 
152 version(BindHB_Static)
153     hb_bool_t hb_shape_plan_execute (
154         hb_shape_plan_t* shape_plan,
155         hb_font_t* font,
156         hb_buffer_t* buffer,
157         const(hb_feature_t)* features,
158         uint num_features);
159 else
160 {
161     private alias fp_hb_shape_plan_execute = hb_bool_t function (
162         hb_shape_plan_t* shape_plan,
163         hb_font_t* font,
164         hb_buffer_t* buffer,
165         const(hb_feature_t)* features,
166         uint num_features);
167     __gshared fp_hb_shape_plan_execute hb_shape_plan_execute;
168 }
169 
170 version(BindHB_Static)
171     const(char)* hb_shape_plan_get_shaper (hb_shape_plan_t* shape_plan);
172 else
173 {
174     private alias fp_hb_shape_plan_get_shaper = const(char)* function (hb_shape_plan_t* shape_plan);
175     __gshared fp_hb_shape_plan_get_shaper hb_shape_plan_get_shaper;
176 }