Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch mojave-cleanup Excluding Merge-Ins
This is equivalent to a diff from 5be31db0 to f0df87e1
2018-10-30
| ||
16:15 | Many updates for macOS. Most, but not all, were triggered by changes between OSX 10.13 and 10.14. check-in: e972802e user: culler tags: core-8-6-branch | |
15:49 | Edited comments in tkMacOSXScrlbr.c Closed-Leaf check-in: f0df87e1 user: culler tags: mojave-cleanup | |
03:56 | Fixed scrollbar behavior. Added some padding in buttons for 10.6 only. check-in: d711e835 user: culler tags: mojave-cleanup | |
2018-10-22
| ||
20:42 | Add test textDisp-24.25 exercising a basic testcase for Tablelist (see [1c8aad0efa] check-in: f6ab49c4 user: fvogel tags: core-8-6-branch | |
2018-10-21
| ||
21:41 | Deal with Mojave deprecations and remove unneeded code. check-in: c5a4c766 user: culler tags: mojave-cleanup | |
16:23 | Remove knownBug constraint on test scrollbar-6.27 as this test now passes (checked on Vista - comment there was for Win2K) check-in: 6fee05d9 user: fvogel tags: trunk | |
16:23 | Remove knownBug constraint on test scrollbar-6.27 as this test now passes (checked on Vista - comment there was for Win2K) check-in: 5be31db0 user: fvogel tags: core-8-6-branch | |
2018-10-19
| ||
17:13 | Remove 'knownBug' constraint on tests that do pass without it (text-22.199 and 22.200), and fix error in the regexp for other tests (text-22.202 and 22.203) that then pass (constraint 'knownBug' removed as well therefore). check-in: e8973162 user: fvogel tags: core-8-6-branch | |
Changes to generic/tkBind.c.
︙ | |||
71 72 73 74 75 76 77 | 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 | + + + + + + + + + + + - + + + | * down (and auto-repeating). There may be as many as 3 auto-repeat events * after each mouse button press or release (see the first large comment block * within Tk_BindEvent for more on this), for a total of 20 events to cover * the three button presses and two intervening releases. If you reduce * EVENT_BUFFER_SIZE too much, shift multi-clicks will be lost. */ /* * NOTE: The changes which were needed to make Tk work on OSX 10.14 (Mojave) * also demand that the event ring be a bit bigger. It might be wise to * augment the current double-click pattern matching by adding a new * DoubleClick modifier bit which could be set based on the clickCount of the * Apple NSEvent object. */ #ifndef TK_MAC_OSX #define EVENT_BUFFER_SIZE 45 #else |
︙ |
Changes to generic/tkButton.c.
︙ | |||
875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 | 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 | + + + + + + | * Special note: must cancel any existing idle handler for * TkpDisplayButton; it's no longer needed, and * TkpDisplayButton cleared the REDRAW_PENDING flag. */ Tcl_CancelIdleCall(TkpDisplayButton, butPtr); XFlush(butPtr->display); #ifndef MAC_OSX_TK /* * On the mac you can not sleep in a display proc, and the * flash command doesn't do anything anyway. */ Tcl_Sleep(50); #endif } } break; case COMMAND_INVOKE: if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "invoke"); |
︙ |
Changes to generic/tkTextDisp.c.
︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | + + + + + | #include "tkWinInt.h" #elif defined(__CYGWIN__) #include "tkUnixInt.h" #endif #ifdef MAC_OSX_TK #include "tkMacOSXInt.h" #define OK_TO_LOG (!TkpAppIsDrawing()) #define FORCE_DISPLAY(winPtr) TkpDisplayWindow(winPtr) #else #define OK_TO_LOG 1 #define FORCE_DISPLAY(winPtr) #endif /* * "Calculations of line pixel heights and the size of the vertical * scrollbar." * * Given that tag, font and elide changes can happen to large numbers of |
︙ | |||
199 200 201 202 203 204 205 | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | - + + + + + + - - - + + + + + + + | * precision is different (e.g. Intel) */ #define FP_EQUAL_SCALE(double1, double2, scaleFactor) \ (fabs((double1)-(double2))*((scaleFactor)+1.0) < 0.3) /* |
︙ | |||
3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 | 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 | + + + + + + + + + + + + | */ static void GenerateWidgetViewSyncEvent( TkText *textPtr, /* Information about text widget. */ Bool InSync) /* true if in sync, false otherwise */ { /* * OSX 10.14 needs to be told to display the window when the Text Widget * is in sync. (That is, to run DisplayText inside of the drawRect * method.) Otherwise the screen might not get updated until an event * like a mouse click is received. But that extra drawing corrupts the * data that the test suite is trying to collect. */ if (!tkTextDebug) { FORCE_DISPLAY(textPtr->tkwin); } TkSendVirtualEvent(textPtr->tkwin, "WidgetViewSync", Tcl_NewBooleanObj(InSync)); } /* *---------------------------------------------------------------------- * |
︙ | |||
4132 4133 4134 4135 4136 4137 4138 | 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 | - + - + | return; } interp = textPtr->interp; Tcl_Preserve(interp); if (tkTextDebug) { |
︙ | |||
5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 | 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 | + + | TkText *textPtr, /* Widget record for text widget. */ int mask) /* OR'd collection of bits showing what has * changed. */ { TextDInfo *dInfoPtr = textPtr->dInfoPtr; GC newGC; XGCValues gcValues; Bool inSync = 1; /* * Schedule the window redisplay. See TkTextChanged for the reason why * this has to be done before any calls to FreeDLines. */ if (!(dInfoPtr->flags & REDRAW_PENDING)) { Tcl_DoWhenIdle(DisplayText, textPtr); inSync = 0; } dInfoPtr->flags |= REDRAW_PENDING|REDRAW_BORDERS|DINFO_OUT_OF_DATE |REPICK_NEEDED; /* * (Re-)create the graphics context for drawing the traversal highlight. */ |
︙ | |||
5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 | 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 | + | * be udpated. */ dInfoPtr->xScrollFirst = dInfoPtr->xScrollLast = -1; dInfoPtr->yScrollFirst = dInfoPtr->yScrollLast = -1; if (mask & TK_TEXT_LINE_GEOMETRY) { /* * Set up line metric recalculation. * * Avoid the special zero value, since that is used to mark individual * lines as being out of date. */ |
︙ | |||
5233 5234 5235 5236 5237 5238 5239 | 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 | + + + + - + | dInfoPtr->metricEpoch = -1; if (dInfoPtr->lineUpdateTimer == NULL) { textPtr->refCount++; dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(1, AsyncUpdateLineMetrics, textPtr); inSync = 0; } if (!inSync) { |
︙ |
Changes to macosx/tkMacOSXButton.c.
︙ | |||
416 417 418 419 420 421 422 423 424 425 426 427 428 429 | 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 | + + + | } else { height += butPtr->borderWidth*2; width += butPtr->borderWidth*2; } width += butPtr->inset*2; height += butPtr->inset*2; if ([NSApp macMinorVersion] == 6) { width += 12; } Tk_GeometryRequest(butPtr->tkwin, width, height); Tk_SetInternalBorder(butPtr->tkwin, butPtr->inset); } /* *---------------------------------------------------------------------- |
︙ |
Changes to macosx/tkMacOSXClipboard.c.
︙ | |||
8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | + | * Copyright (c) 2006-2009 Daniel A. Steffen <[email protected]> * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkMacOSXPrivate.h" #include "tkMacOSXConstants.h" #include "tkSelect.h" static NSInteger changeCount = -1; static Tk_Window clipboardOwner = NULL; #pragma mark TKApplication(TKClipboard) |
︙ |
Changes to macosx/tkMacOSXConstants.h.
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 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 | + + + + + + + + + + + + + | * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #ifndef _TKMACCONSTANTS #define _TKMACCONSTANTS #if MAC_OS_X_VERSION_MAX_ALLOWED < 1070 #define NSFullScreenWindowMask (1 << 14) #endif /* * Let's raise a glass for the project manager who improves our lives by * generating deprecation warnings about pointless changes of the names * of constants. */ #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 #define kCTFontDefaultOrientation kCTFontOrientationDefault #define kCTFontVerticalOrientation kCTFontOrientationVertical #endif #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 #define NSOKButton NSModalResponseOK #endif #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101100 #define kCTFontUserFixedPitchFontType kCTFontUIFontUserFixedPitch #endif #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 #define NSAppKitDefined NSEventTypeAppKitDefined #define NSApplicationActivatedEventType NSEventSubtypeApplicationActivated #define NSApplicationDeactivatedEventType NSEventSubtypeApplicationDeactivated #define NSWindowExposedEventType NSEventSubtypeWindowExposed #define NSScreenChangedEventType NSEventSubtypeScreenChanged |
︙ | |||
88 89 90 91 92 93 94 95 96 | 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | + + + + + + + + + + | #define NSClosableWindowMask NSWindowStyleMaskClosable #define NSResizableWindowMask NSWindowStyleMaskResizable #define NSUnifiedTitleAndToolbarWindowMask NSWindowStyleMaskUnifiedTitleAndToolbar #define NSMiniaturizableWindowMask NSWindowStyleMaskMiniaturizable #define NSBorderlessWindowMask NSWindowStyleMaskBorderless #define NSFullScreenWindowMask NSWindowStyleMaskFullScreen #endif #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 #define NSStringPboardType NSPasteboardTypeString #define NSOnState NSControlStateValueOn #define NSOffState NSControlStateValueOff // Now we are also changing names of methods! #define graphicsContextWithGraphicsPort graphicsContextWithCGContext #endif #endif |
Changes to macosx/tkMacOSXDraw.c.
︙ | |||
14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | + + + + + + | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkMacOSXPrivate.h" #include "tkMacOSXDebug.h" #include "tkButton.h" #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 #define GET_CGCONTEXT [[NSGraphicsContext currentContext] CGContext] #else #define GET_CGCONTEXT [[NSGraphicsContext currentContext] graphicsPort] #endif /* #ifdef TK_MAC_DEBUG #define TK_MAC_DEBUG_DRAWING #define TK_MAC_DEBUG_IMAGE_DRAWING #endif */ |
︙ | |||
1485 1486 1487 1488 1489 1490 1491 | 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 | - + | } else { dontDraw = ![view canDraw]; } if (dontDraw) { goto end; } dc.view = view; |
︙ | |||
1654 1655 1656 1657 1658 1659 1660 | 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 | - + | if (macDraw->winPtr && macDraw->flags & TK_CLIP_INVALID) { TkMacOSXUpdateClipRgn(macDraw->winPtr); #ifdef TK_MAC_DEBUG_DRAWING TkMacOSXDbgMsg("%s", macDraw->winPtr->pathName); NSView *view = TkMacOSXDrawableView(macDraw); if ([view lockFocusIfCanDraw]) { |
︙ |
Changes to macosx/tkMacOSXEvent.c.
︙ | |||
108 109 110 111 112 113 114 | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | - - + + + + + + - + + | #pragma mark - /* *---------------------------------------------------------------------- * * TkMacOSXFlushWindows -- * |
Changes to macosx/tkMacOSXFont.c.
︙ | |||
10 11 12 13 14 15 16 17 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + - - - - - - - - - | * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkMacOSXPrivate.h" #include "tkMacOSXFont.h" #include "tkMacOSXConstants.h" |
︙ |
Changes to macosx/tkMacOSXInit.c.
︙ | |||
12 13 14 15 16 17 18 | 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 | - - - + + | * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkMacOSXPrivate.h" #include <sys/stat.h> |
︙ | |||
148 149 150 151 152 153 154 155 156 157 158 159 160 161 | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | + + + + + + + + + + + + + + + + + + + | /* * Install the global autoreleasePool. */ _mainPool = [NSAutoreleasePool new]; [NSApp setPoolLock:0]; /* * Record the OS version we are running on. */ int minorVersion; #if MAC_OS_X_VERSION_MIN_REQUIRED < 101000 Gestalt(gestaltSystemVersionMinor, (SInt32*)&minorVersion); #else NSOperatingSystemVersion systemVersion; systemVersion = [[NSProcessInfo processInfo] operatingSystemVersion]; minorVersion = systemVersion.minorVersion; #endif [NSApp setMacMinorVersion: minorVersion]; /* * We are not drawing yet. */ [NSApp setIsDrawing: NO]; /* * Be our own delegate. */ [self setDelegate:self]; /* * Make sure we are allowed to open windows. |
︙ | |||
251 252 253 254 255 256 257 | 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | - - - - - - - - - - - - - - - | /* * Since it is possible for TkInit to be called multiple times and we * don't want to do the following initialization multiple times we protect * against doing it more than once. */ if (!initialized) { |
︙ |
Changes to macosx/tkMacOSXInt.h.
︙ | |||
195 196 197 198 199 200 201 202 203 204 205 206 207 208 | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | + + + | int clip_y_origin, XRectangle* rectangles, int n, int ordering); #endif MODULE_SCOPE void TkpClipDrawableToRect(Display *display, Drawable d, int x, int y, int width, int height); MODULE_SCOPE void TkpRetainRegion(TkRegion r); MODULE_SCOPE void TkpReleaseRegion(TkRegion r); MODULE_SCOPE void TkpShiftButton(NSButton *button, NSPoint delta); MODULE_SCOPE Bool TkpAppIsDrawing(void); MODULE_SCOPE void TkpDisplayWindow(Tk_Window tkwin); /* * Include the stubbed internal platform-specific API. */ #include "tkIntPlatDecls.h" #endif /* _TKMACINT */ |
Changes to macosx/tkMacOSXKeyEvent.c.
︙ | |||
326 327 328 329 330 331 332 | 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | - + | NSRect rect; NSPoint pt; pt.x = caret_x; pt.y = caret_y; pt = [self convertPoint: pt toView: nil]; |
︙ |
Changes to macosx/tkMacOSXMenu.c.
︙ | |||
781 782 783 784 785 786 787 | 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 | - + | } int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE); NSView *view = [win contentView]; NSRect frame = NSMakeRect(x + 9, tkMacOSXZeroScreenHeight - y - 9, 1, 1); frame.origin = [view convertPoint: |
︙ |
Changes to macosx/tkMacOSXMouseEvent.c.
︙ | |||
86 87 88 89 90 91 92 | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | - + - + | _windowWithMouse = eventWindow; [_windowWithMouse retain]; } /* Create an Xevent to add to the Tk queue. */ NSPoint global, local = [theEvent locationInWindow]; if (eventWindow) { /* local will be in window coordinates. */ |
︙ | |||
369 370 371 372 373 374 375 | 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | - + | if (getLocal) { MacDrawable *macWin = (MacDrawable *) w; NSWindow *win = TkMacOSXDrawableWindow(w); if (win) { NSPoint local; |
︙ | |||
467 468 469 470 471 472 473 | 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 | - + | med.global.h = x; med.global.v = y; med.local = med.global; if (win) { NSPoint local = NSMakePoint(x, tkMacOSXZeroScreenHeight - y); |
︙ |
Changes to macosx/tkMacOSXNotify.c.
︙ | |||
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | 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 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - - - + + + + + - - - - - + + + - - + - - - + + - - - - - + - - - + + - - + + + + + + | #define TSD_INIT() ThreadSpecificData *tsdPtr = \ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)) static void TkMacOSXNotifyExitHandler(ClientData clientData); static void TkMacOSXEventsSetupProc(ClientData clientData, int flags); static void TkMacOSXEventsCheckProc(ClientData clientData, int flags); #ifdef TK_MAC_DEBUG_EVENTS static char* Tk_EventName[39] = { "", "", "KeyPress", /*2*/ "KeyRelease", /*3*/ "ButtonPress", /*4*/ "ButtonRelease", /*5*/ "MotionNotify", /*6*/ "EnterNotify", /*7*/ "LeaveNotify", /*8*/ "FocusIn", /*9*/ "FocusOut", /*10*/ "KeymapNotify", /*11*/ "Expose", /*12*/ "GraphicsExpose", /*13*/ "NoExpose", /*14*/ "VisibilityNotify", /*15*/ "CreateNotify", /*16*/ "DestroyNotify", /*17*/ "UnmapNotify", /*18*/ "MapNotify", /*19*/ "MapRequest", /*20*/ "ReparentNotify", /*21*/ "ConfigureNotify", /*22*/ "ConfigureRequest", /*23*/ "GravityNotify", /*24*/ "ResizeRequest", /*25*/ "CirculateNotify", /*26*/ "CirculateRequest", /*27*/ "PropertyNotify", /*28*/ "SelectionClear", /*29*/ "SelectionRequest", /*30*/ "SelectionNotify", /*31*/ "ColormapNotify", /*32*/ "ClientMessage", /*33*/ "MappingNotify", /*34*/ "VirtualEvent", /*35*/ "ActivateNotify", /*36*/ "DeactivateNotify", /*37*/ "MouseWheelEvent" /*38*/ }; static Tk_RestrictAction InspectQueueRestrictProc( ClientData arg, XEvent *eventPtr) { XVirtualEvent* ve = (XVirtualEvent*) eventPtr; const char *name; long serial = ve->serial; long time = eventPtr->xkey.time; if (eventPtr->type == VirtualEvent) { name = ve->name; } else { name = Tk_EventName[eventPtr->type]; } printf(" > %s;serial = %lu; time=%lu)\n", name, serial, time); return TK_DEFER_EVENT; } /* * Debugging tool which prints the current Tcl queue. */ void DebugPrintQueue(void) { ClientData oldArg; Tk_RestrictProc *oldProc; oldProc = Tk_RestrictEvents(InspectQueueRestrictProc, NULL, &oldArg); printf("Current queue:\n"); while (Tcl_DoOneEvent(TCL_ALL_EVENTS|TCL_DONT_WAIT)) {}; Tk_RestrictEvents(oldProc, oldArg, &oldArg); } # endif #pragma mark TKApplication(TKNotify) @interface NSApplication(TKNotify) /* We need to declare this hidden method. */ - (void) _modalSession: (NSModalSession) session sendEvent: (NSEvent *) event; @end |
︙ | |||
225 226 227 228 229 230 231 | 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | - | untilDate:[NSDate distantPast] inMode:GetRunLoopMode(TkMacOSXGetModalSession()) dequeue:NO]; if (currentEvent) { if (currentEvent.type > 0) { Tcl_SetMaxBlockTime(&zeroBlockTime); } |
︙ | |||
294 295 296 297 298 299 300 | 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | - | #endif if (modalSession) { [NSApp _modalSession:modalSession sendEvent:currentEvent]; } else { [NSApp sendEvent:currentEvent]; } } |
︙ |
Changes to macosx/tkMacOSXPrivate.h.
︙ | |||
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | + + + + | NSArray *_defaultApplicationMenuItems, *_defaultWindowsMenuItems; NSArray *_defaultHelpMenuItems; NSWindow *_windowWithMouse; NSAutoreleasePool *_mainPool; #ifdef __i386__ /* The Objective C runtime used on i386 requires this. */ int _poolLock; int _macMinorVersion; Bool _isDrawing; #endif } @property int poolLock; @property int macMinorVersion; @property Bool isDrawing; @end @interface TKApplication(TKInit) - (NSString *)tkFrameworkImagePath:(NSString*)image; - (void)_resetAutoreleasePool; - (void)_lockAutoreleasePool; - (void)_unlockAutoreleasePool; |
︙ | |||
340 341 342 343 344 345 346 | 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | - - + + | @end VISIBILITY_HIDDEN @interface TKWindow : NSWindow @end @interface NSWindow(TKWm) |
︙ |
Changes to macosx/tkMacOSXScrlbr.c.
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 | 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 | + - + + + + + - + - + - + + + + + + + + + + + + - + - - - - - - - - + - + | /* * tkMacOSXScrollbar.c -- * * This file implements the Macintosh specific portion of the scrollbar * widget. * * Copyright (c) 1996 by Sun Microsystems, Inc. * Copyright 2001-2009, Apple Inc. * Copyright (c) 2006-2009 Daniel A. Steffen <[email protected]> * Copyright (c) 2015 Kevin Walzer/WordTech Commununications LLC. * Copyright (c) 2018 Marc Culler * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkInt.h" #include "tkScrollbar.h" #include "tkMacOSXPrivate.h" #define MIN_SCROLLBAR_VALUE 0 /* * Minimum slider length, in pixels (designed to make sure that the slider is * always easy to grab with the mouse). */ #define MIN_SLIDER_LENGTH 5 |
︙ | |||
108 109 110 111 112 113 114 | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | + + - - + + + + + + + + + + + - + + | Tk_Window tkwin) { MacScrollbar *scrollPtr = (MacScrollbar *)ckalloc(sizeof(MacScrollbar)); scrollPtr->troughGC = None; scrollPtr->copyGC = None; scrollPtr->info = defaultInfo; scrollPtr->buttonDown = false; |
︙ | |||
160 161 162 163 164 165 166 | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | - + | } CGFloat viewHeight = [view bounds].size.height; CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1, .tx = 0, .ty = viewHeight}; CGContextConcatCTM(dc.context, t); |
︙ | |||
184 185 186 187 188 189 190 | 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | - + - - + + + - + | Tk_Height(tkwin) - 2*scrollPtr->highlightWidth, scrollPtr->borderWidth, scrollPtr->relief); Tk_Fill3DRectangle(tkwin, (Pixmap) macWin, scrollPtr->bgBorder, scrollPtr->inset, scrollPtr->inset, Tk_Width(tkwin) - 2*scrollPtr->inset, Tk_Height(tkwin) - 2*scrollPtr->inset, 0, TK_RELIEF_FLAT); |
︙ | |||
224 225 226 227 228 229 230 | 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | - - - - - - + + + + + + + + + + + + + - + + | TkpComputeScrollbarGeometry( register TkScrollbar *scrollPtr) /* Scrollbar whose geometry may have * changed. */ { /* |
︙ | |||
266 267 268 269 270 271 272 | 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | - - + + - - - + + + + | } if (scrollPtr->sliderLast < scrollPtr->sliderFirst + MIN_SLIDER_LENGTH) { scrollPtr->sliderLast = scrollPtr->sliderFirst + MIN_SLIDER_LENGTH; } if (scrollPtr->sliderLast > fieldLength) { scrollPtr->sliderLast = fieldLength; } |
︙ | |||
317 318 319 320 321 322 323 | 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | - - - + - + - - | if (macScrollPtr->troughGC != None) { Tk_FreeGC(scrollPtr->display, macScrollPtr->troughGC); } if (macScrollPtr->copyGC != None) { Tk_FreeGC(scrollPtr->display, macScrollPtr->copyGC); } |
︙ | |||
374 375 376 377 378 379 380 | 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 | - - + + - + - + - - + + + + - - - - + - - + + - - - - - - + + + + + + + + + - | TkpScrollbarPosition( register TkScrollbar *scrollPtr, /* Scrollbar widget record. */ int x, int y) /* Coordinates within scrollPtr's window. */ { /* |
︙ | |||
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 | 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 | + - + - + - + - + - + - + - - + + - + - + - + - - + + - + - + + - + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | *-------------------------------------------------------------- */ static void UpdateControlValues( TkScrollbar *scrollPtr) /* Scrollbar data struct. */ { MacScrollbar *msPtr = (MacScrollbar *)scrollPtr; Tk_Window tkwin = scrollPtr->tkwin; MacDrawable *macWin = (MacDrawable *) Tk_WindowId(scrollPtr->tkwin); double dViewSize; HIRect contrlRect; short width, height; NSView *view = TkMacOSXDrawableView(macWin); CGFloat viewHeight = [view bounds].size.height; NSRect frame; frame = NSMakeRect(macWin->xOff, macWin->yOff, Tk_Width(tkwin), Tk_Height(tkwin)); frame = NSInsetRect(frame, scrollPtr->inset, scrollPtr->inset); frame.origin.y = viewHeight - (frame.origin.y + frame.size.height); contrlRect = NSRectToCGRect(frame); |
︙ | |||
579 580 581 582 583 584 585 | 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 | - + + + + + + + + + + | case DeactivateNotify: TkScrollbarEventuallyRedraw(scrollPtr); break; case ButtonPress: case ButtonRelease: case EnterNotify: case LeaveNotify: |
Changes to macosx/tkMacOSXWindowEvent.c.
︙ | |||
293 294 295 296 297 298 299 300 301 302 303 304 305 306 | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | + + + + + + + + + + + + + + + + + + + + + + + + + | @end #pragma mark - /* *---------------------------------------------------------------------- * * TkpAppIsDrawing -- * * A widget display procedure can call this to determine whether it * is being run inside of the drawRect method. This is needed for * some tests, especially of the Text widget, which record data in * a global Tcl variable and assume that display procedures will be * run in a predictable sequence as Tcl idle tasks. * * Results: * True only while running the drawRect method of a TKContentView; * * Side effects: * None * *---------------------------------------------------------------------- */ MODULE_SCOPE Bool TkpAppIsDrawing(void) { return [NSApp isDrawing]; } /* *---------------------------------------------------------------------- * * GenerateUpdates -- * * Given a Macintosh update region and a Tk window this function geneates * an X Expose event for the window if it meets the update region. The * function will then recursivly have each damaged window generate Expose * events for its child windows. * |
︙ | |||
797 798 799 800 801 802 803 | 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 | - - - - - - + + - + + + + + + + + + + + + + + + - - - - + + + + | @implementation TKContentView(TKWindowEvent) - (void) drawRect: (NSRect) rect { const NSRect *rectsBeingDrawn; NSInteger rectsBeingDrawnCount; |
︙ | |||
886 887 888 889 890 891 892 | 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 | - + + - + | - (void) generateExposeEvents: (HIShapeRef) shape { unsigned long serial; CGRect updateBounds; int updatesNeeded; TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); |
︙ | |||
910 911 912 913 914 915 916 | 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 | - - + - - + + - - + + + | if (updatesNeeded) { /* * First process all of the Expose events. */ |
︙ |
Changes to macosx/tkMacOSXWm.c.
︙ | |||
200 201 202 203 204 205 206 | 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | - + - + - + - + | /* * Conversion of coordinates between window and screen. */ @implementation NSWindow(TKWm) #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 |
︙ | |||
383 384 385 386 387 388 389 | 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 | - + - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + + + + - - + + - - + + - | { id _i1, _i2; } @end @implementation TKWindow: NSWindow |
︙ | |||
802 803 804 805 806 807 808 | 808 809 810 811 812 813 814 815 816 817 818 819 820 821 | - | */ XMapWindow(winPtr->display, winPtr->window); /*Add window to Window menu.*/ NSWindow *win = TkMacOSXDrawableWindow(winPtr->window); [win setExcludedFromWindowsMenu:NO]; |
︙ | |||
5645 5646 5647 5648 5649 5650 5651 | 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 | - | TKContentView *contentView = [[TKContentView alloc] initWithFrame:NSZeroRect]; [window setContentView:contentView]; [contentView release]; [window setDelegate:NSApp]; [window setAcceptsMouseMovedEvents:YES]; [window setReleasedWhenClosed:NO]; |
︙ | |||
5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 | 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 | + + + + + + + + + + + + + + + + + + + + + + + + + + + | geometry.size.height += structureRect.size.height; geometry.origin.y = tkMacOSXZeroScreenHeight - (geometry.origin.y + geometry.size.height); [window setFrame:geometry display:NO]; TkMacOSXRegisterOffScreenWindow((Window) macWin, window); macWin->flags |= TK_HOST_EXISTS; } /* *---------------------------------------------------------------------- * * TkpDisplayWindow -- * * Mark the contentView of this window as needing display so the * window will be drawn by the window manager. If this is called * within the drawRect method, do nothing. * * Results: * None. * * Side effects: * The window's contentView is marked as needing display. * *---------------------------------------------------------------------- */ MODULE_SCOPE void TkpDisplayWindow(Tk_Window tkwin) { if (![NSApp isDrawing]) { TkWindow *winPtr = (TkWindow*)tkwin; NSWindow *w = TkMacOSXDrawableWindow(winPtr->window); [[w contentView] setNeedsDisplay: YES]; } } /* *---------------------------------------------------------------------- * * TkMacOSXRegisterOffScreenWindow -- * * This function adds the passed in Off Screen Port to the hash table |
︙ | |||
6487 6488 6489 6490 6491 6492 6493 | 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 | - + - - + - - - - - - - - - + + + - - - - - - - - + + - - - - - + + + + + + + + + - - + - + - - - + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - + + + + + + - - + + - - - - - + + + + + + - + - - + | TkMacOSXMakeFullscreen( TkWindow *winPtr, NSWindow *window, int fullscreen, Tcl_Interp *interp) { WmInfo *wmPtr = winPtr->wmInfoPtr; |
︙ |
Changes to macosx/tkMacOSXWm.h.
︙ | |||
181 182 183 184 185 186 187 188 189 190 191 192 193 194 | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | + + + + + + + + + | */ WindowClass macClass; UInt64 attributes, configAttributes; TkWindow *scrollWinPtr; /* Ptr to scrollbar handling grow widget. */ TkMenu *menuPtr; NSWindow *window; /* * Space to cache current window state when window becomes Fullscreen. */ unsigned long cachedStyle; unsigned long cachedPresentation; NSRect cachedBounds; } WmInfo; /* * Flag values for WmInfo structures: * * WM_NEVER_MAPPED - non-zero means window has never been mapped; * need to update all info when window is first |
︙ |
Changes to macosx/tkMacOSXXStubs.c.
︙ | |||
174 175 176 177 178 179 180 | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | - + | snprintf(vendor, sizeof(vendor), "Apple AppKit %g", NSAppKitVersionNumber); } display->vendor = vendor; { int major, minor, patch; |
︙ |
Changes to tests/bind.test.
︙ | |||
35 36 37 38 39 40 41 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - - + + - + | } # This function fills the pattern matcher's ring buffer with events of # the specified type. This can be used when testing with generated # events to make sure that there are no stray events in the ring # buffer which might cause the pattern matcher to find unintended # matches. The size of the ring buffer is EVENT_BUFFER_SIZE, which is |
︙ |