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

Function MenwEvent

outdated/sys/mac/macwin.c:2701–2767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2699
2700#if 0 // TARGET_API_MAC_CARBON
2701static pascal OSStatus
2702MenwEvent(EventHandlerCallRef nexthandler, EventRef event, void *userdata)
2703{
2704 NhWindow *wind = (NhWindow *) userdata;
2705
2706
2707 switch (GetEventClass(event)) {
2708 case kEventClassControl: {
2709 ControlRef control;
2710 ControlID id;
2711
2712 switch (GetEventKind(event)) {
2713 case kEventControlHit:
2714 GetEventParameter(event, kEventParamDirectObject,
2715 typeControlRef, NULL, sizeof(ControlRef), NULL, &control);
2716 GetControlID(control, &id);
2717 /* TODO... */
2718 return (noErr);
2719 }
2720 break;
2721 }
2722
2723 case kEventClassKeyboard: {
2724 char ch;
2725 UInt32 modifiers;
2726
2727
2728 GetEventParameter(event, kEventParamKeyMacCharCodes, typeChar, NULL,
2729 sizeof(char), NULL, &ch);
2730 GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, NULL,
2731 sizeof(UInt32), NULL, &modifiers);
2732 if (modifiers & cmdKey)
2733 return (eventNotHandledErr);
2734 MenwKey(wind, ch);
2735 return (noErr);
2736 }
2737
2738 case kEventClassWindow:
2739 switch (GetEventKind(event)) {
2740 case kEventWindowDrawContent:
2741 CallNextEventHandler(nexthandler, event);
2742 MenwUpdate(wind);
2743 return (noErr);
2744
2745 case kEventWindowHandleContentClick: {
2746 CGrafPtr saveport;
2747 GDHandle savedev;
2748 Point pt;
2749
2750 GetEventParameter(event, kEventParamMouseLocation, typeQDPoint,
2751 NULL, sizeof(Point), NULL, &pt);
2752 GetGWorld(&saveport, &savedev);
2753 SetPortWindowPort(wind->its_window);
2754 GlobalToLocal(&pt);
2755 SetGWorld(saveport, savedev);
2756 MenwClick(wind, pt);
2757 return (noErr);
2758 }

Callers

nothing calls this directly

Calls 3

MenwKeyFunction · 0.85
MenwUpdateFunction · 0.85
MenwClickFunction · 0.85

Tested by

no test coverage detected