-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathdrawings.cxx
464 lines (353 loc) · 10.8 KB
/
drawings.cxx
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
#include "drawings.h"
#include <FL/fl_draw.H>
#include <FL/platform.H>
#include <FL/Enumerations.H>
void go_fltk_color(unsigned int color) {
fl_color((Fl_Color)color);
}
void go_fltk_set_draw_font(int font, int size) {
fl_font((Fl_Font)font, size);
}
int go_fltk_draw_font() {
return fl_font();
}
int go_fltk_draw_font_size() {
return fl_size();
}
void go_fltk_draw(const char* text, int x, int y, int w, int h, unsigned int align) {
fl_draw(text, x, y, w, h, (Fl_Align)align);
}
void go_fltk_draw_box(int boxType, int x, int y, int w, int h, unsigned int color) {
fl_draw_box(Fl_Boxtype(boxType), x, y, w, h, (Fl_Color)color);
}
void go_fltk_push_clip(int x, int y, int w, int h) {
fl_push_clip(x, y, w, h);
}
void go_fltk_push_no_clip(void) {
fl_push_no_clip();
}
void go_fltk_pop_clip(void) {
fl_pop_clip();
}
int go_fltk_not_clipped(int x, int y, int w, int h) {
return fl_not_clipped(x, y, w, h);
}
int go_fltk_clip_box(int x, int y, int w, int h, int *X, int *Y, int *W, int *H) {
return fl_clip_box(x, y, w, h, *X, *Y, *W, *H);
}
void go_fltk_restore_clip(void) {
fl_restore_clip();
}
void go_fltk_set_clip_region(void *r) {
fl_clip_region((Fl_Region)r);
}
void *go_fltk_clip_region(void) {
return (void *)fl_clip_region();
}
void go_fltk_point(int x, int y) {
fl_point(x, y);
}
void go_fltk_line_style(int style, int width, char *dashes) {
fl_line_style(style, width, dashes);
}
void go_fltk_rect(int x, int y, int w, int h) {
fl_rect(x, y, w, h);
}
void go_fltk_focus_rect(int x, int y, int w, int h) {
fl_focus_rect(x, y, w, h);
}
void go_fltk_draw_arrow(int x, int y, int w, int h, int arr, int orient, unsigned int color) {
Fl_Rect r{x, y, w, h};
fl_draw_arrow(r, (Fl_Arrow_Type)arr, (Fl_Orientation)orient, color);
}
void go_fltk_rect_with_color(int x, int y, int w, int h, unsigned int c) {
fl_rect(x, y, w, h, c);
}
void go_fltk_rectf(int x, int y, int w, int h) {
fl_rectf(x, y, w, h);
}
void go_fltk_rectf_with_color(int x, int y, int w, int h, unsigned int c) {
fl_rectf(x, y, w, h, c);
}
void go_fltk_rectf_with_rgb(int x, int y, int w, int h, unsigned char r, unsigned char g,
unsigned char b) {
fl_rectf(x, y, w, h, r, g, b);
}
void go_fltk_line(int x, int y, int x1, int y1) {
fl_line(x, y, x1, y1);
}
void go_fltk_line2(int x, int y, int x1, int y1, int x2, int y2) {
fl_line(x, y, x1, y1, x2, y2);
}
void go_fltk_loop(int x, int y, int x1, int y1, int x2, int y2) {
fl_loop(x, y, x1, y1, x2, y2);
}
void go_fltk_loop2(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) {
fl_loop(x, y, x1, y1, x2, y2, x3, y3);
}
void go_fltk_polygon(int x, int y, int x1, int y1, int x2, int y2) {
fl_polygon(x, y, x1, y1, x2, y2);
}
void go_fltk_polygon2(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) {
fl_polygon(x, y, x1, y1, x2, y2, x3, y3);
}
void go_fltk_xyline(int x, int y, int x1) {
fl_xyline(x, y, x1);
}
void go_fltk_xyline2(int x, int y, int x1, int y2) {
fl_xyline(x, y, x1, y2);
}
void go_fltk_xyline3(int x, int y, int x1, int y2, int x3) {
fl_xyline(x, y, x1, y2, x3);
}
void go_fltk_yxline(int x, int y, int y1) {
fl_yxline(x, y, y1);
}
void go_fltk_yxline2(int x, int y, int y1, int x2) {
fl_yxline(x, y, y1, x2);
}
void go_fltk_yxline3(int x, int y, int y1, int x2, int y3) {
fl_yxline(x, y, y1, x2, y3);
}
void go_fltk_arc(int x, int y, int w, int h, double a1, double a2) {
fl_arc(x, y, w, h, a1, a2);
}
void go_fltk_pie(int x, int y, int w, int h, double a1, double a2) {
fl_pie(x, y, w, h, a1, a2);
}
void go_fltk_push_matrix(void) {
fl_push_matrix();
}
void go_fltk_pop_matrix(void) {
fl_pop_matrix();
}
void go_fltk_scale(double x, double y) {
fl_scale(x, y);
}
void go_fltk_scale2(double x) {
fl_scale(x);
}
void go_fltk_translate(double x, double y) {
fl_translate(x, y);
}
void go_fltk_rotate(double d) {
fl_rotate(d);
}
void go_fltk_mult_matrix(double a, double b, double c, double d, double x, double y) {
fl_mult_matrix(a, b, c, d, x, y);
}
void go_fltk_begin_points(void) {
fl_begin_points();
}
void go_fltk_begin_line(void) {
fl_begin_line();
}
void go_fltk_begin_loop(void) {
fl_begin_loop();
}
void go_fltk_begin_polygon(void) {
fl_begin_polygon();
}
void go_fltk_vertex(double x, double y) {
fl_vertex(x, y);
}
void go_fltk_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3,
double Y3) {
fl_curve(X0, Y0, X1, Y1, X2, Y2, X3, Y3);
}
void go_fltk_arc2(double x, double y, double r, double start, double end) {
fl_arc(x, y, r, start, end);
}
void go_fltk_circle(double x, double y, double r) {
fl_circle(x, y, r);
}
void go_fltk_end_points(void) {
fl_end_points();
}
void go_fltk_end_line(void) {
fl_end_line();
}
void go_fltk_end_loop(void) {
fl_end_loop();
}
void go_fltk_end_polygon(void) {
fl_end_polygon();
}
void go_fltk_begin_complex_polygon(void) {
fl_begin_complex_polygon();
}
void go_fltk_gap(void) {
fl_gap();
}
void go_fltk_end_complex_polygon(void) {
fl_end_complex_polygon();
}
double go_fltk_transform_x(double x, double y) {
return fl_transform_x(x, y);
}
double go_fltk_transform_y(double x, double y) {
return fl_transform_y(x, y);
}
double go_fltk_transform_dx(double x, double y) {
return fl_transform_dx(x, y);
}
double go_fltk_transform_dy(double x, double y) {
return fl_transform_dy(x, y);
}
void go_fltk_transformed_vertex(double xf, double yf) {
fl_transformed_vertex(xf, yf);
}
int go_fltk_font(void) {
return fl_font();
}
int go_fltk_size(void) {
return fl_size();
}
int go_fltk_height(void) {
return fl_height();
}
int go_fltk_set_height(int font, int size) {
return fl_height(font, size);
}
int go_fltk_descent(void) {
return fl_descent();
}
double go_fltk_width(const char *txt) {
return fl_width(txt);
}
double go_fltk_width2(const char *txt, int n) {
return fl_width(txt, n);
}
double go_fltk_width3(unsigned int c) {
return fl_width(c);
}
void go_fltk_text_extents(const char *txt, int *dx, int *dy, int *w, int *h) {
return fl_text_extents(txt, *dx, *dy, *w, *h);
}
void go_fltk_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 *go_fltk_latin1_to_local(const char *t, int n) {
return fl_latin1_to_local(t, n);
}
const char *go_fltk_local_to_latin1(const char *t, int n) {
return fl_local_to_latin1(t, n);
}
const char *go_fltk_mac_roman_to_local(const char *t, int n) {
return fl_mac_roman_to_local(t, n);
}
const char *go_fltk_local_to_mac_roman(const char *t, int n) {
return fl_local_to_mac_roman(t, n);
}
void go_fltk_draw2(int angle, const char *str, int x, int y) {
fl_draw(angle, str, x, y);
}
void go_fltk_draw3(const char *str, int n, int x, int y) {
fl_draw(str, n, x, y);
}
void go_fltk_draw4(int angle, const char *str, int n, int x, int y) {
fl_draw(angle, str, n, x, y);
}
void go_fltk_rtl_draw(const char *str, int n, int x, int y) {
fl_rtl_draw(str, n, x, y);
}
void go_fltk_measure(const char *str, int *x, int *y, int draw_symbols) {
fl_measure(str, *x, *y, draw_symbols);
}
void go_fltk_draw5(const char *str, int x, int y, int w, int h, int align, void **img,
int draw_symbols) {
fl_draw(str, x, y, w, h, align, (Fl_Image *)*img, draw_symbols);
}
void go_fltk_frame(const char *s, int x, int y, int w, int h) {
fl_frame(s, x, y, w, h);
}
void go_fltk_frame2(const char *s, int x, int y, int w, int h) {
fl_frame2(s, x, y, w, h);
}
void go_fltk_draw_image(const unsigned char *buf, int X, int Y, int W, int H, int D, int L) {
fl_draw_image(buf, X, Y, W, H, D, L);
}
void go_fltk_draw_image_mono(const unsigned char *buf, int X, int Y, int W, int H, int D, int L) {
fl_draw_image_mono(buf, X, Y, W, H, D, L);
}
char go_fltk_can_do_alpha_blending(void) {
return fl_can_do_alpha_blending();
}
unsigned char *go_fltk_read_image(unsigned char *p, int X, int Y, int W, int H, int alpha) {
return fl_read_image(p, X, Y, W, H, alpha);
}
unsigned char *go_fltk_capture_window_part(void *win, int x, int y, int w, int h) {
Fl_RGB_Image *tmp = fl_capture_window((Fl_Window *)win, x, y, w, h);
return (unsigned char *)tmp->data();
}
int go_fltk_draw_pixmap(const char *const *data, int x, int y, int bg) {
return fl_draw_pixmap(data, x, y, bg);
}
int go_fltk_draw_pixmap2(/*const*/ char *const *data, int x, int y, int bg) {
return fl_draw_pixmap(data, x, y, bg);
}
int go_fltk_measure_pixmap(/*const*/ char *const *data, int *w, int *h) {
return fl_measure_pixmap(data, *w, *h);
}
int go_fltk_measure_pixmap2(const char *const *cdata, int *w, int *h) {
return fl_measure_pixmap(cdata, *w, *h);
}
const char *go_fltk_shortcut_label(unsigned int shortcut) {
return fl_shortcut_label(shortcut);
}
const char *go_fltk_shortcut_label2(unsigned int shortcut, const char **eom) {
return fl_shortcut_label(shortcut, eom);
}
unsigned int go_fltk_old_shortcut(const char *s) {
return fl_old_shortcut(s);
}
void go_fltk_overlay_rect(int x, int y, int w, int h) {
return fl_overlay_rect(x, y, w, h);
}
void go_fltk_overlay_clear(void) {
return fl_overlay_clear();
}
void go_fltk_set_cursor(int cursor) {
return fl_cursor((Fl_Cursor)cursor);
}
void go_fltk_set_cursor2(int cursor, int fg, int bg) {
return fl_cursor((Fl_Cursor)cursor, fg, bg);
}
const char *go_fltk_expand_text(const char *from, char *buf, int maxbuf, double maxw, int *n,
double *width, int wrap, int draw_symbols) {
return fl_expand_text(from, buf, maxbuf, maxw, *n, *width, wrap, draw_symbols);
}
void go_fltk_set_status(int X, int Y, int W, int H) {
fl_set_status(X, Y, W, H);
}
void go_fltk_set_spot(int font, int size, int X, int Y, int W, int H, void *win) {
fl_set_spot(font, size, X, Y, W, H, (Fl_Window *)win);
}
void go_fltk_reset_spot(void) {
fl_reset_spot();
}
void go_fltk_copy_offscreen(int x, int y, int w, int h, GOffscreen *pixmap, int srcx, int srcy) {
fl_copy_offscreen(x, y, w, h, (Fl_Offscreen)pixmap, srcx, srcy);
}
GOffscreen *go_fltk_create_offscreen(int w, int h) {
fl_open_display();
return (GOffscreen *)fl_create_offscreen(w, h);
}
void go_fltk_begin_offscreen(GOffscreen *b) {
fl_begin_offscreen((Fl_Offscreen)b);
}
void go_fltk_end_offscreen(void) {
fl_end_offscreen();
}
void go_fltk_delete_offscreen(GOffscreen *bitmap) {
fl_delete_offscreen((Fl_Offscreen)bitmap);
}
void go_fltk_rescale_offscreen(GOffscreen **ctx) {
fl_rescale_offscreen(*(Fl_Offscreen *)ctx);
}
void go_fltk_draw_text2(const char *str, int x, int y, int w, int h, int align) {
fl_draw(str, x, y, w, h, (Fl_Align)align, 0, 1);
}
void go_fltk_draw_check(int x, int y, int w, int h, unsigned int col) {
fl_draw_check(Fl_Rect(x, y, w, h), (Fl_Color)col);
}