Skip to content

Commit

Permalink
Add TK_MAJOR_VERSION markers
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Nov 6, 2024
1 parent 7c22fb2 commit ed248db
Show file tree
Hide file tree
Showing 8 changed files with 203 additions and 149 deletions.
53 changes: 33 additions & 20 deletions generic/tkButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,13 @@ typedef struct {
Tk_3DBorder activeBorder; /* Value of -activebackground option: this is
* the color used to draw 3-D border and
* background when widget is active. */
Tcl_Obj *borderWidthPtr; /* Value of -borderWidth option: specifies
* width of border in pixels. */
int borderWidth; /* Integer value corresponding to
* borderWidthPtr. Always >= 0. */
#if TK_MAJOR_VERSION > 8
Tcl_Obj *borderWidthObj; /* Value of -borderWidth option: specifies
* width of border in pixels. Always >= 0. */
#else
Tcl_Obj *borderWidthPtr;
int borderWidth;
#endif
int relief; /* Value of -relief option: specifies 3-d
* effect for border, such as
* TK_RELIEF_RAISED. */
Expand All @@ -126,12 +129,15 @@ typedef struct {
* TK_RELIEF_RAISED, to be used when a
* checkbutton or radiobutton without
* indicator is off. */
Tcl_Obj *highlightWidthPtr; /* Value of -highlightthickness option:
#if TK_MAJOR_VERSION > 8
Tcl_Obj *highlightWidthObj; /* Value of -highlightthickness option:
* specifies width in pixels of highlight to
* draw around widget when it has the focus.
* <= 0 means don't draw a highlight. */
int highlightWidth; /* Integer value corresponding to
* highlightWidthPtr. Always >= 0. */
* 0 means don't draw a highlight. Always >= 0. */
#else
Tcl_Obj *highlightWidthPtr;
int highlightWidth;
#endif
Tk_3DBorder highlightBorder;/* Value of -highlightbackground option:
* specifies background with which to draw 3-D
* default ring and focus highlight area when
Expand Down Expand Up @@ -166,26 +172,33 @@ typedef struct {
* disabledFg is NULL. */
GC copyGC; /* Used for copying information from an
* off-screen pixmap to the screen. */
Tcl_Obj *widthPtr; /* Value of -width option. */
int width; /* Integer value corresponding to widthPtr. */
Tcl_Obj *heightPtr; /* Value of -height option. */
int height; /* Integer value corresponding to heightPtr. */
Tcl_Obj *wrapLengthPtr; /* Value of -wraplength option: specifies line
#if TK_MAJOR_VERSION > 8
Tcl_Obj *widthObj; /* Value of -width option. */
Tcl_Obj *heightObj; /* Value of -height option. */
Tcl_Obj *wrapLengthObj; /* Value of -wraplength option: specifies line
* length (in pixels) at which to wrap onto
* next line. <= 0 means don't wrap except at
* newlines. */
int wrapLength; /* Integer value corresponding to
* wrapLengthPtr. */
Tcl_Obj *padXPtr; /* Value of -padx option: specifies how many
Tcl_Obj *padXObj; /* Value of -padx option: specifies how many
* pixels of extra space to leave on left and
* right of text. Ignored for bitmaps and
* images. */
int padX; /* Integer value corresponding to padXPtr. */
Tcl_Obj *padYPtr; /* Value of -padx option: specifies how many
Tcl_Obj *padYObj; /* Value of -padx option: specifies how many
* pixels of extra space to leave above and
* below text. Ignored for bitmaps and
* images. */
int padY; /* Integer value corresponding to padYPtr. */
#else
Tcl_Obj *widthPtr;
int width;
Tcl_Obj *heightPtr;
int height;
Tcl_Obj *wrapLengthPtr;
int wrapLength;
Tcl_Obj *padXPtr;
int padX;
Tcl_Obj *padYPtr;
int padY;
#endif
Tk_Anchor anchor; /* Value of -anchor option: specifies where
* text/bitmap should be displayed inside
* button region. */
Expand Down Expand Up @@ -312,7 +325,7 @@ MODULE_SCOPE void TkButtonWorldChanged(void *instanceData);
MODULE_SCOPE void TkpComputeButtonGeometry(TkButton *butPtr);
MODULE_SCOPE TkButton *TkpCreateButton(Tk_Window tkwin);
#ifndef TkpDestroyButton
MODULE_SCOPE void TkpDestroyButton(TkButton *butPtr);
MODULE_SCOPE void TkpDestroyButton(TkButton *butPtr);
#endif
#ifndef TkpDisplayButton
MODULE_SCOPE void TkpDisplayButton(void *clientData);
Expand Down
32 changes: 24 additions & 8 deletions generic/tkCanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,21 @@ typedef struct TkCanvas {
* Information used when displaying widget:
*/

int borderWidth; /* Width of 3-D border around window. */
#if TK_MAJOR_VERSION > 8
Tcl_Obj *borderWidthObj; /* Width of 3-D border around window. */
#else
int borderWidth;
#endif
Tk_3DBorder bgBorder; /* Used for canvas background. */
int relief; /* Indicates whether window as a whole is
* raised, sunken, or flat. */
int highlightWidth; /* Width in pixels of highlight to draw around
* widget when it has the focus. <= 0 means
#if TK_MAJOR_VERSION > 8
Tcl_Obj *highlightWidthObj; /* Width in pixels of highlight to draw around
* widget when it has the focus. 0 means
* don't draw a highlight. */
#else
int highlightWidth;
#endif
XColor *highlightBgColorPtr;
/* Color for drawing traversal highlight area
* when highlight is off. */
Expand All @@ -78,8 +86,12 @@ typedef struct TkCanvas {
* borders. */
GC pixmapGC; /* Used to copy bits from a pixmap to the
* screen and also to clear the pixmap. */
int width, height; /* Dimensions to request for canvas window,
#if TK_MAJOR_VERSION > 8
Tcl_Obj *widthObj, *heightObj; /* Dimensions to request for canvas window,
* specified in pixels. */
#else
int width, height;
#endif
int redrawX1, redrawY1; /* Upper left corner of area to redraw, in
* pixel coordinates. Border pixels are
* included. Only valid if REDRAW_PENDING flag
Expand Down Expand Up @@ -169,15 +181,19 @@ typedef struct TkCanvas {
* Units are pixels in canvas coords. */
Tcl_Obj *regionObj; /* The option string from which scrollX1 etc.
* are derived. */
int xScrollIncrement; /* If >0, defines a grid for horizontal
#if TK_MAJOR_VERSION > 8
Tcl_Obj *xScrollIncrementObj; /* If >0, defines a grid for horizontal
* scrolling. This is the size of the "unit",
* and the left edge of the screen will always
* lie on an even unit boundary. */
int yScrollIncrement; /* If >0, defines a grid for horizontal
Tcl_Obj *yScrollIncrementObj; /* If >0, defines a grid for vertical
* scrolling. This is the size of the "unit",
* and the left edge of the screen will always
* and the top edge of the screen will always
* lie on an even unit boundary. */

#else
int xScrollIncrement;
int yScrollIncrement;
#endif
/*
* Information used for scanning:
*/
Expand Down
2 changes: 1 addition & 1 deletion generic/tkFileFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ typedef struct FileFilterList {
MODULE_SCOPE void TkFreeFileFilters(FileFilterList *flistPtr);
MODULE_SCOPE void TkInitFileFilters(FileFilterList *flistPtr);
MODULE_SCOPE int TkGetFileFilters(Tcl_Interp *interp,
FileFilterList *flistPtr, Tcl_Obj *valuePtr,
FileFilterList *flistPtr, Tcl_Obj *valuePtr,
int isWindows);

#ifdef __cplusplus
Expand Down
Loading

0 comments on commit ed248db

Please sign in to comment.