diff options
-rw-r--r-- | doc/tk_mac.n | 2 | ||||
-rw-r--r-- | generic/tkCanvas.c | 8 | ||||
-rw-r--r-- | generic/tkText.c | 26 | ||||
-rw-r--r-- | generic/ttk/ttkTreeview.c | 2 | ||||
-rw-r--r-- | library/demos/twind.tcl | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXBitmap.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXScrlbr.c | 6 | ||||
-rw-r--r-- | tests/unixEmbed.test | 2 | ||||
-rw-r--r-- | unix/tkUnixWm.c | 2 | ||||
-rw-r--r-- | win/tkWinButton.c | 8 | ||||
-rw-r--r-- | win/tkWinClipboard.c | 2 | ||||
-rw-r--r-- | win/tkWinCursor.c | 2 | ||||
-rw-r--r-- | win/tkWinDialog.c | 88 | ||||
-rw-r--r-- | win/tkWinEmbed.c | 6 | ||||
-rw-r--r-- | win/tkWinInit.c | 16 | ||||
-rw-r--r-- | win/tkWinKey.c | 6 | ||||
-rw-r--r-- | win/tkWinMenu.c | 14 | ||||
-rw-r--r-- | win/tkWinPixmap.c | 6 | ||||
-rw-r--r-- | win/tkWinScrlbr.c | 2 | ||||
-rw-r--r-- | win/tkWinTest.c | 2 | ||||
-rw-r--r-- | win/tkWinWm.c | 12 | ||||
-rw-r--r-- | win/tkWinX.c | 8 | ||||
-rw-r--r-- | win/ttkWinMonitor.c | 4 |
23 files changed, 115 insertions, 113 deletions
diff --git a/doc/tk_mac.n b/doc/tk_mac.n index da960ff..6c50281 100644 --- a/doc/tk_mac.n +++ b/doc/tk_mac.n @@ -51,7 +51,7 @@ the command is absent, no action will be taken. The default Apple Event handler for AEDoScriptHandler. This command, if defined, executes a Tcl file when an AppleScript sends a .QW "do script" -command to Wish with a file path as a parameter. +command to Wish with a file path as a parameter. .TP \fB::tk::mac::DoScriptText\fR . diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 9a310d0..1c70055 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -613,7 +613,7 @@ DefaultRotateImplementation( if (ItemCoords(canvasPtr, itemPtr, 0, NULL) == TCL_OK && Tcl_ListObjGetElements(NULL, Tcl_GetObjResult(interp), &objc, &objv) == TCL_OK) { - coordv = (double *) Tcl_Alloc(sizeof(double) * objc); + coordv = (double *) ckalloc(sizeof(double) * objc); for (i=0 ; i<objc ; i++) { if (Tcl_GetDoubleFromObj(NULL, objv[i], &coordv[i]) != TCL_OK) { ok = 0; @@ -639,7 +639,7 @@ DefaultRotateImplementation( * Write the coordinates back into the item. */ - newObjv = (Tcl_Obj **) Tcl_Alloc(sizeof(Tcl_Obj *) * objc); + newObjv = (Tcl_Obj **) ckalloc(sizeof(Tcl_Obj *) * objc); for (i=0 ; i<objc ; i++) { newObjv[i] = Tcl_NewDoubleObj(coordv[i]); Tcl_IncrRefCount(newObjv[i]); @@ -648,9 +648,9 @@ DefaultRotateImplementation( for (i=0 ; i<objc ; i++) { Tcl_DecrRefCount(newObjv[i]); } - Tcl_Free((char *) newObjv); + ckfree((char *) newObjv); } - Tcl_Free((char *) coordv); + ckfree((char *) coordv); } /* diff --git a/generic/tkText.c b/generic/tkText.c index 7782521..f810010 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -5958,7 +5958,7 @@ SearchCore( * begin. */ - matchOffset = -1; + matchOffset = TCL_INDEX_NONE; if (searchSpecPtr->exact) { int maxExtraLines = 0; @@ -6230,7 +6230,7 @@ SearchCore( if (!match || ((info.extendStart == info.matches[0].start) - && ((TkSizeT) info.matches[0].end == (TkSizeT) lastOffset - firstOffset))) { + && (info.matches[0].end == (TkSizeT) (lastOffset - firstOffset)))) { int extraLines = 0; TkSizeT prevFullLine; @@ -6248,7 +6248,7 @@ SearchCore( lastNonOverlap = lastTotal; } - if ((TkSizeT) info.extendStart == TCL_AUTO_LENGTH) { + if (info.extendStart == TCL_INDEX_NONE) { /* * No multi-line match is possible. */ @@ -6345,9 +6345,9 @@ SearchCore( */ if ((match && - firstOffset + (TkSizeT) info.matches[0].end != (TkSizeT) lastTotal && - firstOffset + (TkSizeT) info.matches[0].end + 1 < prevFullLine + 1) - || (TkSizeT) info.extendStart == TCL_AUTO_LENGTH) { + firstOffset + info.matches[0].end != (TkSizeT) lastTotal && + firstOffset + info.matches[0].end + 1 < prevFullLine + 1) + || info.extendStart == TCL_INDEX_NONE) { break; } @@ -6358,10 +6358,10 @@ SearchCore( * that line. */ - if (match && ((TkSizeT) info.matches[0].start + 1 >= (TkSizeT) lastOffset + 1)) { + if (match && (info.matches[0].start + 1 >= (TkSizeT) lastOffset + 1)) { break; } - if (match && ((firstOffset + (TkSizeT) info.matches[0].end) + if (match && ((firstOffset + info.matches[0].end) >= prevFullLine)) { if (extraLines > 0) { extraLinesSearched = extraLines - 1; @@ -6497,11 +6497,11 @@ SearchCore( * previous match. */ - if (matchOffset == TCL_AUTO_LENGTH || + if (matchOffset == TCL_INDEX_NONE || ((searchSpecPtr->all || searchSpecPtr->backwards) - && (((TkSizeT)firstOffset + 1< matchOffset + 1) - || ((firstOffset + (TkSizeT) info.matches[0].end - - (TkSizeT) info.matches[0].start) + && (((TkSizeT)firstOffset + 1 < matchOffset + 1) + || ((firstOffset + info.matches[0].end + - info.matches[0].start) > matchOffset + matchLength)))) { matchOffset = firstOffset; @@ -6665,7 +6665,7 @@ SearchCore( * we are done. */ - if ((lastBackwardsLineMatch == -1) && (matchOffset != TCL_AUTO_LENGTH) + if ((lastBackwardsLineMatch == -1) && (matchOffset != TCL_INDEX_NONE) && !searchSpecPtr->all) { searchSpecPtr->foundMatchProc(lineNum, searchSpecPtr, lineInfo, theLine, matchOffset, matchLength); diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index cf7abe1..5b5375c 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -1064,7 +1064,7 @@ static void TreeviewCleanup(void *recordPtr) TreeviewFreeColumns(tv); if (tv->tree.displayColumns) - Tcl_Free((ClientData)tv->tree.displayColumns); + ckfree((ClientData)tv->tree.displayColumns); foreachHashEntry(&tv->tree.items, FreeItemCB); Tcl_DeleteHashTable(&tv->tree.items); diff --git a/library/demos/twind.tcl b/library/demos/twind.tcl index df879e3..45d1da8 100644 --- a/library/demos/twind.tcl +++ b/library/demos/twind.tcl @@ -315,7 +315,7 @@ proc changeBg {t c} { proc embDefBg t { set bg [lindex [$t configure -background] 3] - changeBg $t $bg + changeBg $t $bg } proc textMakePeer {parent} { diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c index e8cb211..615192b 100644 --- a/macosx/tkMacOSXBitmap.c +++ b/macosx/tkMacOSXBitmap.c @@ -134,7 +134,7 @@ PixmapFromImage( { TkMacOSXDrawingContext dc; Pixmap pixmap; - + pixmap = Tk_GetPixmap(display, None, size.width, size.height, 0); if (TkMacOSXSetupDrawingContext(pixmap, NULL, 1, &dc)) { if (dc.context) { diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index 0f92c70..a189646 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -216,7 +216,7 @@ static void drawMacScrollbar( /* * Do not display the thumb unless scrolling is possible. */ - + if (scrollPtr->firstFraction > 0.0 || scrollPtr->lastFraction < 1.0) { CGRect thumbBounds = {thumbOrigin, thumbSize}; path = CGPathCreateWithRoundedRect(thumbBounds, 4, 4, NULL); @@ -233,7 +233,7 @@ static void drawMacScrollbar( } } #endif - + void TkpDisplayScrollbar( ClientData clientData) /* Information about window. */ @@ -317,7 +317,7 @@ TkpDisplayScrollbar( /* * Switch back to NSView coordinates and draw a modern scrollbar. */ - + CGContextConcatCTM(dc.context, t); drawMacScrollbar(scrollPtr, msPtr, dc.context); #endif diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index c2dc073..7d26fbf 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -341,7 +341,7 @@ test unixEmbed-2.4 {EmbeddedEventProc procedure} -constraints { test unixEmbed-3.1 {ContainerEventProc procedure, detect creation} -constraints { - unix testembed notPortable + unix testembed nonPortable } -body { frame .f1 -container 1 -width 200 -height 50 pack .f1 diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index d06f38a..2edc809 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -2441,7 +2441,7 @@ WmIconphotoCmd( for (i = 3 + isDefault; i < objc; i++) { photo = Tk_FindPhoto(interp, Tcl_GetString(objv[i])); if (photo == NULL) { - Tcl_Free((char *) iconPropertyData); + ckfree((char *) iconPropertyData); return TCL_ERROR; } Tk_PhotoGetSize(photo, &width, &height); diff --git a/win/tkWinButton.c b/win/tkWinButton.c index e91857c..52b6e2a 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -131,7 +131,7 @@ InitBoxes(void) ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - hrsrc = FindResource(module, TEXT("buttons"), RT_BITMAP); + hrsrc = FindResource(module, L"buttons", RT_BITMAP); if (hrsrc == NULL) { Tcl_Panic("FindResource() failed for buttons bitmap resource, " "resources in tk_base.rc must be linked into Tk dll or static executable"); @@ -242,15 +242,15 @@ CreateProc( { Window window; HWND parent; - const TCHAR *class; + const WCHAR *class; WinButton *butPtr = (WinButton *)instanceData; parent = Tk_GetHWND(parentWin); if (butPtr->info.type == TYPE_LABEL) { - class = TEXT("STATIC"); + class = L"STATIC"; butPtr->style = SS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS; } else { - class = TEXT("BUTTON"); + class = L"BUTTON"; butPtr->style = BS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS; } butPtr->hwnd = CreateWindow(class, NULL, butPtr->style, diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c index 19874fb..06200d4 100644 --- a/win/tkWinClipboard.c +++ b/win/tkWinClipboard.c @@ -79,7 +79,7 @@ TkSelGetSelection( goto error; } data = GlobalLock(handle); - Tcl_WinTCharToUtf((TCHAR *)data, -1, &ds); + Tcl_WinTCharToUtf((WCHAR *)data, -1, &ds); GlobalUnlock(handle); } else if (IsClipboardFormatAvailable(CF_TEXT)) { /* diff --git a/win/tkWinCursor.c b/win/tkWinCursor.c index 622ba4d..6a9dc75 100644 --- a/win/tkWinCursor.c +++ b/win/tkWinCursor.c @@ -41,7 +41,7 @@ typedef struct { static struct CursorName { const char *name; - LPCTSTR id; + LPCWSTR id; } cursorNames[] = { {"starting", IDC_APPSTARTING}, {"arrow", IDC_ARROW}, diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index bbf49ca..168e27e 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -790,7 +790,7 @@ Tk_ChooseColorObjCmd( chooseColor.Flags = CC_RGBINIT | CC_FULLOPEN | CC_ENABLEHOOK; chooseColor.lCustData = (LPARAM) NULL; chooseColor.lpfnHook = (LPOFNHOOKPROC) ColorDlgHookProc; - chooseColor.lpTemplateName = (LPTSTR) interp; + chooseColor.lpTemplateName = (LPWSTR) interp; for (i = 1; i < objc; i += 2) { int index; @@ -1372,7 +1372,7 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, src = Tcl_GetString(optsPtr->extObj); wstr = (LPWSTR) Tcl_WinUtfToTChar(src, optsPtr->extObj->length, &ds); - if (wstr[0] == L'.') + if (wstr[0] == '.') ++wstr; hr = fdlgIf->lpVtbl->SetDefaultExtension(fdlgIf, wstr); Tcl_DStringFree(&ds); @@ -2287,54 +2287,56 @@ static int MakeFilterVista( for (i = 0, filterPtr = flist.filters; filterPtr; filterPtr = filterPtr->next, ++i) { - const char *sep; - FileFilterClause *clausePtr; - int nbytes; + const char *sep; + FileFilterClause *clausePtr; + int nbytes; - /* Check if this entry should be shown as the default */ - if (initial && strcmp(initial, filterPtr->name) == 0) + /* Check if this entry should be shown as the default */ + if (initial && strcmp(initial, filterPtr->name) == 0) initialIndex = i+1; /* Windows filter indices are 1-based */ - /* First stash away the text description of the pattern */ + /* First stash away the text description of the pattern */ Tcl_WinUtfToTChar(filterPtr->name, -1, &ds); - nbytes = Tcl_DStringLength(&ds); /* # bytes, not Unicode chars */ - nbytes += sizeof(WCHAR); /* Terminating \0 */ - dlgFilterPtr[i].pszName = ckalloc(nbytes); - memmove((void *) dlgFilterPtr[i].pszName, Tcl_DStringValue(&ds), nbytes); - Tcl_DStringFree(&ds); + nbytes = Tcl_DStringLength(&ds); /* # bytes, not Unicode chars */ + nbytes += sizeof(WCHAR); /* Terminating \0 */ + dlgFilterPtr[i].pszName = ckalloc(nbytes); + memmove((void *) dlgFilterPtr[i].pszName, Tcl_DStringValue(&ds), nbytes); + Tcl_DStringFree(&ds); - /* - * Loop through and join patterns with a ";" Each "clause" - * corresponds to a single textual description (called typename) - * in the tk_getOpenFile docs. Each such typename may occur - * multiple times and all these form a single filter entry - * with one clause per occurence. Further each clause may specify - * multiple patterns. Hence the nested loop here. - */ - sep = ""; - for (clausePtr=filterPtr->clauses ; clausePtr; - clausePtr=clausePtr->next) { - GlobPattern *globPtr; - for (globPtr = clausePtr->patterns; globPtr; - globPtr = globPtr->next) { - Tcl_DStringAppend(&patterns, sep, -1); - Tcl_DStringAppend(&patterns, globPtr->pattern, -1); - sep = ";"; - } - } + /* + * Loop through and join patterns with a ";" Each "clause" + * corresponds to a single textual description (called typename) + * in the tk_getOpenFile docs. Each such typename may occur + * multiple times and all these form a single filter entry + * with one clause per occurence. Further each clause may specify + * multiple patterns. Hence the nested loop here. + */ + sep = ""; + for (clausePtr=filterPtr->clauses ; clausePtr; + clausePtr=clausePtr->next) { + GlobPattern *globPtr; + for (globPtr = clausePtr->patterns; globPtr; + globPtr = globPtr->next) { + Tcl_DStringAppend(&patterns, sep, -1); + Tcl_DStringAppend(&patterns, globPtr->pattern, -1); + sep = ";"; + } + } - /* Again we need a Unicode form of the string */ + /* Again we need a Unicode form of the string */ Tcl_WinUtfToTChar(Tcl_DStringValue(&patterns), -1, &ds); - nbytes = Tcl_DStringLength(&ds); /* # bytes, not Unicode chars */ - nbytes += sizeof(WCHAR); /* Terminating \0 */ - dlgFilterPtr[i].pszSpec = ckalloc(nbytes); - memmove((void *)dlgFilterPtr[i].pszSpec, Tcl_DStringValue(&ds), nbytes); - Tcl_DStringFree(&ds); - Tcl_DStringFree(&patterns); + nbytes = Tcl_DStringLength(&ds); /* # bytes, not Unicode chars */ + nbytes += sizeof(WCHAR); /* Terminating \0 */ + dlgFilterPtr[i].pszSpec = ckalloc(nbytes); + memmove((void *)dlgFilterPtr[i].pszSpec, Tcl_DStringValue(&ds), nbytes); + Tcl_DStringFree(&ds); + Tcl_DStringSetLength(&patterns, 0); } + Tcl_DStringFree(&patterns); - if (initialIndex == 0) - initialIndex = 1; /* If no default, show first entry */ + if (initialIndex == 0) { + initialIndex = 1; /* If no default, show first entry */ + } *initialIndexPtr = initialIndex; *dlgFilterPtrPtr = dlgFilterPtr; *countPtr = flist.numFilters; @@ -2491,7 +2493,7 @@ Tk_ChooseDirectoryObjCmd( if (ofnOpts.titleObj != NULL) { Tcl_WinUtfToTChar(Tcl_GetString(ofnOpts.titleObj), -1, &titleString); - bInfo.lpszTitle = (LPTSTR) Tcl_DStringValue(&titleString); + bInfo.lpszTitle = (LPWSTR) Tcl_DStringValue(&titleString); } else { bInfo.lpszTitle = L"Please choose a directory, then select OK."; } @@ -3151,7 +3153,7 @@ HookProc( Tcl_WinUtfToTChar(Tcl_GetString(phd->titleObj), -1, &title); if (Tcl_DStringLength(&title) > 0) { - SetWindowText(hwndDlg, (LPCTSTR) Tcl_DStringValue(&title)); + SetWindowText(hwndDlg, (LPCWSTR) Tcl_DStringValue(&title)); } Tcl_DStringFree(&title); } diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c index 329fd6e..f33a275 100644 --- a/win/tkWinEmbed.c +++ b/win/tkWinEmbed.c @@ -303,10 +303,10 @@ TkpUseWindow( * order to avoid bug 1096074 in future. */ - TCHAR msg[256]; + WCHAR msg[256]; - wsprintf(msg, TEXT("Unable to get information of window \"%.40hs\". Attach to this\nwindow may have unpredictable results if it is not a valid container.\n\nPress Ok to proceed or Cancel to abort attaching."), string); - if (IDCANCEL == MessageBox(hwnd, msg, TEXT("Tk Warning"), + wsprintf(msg, L"Unable to get information of window \"%.40hs\". Attach to this\nwindow may have unpredictable results if it is not a valid container.\n\nPress Ok to proceed or Cancel to abort attaching.", string); + if (IDCANCEL == MessageBox(hwnd, msg, L"Tk Warning", MB_OKCANCEL | MB_ICONWARNING)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "Operation has been canceled", -1)); diff --git a/win/tkWinInit.c b/win/tkWinInit.c index 977474c..be3c340 100644 --- a/win/tkWinInit.c +++ b/win/tkWinInit.c @@ -137,21 +137,21 @@ TkpDisplayWarning( len = MultiByteToWideChar(CP_UTF8, 0, title, -1, titleString, TK_MAX_WARN_LEN); msgString = &titleString[len + 1]; - titleString[TK_MAX_WARN_LEN - 1] = L'\0'; + titleString[TK_MAX_WARN_LEN - 1] = '\0'; MultiByteToWideChar(CP_UTF8, 0, msg, -1, msgString, (TK_MAX_WARN_LEN - 1) - len); /* * Truncate MessageBox string if it is too long to not overflow the screen * and cause possible oversized window error. */ - if (titleString[TK_MAX_WARN_LEN - 1] != L'\0') { + if (titleString[TK_MAX_WARN_LEN - 1] != '\0') { memcpy(titleString + (TK_MAX_WARN_LEN - 5), L" ...", 5 * sizeof(WCHAR)); } if (IsDebuggerPresent()) { - titleString[len - 1] = L':'; - titleString[len] = L' '; + titleString[len - 1] = ':'; + titleString[len] = ' '; OutputDebugStringW(titleString); } else { - titleString[len - 1] = L'\0'; + titleString[len - 1] = '\0'; MessageBoxW(NULL, msgString, titleString, MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL | MB_SETFOREGROUND | MB_TOPMOST); @@ -178,14 +178,14 @@ Tcl_Obj* TkWin32ErrorObj( HRESULT hrError) { - LPTSTR lpBuffer = NULL, p = NULL; - TCHAR sBuffer[30]; + LPWSTR lpBuffer = NULL, p = NULL; + WCHAR sBuffer[30]; Tcl_Obj* errPtr = NULL; Tcl_DString ds; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, (DWORD)hrError, - LANG_NEUTRAL, (LPTSTR)&lpBuffer, 0, NULL); + LANG_NEUTRAL, (LPWSTR)&lpBuffer, 0, NULL); if (lpBuffer == NULL) { lpBuffer = sBuffer; diff --git a/win/tkWinKey.c b/win/tkWinKey.c index 8db34af..c1f9891 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -186,7 +186,7 @@ KeycodeToKeysym( { BYTE keys[256]; int result, deadkey, shift; - TCHAR buf[4]; + WCHAR buf[4]; unsigned int scancode = MapVirtualKey(keycode, 0); /* @@ -572,7 +572,7 @@ TkpSetKeycodeAndState( } } if (keySym >= 0x20) { - result = VkKeyScan((TCHAR) keySym); + result = VkKeyScan((WCHAR) keySym); if (result != -1) { shift = result >> 8; if (shift & 1) @@ -625,7 +625,7 @@ XKeysymToKeycode( } } if (keysym >= 0x20) { - result = VkKeyScan((TCHAR) keysym); + result = VkKeyScan((WCHAR) keysym); if (result != -1) { return (KeyCode) (result & 0xff); } diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index ed2ce93..329c0af 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -19,8 +19,8 @@ * The class of the window for popup menus. */ -#define MENU_CLASS_NAME TEXT("MenuWindowClass") -#define EMBEDDED_MENU_CLASS_NAME TEXT("EmbeddedMenuWindowClass") +#define MENU_CLASS_NAME L"MenuWindowClass" +#define EMBEDDED_MENU_CLASS_NAME L"EmbeddedMenuWindowClass" /* * Used to align a windows bitmap inside a rectangle @@ -573,7 +573,7 @@ ReconfigureWindowsMenu( TkMenuEntry *mePtr; HMENU winMenuHdl = (HMENU) menuPtr->platformData; char *itemText = NULL; - const TCHAR *lpNewItem; + const WCHAR *lpNewItem; UINT flags; UINT itemID; int i, count, systemMenu = 0, base; @@ -610,10 +610,10 @@ ReconfigureWindowsMenu( if ((menuPtr->menuType == MENUBAR) || (menuPtr->menuFlags & MENU_SYSTEM_MENU)) { Tcl_WinUtfToTChar(itemText, -1, &translatedText); - lpNewItem = (const TCHAR *) Tcl_DStringValue(&translatedText); + lpNewItem = (const WCHAR *) Tcl_DStringValue(&translatedText); flags |= MF_STRING; } else { - lpNewItem = (LPCTSTR) mePtr; + lpNewItem = (LPCWSTR) mePtr; flags |= MF_OWNERDRAW; } @@ -3492,7 +3492,7 @@ TkpMenuThreadInit(void) ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - tsdPtr->menuHWND = CreateWindow(MENU_CLASS_NAME, TEXT("MenuWindow"), WS_POPUP, + tsdPtr->menuHWND = CreateWindow(MENU_CLASS_NAME, L"MenuWindow", WS_POPUP, 0, 0, 10, 10, NULL, NULL, Tk_GetHINSTANCE(), NULL); if (!tsdPtr->menuHWND) { @@ -3500,7 +3500,7 @@ TkpMenuThreadInit(void) } tsdPtr->embeddedMenuHWND = - CreateWindow(EMBEDDED_MENU_CLASS_NAME, TEXT("EmbeddedMenuWindow"), + CreateWindow(EMBEDDED_MENU_CLASS_NAME, L"EmbeddedMenuWindow", WS_POPUP, 0, 0, 10, 10, NULL, NULL, Tk_GetHINSTANCE(), NULL); if (!tsdPtr->embeddedMenuHWND) { diff --git a/win/tkWinPixmap.c b/win/tkWinPixmap.c index aa1ebde..9850e26 100644 --- a/win/tkWinPixmap.c +++ b/win/tkWinPixmap.c @@ -104,9 +104,9 @@ Tk_GetPixmap( FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR)&lpMsgBuf, 0, NULL)) { - MessageBox(NULL, (LPTSTR) lpMsgBuf, - TEXT("Tk_GetPixmap: Error from CreateDIBSection"), + (LPWSTR)&lpMsgBuf, 0, NULL)) { + MessageBox(NULL, (LPWSTR) lpMsgBuf, + L"Tk_GetPixmap: Error from CreateDIBSection", MB_OK | MB_ICONINFORMATION); LocalFree(lpMsgBuf); } diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index 43a33ee..1edb1d8 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.c @@ -223,7 +223,7 @@ CreateProc( | SBS_HORZ; } - scrollPtr->hwnd = CreateWindow(TEXT("SCROLLBAR"), NULL, style, + scrollPtr->hwnd = CreateWindow(L"SCROLLBAR", NULL, style, Tk_X(tkwin), Tk_Y(tkwin), Tk_Width(tkwin), Tk_Height(tkwin), parent, NULL, Tk_GetHINSTANCE(), NULL); diff --git a/win/tkWinTest.c b/win/tkWinTest.c index e386605..b09fe1b 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -549,7 +549,7 @@ TestgetwindowinfoObjCmd( Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("id", 2), Tcl_NewWideIntObj(GetWindowLongPtr((HWND)(size_t)hwnd, GWL_ID))); - cch = GetWindowText((HWND)(size_t)hwnd, (LPTSTR)buf, cchBuf); + cch = GetWindowText((HWND)(size_t)hwnd, buf, cchBuf); Tcl_WinTCharToUtf(buf, cch * sizeof (WCHAR), &ds); textObj = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); Tcl_DStringFree(&ds); diff --git a/win/tkWinWm.c b/win/tkWinWm.c index c0f60d8..e41e68d 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -883,7 +883,7 @@ InitWindowClass( class.lpszClassName = TK_WIN_TOPLEVEL_CLASS_NAME; class.lpfnWndProc = WmProc; if (titlebaricon == NULL) { - class.hIcon = LoadIcon(Tk_GetHINSTANCE(), TEXT("tk")); + class.hIcon = LoadIcon(Tk_GetHINSTANCE(), L"tk"); } else { class.hIcon = GetIcon(titlebaricon, ICON_BIG); if (class.hIcon == NULL) { @@ -1248,7 +1248,7 @@ ReadIconFromFile( } Tcl_WinUtfToTChar(file, -1, &ds2); Tcl_DStringFree(&ds); - res = (DWORD *)SHGetFileInfo((TCHAR *)Tcl_DStringValue(&ds2), 0, &sfiSM, + res = (DWORD *)SHGetFileInfo((WCHAR *)Tcl_DStringValue(&ds2), 0, &sfiSM, sizeof(SHFILEINFO), SHGFI_SMALLICON|SHGFI_ICON); if (res != 0) { @@ -1256,7 +1256,7 @@ ReadIconFromFile( unsigned size; Tcl_ResetResult(interp); - res = (DWORD *)SHGetFileInfo((TCHAR *)Tcl_DStringValue(&ds2), 0, &sfi, + res = (DWORD *)SHGetFileInfo((WCHAR *)Tcl_DStringValue(&ds2), 0, &sfi, sizeof(SHFILEINFO), SHGFI_ICON); /* @@ -2131,7 +2131,7 @@ UpdateWrapper( wmPtr->wrapper = CreateWindowEx(wmPtr->exStyle, TK_WIN_TOPLEVEL_CLASS_NAME, - (LPCTSTR) Tcl_DStringValue(&titleString), + (LPCWSTR) Tcl_DStringValue(&titleString), wmPtr->style, x, y, width, height, parentHWND, NULL, Tk_GetHINSTANCE(), NULL); Tcl_DStringFree(&titleString); @@ -5459,7 +5459,7 @@ WmTitleCmd( } if (objc == 3) { if (wrapper) { - TCHAR buf[256]; + WCHAR buf[256]; Tcl_DString titleString; int size = 256; @@ -5485,7 +5485,7 @@ WmTitleCmd( Tcl_DString titleString; Tcl_WinUtfToTChar(wmPtr->title, -1, &titleString); - SetWindowText(wrapper, (LPCTSTR) Tcl_DStringValue(&titleString)); + SetWindowText(wrapper, (LPCWSTR) Tcl_DStringValue(&titleString)); Tcl_DStringFree(&titleString); } } diff --git a/win/tkWinX.c b/win/tkWinX.c index 9d474ac..4d88dc7 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -127,7 +127,7 @@ TkGetServerInfo( OSVERSIONINFOW os; if (!buffer[0]) { - HANDLE handle = GetModuleHandle(TEXT("NTDLL")); + HANDLE handle = GetModuleHandle(L"NTDLL"); int(__stdcall *getversion)(void *) = (int(__stdcall *)(void *))GetProcAddress(handle, "RtlGetVersion"); os.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); @@ -258,7 +258,7 @@ TkWinXInit( if (GetLocaleInfo(LANGIDFROMLCID(PTR2INT(GetKeyboardLayout(0))), LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER, - (LPTSTR) &lpCP, sizeof(lpCP)/sizeof(TCHAR)) + (LPWSTR) &lpCP, sizeof(lpCP)/sizeof(WCHAR)) && TranslateCharsetInfo(INT2PTR(lpCP), &lpCs, TCI_SRCCODEPAGE)) { UpdateInputLanguage((int) lpCs.ciCharset); } @@ -346,8 +346,8 @@ TkWinGetPlatformTheme(void) if ((os.dwMajorVersion == 5 && os.dwMinorVersion == 1)) { HKEY hKey; - LPCTSTR szSubKey = TEXT("Control Panel\\Appearance"); - LPCTSTR szCurrent = TEXT("Current"); + LPCWSTR szSubKey = L"Control Panel\\Appearance"; + LPCWSTR szCurrent = L"Current"; DWORD dwSize = 200; char pBuffer[200]; diff --git a/win/ttkWinMonitor.c b/win/ttkWinMonitor.c index 5d9cf0a..e3608f3 100644 --- a/win/ttkWinMonitor.c +++ b/win/ttkWinMonitor.c @@ -72,8 +72,8 @@ CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp) { WNDCLASSEX wc; HWND hwnd = NULL; - TCHAR title[32] = TEXT("TtkMonitorWindow"); - TCHAR name[32] = TEXT("TtkMonitorClass"); + WCHAR title[32] = L"TtkMonitorWindow"; + WCHAR name[32] = L"TtkMonitorClass"; wc.cbSize = sizeof(WNDCLASSEX); wc.style = CS_HREDRAW | CS_VREDRAW; |