-- ScannerUtilitiesImpl.mesa
Last Edited by: Diebert, April 12, 1985 9:34:55 am PST
Tim Diebert: October 30, 1985 12:07:35 pm PST
Copyright © 1984, Xerox Corporation. All rights reserved.
DIRECTORY
Rope USING [ROPE],
ScannerInternal USING [Parameters, ToolParameters],
UserProfile USING [Number, ProfileChangedProc, Token],
VFonts USING [EstablishFont, Font, FontHeight];
ScannerUtilitiesImpl:
CEDAR
MONITOR
IMPORTS UserProfile, VFonts
EXPORTS ScannerInternal =
BEGIN
OPEN Tool: ScannerInternal;
---- ---- ---- ---- ---- ---- ---- ----
Global Variables (protected by monitor)
---- ---- ---- ---- ---- ---- ---- ----
parameters: Tool.Parameters ← NIL;
---- ---- ---- ---- ---- ---- ---- ----
Utilities (exports to ScannerInternal for individual ops)
---- ---- ---- ---- ---- ---- ---- ----
GetToolParameters:
PUBLIC
PROC
RETURNS [Tool.Parameters] = {
RETURN[parameters]};
ReactToProfile:
PUBLIC
ENTRY UserProfile.ProfileChangedProc =
BEGIN
ENABLE UNWIND => NULL;
params: Tool.Parameters ← NEW[Tool.ToolParameters];
fontFamily: ROPE = UserProfile.Token["Scanner.FontFamily", "Tioga"];
fontSize: NAT = UserProfile.Number["Scanner.FontSize", 10];
params.font ← VFonts.EstablishFont[fontFamily, fontSize];
params.fixedFont ← VFonts.EstablishFont[family: "Gacha", size: fontSize - 2];
params.entryHeight ← VFonts.FontHeight[params.font] + 2;
params.entryVSpace ← VFonts.FontHeight[params.font]*1/6;
params.entryHSpace ← 10;
params.defaultServer ← UserProfile.Token["Scanner.Server", "York"];
params.calFileName ← UserProfile.Token["Scanner.CalibrationFile", "ScannerCal"];
parameters ← params;
END;
ReactToProfile[edit];
END.