diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-01-19 11:55:12 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-01-19 11:55:12 (GMT) |
commit | f4afe0dd31452463068eee153f95725108b66aa3 (patch) | |
tree | b4f7faecd519512fba36ca9b9d1bc276c71e113f | |
parent | 9616cdddf38053c87e9968c99a4ea3cf8a7108dc (diff) | |
parent | 7d012900cd3eee5f14e3ebd061726ffa3510550f (diff) | |
download | tk-f4afe0dd31452463068eee153f95725108b66aa3.zip tk-f4afe0dd31452463068eee153f95725108b66aa3.tar.gz tk-f4afe0dd31452463068eee153f95725108b66aa3.tar.bz2 |
Merge 8.7. int -> TkAlignMode where appropriate
-rw-r--r-- | .github/workflows/linux-build.yml | 2 | ||||
-rw-r--r-- | .github/workflows/mac-build.yml | 2 | ||||
-rw-r--r-- | .github/workflows/win-build.yml | 4 | ||||
-rw-r--r-- | .travis.yml | 293 | ||||
-rw-r--r-- | generic/tkMenubutton.h | 2 | ||||
-rw-r--r-- | generic/tkText.c | 2 | ||||
-rw-r--r-- | generic/tkText.h | 41 | ||||
-rw-r--r-- | generic/tkTextDisp.c | 6 | ||||
-rw-r--r-- | generic/tkTextImage.c | 18 | ||||
-rw-r--r-- | generic/tkTextTag.c | 2 | ||||
-rw-r--r-- | generic/tkTextWind.c | 20 | ||||
-rw-r--r-- | generic/ttk/ttkButton.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkDefaultTheme.c | 4 | ||||
-rw-r--r-- | unix/Makefile.in | 1 |
14 files changed, 51 insertions, 348 deletions
diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 8270ed7..ee5d2e7 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -194,4 +194,4 @@ jobs: echo "::error::Failure during Test" exit 1 } - timeout-minutes: 15 + timeout-minutes: 10 diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index 396b4e4..2462a17 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -161,7 +161,7 @@ jobs: echo "::error::Failure in ttk test results" exit 1 } - timeout-minutes: 15 + timeout-minutes: 20 - name: Carry out trial installation run: | make install || { diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 96700af..62d3974 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -86,7 +86,7 @@ jobs: env: CI_BUILD_WITH_MSVC: 1 shell: bash - timeout-minutes: 15 + timeout-minutes: 10 - name: Build Help (${{ matrix.config }}) run: | &nmake -f makefile.vc htmlhelp ${{ matrix.config }} @@ -175,4 +175,4 @@ jobs: echo "::error::Failure during Test" exit 1 } - timeout-minutes: 15 + timeout-minutes: 10 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1767ecb..0000000 --- a/.travis.yml +++ /dev/null @@ -1,293 +0,0 @@ -language: c -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - binutils-mingw-w64-i686 - - binutils-mingw-w64-x86-64 - - gcc-mingw-w64 - - gcc-mingw-w64-base - - gcc-mingw-w64-i686 - - gcc-mingw-w64-x86-64 - - gcc-multilib - - tcl8.6-dev - - libx11-dev - - libnotify-dev - - libglib2.0-dev - - libxss-dev - - xvfb - homebrew: - packages: - - tcl-tk - - libnotify - - glib -# casks: -# - xquartz -jobs: - include: -# Testing on Linux GCC - - name: "Linux/GCC/Shared" - os: linux - dist: focal - services: - - xvfb - compiler: gcc - env: - - BUILD_DIR=unix - script: &x11gui - - make binaries libraries tktest - - make install - - make test-classic >out-classic.txt - - cat out-classic.txt - - grep -q "Failed 0" out-classic.txt - - make test-ttk >out-ttk.txt - - cat out-ttk.txt - - grep -q "Failed 0" out-ttk.txt - - name: "Linux/GCC/Shared: NO_DEPRECATED" - os: linux - dist: focal - services: - - xvfb - compiler: gcc - env: - - BUILD_DIR=unix - - CFGOPT="CFLAGS=-DTK_NO_DEPRECATED=1" - script: *x11gui - - name: "Linux/GCC/Shared/no-xft" - os: linux - dist: focal - services: - - xvfb - compiler: gcc - env: - - BUILD_DIR=unix - - CFGOPT="--disable-xft" - script: *x11gui - - name: "Linux/GCC/Shared/no-libnotify" - os: linux - dist: focal - services: - - xvfb - compiler: gcc - env: - - BUILD_DIR=unix - - CFGOPT="--disable-libnotify" - script: *x11gui - - name: "Linux/GCC/Shared/bionic" - os: linux - dist: bionic - services: - - xvfb - compiler: gcc - env: - - BUILD_DIR=unix - script: *x11gui - - name: "Linux/GCC/Shared/xenial" - os: linux - dist: xenial - services: - - xvfb - compiler: gcc - env: - - BUILD_DIR=unix - script: *x11gui - - name: "Linux/GCC/Static" - os: linux - dist: focal - compiler: gcc - env: - - BUILD_DIR=unix - - CFGOPT="--disable-shared" - - name: "Linux/GCC/Debug" - os: linux - dist: focal - compiler: gcc - env: - - BUILD_DIR=unix - - CFGOPT="--enable-symbols" - - name: "Linux/G++/Shared" - os: linux - dist: focal - compiler: g++ - env: - - BUILD_DIR=unix - - CFGOPT="CC=g++ CFLAGS=-Dregister=dont+use+register" - - name: "Linux/G++/Shared UTF_MAX=4" - os: linux - dist: focal - compiler: g++ - env: - - BUILD_DIR=unix - - CFGOPT="CC=g++ CFLAGS=-DTCL_UTF_MAX=4" - - name: "Linux/G++/Shared UTF_MAX=6" - os: linux - dist: focal - compiler: g++ - env: - - BUILD_DIR=unix - - CFGOPT="CC=g++ CFLAGS=-DTCL_UTF_MAX=6" -# Newer/Older versions of GCC - - name: "Linux/GCC 10/Shared" - os: linux - dist: focal - compiler: gcc-10 - addons: - apt: - packages: - - g++-10 - env: - - BUILD_DIR=unix - - name: "Linux/GCC 5/Shared" - os: linux - dist: bionic - compiler: gcc-5 - addons: - apt: - packages: - - g++-5 - env: - - BUILD_DIR=unix -# Testing on Linux Clang - - name: "Linux/Clang/Shared" - os: linux - dist: focal - compiler: clang - env: - - BUILD_DIR=unix - - name: "Linux/Clang/Shared: NO_DEPRECATED" - os: linux - dist: focal - compiler: clang - env: - - BUILD_DIR=unix - - CFGOPT="CFLAGS=-DTK_NO_DEPRECATED=1" - - name: "Linux/Clang/Shared/no-xft" - os: linux - dist: focal - compiler: clang - env: - - BUILD_DIR=unix - - CFGOPT="--disable-xft" - - name: "Linux/Clang/Static" - os: linux - dist: focal - compiler: clang - env: - - CFGOPT="--disable-shared" - - BUILD_DIR=unix - - name: "Linux/Clang/Debug" - os: linux - dist: focal - compiler: clang - env: - - BUILD_DIR=unix - - CFGOPT="--enable-symbols" -# Testing on Mac, various styles - - name: "macOS/Xcode 12/Shared" - os: osx - osx_image: xcode12 - env: - - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include" - - name: "macOS/Clang++/Xcode 12/Shared" - os: osx - osx_image: xcode12 - env: - - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib CC=clang++ --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-D__private_extern__=extern" - - name: "macOS/Xcode 12/Static" - os: osx - osx_image: xcode12 - env: - - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua --disable-shared CFLAGS=-I/usr/local/opt/tcl-tk/include" - - name: "macOS/Xcode 12/Debug" - os: osx - osx_image: xcode12 - env: - - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua --enable-symbols CFLAGS=-I/usr/local/opt/tcl-tk/include" -# - name: "macOS/Xcode 12/Shared/XQuartz" -# os: osx -# osx_image: xcode12 -# env: -# - BUILD_DIR=unix -# - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --disable-corefoundation --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib CFLAGS=-I/usr/local/opt/tcl-tk/include" -# Older MacOS versions - - name: "macOS/Xcode 11/Shared" - os: osx - osx_image: xcode11.7 - env: - - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-mmacosx-version-min=10.14" - - name: "macOS/Xcode 10/Shared" - os: osx - osx_image: xcode10.3 - addons: - homebrew: - packages: - - tcl-tk - update: true - env: - - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-mmacosx-version-min=10.14" - - name: "macOS/Xcode 9/Shared" - os: osx - osx_image: xcode9.4 - addons: - homebrew: - packages: - - tcl-tk - update: true - env: - - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-mmacosx-version-min=10.13" -# Test on Windows with MSVC native -# - name: "Windows/MSVC/Shared" -# os: windows -# compiler: cl -# env: &vcenv -# - BUILD_DIR=win -# - VCDIR="/C/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build" -# before_install: &vcpreinst -# - PATH="$PATH:$VCDIR" -# - cd ${BUILD_DIR} -# install: [] -# script: -# - cmd.exe //C vcvarsall.bat x64 '&&' nmake '-f' makefile.vc all tktest -# "make dist" only - - name: "Linux: make dist" - os: linux - dist: focal - compiler: gcc - env: - - BUILD_DIR=unix - script: - - make dist -before_install: - - |- - case $TRAVIS_OS_NAME in - windows) - choco install -y magicsplat-tcl-tk - ;; - esac - - cd ${BUILD_DIR} -install: - - mkdir "$HOME/install dir" - - ./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1) -script: - - make all tktest - - make install -before_cache: - - |- - case $TRAVIS_OS_NAME in - osx) - brew cleanup - ;; - esac -cache: - directories: - - $HOME/Library/Caches/Homebrew - - $HOME/AppData/Local/Temp/chocolatey - - $HOME/AppData/Local/Apps/Tcl86 diff --git a/generic/tkMenubutton.h b/generic/tkMenubutton.h index 146bfe7..043c88d 100644 --- a/generic/tkMenubutton.h +++ b/generic/tkMenubutton.h @@ -165,7 +165,7 @@ typedef struct { * "right", and "flush". "flush" means that * the upper left corner of the menubutton is * where the menu pops up. "above" and "below" - * will attempt to pop the menu compleletly + * will attempt to pop the menu completely * above or below the menu respectively. * "left" and "right" will pop the menu left * or right, and the active item will be next diff --git a/generic/tkText.c b/generic/tkText.c index 0eb8d7f..78fe385 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -220,7 +220,7 @@ static const Tk_OptionSpec optionSpecs[] = { TK_OPTION_NULL_OK, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING_TABLE, "-tabstyle", "tabStyle", "TabStyle", DEF_TEXT_TABSTYLE, TCL_INDEX_NONE, offsetof(TkText, tabStyle), - 0, tkTextTabStyleStrings, TK_TEXT_LINE_GEOMETRY}, + TK_OPTION_ENUM_VAR, tkTextTabStyleStrings, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_TEXT_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(TkText, takeFocus), TK_OPTION_NULL_OK, 0, 0}, diff --git a/generic/tkText.h b/generic/tkText.h index 4850156..b16ada9 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -99,6 +99,10 @@ typedef struct TkTextEmbWindowClient { struct TkTextEmbWindowClient *next; } TkTextEmbWindowClient; +typedef enum { + TK_ALIGN_BASELINE, TK_ALIGN_BOTTOM, TK_ALIGN_CENTER, TK_ALIGN_TOP +} TkAlignMode; + typedef struct TkTextEmbWindow { struct TkSharedText *sharedTextPtr; /* Information about the shared portion of the @@ -112,7 +116,7 @@ typedef struct TkTextEmbWindow { * window. */ char *create; /* Script to create window on-demand. NULL * means no such script. Malloc-ed. */ - int align; /* How to align window in vertical space. See + TkAlignMode align; /* How to align window in vertical space. See * definitions in tkTextWind.c. */ int padX, padY; /* Padding to leave around each side of * window, in pixels. */ @@ -144,7 +148,7 @@ typedef struct TkTextEmbImage { * the image. */ Tk_Image image; /* Image for this segment. NULL means that the * image hasn't been created yet. */ - int align; /* How to align image in vertical space. See + TkAlignMode align; /* How to align image in vertical space. See * definitions in tkTextImage.c. */ int padX, padY; /* Padding to leave around each side of image, * in pixels. */ @@ -288,6 +292,20 @@ typedef enum { TEXT_WRAPMODE_WORD } TkWrapMode; +/* + * The following are the supported styles of tabbing, used for the -tabstyle + * option of the text widget. The first element is only used for tag options. + */ + +typedef enum { + TK_TEXT_TABSTYLE_NULL = -1, + TK_TEXT_TABSTYLE_TABULAR, + TK_TEXT_TABSTYLE_WORDPROCESSOR +} TkTextTabStyle; + +MODULE_SCOPE const char *const tkTextTabStyleStrings[]; + + MODULE_SCOPE const char *const tkTextWrapStrings[]; typedef struct TkTextTag { @@ -385,7 +403,7 @@ typedef struct TkTextTag { struct TkTextTabArray *tabArrayPtr; /* Info about tabs for tag (malloc-ed) or * NULL. Corresponds to tabString. */ - int tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR + TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR * or TK_TEXT_TABSTYLE_NULL (if not specified). */ Tcl_Obj *underlinePtr; /* -underline option. NULL * means option not specified. */ @@ -454,19 +472,6 @@ typedef struct TkTextSearch { typedef enum {LEFT, RIGHT, CENTER, NUMERIC} TkTextTabAlign; -/* - * The following are the supported styles of tabbing, used for the -tabstyle - * option of the text widget. The first element is only used for tag options. - */ - -typedef enum { - TK_TEXT_TABSTYLE_NULL = -1, - TK_TEXT_TABSTYLE_TABULAR, - TK_TEXT_TABSTYLE_WORDPROCESSOR -} TkTextTabStyle; - -MODULE_SCOPE const char *const tkTextTabStyleStrings[]; - typedef struct TkTextTab { int location; /* Offset in pixels of this tab stop from the * left margin (lmargin2) of the text. */ @@ -641,7 +646,7 @@ typedef struct TkText { Tcl_Interp *interp; /* Interpreter associated with widget. Used to * delete widget command. */ Tcl_Command widgetCmd; /* Token for text's widget command. */ - TkTextState state; /* Either TK_TEXT_STATE_NORMAL or TK_TEXT_STATE_DISABLED. A + TkTextState state; /* Either TK_TEXT_STATE_DISABLED or TK_TEXT_STATE_NORMAL. A * text widget is read-only when disabled. */ /* @@ -681,7 +686,7 @@ typedef struct TkText { /* Information about tab stops (malloc'ed). * NULL means perform default tabbing * behavior. */ - int tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ + TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ /* * Additional information used for displaying: diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index efe30fd..03a5041 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -150,7 +150,7 @@ typedef struct StyleValues { int spacing3; /* Spacing below last dline in text line. */ TkTextTabArray *tabArrayPtr;/* Locations and types of tab stops (may be * NULL). */ - int tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ + TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ int underline; /* Non-zero means draw underline underneath * text. */ XColor *underlineColor; /* Foreground color for underline underneath @@ -1171,7 +1171,7 @@ LayoutDLine( * chunk. */ TkTextTabArray *tabArrayPtr;/* Tab stops for line; taken from style for * the first character on line. */ - int tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ + TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ int tabSize; /* Number of pixels consumed by current tab * stop. */ TkTextDispChunk *lastCharChunkPtr; @@ -8489,7 +8489,7 @@ static int SizeOfTab( TkText *textPtr, /* Information about the text widget as a * whole. */ - int tabStyle, /* One of TK_TEXT_TABSTYLE_TABULAR + TkTextTabStyle tabStyle, /* One of TK_TEXT_TABSTYLE_TABULAR * or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ TkTextTabArray *tabArrayPtr,/* Information about the tab stops that apply * to this line. NULL means use default diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c index e759584..2d2498b 100644 --- a/generic/tkTextImage.c +++ b/generic/tkTextImage.c @@ -77,10 +77,6 @@ static const char *const alignStrings[] = { "baseline", "bottom", "center", "top", NULL }; -typedef enum { - ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_TOP -} alignMode; - /* * Information used for parsing image configuration options: */ @@ -88,7 +84,7 @@ typedef enum { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-align", NULL, NULL, "center", TCL_INDEX_NONE, offsetof(TkTextEmbImage, align), - 0, alignStrings, 0}, + TK_OPTION_ENUM_VAR, alignStrings, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, "0", TCL_INDEX_NONE, offsetof(TkTextEmbImage, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", NULL, NULL, @@ -255,7 +251,7 @@ TkTextImageCmd( eiPtr->body.ei.imageString = NULL; eiPtr->body.ei.name = NULL; eiPtr->body.ei.image = NULL; - eiPtr->body.ei.align = ALIGN_CENTER; + eiPtr->body.ei.align = TK_ALIGN_CENTER; eiPtr->body.ei.padX = eiPtr->body.ei.padY = 0; eiPtr->body.ei.chunkCount = 0; eiPtr->body.ei.optionTable = Tk_CreateOptionTable(interp, optionSpecs); @@ -566,7 +562,7 @@ EmbImageLayoutProc( chunkPtr->measureProc = NULL; chunkPtr->bboxProc = EmbImageBboxProc; chunkPtr->numBytes = 1; - if (eiPtr->body.ei.align == ALIGN_BASELINE) { + if (eiPtr->body.ei.align == TK_ALIGN_BASELINE) { chunkPtr->minAscent = height - eiPtr->body.ei.padY; chunkPtr->minDescent = eiPtr->body.ei.padY; chunkPtr->minHeight = 0; @@ -728,16 +724,16 @@ EmbImageBboxProc( *xPtr = chunkPtr->x + eiPtr->body.ei.padX; switch (eiPtr->body.ei.align) { - case ALIGN_BOTTOM: + case TK_ALIGN_BOTTOM: *yPtr = y + (lineHeight - *heightPtr - eiPtr->body.ei.padY); break; - case ALIGN_CENTER: + case TK_ALIGN_CENTER: *yPtr = y + (lineHeight - *heightPtr)/2; break; - case ALIGN_TOP: + case TK_ALIGN_TOP: *yPtr = y + eiPtr->body.ei.padY; break; - case ALIGN_BASELINE: + case TK_ALIGN_BASELINE: *yPtr = y + (baseline - *heightPtr); break; } diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index 344fd70..e21f2ac 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -69,7 +69,7 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, offsetof(TkTextTag, tabStringPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-tabstyle", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, tabStyle), - TK_OPTION_NULL_OK, tkTextTabStyleStrings, 0}, + TK_OPTION_NULL_OK|TK_OPTION_ENUM_VAR, tkTextTabStyleStrings, 0}, {TK_OPTION_BOOLEAN, "-underline", NULL, NULL, NULL, offsetof(TkTextTag, underlinePtr), offsetof(TkTextTag, underline), TK_OPTION_NULL_OK, 0, 0}, diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index 391f836..f8ec9f5 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -89,10 +89,6 @@ static const char *const alignStrings[] = { "baseline", "bottom", "center", "top", NULL }; -typedef enum { - ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_TOP -} alignMode; - /* * Information used for parsing window configuration options: */ @@ -100,7 +96,7 @@ typedef enum { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-align", NULL, NULL, "center", TCL_INDEX_NONE, offsetof(TkTextEmbWindow, align), - 0, alignStrings, 0}, + TK_OPTION_ENUM_VAR, alignStrings, 0}, {TK_OPTION_STRING, "-create", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextEmbWindow, create), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, @@ -295,7 +291,7 @@ TkTextWindowCmd( ewPtr->body.ew.linePtr = NULL; ewPtr->body.ew.tkwin = NULL; ewPtr->body.ew.create = NULL; - ewPtr->body.ew.align = ALIGN_CENTER; + ewPtr->body.ew.align = TK_ALIGN_CENTER; ewPtr->body.ew.padX = ewPtr->body.ew.padY = 0; ewPtr->body.ew.stretch = 0; ewPtr->body.ew.optionTable = Tk_CreateOptionTable(interp, optionSpecs); @@ -1009,7 +1005,7 @@ EmbWinLayoutProc( chunkPtr->measureProc = NULL; chunkPtr->bboxProc = EmbWinBboxProc; chunkPtr->numBytes = 1; - if (ewPtr->body.ew.align == ALIGN_BASELINE) { + if (ewPtr->body.ew.align == TK_ALIGN_BASELINE) { chunkPtr->minAscent = height - ewPtr->body.ew.padY; chunkPtr->minDescent = ewPtr->body.ew.padY; chunkPtr->minHeight = 0; @@ -1257,23 +1253,23 @@ EmbWinBboxProc( } *xPtr = chunkPtr->x + ewPtr->body.ew.padX; if (ewPtr->body.ew.stretch) { - if (ewPtr->body.ew.align == ALIGN_BASELINE) { + if (ewPtr->body.ew.align == TK_ALIGN_BASELINE) { *heightPtr = baseline - ewPtr->body.ew.padY; } else { *heightPtr = lineHeight - 2*ewPtr->body.ew.padY; } } switch (ewPtr->body.ew.align) { - case ALIGN_BOTTOM: + case TK_ALIGN_BOTTOM: *yPtr = y + (lineHeight - *heightPtr - ewPtr->body.ew.padY); break; - case ALIGN_CENTER: + case TK_ALIGN_CENTER: *yPtr = y + (lineHeight - *heightPtr)/2; break; - case ALIGN_TOP: + case TK_ALIGN_TOP: *yPtr = y + ewPtr->body.ew.padY; break; - case ALIGN_BASELINE: + case TK_ALIGN_BASELINE: *yPtr = y + (baseline - *heightPtr); break; } diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index 51f86c2..8ed8bee 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -818,7 +818,7 @@ typedef struct * Option specifications: */ static const char *const directionStrings[] = { - "above", "below", "left", "right", "flush", NULL + "above", "below", "flush", "left", "right", NULL }; static const Tk_OptionSpec MenubuttonOptionSpecs[] = { diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index 0560e74..c774d43 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -931,9 +931,9 @@ typedef struct { } MenubuttonArrowElement; static const char *const directionStrings[] = { /* See also: button.c */ - "above", "below", "left", "right", "flush", NULL + "above", "below", "flush", "left", "right", NULL }; -enum { POST_ABOVE, POST_BELOW, POST_LEFT, POST_RIGHT, POST_FLUSH }; +enum { POST_ABOVE, POST_BELOW, POST_FLUSH, POST_LEFT, POST_RIGHT }; static const Ttk_ElementOptionSpec MenubuttonArrowElementOptions[] = { { "-direction", TK_OPTION_STRING, diff --git a/unix/Makefile.in b/unix/Makefile.in index d6499a0..90f3683 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1794,7 +1794,6 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(MAC $(TEST_DIR)/option.file* $(DISTDIR)/tests $(INSTALL_DATA_DIR) $(DISTDIR)/tests/ttk $(DIST_INSTALL_DATA) $(TEST_DIR)/ttk/*.{svg,test,tcl} $(DISTDIR)/tests/ttk - cp -p $(TOP_DIR)/.travis.yml $(DISTDIR) mkdir -p $(DISTDIR)/.github/workflows cp -p $(TOP_DIR)/.github/workflows/*.yml $(DISTDIR)/.github/workflows |