diff options
author | redman <redman> | 1999-02-26 02:24:45 (GMT) |
---|---|---|
committer | redman <redman> | 1999-02-26 02:24:45 (GMT) |
commit | d4afe29e7819e8628a15b96a3372d1f797348714 (patch) | |
tree | e4e370046021372bc094f1540d7f4b4a94403677 | |
parent | cc18dffb9e2573bb0efc08f6f71244d46c746bd1 (diff) | |
download | tk-d4afe29e7819e8628a15b96a3372d1f797348714.zip tk-d4afe29e7819e8628a15b96a3372d1f797348714.tar.gz tk-d4afe29e7819e8628a15b96a3372d1f797348714.tar.bz2 |
Add wishc81.exe and wishc81d.exe, console-based wish executables (console
subsystem instead of windows subsystem). This required adding a main() function
and adding code to disable calling Tk_ConsoleInit().
Add code to hook windows-based wish81.exe and wish81d.exe to stdin/stdout/stderr
if they are actually there (usually this happens if it's a pipe, file, lpt or com
port).
Modified makefile to be able to run tests from the makefile. Added cat32.exe
for this purpose.
-rw-r--r-- | win/makefile.vc | 29 | ||||
-rw-r--r-- | win/tkWinWm.c | 7 | ||||
-rw-r--r-- | win/winMain.c | 62 |
3 files changed, 88 insertions, 10 deletions
diff --git a/win/makefile.vc b/win/makefile.vc index 6385911..c0f6d65 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -4,7 +4,7 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Copyright (c) 1995-1997 Sun Microsystems, Inc. -# RCS: @(#) $Id: makefile.vc,v 1.1.4.9 1999/02/12 01:09:03 stanton Exp $ +# RCS: @(#) $Id: makefile.vc,v 1.1.4.10 1999/02/26 02:24:45 redman Exp $ # Does not depend on the presence of any environment variables in # order to compile tcl; all needed information is derived from @@ -71,9 +71,11 @@ TKPLUGINDLL = $(OUTDIR)\$(TKPLUGINDLLNAME) TKPLUGINLIB = $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)p$(DBGX).lib WISH = $(OUTDIR)\$(WISHNAMEPREFIX)$(VERSION)$(DBGX).exe +WISHC = $(OUTDIR)\$(WISHNAMEPREFIX)c$(VERSION)$(DBGX).exe WISHP = $(OUTDIR)\$(WISHNAMEPREFIX)p$(VERSION)$(DBGX).exe TKTEST = $(OUTDIR)\$(TKNAMEPREFIX)test.exe DUMPEXTS = $(TMPDIR)\dumpexts.exe +CAT32 = $(TMPDIR)\cat32.exe BIN_INSTALL_DIR = $(INSTALLDIR)\bin INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include @@ -249,7 +251,7 @@ libcdll = msvcrt$(DBGX).lib oldnames.lib baselibs = kernel32.lib $(optlibs) advapi32.lib winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib guilibs = $(libc) $(winlibs) - +conlibs = $(libc) $(baselibs) guilibsdll = $(libcdll) $(winlibs) ###################################################################### @@ -303,11 +305,17 @@ CON_CFLAGS = $(cdebug) $(cflags) $(cvars) $(include32) -DCONSOLE # Project specific targets ###################################################################### -all: setup $(WISH) -test: setup $(TKTEST) +all: setup $(WISH) $(WISHC) $(CAT32) install: install-binaries install-libraries plugin: setup $(TKPLUGINDLL) $(WISHP) -tktest: setup $(TKTEST) +tktest: setup $(TKTEST) $(CAT32) +test: setup $(TKTEST) $(TKLIB) $(CAT32) + copy $(TCLDIR)\bin\pkgIndex.tcl $(OUTDIR) + set TCL_LIBRARY=$(TCLDIR)/library + $(TKTEST) << | $(CAT32) + cd ../tests + source all +<< setup: @mkd $(TMPDIR) @@ -317,6 +325,7 @@ install-binaries: @mkd "$(BIN_INSTALL_DIR)" copy $(TKDLL) "$(BIN_INSTALL_DIR)" copy $(WISH) "$(BIN_INSTALL_DIR)" + copy $(WISHC) "$(BIN_INSTALL_DIR)" @mkd "$(LIB_INSTALL_DIR)" copy $(TKLIB) "$(LIB_INSTALL_DIR)" @@ -359,6 +368,11 @@ $(WISH): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \ $(guilibsdll) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB) $(WISHOBJS) +$(WISHC): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res + set LIB=$(TOOLS32)\lib + $(link32) $(ldebug) $(conlflags) $(TMPDIR)\wish.res -out:$@ \ + $(guilibsdll) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB) $(WISHOBJS) + $(WISHP): $(WISHOBJS) $(TKPLUGINLIB) $(TMPDIR)\wish.res set LIB=$(TOOLS32)\lib $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \ @@ -386,6 +400,11 @@ $(DUMPEXTS): $(TCLDIR)\win\winDumpExts.c $(link32) $(ldebug) $(conlflags) $(guilibs) -out:$@ \ $(TMPDIR)\winDumpExts.obj +$(CAT32): $(WINDIR)\cat.c + $(cc32) $(CON_CFLAGS) -Fo$(TMPDIR)\ $? + set LIB=$(TOOLS32)\lib + $(link32) $(conlflags) -out:$@ -stack:16384 $(TMPDIR)\cat.obj $(conlibs) + # # Special case object file targets # diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 40a4f48..bf2ff57 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinWm.c,v 1.1.4.7 1999/02/11 04:13:52 stanton Exp $ + * RCS: @(#) $Id: tkWinWm.c,v 1.1.4.8 1999/02/26 02:24:45 redman Exp $ */ #include "tkWinInt.h" @@ -324,6 +324,7 @@ InitWm(void) return; } tsdPtr->initialized = 1; + tsdPtr->firstWindow = 1; classPtr = &tsdPtr->toplevelClass; classPtr->style = CS_HREDRAW | CS_VREDRAW | CS_CLASSDC; @@ -904,6 +905,7 @@ TkpWmSetState(winPtr, state) WmInfo *wmPtr = winPtr->wmInfoPtr; int cmd; + if (wmPtr->flags & WM_NEVER_MAPPED) { wmPtr->hints.initial_state = state; return; @@ -919,6 +921,7 @@ TkpWmSetState(winPtr, state) } else if (state == ZoomState) { cmd = SW_SHOWMAXIMIZED; } + ShowWindow(wmPtr->wrapper, cmd); wmPtr->flags &= ~WM_SYNC_PENDING; } @@ -3982,7 +3985,7 @@ WmProc(hwnd, message, wParam, lParam) * assumes move/size is only one level deep. */ LRESULT result; TkWindow *winPtr; - + if (TkWinHandleMenuEvent(&hwnd, &message, &wParam, &lParam, &result)) { goto done; } diff --git a/win/winMain.c b/win/winMain.c index 48eac39..23aa235 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: winMain.c,v 1.1.4.3 1999/02/11 04:13:52 stanton Exp $ + * RCS: @(#) $Id: winMain.c,v 1.1.4.4 1999/02/26 02:24:46 redman Exp $ */ #include <tk.h> @@ -43,6 +43,8 @@ extern int TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp)); extern int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp)); #endif /* TCL_TEST */ +static BOOL consoleRequired = TRUE; + /* *---------------------------------------------------------------------- @@ -97,6 +99,7 @@ WinMain(hInstance, hPrevInstance, lpszCmdLine, nCmdShow) * called to attach the console to a text widget. */ + consoleRequired = TRUE; TkConsoleCreate(); Tk_Main(argc, argv, Tcl_AppInit); @@ -140,8 +143,10 @@ Tcl_AppInit(interp) * application. */ - if (TkConsoleInit(interp) == TCL_ERROR) { - goto error; + if (consoleRequired) { + if (TkConsoleInit(interp) == TCL_ERROR) { + goto error; + } } #ifdef TCL_TEST @@ -321,3 +326,54 @@ setargv(argcPtr, argvPtr) *argcPtr = argc; *argvPtr = argv; } + + +/* + *---------------------------------------------------------------------- + * + * main -- + * + * Main entry point from the console. + * + * Results: + * None: Tk_Main never returns here, so this procedure never + * returns either. + * + * Side effects: + * Whatever the applications does. + * + *---------------------------------------------------------------------- + */ + +int main(int argc, char **argv) +{ + Tcl_SetPanicProc(WishPanic); + + /* + * Set up the default locale to be standard "C" locale so parsing + * is performed correctly. + */ + + setlocale(LC_ALL, "C"); + /* + * Increase the application queue size from default value of 8. + * At the default value, cross application SendMessage of WM_KILLFOCUS + * will fail because the handler will not be able to do a PostMessage! + * This is only needed for Windows 3.x, since NT dynamically expands + * the queue. + */ + + SetMessageQueue(64); + + /* + * Create the console channels and install them as the standard + * channels. All I/O will be discarded until TkConsoleInit is + * called to attach the console to a text widget. + */ + + consoleRequired = FALSE; + + Tk_Main(argc, argv, Tcl_AppInit); + return 0; +} + |