00001
00002
00003
00004
00005
00006
00007
00008 #include "GedManagement.h"
00009 #include "TCL_Global.h"
00010
00011
00012 static Tcl_Interp * getGedInterpreter( void ) ;
00013
00014 int sciDestroyGed( int figureId )
00015 {
00016 Tcl_Interp * gedInterp = getGedInterpreter() ;
00017 if ( isGedOpenedOn( figureId ) )
00018 {
00019
00020 Tcl_Eval( gedInterp, "catch { destroy .ticks }" ) ;
00021
00022 Tcl_Eval( gedInterp, "catch { destroy .axes }" ) ;
00023 return 0 ;
00024 }
00025 else
00026 {
00027 return 1 ;
00028 }
00029 }
00030
00031
00032 int isGedOpenedOn( int figureId )
00033 {
00034 Tcl_Interp * gedInterp = getGedInterpreter() ;
00035 if ( gedInterp != NULL )
00036 {
00037
00038 char * sGedWindowNum = (char * ) Tcl_GetVar( gedInterp, "sciGedIsAlive", TCL_GLOBAL_ONLY ) ;
00039 if ( sGedWindowNum )
00040 {
00041
00042 int iGedWindowNum ;
00043 sscanf( sGedWindowNum, "%d", &iGedWindowNum ) ;
00044
00045 if ( iGedWindowNum == figureId )
00046 {
00047 return TRUE ;
00048 }
00049 else
00050 {
00051 return FALSE ;
00052 }
00053 }
00054 else
00055 {
00056 return FALSE ;
00057 }
00058 }
00059 else
00060 {
00061
00062 return FALSE ;
00063 }
00064 }
00065
00066
00067
00068
00069
00070 static Tcl_Interp * getGedInterpreter( void )
00071 {
00072 return TCLinterp ;
00073 }
00074
00075