MCPcopy Create free account
hub / github.com/NetHack/NetHack / eventLoop

Function eventLoop

outdated/sys/mac/mrecover.c:743–852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

741}
742
743static void
744eventLoop()
745{
746 short wneMask = (in.Front ? everyEvent : (osMask + updateMask));
747 long wneSleep = (in.Front ? 0L : 3L);
748
749 while (1) {
750 if (in.Front)
751 adjustGUI();
752
753 if (memActivity >= pBytes->memCleanup)
754 adjustMemory();
755
756 (void) WaitNextEvent(wneMask, &wnEvt, wneSleep, (RgnHandle) 0L);
757
758 if (in.Dialog)
759 (void) IsDialogEvent(&wnEvt);
760
761 switch (wnEvt.what) {
762 case osEvt:
763 if (((wnEvt.message & osEvtMessageMask) >> 24)
764 == suspendResumeMessage) {
765 in.Front = (wnEvt.message & resumeFlag);
766 wneMask = (in.Front ? everyEvent : (osMask + updateMask));
767 wneSleep = (in.Front ? 0L : 3L);
768 }
769 break;
770
771 case nullEvent:
772 /* adjust the FIFO notification queue */
773 if (pNMQ && pNMQ->nmDispose) {
774 notifPtr pNMX = pNMQ->nmNext;
775
776 DisposPtr((Ptr) pNMQ);
777 pNMQ = pNMX;
778
779 memActivity++;
780 }
781
782 if (in.Recover)
783 continueRecover();
784 break;
785
786 case mouseDown: {
787 WindowPtr whichWindow;
788
789 switch (FindWindow(wnEvt.where, &whichWindow)) {
790 case inMenuBar:
791 RecoverMenuEvent(MenuSelect(wnEvt.where));
792 break;
793
794 case inSysWindow:
795 SystemClick(&wnEvt, whichWindow);
796 break;
797
798 case inDrag: {
799 Rect boundsRect = qd.screenBits.bounds;
800 Point offsetPt;

Callers 1

mrecover.cFile · 0.85

Calls 6

adjustGUIFunction · 0.85
adjustMemoryFunction · 0.85
continueRecoverFunction · 0.85
RecoverMenuEventFunction · 0.85
endRecoverFunction · 0.85
noteFunction · 0.85

Tested by

no test coverage detected