fltk-sys 1.5.22

Rust bindings for the FLTK GUI library
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
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
#include <cfltk/cfl_draw.h>
#include <cfltk/cfl_lock.h>
#include <cfltk/cfl_widget.hpp>

#include <FL/Enumerations.H>
#include <FL/Fl.H>
#include <FL/Fl_Graphics_Driver.H>
#include <FL/Fl_Image.H>
#include <FL/Fl_Rect.H>
#include <FL/Fl_Window.H>
#include <FL/fl_draw.H>
#include <FL/fl_show_colormap.H>
#include <FL/platform.H>

void Fl_set_color_int(unsigned int c) {
    fl_color(c);
}

void Fl_set_color_rgb(unsigned char r, unsigned char g, unsigned char b) {
    fl_color(r, g, b);
}

unsigned int Fl_get_color(void) {
    return fl_color();
}

void Fl_push_clip(int x, int y, int w, int h) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_push_clip(x, y, w, h);
}

void Fl_push_no_clip(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_push_no_clip();
}

void Fl_pop_clip(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_pop_clip();
}

int Fl_not_clipped(int x, int y, int w, int h) {
    if (!fl_graphics_driver)
        return 0;
    fl_open_display();
    return fl_not_clipped(x, y, w, h);
}

int Fl_clip_box(int x, int y, int w, int h, int *X, int *Y, int *W, int *H) {
    if (!fl_graphics_driver)
        return 0;
    fl_open_display();
    return fl_clip_box(x, y, w, h, *X, *Y, *W, *H);
}

void Fl_restore_clip(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_restore_clip();
}

void Fl_set_clip_region(void *r) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_clip_region((Fl_Region)r);
}

void *Fl_clip_region(void) {
    if (!fl_graphics_driver)
        return nullptr;
    fl_open_display();
    return (void *)fl_clip_region();
}

void Fl_point(int x, int y) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_point(x, y);
}

void Fl_line_style(int style, int width, char *dashes) {
    fl_line_style(style, width, dashes);
}

void Fl_rect(int x, int y, int w, int h) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_rect(x, y, w, h);
}

void Fl_focus_rect(int x, int y, int w, int h) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_focus_rect(x, y, w, h);
}

void Fl_rect_with_color(int x, int y, int w, int h, unsigned int c) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_rect(x, y, w, h, c);
}

void Fl_rectf(int x, int y, int w, int h) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_rectf(x, y, w, h);
}

void Fl_rectf_with_color(int x, int y, int w, int h, unsigned int c) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_rectf(x, y, w, h, c);
}

void Fl_rectf_with_rgb(
    int x,
    int y,
    int w,
    int h,
    unsigned char r,
    unsigned char g,
    unsigned char b
) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_rectf(x, y, w, h, r, g, b);
}

void Fl_line(int x, int y, int x1, int y1) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_line(x, y, x1, y1);
}

void Fl_line2(int x, int y, int x1, int y1, int x2, int y2) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_line(x, y, x1, y1, x2, y2);
}

void Fl_loop(int x, int y, int x1, int y1, int x2, int y2) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_loop(x, y, x1, y1, x2, y2);
}

void Fl_loop2(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_loop(x, y, x1, y1, x2, y2, x3, y3);
}

void Fl_polygon(int x, int y, int x1, int y1, int x2, int y2) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_polygon(x, y, x1, y1, x2, y2);
}

void Fl_polygon2(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_polygon(x, y, x1, y1, x2, y2, x3, y3);
}

void Fl_xyline(int x, int y, int x1) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_xyline(x, y, x1);
}

void Fl_xyline2(int x, int y, int x1, int y2) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_xyline(x, y, x1, y2);
}

void Fl_xyline3(int x, int y, int x1, int y2, int x3) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_xyline(x, y, x1, y2, x3);
}

void Fl_yxline(int x, int y, int y1) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_yxline(x, y, y1);
}

void Fl_yxline2(int x, int y, int y1, int x2) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_yxline(x, y, y1, x2);
}

void Fl_yxline3(int x, int y, int y1, int x2, int y3) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_yxline(x, y, y1, x2, y3);
}

void Fl_arc(int x, int y, int w, int h, double a1, double a2) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_arc(x, y, w, h, a1, a2);
}

void Fl_pie(int x, int y, int w, int h, double a1, double a2) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_pie(x, y, w, h, a1, a2);
}

void Fl_push_matrix(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_push_matrix();
}

void Fl_pop_matrix(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_pop_matrix();
}

void Fl_scale(double x, double y) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_scale(x, y);
}

void Fl_scale2(double x) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_scale(x);
}

void Fl_translate(double x, double y) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_translate(x, y);
}

void Fl_rotate(double d) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_rotate(d);
}

void Fl_mult_matrix(
    double a, double b, double c, double d, double x, double y
) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_mult_matrix(a, b, c, d, x, y);
}

void Fl_begin_points(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_begin_points();
}

void Fl_begin_line(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_begin_line();
}

void Fl_begin_loop(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_begin_loop();
}

void Fl_begin_polygon(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_begin_polygon();
}

void Fl_vertex(double x, double y) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_vertex(x, y);
}

void Fl_curve(
    double X0,
    double Y0,
    double X1,
    double Y1,
    double X2,
    double Y2,
    double X3,
    double Y3
) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_curve(X0, Y0, X1, Y1, X2, Y2, X3, Y3);
}

void Fl_arc2(double x, double y, double r, double start, double end) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_arc(x, y, r, start, end);
}

void Fl_circle(double x, double y, double r) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_circle(x, y, r);
}

void Fl_draw_circle(int x, int y, int d, unsigned int c) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_draw_circle(x, y, d, (Fl_Color)c);
}

void Fl_end_points(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_end_points();
}

void Fl_end_line(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_end_line();
}

void Fl_end_loop(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_end_loop();
}

void Fl_end_polygon(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_end_polygon();
}

void Fl_begin_complex_polygon(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_begin_complex_polygon();
}

void Fl_gap(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_gap();
}

void Fl_end_complex_polygon(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_end_complex_polygon();
}

double Fl_transform_x(double x, double y) {
    if (!fl_graphics_driver)
        return 0;
    fl_open_display();
    return fl_transform_x(x, y);
}

double Fl_transform_y(double x, double y) {
    if (!fl_graphics_driver)
        return 0;
    fl_open_display();
    return fl_transform_y(x, y);
}

double Fl_transform_dx(double x, double y) {
    if (!fl_graphics_driver)
        return 0;
    fl_open_display();
    return fl_transform_dx(x, y);
}

double Fl_transform_dy(double x, double y) {
    if (!fl_graphics_driver)
        return 0;
    fl_open_display();
    return fl_transform_dy(x, y);
}

void Fl_transformed_vertex(double xf, double yf) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_transformed_vertex(xf, yf);
}

void Fl_set_draw_font(int face, int fsize) {
    fl_font(face, fsize);
}

int Fl_font(void) {
    return fl_font();
}

int Fl_size(void) {
    if (!fl_graphics_driver)
        return 0;
    return fl_size();
}

int Fl_height(void) {
    return fl_height();
}

int Fl_set_height(int font, int size) {
    return fl_height(font, size);
}

int Fl_descent(void) {
    if (!fl_graphics_driver)
        return 0;
    fl_open_display();
    return fl_descent();
}

double Fl_width(const char *txt) {
    return fl_width(txt);
}

double Fl_width2(const char *txt, int n) {
    return fl_width(txt, n);
}

double Fl_width3(unsigned int c) {
    return fl_width(c);
}

void Fl_text_extents(const char *txt, int *dx, int *dy, int *w, int *h) {
    return fl_text_extents(txt, *dx, *dy, *w, *h);
}

void Fl_text_extents2(const char *t, int n, int *dx, int *dy, int *w, int *h) {
    return fl_text_extents(t, n, *dx, *dy, *w, *h);
}

const char *Fl_latin1_to_local(const char *t, int n) {
    return fl_latin1_to_local(t, n);
}

const char *Fl_local_to_latin1(const char *t, int n) {
    return fl_local_to_latin1(t, n);
}

const char *Fl_mac_roman_to_local(const char *t, int n) {
    return fl_mac_roman_to_local(t, n);
}

const char *Fl_local_to_mac_roman(const char *t, int n) {
    return fl_local_to_mac_roman(t, n);
}

void Fl_draw(const char *str, int x, int y) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_draw(str, x, y);
}

void Fl_draw2(int angle, const char *str, int x, int y) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_draw(angle, str, x, y);
}

void Fl_draw3(const char *str, int n, int x, int y) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_draw(str, n, x, y);
}

void Fl_draw4(int angle, const char *str, int n, int x, int y) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_draw(angle, str, n, x, y);
}

void Fl_rtl_draw(const char *str, int n, int x, int y) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_rtl_draw(str, n, x, y);
}

void Fl_measure(const char *str, int *x, int *y, int draw_symbols) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_measure(str, *x, *y, draw_symbols);
}

void Fl_draw5(
    const char *str,
    int x,
    int y,
    int w,
    int h,
    int align,
    void **img,
    int draw_symbols
) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_draw(str, x, y, w, h, align, (Fl_Image *)*img, draw_symbols);
}

void Fl_frame(const char *s, int x, int y, int w, int h) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_frame(s, x, y, w, h);
}

void Fl_frame2(const char *s, int x, int y, int w, int h) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_frame2(s, x, y, w, h);
}

void Fl_draw_box(int box_type, int x, int y, int w, int h, unsigned int c) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_draw_box((Fl_Boxtype)box_type, x, y, w, h, c);
}

void Fl_draw_image(
    const unsigned char *buf, int X, int Y, int W, int H, int D, int L
) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_draw_image(buf, X, Y, W, H, D, L);
}

void Fl_draw_image_mono(
    const unsigned char *buf, int X, int Y, int W, int H, int D, int L
) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_draw_image_mono(buf, X, Y, W, H, D, L);
}

char Fl_can_do_alpha_blending(void) {
    return fl_can_do_alpha_blending();
}

unsigned char *
Fl_read_image(unsigned char *p, int X, int Y, int W, int H, int alpha) {
    if (!fl_graphics_driver)
        return nullptr;
    fl_open_display();
    return fl_read_image(p, X, Y, W, H, alpha);
}

unsigned char *Fl_capture_window_part(void *win, int x, int y, int w, int h) {
    if (!fl_graphics_driver)
        return nullptr;
    fl_open_display();
    Fl_RGB_Image *tmp = fl_capture_window((Fl_Window *)win, x, y, w, h);
    return (unsigned char *)tmp->data();
}

int Fl_draw_pixmap(const char *const *data, int x, int y, int bg) {
    if (!fl_graphics_driver)
        return 0;
    fl_open_display();
    return fl_draw_pixmap(data, x, y, bg);
}

int Fl_draw_pixmap2(/*const*/ char *const *data, int x, int y, int bg) {
    if (!fl_graphics_driver)
        return 0;
    fl_open_display();
    return fl_draw_pixmap(data, x, y, bg);
}

int Fl_measure_pixmap(/*const*/ char *const *data, int *w, int *h) {
    if (!fl_graphics_driver)
        return 0;
    fl_open_display();
    return fl_measure_pixmap(data, *w, *h);
}

int Fl_measure_pixmap2(const char *const *cdata, int *w, int *h) {
    if (!fl_graphics_driver)
        return 0;
    fl_open_display();
    return fl_measure_pixmap(cdata, *w, *h);
}

const char *Fl_shortcut_label(unsigned int shortcut) {
    return fl_shortcut_label(shortcut);
}

const char *Fl_shortcut_label2(unsigned int shortcut, const char **eom) {
    return fl_shortcut_label(shortcut, eom);
}

unsigned int Fl_old_shortcut(const char *s) {
    return fl_old_shortcut(s);
}

void Fl_overlay_rect(int x, int y, int w, int h) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    return fl_overlay_rect(x, y, w, h);
}

void Fl_overlay_clear(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    return fl_overlay_clear();
}

void Fl_set_cursor(int cursor) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    return fl_cursor((Fl_Cursor)cursor);
}

void Fl_set_cursor2(int cursor, int fg, int bg) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    return fl_cursor((Fl_Cursor)cursor, fg, bg);
}

const char *Fl_expand_text(
    const char *from,
    char *buf,
    int maxbuf,
    double maxw,
    int *n,
    double *width,
    int wrap,
    int draw_symbols
) {
    if (!fl_graphics_driver)
        return nullptr;
    fl_open_display();
    return fl_expand_text(
        from, buf, maxbuf, maxw, *n, *width, wrap, draw_symbols
    );
}

void Fl_set_status(int X, int Y, int W, int H) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_set_status(X, Y, W, H);
}

void Fl_set_spot(int font, int size, int X, int Y, int W, int H, void *win) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_set_spot(font, size, X, Y, W, H, (Fl_Window *)win);
}

void Fl_reset_spot(void) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_reset_spot();
}

unsigned int Fl_show_colormap(unsigned int old_col) {
    if (!fl_graphics_driver)
        return 0;
    fl_open_display();
    return fl_show_colormap((Fl_Color)old_col);
}

void Fl_copy_offscreen(
    int x, int y, int w, int h, void *pixmap, int srcx, int srcy
) {
    fl_copy_offscreen(x, y, w, h, (Fl_Offscreen)pixmap, srcx, srcy);
}

void *Fl_create_offscreen(int w, int h) {
    return (void *)fl_create_offscreen(w, h);
}

void Fl_begin_offscreen(void *b) {
    fl_begin_offscreen((Fl_Offscreen)b);
}

void Fl_end_offscreen(void) {
    fl_end_offscreen();
}

void Fl_delete_offscreen(void *bitmap) {
    fl_delete_offscreen((Fl_Offscreen)bitmap);
}

void Fl_rescale_offscreen(void **ctx) {
    fl_rescale_offscreen(*(Fl_Offscreen *)ctx);
}

void Fl_draw_text2(const char *str, int x, int y, int w, int h, int align) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_draw(str, x, y, w, h, (Fl_Align)align, nullptr, 0);
}

void Fl_draw_check(int x, int y, int w, int h, unsigned int col) {
    if (!fl_graphics_driver)
        return;
    fl_open_display();
    fl_draw_check(Fl_Rect(x, y, w, h), (Fl_Color)col);
}

int Fl_add_symbol(
    const char *name, void (*drawit)(unsigned int), int scalable
) {
    return fl_add_symbol(name, drawit, scalable);
}

void Fl_rounded_rect(int x, int y, int w, int h, int r) {
    fl_rounded_rect(x, y, w, h, r);
}

void Fl_rounded_rectf(int x, int y, int w, int h, int r) {
    fl_rounded_rectf(x, y, w, h, r);
}

float Fl_override_scale(void) {
    return fl_override_scale();
}

void Fl_restore_scale(float s) {
    fl_restore_scale(s);
}