1 2 3 4 5 6 7 8 9 10 11 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 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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
/* -----------------------------------------------------------------------------
* See the LICENSE file for information on copyright, usage and redistribution
* of SWIG, and the README file for authors - http://www.swig.org/release.html.
*
* mactclinit.c
* ----------------------------------------------------------------------------- */
/*
* tclMacAppInit.c --
*
* Provides a version of the Tcl_AppInit procedure for the example shell.
*
* Copyright (c) 1993-1994 Lockheed Missle & Space Company, AI Center
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* SCCS: @(#) tclMacAppInit.c 1.17 97/01/21 18:13:34
*/
#include "tcl.h"
#include "tclInt.h"
#include "tclMacInt.h"
#if defined(THINK_C)
# include <console.h>
#elif defined(__MWERKS__)
# include <SIOUX.h>
short InstallConsole _ANSI_ARGS_((short fd));
#endif
/*
*----------------------------------------------------------------------
*
* MacintoshInit --
*
* This procedure calls initalization routines to set up a simple
* console on a Macintosh. This is necessary as the Mac doesn't
* have a stdout & stderr by default.
*
* Results:
* Returns TCL_OK if everything went fine. If it didn't the
* application should probably fail.
*
* Side effects:
* Inits the appropiate console package.
*
*----------------------------------------------------------------------
*/
#ifdef __cplusplus
extern "C"
#endif
extern int
MacintoshInit()
{
#if defined(THINK_C)
/* Set options for Think C console package */
/* The console package calls the Mac init calls */
console_options.pause_atexit = 0;
console_options.title = "\pTcl Interpreter";
#elif defined(__MWERKS__)
/* Set options for CodeWarrior SIOUX package */
SIOUXSettings.autocloseonquit = true;
SIOUXSettings.showstatusline = true;
SIOUXSettings.asktosaveonclose = false;
InstallConsole(0);
SIOUXSetTitle("\pTcl Interpreter");
#elif defined(applec)
/* Init packages used by MPW SIOW package */
InitGraf((Ptr)&qd.thePort);
InitFonts();
InitWindows();
InitMenus();
TEInit();
InitDialogs(nil);
InitCursor();
#endif
TclMacSetEventProc((TclMacConvertEventPtr) SIOUXHandleOneEvent);
/* No problems with initialization */
return TCL_OK;
}
|