diff --git a/generic/tkDList.h b/generic/tkDList.h index 1cd5977ac..2130b56a9 100644 --- a/generic/tkDList.h +++ b/generic/tkDList.h @@ -440,7 +440,7 @@ static void \ LT##_Free(struct ElemType *elem) \ { \ LT##_Remove(elem); \ - ckfree((void *)elem); \ + ckfree((char *)elem); \ } \ \ __TK_DLIST_UNUSED \ @@ -508,7 +508,7 @@ LT##_Clear(LT *head) \ assert(head); \ for (p = head->first; p; p = next) { \ next = LT##_Next(p); \ - ckfree((void *)p); \ + ckfree((char *)p); \ } \ LT##_Init(head); \ } \ diff --git a/generic/tkEntry.c b/generic/tkEntry.c index cc6a408f5..2e235b2f2 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -1044,7 +1044,7 @@ DestroyEntry( * Tk_FreeOptions handle all the standard option-related stuff. */ - ckfree((void *)entryPtr->string); + ckfree((char *)entryPtr->string); if (entryPtr->textVarNameObj != NULL) { Tcl_UntraceVar2(entryPtr->interp, Tcl_GetString(entryPtr->textVarNameObj), NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, @@ -1059,7 +1059,7 @@ DestroyEntry( } Tcl_DeleteTimerHandler(entryPtr->insertBlinkHandler); if (entryPtr->displayString != entryPtr->string) { - ckfree((void *)entryPtr->displayString); + ckfree((char *)entryPtr->displayString); } if (entryPtr->type == TK_SPINBOX) { Spinbox *sbPtr = (Spinbox *) entryPtr; @@ -1984,7 +1984,7 @@ EntryComputeGeometry( char *p; if (entryPtr->displayString != entryPtr->string) { - ckfree((void *)entryPtr->displayString); + ckfree((char *)entryPtr->displayString); entryPtr->displayString = entryPtr->string; entryPtr->numDisplayBytes = entryPtr->numBytes; } @@ -2192,7 +2192,7 @@ InsertChars( return TCL_OK; } - ckfree((void *)string); + ckfree((char *)string); entryPtr->string = newStr; /* @@ -2298,7 +2298,7 @@ DeleteChars( } ckfree(toDelete); - ckfree((void *)entryPtr->string); + ckfree((char *)entryPtr->string); entryPtr->string = newStr; entryPtr->numChars -= count; entryPtr->numBytes -= byteCount; @@ -2488,13 +2488,13 @@ EntrySetValue( if (entryPtr->flags & VALIDATE_ABORT) { entryPtr->flags &= ~VALIDATE_ABORT; - ckfree((void *)value); + ckfree((char *)value); return; } } oldSource = entryPtr->string; - ckfree((void *)entryPtr->string); + ckfree((char *)entryPtr->string); if (malloced) { entryPtr->string = value; diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 72dbc5179..0ea46b3f7 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -257,13 +257,13 @@ PhotoFormatThreadExitProc( while (tsdPtr->formatList != NULL) { freePtr = tsdPtr->formatList; tsdPtr->formatList = tsdPtr->formatList->nextPtr; - ckfree((void *)freePtr->name); + ckfree((char *)freePtr->name); ckfree(freePtr); } while (tsdPtr->formatListVersion3 != NULL) { freePtrVersion3 = tsdPtr->formatListVersion3; tsdPtr->formatListVersion3 = tsdPtr->formatListVersion3->nextPtr; - ckfree((void *)freePtrVersion3->name); + ckfree((char *)freePtrVersion3->name); ckfree(freePtrVersion3); } } diff --git a/win/nmakehlp.c b/win/nmakehlp.c index 4fc9f7a0e..10fb23e43 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -101,7 +101,7 @@ main( case 'l': if (argc < 3) { chars = snprintf(msg, sizeof(msg) - 1, - "usage: %s -l ? ...?\n" + "usage: %s -l ? ...?\n" "Tests for whether link.exe supports an option\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, @@ -493,9 +493,9 @@ IsIn( /* * GetVersionFromFile -- - * Looks for a match string in a file and then returns the version - * following the match where a version is anything acceptable to - * package provide or package ifneeded. + * Looks for a match string in a file and then returns the version + * following the match where a version is anything acceptable to + * package provide or package ifneeded. */ static const char * diff --git a/win/tkWinButton.c b/win/tkWinButton.c index ae132542c..cccfc8092 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -756,7 +756,7 @@ TkpDisplayButton( XSetClipOrigin(butPtr->display, gc, 0, 0); } if ((butPtr->state == STATE_DISABLED) && - (butPtr->disabledFg != NULL)) { + (butPtr->disabledFg != NULL)) { COLORREF oldFgColor = gc->foreground; if (gc->background == GetSysColor(COLOR_BTNFACE)) { @@ -827,10 +827,9 @@ TkpDisplayButton( if (gc->background == GetSysColor(COLOR_BTNFACE)) { gc->foreground = GetSysColor(COLOR_3DHILIGHT); Tk_DrawTextLayout(butPtr->display, pixmap, gc, - butPtr->textLayout, - x + 1, y + 1, 0, -1); + butPtr->textLayout, x + 1, y + 1, 0, -1); Tk_UnderlineTextLayout(butPtr->display, pixmap, gc, - butPtr->textLayout, x + 1, y + 1, butPtr->underline); + butPtr->textLayout, x + 1, y + 1, butPtr->underline); gc->foreground = oldFgColor; } } diff --git a/win/tkWinColor.c b/win/tkWinColor.c index 63af7d94e..9735665c7 100644 --- a/win/tkWinColor.c +++ b/win/tkWinColor.c @@ -180,9 +180,9 @@ TkpGetColor( XAllocColor(Tk_Display(tkwin), Tk_Colormap(tkwin), &winColPtr->info.color); - return (TkColor *) winColPtr; + return (TkColor *)winColPtr; } - return (TkColor *) NULL; + return (TkColor *)NULL; } /* diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index 668d0386d..ad6afa790 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -575,14 +575,14 @@ static int GetFileNameXP(Tcl_Interp *interp, OFNOpts *optsPtr, enum OFNOper oper); static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, enum OFNOper oper); -static int GetFileName(void *clientData, +static int GetFileName(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], enum OFNOper oper); static int MakeFilterVista(Tcl_Interp *interp, OFNOpts *optsPtr, DWORD *countPtr, TCLCOMDLG_FILTERSPEC **dlgFilterPtrPtr, DWORD *defaultFilterIndexPtr); static void FreeFilterVista(DWORD count, TCLCOMDLG_FILTERSPEC *dlgFilterPtr); -static int MakeFilter(Tcl_Interp *interp, Tcl_Obj *valuePtr, +static int MakeFilter(Tcl_Interp *interp, Tcl_Obj *valuePtr, Tcl_DString *dsPtr, Tcl_Obj *initialPtr, int *indexPtr); static UINT APIENTRY OFNHookProc(HWND hdlg, UINT uMsg, WPARAM wParam, @@ -601,24 +601,24 @@ static const char *ConvertExternalFilename(LPCWSTR, Tcl_DString *); * to the window underneath. If the window underneath happens to be a * windows control (eg a button) then it will be activated by accident. * - * This problem does not occur in dialog boxes, because windows must do - * some special processing to solve the problem. (separate message - * processing functions are used to cope with keyboard navigation of - * controls.) + * This problem does not occur in dialog boxes, because windows must do + * some special processing to solve the problem. (separate message + * processing functions are used to cope with keyboard navigation of + * controls.) * - * Here is one solution. After returning, we flush all mouse events + * Here is one solution. After returning, we flush all mouse events * for 1/4 second. In 8.6.5 and earlier, the code used to * poll the message queue consuming WM_LBUTTONUP messages. - * On seeing a WM_LBUTTONDOWN message, it would exit early, since the user - * must be doing something new. However this early exit does not work + * On seeing a WM_LBUTTONDOWN message, it would exit early, since the user + * must be doing something new. However this early exit does not work * on Vista and later because the Windows sends both BUTTONDOWN and * BUTTONUP after the DBLCLICK instead of just BUTTONUP as on XP. * Rather than try and figure out version specific sequences, we * ignore all mouse events in that interval. * * This fix only works for the current application, so the problem will - * still occur if the open dialog happens to be over another applications - * button. However this is a fairly rare occurrance. + * still occur if the open dialog happens to be over another applications + * button. However this is a fairly rare occurrance. * * Results: * None. @@ -1436,7 +1436,7 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, ConvertExternalFilename(wstr, &fnds); resultObj = Tcl_NewStringObj(Tcl_DStringValue(&fnds), - Tcl_DStringLength(&fnds)); + Tcl_DStringLength(&fnds)); CoTaskMemFree(wstr); Tcl_DStringFree(&fnds); } @@ -1814,7 +1814,7 @@ GetFileName( Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument objects. */ - enum OFNOper oper) /* 1 to call GetOpenFileName(), 0 to call + enum OFNOper oper) /* 1 to call GetOpenFileName(), 0 to call * GetSaveFileName(). */ { OFNOpts ofnOpts; diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index b82c7ac52..a7ab9c0ac 100644 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -154,7 +154,7 @@ TkWinGetDrawableDC( if (twdPtr->type == TWD_WINDOW) { TkWindow *winPtr = twdPtr->window.winPtr; - dc = GetDC(twdPtr->window.handle); + dc = GetDC(twdPtr->window.handle); if (winPtr == NULL) { cmap = DefaultColormap(display, DefaultScreen(display)); } else { diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c index 482611952..de4eaba8a 100644 --- a/win/tkWinEmbed.c +++ b/win/tkWinEmbed.c @@ -290,7 +290,7 @@ Tk_UseWindow( id = SendMessageW(hwnd, TK_INFO, TK_CONTAINER_VERIFY, 0); if (id == PTR2INT(hwnd)) { if (!SendMessageW(hwnd, TK_INFO, TK_CONTAINER_ISAVAILABLE, 0)) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( + Tcl_SetObjResult(interp, Tcl_NewStringObj( "The container is already in use", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "EMBED", "IN_USE", NULL); return TCL_ERROR; @@ -312,7 +312,7 @@ Tk_UseWindow( wsprintfW(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 == MessageBoxW(hwnd, msg, L"Tk Warning", MB_OKCANCEL | MB_ICONWARNING)) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( + Tcl_SetObjResult(interp, Tcl_NewStringObj( "Operation has been canceled", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "EMBED", "CANCEL", NULL); return TCL_ERROR; diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 1802b3575..76668c8ea 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -729,7 +729,7 @@ void TkpGetFontAttrsForChar( Tk_Window tkwin, /* Window on the font's display */ Tk_Font tkfont, /* Font to query */ - int c, /* Character of interest */ + int c, /* Character of interest */ TkFontAttributes *faPtr) /* Output: Font attributes */ { WinFont *fontPtr = (WinFont *) tkfont; @@ -1622,7 +1622,7 @@ InitFont( fmPtr->maxWidth = tm.tmMaxCharWidth; fmPtr->fixed = !(tm.tmPitchAndFamily & TMPF_FIXED_PITCH); - fontPtr->numSubFonts = 1; + fontPtr->numSubFonts = 1; fontPtr->subFontArray = fontPtr->staticSubFonts; InitSubFont(hdc, hFont, 1, &fontPtr->subFontArray[0]); @@ -1694,7 +1694,7 @@ InitSubFont( int base, /* Non-zero if this SubFont is being used as * the base font for a font object. */ SubFont *subFontPtr) /* Filled with SubFont constructed from above - * attributes. */ + * attributes. */ { subFontPtr->hFont0 = hFont; subFontPtr->familyPtr = AllocFontFamily(hdc, hFont, base); @@ -1883,7 +1883,7 @@ FreeFontFamily( return; } if (familyPtr->refCount-- > 1) { - return; + return; } for (i = 0; i < FONTMAP_PAGES; i++) { if (familyPtr->fontMap[i] != NULL) { @@ -2443,7 +2443,7 @@ CanUseFallback( if (fontPtr->numSubFonts >= SUBFONT_SPACE) { SubFont *newPtr; - newPtr = (SubFont *)ckalloc(sizeof(SubFont) * (fontPtr->numSubFonts + 1)); + newPtr = (SubFont *)ckalloc(sizeof(SubFont) * (fontPtr->numSubFonts + 1)); memcpy(newPtr, fontPtr->subFontArray, fontPtr->numSubFonts * sizeof(SubFont)); if (fontPtr->subFontArray != fontPtr->staticSubFonts) { diff --git a/win/tkWinGDI.c b/win/tkWinGDI.c index ad87d226b..03ba2e880 100644 --- a/win/tkWinGDI.c +++ b/win/tkWinGDI.c @@ -133,7 +133,7 @@ static const struct gdi_command { * * GdiArc -- * - * Map canvas arcs to GDI context. + * Map canvas arcs to GDI context. * * Results: * Renders arcs. @@ -290,8 +290,8 @@ static int GdiArc( * * GdiBitmap -- * - * Unimplemented for now. Should use the same techniques as - * CanvasPsBitmap (tkCanvPs.c). + * Unimplemented for now. Should use the same techniques as + * CanvasPsBitmap (tkCanvPs.c). * * Results: * None. @@ -676,9 +676,9 @@ static int GdiLine( return TCL_ERROR; } if ((Tcl_GetIntFromObj(interp, objv[2], (int *)&polypoints[0].x) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[3], (int *)&polypoints[0].y) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[4], (int *)&polypoints[1].x) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[5], (int *)&polypoints[1].y) != TCL_OK) + || (Tcl_GetIntFromObj(interp, objv[3], (int *)&polypoints[0].y) != TCL_OK) + || (Tcl_GetIntFromObj(interp, objv[4], (int *)&polypoints[1].x) != TCL_OK) + || (Tcl_GetIntFromObj(interp, objv[5], (int *)&polypoints[1].y) != TCL_OK) ) { return TCL_ERROR; } @@ -1366,7 +1366,8 @@ static int GdiCharWidths( HDC hDC; LOGFONTW lf; - HFONT hfont, oldfont; + HFONT hfont; + HGDIOBJ oldfont; int made_font = 0; const char *aryvarname = "GdiCharWidths"; /* For now, assume 256 characters in the font.... */ @@ -1481,9 +1482,10 @@ int GdiText( const char *string = 0; RECT sizerect; UINT format_flags = DT_EXPANDTABS|DT_NOPREFIX; /* Like the canvas. */ - Tk_Anchor anchor = 0; + Tk_Anchor anchor = TK_ANCHOR_N; LOGFONTW lf; - HFONT hfont, oldfont; + HFONT hfont; + HGDIOBJ oldfont; int made_font = 0; int retval; int dotextcolor = 0; @@ -3114,7 +3116,7 @@ static HBITMAP CopyScreenToBitmap( LPRECT lpRect) { HDC hScrDC, hMemDC; /* Screen DC and memory DC. */ - HBITMAP hBitmap, hOldBitmap; /* Handles to deice-dependent bitmaps. */ + HGDIOBJ hBitmap, hOldBitmap; /* Handles to deice-dependent bitmaps. */ int nX, nY, nX2, nY2; /* Coordinates of rectangle to grab. */ int nWidth, nHeight; /* DIB width and height */ int xScrn, yScrn; /* Screen resolution. */ @@ -3186,7 +3188,7 @@ static HBITMAP CopyScreenToBitmap( /* Return handle to the bitmap. */ - return hBitmap; + return (HBITMAP)hBitmap; } /* @@ -3230,7 +3232,7 @@ static HANDLE BitmapToDIB( /* Ff no palette is specified, use default palette. */ if (hPal == NULL) { - hPal = GetStockObject(DEFAULT_PALETTE); + hPal = (HPALETTE)GetStockObject(DEFAULT_PALETTE); } /* Calculate bits per pixel. */ diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index cd29597df..86bef9562 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -331,10 +331,10 @@ TkpNewMenu( winMenuHdl = CreatePopupMenu(); if (winMenuHdl == NULL) { - Tcl_SetObjResult(menuPtr->interp, Tcl_NewStringObj( + Tcl_SetObjResult(menuPtr->interp, Tcl_NewStringObj( "No more menus can be allocated.", TCL_INDEX_NONE)); Tcl_SetErrorCode(menuPtr->interp, "TK", "MENU", "SYSTEM_RESOURCES", NULL); - return TCL_ERROR; + return TCL_ERROR; } /* @@ -424,7 +424,7 @@ TkpDestroyMenu( Tcl_DeleteHashEntry(hashEntryPtr); } } - DestroyMenu(winMenuHdl); + DestroyMenu(winMenuHdl); } menuPtr->platformData = NULL; @@ -509,7 +509,7 @@ GetEntryText( : Tcl_GetString(mePtr->accelPtr); const char *p, *next; Tcl_DString itemString; - int ch = 0; + Tcl_UniChar ch = 0; /* * We have to construct the string with an ampersand preceeding the @@ -580,7 +580,7 @@ ReconfigureWindowsMenu( Tcl_DString translatedText; if (NULL == winMenuHdl) { - return; + return; } /* @@ -796,7 +796,7 @@ TkpPostMenu( if (menuPtr->tkwin == NULL) { tsdPtr->inPostMenu--; - return TCL_OK; + return TCL_OK; } if (NULL == parentWindow) { @@ -882,7 +882,7 @@ TkpPostTearoffMenu( TkRecomputeMenu(menuPtr); result = TkPostCommand(menuPtr); if (result != TCL_OK) { - return result; + return result; } /* @@ -891,7 +891,7 @@ TkpPostTearoffMenu( */ if (menuPtr->tkwin == NULL) { - return TCL_OK; + return TCL_OK; } /* @@ -973,7 +973,7 @@ TkpMenuNewEntry( TkMenu *menuPtr = mePtr->menuPtr; if (GetNewID(mePtr, &commandID) != TCL_OK) { - return TCL_ERROR; + return TCL_ERROR; } ScheduleMenuReconfigure(menuPtr); mePtr->platformEntryData = (TkMenuPlatformEntryData) INT2PTR(commandID); @@ -1477,17 +1477,17 @@ RecursivelyClearActiveMenu( TkActivateMenuEntry(menuPtr, TCL_INDEX_NONE); MenuSelectEvent(menuPtr); for (i = 0; i < menuPtr->numEntries; i++) { - mePtr = menuPtr->entries[i]; + mePtr = menuPtr->entries[i]; if (mePtr->state == ENTRY_ACTIVE) { mePtr->state = ENTRY_NORMAL; } mePtr->entryFlags &= ~ENTRY_PLATFORM_FLAG1; - if (mePtr->type == CASCADE_ENTRY) { - if ((mePtr->childMenuRefPtr != NULL) - && (mePtr->childMenuRefPtr->menuPtr != NULL)) { - RecursivelyClearActiveMenu(mePtr->childMenuRefPtr->menuPtr); - } - } + if (mePtr->type == CASCADE_ENTRY) { + if ((mePtr->childMenuRefPtr != NULL) + && (mePtr->childMenuRefPtr->menuPtr != NULL)) { + RecursivelyClearActiveMenu(mePtr->childMenuRefPtr->menuPtr); + } + } } } @@ -1561,7 +1561,7 @@ Tk_SetMainMenubar( TCL_UNUSED(Tcl_Interp *), /* The interpreter of the application */ TCL_UNUSED(Tk_Window), /* The frame we are setting up */ TCL_UNUSED(const char *)) /* The name of the menu to put in front. If - * NULL, use the default menu bar. */ + * NULL, use the default menu bar. */ { /* * Nothing to do. @@ -1653,7 +1653,7 @@ GetMenuAccelGeometry( *widthPtr = Tk_TextWidth(tkfont, accel, mePtr->accelLength); } else { - *widthPtr = 0; + *widthPtr = 0; } } @@ -1830,7 +1830,7 @@ DrawMenuEntryIndicator( { if ((mePtr->type == CHECK_BUTTON_ENTRY) || (mePtr->type == RADIO_BUTTON_ENTRY)) { - if (mePtr->indicatorOn && (mePtr->entryFlags & ENTRY_SELECTED)) { + if (mePtr->indicatorOn && (mePtr->entryFlags & ENTRY_SELECTED)) { RECT rect; GC whichGC; int borderWidth, activeBorderWidth; @@ -2360,7 +2360,7 @@ DrawMenuEntryLabel( */ if (mePtr->image != NULL) { - Tk_SizeOfImage(mePtr->image, &imageWidth, &imageHeight); + Tk_SizeOfImage(mePtr->image, &imageWidth, &imageHeight); haveImage = 1; } else if (mePtr->bitmapPtr != NULL) { Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr); @@ -2445,25 +2445,25 @@ DrawMenuEntryLabel( */ if (mePtr->image != NULL) { - if ((mePtr->selectImage != NULL) - && (mePtr->entryFlags & ENTRY_SELECTED)) { + if ((mePtr->selectImage != NULL) + && (mePtr->entryFlags & ENTRY_SELECTED)) { Tk_RedrawImage(mePtr->selectImage, 0, 0, imageWidth, imageHeight, d, leftEdge + imageXOffset, (int) (y + (mePtr->height-imageHeight)/2 + imageYOffset)); - } else { + } else { Tk_RedrawImage(mePtr->image, 0, 0, imageWidth, imageHeight, d, leftEdge + imageXOffset, (int) (y + (mePtr->height-imageHeight)/2 + imageYOffset)); - } + } } else if (mePtr->bitmapPtr != NULL) { Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr); - XCopyPlane(menuPtr->display, bitmap, d, gc, 0, 0, + XCopyPlane(menuPtr->display, bitmap, d, gc, 0, 0, (unsigned) imageWidth, (unsigned) imageHeight, leftEdge + imageXOffset, (int) (y + (mePtr->height - imageHeight)/2 + imageYOffset), 1); } if ((mePtr->compound != COMPOUND_NONE) || !haveImage) { - if (mePtr->labelLength > 0) { + if (mePtr->labelLength > 0) { int baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2; const char *label = Tcl_GetString(mePtr->labelPtr); @@ -2671,7 +2671,7 @@ TkpDrawMenuEntry( memDc = CreateCompatibleDC(menuDc); oldBitmap = (HBITMAP)SelectObject(memDc, - CreateCompatibleBitmap(menuDc, width, height) ); + CreateCompatibleBitmap(menuDc, width, height) ); memWinDraw.type = TWD_WINDC; memWinDraw.winDC.hdc = memDc; @@ -2695,21 +2695,21 @@ TkpDrawMenuEntry( gc = menuPtr->activeGC; } } else { - TkMenuEntry *cascadeEntryPtr; - int parentDisabled = 0; - const char *name; + TkMenuEntry *cascadeEntryPtr; + int parentDisabled = 0; + const char *name; - for (cascadeEntryPtr = menuPtr->menuRefPtr->parentEntryPtr; - cascadeEntryPtr != NULL; - cascadeEntryPtr = cascadeEntryPtr->nextCascadePtr) { + for (cascadeEntryPtr = menuPtr->menuRefPtr->parentEntryPtr; + cascadeEntryPtr != NULL; + cascadeEntryPtr = cascadeEntryPtr->nextCascadePtr) { name = Tcl_GetString(cascadeEntryPtr->namePtr); - if (strcmp(name, Tk_PathName(menuPtr->tkwin)) == 0) { - if (mePtr->state == ENTRY_DISABLED) { - parentDisabled = 1; - } - break; - } - } + if (strcmp(name, Tk_PathName(menuPtr->tkwin)) == 0) { + if (mePtr->state == ENTRY_DISABLED) { + parentDisabled = 1; + } + break; + } + } if (((parentDisabled || (mePtr->state == ENTRY_DISABLED))) && (menuPtr->disabledFgPtr != NULL)) { @@ -2821,12 +2821,12 @@ GetMenuLabelGeometry( int haveImage = 0; if (mePtr->image != NULL) { - Tk_SizeOfImage(mePtr->image, widthPtr, heightPtr); + Tk_SizeOfImage(mePtr->image, widthPtr, heightPtr); haveImage = 1; } else if (mePtr->bitmapPtr != NULL) { Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr); - Tk_SizeOfBitmap(menuPtr->display, bitmap, widthPtr, heightPtr); + Tk_SizeOfBitmap(menuPtr->display, bitmap, widthPtr, heightPtr); haveImage = 1; } else { *heightPtr = 0; @@ -2842,7 +2842,7 @@ GetMenuLabelGeometry( * Either it is compound or we don't have an image, */ - if (mePtr->labelPtr != NULL) { + if (mePtr->labelPtr != NULL) { int textWidth; const char *label = Tcl_GetString(mePtr->labelPtr); @@ -2899,7 +2899,7 @@ GetMenuLabelGeometry( */ *heightPtr = fmPtr->linespace; - } + } } *heightPtr += 1; } @@ -3018,9 +3018,9 @@ TkpComputeStandardMenuGeometry( } else { tkfont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->entries[i]->fontPtr); - Tk_GetFontMetrics(tkfont, &entryMetrics); - fmPtr = &entryMetrics; - } + Tk_GetFontMetrics(tkfont, &entryMetrics); + fmPtr = &entryMetrics; + } if ((i > 0) && menuPtr->entries[i]->columnBreak) { if (accelWidth != 0) { labelWidth += accelSpace; @@ -3042,11 +3042,11 @@ TkpComputeStandardMenuGeometry( if (menuPtr->entries[i]->type == SEPARATOR_ENTRY) { GetMenuSeparatorGeometry(menuPtr, menuPtr->entries[i], tkfont, - fmPtr, &width, &height); + fmPtr, &width, &height); menuPtr->entries[i]->height = height; } else if (menuPtr->entries[i]->type == TEAROFF_ENTRY) { GetTearoffEntryGeometry(menuPtr, menuPtr->entries[i], tkfont, - fmPtr, &width, &height); + fmPtr, &width, &height); menuPtr->entries[i]->height = height; } else { /* @@ -3059,32 +3059,32 @@ TkpComputeStandardMenuGeometry( */ GetMenuLabelGeometry(menuPtr->entries[i], tkfont, fmPtr, &width, - &height); + &height); menuPtr->entries[i]->height = height; if (width > labelWidth) { - labelWidth = width; + labelWidth = width; } GetMenuAccelGeometry(menuPtr, menuPtr->entries[i], tkfont, fmPtr, &width, &height); if (height > menuPtr->entries[i]->height) { - menuPtr->entries[i]->height = height; + menuPtr->entries[i]->height = height; } if (width > accelWidth) { - accelWidth = width; + accelWidth = width; } GetMenuIndicatorGeometry(menuPtr, menuPtr->entries[i], tkfont, - fmPtr, &width, &height); + fmPtr, &width, &height); if (height > menuPtr->entries[i]->height) { - menuPtr->entries[i]->height = height; + menuPtr->entries[i]->height = height; } if (width > indicatorSpace) { - indicatorSpace = width; + indicatorSpace = width; } menuPtr->entries[i]->height += 2 * activeBorderWidth + 1; - } + } menuPtr->entries[i]->y = y; y += menuPtr->entries[i]->height; if (y > windowHeight) { diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index b34f19869..b841dae7d 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.c @@ -76,7 +76,7 @@ const Tk_ClassProcs tkpScrollbarProcs = { sizeof(Tk_ClassProcs), /* size */ NULL, /* worldChangedProc */ CreateProc, /* createProc */ - NULL /* modalProc */ + NULL /* modalProc */ }; static void @@ -403,7 +403,7 @@ TkpComputeScrollbarGeometry( fieldLength = Tk_Width(scrollPtr->tkwin); minThumbSize = hThumb; } - fieldLength -= 2*scrollPtr->arrowLength; + fieldLength -= 2 * scrollPtr->arrowLength; if (fieldLength < 0) { fieldLength = 0; } @@ -442,10 +442,10 @@ TkpComputeScrollbarGeometry( if (scrollPtr->vertical) { Tk_GeometryRequest(scrollPtr->tkwin, - scrollPtr->width, 2*scrollPtr->arrowLength + minThumbSize); + scrollPtr->width, 2 * scrollPtr->arrowLength + minThumbSize); } else { Tk_GeometryRequest(scrollPtr->tkwin, - 2*scrollPtr->arrowLength + minThumbSize, scrollPtr->width); + 2 * scrollPtr->arrowLength + minThumbSize, scrollPtr->width); } Tk_SetInternalBorder(scrollPtr->tkwin, 0); } @@ -599,7 +599,7 @@ TkpConfigureScrollbar( * * This function is invoked in response to a ButtonPress event. * It resends the event to the Scrollbar window procedure, - * which in turn enters a modal loop. + * which in turn enters a modal loop. * *---------------------------------------------------------------------- */ diff --git a/win/tkWinSysTray.c b/win/tkWinSysTray.c index 6c56735b9..d59350296 100644 --- a/win/tkWinSysTray.c +++ b/win/tkWinSysTray.c @@ -1,9 +1,9 @@ /* * tkWinSysTray.c -- * - * tkWinSysTray.c implements a "systray" Tcl command which permits to - * change the system tray/taskbar icon of a Tk toplevel window and - * a "sysnotify" command to post system notifications. + * tkWinSysTray.c implements a "systray" Tcl command which permits to + * change the system tray/taskbar icon of a Tk toplevel window and + * a "sysnotify" command to post system notifications. * * Copyright © 1995-1996 Microsoft Corp. * Copyright © 1998 Brueckner & Jarosch Ing.GmbH, Erfurt, Germany @@ -81,7 +81,7 @@ static Tk_EventProc WinIcoDestroy; * * DrawXORMask -- * - * Using DIB functions, draw XOR mask on hDC in Rect. + * Using DIB functions, draw XOR mask on hDC in Rect. * * Results: * Icon is rendered. @@ -131,7 +131,7 @@ DrawXORMask( * * DrawANDMask -- * - * Using DIB functions, draw AND mask on hDC in Rect. + * Using DIB functions, draw AND mask on hDC in Rect. * * Results: * Icon is rendered. @@ -202,7 +202,7 @@ DrawANDMask( * * TaskbarOperation -- * - * Management of icon display. + * Management of icon display. * * Results: * Icon is displayed or deleted. @@ -256,7 +256,7 @@ TaskbarOperation( * * NewIcon -- * - * Create icon for display in system tray. + * Create icon for display in system tray. * * Results: * Icon is created for display. @@ -294,7 +294,7 @@ NewIcon( * * FreeIcoPtr -- * - * Delete icon and free memory. + * Delete icon and free memory. * * Results: * Icon is removed from display. @@ -337,7 +337,7 @@ FreeIcoPtr( * * GetIcoPtr -- * - * Get pointer to icon for display. + * Get pointer to icon for display. * * Results: * Icon is obtained for display. @@ -701,8 +701,8 @@ TaskbarEval( * * TaskbarHandlerProc -- * - * Windows callback procedure, if ICON_MESSAGE arrives, try to execute - * the taskbar_command. + * Windows callback procedure, if ICON_MESSAGE arrives, try to execute + * the taskbar_command. * * Results: * Command execution. @@ -772,7 +772,7 @@ TaskbarHandlerProc( * * RegisterHandlerClass -- * - * Registers the handler window class. + * Registers the handler window class. * * Results: * Handler class registered. @@ -807,7 +807,7 @@ RegisterHandlerClass( * * CreateTaskbarHandlerWindow -- * - * Creates a hidden window to handle taskbar messages. + * Creates a hidden window to handle taskbar messages. * * Results: * Hidden window created. @@ -886,7 +886,7 @@ WinIcoDestroy( * * WinSystrayCmd -- * - * Main command for creating, displaying, and removing icons from taskbar. + * Main command for creating, displaying, and removing icons from taskbar. * * Results: * Management of icon display in taskbar/system tray. @@ -1047,7 +1047,7 @@ WinSystrayCmd( * * WinSysNotifyCmd -- * - * Main command for creating and displaying notifications/balloons from system tray. + * Main command for creating and displaying notifications/balloons from system tray. * * Results: * Display of notifications. @@ -1128,7 +1128,7 @@ WinSysNotifyCmd( * * WinIcoInit -- * - * Initialize this package and create script-level commands. + * Initialize this package and create script-level commands. * * Results: * Initialization of code. diff --git a/win/tkWinTest.c b/win/tkWinTest.c index 4e993af76..06f36125d 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -522,9 +522,9 @@ TestgetwindowinfoObjCmd( cch = GetClassNameW((HWND)INT2PTR(hwnd), buf, cchBuf); if (cch == 0) { - Tcl_SetObjResult(interp, Tcl_NewStringObj("failed to get class name: ", TCL_INDEX_NONE)); - AppendSystemError(interp, GetLastError()); - return TCL_ERROR; + Tcl_SetObjResult(interp, Tcl_NewStringObj("failed to get class name: ", TCL_INDEX_NONE)); + AppendSystemError(interp, GetLastError()); + return TCL_ERROR; } else { Tcl_DStringInit(&ds); Tcl_WCharToUtfDString(buf, wcslen(buf), &ds); diff --git a/win/tkWinWm.c b/win/tkWinWm.c index c2d168306..bcfb3aac7 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -2344,7 +2344,7 @@ TkpWmSetState( } else if (state == ZoomState) { cmd = SW_SHOWMAXIMIZED; } else { - goto setStateEnd; + goto setStateEnd; } ShowWindow(wmPtr->wrapper, cmd); diff --git a/win/tkWinX.c b/win/tkWinX.c index f86b36016..1f9d5843d 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -117,7 +117,7 @@ static Tcl_ThreadDataKey dataKey; static void GenerateXEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); static unsigned int GetState(UINT message, WPARAM wParam, LPARAM lParam); -static void GetTranslatedKey(TkKeyEvent *xkey, UINT type); +static void GetTranslatedKey(TkKeyEvent *xkey, UINT type); static void UpdateInputLanguage(int charset); static int HandleIMEComposition(HWND hwnd, LPARAM lParam); diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c index 1aaaa9903..7cfe410d2 100644 --- a/win/ttkWinTheme.c +++ b/win/ttkWinTheme.c @@ -15,7 +15,7 @@ /* * BoxToRect -- - * Helper routine. Converts a Ttk_Box to a Win32 RECT. + * Helper routine. Converts a Ttk_Box to a Win32 RECT. */ static RECT BoxToRect(Ttk_Box b) { @@ -29,12 +29,12 @@ static RECT BoxToRect(Ttk_Box b) /* * ReliefToEdge -- - * Convert a Tk "relief" value into an Windows "edge" value. - * NB: Caller must check for RELIEF_FLAT and RELIEF_SOLID, + * Convert a Tk "relief" value into an Windows "edge" value. + * NB: Caller must check for RELIEF_FLAT and RELIEF_SOLID, * which must be handled specially. * * Passing the BF_FLAT flag to DrawEdge() yields something similar - * to TK_RELIEF_SOLID. TK_RELIEF_FLAT can be implemented by not + * to TK_RELIEF_SOLID. TK_RELIEF_FLAT can be implemented by not * drawing anything. */ static unsigned int ReliefToEdge(int relief) @@ -56,13 +56,13 @@ static unsigned int ReliefToEdge(int relief) static const Ttk_StateTable checkbutton_statemap[] = { /* see also SF#1865898 */ { DFCS_BUTTON3STATE|DFCS_CHECKED|DFCS_INACTIVE, - TTK_STATE_ALTERNATE|TTK_STATE_DISABLED, 0 }, + TTK_STATE_ALTERNATE|TTK_STATE_DISABLED, 0 }, { DFCS_BUTTON3STATE|DFCS_CHECKED|DFCS_PUSHED, - TTK_STATE_ALTERNATE|TTK_STATE_PRESSED, 0 }, + TTK_STATE_ALTERNATE|TTK_STATE_PRESSED, 0 }, { DFCS_BUTTON3STATE|DFCS_CHECKED|DFCS_HOT, - TTK_STATE_ALTERNATE|TTK_STATE_ACTIVE, 0 }, + TTK_STATE_ALTERNATE|TTK_STATE_ACTIVE, 0 }, { DFCS_BUTTON3STATE|DFCS_CHECKED, - TTK_STATE_ALTERNATE, 0 }, + TTK_STATE_ALTERNATE, 0 }, { DFCS_CHECKED|DFCS_INACTIVE, TTK_STATE_SELECTED|TTK_STATE_DISABLED, 0 }, { DFCS_CHECKED|DFCS_PUSHED, TTK_STATE_SELECTED|TTK_STATE_PRESSED, 0 }, @@ -90,7 +90,7 @@ static const Ttk_StateTable arrow_statemap[] = { /*------------------------------------------------------------------------ * +++ FrameControlElement -- - * General-purpose element for things drawn with DrawFrameControl + * General-purpose element for things drawn with DrawFrameControl */ typedef struct { const char *name; /* element name */ @@ -115,13 +115,13 @@ static FrameControlElementData FrameControlElements[] = { DFC_BUTTON, DFCS_BUTTONCHECK, FIXEDSIZE(BASE_DIM), FIXEDSIZE(BASE_DIM), checkbutton_statemap, {0,0,4,0} }, { "Radiobutton.indicator", - DFC_BUTTON, DFCS_BUTTONRADIO, FIXEDSIZE(BASE_DIM), FIXEDSIZE(BASE_DIM), + DFC_BUTTON, DFCS_BUTTONRADIO, FIXEDSIZE(BASE_DIM), FIXEDSIZE(BASE_DIM), checkbutton_statemap, {0,0,4,0} }, { "uparrow", - DFC_SCROLL, DFCS_SCROLLUP, SM_CXVSCROLL, SM_CYVSCROLL, + DFC_SCROLL, DFCS_SCROLLUP, SM_CXVSCROLL, SM_CYVSCROLL, arrow_statemap, {0,0,0,0} }, { "downarrow", - DFC_SCROLL, DFCS_SCROLLDOWN, SM_CXVSCROLL, SM_CYVSCROLL, + DFC_SCROLL, DFCS_SCROLLDOWN, SM_CXVSCROLL, SM_CYVSCROLL, arrow_statemap, {0,0,0,0} }, { "leftarrow", DFC_SCROLL, DFCS_SCROLLLEFT, SM_CXHSCROLL, SM_CYHSCROLL, @@ -130,7 +130,7 @@ static FrameControlElementData FrameControlElements[] = { DFC_SCROLL, DFCS_SCROLLRIGHT, SM_CXHSCROLL, SM_CYHSCROLL, arrow_statemap, {0,0,0,0} }, { "sizegrip", - DFC_SCROLL, DFCS_SCROLLSIZEGRIP, SM_CXVSCROLL, SM_CYHSCROLL, + DFC_SCROLL, DFCS_SCROLLSIZEGRIP, SM_CXVSCROLL, SM_CYHSCROLL, arrow_statemap, {0,0,0,0} }, { "Spinbox.uparrow", DFC_SCROLL, DFCS_SCROLLUP, SM_CXVSCROLL, HALFMETRIC(SM_CYVSCROLL), @@ -270,7 +270,7 @@ typedef struct { static const Ttk_ElementOptionSpec FieldElementOptions[] = { { "-fieldbackground", TK_OPTION_BORDER, - offsetof(FieldElement,backgroundObj), "white" }, + offsetof(FieldElement,backgroundObj), "white" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; @@ -358,7 +358,7 @@ static void ButtonBorderElementSize( /* Space for default indicator: */ if (defaultState != TTK_BUTTON_DEFAULT_DISABLED) { - ++cx; ++cy; + ++cx; ++cy; } /* Space for focus ring: @@ -426,7 +426,7 @@ static const Ttk_ElementSpec ButtonBorderElementSpec = { /*------------------------------------------------------------------------ * +++ Focus element. - * Draw dotted focus rectangle. + * Draw dotted focus rectangle. */ static void FocusElementSize( @@ -463,7 +463,7 @@ static const Ttk_ElementSpec FocusElementSpec = { }; /* FillFocusElement -- - * Draws a focus ring filled with the selection color + * Draws a focus ring filled with the selection color */ typedef struct { @@ -498,14 +498,14 @@ static void FillFocusElementDraw( /* * ComboboxFocusElement -- - * Read-only comboboxes have a filled focus ring, editable ones do not. + * Read-only comboboxes have a filled focus ring, editable ones do not. */ static void ComboboxFocusElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, Ttk_State state) { if (state & TTK_STATE_READONLY) { - FillFocusElementDraw(clientData, elementRecord, tkwin, d, b, state); + FillFocusElementDraw(clientData, elementRecord, tkwin, d, b, state); } } @@ -967,11 +967,11 @@ TtkWinTheme_Init( Ttk_RegisterElementSpec(themePtr, "field", &FieldElementSpec, NULL); Ttk_RegisterElementSpec(themePtr, "focus", &FocusElementSpec, NULL); Ttk_RegisterElementSpec(themePtr, "Combobox.focus", - &ComboboxFocusElementSpec, NULL); + &ComboboxFocusElementSpec, NULL); Ttk_RegisterElementSpec(themePtr, "thumb", &ThumbElementSpec, NULL); Ttk_RegisterElementSpec(themePtr, "slider", &SliderElementSpec, NULL); Ttk_RegisterElementSpec(themePtr, "Scrollbar.trough", &TroughElementSpec, - TroughClientDataInit(interp)); + TroughClientDataInit(interp)); Ttk_RegisterElementSpec(themePtr, "tab", &TabElementSpec, NULL); Ttk_RegisterElementSpec(themePtr, "client", &ClientElementSpec, NULL); diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index 4b868aa9b..d41ff4358 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -12,7 +12,7 @@ * See also: * * + * shellcc/platform/commctls/userex/refentry.asp > */ #include "tkWinInt.h" @@ -149,7 +149,7 @@ XPThemeEnabled( /* * BoxToRect -- - * Helper routine. Returns a RECT data structure. + * Helper routine. Returns a RECT data structure. */ static RECT BoxToRect(Ttk_Box b) @@ -172,11 +172,11 @@ static const Ttk_StateTable null_statemap[] = { {0,0,0} }; */ static const Ttk_StateTable pushbutton_statemap[] = { - { PBS_DISABLED, TTK_STATE_DISABLED, 0 }, - { PBS_PRESSED, TTK_STATE_PRESSED, 0 }, + { PBS_DISABLED, TTK_STATE_DISABLED, 0 }, + { PBS_PRESSED, TTK_STATE_PRESSED, 0 }, { PBS_HOT, TTK_STATE_ACTIVE, 0 }, { PBS_DEFAULTED, TTK_STATE_ALTERNATE, 0 }, - { PBS_NORMAL, 0, 0 } + { PBS_NORMAL, 0, 0 } }; /* @@ -184,10 +184,10 @@ static const Ttk_StateTable pushbutton_statemap[] = */ static const Ttk_StateTable checkbox_statemap[] = { -{CBS_MIXEDDISABLED, TTK_STATE_ALTERNATE|TTK_STATE_DISABLED, 0}, -{CBS_MIXEDPRESSED, TTK_STATE_ALTERNATE|TTK_STATE_PRESSED, 0}, -{CBS_MIXEDHOT, TTK_STATE_ALTERNATE|TTK_STATE_ACTIVE, 0}, -{CBS_MIXEDNORMAL, TTK_STATE_ALTERNATE, 0}, +{CBS_MIXEDDISABLED, TTK_STATE_ALTERNATE|TTK_STATE_DISABLED, 0}, +{CBS_MIXEDPRESSED, TTK_STATE_ALTERNATE|TTK_STATE_PRESSED, 0}, +{CBS_MIXEDHOT, TTK_STATE_ALTERNATE|TTK_STATE_ACTIVE, 0}, +{CBS_MIXEDNORMAL, TTK_STATE_ALTERNATE, 0}, {CBS_CHECKEDDISABLED, TTK_STATE_SELECTED|TTK_STATE_DISABLED, 0}, {CBS_CHECKEDPRESSED, TTK_STATE_SELECTED|TTK_STATE_PRESSED, 0}, {CBS_CHECKEDHOT, TTK_STATE_SELECTED|TTK_STATE_ACTIVE, 0}, @@ -255,22 +255,22 @@ static const Ttk_StateTable combotext_statemap[] = */ static const Ttk_StateTable combobox_statemap[] = { { CBXS_DISABLED, TTK_STATE_DISABLED, 0 }, - { CBXS_PRESSED, TTK_STATE_PRESSED, 0 }, - { CBXS_HOT, TTK_STATE_ACTIVE, 0 }, - { CBXS_HOT, TTK_STATE_HOVER, 0 }, - { CBXS_NORMAL, 0, 0 } + { CBXS_PRESSED, TTK_STATE_PRESSED, 0 }, + { CBXS_HOT, TTK_STATE_ACTIVE, 0 }, + { CBXS_HOT, TTK_STATE_HOVER, 0 }, + { CBXS_NORMAL, 0, 0 } }; /* * Toolbar buttons (TP_BUTTON): */ static const Ttk_StateTable toolbutton_statemap[] = { - { TS_DISABLED, TTK_STATE_DISABLED, 0 }, + { TS_DISABLED, TTK_STATE_DISABLED, 0 }, { TS_PRESSED, TTK_STATE_PRESSED, 0 }, { TS_HOTCHECKED, TTK_STATE_SELECTED|TTK_STATE_ACTIVE, 0 }, - { TS_CHECKED, TTK_STATE_SELECTED, 0 }, - { TS_HOT, TTK_STATE_ACTIVE, 0 }, - { TS_NORMAL, 0,0 } + { TS_CHECKED, TTK_STATE_SELECTED, 0 }, + { TS_HOT, TTK_STATE_ACTIVE, 0 }, + { TS_NORMAL, 0,0 } }; /* @@ -278,34 +278,34 @@ static const Ttk_StateTable toolbutton_statemap[] = { */ static const Ttk_StateTable scrollbar_statemap[] = { - { SCRBS_DISABLED, TTK_STATE_DISABLED, 0 }, - { SCRBS_PRESSED, TTK_STATE_PRESSED, 0 }, + { SCRBS_DISABLED, TTK_STATE_DISABLED, 0 }, + { SCRBS_PRESSED, TTK_STATE_PRESSED, 0 }, { SCRBS_HOT, TTK_STATE_ACTIVE, 0 }, - { SCRBS_NORMAL, 0, 0 } + { SCRBS_NORMAL, 0, 0 } }; static const Ttk_StateTable uparrow_statemap[] = { { ABS_UPDISABLED, TTK_STATE_DISABLED, 0 }, - { ABS_UPPRESSED, TTK_STATE_PRESSED, 0 }, + { ABS_UPPRESSED, TTK_STATE_PRESSED, 0 }, { ABS_UPHOT, TTK_STATE_ACTIVE, 0 }, - { ABS_UPNORMAL, 0, 0 } + { ABS_UPNORMAL, 0, 0 } }; static const Ttk_StateTable downarrow_statemap[] = { { ABS_DOWNDISABLED, TTK_STATE_DISABLED, 0 }, - { ABS_DOWNPRESSED, TTK_STATE_PRESSED, 0 }, + { ABS_DOWNPRESSED, TTK_STATE_PRESSED, 0 }, { ABS_DOWNHOT, TTK_STATE_ACTIVE, 0 }, - { ABS_DOWNNORMAL, 0, 0 } + { ABS_DOWNNORMAL, 0, 0 } }; static const Ttk_StateTable leftarrow_statemap[] = { { ABS_LEFTDISABLED, TTK_STATE_DISABLED, 0 }, - { ABS_LEFTPRESSED, TTK_STATE_PRESSED, 0 }, + { ABS_LEFTPRESSED, TTK_STATE_PRESSED, 0 }, { ABS_LEFTHOT, TTK_STATE_ACTIVE, 0 }, - { ABS_LEFTNORMAL, 0, 0 } + { ABS_LEFTNORMAL, 0, 0 } }; static const Ttk_StateTable rightarrow_statemap[] = @@ -313,7 +313,7 @@ static const Ttk_StateTable rightarrow_statemap[] = { ABS_RIGHTDISABLED,TTK_STATE_DISABLED, 0 }, { ABS_RIGHTPRESSED, TTK_STATE_PRESSED, 0 }, { ABS_RIGHTHOT, TTK_STATE_ACTIVE, 0 }, - { ABS_RIGHTNORMAL, 0, 0 } + { ABS_RIGHTNORMAL, 0, 0 } }; static const Ttk_StateTable spinbutton_statemap[] = @@ -329,11 +329,11 @@ static const Ttk_StateTable spinbutton_statemap[] = */ static const Ttk_StateTable scale_statemap[] = { - { TUS_DISABLED, TTK_STATE_DISABLED, 0 }, - { TUS_PRESSED, TTK_STATE_PRESSED, 0 }, - { TUS_FOCUSED, TTK_STATE_FOCUS, 0 }, + { TUS_DISABLED, TTK_STATE_DISABLED, 0 }, + { TUS_PRESSED, TTK_STATE_PRESSED, 0 }, + { TUS_FOCUSED, TTK_STATE_FOCUS, 0 }, { TUS_HOT, TTK_STATE_ACTIVE, 0 }, - { TUS_NORMAL, 0, 0 } + { TUS_NORMAL, 0, 0 } }; static const Ttk_StateTable tabitem_statemap[] = @@ -368,21 +368,21 @@ static const Ttk_StateTable tabitem_statemap[] = * BP_PUSHBUTTONS). Set the IGNORE_THEMESIZE flag to skip this call. */ -typedef struct /* XP element specifications */ +typedef struct /* XP element specifications */ { const char *elementName; /* Tk theme engine element name */ const Ttk_ElementSpec *elementSpec; - /* Element spec (usually GenericElementSpec) */ + /* Element spec (usually GenericElementSpec) */ LPCWSTR className; /* Windows window class name */ - int partId; /* BP_PUSHBUTTON, BP_CHECKBUTTON, etc. */ + int partId; /* BP_PUSHBUTTON, BP_CHECKBUTTON, etc. */ const Ttk_StateTable *statemap; /* Map Tk states to XP states */ Ttk_Padding padding; /* See NOTE-GetThemeMargins */ - unsigned flags; -# define IGNORE_THEMESIZE 0x80000000U /* See NOTE-GetThemePartSize */ -# define PAD_MARGINS 0x40000000U /* See NOTE-GetThemeMargins */ -# define HEAP_ELEMENT 0x20000000U /* ElementInfo is on heap */ -# define HALF_HEIGHT 0x10000000U /* Used by GenericSizedElements */ -# define HALF_WIDTH 0x08000000U /* Used by GenericSizedElements */ + unsigned flags; +# define IGNORE_THEMESIZE 0x80000000U /* See NOTE-GetThemePartSize */ +# define PAD_MARGINS 0x40000000U /* See NOTE-GetThemeMargins */ +# define HEAP_ELEMENT 0x20000000U /* ElementInfo is on heap */ +# define HALF_HEIGHT 0x10000000U /* Used by GenericSizedElements */ +# define HALF_WIDTH 0x08000000U /* Used by GenericSizedElements */ } ElementInfo; typedef struct @@ -436,13 +436,13 @@ static void DestroyElementData(void *clientData) /* * InitElementData -- - * Looks up theme handle. If Drawable argument is non-NULL, - * also initializes DC. + * Looks up theme handle. If Drawable argument is non-NULL, + * also initializes DC. * * Returns: - * 1 on success, 0 on error. - * Caller must later call FreeElementData() so this element - * can be reused. + * 1 on success, 0 on error. + * Caller must later call FreeElementData() so this element + * can be reused. */ static int @@ -544,7 +544,7 @@ static void GenericElementDraw( } if (elementData->info->flags & PAD_MARGINS) { - b = Ttk_PadBox(b, elementData->info->padding); + b = Ttk_PadBox(b, elementData->info->padding); } rc = BoxToRect(b); @@ -693,12 +693,12 @@ static void PbarElementSize( int nBars = 3; GenericElementSize(clientData, elementRecord, tkwin, - widthPtr, heightPtr, paddingPtr); + widthPtr, heightPtr, paddingPtr); if (elementData->info->partId == PP_CHUNK) { - *widthPtr *= nBars; + *widthPtr *= nBars; } else if (elementData->info->partId == PP_CHUNKVERT) { - *heightPtr *= nBars; + *heightPtr *= nBars; } } @@ -717,13 +717,13 @@ static const Ttk_ElementSpec PbarElementSpec = * proper iPartID for the leftmost tab. * * Notes: TABP_TABITEMRIGHTEDGE (or TABP_TOPTABITEMRIGHTEDGE, - * which appears to be identical) should be used if the + * which appears to be identical) should be used if the * tab is exactly at the right edge of the notebook, but * not if it's simply the rightmost tab. This information - * is not available. + * is not available. * * The TIS_* and TILES_* definitions are identical, so - * we can use the same statemap no matter what the partId. + * we can use the same statemap no matter what the partId. */ static void TabElementSize( @@ -742,7 +742,7 @@ static void TabElementSize( } GenericElementSize(clientData, elementRecord, tkwin, - widthPtr, heightPtr, paddingPtr); + widthPtr, heightPtr, paddingPtr); *paddingPtr = Ttk_UniformPadding(3); switch (nbTabsStickBit) { @@ -868,23 +868,23 @@ static const Ttk_ElementSpec TabElementSpec = static const Ttk_StateTable header_statemap[] = { - { HIS_PRESSED, TTK_STATE_PRESSED, 0 }, - { HIS_HOT, TTK_STATE_ACTIVE, 0 }, - { HIS_NORMAL, 0,0 }, + { HIS_PRESSED, TTK_STATE_PRESSED, 0 }, + { HIS_HOT, TTK_STATE_ACTIVE, 0 }, + { HIS_NORMAL, 0,0 }, }; static const Ttk_StateTable treeview_statemap[] = { - { TREIS_DISABLED, TTK_STATE_DISABLED, 0 }, + { TREIS_DISABLED, TTK_STATE_DISABLED, 0 }, { TREIS_SELECTED, TTK_STATE_SELECTED, 0}, - { TREIS_HOT, TTK_STATE_ACTIVE, 0 }, - { TREIS_NORMAL, 0,0 }, + { TREIS_HOT, TTK_STATE_ACTIVE, 0 }, + { TREIS_NORMAL, 0,0 }, }; static const Ttk_StateTable tvpglyph_statemap[] = { - { GLPS_OPENED, TTK_STATE_OPEN, 0 }, - { GLPS_CLOSED, 0,0 }, + { GLPS_OPENED, TTK_STATE_OPEN, 0 }, + { GLPS_CLOSED, 0,0 }, }; static void TreeIndicatorElementDraw( @@ -1072,82 +1072,82 @@ TTK_END_LAYOUT_TABLE static const ElementInfo ElementInfoTable[] = { { "Checkbutton.indicator", &GenericElementSpec, L"BUTTON", - BP_CHECKBOX, checkbox_statemap, PAD(0, 0, 4, 0), PAD_MARGINS }, + BP_CHECKBOX, checkbox_statemap, PAD(0, 0, 4, 0), PAD_MARGINS }, { "Radiobutton.indicator", &GenericElementSpec, L"BUTTON", - BP_RADIOBUTTON, radiobutton_statemap, PAD(0, 0, 4, 0), PAD_MARGINS }, + BP_RADIOBUTTON, radiobutton_statemap, PAD(0, 0, 4, 0), PAD_MARGINS }, { "Button.button", &GenericElementSpec, L"BUTTON", - BP_PUSHBUTTON, pushbutton_statemap, PAD(3, 3, 3, 3), IGNORE_THEMESIZE }, + BP_PUSHBUTTON, pushbutton_statemap, PAD(3, 3, 3, 3), IGNORE_THEMESIZE }, { "Labelframe.border", &GenericElementSpec, L"BUTTON", - BP_GROUPBOX, groupbox_statemap, PAD(2, 2, 2, 2), 0 }, + BP_GROUPBOX, groupbox_statemap, PAD(2, 2, 2, 2), 0 }, { "Entry.field", &GenericElementSpec, L"EDIT", EP_EDITTEXT, - edittext_statemap, PAD(1, 1, 1, 1), 0 }, + edittext_statemap, PAD(1, 1, 1, 1), 0 }, { "Combobox.field", &GenericElementSpec, L"EDIT", EP_EDITTEXT, combotext_statemap, PAD(1, 1, 1, 1), 0 }, { "Combobox.downarrow", &GenericSizedElementSpec, L"COMBOBOX", CP_DROPDOWNBUTTON, combobox_statemap, NOPAD, (SM_CXVSCROLL << 8) | SM_CYVSCROLL }, { "Vertical.Scrollbar.trough", &GenericElementSpec, L"SCROLLBAR", - SBP_UPPERTRACKVERT, scrollbar_statemap, NOPAD, 0 }, + SBP_UPPERTRACKVERT, scrollbar_statemap, NOPAD, 0 }, { "Vertical.Scrollbar.thumb", &ThumbElementSpec, L"SCROLLBAR", - SBP_THUMBBTNVERT, scrollbar_statemap, NOPAD, 0 }, + SBP_THUMBBTNVERT, scrollbar_statemap, NOPAD, 0 }, { "Vertical.Scrollbar.grip", &GenericElementSpec, L"SCROLLBAR", - SBP_GRIPPERVERT, scrollbar_statemap, NOPAD, 0 }, + SBP_GRIPPERVERT, scrollbar_statemap, NOPAD, 0 }, { "Horizontal.Scrollbar.trough", &GenericElementSpec, L"SCROLLBAR", - SBP_UPPERTRACKHORZ, scrollbar_statemap, NOPAD, 0 }, + SBP_UPPERTRACKHORZ, scrollbar_statemap, NOPAD, 0 }, { "Horizontal.Scrollbar.thumb", &ThumbElementSpec, L"SCROLLBAR", - SBP_THUMBBTNHORZ, scrollbar_statemap, NOPAD, 0 }, + SBP_THUMBBTNHORZ, scrollbar_statemap, NOPAD, 0 }, { "Horizontal.Scrollbar.grip", &GenericElementSpec, L"SCROLLBAR", - SBP_GRIPPERHORZ, scrollbar_statemap, NOPAD, 0 }, + SBP_GRIPPERHORZ, scrollbar_statemap, NOPAD, 0 }, { "Scrollbar.uparrow", &GenericSizedElementSpec, L"SCROLLBAR", - SBP_ARROWBTN, uparrow_statemap, NOPAD, + SBP_ARROWBTN, uparrow_statemap, NOPAD, (SM_CXVSCROLL << 8) | SM_CYVSCROLL }, { "Scrollbar.downarrow", &GenericSizedElementSpec, L"SCROLLBAR", - SBP_ARROWBTN, downarrow_statemap, NOPAD, + SBP_ARROWBTN, downarrow_statemap, NOPAD, (SM_CXVSCROLL << 8) | SM_CYVSCROLL }, { "Scrollbar.leftarrow", &GenericSizedElementSpec, L"SCROLLBAR", - SBP_ARROWBTN, leftarrow_statemap, NOPAD, + SBP_ARROWBTN, leftarrow_statemap, NOPAD, (SM_CXHSCROLL << 8) | SM_CYHSCROLL }, { "Scrollbar.rightarrow", &GenericSizedElementSpec, L"SCROLLBAR", - SBP_ARROWBTN, rightarrow_statemap, NOPAD, + SBP_ARROWBTN, rightarrow_statemap, NOPAD, (SM_CXHSCROLL << 8) | SM_CYHSCROLL }, { "Horizontal.Scale.slider", &GenericElementSpec, L"TRACKBAR", - TKP_THUMB, scale_statemap, NOPAD, 0 }, + TKP_THUMB, scale_statemap, NOPAD, 0 }, { "Vertical.Scale.slider", &GenericElementSpec, L"TRACKBAR", - TKP_THUMBVERT, scale_statemap, NOPAD, 0 }, + TKP_THUMBVERT, scale_statemap, NOPAD, 0 }, { "Horizontal.Scale.track", &GenericElementSpec, L"TRACKBAR", - TKP_TRACK, scale_statemap, NOPAD, 0 }, + TKP_TRACK, scale_statemap, NOPAD, 0 }, { "Vertical.Scale.track", &GenericElementSpec, L"TRACKBAR", - TKP_TRACKVERT, scale_statemap, NOPAD, 0 }, + TKP_TRACKVERT, scale_statemap, NOPAD, 0 }, /* ttk::progressbar elements */ { "Horizontal.Progressbar.pbar", &PbarElementSpec, L"PROGRESS", - PP_CHUNK, null_statemap, NOPAD, 0 }, + PP_CHUNK, null_statemap, NOPAD, 0 }, { "Vertical.Progressbar.pbar", &PbarElementSpec, L"PROGRESS", - PP_CHUNKVERT, null_statemap, NOPAD, 0 }, + PP_CHUNKVERT, null_statemap, NOPAD, 0 }, { "Horizontal.Progressbar.trough", &GenericElementSpec, L"PROGRESS", - PP_BAR, null_statemap, PAD(3,3,3,3), IGNORE_THEMESIZE }, + PP_BAR, null_statemap, PAD(3,3,3,3), IGNORE_THEMESIZE }, { "Vertical.Progressbar.trough", &GenericElementSpec, L"PROGRESS", - PP_BARVERT, null_statemap, PAD(3,3,3,3), IGNORE_THEMESIZE }, + PP_BARVERT, null_statemap, PAD(3,3,3,3), IGNORE_THEMESIZE }, /* ttk::notebook */ { "tab", &TabElementSpec, L"TAB", - TABP_TABITEM, tabitem_statemap, PAD(3,3,3,0), 0 }, + TABP_TABITEM, tabitem_statemap, PAD(3,3,3,0), 0 }, { "client", &GenericElementSpec, L"TAB", - TABP_PANE, null_statemap, PAD(1,1,3,3), 0 }, + TABP_PANE, null_statemap, PAD(1,1,3,3), 0 }, { "NotebookPane.background", &GenericElementSpec, L"TAB", - TABP_BODY, null_statemap, NOPAD, 0 }, + TABP_BODY, null_statemap, NOPAD, 0 }, { "Toolbutton.border", &GenericElementSpec, L"TOOLBAR", - TP_BUTTON, toolbutton_statemap, NOPAD,0 }, + TP_BUTTON, toolbutton_statemap, NOPAD,0 }, { "Menubutton.button", &GenericElementSpec, L"TOOLBAR", - TP_SPLITBUTTON,toolbutton_statemap, NOPAD,0 }, + TP_SPLITBUTTON,toolbutton_statemap, NOPAD,0 }, { "Menubutton.dropdown", &GenericElementSpec, L"TOOLBAR", - TP_SPLITBUTTONDROPDOWN,toolbutton_statemap, NOPAD,0 }, + TP_SPLITBUTTONDROPDOWN,toolbutton_statemap, NOPAD,0 }, { "Treeview.field", &GenericElementSpec, L"TREEVIEW", TVP_TREEITEM, treeview_statemap, PAD(1, 1, 1, 1), IGNORE_THEMESIZE }, { "Treeitem.indicator", &TreeIndicatorElementSpec, L"TREEVIEW", - TVP_GLYPH, tvpglyph_statemap, PAD(1,1,6,0), PAD_MARGINS }, + TVP_GLYPH, tvpglyph_statemap, PAD(1,1,6,0), PAD_MARGINS }, { "Treeheading.border", &GenericElementSpec, L"HEADER", - HP_HEADERITEM, header_statemap, PAD(4,0,4,0),0 }, + HP_HEADERITEM, header_statemap, PAD(4,0,4,0),0 }, { "sizegrip", &GenericElementSpec, L"STATUS", - SP_GRIPPER, null_statemap, NOPAD,0 }, + SP_GRIPPER, null_statemap, NOPAD,0 }, { "Spinbox.field", &GenericElementSpec, L"EDIT", EP_EDITTEXT, edittext_statemap, PAD(1, 1, 1, 1), 0 }, { "Spinbox.uparrow", &SpinboxArrowElementSpec, L"SPIN", @@ -1158,7 +1158,7 @@ static const ElementInfo ElementInfoTable[] = { PAD_MARGINS | ((SM_CXVSCROLL << 8) | SM_CYVSCROLL) }, #ifdef BROKEN_TEXT_ELEMENT { "Labelframe.text", &TextElementSpec, L"BUTTON", - BP_GROUPBOX, groupbox_statemap, NOPAD,0 }, + BP_GROUPBOX, groupbox_statemap, NOPAD,0 }, #endif { 0,0,0,0,0,NOPAD,0 } };