diff options
Diffstat (limited to 'macosx/tkMacOSXTest.c')
| -rw-r--r-- | macosx/tkMacOSXTest.c | 99 |
1 files changed, 26 insertions, 73 deletions
diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c index 3be0c92..459c514 100644 --- a/macosx/tkMacOSXTest.c +++ b/macosx/tkMacOSXTest.c @@ -21,9 +21,6 @@ * Forward declarations of procedures defined later in this file: */ -#if !defined(NDEBUG) && MAC_OS_X_VERSION_MAX_ALLOWED < 1080 -static Tcl_ObjCmdProc2 DebuggerObjCmd; -#endif static Tcl_ObjCmdProc2 PressButtonObjCmd; static Tcl_ObjCmdProc2 MoveMouseObjCmd; static Tcl_ObjCmdProc2 InjectKeyEventObjCmd; @@ -55,9 +52,6 @@ TkplatformtestInit( * Add commands for platform specific tests on MacOS here. */ -#if !defined(NDEBUG) && MAC_OS_X_VERSION_MAX_ALLOWED < 1080 - Tcl_CreateObjCommand2(interp, "debugger", DebuggerObjCmd, NULL, NULL); -#endif Tcl_CreateObjCommand2(interp, "pressbutton", PressButtonObjCmd, NULL, NULL); Tcl_CreateObjCommand2(interp, "movemouse", MoveMouseObjCmd, NULL, NULL); Tcl_CreateObjCommand2(interp, "injectkeyevent", InjectKeyEventObjCmd, NULL, NULL); @@ -68,36 +62,6 @@ TkplatformtestInit( /* *---------------------------------------------------------------------- * - * DebuggerObjCmd -- - * - * This procedure simply calls the low level debugger, which was - * deprecated in OSX 10.8. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -#if !defined(NDEBUG) && MAC_OS_X_VERSION_MAX_ALLOWED < 1080 -static int -DebuggerObjCmd( - TCL_UNUSED(void *), - TCL_UNUSED(Tcl_Interp *), - TCL_UNUSED(Tcl_Size), - TCL_UNUSED(Tcl_Obj *const *)) -{ - Debugger(); - return TCL_OK; -} -#endif - -/* - *---------------------------------------------------------------------- - * * MenuBarHeightObjCmd -- * * This procedure calls [NSMenu menuBarHeight] and returns the result @@ -140,6 +104,8 @@ MenuBarHeightObjCmd( * Returns true if and only if the NSView of the drawable is the * current focusView, which on 10.14 and newer systems can only be the * case when within [NSView drawRect]. + * NOTE: This is no longer needed when we use updateLayer instead + * of drawRect. Now it always returns True. * * Side effects: * None @@ -151,21 +117,8 @@ MODULE_SCOPE Bool TkTestLogDisplay( Drawable drawable) { - MacDrawable *macWin = (MacDrawable *)drawable; - NSWindow *win = nil; - if (macWin->toplevel && macWin->toplevel->winPtr && - macWin->toplevel->winPtr->wmInfoPtr && - macWin->toplevel->winPtr->wmInfoPtr->window) { - win = macWin->toplevel->winPtr->wmInfoPtr->window; - } else if (macWin->winPtr && macWin->winPtr->wmInfoPtr && - macWin->winPtr->wmInfoPtr->window) { - win = macWin->winPtr->wmInfoPtr->window; - } - if (win) { - return ([win contentView] == [NSView focusView]); - } else { - return True; - } + (void) drawable; + return True; } /* @@ -210,8 +163,8 @@ PressButtonObjCmd( } if (objc != 3) { - Tcl_WrongNumArgs(interp, 1, objv, "x y"); - return TCL_ERROR; + Tcl_WrongNumArgs(interp, 1, objv, "x y"); + return TCL_ERROR; } for (i = 1; i < objc; i++) { if (Tcl_GetIntFromObj(interp,objv[i],&value) != TCL_OK) { @@ -310,8 +263,8 @@ MoveMouseObjCmd( } if (objc != 3) { - Tcl_WrongNumArgs(interp, 1, objv, "x y"); - return TCL_ERROR; + Tcl_WrongNumArgs(interp, 1, objv, "x y"); + return TCL_ERROR; } for (i = 1; i < objc; i++) { if (Tcl_GetIntFromObj(interp,objv[i],&value) != TCL_OK) { @@ -373,12 +326,12 @@ InjectKeyEventObjCmd( if (objc < 3) { wrongArgs: - Tcl_WrongNumArgs(interp, 1, objv, "option keysym ?arg?"); - return TCL_ERROR; + Tcl_WrongNumArgs(interp, 1, objv, "option keysym ?arg?"); + return TCL_ERROR; } if (Tcl_GetIndexFromObjStruct(interp, objv[1], optionStrings, - sizeof(char *), "option", 0, &index) != TCL_OK) { - return TCL_ERROR; + sizeof(char *), "option", 0, &index) != TCL_OK) { + return TCL_ERROR; } type = types[index]; if (Tcl_GetIntFromObj(interp, objv[2], &keysym) != TCL_OK) { @@ -390,37 +343,37 @@ InjectKeyEventObjCmd( macKC.uint = XKeysymToKeycode(NULL, keysym); for (i = 3; i < objc; i++) { if (Tcl_GetIndexFromObjStruct(interp, objv[i], argStrings, - sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) { - return TCL_ERROR; - } - switch ((enum args) index) { + sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) { + return TCL_ERROR; + } + switch ((enum args) index) { case KEYEVENT_SHIFT: mods |= NSShiftKeyMask; - break; + break; case KEYEVENT_CONTROL: mods |= NSControlKeyMask; - break; + break; case KEYEVENT_OPTION: mods |= NSAlternateKeyMask; - break; + break; case KEYEVENT_COMMAND: mods |= NSCommandKeyMask; - break; + break; case KEYEVENT_FUNCTION: mods |= NSFunctionKeyMask; - break; + break; case KEYEVENT_X: if (++i >= objc) { - goto wrongArgs; - } + goto wrongArgs; + } if (Tcl_GetIntFromObj(interp,objv[i], &x) != TCL_OK) { return TCL_ERROR; } break; case KEYEVENT_Y: if (++i >= objc) { - goto wrongArgs; - } + goto wrongArgs; + } if (Tcl_GetIntFromObj(interp,objv[i], &y) != TCL_OK) { return TCL_ERROR; } @@ -448,7 +401,7 @@ InjectKeyEventObjCmd( } keyEvent = [NSEvent keyEventWithType:type location:NSMakePoint(x, y) - modifierFlags:mods + modifierFlags:mods timestamp:GetCurrentEventTime() windowNumber:0 context:nil |
