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

Function HandleClick

outdated/sys/mac/macwin.c:3023–3100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3021#endif /* !TARGET_API_MAC_CARBON */
3022
3023static void
3024HandleClick(EventRecord *theEvent)
3025{
3026 int code;
3027 unsigned long l;
3028 WindowPtr theWindow;
3029 NhWindow *aWin;
3030 Rect r;
3031 Boolean not_inSelect;
3032
3033 InsetRect(GetRegionBounds(GetGrayRgn(), &r), 4, 4);
3034
3035 code = FindWindow(theEvent->where, &theWindow);
3036 aWin = GetNhWin(theWindow);
3037 not_inSelect = (inSelect == WIN_ERR || aWin - theWindows == inSelect);
3038
3039 switch (code) {
3040 case inContent:
3041#if 1 //!TARGET_API_MAC_CARBON
3042 if (not_inSelect) {
3043 int kind = GetWindowKind(theWindow) - WIN_BASE_KIND;
3044 winCursorFuncs[kind](theEvent, theWindow, gMouseRgn);
3045 SelectWindow(theWindow);
3046 SetPortWindowPort(theWindow);
3047 winClickFuncs[kind](theEvent, theWindow);
3048 } else {
3049 nhbell();
3050 }
3051#endif
3052 break;
3053
3054 case inDrag:
3055 if (not_inSelect) {
3056 SetCursor(&qdarrow);
3057 DragWindow(theWindow, theEvent->where, &r);
3058 SaveWindowPos(theWindow);
3059 } else {
3060 nhbell();
3061 }
3062 break;
3063
3064 case inGrow:
3065 if (not_inSelect) {
3066 SetCursor(&qdarrow);
3067 SetRect(&r, 80, 2 * aWin->row_height + 1, r.right, r.bottom);
3068 if (aWin == theWindows + WIN_MESSAGE)
3069 r.top += SBARHEIGHT;
3070 l = GrowWindow(theWindow, theEvent->where, &r);
3071 SizeWindow(theWindow, l & 0xffff, l >> 16, FALSE);
3072 SaveWindowSize(theWindow);
3073 SetPortWindowPort(theWindow);
3074 GetWindowBounds(theWindow, kWindowContentRgn, &r);
3075 OffsetRect(&r, -r.left, -r.top);
3076 InvalWindowRect(theWindow, &r);
3077 if (aWin->scrollBar) {
3078 DrawScrollbar(aWin);
3079 }
3080 } else {

Callers 1

HandleEventFunction · 0.85

Calls 6

GetNhWinFunction · 0.85
SaveWindowPosFunction · 0.85
SaveWindowSizeFunction · 0.85
DrawScrollbarFunction · 0.85
WindowGoAwayFunction · 0.85
DoMenuEvtFunction · 0.85

Tested by

no test coverage detected