summaryrefslogtreecommitdiff
path: root/src/c_fl_postscript_file_device.cpp
blob: 22495dd012af8cd615335e96058a1ea4d1558fa8 (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


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


#include <FL/Fl_PostScript.H>
#include "c_fl_postscript_file_device.h"




//  Making available protected methods

class My_PostScript_File_Device : Fl_PostScript_File_Device {
public:
    using Fl_PostScript_File_Device::driver;
};




//  Flattened C API

POSTSCRIPTFILEDEVICE new_fl_postscript_file_device(void) {
    Fl_PostScript_File_Device *p = new Fl_PostScript_File_Device();
    return p;
}

void free_fl_postscript_file_device(POSTSCRIPTFILEDEVICE p) {
    delete reinterpret_cast<Fl_PostScript_File_Device*>(p);
}




const char * fl_postscript_file_device_get_file_chooser_title() {
    return Fl_PostScript_File_Device::file_chooser_title;
}

void fl_postscript_file_device_set_file_chooser_title(const char * v) {
    Fl_PostScript_File_Device::file_chooser_title = v;
}




void * fl_postscript_file_device_get_driver(POSTSCRIPTFILEDEVICE p) {
    return (reinterpret_cast<Fl_PostScript_File_Device*>(p)->*(&My_PostScript_File_Device::driver))();
}




int fl_postscript_file_device_start_job(POSTSCRIPTFILEDEVICE p, int c) {
    return reinterpret_cast<Fl_PostScript_File_Device*>(p)->start_job(c, 0, 0);
}

int fl_postscript_file_device_start_job2(POSTSCRIPTFILEDEVICE p, int c, int * f, int * t) {
    return reinterpret_cast<Fl_PostScript_File_Device*>(p)->start_job(c, f, t);
}

int fl_postscript_file_device_start_job3(POSTSCRIPTFILEDEVICE p, void * o, int c, int f, int l) {
    return reinterpret_cast<Fl_PostScript_File_Device*>(p)->start_job
        (reinterpret_cast<FILE*>(o),
         c,
         static_cast<Fl_Paged_Device::Page_Format>(f),
         static_cast<Fl_Paged_Device::Page_Layout>(l));
}

int fl_postscript_file_device_start_job4(POSTSCRIPTFILEDEVICE p, int c, int f, int l) {
    return reinterpret_cast<Fl_PostScript_File_Device*>(p)->start_job
       (c,
        static_cast<Fl_Paged_Device::Page_Format>(f),
        static_cast<Fl_Paged_Device::Page_Layout>(l));
}

void fl_postscript_file_device_end_job(POSTSCRIPTFILEDEVICE p) {
    reinterpret_cast<Fl_PostScript_File_Device*>(p)->end_job();
}

int fl_postscript_file_device_start_page(POSTSCRIPTFILEDEVICE p) {
    return reinterpret_cast<Fl_PostScript_File_Device*>(p)->start_page();
}

int fl_postscript_file_device_end_page(POSTSCRIPTFILEDEVICE p) {
    return reinterpret_cast<Fl_PostScript_File_Device*>(p)->end_page();
}




void fl_postscript_file_device_margins(POSTSCRIPTFILEDEVICE p, int * l, int * t, int * r, int * b) {
    reinterpret_cast<Fl_PostScript_File_Device*>(p)->margins(l,t,r,b);
}

int fl_postscript_file_device_printable_rect(POSTSCRIPTFILEDEVICE p, int * w, int * h) {
    return reinterpret_cast<Fl_PostScript_File_Device*>(p)->printable_rect(w,h);
}

void fl_postscript_file_device_get_origin(POSTSCRIPTFILEDEVICE p, int * x, int * y) {
    reinterpret_cast<Fl_PostScript_File_Device*>(p)->origin(x,y);
}

void fl_postscript_file_device_set_origin(POSTSCRIPTFILEDEVICE p, int x, int y) {
    reinterpret_cast<Fl_PostScript_File_Device*>(p)->origin(x,y);
}

void fl_postscript_file_device_rotate(POSTSCRIPTFILEDEVICE p, float r) {
    reinterpret_cast<Fl_PostScript_File_Device*>(p)->rotate(r);
}

void fl_postscript_file_device_scale(POSTSCRIPTFILEDEVICE p, float x, float y) {
    reinterpret_cast<Fl_PostScript_File_Device*>(p)->scale(x,y);
}

void fl_postscript_file_device_translate(POSTSCRIPTFILEDEVICE p, int x, int y) {
    reinterpret_cast<Fl_PostScript_File_Device*>(p)->translate(x,y);
}

void fl_postscript_file_device_untranslate(POSTSCRIPTFILEDEVICE p) {
    reinterpret_cast<Fl_PostScript_File_Device*>(p)->untranslate();
}