1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
|
/*
* Mr. 4th Dimention - Allen Webster
*
* 09.12.2019
*
* Documentation of the custom layer's primary api : buffer-related calls
*
*/
// TOP
function void
doc_custom_api__draw(Arena *arena, API_Definition *api_def, Doc_Cluster *cluster){
Doc_Function func = {};
if (begin_doc_call(arena, cluster, api_def, "draw_string_oriented", &func)){
doc_function_brief(arena, &func, "Directly render text");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "font_id");
doc_text(arena, params, "the id of the face to use rendering the text");
doc_function_param(arena, &func, "color");
doc_text(arena, params, "the color of the text");
doc_function_param(arena, &func, "str");
doc_text(arena, params, "the text to be rendered");
doc_function_param(arena, &func, "point");
doc_text(arena, params, "the position of the text, in pixels relative to the screen's top left corner");
doc_function_param(arena, &func, "flags");
doc_text(arena, params, "flags determining the orientation of the string to render");
doc_function_param(arena, &func, "delta");
doc_text(arena, params, "a unit vector specifying the direction along which the text advances");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "the new point after advancing the point while laying out the text");
// details
Doc_Block *det = doc_function_details(arena, &func);
doc_text(arena, det, "As a render function, this only takes effect during a call to the render hook.");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "get_string_advance", &func)){
doc_function_brief(arena, &func, "Compute the total advance of a string rendered in a particular font");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "font_id");
doc_text(arena, params, "the id of the face to use rendering the text");
doc_function_param(arena, &func, "str");
doc_text(arena, params, "the text to be rendered");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "the total advance of the string");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "draw_rectangle", &func)){
doc_function_brief(arena, &func, "Directly render a rectangle");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "rect");
doc_text(arena, params, "the rectangle coordinates, in pixels relative to the top left corner of the screen");
doc_function_param(arena, &func, "roundness");
doc_text(arena, params, "the roundness of the pixels, set as a radius of a circular curve measured in pixels");
doc_function_param(arena, &func, "color");
doc_text(arena, params, "the color of the rectangle");
// details
Doc_Block *det = doc_function_details(arena, &func);
doc_text(arena, det, "As a render function, this only takes effect during a call to the render hook.");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "draw_rectangle_outline", &func)){
doc_function_brief(arena, &func, "Directly render a rectangle outline");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "rect");
doc_text(arena, params, "the rectangle coordinates, in pixels relative to the top left corner of the screen");
doc_function_param(arena, &func, "roundness");
doc_text(arena, params, "the roundness of the pixels, set as a radius of a circular curve measured in pixels");
doc_function_param(arena, &func, "thickness");
doc_text(arena, params, "the thickness, in pixels, of the rectangle outline");
doc_function_param(arena, &func, "color");
doc_text(arena, params, "the color of the rectangle");
// details
Doc_Block *det = doc_function_details(arena, &func);
doc_text(arena, det, "As a render function, this only takes effect during a call to the render hook.");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "draw_set_clip", &func)){
doc_function_brief(arena, &func, "Set the clip rectangle for future render functions");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "new_clip");
doc_text(arena, params, "the new rectangular coordinates of the clip rectangle, in pixels relative to the top left corner of the screen");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "the previous value of clip rectangle");
// details
Doc_Block *det = doc_function_details(arena, &func);
doc_text(arena, det, "As a render function, this only takes effect during a call to the render hook.");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "text_layout_create", &func)){
doc_function_brief(arena, &func, "Create a text layout object");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "buffer_id");
doc_text(arena, params, "the id of the buffer to read for layout");
doc_function_param(arena, &func, "rect");
doc_text(arena, params, "the region on the screen where the layout will be placed");
doc_function_param(arena, &func, "buffer_point");
doc_text(arena, params, "the point in the buffer that will be placed in the top left corner of the rectangle");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "the id of the new text layout object, when the buffer exists and contains the buffer point, otherwise zero");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "text_layout_region", &func)){
doc_function_brief(arena, &func, "Get the on screen rectangular region of a layout object");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "text_layout_id");
doc_text(arena, params, "the id of the text layout object");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "on success, when the text layout object exists, the rectangular region used to create the object, otherwise zero");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "text_layout_get_buffer", &func)){
doc_function_brief(arena, &func, "Get the buffer of a layout object");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "text_layout_id");
doc_text(arena, params, "the id of the text layout object");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "on success, when the text layout object exists, the id of the buffer used to create the object, otherwise zero");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "text_layout_get_visible_range", &func)){
doc_function_brief(arena, &func, "Get the range in byte positions within the buffer that are visible in a text layout");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "text_layout_id");
doc_text(arena, params, "the id of the text layout object");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "on success, when the text layout object exists, the range of positions in the buffer that are visible in the object, otherwise cleared to zero");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "text_layout_line_on_screen", &func)){
doc_function_brief(arena, &func, "Get the range of the y-axis spanned by a line layout");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "layout_id");
doc_text(arena, params, "the id of the text layout object");
doc_function_param(arena, &func, "line_number");
doc_text(arena, params, "the line number of the line to query");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "on success, when the object exists and the line is visible in the layout, the range in pixels from the top to the bottom of a particular line, cleared to zero otherwise");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "text_layout_character_on_screen", &func)){
doc_function_brief(arena, &func, "Get the rectangle covered by a character in the layout");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "layout_id");
doc_text(arena, params, "the id of the text layout object");
doc_function_param(arena, &func, "pos");
doc_text(arena, params, "the byte position to query");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "on success, when the object exists and the position is visible in the layout, the rectangle in pixels covered by the character, cleared to zero otherwise");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "paint_text_color", &func)){
doc_function_brief(arena, &func, "Set the color of a range of characters in a text layout");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "layout_id");
doc_text(arena, params, "the id of the text layout object");
doc_function_param(arena, &func, "range");
doc_text(arena, params, "the range in byte positions to modify");
doc_function_param(arena, &func, "color");
doc_text(arena, params, "the new color of the text in the range");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "text_layout_free", &func)){
doc_function_brief(arena, &func, "Release the resources associated with a text layout object");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "text_layout_id");
doc_text(arena, params, "the id of the text layout object");
// return
Doc_Block *ret = doc_function_return(arena, &func);
doc_text(arena, ret, "non-zero on success, when the text layout object exists, otherwise zero");
}
////////////////////////////////
if (begin_doc_call(arena, cluster, api_def, "draw_text_layout", &func)){
doc_function_brief(arena, &func, "Directly render a text layout object");
// params
Doc_Block *params = doc_function_begin_params(arena, &func);
doc_custom_app_ptr(arena, &func);
doc_function_param(arena, &func, "layout_id");
doc_text(arena, params, "the id of the text layout object");
doc_function_param(arena, &func, "special_color");
doc_text(arena, params, "the color to use for characters with the special character flag");
doc_function_param(arena, &func, "ghost_color");
doc_text(arena, params, "the color to use for characters with the ghost character flag");
}
}
// BOTTOM
|