home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
coders
/
jËzyki_programowania
/
oberon
/
system
/
printer.mod
(
.txt
)
< prev
next >
Wrap
Oberon Text
|
1977-12-31
|
3KB
|
74 lines
Syntax10.Scn.Fnt
Syntax10b.Scn.Fnt
Syntax10i.Scn.Fnt
MODULE Printer; (*UNIX version: JT 11.5.90, RC 2.7.93, JS 13.10.94, << Ceres, SHML 12 Jul 95 *)
IMPORT PrinterDriver, Modules;
res*: INTEGER; (*0 = done, 1 = not done*)
PageWidth*, PageHeight*: INTEGER;
arg: ARRAY 32 OF CHAR;
(* -- Exported Procedures -- *)
PROCEDURE Open*(VAR name, user: ARRAY OF CHAR; password: LONGINT);
(** name = Module.(PrinterName|FileName); e.g. CeresPrinter.Pluto, CeresPrinter.Out.Prt, PSPrinter.Out.ps **)
VAR driver: ARRAY 32 OF CHAR; driverModule: Modules.Module; i, j: INTEGER; driverInit: Modules.Command;
BEGIN
res := 1; i := 0; j := 0;
driver := ""; arg := "";
WHILE (name[i] # 0X) & (name[i] # ".") DO driver[j] := name[i]; INC(i); INC(j) END;
driver[j] := 0X;
IF name[i] # 0X THEN INC(i) END;
j := 0;
WHILE (name[i] # 0X) DO arg[j] := name[i]; INC(i); INC(j) END;
arg[j] := 0X;
driverModule := Modules.ThisMod(driver);
IF driverModule = NIL THEN PrinterDriver.Error(driver, "not found"); RETURN END;
driverInit := Modules.ThisCommand(driverModule, "Init");
IF driverInit = NIL THEN PrinterDriver.Error(driver, "Init not found"); RETURN END;
driverInit;
PrinterDriver.Open(arg, user, password);
res := PrinterDriver.res;
IF PrinterDriver.err THEN
PrinterDriver.Error(PrinterDriver.errMsg, PrinterDriver.f)
END
END Open;
PROCEDURE ReplConst*(x, y, w, h: INTEGER);
BEGIN PrinterDriver.ReplConst(x, y, w, h)
END ReplConst;
PROCEDURE UseListFont*(VAR name: ARRAY OF CHAR);
BEGIN PrinterDriver.UseListFont(name)
END UseListFont;
PROCEDURE String*(x, y: INTEGER; VAR s, fname: ARRAY OF CHAR);
BEGIN PrinterDriver.String(x, y, s, fname)
END String;
PROCEDURE ContString*(VAR s, fname: ARRAY OF CHAR);
BEGIN PrinterDriver.ContString(s, fname)
END ContString;
PROCEDURE ReplPattern*(x, y, w, h, col: INTEGER);
BEGIN PrinterDriver.ReplPattern(x, y, w, h, col)
END ReplPattern;
PROCEDURE Line*(x0, y0, x1, y1: INTEGER);
BEGIN PrinterDriver.Line(x0, y0, x1, y1)
END Line;
PROCEDURE Circle*(x0, y0, r: INTEGER);
BEGIN PrinterDriver.Circle(x0,y0,r)
END Circle;
PROCEDURE Ellipse*(x0, y0, a, b: INTEGER);
BEGIN PrinterDriver.Ellipse(x0, y0, a, b)
END Ellipse;
PROCEDURE Spline*(x0, y0, n, open: INTEGER; VAR X, Y: ARRAY OF INTEGER);
BEGIN PrinterDriver.Spline(x0, y0, n, open, X, Y)
END Spline;
PROCEDURE Picture*(x, y, w, h, mode: INTEGER; adr: LONGINT);
BEGIN PrinterDriver.Picture(x, y, w, h, mode, adr)
END Picture;
PROCEDURE Page*(nofcopies: INTEGER);
BEGIN PrinterDriver.Page(nofcopies)
END Page;
PROCEDURE Close*;
BEGIN PrinterDriver.Close
END Close;
PROCEDURE UseColor*(red, green, blue: INTEGER);
BEGIN PrinterDriver.UseColor(red, green, blue)
END UseColor;
BEGIN PageWidth := 2336; PageHeight := 3425
END Printer.