-- Blt.mesa
-- Last changed by Doug Wyatt, September 30, 1980 2:41 PM

DIRECTORY
BitBltDefs USING [BBptr, BBTableSpace];

Blt: DEFINITIONS = {

Grays: TYPE = ARRAY [0..4) OF CARDINAL;

Handle: TYPE = POINTER TO Data;

BBptr: TYPE = BitBltDefs.BBptr;

Data: TYPE = RECORD [
bbt: BBptr,
grays: Grays,
sdx,sdy: INTEGER,
refs: PRIVATE CARDINAL←1,
space: PRIVATE BitBltDefs.BBTableSpace
];

New: PROC[base: LONG POINTER, raster: CARDINAL] RETURNS[Handle];

Source: PROC[d: Handle, base: LONG POINTER, raster: CARDINAL];

SetX: PROC[d: Handle, xmin,xmax: CARDINAL] = INLINE {
bbt: BBptr=d.bbt;
bbt.dlx←xmin; bbt.dw←xmax-xmin;
};

SetY: PROC[d: Handle, ymin,ymax: CARDINAL] = INLINE {
bbt: BBptr=d.bbt;
bbt.dty←ymin; bbt.dh←ymax-ymin;
};

SetBox: PROC[d: Handle, xmin,ymin,w,h: CARDINAL] = INLINE {
bbt: BBptr=d.bbt;
bbt.dlx←xmin; bbt.dty←ymin;
bbt.dw←w; bbt.dh←h;
};

Rect: PROC[d: Handle];

Ref: PROC[d: Handle] RETURNS[Handle] = INLINE {
d.refs←d.refs+1; RETURN[d]
};

Free: PROC[dPtr: LONG POINTER TO Handle] = INLINE {
d: Handle=dPtr↑; dPtr↑←NIL;
IF (d.refs←d.refs-1)=0 THEN CFree[d]
};
CFree: PRIVATE PROC[d: Handle];

BltImpl: PROGRAM;

}.