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
|
-- Programmed by Jedidiah Barber
-- Released into the public domain
with
Ada.Assertions,
FLTK.Static,
Interfaces.C;
use type
FLTK.Static.Box_Draw_Function;
package body FLTK.Box_Draw_Marshal is
package Chk renames Ada.Assertions;
C_Ptr_Array : array (Box_Kind) of Storage.Integer_Address;
Ada_Access_Array : array (Box_Kind) of FLTK.Static.Box_Draw_Function;
procedure fl_static_box_draw_marshal
(F : in Storage.Integer_Address;
X, Y, W, H : in Interfaces.C.int;
T : in Interfaces.C.unsigned);
pragma Import (C, fl_static_box_draw_marshal, "fl_static_box_draw_marshal");
pragma Inline (fl_static_box_draw_marshal);
generic
Kind : Box_Kind;
procedure Generic_Box_Draw
(X, Y, W, H : in Integer;
Tone : in Color)
with Inline;
procedure Generic_Box_Draw
(X, Y, W, H : in Integer;
Tone : in Color) is
begin
fl_static_box_draw_marshal
(C_Ptr_Array (Kind),
Interfaces.C.int (X),
Interfaces.C.int (Y),
Interfaces.C.int (W),
Interfaces.C.int (H),
Interfaces.C.unsigned (Tone));
end Generic_Box_Draw;
procedure No_Box_Draw is new Generic_Box_Draw (No_Box);
procedure Flat_Box_Draw is new Generic_Box_Draw (Flat_Box);
procedure Up_Box_Draw is new Generic_Box_Draw (Up_Box);
procedure Down_Box_Draw is new Generic_Box_Draw (Down_Box);
procedure Up_Frame_Draw is new Generic_Box_Draw (Up_Frame);
procedure Down_Frame_Draw is new Generic_Box_Draw (Down_Frame);
procedure Thin_Up_Box_Draw is new Generic_Box_Draw (Thin_Up_Box);
procedure Thin_Down_Box_Draw is new Generic_Box_Draw (Thin_Down_Box);
procedure Thin_Up_Frame_Draw is new Generic_Box_Draw (Thin_Up_Frame);
procedure Thin_Down_Frame_Draw is new Generic_Box_Draw (Thin_Down_Frame);
procedure Engraved_Box_Draw is new Generic_Box_Draw (Engraved_Box);
procedure Embossed_Box_Draw is new Generic_Box_Draw (Embossed_Box);
procedure Engraved_Frame_Draw is new Generic_Box_Draw (Engraved_Frame);
procedure Embossed_Frame_Draw is new Generic_Box_Draw (Embossed_Frame);
procedure Border_Box_Draw is new Generic_Box_Draw (Border_Box);
procedure Shadow_Box_Draw is new Generic_Box_Draw (Shadow_Box);
procedure Border_Frame_Draw is new Generic_Box_Draw (Border_Frame);
procedure Shadow_Frame_Draw is new Generic_Box_Draw (Shadow_Frame);
procedure Rounded_Box_Draw is new Generic_Box_Draw (Rounded_Box);
procedure RShadow_Box_Draw is new Generic_Box_Draw (RShadow_Box);
procedure Rounded_Frame_Draw is new Generic_Box_Draw (Rounded_Frame);
procedure RFlat_Box_Draw is new Generic_Box_Draw (RFlat_Box);
procedure Round_Up_Box_Draw is new Generic_Box_Draw (Round_Up_Box);
procedure Round_Down_Box_Draw is new Generic_Box_Draw (Round_Down_Box);
procedure Diamond_Up_Box_Draw is new Generic_Box_Draw (Diamond_Up_Box);
procedure Diamond_Down_Box_Draw is new Generic_Box_Draw (Diamond_Down_Box);
procedure Oval_Box_Draw is new Generic_Box_Draw (Oval_Box);
procedure OShadow_Box_Draw is new Generic_Box_Draw (OShadow_Box);
procedure Oval_Frame_Draw is new Generic_Box_Draw (Oval_Frame);
procedure OFlat_Box_Draw is new Generic_Box_Draw (OFlat_Box);
procedure Plastic_Up_Box_Draw is new Generic_Box_Draw (Plastic_Up_Box);
procedure Plastic_Down_Box_Draw is new Generic_Box_Draw (Plastic_Down_Box);
procedure Plastic_Up_Frame_Draw is new Generic_Box_Draw (Plastic_Up_Frame);
procedure Plastic_Down_Frame_Draw is new Generic_Box_Draw (Plastic_Down_Frame);
procedure Plastic_Thin_Up_Box_Draw is new Generic_Box_Draw (Plastic_Thin_Up_Box);
procedure Plastic_Thin_Down_Box_Draw is new Generic_Box_Draw (Plastic_Thin_Down_Box);
procedure Plastic_Round_Up_Box_Draw is new Generic_Box_Draw (Plastic_Round_Up_Box);
procedure Plastic_Round_Down_Box_Draw is new Generic_Box_Draw (Plastic_Round_Down_Box);
procedure Gtk_Up_Box_Draw is new Generic_Box_Draw (Gtk_Up_Box);
procedure Gtk_Down_Box_Draw is new Generic_Box_Draw (Gtk_Down_Box);
procedure Gtk_Up_Frame_Draw is new Generic_Box_Draw (Gtk_Up_Frame);
procedure Gtk_Down_Frame_Draw is new Generic_Box_Draw (Gtk_Down_Frame);
procedure Gtk_Thin_Up_Box_Draw is new Generic_Box_Draw (Gtk_Thin_Up_Box);
procedure Gtk_Thin_Down_Box_Draw is new Generic_Box_Draw (Gtk_Thin_Down_Box);
procedure Gtk_Thin_Up_Frame_Draw is new Generic_Box_Draw (Gtk_Thin_Up_Frame);
procedure Gtk_Thin_Down_Frame_Draw is new Generic_Box_Draw (Gtk_Thin_Down_Frame);
procedure Gtk_Round_Up_Box_Draw is new Generic_Box_Draw (Gtk_Round_Up_Box);
procedure Gtk_Round_Down_Box_Draw is new Generic_Box_Draw (Gtk_Round_Down_Box);
procedure Gleam_Up_Box_Draw is new Generic_Box_Draw (Gleam_Up_Box);
procedure Gleam_Down_Box_Draw is new Generic_Box_Draw (Gleam_Down_Box);
procedure Gleam_Up_Frame_Draw is new Generic_Box_Draw (Gleam_Up_Frame);
procedure Gleam_Down_Frame_Draw is new Generic_Box_Draw (Gleam_Down_Frame);
procedure Gleam_Thin_Up_Box_Draw is new Generic_Box_Draw (Gleam_Thin_Up_Box);
procedure Gleam_Thin_Down_Box_Draw is new Generic_Box_Draw (Gleam_Thin_Down_Box);
procedure Gleam_Round_Up_Box_Draw is new Generic_Box_Draw (Gleam_Round_Up_Box);
procedure Gleam_Round_Down_Box_Draw is new Generic_Box_Draw (Gleam_Round_Down_Box);
procedure Free_Box_Draw is new Generic_Box_Draw (Free_Box);
generic
Kind : Box_Kind;
procedure Generic_Box_Draw_Hook
(X, Y, W, H : in Interfaces.C.int;
Tone : in Interfaces.C.unsigned)
with Inline, Convention => C;
procedure Generic_Box_Draw_Hook
(X, Y, W, H : in Interfaces.C.int;
Tone : in Interfaces.C.unsigned) is
begin
pragma Assert (Ada_Access_Array (Kind) /= null);
Ada_Access_Array (Kind)
(Integer (X), Integer (Y),
Integer (W), Integer (H),
Color (Tone));
exception
when Chk.Assertion_Error => raise Internal_FLTK_Error with
"Box_Draw_Function hook tried to get a null subprogram access";
end Generic_Box_Draw_Hook;
procedure No_Box_Hook is new Generic_Box_Draw_Hook (No_Box);
procedure Flat_Box_Hook is new Generic_Box_Draw_Hook (Flat_Box);
procedure Up_Box_Hook is new Generic_Box_Draw_Hook (Up_Box);
procedure Down_Box_Hook is new Generic_Box_Draw_Hook (Down_Box);
procedure Up_Frame_Hook is new Generic_Box_Draw_Hook (Up_Frame);
procedure Down_Frame_Hook is new Generic_Box_Draw_Hook (Down_Frame);
procedure Thin_Up_Box_Hook is new Generic_Box_Draw_Hook (Thin_Up_Box);
procedure Thin_Down_Box_Hook is new Generic_Box_Draw_Hook (Thin_Down_Box);
procedure Thin_Up_Frame_Hook is new Generic_Box_Draw_Hook (Thin_Up_Frame);
procedure Thin_Down_Frame_Hook is new Generic_Box_Draw_Hook (Thin_Down_Frame);
procedure Engraved_Box_Hook is new Generic_Box_Draw_Hook (Engraved_Box);
procedure Embossed_Box_Hook is new Generic_Box_Draw_Hook (Embossed_Box);
procedure Engraved_Frame_Hook is new Generic_Box_Draw_Hook (Engraved_Frame);
procedure Embossed_Frame_Hook is new Generic_Box_Draw_Hook (Embossed_Frame);
procedure Border_Box_Hook is new Generic_Box_Draw_Hook (Border_Box);
procedure Shadow_Box_Hook is new Generic_Box_Draw_Hook (Shadow_Box);
procedure Border_Frame_Hook is new Generic_Box_Draw_Hook (Border_Frame);
procedure Shadow_Frame_Hook is new Generic_Box_Draw_Hook (Shadow_Frame);
procedure Rounded_Box_Hook is new Generic_Box_Draw_Hook (Rounded_Box);
procedure RShadow_Box_Hook is new Generic_Box_Draw_Hook (RShadow_Box);
procedure Rounded_Frame_Hook is new Generic_Box_Draw_Hook (Rounded_Frame);
procedure RFlat_Box_Hook is new Generic_Box_Draw_Hook (RFlat_Box);
procedure Round_Up_Box_Hook is new Generic_Box_Draw_Hook (Round_Up_Box);
procedure Round_Down_Box_Hook is new Generic_Box_Draw_Hook (Round_Down_Box);
procedure Diamond_Up_Box_Hook is new Generic_Box_Draw_Hook (Diamond_Up_Box);
procedure Diamond_Down_Box_Hook is new Generic_Box_Draw_Hook (Diamond_Down_Box);
procedure Oval_Box_Hook is new Generic_Box_Draw_Hook (Oval_Box);
procedure OShadow_Box_Hook is new Generic_Box_Draw_Hook (OShadow_Box);
procedure Oval_Frame_Hook is new Generic_Box_Draw_Hook (Oval_Frame);
procedure OFlat_Box_Hook is new Generic_Box_Draw_Hook (OFlat_Box);
procedure Plastic_Up_Box_Hook is new Generic_Box_Draw_Hook (Plastic_Up_Box);
procedure Plastic_Down_Box_Hook is new Generic_Box_Draw_Hook (Plastic_Down_Box);
procedure Plastic_Up_Frame_Hook is new Generic_Box_Draw_Hook (Plastic_Up_Frame);
procedure Plastic_Down_Frame_Hook is new Generic_Box_Draw_Hook (Plastic_Down_Frame);
procedure Plastic_Thin_Up_Box_Hook is new Generic_Box_Draw_Hook (Plastic_Thin_Up_Box);
procedure Plastic_Thin_Down_Box_Hook is new Generic_Box_Draw_Hook (Plastic_Thin_Down_Box);
procedure Plastic_Round_Up_Box_Hook is new Generic_Box_Draw_Hook (Plastic_Round_Up_Box);
procedure Plastic_Round_Down_Box_Hook is new Generic_Box_Draw_Hook (Plastic_Round_Down_Box);
procedure Gtk_Up_Box_Hook is new Generic_Box_Draw_Hook (Gtk_Up_Box);
procedure Gtk_Down_Box_Hook is new Generic_Box_Draw_Hook (Gtk_Down_Box);
procedure Gtk_Up_Frame_Hook is new Generic_Box_Draw_Hook (Gtk_Up_Frame);
procedure Gtk_Down_Frame_Hook is new Generic_Box_Draw_Hook (Gtk_Down_Frame);
procedure Gtk_Thin_Up_Box_Hook is new Generic_Box_Draw_Hook (Gtk_Thin_Up_Box);
procedure Gtk_Thin_Down_Box_Hook is new Generic_Box_Draw_Hook (Gtk_Thin_Down_Box);
procedure Gtk_Thin_Up_Frame_Hook is new Generic_Box_Draw_Hook (Gtk_Thin_Up_Frame);
procedure Gtk_Thin_Down_Frame_Hook is new Generic_Box_Draw_Hook (Gtk_Thin_Down_Frame);
procedure Gtk_Round_Up_Box_Hook is new Generic_Box_Draw_Hook (Gtk_Round_Up_Box);
procedure Gtk_Round_Down_Box_Hook is new Generic_Box_Draw_Hook (Gtk_Round_Down_Box);
procedure Gleam_Up_Box_Hook is new Generic_Box_Draw_Hook (Gleam_Up_Box);
procedure Gleam_Down_Box_Hook is new Generic_Box_Draw_Hook (Gleam_Down_Box);
procedure Gleam_Up_Frame_Hook is new Generic_Box_Draw_Hook (Gleam_Up_Frame);
procedure Gleam_Down_Frame_Hook is new Generic_Box_Draw_Hook (Gleam_Down_Frame);
procedure Gleam_Thin_Up_Box_Hook is new Generic_Box_Draw_Hook (Gleam_Thin_Up_Box);
procedure Gleam_Thin_Down_Box_Hook is new Generic_Box_Draw_Hook (Gleam_Thin_Down_Box);
procedure Gleam_Round_Up_Box_Hook is new Generic_Box_Draw_Hook (Gleam_Round_Up_Box);
procedure Gleam_Round_Down_Box_Hook is new Generic_Box_Draw_Hook (Gleam_Round_Down_Box);
procedure Free_Box_Hook is new Generic_Box_Draw_Hook (Free_Box);
function To_Ada
(Kind : in Box_Kind;
Ptr : in Storage.Integer_Address)
return FLTK.Static.Box_Draw_Function is
begin
if Ptr = Null_Pointer then
return null;
end if;
C_Ptr_Array (Kind) := Ptr;
case Kind is
when No_Box => return
(if Ptr = Storage.To_Integer (No_Box_Hook'Address)
then Ada_Access_Array (Kind)
else No_Box_Draw'Access);
when Flat_Box => return
(if Ptr = Storage.To_Integer (Flat_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Flat_Box_Draw'Access);
when Up_Box => return
(if Ptr = Storage.To_Integer (Up_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Up_Box_Draw'Access);
when Down_Box => return
(if Ptr = Storage.To_Integer (Down_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Down_Box_Draw'Access);
when Up_Frame => return
(if Ptr = Storage.To_Integer (Up_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Up_Frame_Draw'Access);
when Down_Frame => return
(if Ptr = Storage.To_Integer (Down_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Down_Frame_Draw'Access);
when Thin_Up_Box => return
(if Ptr = Storage.To_Integer (Thin_Up_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Thin_Up_Box_Draw'Access);
when Thin_Down_Box => return
(if Ptr = Storage.To_Integer (Thin_Down_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Thin_Down_Box_Draw'Access);
when Thin_Up_Frame => return
(if Ptr = Storage.To_Integer (Thin_Up_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Thin_Up_Frame_Draw'Access);
when Thin_Down_Frame => return
(if Ptr = Storage.To_Integer (Thin_Down_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Thin_Down_Frame_Draw'Access);
when Engraved_Box => return
(if Ptr = Storage.To_Integer (Engraved_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Engraved_Box_Draw'Access);
when Embossed_Box => return
(if Ptr = Storage.To_Integer (Embossed_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Embossed_Box_Draw'Access);
when Engraved_Frame => return
(if Ptr = Storage.To_Integer (Engraved_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Engraved_Frame_Draw'Access);
when Embossed_Frame => return
(if Ptr = Storage.To_Integer (Embossed_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Embossed_Frame_Draw'Access);
when Border_Box => return
(if Ptr = Storage.To_Integer (Border_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Border_Box_Draw'Access);
when Shadow_Box => return
(if Ptr = Storage.To_Integer (Shadow_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Shadow_Box_Draw'Access);
when Border_Frame => return
(if Ptr = Storage.To_Integer (Border_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Border_Frame_Draw'Access);
when Shadow_Frame => return
(if Ptr = Storage.To_Integer (Shadow_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Shadow_Frame_Draw'Access);
when Rounded_Box => return
(if Ptr = Storage.To_Integer (Rounded_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Rounded_Box_Draw'Access);
when RShadow_Box => return
(if Ptr = Storage.To_Integer (RShadow_Box_Hook'Address)
then Ada_Access_Array (Kind)
else RShadow_Box_Draw'Access);
when Rounded_Frame => return
(if Ptr = Storage.To_Integer (Rounded_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Rounded_Frame_Draw'Access);
when RFlat_Box => return
(if Ptr = Storage.To_Integer (RFlat_Box_Hook'Address)
then Ada_Access_Array (Kind)
else RFlat_Box_Draw'Access);
when Round_Up_Box => return
(if Ptr = Storage.To_Integer (Round_Up_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Round_Up_Box_Draw'Access);
when Round_Down_Box => return
(if Ptr = Storage.To_Integer (Round_Down_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Round_Down_Box_Draw'Access);
when Diamond_Up_Box => return
(if Ptr = Storage.To_Integer (Diamond_Up_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Diamond_Up_Box_Draw'Access);
when Diamond_Down_Box => return
(if Ptr = Storage.To_Integer (Diamond_Down_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Diamond_Down_Box_Draw'Access);
when Oval_Box => return
(if Ptr = Storage.To_Integer (Oval_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Oval_Box_Draw'Access);
when OShadow_Box => return
(if Ptr = Storage.To_Integer (OShadow_Box_Hook'Address)
then Ada_Access_Array (Kind)
else OShadow_Box_Draw'Access);
when Oval_Frame => return
(if Ptr = Storage.To_Integer (Oval_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Oval_Frame_Draw'Access);
when OFlat_Box => return
(if Ptr = Storage.To_Integer (OFlat_Box_Hook'Address)
then Ada_Access_Array (Kind)
else OFlat_Box_Draw'Access);
when Plastic_Up_Box => return
(if Ptr = Storage.To_Integer (Plastic_Up_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Plastic_Up_Box_Draw'Access);
when Plastic_Down_Box => return
(if Ptr = Storage.To_Integer (Plastic_Down_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Plastic_Down_Box_Draw'Access);
when Plastic_Up_Frame => return
(if Ptr = Storage.To_Integer (Plastic_Up_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Plastic_Up_Frame_Draw'Access);
when Plastic_Down_Frame => return
(if Ptr = Storage.To_Integer (Plastic_Down_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Plastic_Down_Frame_Draw'Access);
when Plastic_Thin_Up_Box => return
(if Ptr = Storage.To_Integer (Plastic_Thin_Up_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Plastic_Thin_Up_Box_Draw'Access);
when Plastic_Thin_Down_Box => return
(if Ptr = Storage.To_Integer (Plastic_Thin_Down_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Plastic_Thin_Down_Box_Draw'Access);
when Plastic_Round_Up_Box => return
(if Ptr = Storage.To_Integer (Plastic_Round_Up_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Plastic_Round_Up_Box_Draw'Access);
when Plastic_Round_Down_Box => return
(if Ptr = Storage.To_Integer (Plastic_Round_Down_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Plastic_Round_Down_Box_Draw'Access);
when Gtk_Up_Box => return
(if Ptr = Storage.To_Integer (Gtk_Up_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Gtk_Up_Box_Draw'Access);
when Gtk_Down_Box => return
(if Ptr = Storage.To_Integer (Gtk_Down_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Gtk_Down_Box_Draw'Access);
when Gtk_Up_Frame => return
(if Ptr = Storage.To_Integer (Gtk_Up_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Gtk_Up_Frame_Draw'Access);
when Gtk_Down_Frame => return
(if Ptr = Storage.To_Integer (Gtk_Down_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Gtk_Down_Frame_Draw'Access);
when Gtk_Thin_Up_Box => return
(if Ptr = Storage.To_Integer (Gtk_Thin_Up_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Gtk_Thin_Up_Box_Draw'Access);
when Gtk_Thin_Down_Box => return
(if Ptr = Storage.To_Integer (Gtk_Thin_Down_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Gtk_Thin_Down_Box_Draw'Access);
when Gtk_Thin_Up_Frame => return
(if Ptr = Storage.To_Integer (Gtk_Thin_Up_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Gtk_Thin_Up_Frame_Draw'Access);
when Gtk_Thin_Down_Frame => return
(if Ptr = Storage.To_Integer (Gtk_Thin_Down_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Gtk_Thin_Down_Frame_Draw'Access);
when Gtk_Round_Up_Box => return
(if Ptr = Storage.To_Integer (Gtk_Round_Up_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Gtk_Round_Up_Box_Draw'Access);
when Gtk_Round_Down_Box => return
(if Ptr = Storage.To_Integer (Gtk_Round_Down_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Gtk_Round_Down_Box_Draw'Access);
when Gleam_Up_Box => return
(if Ptr = Storage.To_Integer (Gleam_Up_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Gleam_Up_Box_Draw'Access);
when Gleam_Down_Box => return
(if Ptr = Storage.To_Integer (Gleam_Down_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Gleam_Down_Box_Draw'Access);
when Gleam_Up_Frame => return
(if Ptr = Storage.To_Integer (Gleam_Up_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Gleam_Up_Frame_Draw'Access);
when Gleam_Down_Frame => return
(if Ptr = Storage.To_Integer (Gleam_Down_Frame_Hook'Address)
then Ada_Access_Array (Kind)
else Gleam_Down_Frame_Draw'Access);
when Gleam_Thin_Up_Box => return
(if Ptr = Storage.To_Integer (Gleam_Thin_Up_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Gleam_Thin_Up_Box_Draw'Access);
when Gleam_Thin_Down_Box => return
(if Ptr = Storage.To_Integer (Gleam_Thin_Down_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Gleam_Thin_Down_Box_Draw'Access);
when Gleam_Round_Up_Box => return
(if Ptr = Storage.To_Integer (Gleam_Round_Up_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Gleam_Round_Up_Box_Draw'Access);
when Gleam_Round_Down_Box => return
(if Ptr = Storage.To_Integer (Gleam_Round_Down_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Gleam_Round_Down_Box_Draw'Access);
when Free_Box => return
(if Ptr = Storage.To_Integer (Free_Box_Hook'Address)
then Ada_Access_Array (Kind)
else Free_Box_Draw'Access);
end case;
end To_Ada;
function To_C
(Kind : in Box_Kind;
Func : in FLTK.Static.Box_Draw_Function)
return Storage.Integer_Address is
begin
if Func = null then
return Null_Pointer;
end if;
Ada_Access_Array (Kind) := Func;
case Kind is
when No_Box => return
(if Func = No_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (No_Box_Hook'Address));
when Flat_Box => return
(if Func = Flat_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Flat_Box_Hook'Address));
when Up_Box => return
(if Func = Up_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Up_Box_Hook'Address));
when Down_Box => return
(if Func = Down_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Down_Box_Hook'Address));
when Up_Frame => return
(if Func = Up_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Up_Frame_Hook'Address));
when Down_Frame => return
(if Func = Down_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Down_Frame_Hook'Address));
when Thin_Up_Box => return
(if Func = Thin_Up_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Thin_Up_Box_Hook'Address));
when Thin_Down_Box => return
(if Func = Thin_Down_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Thin_Down_Box_Hook'Address));
when Thin_Up_Frame => return
(if Func = Thin_Up_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Thin_Up_Frame_Hook'Address));
when Thin_Down_Frame => return
(if Func = Thin_Down_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Thin_Down_Frame_Hook'Address));
when Engraved_Box => return
(if Func = Engraved_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Engraved_Box_Hook'Address));
when Embossed_Box => return
(if Func = Embossed_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Embossed_Box_Hook'Address));
when Engraved_Frame => return
(if Func = Engraved_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Engraved_Frame_Hook'Address));
when Embossed_Frame => return
(if Func = Embossed_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Embossed_Frame_Hook'Address));
when Border_Box => return
(if Func = Border_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Border_Box_Hook'Address));
when Shadow_Box => return
(if Func = Shadow_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Shadow_Box_Hook'Address));
when Border_Frame => return
(if Func = Border_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Border_Frame_Hook'Address));
when Shadow_Frame => return
(if Func = Shadow_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Shadow_Frame_Hook'Address));
when Rounded_Box => return
(if Func = Rounded_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Rounded_Box_Hook'Address));
when RShadow_Box => return
(if Func = RShadow_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (RShadow_Box_Hook'Address));
when Rounded_Frame => return
(if Func = Rounded_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Rounded_Frame_Hook'Address));
when RFlat_Box => return
(if Func = RFlat_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (RFlat_Box_Hook'Address));
when Round_Up_Box => return
(if Func = Round_Up_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Round_Up_Box_Hook'Address));
when Round_Down_Box => return
(if Func = Round_Down_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Round_Down_Box_Hook'Address));
when Diamond_Up_Box => return
(if Func = Diamond_Up_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Diamond_Up_Box_Hook'Address));
when Diamond_Down_Box => return
(if Func = Diamond_Down_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Diamond_Down_Box_Hook'Address));
when Oval_Box => return
(if Func = Oval_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Oval_Box_Hook'Address));
when OShadow_Box => return
(if Func = OShadow_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (OShadow_Box_Hook'Address));
when Oval_Frame => return
(if Func = Oval_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Oval_Frame_Hook'Address));
when OFlat_Box => return
(if Func = OFlat_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (OFlat_Box_Hook'Address));
when Plastic_Up_Box => return
(if Func = Plastic_Up_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Plastic_Up_Box_Hook'Address));
when Plastic_Down_Box => return
(if Func = Plastic_Down_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Plastic_Down_Box_Hook'Address));
when Plastic_Up_Frame => return
(if Func = Plastic_Up_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Plastic_Up_Frame_Hook'Address));
when Plastic_Down_Frame => return
(if Func = Plastic_Down_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Plastic_Down_Frame_Hook'Address));
when Plastic_Thin_Up_Box => return
(if Func = Plastic_Thin_Up_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Plastic_Thin_Up_Box_Hook'Address));
when Plastic_Thin_Down_Box => return
(if Func = Plastic_Thin_Down_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Plastic_Thin_Down_Box_Hook'Address));
when Plastic_Round_Up_Box => return
(if Func = Plastic_Round_Up_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Plastic_Round_Up_Box_Hook'Address));
when Plastic_Round_Down_Box => return
(if Func = Plastic_Round_Down_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Plastic_Round_Down_Box_Hook'Address));
when Gtk_Up_Box => return
(if Func = Gtk_Up_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gtk_Up_Box_Hook'Address));
when Gtk_Down_Box => return
(if Func = Gtk_Down_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gtk_Down_Box_Hook'Address));
when Gtk_Up_Frame => return
(if Func = Gtk_Up_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gtk_Up_Frame_Hook'Address));
when Gtk_Down_Frame => return
(if Func = Gtk_Down_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gtk_Down_Frame_Hook'Address));
when Gtk_Thin_Up_Box => return
(if Func = Gtk_Thin_Up_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gtk_Thin_Up_Box_Hook'Address));
when Gtk_Thin_Down_Box => return
(if Func = Gtk_Thin_Down_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gtk_Thin_Down_Box_Hook'Address));
when Gtk_Thin_Up_Frame => return
(if Func = Gtk_Thin_Up_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gtk_Thin_Up_Frame_Hook'Address));
when Gtk_Thin_Down_Frame => return
(if Func = Gtk_Thin_Down_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gtk_Thin_Down_Frame_Hook'Address));
when Gtk_Round_Up_Box => return
(if Func = Gtk_Round_Up_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gtk_Round_Up_Box_Hook'Address));
when Gtk_Round_Down_Box => return
(if Func = Gtk_Round_Down_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gtk_Round_Down_Box_Hook'Address));
when Gleam_Up_Box => return
(if Func = Gleam_Up_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gleam_Up_Box_Hook'Address));
when Gleam_Down_Box => return
(if Func = Gleam_Down_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gleam_Down_Box_Hook'Address));
when Gleam_Up_Frame => return
(if Func = Gleam_Up_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gleam_Up_Frame_Hook'Address));
when Gleam_Down_Frame => return
(if Func = Gleam_Down_Frame_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gleam_Down_Frame_Hook'Address));
when Gleam_Thin_Up_Box => return
(if Func = Gleam_Thin_Up_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gleam_Thin_Up_Box_Hook'Address));
when Gleam_Thin_Down_Box => return
(if Func = Gleam_Thin_Down_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gleam_Thin_Down_Box_Hook'Address));
when Gleam_Round_Up_Box => return
(if Func = Gleam_Round_Up_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gleam_Round_Up_Box_Hook'Address));
when Gleam_Round_Down_Box => return
(if Func = Gleam_Round_Down_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Gleam_Round_Down_Box_Hook'Address));
when Free_Box => return
(if Func = Free_Box_Draw'Access
then C_Ptr_Array (Kind)
else Storage.To_Integer (Free_Box_Hook'Address));
end case;
end To_C;
end FLTK.Box_Draw_Marshal;
|