Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch tip-487 Excluding Merge-Ins
This is equivalent to a diff from 909b2eb5 to 6baad6d4
2017-12-07
| ||
12:14 | TIP #487: Stop support for Pre-XP Windows check-in: de05012d user: jan.nijtmans tags: trunk | |
2017-11-28
| ||
09:17 | CONST'ify some string arrays (strings itself where already CONST, but the arrays were not). Minor C-compiler optimization. check-in: 4258d2f4 user: jan.nijtmans tags: trunk | |
08:38 | Merge trunk. Another MSYS compilation fix attempt: Setting WINVER to 0x0600 should do the trick to make it compile. Closed-Leaf check-in: 6baad6d4 user: jan.nijtmans tags: tip-487 | |
03:00 | Merge core-8-6-branch into trunk, removes obsolete experimental Mac window flags check-in: 909b2eb5 user: kevin_walzer tags: trunk | |
02:57 | Merge in remove_mac_decorations branch check-in: 7a7a1baa user: kevin_walzer tags: core-8-6-branch | |
2017-11-27
| ||
22:50 | Merge core-8-6-branch into trunk. Removes conditional code for OS X 10.5. check-in: c4638df7 user: culler tags: trunk | |
12:31 | Defining NTDDI_VERSION doesn't appear to work with mingw-w64. Don't bother. check-in: c3db263d user: jan.nijtmans tags: tip-487 | |
Changes to generic/tk.h.
︙ | ︙ | |||
748 749 750 751 752 753 754 | (((Tk_FakeWin *) (tkwin))->flags & TK_WIN_MANAGED) #define Tk_TopWinHierarchy(tkwin) \ (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY) #define Tk_IsManageable(tkwin) \ (((Tk_FakeWin *) (tkwin))->flags & TK_WM_MANAGEABLE) #define Tk_ReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->reqWidth) #define Tk_ReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->reqHeight) | | | 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 | (((Tk_FakeWin *) (tkwin))->flags & TK_WIN_MANAGED) #define Tk_TopWinHierarchy(tkwin) \ (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY) #define Tk_IsManageable(tkwin) \ (((Tk_FakeWin *) (tkwin))->flags & TK_WM_MANAGEABLE) #define Tk_ReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->reqWidth) #define Tk_ReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->reqHeight) #if !defined(TK_NO_DEPRECATED) && TK_MAJOR_VERSION < 9 #define Tk_InternalBorderWidth(tkwin) \ (((Tk_FakeWin *) (tkwin))->internalBorderLeft) #endif /* !TK_NO_DEPRECATED */ #define Tk_InternalBorderLeft(tkwin) \ (((Tk_FakeWin *) (tkwin))->internalBorderLeft) #define Tk_InternalBorderRight(tkwin) \ (((Tk_FakeWin *) (tkwin))->internalBorderRight) |
︙ | ︙ | |||
1568 1569 1570 1571 1572 1573 1574 | * Allow users to say that they don't want to alter their source to add extra * arguments to Tk_PhotoPutBlock() et al. * * This goes after the inclusion of the stubbed-decls so that the declarations * of what is actually there can be correct. */ | | | 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 | * Allow users to say that they don't want to alter their source to add extra * arguments to Tk_PhotoPutBlock() et al. * * This goes after the inclusion of the stubbed-decls so that the declarations * of what is actually there can be correct. */ #if !defined(TK_NO_DEPRECATED) && TK_MAJOR_VERSION < 9 && !defined(BUILD_tk) #ifdef USE_COMPOSITELESS_PHOTO_PUT_BLOCK # ifdef Tk_PhotoPutBlock # undef Tk_PhotoPutBlock # endif # define Tk_PhotoPutBlock Tk_PhotoPutBlock_NoComposite # ifdef Tk_PhotoPutZoomedBlock # undef Tk_PhotoPutZoomedBlock |
︙ | ︙ |
Changes to generic/tkIntPlatDecls.h.
︙ | ︙ | |||
662 663 664 665 666 667 668 669 | #endif /* defined(USE_TK_STUBS) */ /* !END!: Do not edit above this line. */ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #endif /* _TKINTPLATDECLS */ | > > > | 662 663 664 665 666 667 668 669 670 671 672 | #endif /* defined(USE_TK_STUBS) */ /* !END!: Do not edit above this line. */ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #undef TkWinGetPlatformId #define TkWinGetPlatformId() (2) /* VER_PLATFORM_WIN32_NT */ #endif /* _TKINTPLATDECLS */ |
Changes to generic/tkStubInit.c.
︙ | ︙ | |||
35 36 37 38 39 40 41 42 43 | /* * Remove macro that might interfere with the definition below. */ #undef Tk_MainEx #undef Tk_FreeXId | > | > > > > | | | > > | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | /* * Remove macro that might interfere with the definition below. */ #undef Tk_MainEx #undef Tk_FreeXId #undef TkWinGetPlatformId #if defined(TK_NO_DEPRECATED) || TK_MAJOR_VERSION > 8 #define Tk_FreeXId 0 #define TkWinGetPlatformId 0 #define Tk_PhotoPutBlock_NoComposite 0 #define Tk_PhotoPutZoomedBlock_NoComposite 0 #define Tk_PhotoExpand_Panic 0 #define Tk_PhotoPutBlock_Panic 0 #define Tk_PhotoPutZoomedBlock_Panic 0 #define Tk_PhotoSetSize_Panic 0 #else static void doNothing(void) { /* dummy implementation, no need to do anything */ } #define Tk_FreeXId ((void (*)(Display *, XID)) doNothing) #if defined(_WIN32) || defined(__CYGWIN__) #define TkWinGetPlatformId winGetPlatformId static int TkWinGetPlatformId() { return 2; } #endif /* defined(_WIN32) || defined(__CYGWIN__) */ #endif /* defined(TK_NO_DEPRECATED) || TK_MAJOR_VERSION > 8 */ #ifdef _WIN32 int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) { /* dummy implementation, no need to do anything */ return 0; } void |
︙ | ︙ | |||
221 222 223 224 225 226 227 | # define TkWinSetWindowPos 0 # define TkWinWmCleanup 0 # define TkWinXCleanup 0 # define TkWinXInit 0 # define TkWinSetForegroundWindow 0 # define TkWinDialogDebug 0 # define TkWinGetMenuSystemDefault 0 | < | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | # define TkWinSetWindowPos 0 # define TkWinWmCleanup 0 # define TkWinXCleanup 0 # define TkWinXInit 0 # define TkWinSetForegroundWindow 0 # define TkWinDialogDebug 0 # define TkWinGetMenuSystemDefault 0 # define TkWinSetHINSTANCE 0 # define TkWinGetPlatformTheme 0 # define TkWinChildProc 0 # elif !defined(MAC_OSX_TK) /* UNIX */ # undef TkClipBox |
︙ | ︙ |
Changes to win/configure.
︙ | ︙ | |||
689 690 691 692 693 694 695 | LDFLAGS_DEFAULT CFLAGS_DEFAULT MAN2TCLFLAGS CFLAGS_WARNING CFLAGS_OPTIMIZE CFLAGS_DEBUG DL_LIBS | < | 689 690 691 692 693 694 695 696 697 698 699 700 701 702 | LDFLAGS_DEFAULT CFLAGS_DEFAULT MAN2TCLFLAGS CFLAGS_WARNING CFLAGS_OPTIMIZE CFLAGS_DEBUG DL_LIBS CYGPATH TCL_DEFS TCL_STUB_LIB_SPEC TCL_STUB_LIB_FLAG TCL_STUB_LIB_FILE TCL_LIB_SPEC TCL_LIB_FLAG |
︙ | ︙ | |||
761 762 763 764 765 766 767 | ac_subst_files='' ac_user_opts=' enable_option_checking enable_threads enable_shared with_tcl enable_64bit | < < | 760 761 762 763 764 765 766 767 768 769 770 771 772 773 | ac_subst_files='' ac_user_opts=' enable_option_checking enable_threads enable_shared with_tcl enable_64bit enable_symbols enable_embedded_manifest ' ac_precious_vars='build_alias host_alias target_alias CC |
︙ | ︙ | |||
1385 1386 1387 1388 1389 1390 1391 | Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-threads build with threads (default: on) --enable-shared build and link with shared libraries (default: on) --enable-64bit enable 64bit support (where applicable) | < < | 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 | Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-threads build with threads (default: on) --enable-shared build and link with shared libraries (default: on) --enable-64bit enable 64bit support (where applicable) --enable-symbols build with debugging symbols (default: off) --enable-embedded-manifest embed manifest if possible (default: yes) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-tcl directory containing tcl configuration (tclConfig.sh) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> LIBS libraries to pass to the linker, e.g. -l<library> |
︙ | ︙ | |||
3978 3979 3980 3981 3982 3983 3984 | else do64bit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 $as_echo "$do64bit" >&6; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < | 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 | else do64bit=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 $as_echo "$do64bit" >&6; } # Set some defaults (may get changed below) EXTRA_CFLAGS="" $as_echo "#define MODULE_SCOPE extern" >>confdefs.h # Extract the first word of "cygpath", so it can be a program name with args. |
︙ | ︙ | |||
4279 4280 4281 4282 4283 4284 4285 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler flags" >&5 $as_echo_n "checking compiler flags... " >&6; } if test "${GCC}" = "yes" ; then SHLIB_LD="" SHLIB_LD_LIBS='${LIBS}' LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -luserenv -lws2_32" # mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't | | | 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler flags" >&5 $as_echo_n "checking compiler flags... " >&6; } if test "${GCC}" = "yes" ; then SHLIB_LD="" SHLIB_LD_LIBS='${LIBS}' LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -luserenv -lws2_32" # mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't LIBS_GUI="-luxtheme -lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32" STLIB_LD='${AR} cr' RC_OUT=-o RC_TYPE= RC_INCLUDE=--include RC_DEFINE=--define RES=res.o MAKE_LIB="\${STLIB_LD} \$@" |
︙ | ︙ | |||
4503 4504 4505 4506 4507 4508 4509 | CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d" # -O2 - create fast code (/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy) CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" lflags="${lflags} -nologo" LINKBIN="link" fi | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < | 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 | CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d" # -O2 - create fast code (/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy) CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" lflags="${lflags} -nologo" LINKBIN="link" fi LIBS_GUI="gdi32.lib uxtheme.lib comdlg32.lib imm32.lib comctl32.lib shell32.lib uuid.lib" SHLIB_LD="${LINKBIN} -dll -incremental:no ${lflags}" SHLIB_LD_LIBS='${LIBS}' # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" RC_OUT=-fo RC_TYPE=-r |
︙ | ︙ | |||
4634 4635 4636 4637 4638 4639 4640 | # Specify the CC output file names based on the target name CC_OBJNAME="-Fo\$@" CC_EXENAME="-Fe\"\$(shell \$(CYGPATH) '\$@')\"" # Specify linker flags depending on the type of app being # built -- Console vs. Window. | | | 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 | # Specify the CC output file names based on the target name CC_OBJNAME="-Fo\$@" CC_EXENAME="-Fe\"\$(shell \$(CYGPATH) '\$@')\"" # Specify linker flags depending on the type of app being # built -- Console vs. Window. if test "${TARGETCPU}" != "X86"; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi |
︙ | ︙ | |||
4881 4882 4883 4884 4885 4886 4887 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_strtoi64" >&5 $as_echo "$tcl_cv_strtoi64" >&6; } if test $tcl_cv_strtoi64 = no; then $as_echo "#define NO_STRTOI64 1" >>confdefs.h fi | < < < < < < < < < < < < < < < < < < < < < < < < < | 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_strtoi64" >&5 $as_echo "$tcl_cv_strtoi64" >&6; } if test $tcl_cv_strtoi64 = no; then $as_echo "#define NO_STRTOI64 1" >>confdefs.h fi #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols # option. This macro depends on C flags, and should be called # after SC_CONFIG_CFLAGS macro is called. #-------------------------------------------------------------------- |
︙ | ︙ |
Changes to win/configure.ac.
︙ | ︙ | |||
117 118 119 120 121 122 123 | AC_TRY_LINK([#include <stdlib.h>], [_strtoi64(0,0,0)], tcl_cv_strtoi64=yes, tcl_cv_strtoi64=no)]) if test $tcl_cv_strtoi64 = no; then AC_DEFINE(NO_STRTOI64, 1, [Is _strtoi64 function available?]) fi | < < < < < < < < < < < | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | AC_TRY_LINK([#include <stdlib.h>], [_strtoi64(0,0,0)], tcl_cv_strtoi64=yes, tcl_cv_strtoi64=no)]) if test $tcl_cv_strtoi64 = no; then AC_DEFINE(NO_STRTOI64, 1, [Is _strtoi64 function available?]) fi #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols # option. This macro depends on C flags, and should be called # after SC_CONFIG_CFLAGS macro is called. #-------------------------------------------------------------------- SC_ENABLE_SYMBOLS |
︙ | ︙ |
Changes to win/makefile.vc.
︙ | ︙ | |||
72 73 74 75 76 77 78 | # Tk does need the source directory, though. Tk comes very close # to not needing the sources, but does, in fact, require them. # # INSTALLDIR=<path> # Sets where to install Tcl from the built binaries. # C:\Progra~1\Tcl is assumed when not specified. # | | < < | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | # Tk does need the source directory, though. Tk comes very close # to not needing the sources, but does, in fact, require them. # # INSTALLDIR=<path> # Sets where to install Tcl from the built binaries. # C:\Progra~1\Tcl is assumed when not specified. # # OPTS=loimpact,msvcrt,nothreads,pdbs,profile,square,static,staticpkg,symbols,unchecked,none # Sets special options for the core. The default is for none. # Any combination of the above may be used (comma separated). # 'none' will over-ride everything to nothing. # # loimpact = Adds a flag for how NT treats the heap to keep memory # in use, low. This is said to impact alloc performance. # msvcrt = Affects the static option only to switch it from # using libcmt(d) as the C runtime [by default] to # msvcrt(d). This is useful for static embedding # support. # nothreads= Turns off full multithreading support. # square = Include the demo square widget. # static = Builds a static library of the core instead of a # dll. The shell will be static (and large), as well. # staticpkg= Affects the static option only to switch wishXX.exe # to have the dde and reg extension linked inside it. # pdbs = Build detached symbols for release builds. # profile = Adds profiling hooks. Map file is assumed. |
︙ | ︙ | |||
188 189 190 191 192 193 194 | !if $(TCLINSTALL) !message *** Warning: Tk requires the source distribution of Tcl to build from, !message *** at this time, sorry. Please set the TCLDIR macro to point to the !message *** Tcl sources. !endif # Extra makefile options processing... | < < < < < < < < < < < | 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | !if $(TCLINSTALL) !message *** Warning: Tk requires the source distribution of Tcl to build from, !message *** at this time, sorry. Please set the TCLDIR macro to point to the !message *** Tcl sources. !endif # Extra makefile options processing... !if [nmakehlp -f "$(OPTS)" "square"] !message *** Include ttk square demo widget TTK_SQUARE_WIDGET = 1 !else TTK_SQUARE_WIDGET = 0 !endif STUBPREFIX = $(PROJECT)stub WISHNAMEPREFIX = wish BINROOT = $(MAKEDIR) # originally . ROOT = $(MAKEDIR)\.. # originally .. |
︙ | ︙ |
Changes to win/tcl.m4.
︙ | ︙ | |||
540 541 542 543 544 545 546 | # Step 0: Enable 64 bit support? AC_MSG_CHECKING([if 64bit support is requested]) AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)], [do64bit=$enableval], [do64bit=no]) AC_MSG_RESULT($do64bit) | < < < < < < < < < < < | 540 541 542 543 544 545 546 547 548 549 550 551 552 553 | # Step 0: Enable 64 bit support? AC_MSG_CHECKING([if 64bit support is requested]) AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)], [do64bit=$enableval], [do64bit=no]) AC_MSG_RESULT($do64bit) # Set some defaults (may get changed below) EXTRA_CFLAGS="" AC_DEFINE(MODULE_SCOPE, [extern], [No need to mark inidividual symbols as hidden]) AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo) SHLIB_SUFFIX=".dll" |
︙ | ︙ | |||
671 672 673 674 675 676 677 | AC_MSG_CHECKING([compiler flags]) if test "${GCC}" = "yes" ; then SHLIB_LD="" SHLIB_LD_LIBS='${LIBS}' LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -luserenv -lws2_32" # mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't | | | 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 | AC_MSG_CHECKING([compiler flags]) if test "${GCC}" = "yes" ; then SHLIB_LD="" SHLIB_LD_LIBS='${LIBS}' LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -luserenv -lws2_32" # mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't LIBS_GUI="-luxtheme -lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32" STLIB_LD='${AR} cr' RC_OUT=-o RC_TYPE= RC_INCLUDE=--include RC_DEFINE=--define RES=res.o MAKE_LIB="\${STLIB_LD} \[$]@" |
︙ | ︙ | |||
867 868 869 870 871 872 873 | CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d" # -O2 - create fast code (/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy) CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" lflags="${lflags} -nologo" LINKBIN="link" fi | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < | 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 | CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d" # -O2 - create fast code (/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy) CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" lflags="${lflags} -nologo" LINKBIN="link" fi LIBS_GUI="gdi32.lib uxtheme.lib comdlg32.lib imm32.lib comctl32.lib shell32.lib uuid.lib" SHLIB_LD="${LINKBIN} -dll -incremental:no ${lflags}" SHLIB_LD_LIBS='${LIBS}' # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" RC_OUT=-fo RC_TYPE=-r |
︙ | ︙ | |||
989 990 991 992 993 994 995 | # Specify the CC output file names based on the target name CC_OBJNAME="-Fo\[$]@" CC_EXENAME="-Fe\"\$(shell \$(CYGPATH) '\[$]@')\"" # Specify linker flags depending on the type of app being # built -- Console vs. Window. | | | 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 | # Specify the CC output file names based on the target name CC_OBJNAME="-Fo\[$]@" CC_EXENAME="-Fe\"\$(shell \$(CYGPATH) '\[$]@')\"" # Specify linker flags depending on the type of app being # built -- Console vs. Window. if test "${TARGETCPU}" != "X86"; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi |
︙ | ︙ |
Changes to win/tkWin.h.
︙ | ︙ | |||
14 15 16 17 18 19 20 | #define _TKWIN /* * We must specify the lower version we intend to support. In particular * the SystemParametersInfo API doesn't like to receive structures that * are larger than it expects which affects the font assignments. * | | > < < < | | | | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | #define _TKWIN /* * We must specify the lower version we intend to support. In particular * the SystemParametersInfo API doesn't like to receive structures that * are larger than it expects which affects the font assignments. * * WINVER = 0x0600 means Windows Vista and above. Even though we still * support Windows XP, but the Vista-specifics are tested at runtime. */ #ifndef WINVER # define WINVER 0x0600 #endif #ifndef _WIN32_WINNT # define _WIN32_WINNT 0x0600 #endif #ifndef _WIN32_IE # define _WIN32_IE 0x0700 #endif #ifndef _TK #include <tk.h> #endif #define WIN32_LEAN_AND_MEAN |
︙ | ︙ |
Changes to win/tkWinX.c.
︙ | ︙ | |||
47 48 49 50 51 52 53 | * Declarations of static variables used in this file. */ static const char winScreenName[] = ":0"; /* Default name of windows display. */ static HINSTANCE tkInstance = NULL; /* Application instance handle. */ static int childClassInitialized; /* Registered child class? */ static WNDCLASS childClass; /* Window class for child windows. */ | < | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | * Declarations of static variables used in this file. */ static const char winScreenName[] = ":0"; /* Default name of windows display. */ static HINSTANCE tkInstance = NULL; /* Application instance handle. */ static int childClassInitialized; /* Registered child class? */ static WNDCLASS childClass; /* Window class for child windows. */ static int tkWinTheme = 0; /* See TkWinGetPlatformTheme */ static Tcl_Encoding keyInputEncoding = NULL; /* The current character encoding for * keyboard input */ static int keyInputCharset = -1; /* The Win32 CHARSET for the keyboard * encoding */ static Tcl_Encoding unicodeEncoding = NULL; |
︙ | ︙ | |||
301 302 303 304 305 306 307 | TkWinWmCleanup(hInstance); TkWinCleanupContainerList(); } /* *---------------------------------------------------------------------- * | | | < | | < < < < < | | < < | | 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | TkWinWmCleanup(hInstance); TkWinCleanupContainerList(); } /* *---------------------------------------------------------------------- * * TkWinGetPlatformTheme -- * * Return the Windows drawing style we should be using. * * Results: * The return value is one of: * TK_THEME_WIN_CLASSIC 95/98/NT or XP in classic mode * TK_THEME_WIN_XP XP not in classic mode * *---------------------------------------------------------------------- */ int TkWinGetPlatformTheme(void) { if (tkWinTheme == 0) { OSVERSIONINFOW os; os.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); GetVersionExW(&os); /* * Set tkWinTheme to be TK_THEME_WIN_XP or TK_THEME_WIN_CLASSIC. The * TK_THEME_WIN_CLASSIC could be set even when running under XP if the * windows classic theme was selected. */ if ((os.dwMajorVersion == 5 && os.dwMinorVersion == 1)) { HKEY hKey; LPCTSTR szSubKey = TEXT("Control Panel\\Appearance"); LPCTSTR szCurrent = TEXT("Current"); DWORD dwSize = 200; char pBuffer[200]; memset(pBuffer, 0, dwSize); |
︙ | ︙ | |||
360 361 362 363 364 365 366 | tkWinTheme = TK_THEME_WIN_XP; } } } else { tkWinTheme = TK_THEME_WIN_CLASSIC; } } | < < < < < < < < < < < < < < < < < < < < < < < < < < < | 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | tkWinTheme = TK_THEME_WIN_XP; } } } else { tkWinTheme = TK_THEME_WIN_CLASSIC; } } return tkWinTheme; } /* *---------------------------------------------------------------------- * * TkGetDefaultScreenName -- |
︙ | ︙ |
Changes to win/ttkWinXPTheme.c.
︙ | ︙ | |||
12 13 14 15 16 17 18 | * See also: * * <URL: http://msdn.microsoft.com/library/en-us/ * shellcc/platform/commctls/userex/refentry.asp > */ #include <tkWinInt.h> | < < < < < | | < | < < < < < < < < < < < < < < < < < < < | < | < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | * See also: * * <URL: http://msdn.microsoft.com/library/en-us/ * shellcc/platform/commctls/userex/refentry.asp > */ #include <tkWinInt.h> #include <windows.h> #include <uxtheme.h> #if defined(_MSC_VER) && _MSC_VER > 1500 # include <vssym32.h> #else # include <tmschema.h> #endif #ifdef _MSC_VER # pragma comment (lib, "uxtheme.lib") #endif #include "ttk/ttkTheme.h" static int XPThemeEnabled(Ttk_Theme theme, void *clientData) { int active = IsThemeActive(); int themed = IsAppThemed(); return (active && themed); } /* * BoxToRect -- * Helper routine. Returns a RECT data structure. */ |
︙ | ︙ | |||
388 389 390 391 392 393 394 | typedef struct { /* * Static data, initialized when element is registered: */ ElementInfo *info; | | | | | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | typedef struct { /* * Static data, initialized when element is registered: */ ElementInfo *info; HWND stubWindow; /* * Dynamic data, allocated by InitElementData: */ HTHEME hTheme; HDC hDC; HWND hwnd; /* For TkWinDrawableReleaseDC: */ Drawable drawable; TkWinDCState dcState; } ElementData; static ElementData * NewElementData(HWND stubWindow, ElementInfo *info) { ElementData *elementData = ckalloc(sizeof(ElementData)); elementData->stubWindow = stubWindow; elementData->info = info; elementData->hTheme = elementData->hDC = 0; return elementData; } /* |
︙ | ︙ | |||
450 451 452 453 454 455 456 | InitElementData(ElementData *elementData, Tk_Window tkwin, Drawable d) { Window win = Tk_WindowId(tkwin); if (win != None) { elementData->hwnd = Tk_GetHWND(win); } else { | | | | | 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | InitElementData(ElementData *elementData, Tk_Window tkwin, Drawable d) { Window win = Tk_WindowId(tkwin); if (win != None) { elementData->hwnd = Tk_GetHWND(win); } else { elementData->hwnd = elementData->stubWindow; } elementData->hTheme = OpenThemeData( elementData->hwnd, elementData->info->className); if (!elementData->hTheme) return 0; elementData->drawable = d; if (d != 0) { elementData->hDC = TkWinGetDrawableDC(Tk_Display(tkwin), d, &elementData->dcState); } return 1; } static void FreeElementData(ElementData *elementData) { CloseThemeData(elementData->hTheme); if (elementData->drawable != 0) { TkWinReleaseDrawableDC( elementData->drawable, elementData->hDC, &elementData->dcState); } } /*---------------------------------------------------------------------- |
︙ | ︙ | |||
497 498 499 500 501 502 503 | HRESULT result; SIZE size; if (!InitElementData(elementData, tkwin, 0)) return; if (!(elementData->info->flags & IGNORE_THEMESIZE)) { | | | 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | HRESULT result; SIZE size; if (!InitElementData(elementData, tkwin, 0)) return; if (!(elementData->info->flags & IGNORE_THEMESIZE)) { result = GetThemePartSize( elementData->hTheme, elementData->hDC, elementData->info->partId, Ttk_StateTableLookup(elementData->info->statemap, 0), NULL /*RECT *prc*/, TS_TRUE, &size); |
︙ | ︙ | |||
537 538 539 540 541 542 543 | } if (elementData->info->flags & PAD_MARGINS) { b = Ttk_PadBox(b, elementData->info->padding); } rc = BoxToRect(b); | | | 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | } if (elementData->info->flags & PAD_MARGINS) { b = Ttk_PadBox(b, elementData->info->padding); } rc = BoxToRect(b); DrawThemeBackground( elementData->hTheme, elementData->hDC, elementData->info->partId, Ttk_StateTableLookup(elementData->info->statemap, state), &rc, NULL/*pContentRect*/); |
︙ | ︙ | |||
578 579 580 581 582 583 584 | if (!InitElementData(elementData, tkwin, 0)) return; GenericElementSize(clientData, elementRecord, tkwin, widthPtr, heightPtr, paddingPtr); | | | | 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 | if (!InitElementData(elementData, tkwin, 0)) return; GenericElementSize(clientData, elementRecord, tkwin, widthPtr, heightPtr, paddingPtr); *widthPtr = GetThemeSysSize(NULL, (elementData->info->flags >> 8) & 0xff); *heightPtr = GetThemeSysSize(NULL, elementData->info->flags & 0xff); if (elementData->info->flags & HALF_HEIGHT) *heightPtr /= 2; if (elementData->info->flags & HALF_WIDTH) *widthPtr /= 2; } |
︙ | ︙ | |||
648 649 650 651 652 653 654 | */ if (state & TTK_STATE_DISABLED) return; if (!InitElementData(elementData, tkwin, d)) return; | | | 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 | */ if (state & TTK_STATE_DISABLED) return; if (!InitElementData(elementData, tkwin, d)) return; DrawThemeBackground(elementData->hTheme, elementData->hDC, elementData->info->partId, stateId, &rc, NULL); FreeElementData(elementData); } static Ttk_ElementSpec ThumbElementSpec = |
︙ | ︙ | |||
722 723 724 725 726 727 728 | int partId = elementData->info->partId; RECT rc = BoxToRect(b); if (!InitElementData(elementData, tkwin, d)) return; if (state & TTK_STATE_USER1) partId = TABP_TABITEMLEFTEDGE; | | | 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 | int partId = elementData->info->partId; RECT rc = BoxToRect(b); if (!InitElementData(elementData, tkwin, d)) return; if (state & TTK_STATE_USER1) partId = TABP_TABITEMLEFTEDGE; DrawThemeBackground( elementData->hTheme, elementData->hDC, partId, Ttk_StateTableLookup(elementData->info->statemap, state), &rc, NULL); FreeElementData(elementData); } static Ttk_ElementSpec TabElementSpec = { |
︙ | ︙ | |||
825 826 827 828 829 830 831 | ElementData *elementData = clientData; RECT rc = {0, 0}; HRESULT hr = S_OK; if (!InitElementData(elementData, tkwin, 0)) return; | | | 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 | ElementData *elementData = clientData; RECT rc = {0, 0}; HRESULT hr = S_OK; if (!InitElementData(elementData, tkwin, 0)) return; hr = GetThemeTextExtent( elementData->hTheme, elementData->hDC, elementData->info->partId, Ttk_StateTableLookup(elementData->info->statemap, 0), Tcl_GetUnicode(element->textObj), -1, DT_LEFT,// | DT_BOTTOM | DT_NOPREFIX, |
︙ | ︙ | |||
858 859 860 861 862 863 864 | ElementData *elementData = clientData; RECT rc = BoxToRect(b); HRESULT hr = S_OK; if (!InitElementData(elementData, tkwin, d)) return; | | | 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 | ElementData *elementData = clientData; RECT rc = BoxToRect(b); HRESULT hr = S_OK; if (!InitElementData(elementData, tkwin, d)) return; hr = DrawThemeText( elementData->hTheme, elementData->hDC, elementData->info->partId, Ttk_StateTableLookup(elementData->info->statemap, state), Tcl_GetUnicode(element->textObj), -1, DT_LEFT,// | DT_BOTTOM | DT_NOPREFIX, |
︙ | ︙ | |||
1091 1092 1093 1094 1095 1096 1097 | Tcl_Interp *interp, void *clientData, Ttk_Theme theme, const char *elementName, int objc, Tcl_Obj *const objv[]) { | | | 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 | Tcl_Interp *interp, void *clientData, Ttk_Theme theme, const char *elementName, int objc, Tcl_Obj *const objv[]) { HWND stubWindow = clientData; ElementInfo *elementPtr = NULL; ClientData elementData; Tcl_UniChar *className; int partId = 0; Ttk_StateTable *stateTable; Ttk_Padding pad = {0, 0, 0, 0}; int flags = 0; |
︙ | ︙ | |||
1233 1234 1235 1236 1237 1238 1239 | elementPtr->elementName = name; /* set the class name to an allocated copy */ wname = ckalloc(sizeof(WCHAR) * (length + 1)); wcscpy(wname, className); elementPtr->className = wname; | | | < < < < < | < < < < | < | | | | < < | 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 | elementPtr->elementName = name; /* set the class name to an allocated copy */ wname = ckalloc(sizeof(WCHAR) * (length + 1)); wcscpy(wname, className); elementPtr->className = wname; elementData = NewElementData(stubWindow, elementPtr); Ttk_RegisterElementSpec( theme, elementName, elementPtr->elementSpec, elementData); Ttk_RegisterCleanup(interp, elementData, DestroyElementData); Tcl_SetObjResult(interp, Tcl_NewStringObj(elementName, -1)); return TCL_OK; } /*---------------------------------------------------------------------- * +++ Initialization routine: */ MODULE_SCOPE int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd) { HWND stubWindow; Ttk_Theme themePtr, parentPtr, vistaPtr; ElementInfo *infoPtr; OSVERSIONINFOW os; os.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); GetVersionExW(&os); stubWindow = hwnd; /* * Create the new style engine. */ parentPtr = Ttk_GetTheme(interp, "winnative"); themePtr = Ttk_CreateTheme(interp, "xpnative", parentPtr); if (!themePtr) return TCL_ERROR; /* * Set theme data and cleanup proc */ Ttk_SetThemeEnabledProc(themePtr, XPThemeEnabled, stubWindow); Ttk_RegisterElementFactory(interp, "vsapi", Ttk_CreateVsapiElement, stubWindow); /* * Create the vista theme on suitable platform versions and set the theme * enable function. The theme itself is defined in script. */ if (os.dwMajorVersion > 5) { vistaPtr = Ttk_CreateTheme(interp, "vista", themePtr); if (vistaPtr) { Ttk_SetThemeEnabledProc(vistaPtr, XPThemeEnabled, stubWindow); } } /* * New elements: */ for (infoPtr = ElementInfoTable; infoPtr->elementName != 0; ++infoPtr) { ClientData clientData = NewElementData(stubWindow, infoPtr); Ttk_RegisterElementSpec( themePtr, infoPtr->elementName, infoPtr->elementSpec, clientData); Ttk_RegisterCleanup(interp, clientData, DestroyElementData); } Ttk_RegisterElementSpec(themePtr, "Scale.trough", &ttkNullElementSpec, 0); /* * Layouts: */ Ttk_RegisterLayouts(themePtr, LayoutTable); Tcl_PkgProvide(interp, "ttk::theme::xpnative", TTK_VERSION); return TCL_OK; } |