ViewerIdleImpl.Mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
Last Edited by: Spreitzer, June 7, 1985 4:32:27 pm PDT
DIRECTORY Buttons, Idle, Menus, SystemVersion, ViewerClasses, ViewerIdle, ViewerOps;
ViewerIdleImpl: CEDAR MONITOR
IMPORTS Buttons, Idle, SystemVersion, ViewerOps
EXPORTS ViewerIdle
= {
GetIdleProc: PUBLIC ENTRY PROC RETURNS [proc: Buttons.ButtonProc, clientData: REF ANY] = {proc ← idleProc; clientData ← idleData};
SetIdleProc: PUBLIC ENTRY PROC [proc: Buttons.ButtonProc, clientData: REF ANYNIL] RETURNS [oldProc: Buttons.ButtonProc, oldClientData: REF ANY] = {
oldProc ← idleProc;
oldClientData ← idleData;
idleProc ← proc;
idleData ← clientData;
};
idleProc: Buttons.ButtonProc ← CallSleep;
idleData: REF ANYNIL;
CallSleep: Buttons.ButtonProc = {Idle.Sleep[]};
IdleProc: PROC [parent: REF ANY, clientData: REF ANYNIL,
mouseButton: Menus.MouseButton ← red, shift, control: BOOLFALSE] --Buttons.ButtonProc-- = {
idleProc[
parent: parent,
clientData: idleData,
mouseButton: mouseButton,
shift: shift,
control: control];
RefreshIfNecessary[];
};
useIdleCrock: BOOLTRUE; -- can be set to FALSE to provoke the bug
RefreshIfNecessary: PROC = {
IF useIdleCrock AND SystemVersion.machineType = dandelion THEN
RRA: February 24, 1984 12:44:23 pm PST
This crock is here to get around a bug that is probably in VM. If we do not repaint everything, trash gets left on the screen after Idle comes back. This is tied up with the special memory used for the terminal on DLions, and nowhere else. Luckily, the bug appears benign except for the screen trash.
ViewerOps.PaintEverything[];
};
idleViewer: ViewerClasses.Viewer;
Start: PROC = {
idleViewer ← Buttons.Create[info: [name: "Idle"], proc: IdleProc, fork: TRUE];
};
Start[];
}.