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

Function MsgEvent

outdated/sys/mac/macwin.c:2482–2548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2480
2481#if 0 // TARGET_API_MAC_CARBON
2482static pascal OSStatus
2483MsgEvent(EventHandlerCallRef nexthandler, EventRef event, void *userdata)
2484{
2485 NhWindow *wind = (NhWindow *) userdata;
2486
2487
2488 switch (GetEventClass(event)) {
2489 case kEventClassControl: {
2490 ControlRef control;
2491 ControlID id;
2492
2493 switch (GetEventKind(event)) {
2494 case kEventControlHit:
2495 GetEventParameter(event, kEventParamDirectObject,
2496 typeControlRef, NULL, sizeof(ControlRef), NULL, &control);
2497 GetControlID(control, &id);
2498 /* TODO... */
2499 return (noErr);
2500 }
2501 break;
2502 }
2503
2504 case kEventClassKeyboard: {
2505 char ch;
2506 UInt32 modifiers;
2507
2508
2509 GetEventParameter(event, kEventParamKeyMacCharCodes, typeChar, NULL,
2510 sizeof(char), NULL, &ch);
2511 GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, NULL,
2512 sizeof(UInt32), NULL, &modifiers);
2513 if (modifiers & cmdKey)
2514 return (eventNotHandledErr);
2515 AddToKeyQueue(topl_resp_key(ch), TRUE);
2516 return (noErr);
2517 }
2518
2519 case kEventClassWindow:
2520 switch (GetEventKind(event)) {
2521 case kEventWindowDrawContent:
2522 CallNextEventHandler(nexthandler, event);
2523 MsgUpdate(wind);
2524 return (noErr);
2525
2526 case kEventWindowHandleContentClick: {
2527 CGrafPtr saveport;
2528 GDHandle savedev;
2529 Point pt;
2530
2531 GetEventParameter(event, kEventParamMouseLocation, typeQDPoint,
2532 NULL, sizeof(Point), NULL, &pt);
2533 GetGWorld(&saveport, &savedev);
2534 SetPortWindowPort(wind->its_window);
2535 GlobalToLocal(&pt);
2536 SetGWorld(saveport, savedev);
2537 MsgClick(wind, pt);
2538 return (noErr);
2539 }

Callers

nothing calls this directly

Calls 4

AddToKeyQueueFunction · 0.85
topl_resp_keyFunction · 0.85
MsgUpdateFunction · 0.85
MsgClickFunction · 0.85

Tested by

no test coverage detected