Skip to content

Commit

Permalink
Two more Tk_GetPixelsFromObj usages. Remove double MODULE_SCOPE defin…
Browse files Browse the repository at this point in the history
…itions. All backported
  • Loading branch information
jan.nijtmans committed May 11, 2024
1 parent caa2d05 commit 5c8f06b
Show file tree
Hide file tree
Showing 20 changed files with 51 additions and 43 deletions.
4 changes: 2 additions & 2 deletions generic/ttk/ttkButton.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,8 @@ TTK_END_LAYOUT
* +++ Initialization.
*/

MODULE_SCOPE
void TtkButton_Init(Tcl_Interp *interp)
MODULE_SCOPE void
TtkButton_Init(Tcl_Interp *interp)
{
Ttk_Theme theme = Ttk_GetDefaultTheme(interp);

Expand Down
4 changes: 3 additions & 1 deletion generic/ttk/ttkDefaultTheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,9 @@ static Ttk_ElementSpec TreeitemIndicatorElementSpec = {
* TtkAltTheme_Init --
* Install alternate theme.
*/
MODULE_SCOPE int TtkAltTheme_Init(Tcl_Interp *interp)

MODULE_SCOPE int
TtkAltTheme_Init(Tcl_Interp *interp)
{
Ttk_Theme theme = Ttk_CreateTheme(interp, "alt", NULL);

Expand Down
8 changes: 4 additions & 4 deletions generic/ttk/ttkElements.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ static Ttk_ElementOptionSpec PaddingElementOptions[] = {
Tk_Offset(PaddingElement,paddingObj), "0" },
{ "-relief", TK_OPTION_RELIEF,
Tk_Offset(PaddingElement,reliefObj), "flat" },
{ "-shiftrelief", TK_OPTION_INT,
{ "-shiftrelief", TK_OPTION_PIXELS,
Tk_Offset(PaddingElement,shiftreliefObj), "0" },
{ NULL, 0, 0, NULL }
};
Expand All @@ -314,7 +314,7 @@ static void PaddingElementSize(
Ttk_Padding pad;

Tk_GetReliefFromObj(NULL, padding->reliefObj, &relief);
Tcl_GetIntFromObj(NULL, padding->shiftreliefObj, &shiftRelief);
Tk_GetPixelsFromObj(NULL, tkwin, padding->shiftreliefObj, &shiftRelief);
Ttk_GetPaddingFromObj(NULL,tkwin,padding->paddingObj,&pad);
*paddingPtr = Ttk_RelievePadding(pad, relief, shiftRelief);
}
Expand Down Expand Up @@ -1529,8 +1529,8 @@ static Ttk_ElementSpec ClientElementSpec = {
* Register default element implementations.
*/

MODULE_SCOPE
void TtkElements_Init(Tcl_Interp *interp)
MODULE_SCOPE void
TtkElements_Init(Tcl_Interp *interp)
{
Ttk_Theme theme = Ttk_GetDefaultTheme(interp);

Expand Down
5 changes: 3 additions & 2 deletions generic/ttk/ttkEntry.c
Original file line number Diff line number Diff line change
Expand Up @@ -2134,8 +2134,9 @@ TTK_END_LAYOUT
/*------------------------------------------------------------------------
* +++ Initialization.
*/
MODULE_SCOPE
void TtkEntry_Init(Tcl_Interp *interp)

MODULE_SCOPE void
TtkEntry_Init(Tcl_Interp *interp)
{
Ttk_Theme themePtr = Ttk_GetDefaultTheme(interp);

Expand Down
4 changes: 2 additions & 2 deletions generic/ttk/ttkFrame.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,8 @@ TTK_END_LAYOUT
* +++ Initialization.
*/

MODULE_SCOPE
void TtkFrame_Init(Tcl_Interp *interp)
MODULE_SCOPE void
TtkFrame_Init(Tcl_Interp *interp)
{
Ttk_Theme theme = Ttk_GetDefaultTheme(interp);

Expand Down
4 changes: 2 additions & 2 deletions generic/ttk/ttkImage.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,8 @@ Ttk_CreateImageElement(
return TCL_ERROR;
}

MODULE_SCOPE
void TtkImage_Init(Tcl_Interp *interp)
MODULE_SCOPE void
TtkImage_Init(Tcl_Interp *interp)
{
Ttk_RegisterElementFactory(interp, "image", Ttk_CreateImageElement, NULL);
}
Expand Down
4 changes: 2 additions & 2 deletions generic/ttk/ttkLabel.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,8 @@ static Ttk_ElementSpec LabelElementSpec = {
* +++ Initialization.
*/

MODULE_SCOPE
void TtkLabel_Init(Tcl_Interp *interp)
MODULE_SCOPE void
TtkLabel_Init(Tcl_Interp *interp)
{
Ttk_Theme theme = Ttk_GetDefaultTheme(interp);

Expand Down
1 change: 1 addition & 0 deletions generic/ttk/ttkLayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ Ttk_Box Ttk_PlaceBox(
* Ttk_PositionBox --
* Pack and stick a box according to PositionSpec flags.
*/

MODULE_SCOPE Ttk_Box
Ttk_PositionBox(Ttk_Box *cavity, int width, int height, Ttk_PositionSpec flags)
{
Expand Down
4 changes: 2 additions & 2 deletions generic/ttk/ttkNotebook.c
Original file line number Diff line number Diff line change
Expand Up @@ -1425,8 +1425,8 @@ TTK_END_LAYOUT
* +++ Initialization.
*/

MODULE_SCOPE
void TtkNotebook_Init(Tcl_Interp *interp)
MODULE_SCOPE void
TtkNotebook_Init(Tcl_Interp *interp)
{
Ttk_Theme themePtr = Ttk_GetDefaultTheme(interp);

Expand Down
11 changes: 6 additions & 5 deletions generic/ttk/ttkPanedwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,23 +925,23 @@ typedef struct {
} SashElement;

static Ttk_ElementOptionSpec SashElementOptions[] = {
{ "-sashthickness", TK_OPTION_INT,
{ "-sashthickness", TK_OPTION_PIXELS,
Tk_Offset(SashElement,thicknessObj), "5" },
{ NULL, TK_OPTION_BOOLEAN, 0, NULL }
};

static void SashElementSize(
TCL_UNUSED(void *),
void *elementRecord,
TCL_UNUSED(Tk_Window),
Tk_Window tkwin,
int *widthPtr,
int *heightPtr,
TCL_UNUSED(Ttk_Padding *))
{
SashElement *sash = (SashElement *)elementRecord;
int thickness = DEFAULT_SASH_THICKNESS;

Tcl_GetIntFromObj(NULL, sash->thicknessObj, &thickness);
Tk_GetPixelsFromObj(NULL, tkwin, sash->thicknessObj, &thickness);
*widthPtr = *heightPtr = thickness;
}

Expand All @@ -968,8 +968,9 @@ TTK_END_LAYOUT
/*------------------------------------------------------------------------
* +++ Registration routine.
*/
MODULE_SCOPE
void TtkPanedwindow_Init(Tcl_Interp *interp)

MODULE_SCOPE void
TtkPanedwindow_Init(Tcl_Interp *interp)
{
Ttk_Theme themePtr = Ttk_GetDefaultTheme(interp);
RegisterWidget(interp, "ttk::panedwindow", &PanedWidgetSpec);
Expand Down
4 changes: 2 additions & 2 deletions generic/ttk/ttkProgress.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ TTK_END_LAYOUT
* Initialization:
*/

MODULE_SCOPE
void TtkProgressbar_Init(Tcl_Interp *interp)
MODULE_SCOPE void
TtkProgressbar_Init(Tcl_Interp *interp)
{
Ttk_Theme themePtr = Ttk_GetDefaultTheme(interp);

Expand Down
5 changes: 3 additions & 2 deletions generic/ttk/ttkScale.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,9 @@ TTK_END_LAYOUT
/*
* Initialization.
*/
MODULE_SCOPE
void TtkScale_Init(Tcl_Interp *interp)

MODULE_SCOPE void
TtkScale_Init(Tcl_Interp *interp)
{
Ttk_Theme theme = Ttk_GetDefaultTheme(interp);

Expand Down
4 changes: 2 additions & 2 deletions generic/ttk/ttkScrollbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ TTK_END_LAYOUT
* +++ Initialization.
*/

MODULE_SCOPE
void TtkScrollbar_Init(Tcl_Interp *interp)
MODULE_SCOPE void
TtkScrollbar_Init(Tcl_Interp *interp)
{
Ttk_Theme theme = Ttk_GetDefaultTheme(interp);

Expand Down
4 changes: 2 additions & 2 deletions generic/ttk/ttkSeparator.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ TTK_END_LAYOUT
/* +++ Initialization:
*/

MODULE_SCOPE
void TtkSeparator_Init(Tcl_Interp *interp)
MODULE_SCOPE void
TtkSeparator_Init(Tcl_Interp *interp)
{
Ttk_Theme theme = Ttk_GetDefaultTheme(interp);

Expand Down
12 changes: 6 additions & 6 deletions generic/ttk/ttkTheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,8 @@ Ttk_GetResourceCache(Tcl_Interp *interp)
* Register a new layout specification with a style.
* @@@ TODO: Make sure layoutName is not ".", root style must not have a layout
*/
MODULE_SCOPE
void Ttk_RegisterLayoutTemplate(
MODULE_SCOPE void
Ttk_RegisterLayoutTemplate(
Ttk_Theme theme, /* Target theme */
const char *layoutName, /* Name of new layout */
Ttk_LayoutTemplate layoutTemplate) /* Template */
Expand Down Expand Up @@ -1143,8 +1143,8 @@ Ttk_DrawElement(
* Side effects: Sets interp's result.
*/

MODULE_SCOPE
int TtkEnumerateHashTable(Tcl_Interp *interp, Tcl_HashTable *ht)
MODULE_SCOPE int
TtkEnumerateHashTable(Tcl_Interp *interp, Tcl_HashTable *ht)
{
Tcl_HashSearch search;
Tcl_Obj *result = Tcl_NewListObj(0, NULL);
Expand Down Expand Up @@ -1692,8 +1692,8 @@ StyleObjCmd(
return Ttk_InvokeEnsemble(StyleEnsemble, 1, clientData,interp,objc,objv);
}

MODULE_SCOPE
int Ttk_InvokeEnsemble( /* Run an ensemble command */
MODULE_SCOPE int
Ttk_InvokeEnsemble( /* Run an ensemble command */
const Ttk_Ensemble *ensemble, int cmdIndex,
void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
Expand Down
4 changes: 2 additions & 2 deletions generic/ttk/ttkTreeview.c
Original file line number Diff line number Diff line change
Expand Up @@ -3479,8 +3479,8 @@ static Ttk_ElementSpec RowElementSpec = {
* +++ Initialisation.
*/

MODULE_SCOPE
void TtkTreeview_Init(Tcl_Interp *interp)
MODULE_SCOPE void
TtkTreeview_Init(Tcl_Interp *interp)
{
Ttk_Theme theme = Ttk_GetDefaultTheme(interp);

Expand Down
1 change: 1 addition & 0 deletions macosx/tkMacOSXTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ MenuBarHeightObjCmd(
*
*----------------------------------------------------------------------
*/

MODULE_SCOPE Bool
TkTestLogDisplay(
Drawable drawable)
Expand Down
4 changes: 2 additions & 2 deletions macosx/ttkMacOSXTheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -3333,8 +3333,8 @@ static int AquaTheme_Init(
return TCL_OK;
}

MODULE_SCOPE
int Ttk_MacOSXPlatformInit(
MODULE_SCOPE int
Ttk_MacOSXPlatformInit(
Tcl_Interp *interp)
{
return AquaTheme_Init(interp);
Expand Down
4 changes: 2 additions & 2 deletions win/ttkWinTheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,8 +940,8 @@ TTK_END_LAYOUT_TABLE

/* ---------------------------------------------------------------------- */

MODULE_SCOPE
int TtkWinTheme_Init(
MODULE_SCOPE int
TtkWinTheme_Init(
Tcl_Interp *interp,
TCL_UNUSED(HWND))
{
Expand Down
3 changes: 2 additions & 1 deletion win/ttkWinXPTheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,8 @@ Ttk_CreateVsapiElement(
* +++ Initialization routine:
*/

MODULE_SCOPE int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd)
MODULE_SCOPE int
TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd)
{
XPThemeData *themeData;
XPThemeProcs *procs;
Expand Down

0 comments on commit 5c8f06b

Please sign in to comment.