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

Function HandleUpdate

outdated/sys/mac/macwin.c:3115–3164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3113#endif
3114
3115static void
3116HandleUpdate(EventRecord *theEvent)
3117{
3118 WindowPtr theWindow = (WindowPtr) theEvent->message;
3119 NhWindow *aWin = GetNhWin(theWindow);
3120 Rect r;
3121#if 1 //!TARGET_API_MAC_CARBON
3122 EventRecord fake;
3123#endif
3124
3125 char existing_update_region = FALSE;
3126 Rect rect;
3127
3128 if (theWindow == _mt_window) {
3129 existing_update_region =
3130 (get_invalid_region(theWindow, &rect) == noErr);
3131 }
3132 BeginUpdate(theWindow);
3133 SetPortWindowPort(theWindow);
3134 GetWindowBounds(theWindow, kWindowContentRgn, &r);
3135 OffsetRect(&r, -r.left, -r.top);
3136 EraseRect(&r);
3137#if 0 // TARGET_API_MAC_CARBON
3138 switch (GetWindowKind(theWindow) - WIN_BASE_KIND) {
3139 case NHW_BASE:
3140 case NHW_MAP:
3141 case NHW_STATUS:
3142 image_tty(NULL, theWindow);
3143 break;
3144 case NHW_MESSAGE:
3145 MsgUpdate(GetNhWin(theWindow));
3146 break;
3147 case NHW_MENU:
3148 MenwUpdate(GetNhWin(theWindow));
3149 break;
3150 case NHW_TEXT:
3151 TextUpdate(GetNhWin(theWindow));
3152 break;
3153 }
3154#else
3155 winUpdateFuncs[GetWindowKind(theWindow) - WIN_BASE_KIND](&fake,
3156 theWindow);
3157#endif
3158
3159 if (theWindow == _mt_window && existing_update_region) {
3160 set_invalid_region(theWindow, &rect);
3161 }
3162 aWin->drawn = TRUE;
3163 EndUpdate(theWindow);
3164}
3165
3166#if 1 //!TARGET_API_MAC_CARBON
3167

Callers 1

HandleEventFunction · 0.85

Calls 7

GetNhWinFunction · 0.85
get_invalid_regionFunction · 0.85
image_ttyFunction · 0.85
MsgUpdateFunction · 0.85
MenwUpdateFunction · 0.85
TextUpdateFunction · 0.85
set_invalid_regionFunction · 0.85

Tested by

no test coverage detected