rute 0.0.6

UI library implemented on top of Qt
Documentation
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This file is auto-generated by rute_gen. DO NOT EDIT
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include "../rute_base.h"
#include "../rute_manual.h"
#include <QFont>
#include "font_ffi.h"

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_swap(struct RUBase* self_c, struct RUBase* other) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->swap(*((WRFont*)other));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static const char* font_family(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->family();
    return q_string_to_const_char(ret_value);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_family(struct RUBase* self_c, const char* arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setFamily(QString::fromUtf8(arg0));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static const char* font_style_name(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->styleName();
    return q_string_to_const_char(ret_value);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_style_name(struct RUBase* self_c, const char* arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setStyleName(QString::fromUtf8(arg0));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int font_point_size(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->pointSize();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_point_size(struct RUBase* self_c, int arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setPointSize(arg0);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static float font_point_size_f(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->pointSizeF();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_point_size_f(struct RUBase* self_c, float arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setPointSizeF(arg0);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int font_pixel_size(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->pixelSize();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_pixel_size(struct RUBase* self_c, int arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setPixelSize(arg0);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int font_weight(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->weight();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_weight(struct RUBase* self_c, int arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setWeight(arg0);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool font_bold(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->bold();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_bold(struct RUBase* self_c, bool arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setBold(arg0);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool font_italic(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->italic();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_italic(struct RUBase* self_c, bool b) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setItalic(b);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool font_underline(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->underline();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_underline(struct RUBase* self_c, bool arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setUnderline(arg0);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool font_overline(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->overline();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_overline(struct RUBase* self_c, bool arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setOverline(arg0);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool font_fixed_pitch(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->fixedPitch();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_fixed_pitch(struct RUBase* self_c, bool arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setFixedPitch(arg0);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool font_kerning(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->kerning();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_kerning(struct RUBase* self_c, bool arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setKerning(arg0);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static uint32_t font_style_hint(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->styleHint();
    return (uint32_t)ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_style_hint(struct RUBase* self_c, uint32_t arg0, uint32_t arg1) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setStyleHint((QFont::StyleHint)arg0, (QFont::StyleStrategy)arg1);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static float font_letter_spacing(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->letterSpacing();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static uint32_t font_letter_spacing_type(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->letterSpacingType();
    return (uint32_t)ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_letter_spacing(struct RUBase* self_c, uint32_t stype, float spacing) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setLetterSpacing((QFont::SpacingType)stype, spacing);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static float font_word_spacing(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->wordSpacing();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_word_spacing(struct RUBase* self_c, float spacing) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setWordSpacing(spacing);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_capitalization(struct RUBase* self_c, uint32_t arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setCapitalization((QFont::Capitalization)arg0);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static uint32_t font_capitalization(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->capitalization();
    return (uint32_t)ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_hinting_preference(struct RUBase* self_c, uint32_t hinting_preference) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setHintingPreference((QFont::HintingPreference)hinting_preference);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static uint32_t font_hinting_preference(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->hintingPreference();
    return (uint32_t)ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool font_raw_mode(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->rawMode();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_raw_mode(struct RUBase* self_c, bool arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setRawMode(arg0);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool font_exact_match(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->exactMatch();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static bool font_is_copy_of(struct RUBase* self_c, struct RUBase* arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->isCopyOf(*((WRFont*)arg0));
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_set_raw_name(struct RUBase* self_c, const char* arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->setRawName(QString::fromUtf8(arg0));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static const char* font_raw_name(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->rawName();
    return q_string_to_const_char(ret_value);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static const char* font_key(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->key();
    return q_string_to_const_char(ret_value);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static const char* font_substitute(struct RUBase* self_c, const char* arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->substitute(QString::fromUtf8(arg0));
    return q_string_to_const_char(ret_value);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_insert_substitution(struct RUBase* self_c, const char* arg0, const char* arg1) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->insertSubstitution(QString::fromUtf8(arg0), QString::fromUtf8(arg1));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_remove_substitutions(struct RUBase* self_c, const char* arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->removeSubstitutions(QString::fromUtf8(arg0));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_initialize(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->initialize();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_cleanup(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->cleanup();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_cache_statistics(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->cacheStatistics();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static const char* font_default_family(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->defaultFamily();
    return q_string_to_const_char(ret_value);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static const char* font_last_resort_family(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->lastResortFamily();
    return q_string_to_const_char(ret_value);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static const char* font_last_resort_font(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->lastResortFont();
    return q_string_to_const_char(ret_value);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUFont font_resolve(struct RUBase* self_c, struct RUBase* arg0) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->resolve(*((WRFont*)arg0));
    WRFont* new_val = new WRFont();
    *new_val = ret_value;
    struct RUFont ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_font_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static uint64_t font_resolve_2(struct RUBase* self_c) {
    WRFont* qt_value = (WRFont*)self_c;
    auto ret_value = qt_value->resolve();
    return ret_value;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void font_resolve_3(struct RUBase* self_c, uint64_t mask) {
    WRFont* qt_value = (WRFont*)self_c;
    qt_value->resolve(mask);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUFont create_font(
    struct RUBase* priv_data,
    RUDeleteCallback delete_callback,
    void* private_user_data)
{
    auto ctl = generic_create_func_with_delete<struct RUFont, WRFont>(priv_data, delete_callback, private_user_data);
    ctl.all_funcs = &s_font_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void destroy_font(struct RUBase* priv_data) {
    destroy_generic<WRFont>(priv_data);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUFont get_font(struct RUBase* priv_data) {
    (void)priv_data;
    RUFont ctl;
    ctl.qt_data = nullptr;
    ctl.host_data = nullptr;
    ctl.all_funcs = &s_font_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

struct RUFontFuncs s_font_funcs = {
    destroy_font,
    font_swap,
    font_family,
    font_set_family,
    font_style_name,
    font_set_style_name,
    font_point_size,
    font_set_point_size,
    font_point_size_f,
    font_set_point_size_f,
    font_pixel_size,
    font_set_pixel_size,
    font_weight,
    font_set_weight,
    font_bold,
    font_set_bold,
    font_italic,
    font_set_italic,
    font_underline,
    font_set_underline,
    font_overline,
    font_set_overline,
    font_fixed_pitch,
    font_set_fixed_pitch,
    font_kerning,
    font_set_kerning,
    font_style_hint,
    font_set_style_hint,
    font_letter_spacing,
    font_letter_spacing_type,
    font_set_letter_spacing,
    font_word_spacing,
    font_set_word_spacing,
    font_set_capitalization,
    font_capitalization,
    font_set_hinting_preference,
    font_hinting_preference,
    font_raw_mode,
    font_set_raw_mode,
    font_exact_match,
    font_is_copy_of,
    font_set_raw_name,
    font_raw_name,
    font_key,
    font_substitute,
    font_insert_substitution,
    font_remove_substitutions,
    font_initialize,
    font_cleanup,
    font_cache_statistics,
    font_default_family,
    font_last_resort_family,
    font_last_resort_font,
    font_resolve,
    font_resolve_2,
    font_resolve_3,
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

struct RUFontAllFuncs s_font_all_funcs = {
    &s_font_funcs,
};