diff options
| author | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
| commit | 46439007cf417cbd9ac8049bb4122c890097a0fa (patch) | |
| tree | 6fdb25e5f3a2b6d5657eb23b35774b631d4d97e4 /module/print.m | |
| parent | 37da2899f40661e3e9631e497da8dc59b971cbd0 (diff) | |
20060303-partial
Diffstat (limited to 'module/print.m')
| -rw-r--r-- | module/print.m | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/module/print.m b/module/print.m new file mode 100644 index 00000000..79c5aa8c --- /dev/null +++ b/module/print.m @@ -0,0 +1,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); + +}; |
