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

Function mac_init_nhwindows

outdated/sys/mac/macwin.c:695–738  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693}
694
695void
696mac_init_nhwindows(int *argcp, char **argv)
697{
698 Rect r;
699#if !TARGET_API_MAC_CARBON
700 Rect scr = (*GetGrayRgn())->rgnBBox;
701 small_screen =
702 scr.bottom - scr.top <= (iflags.large_font ? 12 * 40 : 9 * 40);
703#endif
704
705 InitMenuRes();
706
707 theWindows = (NhWindow *) NewPtrClear(NUM_MACWINDOWS * sizeof(NhWindow));
708 if (MemError())
709 error("mac_init_nhwindows: Couldn't allocate memory for windows.");
710
711 DimMenuBar();
712
713 tty_init_nhwindows(argcp, argv);
714 iflags.window_inited = TRUE;
715
716 /* Some ugly hacks to make both interfaces happy:
717 * Mac port uses both tty interface (for main map) and extra windows. The
718 * winids need to
719 * be kept in synch for both interfaces to map. Also, the "blocked"
720 * display_nhwindow case
721 * for the map automatically calls the tty interface for the message box,
722 * so some version
723 * of the message box has to exist in the tty world to prevent a meltdown,
724 * even though most
725 * messages are handled in mac window.
726 */
727 mac_create_nhwindow(NHW_BASE);
728 tty_create_nhwindow(NHW_MESSAGE);
729
730#if 1 //!TARGET_API_MAC_CARBON
731 /* Resize and reposition the message window */
732 RetrievePosition(kMessageWindow, &r.top, &r.left);
733 RetrieveSize(kMessageWindow, r.top, r.left, &r.bottom, &r.right);
734 MoveWindow(theWindows[NHW_MESSAGE].its_window, r.left, r.top, false);
735 SizeWindow(theWindows[NHW_MESSAGE].its_window, r.right, r.bottom, true);
736#endif
737 return;
738}
739
740winid
741mac_create_nhwindow(int kind)

Callers

nothing calls this directly

Calls 7

InitMenuResFunction · 0.85
tty_init_nhwindowsFunction · 0.85
mac_create_nhwindowFunction · 0.85
tty_create_nhwindowFunction · 0.85
RetrievePositionFunction · 0.85
RetrieveSizeFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected