summaryrefslogtreecommitdiff
path: root/src/fltk-devices-surface-paged-printers.adb
blob: 3e605c897e9d2ebf9f06d25f041f4af214736ed6 (plain)
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
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915


--  Programmed by Jedidiah Barber
--  Released into the public domain


with

    Interfaces.C.Strings;

use type

    Interfaces.C.int;


package body FLTK.Devices.Surface.Paged.Printers is


    ------------------------
    --  Functions From C  --
    ------------------------

    function new_fl_printer
        return Storage.Integer_Address;
    pragma Import (C, new_fl_printer, "new_fl_printer");
    pragma Inline (new_fl_printer);

    procedure free_fl_printer
           (D : in Storage.Integer_Address);
    pragma Import (C, free_fl_printer, "free_fl_printer");
    pragma Inline (free_fl_printer);




    function fl_printer_get_dialog_title
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_dialog_title, "fl_printer_get_dialog_title");
    pragma Inline (fl_printer_get_dialog_title);

    procedure fl_printer_set_dialog_title
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_dialog_title, "fl_printer_set_dialog_title");
    pragma Inline (fl_printer_set_dialog_title);

    function fl_printer_get_dialog_printer
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_dialog_printer, "fl_printer_get_dialog_printer");
    pragma Inline (fl_printer_get_dialog_printer);

    procedure fl_printer_set_dialog_printer
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_dialog_printer, "fl_printer_set_dialog_printer");
    pragma Inline (fl_printer_set_dialog_printer);

    function fl_printer_get_dialog_range
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_dialog_range, "fl_printer_get_dialog_range");
    pragma Inline (fl_printer_get_dialog_range);

    procedure fl_printer_set_dialog_range
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_dialog_range, "fl_printer_set_dialog_range");
    pragma Inline (fl_printer_set_dialog_range);

    function fl_printer_get_dialog_copies
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_dialog_copies, "fl_printer_get_dialog_copies");
    pragma Inline (fl_printer_get_dialog_copies);

    procedure fl_printer_set_dialog_copies
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_dialog_copies, "fl_printer_set_dialog_copies");
    pragma Inline (fl_printer_set_dialog_copies);

    function fl_printer_get_dialog_all
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_dialog_all, "fl_printer_get_dialog_all");
    pragma Inline (fl_printer_get_dialog_all);

    procedure fl_printer_set_dialog_all
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_dialog_all, "fl_printer_set_dialog_all");
    pragma Inline (fl_printer_set_dialog_all);

    function fl_printer_get_dialog_pages
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_dialog_pages, "fl_printer_get_dialog_pages");
    pragma Inline (fl_printer_get_dialog_pages);

    procedure fl_printer_set_dialog_pages
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_dialog_pages, "fl_printer_set_dialog_pages");
    pragma Inline (fl_printer_set_dialog_pages);

    function fl_printer_get_dialog_from
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_dialog_from, "fl_printer_get_dialog_from");
    pragma Inline (fl_printer_get_dialog_from);

    procedure fl_printer_set_dialog_from
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_dialog_from, "fl_printer_set_dialog_from");
    pragma Inline (fl_printer_set_dialog_from);

    function fl_printer_get_dialog_to
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_dialog_to, "fl_printer_get_dialog_to");
    pragma Inline (fl_printer_get_dialog_to);

    procedure fl_printer_set_dialog_to
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_dialog_to, "fl_printer_set_dialog_to");
    pragma Inline (fl_printer_set_dialog_to);

    function fl_printer_get_dialog_properties
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_dialog_properties, "fl_printer_get_dialog_properties");
    pragma Inline (fl_printer_get_dialog_properties);

    procedure fl_printer_set_dialog_properties
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_dialog_properties, "fl_printer_set_dialog_properties");
    pragma Inline (fl_printer_set_dialog_properties);

    function fl_printer_get_dialog_copyno
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_dialog_copyno, "fl_printer_get_dialog_copyno");
    pragma Inline (fl_printer_get_dialog_copyno);

    procedure fl_printer_set_dialog_copyno
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_dialog_copyno, "fl_printer_set_dialog_copyno");
    pragma Inline (fl_printer_set_dialog_copyno);

    function fl_printer_get_dialog_print_button
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_dialog_print_button, "fl_printer_get_dialog_print_button");
    pragma Inline (fl_printer_get_dialog_print_button);

    procedure fl_printer_set_dialog_print_button
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_dialog_print_button, "fl_printer_set_dialog_print_button");
    pragma Inline (fl_printer_set_dialog_print_button);

    function fl_printer_get_dialog_cancel_button
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_dialog_cancel_button, "fl_printer_get_dialog_cancel_button");
    pragma Inline (fl_printer_get_dialog_cancel_button);

    procedure fl_printer_set_dialog_cancel_button
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_dialog_cancel_button, "fl_printer_set_dialog_cancel_button");
    pragma Inline (fl_printer_set_dialog_cancel_button);

    function fl_printer_get_dialog_print_to_file
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_dialog_print_to_file, "fl_printer_get_dialog_print_to_file");
    pragma Inline (fl_printer_get_dialog_print_to_file);

    procedure fl_printer_set_dialog_print_to_file
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_dialog_print_to_file, "fl_printer_set_dialog_print_to_file");
    pragma Inline (fl_printer_set_dialog_print_to_file);

    function fl_printer_get_property_title
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_property_title, "fl_printer_get_property_title");
    pragma Inline (fl_printer_get_property_title);

    procedure fl_printer_set_property_title
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_property_title, "fl_printer_set_property_title");
    pragma Inline (fl_printer_set_property_title);

    function fl_printer_get_property_pagesize
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_property_pagesize, "fl_printer_get_property_pagesize");
    pragma Inline (fl_printer_get_property_pagesize);

    procedure fl_printer_set_property_pagesize
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_property_pagesize, "fl_printer_set_property_pagesize");
    pragma Inline (fl_printer_set_property_pagesize);

    function fl_printer_get_property_mode
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_property_mode, "fl_printer_get_property_mode");
    pragma Inline (fl_printer_get_property_mode);

    procedure fl_printer_set_property_mode
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_property_mode, "fl_printer_set_property_mode");
    pragma Inline (fl_printer_set_property_mode);

    function fl_printer_get_property_use
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_property_use, "fl_printer_get_property_use");
    pragma Inline (fl_printer_get_property_use);

    procedure fl_printer_set_property_use
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_property_use, "fl_printer_set_property_use");
    pragma Inline (fl_printer_set_property_use);

    function fl_printer_get_property_save
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_property_save, "fl_printer_get_property_save");
    pragma Inline (fl_printer_get_property_save);

    procedure fl_printer_set_property_save
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_property_save, "fl_printer_set_property_save");
    pragma Inline (fl_printer_set_property_save);

    function fl_printer_get_property_cancel
        return Interfaces.C.Strings.chars_ptr;
    pragma Import (C, fl_printer_get_property_cancel, "fl_printer_get_property_cancel");
    pragma Inline (fl_printer_get_property_cancel);

    procedure fl_printer_set_property_cancel
           (V : in Interfaces.C.Strings.chars_ptr);
    pragma Import (C, fl_printer_set_property_cancel, "fl_printer_set_property_cancel");
    pragma Inline (fl_printer_set_property_cancel);




    function fl_printer_start_job
           (D : in Storage.Integer_Address;
            C : in Interfaces.C.int)
        return Interfaces.C.int;
    pragma Import (C, fl_printer_start_job, "fl_printer_start_job");
    pragma Inline (fl_printer_start_job);

    function fl_printer_start_job2
           (D    : in     Storage.Integer_Address;
            C    : in     Interfaces.C.int;
            F, T :    out Interfaces.C.int)
        return Interfaces.C.int;
    pragma Import (C, fl_printer_start_job2, "fl_printer_start_job2");
    pragma Inline (fl_printer_start_job2);

    procedure fl_printer_end_job
           (D : in Storage.Integer_Address);
    pragma Import (C, fl_printer_end_job, "fl_printer_end_job");
    pragma Inline (fl_printer_end_job);

    function fl_printer_start_page
           (D : in Storage.Integer_Address)
        return Interfaces.C.int;
    pragma Import (C, fl_printer_start_page, "fl_printer_start_page");
    pragma Inline (fl_printer_start_page);

    function fl_printer_end_page
           (D : in Storage.Integer_Address)
        return Interfaces.C.int;
    pragma Import (C, fl_printer_end_page, "fl_printer_end_page");
    pragma Inline (fl_printer_end_page);




    procedure fl_printer_margins
           (D          : in     Storage.Integer_Address;
            L, T, R, B :    out Interfaces.C.int);
    pragma Import (C, fl_printer_margins, "fl_printer_margins");
    pragma Inline (fl_printer_margins);

    function fl_printer_printable_rect
           (D    : in     Storage.Integer_Address;
            W, H :    out Interfaces.C.int)
        return Interfaces.C.int;
    pragma Import (C, fl_printer_printable_rect, "fl_printer_printable_rect");
    pragma Inline (fl_printer_printable_rect);

    procedure fl_printer_get_origin
           (D    : in     Storage.Integer_Address;
            X, Y :    out Interfaces.C.int);
    pragma Import (C, fl_printer_get_origin, "fl_printer_get_origin");
    pragma Inline (fl_printer_get_origin);

    procedure fl_printer_set_origin
           (D    : in Storage.Integer_Address;
            X, Y : in Interfaces.C.int);
    pragma Import (C, fl_printer_set_origin, "fl_printer_set_origin");
    pragma Inline (fl_printer_set_origin);

    procedure fl_printer_rotate
           (D : in Storage.Integer_Address;
            R : in Interfaces.C.C_float);
    pragma Import (C, fl_printer_rotate, "fl_printer_rotate");
    pragma Inline (fl_printer_rotate);

    procedure fl_printer_scale
           (D    : in Storage.Integer_Address;
            X, Y : in Interfaces.C.C_float);
    pragma Import (C, fl_printer_scale, "fl_printer_scale");
    pragma Inline (fl_printer_scale);

    procedure fl_printer_translate
           (D    : in Storage.Integer_Address;
            X, Y : in Interfaces.C.int);
    pragma Import (C, fl_printer_translate, "fl_printer_translate");
    pragma Inline (fl_printer_translate);

    procedure fl_printer_untranslate
           (D : in Storage.Integer_Address);
    pragma Import (C, fl_printer_untranslate, "fl_printer_untranslate");
    pragma Inline (fl_printer_untranslate);




    procedure fl_printer_print_widget
           (D, I   : in Storage.Integer_Address;
            DX, DY : in Interfaces.C.int);
    pragma Import (C, fl_printer_print_widget, "fl_printer_print_widget");
    pragma Inline (fl_printer_print_widget);

    procedure fl_printer_print_window_part
           (D, I               : in Storage.Integer_Address;
            X, Y, W, H, DX, DY : in Interfaces.C.int);
    pragma Import (C, fl_printer_print_window_part, "fl_printer_print_window_part");
    pragma Inline (fl_printer_print_window_part);




    procedure fl_printer_set_current
           (D : in Storage.Integer_Address);
    pragma Import (C, fl_printer_set_current, "fl_printer_set_current");
    pragma Inline (fl_printer_set_current);




    -------------------
    --  Destructors  --
    -------------------

    procedure Finalize
           (This : in out Printer) is
    begin
        if This.Void_Ptr /= Null_Pointer and This.Needs_Dealloc then
            free_fl_printer (This.Void_Ptr);
            This.Void_Ptr := Null_Pointer;
        end if;
    end Finalize;


    procedure Finalize
           (This : in out Printer_Final_Controller)
    is
        use Interfaces.C.Strings;
    begin
        Free (Dialog_Title);
        Free (Dialog_Printer);
        Free (Dialog_Range);
        Free (Dialog_Copies);
        Free (Dialog_All);
        Free (Dialog_Pages);
        Free (Dialog_From);
        Free (Dialog_To);
        Free (Dialog_Properties);
        Free (Dialog_Copyno);
        Free (Dialog_Print_Button);
        Free (Dialog_Cancel_Button);
        Free (Dialog_Print_To_File);
        Free (Property_Title);
        Free (Property_Pagesize);
        Free (Property_Mode);
        Free (Property_Use);
        Free (Property_Save);
        Free (Property_Cancel);
    end Finalize;




    --------------------
    --  Constructors  --
    --------------------

    package body Forge is

        function Create
            return Printer is
        begin
            return This : Printer do
                This.Void_Ptr := new_fl_printer;
            end return;
        end Create;

        pragma Inline (Create);

    end Forge;




    -------------------------
    --  Static Attributes  --
    -------------------------

    function Get_Dialog_Title
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_dialog_title);
    end Get_Dialog_Title;


    procedure Set_Dialog_Title
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Dialog_Title);
        Dialog_Title := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_dialog_title (Dialog_Title);
    end Set_Dialog_Title;


    function Get_Dialog_Printer
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_dialog_printer);
    end Get_Dialog_Printer;


    procedure Set_Dialog_Printer
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Dialog_Printer);
        Dialog_Printer := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_dialog_printer (Dialog_Printer);
    end Set_Dialog_Printer;


    function Get_Dialog_Range
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_dialog_range);
    end Get_Dialog_Range;


    procedure Set_Dialog_Range
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Dialog_Range);
        Dialog_Range := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_dialog_range (Dialog_Range);
    end Set_Dialog_Range;


    function Get_Dialog_Copies
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_dialog_copies);
    end Get_Dialog_Copies;


    procedure Set_Dialog_Copies
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Dialog_Copies);
        Dialog_Copies := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_dialog_copies (Dialog_Copies);
    end Set_Dialog_Copies;


    function Get_Dialog_All
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_dialog_all);
    end Get_Dialog_All;


    procedure Set_Dialog_All
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Dialog_All);
        Dialog_All := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_dialog_all (Dialog_All);
    end Set_Dialog_All;


    function Get_Dialog_Pages
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_dialog_pages);
    end Get_Dialog_Pages;


    procedure Set_Dialog_Pages
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Dialog_Pages);
        Dialog_Pages := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_dialog_pages (Dialog_Pages);
    end Set_Dialog_Pages;


    function Get_Dialog_From
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_dialog_from);
    end Get_Dialog_From;


    procedure Set_Dialog_From
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Dialog_From);
        Dialog_From := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_dialog_from (Dialog_From);
    end Set_Dialog_From;


    function Get_Dialog_To
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_dialog_to);
    end Get_Dialog_To;


    procedure Set_Dialog_To
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Dialog_To);
        Dialog_To := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_dialog_to (Dialog_To);
    end Set_Dialog_To;


    function Get_Dialog_Properties
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_dialog_properties);
    end Get_Dialog_Properties;


    procedure Set_Dialog_Properties
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Dialog_Properties);
        Dialog_Properties := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_dialog_properties (Dialog_Properties);
    end Set_Dialog_Properties;


    function Get_Dialog_Number_Copies
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_dialog_copyno);
    end Get_Dialog_Number_Copies;


    procedure Set_Dialog_Number_Copies
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Dialog_Copyno);
        Dialog_Copyno := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_dialog_copyno (Dialog_Copyno);
    end Set_Dialog_Number_Copies;


    function Get_Dialog_Print_Button
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_dialog_print_button);
    end Get_Dialog_Print_Button;


    procedure Set_Dialog_Print_Button
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Dialog_Print_Button);
        Dialog_Print_Button := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_dialog_print_button (Dialog_Print_Button);
    end Set_Dialog_Print_Button;


    function Get_Dialog_Cancel_Button
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_dialog_cancel_button);
    end Get_Dialog_Cancel_Button;


    procedure Set_Dialog_Cancel_Button
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Dialog_Cancel_Button);
        Dialog_Cancel_Button := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_dialog_cancel_button (Dialog_Cancel_Button);
    end Set_Dialog_Cancel_Button;


    function Get_Dialog_Print_To_File
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_dialog_print_to_file);
    end Get_Dialog_Print_To_File;


    procedure Set_Dialog_Print_To_File
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Dialog_Print_To_File);
        Dialog_Print_To_File := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_dialog_print_to_file (Dialog_Print_To_File);
    end Set_Dialog_Print_To_File;


    function Get_Property_Title
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_property_title);
    end Get_Property_Title;


    procedure Set_Property_Title
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Property_Title);
        Property_Title := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_property_title (Property_Title);
    end Set_Property_Title;


    function Get_Property_Page_Size
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_property_pagesize);
    end Get_Property_Page_Size;


    procedure Set_Property_Page_Size
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Property_Pagesize);
        Property_Pagesize := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_property_pagesize (Property_Pagesize);
    end Set_Property_Page_Size;


    function Get_Property_Mode
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_property_mode);
    end Get_Property_Mode;


    procedure Set_Property_Mode
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Property_Mode);
        Property_Mode := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_property_mode (Property_Mode);
    end Set_Property_Mode;


    function Get_Property_Use
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_property_use);
    end Get_Property_Use;


    procedure Set_Property_Use
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Property_Use);
        Property_Use := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_property_use (Property_Use);
    end Set_Property_Use;


    function Get_Property_Save
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_property_save);
    end Get_Property_Save;


    procedure Set_Property_Save
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Property_Save);
        Property_Save := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_property_save (Property_Save);
    end Set_Property_Save;


    function Get_Property_Cancel
        return String is
    begin
        return Interfaces.C.Strings.Value (fl_printer_get_property_cancel);
    end Get_Property_Cancel;


    procedure Set_Property_Cancel
           (Value : in String) is
    begin
        Interfaces.C.Strings.Free (Property_Cancel);
        Property_Cancel := Interfaces.C.Strings.New_String (Value);
        fl_printer_set_property_cancel (Property_Cancel);
    end Set_Property_Cancel;




    -----------------------
    --  API Subprograms  --
    -----------------------

    function Get_Original_Driver
           (This : in out Printer)
        return FLTK.Devices.Graphics.Graphics_Driver_Reference is
    begin
        return raise Program_Error with "Won't be implemented until Graphics_Drivers taken care of";
    end Get_Original_Driver;




    procedure Start_Job
           (This  : in out Printer;
            Count : in     Natural := 0) is
    begin
        if fl_printer_start_job
            (This.Void_Ptr, Interfaces.C.int (Count)) /= 0
        then
            raise Page_Error;
        end if;
    end Start_Job;


    procedure Start_Job
           (This     : in out Printer;
            Count    : in     Natural := 0;
            From, To :    out Positive) is
    begin
        if fl_printer_start_job2
           (This.Void_Ptr,
            Interfaces.C.int (Count),
            Interfaces.C.int (From),
            Interfaces.C.int (To)) /= 0
        then
            raise Page_Error;
        end if;
    end Start_Job;


    procedure End_Job
           (This : in out Printer) is
    begin
        fl_printer_end_job (This.Void_Ptr);
    end End_Job;


    procedure Start_Page
           (This : in out Printer) is
    begin
        if fl_printer_start_page (This.Void_Ptr) /= 0 then
            raise Page_Error;
        end if;
    end Start_Page;


    procedure End_Page
           (This : in out Printer) is
    begin
        if fl_printer_end_page (This.Void_Ptr) /= 0 then
            raise Page_Error;
        end if;
    end End_Page;




    procedure Get_Margins
           (This                     : in     Printer;
            Left, Top, Right, Bottom :    out Integer) is
    begin
        fl_printer_margins
           (This.Void_Ptr,
            Interfaces.C.int (Left),
            Interfaces.C.int (Top),
            Interfaces.C.int (Right),
            Interfaces.C.int (Bottom));
    end Get_Margins;


    procedure Get_Printable_Rect
           (This : in     Printer;
            W, H :    out Integer) is
    begin
        if fl_printer_printable_rect
            (This.Void_Ptr, Interfaces.C.int (W), Interfaces.C.int (H)) /= 0
        then
            raise Page_Error;
        end if;
    end Get_Printable_Rect;


    procedure Get_Origin
           (This : in     Printer;
            X, Y :    out Integer) is
    begin
        fl_printer_get_origin (This.Void_Ptr, Interfaces.C.int (X), Interfaces.C.int (Y));
    end Get_Origin;


    procedure Set_Origin
           (This : in out Printer;
            X, Y : in     Integer) is
    begin
        fl_printer_set_origin
           (This.Void_Ptr,
            Interfaces.C.int (X),
            Interfaces.C.int (Y));
    end Set_Origin;


    procedure Rotate
           (This    : in out Printer;
            Degrees : in     Float) is
    begin
        fl_printer_rotate (This.Void_Ptr, Interfaces.C.C_float (Degrees));
    end Rotate;


    procedure Scale
           (This   : in out Printer;
            Factor : in     Float) is
    begin
        fl_printer_scale (This.Void_Ptr, Interfaces.C.C_float (Factor), 0.0);
    end Scale;


    procedure Scale
           (This               : in out Printer;
            Factor_X, Factor_Y : in     Float) is
    begin
        fl_printer_scale
           (This.Void_Ptr,
            Interfaces.C.C_float (Factor_X),
            Interfaces.C.C_float (Factor_Y));
    end Scale;


    procedure Translate
           (This             : in out Printer;
            Delta_X, Delta_Y : in     Integer) is
    begin
        fl_printer_translate
           (This.Void_Ptr,
            Interfaces.C.int (Delta_X),
            Interfaces.C.int (Delta_Y));
    end Translate;


    procedure Untranslate
           (This : in out Printer) is
    begin
        fl_printer_untranslate (This.Void_Ptr);
    end Untranslate;




    procedure Print_Widget
           (This               : in out Printer;
            Item               : in     FLTK.Widgets.Widget'Class;
            Offset_X, Offset_Y : in     Integer := 0) is
    begin
        fl_printer_print_widget
           (This.Void_Ptr,
            Wrapper (Item).Void_Ptr,
            Interfaces.C.int (Offset_X),
            Interfaces.C.int (Offset_Y));
    end Print_Widget;


    procedure Print_Window_Part
           (This               : in out Printer;
            Item               : in     FLTK.Widgets.Groups.Windows.Window'Class;
            X, Y, W, H         : in     Integer;
            Offset_X, Offset_Y : in     Integer := 0) is
    begin
        fl_printer_print_window_part
           (This.Void_Ptr,
            Wrapper (Item).Void_Ptr,
            Interfaces.C.int (X),
            Interfaces.C.int (Y),
            Interfaces.C.int (W),
            Interfaces.C.int (H),
            Interfaces.C.int (Offset_X),
            Interfaces.C.int (Offset_Y));
    end Print_Window_Part;




    procedure Set_Current
           (This : in out Printer) is
    begin
        fl_printer_set_current (This.Void_Ptr);
        This.Set_Current_Bookkeep;
    end Set_Current;


end FLTK.Devices.Surface.Paged.Printers;