Index: generic/tk.h ================================================================== --- generic/tk.h +++ generic/tk.h @@ -750,11 +750,11 @@ (((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) -#ifndef TK_NO_DEPRECATED +#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) @@ -1570,11 +1570,11 @@ * * 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) && !defined(BUILD_tk) +#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 Index: generic/tkIntPlatDecls.h ================================================================== --- generic/tkIntPlatDecls.h +++ generic/tkIntPlatDecls.h @@ -664,6 +664,9 @@ /* !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 */ Index: generic/tkStubInit.c ================================================================== --- generic/tkStubInit.c +++ generic/tkStubInit.c @@ -37,14 +37,16 @@ * Remove macro that might interfere with the definition below. */ #undef Tk_MainEx #undef Tk_FreeXId +#undef TkWinGetPlatformId -#ifdef TK_NO_DEPRECATED +#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 @@ -55,14 +57,19 @@ { /* dummy implementation, no need to do anything */ } #define Tk_FreeXId ((void (*)(Display *, XID)) doNothing) -#endif +#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; @@ -223,11 +230,10 @@ # define TkWinXCleanup 0 # define TkWinXInit 0 # define TkWinSetForegroundWindow 0 # define TkWinDialogDebug 0 # define TkWinGetMenuSystemDefault 0 -# define TkWinGetPlatformId 0 # define TkWinSetHINSTANCE 0 # define TkWinGetPlatformTheme 0 # define TkWinChildProc 0 # elif !defined(MAC_OSX_TK) /* UNIX */ Index: win/configure ================================================================== --- win/configure +++ win/configure @@ -691,11 +691,10 @@ MAN2TCLFLAGS CFLAGS_WARNING CFLAGS_OPTIMIZE CFLAGS_DEBUG DL_LIBS -CELIB_DIR CYGPATH TCL_DEFS TCL_STUB_LIB_SPEC TCL_STUB_LIB_FLAG TCL_STUB_LIB_FILE @@ -763,12 +762,10 @@ enable_option_checking enable_threads enable_shared with_tcl enable_64bit -enable_wince -with_celib enable_symbols enable_embedded_manifest ' ac_precious_vars='build_alias host_alias @@ -1387,21 +1384,19 @@ --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-wince enable Win/CE 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) - --with-celib=DIR use Windows/CE support library from DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a @@ -3980,37 +3975,10 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 $as_echo "$do64bit" >&6; } - # Cross-compiling options for Windows/CE builds - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Windows/CE build is requested" >&5 -$as_echo_n "checking if Windows/CE build is requested... " >&6; } - # Check whether --enable-wince was given. -if test "${enable_wince+set}" = set; then : - enableval=$enable_wince; doWince=$enableval -else - doWince=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doWince" >&5 -$as_echo "$doWince" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Windows/CE celib directory" >&5 -$as_echo_n "checking for Windows/CE celib directory... " >&6; } - -# Check whether --with-celib was given. -if test "${with_celib+set}" = set; then : - withval=$with_celib; CELIB_DIR=$withval -else - CELIB_DIR=NO_CELIB -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CELIB_DIR" >&5 -$as_echo "$CELIB_DIR" >&6; } - # Set some defaults (may get changed below) EXTRA_CFLAGS="" $as_echo "#define MODULE_SCOPE extern" >>confdefs.h @@ -4281,11 +4249,11 @@ 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="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32" + 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 @@ -4505,111 +4473,11 @@ CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" lflags="${lflags} -nologo" LINKBIN="link" fi - if test "$doWince" != "no" ; then - # Set defaults for common evc4/PPC2003 setup - # Currently Tcl requires 300+, possibly 420+ for sockets - CEVERSION=420; # could be 211 300 301 400 420 ... - TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... - ARCH=ARM; # could be ARM MIPS X86EM ... - PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" - if test "$doWince" != "yes"; then - # If !yes then the user specified something - # Reset ARCH to allow user to skip specifying it - ARCH= - eval `echo $doWince | awk -F "," '{ \ - if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ - if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ - if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ - if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ - if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ - }'` - if test "x${ARCH}" = "x" ; then - ARCH=$TARGETCPU; - fi - fi - OSVERSION=WCE$CEVERSION; - if test "x${WCEROOT}" = "x" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" - if test ! -d "${WCEROOT}" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded Tools" - fi - fi - if test "x${SDKROOT}" = "x" ; then - SDKROOT="C:/Program Files/Windows CE Tools" - if test ! -d "${SDKROOT}" ; then - SDKROOT="C:/Windows CE Tools" - fi - fi - # The space-based-path will work for the Makefile, but will - # not work if AC_TRY_COMPILE is called. - WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` - SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` - CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` - if test ! -d "${CELIB_DIR}/inc"; then - as_fn_error $? "Invalid celib directory \"${CELIB_DIR}\"" "$LINENO" 5 - fi - if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"\ - -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then - as_fn_error $? "could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" "$LINENO" 5 - else - CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" - if test -d "${CEINCLUDE}/${TARGETCPU}" ; then - CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" - fi - CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" - fi - fi - - if test "$doWince" != "no" ; then - CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" - if test "${TARGETCPU}" = "X86"; then - CC="${CEBINROOT}/cl.exe" - else - CC="${CEBINROOT}/cl${ARCH}.exe" - fi - CC="\"${CC}\" -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" - RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" - arch=`echo ${ARCH} | awk '{print tolower($0)}'` - defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _DLL _WINDOWS" - for i in $defs ; do - cat >>confdefs.h <<_ACEOF -#define $i 1 -_ACEOF - - done -# if test "${ARCH}" = "X86EM"; then -# AC_DEFINE_UNQUOTED(_WIN32_WCE_EMULATION) -# fi - cat >>confdefs.h <<_ACEOF -#define _WIN32_WCE $CEVERSION -_ACEOF - - cat >>confdefs.h <<_ACEOF -#define UNDER_CE $CEVERSION -_ACEOF - - CFLAGS_DEBUG="-nologo -Zi -Od" - CFLAGS_OPTIMIZE="-nologo -O2" - lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` - lflags="-nodefaultlib -MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" - LINKBIN="\"${CEBINROOT}/link.exe\"" - - if test "${CEVERSION}" -lt 400 ; then - LIBS="coredll.lib corelibc.lib winsock.lib" - else - LIBS="coredll.lib corelibc.lib ws2.lib" - fi - # celib currently stuck at wce300 status - #LIBS="$LIBS \${CELIB_DIR}/wince-${ARCH}-pocket-${OSVERSION}-release/celib.lib" - LIBS="$LIBS \"\${CELIB_DIR}/wince-${ARCH}-pocket-wce300-release/celib.lib\"" - LIBS_GUI="commctrl.lib commdlg.lib" - else - LIBS_GUI="gdi32.lib comdlg32.lib imm32.lib comctl32.lib shell32.lib uuid.lib" - 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}" @@ -4636,11 +4504,11 @@ CC_OBJNAME="-Fo\$@" CC_EXENAME="-Fe\"\$(shell \$(CYGPATH) '\$@')\"" # Specify linker flags depending on the type of app being # built -- Console vs. Window. - if test "$doWince" != "no" -a "${TARGETCPU}" != "X86"; then + 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}" @@ -4883,35 +4751,10 @@ if test $tcl_cv_strtoi64 = no; then $as_echo "#define NO_STRTOI64 1" >>confdefs.h fi - -#-------------------------------------------------------------------- -# Windows XP theme engine header for Ttk -#-------------------------------------------------------------------- - -ac_fn_c_check_header_compile "$LINENO" "uxtheme.h" "ac_cv_header_uxtheme_h" "#include -" -if test "x$ac_cv_header_uxtheme_h" = xyes; then : - $as_echo "#define HAVE_UXTHEME_H 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: xpnative theme will be unavailable" >&5 -$as_echo "$as_me: xpnative theme will be unavailable" >&6;} -fi - - -ac_fn_c_check_header_compile "$LINENO" "vssym32.h" "ac_cv_header_vssym32_h" "#include -#include -" -if test "x$ac_cv_header_vssym32_h" = xyes; then : - $as_echo "#define HAVE_VSSYM32_H 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. Index: win/configure.ac ================================================================== --- win/configure.ac +++ win/configure.ac @@ -119,21 +119,10 @@ 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 -#-------------------------------------------------------------------- -# Windows XP theme engine header for Ttk -#-------------------------------------------------------------------- - -AC_CHECK_HEADER([uxtheme.h], [AC_DEFINE(HAVE_UXTHEME_H)], - [AC_MSG_NOTICE([xpnative theme will be unavailable])], - [#include ]) -AC_CHECK_HEADER([vssym32.h], [AC_DEFINE(HAVE_VSSYM32_H)], [], - [#include -#include ]) - #-------------------------------------------------------------------- # 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. #-------------------------------------------------------------------- Index: win/makefile.vc ================================================================== --- win/makefile.vc +++ win/makefile.vc @@ -74,11 +74,11 @@ # # INSTALLDIR= # Sets where to install Tcl from the built binaries. # C:\Progra~1\Tcl is assumed when not specified. # -# OPTS=loimpact,msvcrt,nothreads,noxp,pdbs,profile,square,static,staticpkg,symbols,unchecked,none +# 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 @@ -86,12 +86,10 @@ # 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. -# noxp = If you do not have the uxtheme.h header then you -# cannot include support for XP themeing. # 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. @@ -190,26 +188,15 @@ !message *** at this time, sorry. Please set the TCLDIR macro to point to the !message *** Tcl sources. !endif # Extra makefile options processing... -!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"] -HAVE_UXTHEME_H = 1 -TTK_SQUARE_WIDGET = 0 -!else -!if [nmakehlp -f $(OPTS) "noxp"] -!message *** Exclude support for XP theme -HAVE_UXTHEME_H = 0 -!else -HAVE_UXTHEME_H = 1 -!endif !if [nmakehlp -f "$(OPTS)" "square"] !message *** Include ttk square demo widget TTK_SQUARE_WIDGET = 1 !else TTK_SQUARE_WIDGET = 0 -!endif !endif STUBPREFIX = $(PROJECT)stub WISHNAMEPREFIX = wish Index: win/tcl.m4 ================================================================== --- win/tcl.m4 +++ win/tcl.m4 @@ -542,21 +542,10 @@ 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) - # Cross-compiling options for Windows/CE builds - - AC_MSG_CHECKING([if Windows/CE build is requested]) - AC_ARG_ENABLE(wince,[ --enable-wince enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no]) - AC_MSG_RESULT($doWince) - - AC_MSG_CHECKING([for Windows/CE celib directory]) - AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], - CELIB_DIR=$withval, CELIB_DIR=NO_CELIB) - AC_MSG_RESULT([$CELIB_DIR]) - # 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) @@ -673,11 +662,11 @@ 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="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32" + 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 @@ -869,102 +858,11 @@ CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" lflags="${lflags} -nologo" LINKBIN="link" fi - if test "$doWince" != "no" ; then - # Set defaults for common evc4/PPC2003 setup - # Currently Tcl requires 300+, possibly 420+ for sockets - CEVERSION=420; # could be 211 300 301 400 420 ... - TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... - ARCH=ARM; # could be ARM MIPS X86EM ... - PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" - if test "$doWince" != "yes"; then - # If !yes then the user specified something - # Reset ARCH to allow user to skip specifying it - ARCH= - eval `echo $doWince | awk -F "," '{ \ - if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \ - if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ - if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \ - if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \ - if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \ - }'` - if test "x${ARCH}" = "x" ; then - ARCH=$TARGETCPU; - fi - fi - OSVERSION=WCE$CEVERSION; - if test "x${WCEROOT}" = "x" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" - if test ! -d "${WCEROOT}" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded Tools" - fi - fi - if test "x${SDKROOT}" = "x" ; then - SDKROOT="C:/Program Files/Windows CE Tools" - if test ! -d "${SDKROOT}" ; then - SDKROOT="C:/Windows CE Tools" - fi - fi - # The space-based-path will work for the Makefile, but will - # not work if AC_TRY_COMPILE is called. - WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` - SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` - CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` - if test ! -d "${CELIB_DIR}/inc"; then - AC_MSG_ERROR([Invalid celib directory "${CELIB_DIR}"]) - fi - if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"\ - -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then - AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]]) - else - CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" - if test -d "${CEINCLUDE}/${TARGETCPU}" ; then - CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" - fi - CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" - fi - fi - - if test "$doWince" != "no" ; then - CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" - if test "${TARGETCPU}" = "X86"; then - CC="${CEBINROOT}/cl.exe" - else - CC="${CEBINROOT}/cl${ARCH}.exe" - fi - CC="\"${CC}\" -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" - RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" - arch=`echo ${ARCH} | awk '{print tolower([$]0)}'` - defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _DLL _WINDOWS" - for i in $defs ; do - AC_DEFINE_UNQUOTED($i) - done -# if test "${ARCH}" = "X86EM"; then -# AC_DEFINE_UNQUOTED(_WIN32_WCE_EMULATION) -# fi - AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION) - AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION) - CFLAGS_DEBUG="-nologo -Zi -Od" - CFLAGS_OPTIMIZE="-nologo -O2" - lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` - lflags="-nodefaultlib -MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" - LINKBIN="\"${CEBINROOT}/link.exe\"" - AC_SUBST(CELIB_DIR) - if test "${CEVERSION}" -lt 400 ; then - LIBS="coredll.lib corelibc.lib winsock.lib" - else - LIBS="coredll.lib corelibc.lib ws2.lib" - fi - # celib currently stuck at wce300 status - #LIBS="$LIBS \${CELIB_DIR}/wince-${ARCH}-pocket-${OSVERSION}-release/celib.lib" - LIBS="$LIBS \"\${CELIB_DIR}/wince-${ARCH}-pocket-wce300-release/celib.lib\"" - LIBS_GUI="commctrl.lib commdlg.lib" - else - LIBS_GUI="gdi32.lib comdlg32.lib imm32.lib comctl32.lib shell32.lib uuid.lib" - 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}" @@ -991,11 +889,11 @@ CC_OBJNAME="-Fo\[$]@" CC_EXENAME="-Fe\"\$(shell \$(CYGPATH) '\[$]@')\"" # Specify linker flags depending on the type of app being # built -- Console vs. Window. - if test "$doWince" != "no" -a "${TARGETCPU}" != "X86"; then + 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}" Index: win/tkWin.h ================================================================== --- win/tkWin.h +++ win/tkWin.h @@ -16,24 +16,22 @@ /* * 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. * - * NTDDI_VERSION = 0x0600 means Windows Vista and above + * WINVER = 0x0600 means Windows Vista and above. Even though we still + * support Windows XP, but the Vista-specifics are tested at runtime. */ -#ifndef NTDDI_VERSION -#define NTDDI_VERSION 0x06000000 -#endif #ifndef WINVER -#define WINVER 0x0600 +# define WINVER 0x0600 #endif #ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x0600 +# define _WIN32_WINNT 0x0600 #endif #ifndef _WIN32_IE -#define _WIN32_IE 0x0600 +# define _WIN32_IE 0x0700 #endif #ifndef _TK #include #endif Index: win/tkWinX.c ================================================================== --- win/tkWinX.c +++ win/tkWinX.c @@ -49,11 +49,10 @@ 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 tkPlatformId = 0; /* version of Windows platform */ 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 @@ -303,46 +302,38 @@ } /* *---------------------------------------------------------------------- * - * TkWinGetPlatformId -- + * TkWinGetPlatformTheme -- * - * Determines whether running under NT, 95, or Win32s, to allow runtime - * conditional code. Win32s is no longer supported. + * Return the Windows drawing style we should be using. * * Results: * The return value is one of: - * VER_PLATFORM_WIN32s Win32s on Windows 3.1 (not supported) - * VER_PLATFORM_WIN32_WINDOWS Win32 on Windows 95, 98, ME (not supported) - * VER_PLATFORM_WIN32_NT Win32 on Windows XP, Vista, Windows 7, Windows 8 - * VER_PLATFORM_WIN32_CE Win32 on Windows CE - * - * Side effects: - * None. + * TK_THEME_WIN_CLASSIC 95/98/NT or XP in classic mode + * TK_THEME_WIN_XP XP not in classic mode * *---------------------------------------------------------------------- */ int -TkWinGetPlatformId(void) +TkWinGetPlatformTheme(void) { - if (tkPlatformId == 0) { + if (tkWinTheme == 0) { OSVERSIONINFOW os; os.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); GetVersionExW(&os); - tkPlatformId = os.dwPlatformId; /* * 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.dwPlatformId == VER_PLATFORM_WIN32_NT) && - (os.dwMajorVersion == 5 && os.dwMinorVersion == 1)) { + 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]; @@ -362,37 +353,10 @@ } } else { tkWinTheme = TK_THEME_WIN_CLASSIC; } } - return tkPlatformId; -} - -/* - *---------------------------------------------------------------------- - * - * 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 - * - * Side effects: - * Could invoke TkWinGetPlatformId. - * - *---------------------------------------------------------------------- - */ - -int -TkWinGetPlatformTheme(void) -{ - if (tkPlatformId == 0) { - TkWinGetPlatformId(); - } return tkWinTheme; } /* *---------------------------------------------------------------------- Index: win/ttkWinXPTheme.c ================================================================== --- win/ttkWinXPTheme.c +++ win/ttkWinXPTheme.c @@ -14,139 +14,28 @@ * */ #include -#ifndef HAVE_UXTHEME_H -/* Stub for platforms that lack the XP theme API headers: */ -int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd) { return TCL_OK; } -#else - #include #include -#if defined(HAVE_VSSYM32_H) || _MSC_VER > 1500 +#if defined(_MSC_VER) && _MSC_VER > 1500 # include #else # include #endif +#ifdef _MSC_VER +# pragma comment (lib, "uxtheme.lib") +#endif #include "ttk/ttkTheme.h" -typedef HTHEME (STDAPICALLTYPE OpenThemeDataProc)(HWND hwnd, - LPCWSTR pszClassList); -typedef HRESULT (STDAPICALLTYPE CloseThemeDataProc)(HTHEME hTheme); -typedef HRESULT (STDAPICALLTYPE DrawThemeBackgroundProc)(HTHEME hTheme, - HDC hdc, int iPartId, int iStateId, const RECT *pRect, - OPTIONAL const RECT *pClipRect); -typedef HRESULT (STDAPICALLTYPE GetThemePartSizeProc)(HTHEME,HDC, - int iPartId, int iStateId, - RECT *prc, enum THEMESIZE eSize, SIZE *psz); -typedef int (STDAPICALLTYPE GetThemeSysSizeProc)(HTHEME,int); -/* GetThemeTextExtent and DrawThemeText only used with BROKEN_TEXT_ELEMENT */ -typedef HRESULT (STDAPICALLTYPE GetThemeTextExtentProc)(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, - DWORD dwTextFlags, const RECT *pBoundingRect, RECT *pExtent); -typedef HRESULT (STDAPICALLTYPE DrawThemeTextProc)(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, - DWORD dwTextFlags, DWORD dwTextFlags2, const RECT *pRect); -typedef BOOL (STDAPICALLTYPE IsThemeActiveProc)(void); -typedef BOOL (STDAPICALLTYPE IsAppThemedProc)(void); - -typedef struct -{ - OpenThemeDataProc *OpenThemeData; - CloseThemeDataProc *CloseThemeData; - GetThemePartSizeProc *GetThemePartSize; - GetThemeSysSizeProc *GetThemeSysSize; - DrawThemeBackgroundProc *DrawThemeBackground; - DrawThemeTextProc *DrawThemeText; - GetThemeTextExtentProc *GetThemeTextExtent; - IsThemeActiveProc *IsThemeActive; - IsAppThemedProc *IsAppThemed; - - HWND stubWindow; -} XPThemeProcs; - -typedef struct -{ - HINSTANCE hlibrary; - XPThemeProcs *procs; -} XPThemeData; - -/* - *---------------------------------------------------------------------- - * - * LoadXPThemeProcs -- - * Initialize XP theming support. - * - * XP theme support is included in UXTHEME.DLL - * We dynamically load this DLL at runtime instead of linking - * to it at build-time. - * - * Returns: - * A pointer to an XPThemeProcs table if successful, NULL otherwise. - */ - -static XPThemeProcs * -LoadXPThemeProcs(HINSTANCE *phlib) -{ - /* - * Load the library "uxtheme.dll", where the native widget - * drawing routines are implemented. This will only succeed - * if we are running at least on Windows XP. - */ - HINSTANCE handle; - *phlib = handle = LoadLibrary(TEXT("uxtheme.dll")); - if (handle != 0) - { - /* - * We have successfully loaded the library. Proceed in storing the - * addresses of the functions we want to use. - */ - XPThemeProcs *procs = ckalloc(sizeof(XPThemeProcs)); -#define LOADPROC(name) \ - (0 != (procs->name = (name ## Proc *)GetProcAddress(handle, #name) )) - - if ( LOADPROC(OpenThemeData) - && LOADPROC(CloseThemeData) - && LOADPROC(GetThemePartSize) - && LOADPROC(GetThemeSysSize) - && LOADPROC(DrawThemeBackground) - && LOADPROC(GetThemeTextExtent) - && LOADPROC(DrawThemeText) - && LOADPROC(IsThemeActive) - && LOADPROC(IsAppThemed) - ) - { - return procs; - } -#undef LOADPROC - ckfree(procs); - } - return 0; -} - -/* - * XPThemeDeleteProc -- - * - * Release any theme allocated resources. - */ - -static void -XPThemeDeleteProc(void *clientData) -{ - XPThemeData *themeData = clientData; - FreeLibrary(themeData->hlibrary); - ckfree(clientData); -} - static int XPThemeEnabled(Ttk_Theme theme, void *clientData) { - XPThemeData *themeData = clientData; - int active = themeData->procs->IsThemeActive(); - int themed = themeData->procs->IsAppThemed(); + int active = IsThemeActive(); + int themed = IsAppThemed(); return (active && themed); } /* * BoxToRect -- @@ -390,11 +279,11 @@ { /* * Static data, initialized when element is registered: */ ElementInfo *info; - XPThemeProcs *procs; /* Pointer to theme procedure table */ + HWND stubWindow; /* * Dynamic data, allocated by InitElementData: */ HTHEME hTheme; @@ -405,15 +294,15 @@ Drawable drawable; TkWinDCState dcState; } ElementData; static ElementData * -NewElementData(XPThemeProcs *procs, ElementInfo *info) +NewElementData(HWND stubWindow, ElementInfo *info) { ElementData *elementData = ckalloc(sizeof(ElementData)); - elementData->procs = procs; + elementData->stubWindow = stubWindow; elementData->info = info; elementData->hTheme = elementData->hDC = 0; return elementData; } @@ -452,14 +341,14 @@ Window win = Tk_WindowId(tkwin); if (win != None) { elementData->hwnd = Tk_GetHWND(win); } else { - elementData->hwnd = elementData->procs->stubWindow; + elementData->hwnd = elementData->stubWindow; } - elementData->hTheme = elementData->procs->OpenThemeData( + elementData->hTheme = OpenThemeData( elementData->hwnd, elementData->info->className); if (!elementData->hTheme) return 0; @@ -473,11 +362,11 @@ } static void FreeElementData(ElementData *elementData) { - elementData->procs->CloseThemeData(elementData->hTheme); + CloseThemeData(elementData->hTheme); if (elementData->drawable != 0) { TkWinReleaseDrawableDC( elementData->drawable, elementData->hDC, &elementData->dcState); } } @@ -499,11 +388,11 @@ if (!InitElementData(elementData, tkwin, 0)) return; if (!(elementData->info->flags & IGNORE_THEMESIZE)) { - result = elementData->procs->GetThemePartSize( + result = GetThemePartSize( elementData->hTheme, elementData->hDC, elementData->info->partId, Ttk_StateTableLookup(elementData->info->statemap, 0), NULL /*RECT *prc*/, @@ -539,11 +428,11 @@ if (elementData->info->flags & PAD_MARGINS) { b = Ttk_PadBox(b, elementData->info->padding); } rc = BoxToRect(b); - elementData->procs->DrawThemeBackground( + DrawThemeBackground( elementData->hTheme, elementData->hDC, elementData->info->partId, Ttk_StateTableLookup(elementData->info->statemap, state), &rc, @@ -580,13 +469,13 @@ return; GenericElementSize(clientData, elementRecord, tkwin, widthPtr, heightPtr, paddingPtr); - *widthPtr = elementData->procs->GetThemeSysSize(NULL, + *widthPtr = GetThemeSysSize(NULL, (elementData->info->flags >> 8) & 0xff); - *heightPtr = elementData->procs->GetThemeSysSize(NULL, + *heightPtr = GetThemeSysSize(NULL, elementData->info->flags & 0xff); if (elementData->info->flags & HALF_HEIGHT) *heightPtr /= 2; if (elementData->info->flags & HALF_WIDTH) *widthPtr /= 2; @@ -650,11 +539,11 @@ return; if (!InitElementData(elementData, tkwin, d)) return; - elementData->procs->DrawThemeBackground(elementData->hTheme, + DrawThemeBackground(elementData->hTheme, elementData->hDC, elementData->info->partId, stateId, &rc, NULL); FreeElementData(elementData); } @@ -724,11 +613,11 @@ if (!InitElementData(elementData, tkwin, d)) return; if (state & TTK_STATE_USER1) partId = TABP_TABITEMLEFTEDGE; - elementData->procs->DrawThemeBackground( + DrawThemeBackground( elementData->hTheme, elementData->hDC, partId, Ttk_StateTableLookup(elementData->info->statemap, state), &rc, NULL); FreeElementData(elementData); } @@ -827,11 +716,11 @@ HRESULT hr = S_OK; if (!InitElementData(elementData, tkwin, 0)) return; - hr = elementData->procs->GetThemeTextExtent( + hr = GetThemeTextExtent( elementData->hTheme, elementData->hDC, elementData->info->partId, Ttk_StateTableLookup(elementData->info->statemap, 0), Tcl_GetUnicode(element->textObj), @@ -860,11 +749,11 @@ HRESULT hr = S_OK; if (!InitElementData(elementData, tkwin, d)) return; - hr = elementData->procs->DrawThemeText( + hr = DrawThemeText( elementData->hTheme, elementData->hDC, elementData->info->partId, Ttk_StateTableLookup(elementData->info->statemap, state), Tcl_GetUnicode(element->textObj), @@ -1093,11 +982,11 @@ Ttk_Theme theme, const char *elementName, int objc, Tcl_Obj *const objv[]) { - XPThemeData *themeData = clientData; + HWND stubWindow = clientData; ElementInfo *elementPtr = NULL; ClientData elementData; Tcl_UniChar *className; int partId = 0; Ttk_StateTable *stateTable; @@ -1235,11 +1124,11 @@ /* set the class name to an allocated copy */ wname = ckalloc(sizeof(WCHAR) * (length + 1)); wcscpy(wname, className); elementPtr->className = wname; - elementData = NewElementData(themeData->procs, elementPtr); + elementData = NewElementData(stubWindow, elementPtr); Ttk_RegisterElementSpec( theme, elementName, elementPtr->elementSpec, elementData); Ttk_RegisterCleanup(interp, elementData, DestroyElementData); Tcl_SetObjResult(interp, Tcl_NewStringObj(elementName, -1)); @@ -1250,24 +1139,19 @@ * +++ Initialization routine: */ MODULE_SCOPE int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd) { - XPThemeData *themeData; - XPThemeProcs *procs; - HINSTANCE hlibrary; + HWND stubWindow; Ttk_Theme themePtr, parentPtr, vistaPtr; ElementInfo *infoPtr; OSVERSIONINFOW os; os.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); GetVersionExW(&os); - procs = LoadXPThemeProcs(&hlibrary); - if (!procs) - return TCL_ERROR; - procs->stubWindow = hwnd; + stubWindow = hwnd; /* * Create the new style engine. */ parentPtr = Ttk_GetTheme(interp, "winnative"); @@ -1278,35 +1162,30 @@ /* * Set theme data and cleanup proc */ - themeData = ckalloc(sizeof(XPThemeData)); - themeData->procs = procs; - themeData->hlibrary = hlibrary; - - Ttk_SetThemeEnabledProc(themePtr, XPThemeEnabled, themeData); - Ttk_RegisterCleanup(interp, themeData, XPThemeDeleteProc); - Ttk_RegisterElementFactory(interp, "vsapi", Ttk_CreateVsapiElement, themeData); + 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.dwPlatformId == VER_PLATFORM_WIN32_NT && os.dwMajorVersion > 5) { + if (os.dwMajorVersion > 5) { vistaPtr = Ttk_CreateTheme(interp, "vista", themePtr); if (vistaPtr) { - Ttk_SetThemeEnabledProc(vistaPtr, XPThemeEnabled, themeData); + Ttk_SetThemeEnabledProc(vistaPtr, XPThemeEnabled, stubWindow); } } /* * New elements: */ for (infoPtr = ElementInfoTable; infoPtr->elementName != 0; ++infoPtr) { - ClientData clientData = NewElementData(procs, infoPtr); + ClientData clientData = NewElementData(stubWindow, infoPtr); Ttk_RegisterElementSpec( themePtr, infoPtr->elementName, infoPtr->elementSpec, clientData); Ttk_RegisterCleanup(interp, clientData, DestroyElementData); } @@ -1319,7 +1198,5 @@ Tcl_PkgProvide(interp, "ttk::theme::xpnative", TTK_VERSION); return TCL_OK; } - -#endif /* HAVE_UXTHEME_H */