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

Function mac_destroy_nhwindow

outdated/sys/mac/macwin.c:1348–1397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1346}
1347
1348void
1349mac_destroy_nhwindow(winid win)
1350{
1351 WindowPtr theWindow;
1352 NhWindow *aWin = &theWindows[win];
1353 int kind;
1354
1355 if (win < 0 || win >= NUM_MACWINDOWS) {
1356 if (iflags.window_inited)
1357 error("dest_win: Invalid win %d.", win);
1358 return;
1359 }
1360 theWindow = aWin->its_window;
1361 if (!theWindow) {
1362 error("dest_win: Not allocated win %d.", win);
1363 return;
1364 }
1365
1366 /*
1367 * Check special windows. The base window should never go away.
1368 * Other "standard" windows should not go away unless we've exitted
1369 * nhwindows.
1370 */
1371 if (theWindow == _mt_window) {
1372 return;
1373 }
1374 if (win == WIN_INVEN || win == WIN_MESSAGE) {
1375 if (iflags.window_inited) {
1376 if (flags.tombstone && killer[0]) {
1377 /* Prepare for the coming of the tombstone window. */
1378 win_fonts[NHW_TEXT] = kFontIDMonaco;
1379 }
1380 return;
1381 }
1382 if (win == WIN_MESSAGE)
1383 WIN_MESSAGE = WIN_ERR;
1384 }
1385
1386 kind = GetWindowKind(theWindow) - WIN_BASE_KIND;
1387
1388 if ((!IsWindowVisible(theWindow)
1389 || (kind != NHW_MENU && kind != NHW_TEXT))) {
1390 DisposeWindow(theWindow);
1391 if (aWin->windowText) {
1392 DisposeHandle(aWin->windowText);
1393 }
1394 aWin->its_window = (WindowPtr) 0;
1395 aWin->windowText = (Handle) 0;
1396 }
1397}
1398
1399void
1400mac_number_pad(int pad)

Callers 4

mac_create_nhwindowFunction · 0.85
WindowGoAwayFunction · 0.85
mac_exit_nhwindowsFunction · 0.85
TextKeyFunction · 0.85

Calls 1

errorFunction · 0.70

Tested by

no test coverage detected