DIRECTORY ClassIncreek USING [Increek], Cursors USING [CursorType, SetCursor], Imager USING [black, Context, Create, IntegerMaskRectangle, IntegerSetXY, SetColor, ShowCharacters, white], ImplErrors, InputFocus, MessageWindow USING [Append, Blink], MessageWindowPrivate USING [messageWindow], Process USING [GetPriority, MsecToTicks, Pause, Priority, priorityForeground, SetPriority], Rope USING [ROPE], TIPUser USING [DiscardTypeAhead], UserProfile USING [Boolean, CallWhenProfileChanges, ProfileChangedProc], UserTerminal USING [BlinkDisplay, keyboard], VFonts USING [defaultFont], ViewerClasses USING [Viewer], ViewerOps USING [EnumerateViewers, EnumProc, PaintViewer, SaveAllEdits], ViewersSnapshot USING [RollBack], WindowManager USING [RestoreCursor]; ImplErrorsImpl: CEDAR MONITOR IMPORTS Cursors, Imager, InputFocus, MessageWindow, MessageWindowPrivate, Process, TIPUser, UserProfile, UserTerminal, VFonts, ViewerOps, ViewersSnapshot, WindowManager EXPORTS ImplErrors SHARES InputFocus, TIPUser = BEGIN OPEN ImplErrors; Error: PUBLIC SIGNAL [severity: Severity _ fatal, msg: Rope.ROPE _ NIL] = CODE; UserErrorQuery: PUBLIC ENTRY PROC RETURNS [continue: BOOL] = TRUSTED BEGIN OPEN Imager, MessageWindowPrivate.messageWindow; ENABLE UNWIND => NULL; oldPriority: Process.Priority = Process.GetPriority[]; context: Context; mouseBitsRec: TYPE = MACHINE DEPENDENT RECORD [ -- mouse buttons are inverted fill: [0..8192), red: BOOL, blue: BOOL, yellow: BOOL]; mouse: LONG POINTER TO mouseBitsRec = LOOPHOLE[UserTerminal.keyboard]; IF ~worldSwapDebug THEN RETURN[FALSE]; Process.SetPriority[Process.priorityForeground]; TIPUser.DiscardTypeAhead[InputFocus.focusTIP]; context _ Create[$LFDisplay]; SetColor[context, white]; IntegerMaskRectangle[context, cx, cy, cw, ch]; SetColor[context, black]; IntegerSetXY[context, cx+2, cy+2]; THROUGH [0..3) DO UserTerminal.BlinkDisplay[]; Process.Pause[Process.MsecToTicks[100]]; ENDLOOP; ShowCharacters[context, " Uncaught Signal! Red: Proceed, Yellow: Save edits then rollback, Blue: Reject.", VFonts.defaultFont]; WHILE ~mouse.red OR ~mouse.yellow OR ~mouse.blue DO ENDLOOP; -- spin until buttons go up Cursors.SetCursor[questionMark]; DO IF ~mouse.red THEN { continue _ TRUE; MessageWindow.Append["Pressing on in spite of crash! Maybe you should boot.", TRUE]; EXIT} ELSE IF ~mouse.yellow THEN { continue _ TRUE; Cursors.SetCursor[hourGlass]; ViewerOps.SaveAllEdits[! ANY => CONTINUE]; Cursors.SetCursor[retry]; ViewersSnapshot.RollBack[! ANY => CONTINUE]; -- usually no return MessageWindow.Append["Rollback failed! Maybe you should boot.", TRUE]; ViewerOps.EnumerateViewers[Paint]; -- update headers of saved viewers EXIT} ELSE IF ~mouse.blue THEN {continue _ FALSE; EXIT}; ENDLOOP; InputFocus.EnableInput[]; Process.SetPriority[oldPriority]; IF NOT continue THEN RETURN; WindowManager.RestoreCursor[]; MessageWindow.Blink[]; END; Paint: ViewerOps.EnumProc = BEGIN IF v.column#static THEN ViewerOps.PaintViewer[v, caption ! ANY => CONTINUE]; RETURN[TRUE]; END; worldSwapDebug: BOOL; Init: UserProfile.ProfileChangedProc = CHECKED {worldSwapDebug _ UserProfile.Boolean["WorldSwapDebug", FALSE]}; UserProfile.CallWhenProfileChanges[Init]; END. BImplErrorsImpl.mesa; written by S. McGregor Last Edited by: McGregor, August 4, 1983 11:20 am Last Edited by: Maxwell, January 3, 1983 12:56 pm Last Edited by: Wyatt, October 24, 1983 3:31 pm try to flush current TIP notification to client only use low-level interfaces to avoid monitors and potentially broken code Κ»– "cedar" style˜JšΟc+™+Jš1™1J™1J™/J˜šΟk ˜ Jšœ žœ ˜Jšœžœ˜&Jšœžœ_˜kJ˜ J˜ Jšœžœ˜$Jšœžœ˜+šœžœ@˜MJ˜ —Jšœžœžœ˜Jšœžœ˜!Jšœ žœ7˜HJšœ žœ˜,Jšœžœ˜Jšœžœ ˜Jšœ žœ9˜HJšœžœ ˜!Jšœžœ˜$J˜—šœž ˜Jšžœ‘˜¨Jšžœ ˜Jšžœ˜J˜—Jšžœžœ ˜J˜Jš œžœžœ(žœžœžœ˜OJ˜š Οnœžœžœžœžœ žœ˜Jš/™/JšK™KJšžœžœžœ˜J˜6J˜š œžœžœž œžœ˜MJšœžœžœ žœ˜6—Jš œžœžœžœžœ˜FJšžœžœžœžœ˜&Jšœ0˜0J˜.J˜J˜J˜.J˜J˜"šžœž˜J˜J˜(Jšžœ˜—J˜€šžœ žœžœ ž˜3Jšžœ˜$—J˜ šžœžœ žœ˜Jšœ žœ˜JšœOžœ˜UJšžœ˜šžœžœžœ˜Jšœ žœ˜J˜Jšœžœžœ˜*J˜Jšœžœžœ˜AJšœAžœ˜GJšœ#"˜EJšžœ˜—Jš žœžœ žœ žœžœ˜2Jšžœ˜—J˜J˜!Jšžœžœ žœžœ˜J˜J˜Jšžœ˜J˜—šœž˜!Jšžœžœ$žœžœ˜LJšžœžœ˜ Jšžœ˜J˜—Jšœžœ˜J˜šœ'ž˜.Jšœ8žœ˜@—J˜Ibodyšœ)˜)K˜Kšžœ˜J˜J˜J˜—…— „