DIRECTORY UFFileManager, ViewerClasses, ViewerOps, Graphics, Process, Rope; UFFileWatch: CEDAR MONITOR IMPORTS UFFileManager, ViewerOps, Graphics, Process = BEGIN DataRec: TYPE = RECORD [ paint: PROCESS _ NIL, timeout: CONDITION ]; waitTime: Process.Ticks _ Process.MsecToTicks[1000]; PaintProcess: ENTRY PROCEDURE [viewer: ViewerClasses.Viewer] = { ENABLE UNWIND => NULL; d: REF DataRec _ NARROW[viewer.data]; WHILE NOT viewer.destroyed DO TRUSTED{ViewerOps.PaintViewer[viewer, client, FALSE, $Update]}; WAIT d.timeout; ENDLOOP; }; Create: PROCEDURE RETURNS [viewer: ViewerClasses.Viewer] = TRUSTED { data: REF DataRec _ NEW[DataRec]; Process.InitializeCondition[@data.timeout, waitTime]; viewer _ ViewerOps.CreateViewer[flavor: $UFFileWatcher, info: [name: "Open Font Files", data: data], paint: FALSE]; Process.Detach[data.paint _ FORK PaintProcess[viewer]]; ViewerOps.PaintViewer[viewer, all]; }; baseLine: NAT _ 12; indent: NAT _ 6; FileWatcherPaint: ViewerClasses.PaintProc = { PaintFileName: PROC [rope: Rope.ROPE] = { Graphics.SetCP[context, indent, Graphics.GetCP[context].y-baseLine]; Graphics.DrawRope[context, rope]; }; PaintNumber: PROC [i: INT] = { IF i<0 THEN {Graphics.DrawChar[context, '-]; i_-i}; IF i>=10 THEN {PaintNumber[i/10]; i_i MOD 10}; Graphics.DrawChar[context, '0+i]; }; IF NOT clear THEN { Graphics.SetColor[context, Graphics.white]; Graphics.DrawBox[context, [-100000, -100000, 100000, 100000]]; }; Graphics.SetColor[context, Graphics.black]; Graphics.SetCP[context, indent, self.ch-baseLine]; Graphics.DrawRope[context, "Number of file permissions: "]; PaintNumber[UFFileManager.PermissionCount[]]; UFFileManager.EnumerateOpenFontFiles[PaintFileName]; }; fileWatcherClass: ViewerClasses.ViewerClass _ NEW[ViewerClasses.ViewerClassRec _ [ paint: FileWatcherPaint, tipTable: NIL ]]; TRUSTED {ViewerOps.RegisterViewerClass[$UFFileWatcher, fileWatcherClass]}; [] _ Create[]; END. XUFFileWatch.mesa Created January 18, 1983 Michael Plass, January 19, 1983 3:43 pm Κ$˜J™J™J™'IunitšΟk œB˜Kšœ  ˜Jšœ,˜3Jšœ˜šœ œœ˜Jšœœœ˜Jšœ  ˜J˜—K˜4šΟn œœ œ#˜@Jšœœœ˜Jšœœ œ˜%š œ˜Jšœ'œ ˜?Jšœ ˜Jšœ˜—Jšœ˜—šžœ œœ"œ˜DJšœœ œ ˜!J˜5Jšœlœ˜sJšœœ˜7Jšœ#˜#J˜—Kšœ œ˜Kšœœ˜šœ-˜-šž œœ œ˜)JšœD˜DJšœ!˜!J˜—šž œœœ˜Jšœœ(˜3Jšœœœ˜.Jšœ!˜!Jšœ˜—šœœœ˜Jšœ+˜+Jšœ>˜>J˜—Jšœ+˜+Jšœ2˜2Jšœ;˜;Jšœ-˜-Jšœ4˜4Jšœ˜—šœ.œ!˜RJ˜Jšœ ˜ J˜—KšœC˜JK˜Kšœ˜——…—t π