-- JaMMap.mesa
-- Rick Beach, June 16, 1982 10:02 pm
-- quick hack to implement Graphics.Map for JaM
DIRECTORY
Graphics,
JaMFnsDefs,
JaMGraphics,
TAGraphicsHacks;
JaMMap: PROGRAM
IMPORTS Graphics, JaMFnsDefs, JaMGraphics, TAGraphicsHacks = {
WU: PROCEDURE = {
xMapped, yMapped: REAL;
y: REAL ← JaMFnsDefs.PopReal[];
x: REAL ← JaMFnsDefs.PopReal[];
[xMapped, yMapped] ← Graphics.WorldToUser[JaMGraphics.GetDC[], x, y];
JaMFnsDefs.PushReal[xMapped];
JaMFnsDefs.PushReal[yMapped];
};
UW: PROCEDURE = {
xMapped, yMapped: REAL;
y: REAL ← JaMFnsDefs.PopReal[];
x: REAL ← JaMFnsDefs.PopReal[];
[xMapped, yMapped] ← Graphics.UserToWorld[JaMGraphics.GetDC[], x, y];
JaMFnsDefs.PushReal[xMapped];
JaMFnsDefs.PushReal[yMapped];
};
UD: PROCEDURE = {
xMapped, yMapped: REAL;
y: REAL ← JaMFnsDefs.PopReal[];
x: REAL ← JaMFnsDefs.PopReal[];
[xMapped, yMapped] ← TAGraphicsHacks.UserToDevice[JaMGraphics.GetDC[], x, y, FALSE];
JaMFnsDefs.PushReal[xMapped];
JaMFnsDefs.PushReal[yMapped];
};
DU: PROCEDURE = {
xMapped, yMapped: REAL;
y: REAL ← JaMFnsDefs.PopReal[];
x: REAL ← JaMFnsDefs.PopReal[];
[xMapped, yMapped] ← TAGraphicsHacks.DeviceToUser[JaMGraphics.GetDC[], x, y, FALSE];
JaMFnsDefs.PushReal[xMapped];
JaMFnsDefs.PushReal[yMapped];
};
JaMFnsDefs.Register[".wu", WU];
JaMFnsDefs.Register[".uw", UW];
JaMFnsDefs.Register[".du", DU];
JaMFnsDefs.Register[".ud", UD];
}.