ViewerSpecsImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Edited by McGregor on June 9, 1982 4:55 pm
Last Edited by: Maxwell, December 17, 1982 9:58 am
Doug Wyatt, April 15, 1985 0:29:55 am PST
DIRECTORY
ViewerPrivate USING [],
ViewerSpecs USING [iconHeight, iconWidth];
ViewerSpecsImpl: CEDAR PROGRAM
EXPORTS ViewerPrivate, ViewerSpecs
~ BEGIN OPEN ViewerSpecs;
bwScreenWidth: PUBLIC NAT ← 0;
bwScreenHeight: PUBLIC NAT ← 0;
colorScreenWidth: PUBLIC NAT ← 0;
colorScreenHeight: PUBLIC NAT ← 0;
windowBorderSize: PUBLIC NAT ← 0;
captionHeight: PUBLIC NAT ← 0;
menuHeight: PUBLIC NAT ← 0;
menuBarHeight: PUBLIC NAT ← 0;
scrollBarW: PUBLIC NAT ← 0;
messageWindowHeight: PUBLIC NAT ← 0;
openLeftLeftX: PUBLIC NAT ← 0;
openLeftWidth: PUBLIC NAT ← 0;
openRightLeftX: PUBLIC NAT ← 0;
openRightWidth: PUBLIC NAT ← 0;
openTopY: PUBLIC NAT ← 0;
openBottomY: PUBLIC NAT ← 0;
iconLeftX: PUBLIC NAT ← 0;
iconAreaWidth: NAT ← 0;
iconRightX: PUBLIC NAT ← 0;
iconBottomY: PUBLIC NAT ← 0;
iconAreaHeight: NAT ← 0;
iconTopY: PUBLIC NAT ← 0;
iconSpacing: PUBLIC NAT ← 0;
iconRowHeight: PUBLIC NAT ← 0;
iconRows: PUBLIC NAT ← 0;
iconColumnWidth: PUBLIC NAT ← 0;
iconColumns: PUBLIC NAT ← 0;
SetDefaults: PROC ~ {
bwScreenWidth ← 1024;
bwScreenHeight ← 808;
windowBorderSize ← 1;
menuHeight ← 12;
menuBarHeight ← 1;
scrollBarW ← 12;
messageWindowHeight ← 16;
openLeftLeftX ← 0;
openLeftWidth ← 600;
openBottomY ← iconHeight+4;
iconSpacing ← 4; -- should be multiple of 4 for grey background alignment
iconLeftX ← 4; -- should be multiple of 4 for grey background alignment
iconBottomY ← 0;
};
ComputeDependencies: PROC ~ {
captionHeight ← menuHeight;
openRightLeftX ← openLeftLeftX+openLeftWidth;
openRightWidth ← bwScreenWidth-openRightLeftX;
openTopY ← bwScreenHeight-messageWindowHeight;
iconRowHeight ← iconHeight+iconSpacing;
iconRows ← (openTopY-iconBottomY)/iconRowHeight;
iconAreaHeight ← iconRows*iconRowHeight;
iconTopY ← iconBottomY+iconAreaHeight;
iconColumnWidth ← iconWidth+iconSpacing;
iconColumns ← (bwScreenWidth-iconLeftX)/iconColumnWidth;
iconAreaWidth ← iconColumns*iconColumnWidth;
iconRightX ← iconLeftX+iconAreaWidth;
};
SetOpenLeftWidth: PUBLIC PROC [val: NAT] ~ {
openLeftWidth ← MIN[val, bwScreenWidth];
ComputeDependencies[];
};
SetOpenBottomY: PUBLIC PROC [val: NAT] ~ {
openBottomY ← MIN[val, openTopY];
ComputeDependencies[];
};
SetMenuHeight: PUBLIC PROC [val: NAT] ~ {
menuHeight ← MIN[val, 200];
ComputeDependencies[];
};
SetScrollBarWidth: PUBLIC PROC [val: NAT] ~ {
scrollBarW ← MIN[val, 200];
ComputeDependencies[];
};
SetWindowBorderSize: PUBLIC PROC [val: NAT] ~ {
windowBorderSize ← MIN[val, 200];
ComputeDependencies[];
};
SetBWScreenSize: PUBLIC PROC [w, h: NAT] ~ {
bwScreenWidth ← w; bwScreenHeight ← h;
ComputeDependencies[];
};
SetColorScreenSize: PUBLIC PROC [w, h: NAT] ~ {
colorScreenWidth ← w; colorScreenHeight ← h;
ComputeDependencies[];
};
SetDefaults[];
ComputeDependencies[];
END.