1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
/*
* tkMacOSXTest.c --
*
* Contains commands for platform specific tests for
* the Macintosh platform.
*
* Copyright (c) 1996 Sun Microsystems, Inc.
* Copyright 2001-2009, Apple Inc.
* Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkMacOSXPrivate.h"
/*
* Forward declarations of procedures defined later in this file:
*/
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1080
static int DebuggerObjCmd (ClientData dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
#endif
/*
*----------------------------------------------------------------------
*
* TkplatformtestInit --
*
* Defines commands that test platform specific functionality for
* Unix platforms.
*
* Results:
* A standard Tcl result.
*
* Side effects:
* Defines new commands.
*
*----------------------------------------------------------------------
*/
int
TkplatformtestInit(
Tcl_Interp *interp) /* Interpreter to add commands to. */
{
/*
* Add commands for platform specific tests on MacOS here.
*/
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1080
Tcl_CreateObjCommand(interp, "debugger", DebuggerObjCmd, NULL, NULL);
#endif
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* 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 MAC_OS_X_VERSION_MAX_ALLOWED < 1080
static int
DebuggerObjCmd(
ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Not used. */
int objc, /* Not used. */
Tcl_Obj *const objv[]) /* Not used. */
{
Debugger();
return TCL_OK;
}
#endif
/*
*----------------------------------------------------------------------
*
* TkTestLogDisplay --
*
* The test image display procedure calls this to determine whether it
* should write a log message recording that it has being run. On OSX
* 10.14 and later, only calls to the display procedure which occur inside
* of the drawRect method should be logged, since those are the only ones
* which actually draw anything. On earlier systems the opposite is true.
* The calls from within the drawRect method are redundant, since the
* first time the display procedure is run it will do the drawing and that
* first call will usually not occur inside of drawRect.
*
* Results:
* On OSX 10.14 and later, returns true if and only if called from
* within [NSView drawRect]. On earlier systems returns false if
* and only if called from with [NSView drawRect].
*
* Side effects:
* None
*
*----------------------------------------------------------------------
*/
MODULE_SCOPE Bool
TkTestLogDisplay(void) {
if ([NSApp macMinorVersion] >= 14) {
return [NSApp isDrawing];
} else {
return ![NSApp isDrawing];
}
}
/*
* Local Variables:
* mode: objc
* c-basic-offset: 4
* fill-column: 79
* coding: utf-8
* End:
*/
|