| 1346 | } |
| 1347 | |
| 1348 | void |
| 1349 | mac_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 | |
| 1399 | void |
| 1400 | mac_number_pad(int pad) |
no test coverage detected