summaryrefslogtreecommitdiffstats
path: root/generic/tkTest.c
diff options
context:
space:
mode:
authordas <das>2005-11-27 02:36:46 (GMT)
committerdas <das>2005-11-27 02:36:46 (GMT)
commit1b9cdb47165d048a72acb062ead0a15fa722c256 (patch)
tree7ab2d749c35dad34d628970ddcc55bf506c6aace /generic/tkTest.c
parent10e80a6dc5f569368be5a75752fa8e6071a2777b (diff)
downloadtk-1b9cdb47165d048a72acb062ead0a15fa722c256.zip
tk-1b9cdb47165d048a72acb062ead0a15fa722c256.tar.gz
tk-1b9cdb47165d048a72acb062ead0a15fa722c256.tar.bz2
* unix/tcl.m4 (Darwin): add 64bit support, check for Tiger copyfile(),
add CFLAGS to SHLIB_LD to support passing -isysroot in env(CFLAGS) to configure (flag can't be present twice, so can't be in both CFLAGS and LDFLAGS during configure), don't use -prebind when deploying on 10.4, define TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING (rdar://3171542). (SC_ENABLE_LANGINFO, SC_TIME_HANDLER): add/fix caching, fix obsolete autoconf macros. Sync with tk/unix/tcl.m4, sync whitespace with HEAD. * unix/configure.in: fix obsolete autoconf macros, sync gratuitous formatting/ordering differences with tcl/unix/configure.in. * unix/Makefile.in: add CFLAGS to wish/tktest link to make executable linking the same as during configure (needed to avoid loosing any linker relevant flags in CFLAGS, in particular flags that can't be in LDFLAGS). Avoid concurrent linking of wish and compiling of tkTestInit.o during parallel make, fix dependencies and flags for building tkMacOSXInit.o (checkstubs, checkexports): dependency and Darwin fixes * macosx/tkMacOSXEvent.c (TkMacOSXProcessEvent): * macosx/tkMacOSXEvent.h: * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): * macosx/tkMacOSXCarbonEvents.c: install standard application event handler, add & call functions to start and stop carbon even timer that runs the tcl event loop periodically during a nested carbon event loop in the toolbox (e.g. during menutracking) to ensure tcl timers etc continue to fire, register app event handler for menu tracking and HI command carbon events, move menu event handling to new handlers for those carbon events, no longer register for/handle appleevent carbon event (now dealt with by standard application event handler), event debugging code dynamically acquires carbon event debugging functions to allow use on Tiger where they are no longer exported from HIToolbox. * macosx/tkMacOSXFont.c (TkMacOSXUseAntialiasedText): * macosx/tkMacOSXKeyEvent.c (GetKeyboardLayout): * macosx/tkMacOSXCarbonEvents.c (TkMacOSXInitCarbonEvents): * macosx/tkMacOSXInit.c: * macosx/tkMacOSXInt.h: abstract common code to dynamically acquire address of a named symbol (from a loaded dynamic library) into new function TkMacOSXGetNamedSymbol() and macro TkMacOSXInitNamedSymbol. * macosx/tkMacOSXMenu.c (TkpNewMenu): * macosx/tkMacOSXMenubutton.c (MenuButtonInitControl): * macosx/tkMacOSXMenus.c (TkMacOSXHandleMenuSelect): switch to modern utf8 aware menu manager API, remove obsolete code, add error handling. * macosx/tkMacOSXMouseEvent.c: define OSX 10.3 or later only constants if necessary to allow compilation on OSX 10.2 * macosx/tkMacOSXWm.c (UpdateSizeHints): remove code that is never executed. * generic/tk.h: add/correct location of version numbers in macosx files. * generic/tkInt.h: clarify fat compile comment. * macosx/Wish.pbproj/default.pbxuser (new file): * macosx/Wish.pbproj/jingham.pbxuser: * macosx/Wish.pbproj/project.pbxproj: sync with HEAD. * macosx/buildTkConfig.tcl (removed): remove obsolete build files. * macosx/README: clarification/cleanup, sync with HEAD, document universal (fat) builds via CFLAGS (i.e. ppc and i386 at the same time). * macosx/Makefile: add support for reusing configure cache, build target fixes. * generic/tkMenu.c: * macosx/tkMacOSXButton.c: * macosx/tkMacOSXDebug.c: * macosx/tkMacOSXDebug.h: * macosx/tkMacOSXDialog.c: * macosx/tkMacOSXDraw.c: * macosx/tkMacOSXEntry.c: * macosx/tkMacOSXMenu.c: * macosx/tkMacOSXMouseEvent.c: * macosx/tkMacOSXXStubs.c: * macosx/tkMacOSXSubwindows.c: * xlib/xgc.c: declare functions and globals used only in own file as static, #ifdef out a few Xlib and aqua functions that are never called (sync with HEAD). * macosx/tkMacOSXPort.h: * generic/tkInt.decls: correct signature of TkMacOSXHandleMenuSelect, add XSync to aqua Xlib stubs. * generic/tkTest.c: #ifdef unix only declarations. (TestmetricsCmd): unify win and mac implementation. * generic/tkTextDisp.c: * generic/tkTextBTree.c: * macosx/tkMacOSXInit.c: * macosx/tkMacOSXKeyEvent.c: * macosx/tkMacOSXWindowEvent.c: * macosx/tkMacOSXXStubs.c: fix gcc 4 warnings. * macosx/tkMacOSXNotify.c: * macosx/tkMacOSXTest.c: sync with HEAD. * generic/tkIntPlatDecls.h: * generic/tkIntXlibDecls.h: * generic/tkStubInit.c: * unix/configure: regen.
Diffstat (limited to 'generic/tkTest.c')
-rw-r--r--generic/tkTest.c56
1 files changed, 25 insertions, 31 deletions
diff --git a/generic/tkTest.c b/generic/tkTest.c
index 320d5a3..fc91e6c 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkTest.c,v 1.21.2.1 2005/05/24 04:21:01 das Exp $
+ * RCS: @(#) $Id: tkTest.c,v 1.21.2.2 2005/11/27 02:44:25 das Exp $
*/
#include "tkInt.h"
@@ -179,8 +179,10 @@ static int TestfontObjCmd _ANSI_ARGS_((ClientData dummy,
Tcl_Obj *CONST objv[]));
static int TestmakeexistCmd _ANSI_ARGS_((ClientData dummy,
Tcl_Interp *interp, int argc, CONST char **argv));
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK))
static int TestmenubarCmd _ANSI_ARGS_((ClientData dummy,
Tcl_Interp *interp, int argc, CONST char **argv));
+#endif
#if defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)
static int TestmetricsCmd _ANSI_ARGS_((ClientData dummy,
Tcl_Interp *interp, int argc, CONST char **argv));
@@ -201,8 +203,10 @@ static void CustomOptionFree _ANSI_ARGS_((ClientData clientData,
Tk_Window tkwin, char *internalPtr));
static int TestpropCmd _ANSI_ARGS_((ClientData dummy,
Tcl_Interp *interp, int argc, CONST char **argv));
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK))
static int TestsendCmd _ANSI_ARGS_((ClientData dummy,
Tcl_Interp *interp, int argc, CONST char **argv));
+#endif
static int TesttextCmd _ANSI_ARGS_((ClientData dummy,
Tcl_Interp *interp, int argc, CONST char **argv));
#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK))
@@ -1959,6 +1963,7 @@ TestmakeexistCmd(clientData, interp, argc, argv)
*/
/* ARGSUSED */
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK))
static int
TestmenubarCmd(clientData, interp, argc, argv)
ClientData clientData; /* Main window for application. */
@@ -2008,6 +2013,7 @@ TestmenubarCmd(clientData, interp, argc, argv)
return TCL_ERROR;
#endif
}
+#endif
/*
*----------------------------------------------------------------------
@@ -2026,7 +2032,7 @@ TestmenubarCmd(clientData, interp, argc, argv)
*----------------------------------------------------------------------
*/
-#ifdef __WIN32__
+#if defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)
static int
TestmetricsCmd(clientData, interp, argc, argv)
ClientData clientData; /* Main window for application. */
@@ -2035,38 +2041,17 @@ TestmetricsCmd(clientData, interp, argc, argv)
CONST char **argv; /* Argument strings. */
{
char buf[TCL_INTEGER_SPACE];
+ int val;
+#ifdef __WIN32__
if (argc < 2) {
Tcl_AppendResult(interp, "wrong # args; must be \"", argv[0],
" option ?arg ...?\"", (char *) NULL);
return TCL_ERROR;
}
-
- if (strcmp(argv[1], "cyvscroll") == 0) {
- sprintf(buf, "%d", GetSystemMetrics(SM_CYVSCROLL));
- Tcl_AppendResult(interp, buf, (char *) NULL);
- } else if (strcmp(argv[1], "cxhscroll") == 0) {
- sprintf(buf, "%d", GetSystemMetrics(SM_CXHSCROLL));
- Tcl_AppendResult(interp, buf, (char *) NULL);
- } else {
- Tcl_AppendResult(interp, "bad option \"", argv[1],
- "\": must be cxhscroll or cyvscroll", (char *) NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-#endif
-#if defined(MAC_TCL) || defined(MAC_OSX_TK)
-static int
-TestmetricsCmd(clientData, interp, argc, argv)
- ClientData clientData; /* Main window for application. */
- Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- CONST char **argv; /* Argument strings. */
-{
+#else
Tk_Window tkwin = (Tk_Window) clientData;
TkWindow *winPtr;
- char buf[TCL_INTEGER_SPACE];
if (argc != 3) {
Tcl_AppendResult(interp, "wrong # args; must be \"", argv[0],
@@ -2078,18 +2063,27 @@ TestmetricsCmd(clientData, interp, argc, argv)
if (winPtr == NULL) {
return TCL_ERROR;
}
-
+#endif
+
if (strcmp(argv[1], "cyvscroll") == 0) {
- sprintf(buf, "%d", ((TkScrollbar *) winPtr->instanceData)->width);
- Tcl_AppendResult(interp, buf, (char *) NULL);
+#ifdef __WIN32__
+ val = GetSystemMetrics(SM_CYVSCROLL);
+#else
+ val = ((TkScrollbar *) winPtr->instanceData)->width;
+#endif
} else if (strcmp(argv[1], "cxhscroll") == 0) {
- sprintf(buf, "%d", ((TkScrollbar *) winPtr->instanceData)->width);
- Tcl_AppendResult(interp, buf, (char *) NULL);
+#ifdef __WIN32__
+ val = GetSystemMetrics(SM_CXHSCROLL);
+#else
+ val = ((TkScrollbar *) winPtr->instanceData)->width;
+#endif
} else {
Tcl_AppendResult(interp, "bad option \"", argv[1],
"\": must be cxhscroll or cyvscroll", (char *) NULL);
return TCL_ERROR;
}
+ sprintf(buf, "%d", val);
+ Tcl_AppendResult(interp, buf, (char *) NULL);
return TCL_OK;
}
#endif