-- Boxer.mesa
-- Last changed by Doug Wyatt, September 15, 1980 5:56 PM

DIRECTORY
Vector USING [Vec],
Area USING [Rec, Handle];

Boxer: DEFINITIONS = {

Handle: TYPE = LONG POINTER TO Object;

sink: READONLY Handle;

New: PROC RETURNS[Handle];

Put: PROC[self: Handle, v: Vector.Vec] = INLINE {
self.procs.Put[self,v]
};
Include: PROC[self: Handle, area: Area.Handle] = INLINE {
self.procs.Include[self,area]
};
Expand: PROC[self: Handle, slop: REAL] = INLINE {
self.procs.Expand[self,slop]
};
Rectangle: PROC[self: Handle] RETURNS[Area.Rec] = INLINE {
RETURN[self.procs.Rectangle[self]]
};
Copy: PROC[self: Handle] RETURNS[Handle] = INLINE {
RETURN[self.procs.Copy[self]]
};
Free: PROC[selfPtr: LONG POINTER TO Handle] = INLINE {
self: Handle=selfPtr↑; selfPtr↑←sink; self.procs.Free[self]
};

Object: PRIVATE TYPE = RECORD [
procs: LONG POINTER TO READONLY Procs,
data: LONG POINTER TO Data
];
Procs: PRIVATE TYPE = RECORD [
Put: PROC[self: Handle, v: Vector.Vec],
Include: PROC[self: Handle, area: Area.Handle],
Expand: PROC[self: Handle, slop: REAL],
Rectangle: PROC[self: Handle] RETURNS[Area.Rec],
Copy: PROC[self: Handle] RETURNS[Handle],
Free: PROC[self: Handle]
];
Data: PRIVATE TYPE;

BoxerImpl: PROGRAM;

}.