00001 /* 00002 * $Header$ 00003 * $Log$ 00004 * 00005 * Various routines, and global variables 00006 */ 00007 00008 #define __XSVARIOUS_CXX 00009 00010 #include <TEnv.h> 00011 #include <TGClient.h> 00012 #include <TGWindow.h> 00013 #include <TGWindow.h> 00014 00015 #include "XSGraph.h" 00016 #include "XSVarious.h" 00017 00018 /* --------------- XSinitialise ---------------- */ 00019 void 00020 XSinitialise( ) 00021 { 00022 XSelements = new XSElements(ISOTOPES_DESC_FILE); 00023 XSReactionDesc = new NdbMTReacDesc(MT_DESC_FILE); 00024 graphList = new TList(); 00025 00026 // --- Initialise GUI variables --- 00027 fixedFontStruct = gClient->GetFontByName( 00028 gEnv->GetValue("Gui.NormalFont","fixed")); 00029 00030 // Define new graphics context. 00031 memset(&gval,0,sizeof(gval)); 00032 gval.fMask = kGCForeground | kGCBackground | kGCFont | 00033 kGCFillStyle | kGCGraphicsExposures; 00034 gval.fFillStyle = kFillSolid; 00035 gval.fGraphicsExposures = kFALSE; 00036 gval.fFont = gVirtualX->GetFontHandle(fixedFontStruct); 00037 fixedGC=gVirtualX->CreateGC(gClient->GetRoot()->GetId(), &gval); 00038 00039 blueFontStruct = gClient->GetFontByName( 00040 gEnv->GetValue("Gui.NormalFont", 00041 "-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1")); 00042 // Define new graphics context. 00043 gval.fMask = kGCForeground | kGCFont; 00044 gval.fFont = gVirtualX->GetFontHandle(blueFontStruct); 00045 gClient->GetColorByName("blue", gval.fForeground); 00046 blueBoldGC=gVirtualX->CreateGC(gClient->GetRoot()->GetId(), &gval); 00047 00048 } // XSinitialise 00049 00050 /* ---------------- XSfinalise ----------------- */ 00051 void 00052 XSfinalise() 00053 { 00054 delete XSelements; 00055 delete XSReactionDesc; 00056 delete graphList; 00057 } // XSfinalise 00058 00059 /* --------------- Add2GraphList --------------- */ 00060 void 00061 Add2GraphList( XSGraph *gr) 00062 { 00063 graphList->Add(gr); 00064 00065 /* --- Scan all graphs and update the canvas --- */ 00066 // .... 00067 } // Add2GraphList