diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-02-25 15:45:20 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-02-25 15:45:20 (GMT) |
commit | 7ce9a032b4bbf8ab2859ebff5c2c4b3d39773019 (patch) | |
tree | 2aa09749ca8cab2f47e0ad0bf280020a14110595 /macosx | |
parent | 4b14f3903e949b7e394d794fd296c4de14d423a4 (diff) | |
parent | a2eecbce351c9dc1436c1a7a1582e1df477e7d8d (diff) | |
download | tk-7ce9a032b4bbf8ab2859ebff5c2c4b3d39773019.zip tk-7ce9a032b4bbf8ab2859ebff5c2c4b3d39773019.tar.gz tk-7ce9a032b4bbf8ab2859ebff5c2c4b3d39773019.tar.bz2 |
Merge 8.7
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/GNUmakefile | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXBitmap.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXButton.c | 12 | ||||
-rw-r--r-- | macosx/tkMacOSXClipboard.c | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXColor.h | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXCursor.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXDefault.h | 3 | ||||
-rw-r--r-- | macosx/tkMacOSXDialog.c | 29 | ||||
-rw-r--r-- | macosx/tkMacOSXDraw.c | 52 | ||||
-rw-r--r-- | macosx/tkMacOSXEmbed.c | 12 | ||||
-rw-r--r-- | macosx/tkMacOSXFont.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXImage.c | 10 | ||||
-rw-r--r-- | macosx/tkMacOSXKeyEvent.c | 10 | ||||
-rw-r--r-- | macosx/tkMacOSXKeyboard.c | 40 | ||||
-rw-r--r-- | macosx/tkMacOSXKeysyms.h | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXMenu.c | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXMenubutton.c | 12 | ||||
-rw-r--r-- | macosx/tkMacOSXMouseEvent.c | 6 | ||||
-rw-r--r-- | macosx/tkMacOSXNotify.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXPrivate.h | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXScrlbr.c | 12 | ||||
-rw-r--r-- | macosx/tkMacOSXSubwindows.c | 6 | ||||
-rw-r--r-- | macosx/tkMacOSXSysTray.c | 6 | ||||
-rw-r--r-- | macosx/tkMacOSXTest.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 22 | ||||
-rw-r--r-- | macosx/ttkMacOSXTheme.c | 24 |
26 files changed, 150 insertions, 146 deletions
diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index cf76ac0..9828be5 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -100,7 +100,7 @@ space := ${empty} ${empty} objdir = $(subst ${space},\ ,${OBJ_DIR}) develop_make_args := BUILD_STYLE=Development CONFIGURE_ARGS=--enable-symbols -deploy_make_args := BUILD_STYLE=Deployment INSTALL_TARGET=install +deploy_make_args := BUILD_STYLE=Deployment INSTALL_TARGET=install-strip embedded_make_args := EMBEDDED_BUILD=1 install_make_args := INSTALL_BUILD=1 @@ -193,7 +193,7 @@ ${objdir}/Makefile: ${UNIX_DIR}/Makefile.in ${UNIX_DIR}/configure \ mkdir -p "${OBJ_DIR}" && cd "${OBJ_DIR}" && \ if [ ${UNIX_DIR}/configure -nt config.status ]; then ${UNIX_DIR}/configure -C \ --prefix="${PREFIX}" --bindir="${BINDIR}" --libdir="${LIBDIR}" \ - --mandir="${MANDIR}" --enable-framework \ + --mandir="${MANDIR}" --enable-framework --disable-zipfs \ --with-tcl="${TCL_DIR}" \ ${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS}; else ./config.status; fi ifneq (${VERSION},${TCL_VERSION}) diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c index 3c82663..b5652b7 100644 --- a/macosx/tkMacOSXBitmap.c +++ b/macosx/tkMacOSXBitmap.c @@ -257,7 +257,7 @@ TkpGetNativeAppBitmap( if (iconBitmapTable.buckets && (hPtr = Tcl_FindHashEntry(&iconBitmapTable, name))) { OSType type; - IconBitmap *iconBitmap = Tcl_GetHashValue(hPtr); + IconBitmap *iconBitmap = (IconBitmap *)Tcl_GetHashValue(hPtr); name = NULL; size = NSMakeSize(iconBitmap->width, iconBitmap->height); switch (iconBitmap->kind) { @@ -403,7 +403,7 @@ TkMacOSXIconBitmapObjCmd( } hPtr = Tcl_CreateHashEntry(&iconBitmapTable, name, &isNew); if (!isNew) { - iconBitmap = Tcl_GetHashValue(hPtr); + iconBitmap = (IconBitmap *)Tcl_GetHashValue(hPtr); ckfree(iconBitmap->value); } else { iconBitmap = (IconBitmap *)ckalloc(sizeof(IconBitmap)); diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index f96acc7..40743f6 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -181,8 +181,8 @@ void TkpDisplayButton( ClientData clientData) /* Information about widget. */ { - MacButton *macButtonPtr = clientData; - TkButton *butPtr = clientData; + MacButton *macButtonPtr = (MacButton *)clientData; + TkButton *butPtr = (TkButton *)clientData; Tk_Window tkwin = butPtr->tkwin; Pixmap pixmap; DrawParams* dpPtr = &macButtonPtr->drawParams; @@ -901,8 +901,8 @@ ButtonEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - TkButton *buttonPtr = clientData; - MacButton *mbPtr = clientData; + TkButton *buttonPtr = (TkButton *)clientData; + MacButton *mbPtr = (MacButton *)clientData; if (eventPtr->type == ActivateNotify || eventPtr->type == DeactivateNotify) { @@ -957,7 +957,7 @@ TkMacOSXComputeButtonParams( *btnkind = kThemePushButton; } - if ((butPtr->image == None) && (butPtr->bitmap == None)) { + if ((butPtr->image == NULL) && (butPtr->bitmap == None)) { switch (butPtr->type) { case TYPE_BUTTON: *btnkind = kThemePushButton; @@ -1174,7 +1174,7 @@ TkMacOSXComputeButtonDrawParams( static void PulseDefaultButtonProc(ClientData clientData) { - MacButton *mbPtr = clientData; + MacButton *mbPtr = (MacButton *)clientData; TkpDisplayButton(clientData); /* diff --git a/macosx/tkMacOSXClipboard.c b/macosx/tkMacOSXClipboard.c index 8e2b4a4..41887f4 100644 --- a/macosx/tkMacOSXClipboard.c +++ b/macosx/tkMacOSXClipboard.c @@ -137,13 +137,7 @@ TkSelGetSelection( string = [pb stringForType:type]; } if (string) { - if (target == dispPtr->utf8Atom) { - result = proc(clientData, interp, string.UTF8String); - } else if (target == XA_STRING) { - const char *latin1 = [string - cStringUsingEncoding:NSISOLatin1StringEncoding]; - result = proc(clientData, interp, latin1); - } + result = proc(clientData, interp, string.UTF8String); } } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( diff --git a/macosx/tkMacOSXColor.h b/macosx/tkMacOSXColor.h index 1b4bab6..8fa400b 100644 --- a/macosx/tkMacOSXColor.h +++ b/macosx/tkMacOSXColor.h @@ -185,7 +185,7 @@ static SystemColorDatum systemColorData[] = { {"PlaceholderTextColor", semantic, 0, "grayColor", 0, NULL }, {"SeparatorColor", semantic, 0, "grayColor", 0, NULL }, {"UnemphasizedSelectedTextBackgroundColor", semantic, 0, "grayColor", 0, NULL }, -{NULL, 0, 0, NULL, 0, NULL } +{NULL, rgbColor, 0, NULL, 0, NULL } }; #endif diff --git a/macosx/tkMacOSXCursor.c b/macosx/tkMacOSXCursor.c index a04b6bb..dc6aade 100644 --- a/macosx/tkMacOSXCursor.c +++ b/macosx/tkMacOSXCursor.c @@ -536,7 +536,7 @@ TkpSetCursor( { int cursorChanged = 1; - if (cursor == None) { + if (cursor == NULL) { /* * This is a little tricky. We can't really tell whether * gCurrentCursor is NULL because it was NULL last time around or diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index 1df20f7..fb1292d 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -105,7 +105,6 @@ #define DEF_BUTTON_TAKE_FOCUS NULL #define DEF_BUTTON_TEXT "" #define DEF_BUTTON_TEXT_VARIABLE "" -#define DEF_BUTTON_UNDERLINE "-1" #define DEF_BUTTON_VALUE "" #define DEF_BUTTON_WIDTH "0" #define DEF_BUTTON_WRAP_LENGTH "0" @@ -296,7 +295,6 @@ #define DEF_MENU_ENTRY_CHECK_VARIABLE NULL #define DEF_MENU_ENTRY_RADIO_VARIABLE "selectedButton" #define DEF_MENU_ENTRY_SELECT NULL -#define DEF_MENU_ENTRY_UNDERLINE "-1" /* * Defaults for menus overall: @@ -361,7 +359,6 @@ #define DEF_MENUBUTTON_TAKE_FOCUS "0" #define DEF_MENUBUTTON_TEXT "" #define DEF_MENUBUTTON_TEXT_VARIABLE "" -#define DEF_MENUBUTTON_UNDERLINE "-1" #define DEF_MENUBUTTON_WIDTH "0" #define DEF_MENUBUTTON_WRAP_LENGTH "0" diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 7901499..1123346 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -221,7 +221,7 @@ getFileURL( returnCode: (NSModalResponse) returnCode contextInfo: (void *) contextInfo { - FilePanelCallbackInfo *callbackInfo = contextInfo; + FilePanelCallbackInfo *callbackInfo = (FilePanelCallbackInfo *)contextInfo; if (returnCode == modalOK) { Tcl_Obj *resultObj; @@ -266,7 +266,7 @@ getFileURL( - (void) tkAlertDidEnd: (NSAlert *) alert returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo { - AlertCallbackInfo *callbackInfo = contextInfo; + AlertCallbackInfo *callbackInfo = (AlertCallbackInfo *)contextInfo; if (returnCode >= NSAlertFirstButtonReturn) { Tcl_Obj *resultObj = Tcl_NewStringObj(alertButtonStrings[ @@ -422,7 +422,7 @@ Tk_ChooseColorObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { int result = TCL_ERROR; - Tk_Window parent, tkwin = clientData; + Tk_Window parent, tkwin = (Tk_Window)clientData; const char *title = NULL; int i; NSColor *color = nil, *initialColor = nil; @@ -677,7 +677,7 @@ Tk_GetOpenFileObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window tkwin = clientData; + Tk_Window tkwin = (Tk_Window)clientData; char *str; int i, result = TCL_ERROR, haveParentOption = 0; int index, len, multiple = 0; @@ -1679,10 +1679,10 @@ FontchooserEvent( if (!fontchooserInterp) { return; } - fcdPtr = Tcl_GetAssocData(fontchooserInterp, "::tk::fontchooser", NULL); + fcdPtr = (FontchooserData *)Tcl_GetAssocData(fontchooserInterp, "::tk::fontchooser", NULL); switch (kind) { case FontchooserClosed: - if (fcdPtr->parent != None) { + if (fcdPtr->parent != NULL) { Tk_SendVirtualEvent(fcdPtr->parent, "TkFontchooserVisibility", NULL); fontchooserInterp = NULL; } @@ -1738,7 +1738,7 @@ FontchooserCget( switch(optionIndex) { case FontchooserParent: - if (fcdPtr->parent != None) { + if (fcdPtr->parent != NULL) { resObj = Tcl_NewStringObj( ((TkWindow *)fcdPtr->parent)->pathName, -1); } else { @@ -1801,7 +1801,7 @@ FontchooserConfigureCmd( Tcl_Obj *const objv[]) { Tk_Window tkwin = (Tk_Window)clientData; - FontchooserData *fcdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser", + FontchooserData *fcdPtr = (FontchooserData *)Tcl_GetAssocData(interp, "::tk::fontchooser", NULL); int i, r = TCL_OK; @@ -1858,7 +1858,7 @@ FontchooserConfigureCmd( Tk_Window parent = Tk_NameToWindow(interp, Tcl_GetString(objv[i+1]), tkwin); - if (parent == None) { + if (parent == NULL) { return TCL_ERROR; } if (fcdPtr->parent) { @@ -1885,7 +1885,7 @@ FontchooserConfigureCmd( fcdPtr->titleObj = NULL; } break; - case FontchooserFont: + case FontchooserFont: { Tcl_GetStringFromObj(objv[i+1], &len); if (len) { Tk_Font f = Tk_AllocFontFromObj(interp, tkwin, objv[i+1]); @@ -1919,6 +1919,7 @@ FontchooserConfigureCmd( "TkFontchooserFontChanged", NULL); } break; + } case FontchooserCmd: if (fcdPtr->cmdObj) { Tcl_DecrRefCount(fcdPtr->cmdObj); @@ -1964,10 +1965,10 @@ FontchooserShowCmd( TCL_UNUSED(int), TCL_UNUSED(Tcl_Obj *const *)) { - FontchooserData *fcdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser", + FontchooserData *fcdPtr = (FontchooserData *)Tcl_GetAssocData(interp, "::tk::fontchooser", NULL); - if (fcdPtr->parent == None) { + if (fcdPtr->parent == NULL) { fcdPtr->parent = (Tk_Window)clientData; Tk_CreateEventHandler(fcdPtr->parent, StructureNotifyMask, FontchooserParentEventHandler, fcdPtr); @@ -2042,7 +2043,7 @@ FontchooserParentEventHandler( ClientData clientData, XEvent *eventPtr) { - FontchooserData *fcdPtr = clientData; + FontchooserData *fcdPtr = (FontchooserData *)clientData; if (eventPtr->type == DestroyNotify) { Tk_DeleteEventHandler(fcdPtr->parent, StructureNotifyMask, @@ -2074,7 +2075,7 @@ DeleteFontchooserData( ClientData clientData, Tcl_Interp *interp) { - FontchooserData *fcdPtr = clientData; + FontchooserData *fcdPtr = (FontchooserData *)clientData; if (fcdPtr->titleObj) { Tcl_DecrRefCount(fcdPtr->titleObj); diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 220b1eb..1fa3e1f 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -1332,35 +1332,37 @@ TkMacOSXSetupDrawingContext( * Finish configuring the drawing context. */ - CGAffineTransform t = { - .a = 1, .b = 0, - .c = 0, .d = -1, - .tx = 0, - .ty = dc.portBounds.size.height - }; - - dc.portBounds.origin.x += macDraw->xOff; - dc.portBounds.origin.y += macDraw->yOff; - CGContextSaveGState(dc.context); - CGContextSetTextDrawingMode(dc.context, kCGTextFill); - CGContextConcatCTM(dc.context, t); - if (dc.clipRgn) { + { + CGAffineTransform t = { + .a = 1, .b = 0, + .c = 0, .d = -1, + .tx = 0, + .ty = dc.portBounds.size.height + }; -#ifdef TK_MAC_DEBUG_DRAWING + dc.portBounds.origin.x += macDraw->xOff; + dc.portBounds.origin.y += macDraw->yOff; CGContextSaveGState(dc.context); - ChkErr(HIShapeReplacePathInCGContext, dc.clipRgn, dc.context); - CGContextSetRGBFillColor(dc.context, 1.0, 0.0, 0.0, 0.1); - CGContextEOFillPath(dc.context); - CGContextRestoreGState(dc.context); -#endif /* TK_MAC_DEBUG_DRAWING */ + CGContextSetTextDrawingMode(dc.context, kCGTextFill); + CGContextConcatCTM(dc.context, t); + if (dc.clipRgn) { - CGRect r; - CGRect b = CGRectApplyAffineTransform( - CGContextGetClipBoundingBox(dc.context), t); - if (!HIShapeIsRectangular(dc.clipRgn) || - !CGRectContainsRect(*HIShapeGetBounds(dc.clipRgn, &r), b)) { +#ifdef TK_MAC_DEBUG_DRAWING + CGContextSaveGState(dc.context); ChkErr(HIShapeReplacePathInCGContext, dc.clipRgn, dc.context); - CGContextEOClip(dc.context); + CGContextSetRGBFillColor(dc.context, 1.0, 0.0, 0.0, 0.1); + CGContextEOFillPath(dc.context); + CGContextRestoreGState(dc.context); +#endif /* TK_MAC_DEBUG_DRAWING */ + + CGRect r; + CGRect b = CGRectApplyAffineTransform( + CGContextGetClipBoundingBox(dc.context), t); + if (!HIShapeIsRectangular(dc.clipRgn) || + !CGRectContainsRect(*HIShapeGetBounds(dc.clipRgn, &r), b)) { + ChkErr(HIShapeReplacePathInCGContext, dc.clipRgn, dc.context); + CGContextEOClip(dc.context); + } } } if (gc) { diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index 98a40e6..832f404 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -704,7 +704,7 @@ EmbeddedEventProc( ClientData clientData, /* Token for container window. */ XEvent *eventPtr) /* ResizeRequest event. */ { - TkWindow *winPtr = clientData; + TkWindow *winPtr = (TkWindow *)clientData; if (eventPtr->type == DestroyNotify) { EmbedWindowDeleted(winPtr); @@ -739,7 +739,7 @@ ContainerEventProc( ClientData clientData, /* Token for container window. */ XEvent *eventPtr) /* ResizeRequest event. */ { - TkWindow *winPtr = clientData; + TkWindow *winPtr = (TkWindow *)clientData; Container *containerPtr; Tk_ErrorHandler errHandler; @@ -847,7 +847,7 @@ EmbedStructureProc( ClientData clientData, /* Token for container window. */ XEvent *eventPtr) /* ResizeRequest event. */ { - Container *containerPtr = clientData; + Container *containerPtr = (Container *)clientData; Tk_ErrorHandler errHandler; if (eventPtr->type == ConfigureNotify) { @@ -856,7 +856,7 @@ EmbedStructureProc( * Send a ConfigureNotify to the embedded application. */ - if (containerPtr->embeddedPtr != None) { + if (containerPtr->embeddedPtr != NULL) { TkDoConfigureNotify(containerPtr->embeddedPtr); } if (containerPtr->embedded != None) { @@ -901,7 +901,7 @@ EmbedActivateProc( ClientData clientData, /* Token for container window. */ XEvent *eventPtr) /* ResizeRequest event. */ { - Container *containerPtr = clientData; + Container *containerPtr = (Container *)clientData; if (containerPtr->embeddedPtr != NULL) { if (eventPtr->type == ActivateNotify) { @@ -936,7 +936,7 @@ EmbedFocusProc( ClientData clientData, /* Token for container window. */ XEvent *eventPtr) /* ResizeRequest event. */ { - Container *containerPtr = clientData; + Container *containerPtr = (Container *)clientData; Display *display; XEvent event; diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index fc68aa9..00a0b9e 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -112,7 +112,7 @@ static int CreateNamedSystemFont(Tcl_Interp *interp, self = [self init]; if (self) { Tcl_DStringInit(&_ds); - Tcl_UtfToChar16DString(bytes, len, &_ds); + Tcl_UtfToChar16DString((const char *)bytes, len, &_ds); _string = [[NSString alloc] initWithCharactersNoCopy:(unichar *)Tcl_DStringValue(&_ds) length:Tcl_DStringLength(&_ds)>>1 diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index 5f74f4f..7646834 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -88,7 +88,7 @@ TkMacOSXCreateCGImageWithXImage( *destPtr++ = xBitReverseTable[(unsigned char)(*(srcPtr++))]; } } else { - data = memcpy(ckalloc(len), image->data + image->xoffset, len); + data = (char *)memcpy(ckalloc(len), image->data + image->xoffset, len); } if (data) { provider = CGDataProviderCreateWithData(data, data, len, @@ -118,7 +118,7 @@ TkMacOSXCreateCGImageWithXImage( bitmapInfo = (image->byte_order == MSBFirst ? kCGBitmapByteOrder32Little : kCGBitmapByteOrder32Big); bitmapInfo |= kCGImageAlphaLast; - data = memcpy(ckalloc(len), image->data + image->xoffset, len); + data = (char *)memcpy(ckalloc(len), image->data + image->xoffset, len); if (data) { provider = CGDataProviderCreateWithData(data, data, len, releaseData); @@ -338,7 +338,7 @@ XCreateImage( XImage *ximage; display->request++; - ximage = ckalloc(sizeof(XImage)); + ximage = (XImage *)ckalloc(sizeof(XImage)); ximage->height = height; ximage->width = width; @@ -634,7 +634,7 @@ XGetImage( NSBitmapImageRep* bitmapRep = nil; NSUInteger bitmap_fmt = 0; XImage* imagePtr = NULL; - char* bitmap = NULL; + char *bitmap = NULL; char R, G, B, A; int depth = 32, offset = 0, bitmap_pad = 0; unsigned int bytes_per_row, size, row, n, m; @@ -657,7 +657,7 @@ XGetImage( bitmap_fmt = [bitmapRep bitmapFormat]; size = [bitmapRep bytesPerPlane]; bytes_per_row = [bitmapRep bytesPerRow]; - bitmap = ckalloc(size); + bitmap = (char *)ckalloc(size); if (!bitmap || (bitmap_fmt != 0 && bitmap_fmt != 1) || [bitmapRep samplesPerPixel] != 4 diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 54a7b5a..4d5a98a 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -53,7 +53,7 @@ static NSUInteger textInputModifiers; TkWindow *winPtr = TkMacOSXGetTkWindow(w), *grabWinPtr, *focusWinPtr; Tk_Window tkwin = (Tk_Window)winPtr; NSEventType type = [theEvent type]; - NSUInteger virtual = [theEvent keyCode]; + NSUInteger virt = [theEvent keyCode]; NSUInteger modifiers = ([theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask); XEvent xEvent; @@ -126,7 +126,7 @@ static NSUInteger textInputModifiers; TKLog(@"-[%@(%p) %s] repeat=%d mods=%x char=%x code=%lu c=%d type=%d", [self class], self, _cmd, (type == NSKeyDown) && [theEvent isARepeat], modifiers, keychar, - virtual, w, type); + virt, w, type); #endif } @@ -215,7 +215,7 @@ static NSUInteger textInputModifiers; macKC.v.o_s = ((modifiers & NSShiftKeyMask ? INDEX_SHIFT : 0) | (modifiers & NSAlternateKeyMask ? INDEX_OPTION : 0)); - macKC.v.virtual = virtual; + macKC.v.virt = virt; switch (type) { case NSFlagsChanged: @@ -349,9 +349,9 @@ static NSUInteger textInputModifiers; UniChar lowChar = [str characterAtIndex:++i]; macKC.v.keychar = CFStringGetLongCharacterForSurrogatePair( (UniChar)keychar, lowChar); - macKC.v.virtual = NON_BMP_VIRTUAL; + macKC.v.virt = NON_BMP_VIRTUAL; } else if (repRange.location == 0 || sendingIMEText) { - macKC.v.virtual = REPLACEMENT_VIRTUAL; + macKC.v.virt = REPLACEMENT_VIRTUAL; } else { macKC.uint = TkMacOSXAddVirtual(macKC.uint); xEvent.xkey.state |= INDEX2STATE(macKC.x.xvirtual); diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c index e6f51d8..adc9906 100644 --- a/macosx/tkMacOSXKeyboard.c +++ b/macosx/tkMacOSXKeyboard.c @@ -143,7 +143,7 @@ static BOOL keyboardChanged = YES; static void InitHashTables(void); static void UpdateKeymaps(void); static int KeyDataToUnicode(UniChar *uniChars, int maxChars, - UInt16 keyaction, UInt32 virtual, UInt32 modifiers, + UInt16 keyaction, UInt32 virt, UInt32 modifiers, UInt32 * deadKeyStatePtr); #pragma mark TKApplication(TKKeyboard) @@ -188,15 +188,15 @@ InitHashTables(void) Tcl_InitHashTable(&special2keysym, TCL_ONE_WORD_KEYS); Tcl_InitHashTable(&keysym2keycode, TCL_ONE_WORD_KEYS); - for (kPtr = keyArray; kPtr->virtual != 0; kPtr++) { + for (kPtr = keyArray; kPtr->virt != 0; kPtr++) { MacKeycode macKC; macKC.v.o_s = 0; - hPtr = Tcl_CreateHashEntry(&special2keysym, INT2PTR(kPtr->virtual), + hPtr = Tcl_CreateHashEntry(&special2keysym, INT2PTR(kPtr->virt), &dummy); Tcl_SetHashValue(hPtr, INT2PTR(kPtr->keysym)); hPtr = Tcl_CreateHashEntry(&keysym2keycode, INT2PTR(kPtr->keysym), &dummy); - macKC.v.virtual = kPtr->virtual; + macKC.v.virt = kPtr->virt; macKC.v.keychar = kPtr->keychar; Tcl_SetHashValue(hPtr, INT2PTR(macKC.uint)); @@ -252,7 +252,7 @@ UpdateKeymaps() { static Bool keymapInitialized = false; Tcl_HashEntry *hPtr; - int virtual, index, dummy; + int virt, index, dummy; if (!keymapInitialized) { Tcl_InitHashTable(&unichar2xvirtual, TCL_ONE_WORD_KEYS); @@ -268,12 +268,12 @@ UpdateKeymaps() */ for (index = 3; index >= 0; index--) { - for (virtual = 0; virtual < 128; virtual++) { + for (virt = 0; virt < 128; virt++) { MacKeycode macKC; - macKC.v = (keycode_v) {.virtual = virtual, .o_s = index, .keychar = 0}; + macKC.v = (keycode_v) {.virt = virt, .o_s = index, .keychar = 0}; int modifiers = INDEX2CARBON(index), result; UniChar keychar = 0; - result = KeyDataToUnicode(&keychar, 1, kUCKeyActionDown, virtual, + result = KeyDataToUnicode(&keychar, 1, kUCKeyActionDown, virt, modifiers, NULL); if (keychar == 0x10) { @@ -284,7 +284,7 @@ UpdateKeymaps() continue; } macKC.v.keychar = keychar; - if (! ON_KEYPAD(virtual)) { + if (! ON_KEYPAD(virt)) { hPtr = Tcl_CreateHashEntry(&unichar2xvirtual, INT2PTR(macKC.x.keychar), &dummy); Tcl_SetHashValue(hPtr, INT2PTR(macKC.x.xvirtual)); @@ -326,7 +326,7 @@ KeyDataToUnicode( UniChar *uniChars, int maxChars, UInt16 keyaction, - UInt32 virtual, + UInt32 virt, UInt32 modifiers, UInt32 *deadKeyStatePtr) { @@ -355,14 +355,14 @@ KeyDataToUnicode( UInt32 dummyState; OSStatus err; - virtual &= 0xFF; + virt &= 0xFF; modifiers = (modifiers >> 8) & 0xFF; if (!deadKeyStatePtr) { options = kUCKeyTranslateNoDeadKeysMask; dummyState = 0; deadKeyStatePtr = &dummyState; } - err = ChkErr(UCKeyTranslate, layoutData, virtual, keyaction, modifiers, + err = ChkErr(UCKeyTranslate, (const UCKeyboardLayout *)layoutData, virt, keyaction, modifiers, keyboardType, options, deadKeyStatePtr, maxChars, &actuallength, uniChars); if (!actuallength && *deadKeyStatePtr) { @@ -424,7 +424,7 @@ XkbKeycodeToKeysym( * an Fn function key or Tab, Backspace, Home, End, etc. */ - hPtr = Tcl_FindHashEntry(&special2keysym, INT2PTR(macKC.v.virtual)); + hPtr = Tcl_FindHashEntry(&special2keysym, INT2PTR(macKC.v.virt)); if (hPtr != NULL) { return (KeySym) Tcl_GetHashValue(hPtr); } @@ -435,7 +435,7 @@ XkbKeycodeToKeysym( * keysym. */ - if (macKC.v.virtual > 127) { + if (macKC.v.virt > 127) { hPtr = Tcl_FindHashEntry(&unichar2keysym, INT2PTR(macKC.v.keychar)); if (hPtr != NULL) { return (KeySym) Tcl_GetHashValue(hPtr); @@ -450,7 +450,7 @@ XkbKeycodeToKeysym( */ modifiers = INDEX2CARBON(macKC.v.o_s); - result = KeyDataToUnicode(&keychar, 1, kUCKeyActionDown, macKC.v.virtual, + result = KeyDataToUnicode(&keychar, 1, kUCKeyActionDown, macKC.v.virt, modifiers, NULL); if (result) { hPtr = Tcl_FindHashEntry(&unichar2keysym, INT2PTR(keychar)); @@ -637,7 +637,7 @@ XKeysymToKeycode( hPtr = Tcl_FindHashEntry(&keysym2keycode, INT2PTR(keysym)); if (hPtr != NULL) { - return (KeyCode) Tcl_GetHashValue(hPtr); + return (KeyCode) PTR2INT(Tcl_GetHashValue(hPtr)); } /* @@ -645,7 +645,7 @@ XKeysymToKeycode( * else. */ - macKC.v.virtual = NO_VIRTUAL; + macKC.v.virt = NO_VIRTUAL; macKC.v.o_s = 0; macKC.v.keychar = 0; @@ -719,7 +719,7 @@ TkpSetKeycodeAndState( if (macKC.v.keychar < 0xF700) { UniChar keychar = macKC.v.keychar; NSString *str, *lower, *upper; - if (macKC.v.virtual != NO_VIRTUAL) { + if (macKC.v.virt != NO_VIRTUAL) { macKC.x.keychar = xvirtual2unichar[macKC.x.xvirtual]; } else { str = [[NSString alloc] initWithCharacters:&keychar length:1]; @@ -781,7 +781,7 @@ TkpGetKeySym( */ if (macKC.v.keychar == MOD_KEYCHAR) { - switch (macKC.v.virtual) { + switch (macKC.v.virt) { case 54: return XK_Meta_R; case 55: @@ -953,7 +953,7 @@ TkMacOSXAddVirtual( unsigned long data = (unsigned long) Tcl_GetHashValue(hPtr); macKC.x.xvirtual = (unsigned int) data; } else { - macKC.v.virtual = NO_VIRTUAL; + macKC.v.virt = NO_VIRTUAL; } return macKC.uint; } diff --git a/macosx/tkMacOSXKeysyms.h b/macosx/tkMacOSXKeysyms.h index 7bd250b..1f6f260 100644 --- a/macosx/tkMacOSXKeysyms.h +++ b/macosx/tkMacOSXKeysyms.h @@ -31,7 +31,7 @@ */ typedef struct { - int virtual; /* value of [NSEvent keyCode] */ + int virt; /* value of [NSEvent keyCode] */ KeySym keysym; /* X11 keysym */ KeyCode keychar; /* XEvent keycode & 0xFFFF */ } KeyInfo; diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 12ad2f3..c618974 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -232,7 +232,7 @@ TKBackgroundLoop *backgroundLoop = nil; - (TkMenu *) tkMenu { - return _tkMenu; + return (TkMenu *)_tkMenu; } - (int) tkIndexOfItem: (NSMenuItem *) menuItem @@ -409,7 +409,7 @@ TKBackgroundLoop *backgroundLoop = nil; (void)menu; if (_tkMenu) { - RecursivelyClearActiveMenu(_tkMenu); + RecursivelyClearActiveMenu((TkMenu *)_tkMenu); } } @@ -433,7 +433,7 @@ TKBackgroundLoop *backgroundLoop = nil; Tcl_Preserve(interp); Tcl_Preserve(menuPtr); - int result = TkPostCommand(_tkMenu); + int result = TkPostCommand(menuPtr); if (result!=TCL_OK && result!=TCL_CONTINUE && result!=TCL_BREAK) { Tcl_AddErrorInfo(interp, "\n (menu preprocess)"); @@ -696,7 +696,7 @@ TkpConfigureMenuEntry( Tk_SizeOfImage(mePtr->image, &imageWidth, &imageHeight); image = TkMacOSXGetNSImageFromTkImage(mePtr->menuPtr->display, mePtr->image, imageWidth, imageHeight); - } else if (mePtr->bitmapPtr != None) { + } else if (mePtr->bitmapPtr != NULL) { Pixmap bitmap = Tk_GetBitmapFromObj(mePtr->menuPtr->tkwin, mePtr->bitmapPtr); diff --git a/macosx/tkMacOSXMenubutton.c b/macosx/tkMacOSXMenubutton.c index 7de2b46..0502029 100644 --- a/macosx/tkMacOSXMenubutton.c +++ b/macosx/tkMacOSXMenubutton.c @@ -165,8 +165,8 @@ void TkpDisplayMenuButton( ClientData clientData) /* Information about widget. */ { - MacMenuButton *mbPtr = clientData; - TkMenuButton *butPtr = clientData; + MacMenuButton *mbPtr = (MacMenuButton *)clientData; + TkMenuButton *butPtr = (TkMenuButton *)clientData; Tk_Window tkwin = butPtr->tkwin; Pixmap pixmap; DrawParams *dpPtr = &mbPtr->drawParams; @@ -240,8 +240,8 @@ TkpDestroyMenuButton( */ void -TkpComputeMenuButtonGeometry(butPtr) - TkMenuButton *butPtr; /* Widget record for menu button. */ +TkpComputeMenuButtonGeometry( + TkMenuButton *butPtr) /* Widget record for menu button. */ { int width, height, avgWidth, haveImage = 0, haveText = 0; int txtWidth, txtHeight; @@ -689,8 +689,8 @@ MenuButtonEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - TkMenuButton *buttonPtr = clientData; - MacMenuButton *mbPtr = clientData; + TkMenuButton *buttonPtr = (TkMenuButton *)clientData; + MacMenuButton *mbPtr = (MacMenuButton *)clientData; if (eventPtr->type == ActivateNotify || eventPtr->type == DeactivateNotify) { diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index c4ba1bd..46f20bc 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -686,6 +686,12 @@ TkpWarpPointer( } CGWarpMouseCursorPosition(pt); + + if (dispPtr->warpWindow) { + TkGenerateButtonEventForXPointer(Tk_WindowId(dispPtr->warpWindow)); + } else { + TkGenerateButtonEventForXPointer(None); + } } /* diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 25dff29..1e78521 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -52,7 +52,7 @@ typedef struct ThreadSpecificData { } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; -#define TSD_INIT() ThreadSpecificData *tsdPtr = \ +#define TSD_INIT() ThreadSpecificData *tsdPtr = (ThreadSpecificData *) \ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)) static void TkMacOSXNotifyExitHandler(ClientData clientData); diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 269e4c4..e88f1a0 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -138,7 +138,7 @@ typedef struct keycode_v_t { unsigned keychar: 22; /* UCS-32 character */ unsigned o_s: 2; /* State of Option and Shift keys. */ - unsigned virtual: 8; /* 8-bit virtual keycode - identifies a key. */ + unsigned virt: 8; /* 8-bit virtual keycode - identifies a key. */ } keycode_v; typedef struct keycode_x_t { @@ -160,7 +160,7 @@ typedef union MacKeycode_t { * Note that 0x7f is del and 0xF8FF is the Apple Logo character. */ -#define ON_KEYPAD(virtual) ((virtual >= 0x41) && (virtual <= 0x5C)) +#define ON_KEYPAD(virt) ((virt >= 0x41) && (virt <= 0x5C)) #define IS_PRINTABLE(keychar) ((keychar >= 0x20) && (keychar != 0x7f) && \ ((keychar < 0xF700) || keychar >= 0xF8FF)) diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index 5cd1f56..6ed53ee 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -246,7 +246,7 @@ void TkpDisplayScrollbar( ClientData clientData) /* Information about window. */ { - TkScrollbar *scrollPtr = clientData; + TkScrollbar *scrollPtr = (TkScrollbar *)clientData; MacScrollbar *msPtr = (MacScrollbar *) scrollPtr; Tk_Window tkwin = scrollPtr->tkwin; TkWindow *winPtr = (TkWindow *) tkwin; @@ -456,10 +456,10 @@ TkpDestroyScrollbar( { MacScrollbar *macScrollPtr = (MacScrollbar *) scrollPtr; - if (macScrollPtr->troughGC != None) { + if (macScrollPtr->troughGC != NULL) { Tk_FreeGC(scrollPtr->display, macScrollPtr->troughGC); } - if (macScrollPtr->copyGC != None) { + if (macScrollPtr->copyGC != NULL) { Tk_FreeGC(scrollPtr->display, macScrollPtr->copyGC); } } @@ -770,7 +770,7 @@ ScrollbarEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - TkScrollbar *scrollPtr = clientData; + TkScrollbar *scrollPtr = (TkScrollbar *)clientData; switch (eventPtr->type) { case UnmapNotify: @@ -784,10 +784,10 @@ ScrollbarEventProc( case ButtonRelease: case EnterNotify: case LeaveNotify: - ScrollbarEvent(clientData, eventPtr); + ScrollbarEvent(scrollPtr, eventPtr); break; default: - TkScrollbarEventProc(clientData, eventPtr); + TkScrollbarEventProc(scrollPtr, eventPtr); } } diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 65efb86..32d5436 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -105,7 +105,7 @@ XDestroyWindow( macWin->view = nil; /* - * Delay deletion of a toplevel data structure untill all children have + * Delay deletion of a toplevel data structure until all children have * been deleted. */ @@ -973,7 +973,7 @@ InvalViewRect( void *ref) { static CGAffineTransform t; - TKContentView *view = ref; + TKContentView *view = (TKContentView *)ref; NSRect dirtyRect; if (!view) { @@ -1435,7 +1435,7 @@ Tk_FreePixmap( display->request++; if (macPix->context) { - char *data = CGBitmapContextGetData(macPix->context); + char *data = (char *)CGBitmapContextGetData(macPix->context); if (data) { ckfree(data); diff --git a/macosx/tkMacOSXSysTray.c b/macosx/tkMacOSXSysTray.c index 563b58f..a0f0829 100644 --- a/macosx/tkMacOSXSysTray.c +++ b/macosx/tkMacOSXSysTray.c @@ -437,7 +437,11 @@ typedef TkStatusItem** StatusItemInfo; */ DEBUG_LOG("willPresentNotification\n"); - completionHandler(ALERT_OPTION); +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400 + if (@available(macOS 11.0, *)) { + completionHandler(ALERT_OPTION); + } +#endif } - (void) userNotificationCenter:(UNUserNotificationCenter *)center diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c index 730b8a4..60167ca 100644 --- a/macosx/tkMacOSXTest.c +++ b/macosx/tkMacOSXTest.c @@ -376,7 +376,7 @@ InjectKeyEventObjCmd( characters:chars charactersIgnoringModifiers:unmod isARepeat:NO - keyCode:macKC.v.virtual]; + keyCode:macKC.v.virt]; [NSApp postEvent:keyEvent atStart:NO]; return TCL_OK; } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 90827dd..c78bc02 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -1482,7 +1482,7 @@ WmSetAttribute( } break; case WMATT_TITLEPATH: { - const char *path = Tcl_FSGetNativePath(value); + const char *path = (const char *)Tcl_FSGetNativePath(value); NSString *filename = @""; if (path && *path) { @@ -1636,7 +1636,7 @@ WmAttributesCmd( Tcl_ListObjAppendElement(NULL, result, Tcl_NewStringObj(WmAttributeNames[attribute], -1)); Tcl_ListObjAppendElement(NULL, result, - WmGetAttribute(winPtr, macWindow, attribute)); + WmGetAttribute(winPtr, macWindow, (WmAttribute)attribute)); } Tcl_SetObjResult(interp, result); } else if (objc == 4) { /* wm attributes $win -attribute */ @@ -1644,7 +1644,7 @@ WmAttributesCmd( sizeof(char *), "attribute", 0, &attribute) != TCL_OK) { return TCL_ERROR; } - Tcl_SetObjResult(interp, WmGetAttribute(winPtr, macWindow, attribute)); + Tcl_SetObjResult(interp, WmGetAttribute(winPtr, macWindow, (WmAttribute)attribute)); } else if ((objc - 3) % 2 == 0) { /* wm attributes $win -att value... */ int i; @@ -1653,7 +1653,7 @@ WmAttributesCmd( sizeof(char *), "attribute", 0, &attribute) != TCL_OK) { return TCL_ERROR; } - if (WmSetAttribute(winPtr, macWindow, interp, attribute, objv[i+1]) + if (WmSetAttribute(winPtr, macWindow, interp, (WmAttribute)attribute, objv[i+1]) != TCL_OK) { return TCL_ERROR; } @@ -4130,7 +4130,7 @@ TopLevelEventProc( ClientData clientData, /* Window for which event occurred. */ XEvent *eventPtr) /* Event that just happened. */ { - TkWindow *winPtr = clientData; + TkWindow *winPtr = (TkWindow *)clientData; winPtr->wmInfoPtr->flags |= WM_VROOT_OFFSET_STALE; if (eventPtr->type == DestroyNotify) { @@ -4216,7 +4216,7 @@ static void UpdateGeometryInfo( ClientData clientData) /* Pointer to the window's record. */ { - TkWindow *winPtr = clientData; + TkWindow *winPtr = (TkWindow *)clientData; WmInfo *wmPtr = winPtr->wmInfoPtr; int x, y, width, height, min, max; @@ -5574,8 +5574,8 @@ TkMacOSXZoomToplevel( void *whichWindow, /* The Macintosh window to zoom. */ short zoomPart) /* Either inZoomIn or inZoomOut */ { - NSWindow *window = whichWindow; - TkWindow *winPtr = TkMacOSXGetTkWindow(window); + NSWindow *window = (NSWindow *)whichWindow; + TkWindow *winPtr = (TkWindow *)TkMacOSXGetTkWindow(window); WmInfo *wmPtr; if (!winPtr || !winPtr->wmInfoPtr) { @@ -5632,7 +5632,7 @@ TkUnsupported1ObjCmd( enum SubCmds { TKMWS_STYLE, TKMWS_TABID, TKMWS_APPEARANCE, TKMWS_ISDARK }; - Tk_Window tkwin = clientData; + Tk_Window tkwin = (Tk_Window)clientData; TkWindow *winPtr; int index; @@ -6705,7 +6705,7 @@ TkWmStackorderToplevel( for (NSWindow *w in backToFront) { hPtr = Tcl_FindHashEntry(&table, (char*) w); if (hPtr != NULL) { - childWinPtr = Tcl_GetHashValue(hPtr); + childWinPtr = (TkWindow *)Tcl_GetHashValue(hPtr); *windowPtr++ = childWinPtr; } } @@ -7030,7 +7030,7 @@ ApplyContainerOverrideChanges( [macWindow setExcludedFromWindowsMenu:NO]; wmPtr->flags &= ~WM_TOPMOST; } - if (wmPtr->container != None) { + if (wmPtr->container != NULL) { TkWindow *containerWinPtr = (TkWindow *)wmPtr->container; if (containerWinPtr && (containerWinPtr->window != None) diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index 08dfc66..5159c8c 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -1676,7 +1676,7 @@ static void ButtonElementSize( int *minHeight, Ttk_Padding *paddingPtr) { - ThemeButtonParams *params = clientData; + ThemeButtonParams *params = (ThemeButtonParams *)clientData; HIThemeButtonDrawInfo info = ComputeButtonDrawInfo(params, 0, tkwin); static const CGRect scratchBounds = {{0, 0}, {100, 100}}; @@ -1741,7 +1741,7 @@ static void ButtonElementDraw( Ttk_Box b, Ttk_State state) { - ThemeButtonParams *params = clientData; + ThemeButtonParams *params = (ThemeButtonParams *)clientData; CGRect bounds = BoxToRect(d, b); HIThemeButtonDrawInfo info = ComputeButtonDrawInfo(params, state, tkwin); int isDark = TkMacOSXInDarkMode(tkwin); @@ -2108,7 +2108,7 @@ static void EntryElementDraw( Ttk_Box b, Ttk_State state) { - EntryElement *e = elementRecord; + EntryElement *e = (EntryElement *)elementRecord; ThemeFrameParams *params = clientData; HIThemeFrameKind kind = params ? params->kind : kHIThemeFrameTextFieldSquare; @@ -2460,8 +2460,8 @@ static void TrackElementDraw( Ttk_Box b, Ttk_State state) { - TrackElementData *data = clientData; - TrackElement *elem = elementRecord; + TrackElementData *data = (TrackElementData *)clientData; + TrackElement *elem = (TrackElement *)elementRecord; int orientation = TTK_ORIENT_HORIZONTAL; double from = 0, to = 100, value = 0, fraction, max; CGRect bounds = BoxToRect(d, b); @@ -2600,7 +2600,7 @@ static void PbarElementDraw( Ttk_Box b, Ttk_State state) { - PbarElement *pbar = elementRecord; + PbarElement *pbar = (PbarElement *)elementRecord; int orientation = TTK_ORIENT_HORIZONTAL, phase; double value = 0, maximum = 100, factor; CGRect bounds = BoxToRect(d, b); @@ -2678,7 +2678,7 @@ static void TroughElementSize( int *minHeight, Ttk_Padding *paddingPtr) { - ScrollbarElement *scrollbar = elementRecord; + ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; int orientation = TTK_ORIENT_HORIZONTAL; SInt32 thickness = 15; @@ -2705,7 +2705,7 @@ static void TroughElementDraw( Ttk_Box b, TCL_UNUSED(Ttk_State)) /* state */ { - ScrollbarElement *scrollbar = elementRecord; + ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; int orientation = TTK_ORIENT_HORIZONTAL; CGRect bounds = BoxToRect(d, b); GrayColor bgGray; @@ -2743,7 +2743,7 @@ static void ThumbElementSize( int *minHeight, TCL_UNUSED(Ttk_Padding *)) /* paddingPtr */ { - ScrollbarElement *scrollbar = elementRecord; + ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; int orientation = TTK_ORIENT_HORIZONTAL; Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation); @@ -2764,7 +2764,7 @@ static void ThumbElementDraw( Ttk_Box b, Ttk_State state) { - ScrollbarElement *scrollbar = elementRecord; + ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; int orientation = TTK_ORIENT_HORIZONTAL; Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation); @@ -3174,7 +3174,7 @@ static void FieldElementDraw( Ttk_Box b, TCL_UNUSED(Ttk_State)) { - FieldElement *e = elementRecord; + FieldElement *e = (FieldElement *)elementRecord; Tk_3DBorder backgroundPtr = Tk_Get3DBorderFromObj(tkwin, e->backgroundObj); @@ -3266,7 +3266,7 @@ static void TreeHeaderElementDraw( Ttk_Box b, Ttk_State state) { - ThemeButtonParams *params = clientData; + ThemeButtonParams *params = (ThemeButtonParams *)clientData; CGRect bounds = BoxToRect(d, b); const HIThemeButtonDrawInfo info = { .version = 0, |