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
|
Print: module
{
PATH: con "/dis/lib/print/print.dis";
CONFIG_PATH: con "/lib/print/";
init: fn(): int;
set_printfd: fn(fd: ref Sys->FD);
print_image: fn(p: ref Printer, display: ref Draw->Display, im: ref Draw->Image, pcwidth: int, cancel: chan of int): int;
print_textfd: fn(p: ref Printer, fd: ref Sys->FD, ps: real, pr: int, wrap: int): int;
get_defprinter: fn(): ref Printer;
set_defprinter: fn(p: ref Printer);
get_size: fn(p: ref Printer): (int, int, int); # dpi, xpixels, ypixels
get_printers: fn(): list of ref Printer;
get_papers: fn(): list of ref Paper;
save_settings: fn(): int;
# Printer types
Ptype: adt {
name: string;
desc: string;
modes: list of ref Pmode;
driver: string;
hpmapfile: string;
};
# Paper sizes
Paper: adt {
name: string;
hpcode: string;
width_inches: real;
height_inches: real;
};
# Print modes
Pmode: adt {
name: string;
desc: string;
resx: int;
resy: int;
blackdepth: int;
coldepth: int;
blackresmult: int;
};
# Print options
Popt: adt {
name: string;
mode: ref Pmode;
paper: ref Paper;
orientation: int;
duplex: int;
};
# Printer instance
PORTRAIT: con 0;
LANDSCAPE: con 1;
DUPLEX_OFF: con 0;
DUPLEX_LONG: con 1;
DUPLEX_SHORT: con 2;
Printer: adt {
name: string;
ptype: ref Ptype;
device: string;
popt: ref Popt;
pdriver: Pdriver;
};
};
Pdriver: module
{
PATHPREFIX: con "/dis/lib/print/";
DATAPREFIX: con "/lib/print/";
init: fn(debug: int);
sendimage: fn(p: ref Print->Printer, tfd: ref Sys->FD, display: ref Draw->Display, im: ref Draw->Image, width: int, lmargin: int, cancel: chan of int): int;
sendtextfd: fn(p: ref Print->Printer, pfd, tfd: ref Sys->FD, ps: real, pr: int, wrap: int): int;
printable_pixels: fn(p: ref Print->Printer): (int, int);
};
|