1/* ----------------------------------------------------------------------------- 2 * See the LICENSE file for information on copyright, usage and redistribution 3 * of SWIG, and the README file for authors - http://www.swig.org/release.html. 4 * 5 * mactclinit.c 6 * ----------------------------------------------------------------------------- */ 7 8/* 9 * tclMacAppInit.c -- 10 * 11 * Provides a version of the Tcl_AppInit procedure for the example shell. 12 * 13 * Copyright (c) 1993-1994 Lockheed Missle & Space Company, AI Center 14 * Copyright (c) 1995-1997 Sun Microsystems, Inc. 15 * 16 * See the file "license.terms" for information on usage and redistribution 17 * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 18 * 19 * SCCS: @(#) tclMacAppInit.c 1.17 97/01/21 18:13:34 20 */ 21 22#include "tcl.h" 23#include "tclInt.h" 24#include "tclMacInt.h" 25 26#if defined(THINK_C) 27# include <console.h> 28#elif defined(__MWERKS__) 29# include <SIOUX.h> 30short InstallConsole _ANSI_ARGS_((short fd)); 31#endif 32 33 34 35/* 36 *---------------------------------------------------------------------- 37 * 38 * MacintoshInit -- 39 * 40 * This procedure calls initalization routines to set up a simple 41 * console on a Macintosh. This is necessary as the Mac doesn't 42 * have a stdout & stderr by default. 43 * 44 * Results: 45 * Returns TCL_OK if everything went fine. If it didn't the 46 * application should probably fail. 47 * 48 * Side effects: 49 * Inits the appropiate console package. 50 * 51 *---------------------------------------------------------------------- 52 */ 53 54#ifdef __cplusplus 55extern "C" 56#endif 57extern int 58MacintoshInit() 59{ 60#if defined(THINK_C) 61 62 /* Set options for Think C console package */ 63 /* The console package calls the Mac init calls */ 64 console_options.pause_atexit = 0; 65 console_options.title = "\pTcl Interpreter"; 66 67#elif defined(__MWERKS__) 68 69 /* Set options for CodeWarrior SIOUX package */ 70 SIOUXSettings.autocloseonquit = true; 71 SIOUXSettings.showstatusline = true; 72 SIOUXSettings.asktosaveonclose = false; 73 InstallConsole(0); 74 SIOUXSetTitle("\pTcl Interpreter"); 75 76#elif defined(applec) 77 78 /* Init packages used by MPW SIOW package */ 79 InitGraf((Ptr)&qd.thePort); 80 InitFonts(); 81 InitWindows(); 82 InitMenus(); 83 TEInit(); 84 InitDialogs(nil); 85 InitCursor(); 86 87#endif 88 89 TclMacSetEventProc((TclMacConvertEventPtr) SIOUXHandleOneEvent); 90 91 /* No problems with initialization */ 92 return TCL_OK; 93} 94