~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina5/tina-tools/tinatool/wdgts/tcl/wdgtsTcl_tw_init.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**********
  2  * 
  3  * Copyright (c) 2003, Division of Imaging Science and Biomedical Engineering,
  4  * University of Manchester, UK.  All rights reserved.
  5  * 
  6  * Redistribution and use in source and binary forms, with or without modification, 
  7  * are permitted provided that the following conditions are met:
  8  * 
  9  *   . Redistributions of source code must retain the above copyright notice, 
 10  *     this list of conditions and the following disclaimer.
 11  *    
 12  *   . Redistributions in binary form must reproduce the above copyright notice,
 13  *     this list of conditions and the following disclaimer in the documentation 
 14  *     and/or other materials provided with the distribution.
 15  * 
 16  *   . Neither the name of the University of Manchester nor the names of its
 17  *     contributors may be used to endorse or promote products derived from this 
 18  *     software without specific prior written permission.
 19  * 
 20  * 
 21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
 26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 31  * POSSIBILITY OF SUCH DAMAGE.
 32  *
 33  **********
 34  * 
 35  * Program :    TINA
 36  * File    :  $Source: /home/tina/cvs/tina-tools/tinatool/wdgts/tcl/wdgtsTcl_tw_init.c,v $
 37  * Date    :  $Date: 2003/10/01 16:02:48 $
 38  * Version :  $Revision: 1.3 $
 39  * CVS Id  :  $Id: wdgtsTcl_tw_init.c,v 1.3 2003/10/01 16:02:48 tony Exp $
 40  *
 41  * Author  : Legacy TINA
 42  *
 43  * Notes :
 44  *
 45  *********
 46 */
 47 
 48 #include "wdgtsTcl_tw_init.h"
 49 
 50 #if HAVE_CONFIG_H
 51 #   include <config.h>
 52 #endif
 53 
 54 #include <tcl.h>
 55 #if HAVE_TK_H
 56 #       include <tk.h>
 57 #endif
 58 
 59 #include <tina/sys/sys_GenDef.h>
 60 
 61 
 62 static char  *progname;
 63 
 64 
 65 Bool tw_save(void)
 66 {
 67         return (false);
 68 }
 69 
 70 
 71 Bool tw_recover(void)
 72 {
 73         return (false);
 74 }
 75 
 76 void tw_set_save(Bool newsave)
 77 {
 78 }
 79 
 80 char *tw_get_progname(void)
 81 {
 82         return (NULL);
 83 }
 84 
 85 void tw_quit(int dummy)
 86 {
 87 }
 88 
 89 
 90 int    Tcl_AppInit(Tcl_Interp *interp)
 91 {
 92   if (Tcl_Init(interp) == TCL_ERROR)
 93     return TCL_ERROR;
 94 
 95         ttcl_set_interp(interp);
 96         tinatool();
 97 
 98         if (Tcl_SerialiseInit(interp) == TCL_ERROR)
 99                 return TCL_ERROR;
100 
101   Tcl_SetVar(interp, "tcl_rcFileName", "~/.tinarc", TCL_GLOBAL_ONLY);
102   return TCL_OK;
103 }
104 
105 void tw_init(int argc, char **argv)
106 {
107         Tcl_Main(argc, argv, Tcl_AppInit);
108 }
109 
110 
111 #if HAVE_TK_H
112 int    Tk_AppInit(Tcl_Interp *interp)
113 {
114     if (Tcl_Init(interp) == TCL_ERROR)
115       return TCL_ERROR;
116 
117     if (Tk_Init(interp) == TCL_ERROR)
118       return TCL_ERROR;
119 
120         ttcl_set_interp(interp);
121         tinatool();
122         
123         if (Tcl_SerialiseInit(interp) == TCL_ERROR)
124                 return TCL_ERROR;
125 
126         Tcl_SetVar(interp, "tcl_rcFileName", "~/.tinarc", TCL_GLOBAL_ONLY);
127         
128         return TCL_OK;
129 }
130 
131 
132 
133 void tw_init_tk(int argc, char **argv)
134 {
135         Tk_Main(argc, argv, Tk_AppInit);
136 }
137 #endif /*HAVE_TK_H*/
138 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.