diff --git a/core/meta/inc/TInterpreter.h b/core/meta/inc/TInterpreter.h index b0d09a248e0c7c9f0825d721a9f18f97087cf7a4..b0579fcf41f1d8a6265c6c6f1d6f5db2fb037ad3 100644 --- a/core/meta/inc/TInterpreter.h +++ b/core/meta/inc/TInterpreter.h @@ -228,7 +228,6 @@ public: // All the functions below must be virtual with a dummy implementation // These functions are redefined in TCling. - //The dummy implementation avoids an implementation in TGWin32InterpreterProxy // Misc virtual int DisplayClass(FILE * /* fout */,const char * /* name */,int /* base */,int /* start */) const {return 0;} @@ -533,7 +532,6 @@ typedef void *DestroyInterpreter_t(TInterpreter*); #ifndef __CINT__ #define gInterpreter (TInterpreter::Instance()) -R__EXTERN TInterpreter* (*gPtr2Interpreter)(); R__EXTERN TInterpreter* gCling; #endif diff --git a/core/meta/src/TInterpreter.cxx b/core/meta/src/TInterpreter.cxx index 41d14485d594eb2612988565a10545944c709605..f15344feea3c27bef670f5d1ea9699106e6d30ec 100644 --- a/core/meta/src/TInterpreter.cxx +++ b/core/meta/src/TInterpreter.cxx @@ -21,7 +21,6 @@ interpreter. #include "TGlobal.h" -TInterpreter* (*gPtr2Interpreter)() = nullptr; // returns pointer to global object, NOT USED! TInterpreter* gCling = nullptr; // returns pointer to global TCling object static TInterpreter *gInterpreterLocal = nullptr; // The real holder of the pointer. @@ -64,6 +63,5 @@ TInterpreter *TInterpreter::Instance() ::Fatal("TInterpreter::Instance","TROOT object is required before accessing a TInterpreter"); } } - if (gPtr2Interpreter) return gPtr2Interpreter(); return gInterpreterLocal; } diff --git a/graf2d/win32gdk/CMakeLists.txt b/graf2d/win32gdk/CMakeLists.txt index bb141520005e064134f3f0e537e52b1d6f0703b6..f73f9109f318743b9df101ce761b7cf795640ac6 100644 --- a/graf2d/win32gdk/CMakeLists.txt +++ b/graf2d/win32gdk/CMakeLists.txt @@ -93,7 +93,6 @@ ROOT_STANDARD_LIBRARY_PACKAGE(Win32gdk src/gifquantize.c src/TGWin32.cxx src/TGWin32GL.cxx - src/TGWin32InterpreterProxy.cxx src/TGWin32ProxyBase.cxx src/TGWin32VirtualGLProxy.cxx src/TGWin32VirtualXProxy.cxx diff --git a/graf2d/win32gdk/inc/TGWin32InterpreterProxy.h b/graf2d/win32gdk/inc/TGWin32InterpreterProxy.h deleted file mode 100644 index 011ed04b274f6c6efdf640d1997f3202ca568dd2..0000000000000000000000000000000000000000 --- a/graf2d/win32gdk/inc/TGWin32InterpreterProxy.h +++ /dev/null @@ -1,119 +0,0 @@ -// $Id: TGWin32InterpreterProxy.h,v 1.15 2007/03/08 15:52:17 rdm Exp $ -// Author: Valeriy Onuchin 15/11/03 - -/************************************************************************* - * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * - * All rights reserved. * - * * - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - - -#ifndef ROOT_TGWin32InterpreterProxy -#define ROOT_TGWin32InterpreterProxy - -/** \class TGWin32InterpreterProxy -\ingroup win32 - -This class defines thread-safe interface to a command line interpreter. -*/ - -#include "TInterpreter.h" - -#if ROOT_VERSION_CODE < ROOT_VERSION(6,00,00) - -#include "TGWin32ProxyBase.h" - - -class TGWin32InterpreterProxy : public TInterpreter , public TGWin32ProxyBase { - -protected: - void Execute(TMethod *method, TObjArray *params, int *error = 0) {} - -public: - - TGWin32InterpreterProxy() { fMaxResponseTime = 1000000; fIsVirtualX = kFALSE; } - TGWin32InterpreterProxy(const char *name, const char *title = "Generic Interpreter") {} - virtual ~TGWin32InterpreterProxy() {} - - void AddIncludePath(const char *path); - Int_t AutoLoad(const char *classname); - void ClearFileBusy(); - void ClearStack(); - Bool_t Declare(const char* code); - void EnableAutoLoading(); - void EndOfLineAction(); - void Initialize(); - void InspectMembers(TMemberInspector&, void* obj, const TClass* cl); - Int_t Load(const char *filenam, Bool_t system = kFALSE); - void LoadMacro(const char *filename, EErrorCode *error = 0); - Int_t LoadLibraryMap(const char *rootmapfile = 0); - Int_t RescanLibraryMap(); - Int_t ReloadAllSharedLibraryMaps(); - Int_t UnloadAllSharedLibraryMaps(); - Int_t UnloadLibraryMap(const char *library); - Long_t ProcessLine(const char *line, EErrorCode *error = 0); - Long_t ProcessLineSynch(const char *line, EErrorCode *error = 0); - void PrintIntro(); - Int_t SetClassSharedLibs(const char *cls, const char *libs); - void SetGetline(const char*(*getlineFunc)(const char* prompt), - void (*histaddFunc)(const char* line)); - void Reset(); - void ResetAll(); - void ResetGlobals(); - void ResetGlobalVar(void *obj); - void RewindDictionary(); - Int_t DeleteGlobal(void *obj); - Int_t DeleteVariable(const char *name); - void SaveContext(); - void SaveGlobalsContext(); - void UpdateListOfGlobals(); - void UpdateListOfGlobalFunctions(); - void UpdateListOfTypes(); - void SetClassInfo(TClass *cl, Bool_t reload = kFALSE); - - TInterpreter::ECheckClassInfo - CheckClassInfo(const char *name, Bool_t autoload, Bool_t isClassOrNamespaceOnly = kFALSE); - Bool_t CheckClassTemplate(const char *name); - - Long_t Calc(const char *line, EErrorCode* error = 0); - void CreateListOfBaseClasses(TClass *cl); - void CreateListOfDataMembers(TClass *cl); - void CreateListOfMethods(TClass *cl); - void UpdateListOfMethods(TClass *cl); - void CreateListOfMethodArgs(TFunction *m); - TString GetMangledName(TClass *cl, const char *method, const char *params); - TString GetMangledNameWithPrototype(TClass *cl, const char *method, const char *proto); - Long_t ExecuteMacro(const char *filename, EErrorCode *error = 0); - Bool_t IsErrorMessagesEnabled() const { return RealObject()->IsErrorMessagesEnabled(); } - Bool_t SetErrorMessages(Bool_t enable = kTRUE); - Bool_t IsProcessLineLocked() const { return RealObject()->IsProcessLineLocked(); } - void SetProcessLineLock(Bool_t lock = kTRUE); - Int_t GetExitCode() const { return RealObject()->GetExitCode(); } - TClass *GenerateTClass(const char *classname, Bool_t emulation, Bool_t silent = kFALSE); - TClass *GenerateTClass(ClassInfo_t *classinfo, Bool_t silent = kFALSE); - Int_t GenerateDictionary(const char *classes, const char *includes = 0, const char *options = 0); - Int_t GetMore() const { return RealObject()->GetMore(); } - Bool_t IsLoaded(const char *filename) const { return RealObject()->IsLoaded(filename); } - char *GetPrompt(); - void *GetInterfaceMethod(TClass *cl, const char *method, const char *params); - void *GetInterfaceMethodWithPrototype(TClass *cl, const char *method, const char *proto); - void GetInterpreterTypeName(const char*,std::string &output,Bool_t=kFALSE); - void Execute(const char *function, const char *params, int *error = 0); - void Execute(TObject *obj, TClass *cl, const char *method, const char *params, int *error = 0); - void Execute(TObject *obj, TClass *cl, TMethod *method, TObjArray *params, int *error = 0); - const char *GetSharedLibs(); - const char *GetClassSharedLibs(const char *cls); - const char *GetSharedLibDeps(const char *lib); - const char *GetIncludePath(); - TObjArray *GetRootMapFiles() const { return RealObject()->GetRootMapFiles(); } - const char *TypeName(const char *s); - - static TInterpreter *RealObject(); - static TInterpreter *ProxyObject(); -}; - -#endif - -#endif diff --git a/graf2d/win32gdk/src/TGWin32.cxx b/graf2d/win32gdk/src/TGWin32.cxx index e2db4f5cb5122b8847c53f6dc91a2bb416999545..401ed2adccabb75bd881c06055a43c631832bc6f 100644 --- a/graf2d/win32gdk/src/TGWin32.cxx +++ b/graf2d/win32gdk/src/TGWin32.cxx @@ -52,7 +52,6 @@ by Olivier Couet (package X11INT). #include "KeySymbols.h" #include "TWinNTSystem.h" #include "TGWin32VirtualXProxy.h" -#include "TGWin32InterpreterProxy.h" #include "TWin32SplashThread.h" #include "TString.h" #include "TObjString.h" @@ -806,9 +805,6 @@ TGWin32::TGWin32(const char *name, const char *title) : TVirtualX(name,title), f TGWin32ProxyBase::fgMainThreadId = ::GetCurrentThreadId(); // gMainThread->fId; TGWin32VirtualXProxy::fgRealObject = this; gPtr2VirtualX = &TGWin32VirtualXProxy::ProxyObject; -#ifdef OLD_THREAD_IMPLEMENTATION - gPtr2Interpreter = &TGWin32InterpreterProxy::ProxyObject; -#endif } } @@ -905,14 +901,7 @@ void TGWin32::CloseDisplay() // terminate server thread gPtr2VirtualX = 0; -#if ROOT_VERSION_CODE < ROOT_VERSION(6,00,00) - gPtr2Interpreter = 0; -#endif gVirtualX = TGWin32VirtualXProxy::RealObject(); - // Following the change in revision 47611, - // gInterpreter is a read-only variable but its value - // is overridden by gPtr2Interpreter when it is not null. - // gInterpreter = TGWin32InterpreterProxy::RealObject(); // The lock above does not work, so at least // minimize the risk diff --git a/graf2d/win32gdk/src/TGWin32InterpreterProxy.cxx b/graf2d/win32gdk/src/TGWin32InterpreterProxy.cxx deleted file mode 100644 index 8345c83c99a98f0c305349f8a8af8b5d9b6e76e8..0000000000000000000000000000000000000000 --- a/graf2d/win32gdk/src/TGWin32InterpreterProxy.cxx +++ /dev/null @@ -1,126 +0,0 @@ -// @(#)root/meta:$Id: TGWin32InterpreterProxy.cxx 38517 2011-03-18 20:20:16Z pcanal $ -// Author: Valeriy Onuchin 15/11/2003 - - -/************************************************************************* - * Copyright (C) 1995-2001, Rene Brun and Fons Rademakers. * - * All rights reserved. * - * * - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - - -#include "TGWin32ProxyDefs.h" -#include "TGWin32InterpreterProxy.h" -#include "TROOT.h" -#include "TGWin32.h" - -#if ROOT_VERSION_CODE < ROOT_VERSION(6,00,00) - -//////////////////////////////////////////////////////////////////////////////// -/// returns TCint object - -TInterpreter *TGWin32InterpreterProxy::RealObject() -{ - return gROOT->GetInterpreter(); -} - -RETURN_PROXY_OBJECT(Interpreter) -VOID_METHOD_ARG1(Interpreter,AddIncludePath,const char*,path,1) -RETURN_METHOD_ARG1(Interpreter,Int_t,AutoLoad,const char *,classname) -VOID_METHOD_ARG0(Interpreter,ClearFileBusy,1) -VOID_METHOD_ARG0(Interpreter,ClearStack,1) -RETURN_METHOD_ARG1(Interpreter,Bool_t,Declare,const char*, code) -VOID_METHOD_ARG0(Interpreter,EndOfLineAction,1) -VOID_METHOD_ARG0(Interpreter,EnableAutoLoading,1) -VOID_METHOD_ARG0(Interpreter,Initialize,0) -// Does not support references: -//VOID_METHOD_ARG3(Interpreter,InspectMembers,TMemberInspector&, insp, void*, obj, const TClass*,cl,1) -void _NAME4_(p2,Interpreter,InspectMembers,insp)(void *in) -{ - struct tmp { - TMemberInspector *par1; void *par2; const TClass *par3; - }; - tmp *p = (tmp*)in; - _NAME3_(TGWin32,Interpreter,Proxy)::RealObject()->InspectMembers(*p->par1,p->par2,p->par3); -} - -void TGWin32InterpreterProxy::InspectMembers(TMemberInspector& insp, void* obj, const TClass* cl) -{ - DEBUG_PROFILE_PROXY_START(InspectMembers) - struct tmp { - TMemberInspector *par1; void *par2; const TClass *par3; - tmp(TMemberInspector *par1,void *par2,const TClass *par3):par1(par1),par2(par2),par3(par3) {} - }; - fParam = new tmp(&insp,obj,cl); - fCallBack = &_NAME4_(p2,Interpreter,InspectMembers,insp); - Bool_t batch = ForwardCallBack(1); - // insp = ((tmp*)fParam)->par1; - obj = ((tmp*)fParam)->par2; - cl = ((tmp*)fParam)->par3; - if (!batch) delete fParam; - DEBUG_PROFILE_PROXY_STOP(InspectMembers) -} - -RETURN_METHOD_ARG3(Interpreter,TClass*,GenerateTClass,const char *,classname,Bool_t,emulation,Bool_t,silent); -RETURN_METHOD_ARG2(Interpreter,TClass*,GenerateTClass,ClassInfo_t *,classinfo,Bool_t,silent); -RETURN_METHOD_ARG3(Interpreter,Int_t,GenerateDictionary,const char*,classes,const char*,headers,const char*,options); -RETURN_METHOD_ARG0(Interpreter,char*,GetPrompt) -RETURN_METHOD_ARG0(Interpreter,const char*,GetSharedLibs) -RETURN_METHOD_ARG0(Interpreter,const char*,GetIncludePath) -RETURN_METHOD_ARG2(Interpreter,Int_t,Load,const char*,filenam,Bool_t,system) -RETURN_METHOD_ARG1(Interpreter,Int_t,LoadLibraryMap,const char*,rootmapfile) -RETURN_METHOD_ARG0(Interpreter,Int_t,RescanLibraryMap) -RETURN_METHOD_ARG0(Interpreter,Int_t,ReloadAllSharedLibraryMaps) -RETURN_METHOD_ARG0(Interpreter,Int_t,UnloadAllSharedLibraryMaps) -RETURN_METHOD_ARG1(Interpreter,Int_t,UnloadLibraryMap,const char*,library) -VOID_METHOD_ARG2(Interpreter,LoadMacro,const char*,filename,TInterpreter::EErrorCode*,error,1) -RETURN_METHOD_ARG2(Interpreter,Long_t,ProcessLine,const char*,line,TInterpreter::EErrorCode*,error) -RETURN_METHOD_ARG2(Interpreter,Long_t,ProcessLineSynch,const char*,line,TInterpreter::EErrorCode*,error) -VOID_METHOD_ARG0(Interpreter,PrintIntro,1) -typedef const char* (*GetlineFunc_t)(const char* prompt); -typedef void (*HistaddFunc_t)(const char* line); -RETURN_METHOD_ARG2(Interpreter,Int_t,SetClassSharedLibs,const char*,cls,const char*,libs); -VOID_METHOD_ARG2(Interpreter,SetGetline,GetlineFunc_t, getlineFunc,\ - HistaddFunc_t, histaddFunc, 1) -VOID_METHOD_ARG0(Interpreter,Reset,1) -VOID_METHOD_ARG0(Interpreter,ResetAll,1) -VOID_METHOD_ARG0(Interpreter,ResetGlobals,1) -VOID_METHOD_ARG1(Interpreter,ResetGlobalVar,void*,obj,1) -VOID_METHOD_ARG0(Interpreter,RewindDictionary,1) -RETURN_METHOD_ARG1(Interpreter,Int_t,DeleteGlobal,void*,obj) -RETURN_METHOD_ARG1(Interpreter,Int_t,DeleteVariable,const char*,name) -VOID_METHOD_ARG0(Interpreter,SaveContext,1) -VOID_METHOD_ARG0(Interpreter,SaveGlobalsContext,1) -VOID_METHOD_ARG0_LOCK(Interpreter,UpdateListOfGlobals) -VOID_METHOD_ARG0_LOCK(Interpreter,UpdateListOfGlobalFunctions) -VOID_METHOD_ARG0_LOCK(Interpreter,UpdateListOfTypes) -VOID_METHOD_ARG2_LOCK(Interpreter,SetClassInfo,TClass*,cl,Bool_t,reload) -RETURN_METHOD_ARG3(Interpreter, TInterpreter::ECheckClassInfo, CheckClassInfo, const char *, name, Bool_t, autoload, - Bool_t, isClassOrNamespaceOnly) -RETURN_METHOD_ARG1(Interpreter,Bool_t,CheckClassTemplate,const char*,name) -RETURN_METHOD_ARG2(Interpreter,Long_t,Calc,const char*,line,TInterpreter::EErrorCode*,error) -VOID_METHOD_ARG1_LOCK(Interpreter,CreateListOfBaseClasses,TClass*,cl) -VOID_METHOD_ARG1_LOCK(Interpreter,CreateListOfDataMembers,TClass*,cl) -VOID_METHOD_ARG1_LOCK(Interpreter,CreateListOfMethods,TClass*,cl) -VOID_METHOD_ARG1_LOCK(Interpreter,CreateListOfMethodArgs,TFunction*,m) -VOID_METHOD_ARG1_LOCK(Interpreter,UpdateListOfMethods,TClass*,cl) -RETURN_METHOD_ARG3(Interpreter,TString,GetMangledName,TClass*,cl,const char*,method,const char*,params) -RETURN_METHOD_ARG3(Interpreter,TString,GetMangledNameWithPrototype,TClass*,cl,const char*,method,const char*,proto) -RETURN_METHOD_ARG3(Interpreter,void*,GetInterfaceMethod,TClass*,cl,const char*,method,const char*,params) -RETURN_METHOD_ARG3(Interpreter,void*,GetInterfaceMethodWithPrototype,TClass*,cl,const char*,method,const char*,proto) -RETURN_METHOD_ARG1(Interpreter,const char*,GetClassSharedLibs,const char*,s) -RETURN_METHOD_ARG1(Interpreter,const char*,GetSharedLibDeps,const char*,s) -RETURN_METHOD_ARG2(Interpreter,const char*,GetInterpreterTypeName,const char*,s,Bool_t,full) -VOID_METHOD_ARG3(Interpreter,Execute,const char*,function,const char*,params,int*,error,1) -VOID_METHOD_ARG5(Interpreter,Execute,TObject*,obj,TClass*,cl,const char*,method,const char*,params,int*,error,1) -VOID_METHOD_ARG5(Interpreter,Execute,TObject*,object,TClass*,cl,TMethod*,method,TObjArray*,params,int*,error,1) -RETURN_METHOD_ARG2(Interpreter,Long_t,ExecuteMacro,const char*,filename,TInterpreter::EErrorCode*,error) -RETURN_METHOD_ARG1(Interpreter,Bool_t,SetErrorMessages,Bool_t,enable) -VOID_METHOD_ARG1(Interpreter,SetProcessLineLock,Bool_t,lock,1) -RETURN_METHOD_ARG1(Interpreter,const char*,TypeName,const char*,s) -// TInterpreter::ECheckClassInfo TGWin32InterpreterProxy::CheckClassInfo(const char* name) { return -// RealObject()->CheckClassInfo(name); } - -#endif diff --git a/graf2d/win32gdk/src/TGWin32ProxyBase.cxx b/graf2d/win32gdk/src/TGWin32ProxyBase.cxx index e827397517f77fcfcd1bd3cd7429606d23da01c6..ed2511804c0c5d36e6b284c70655d328ba562dcd 100644 --- a/graf2d/win32gdk/src/TGWin32ProxyBase.cxx +++ b/graf2d/win32gdk/src/TGWin32ProxyBase.cxx @@ -14,8 +14,7 @@ Proxy classes provide thread-safe interface to global objects. -For example: TGWin32VirtualXProxy (to gVirtualX), - TGWin32InterpreterProxy (to gInterpreter). +For example: TGWin32VirtualXProxy (to gVirtualX). Proxy object creates callback object and posts a windows message to "processing thread". When windows message is received callback @@ -40,7 +39,7 @@ Howto create proxy class: 2. Definition of global object As example check definition and implementation of - gVirtualX, gInterpreter global objects + gVirtualX global object 3. Class definition. proxy class must be inherited from "virtual base class" and @@ -55,19 +54,19 @@ Howto create proxy class: of virtual base class. For example: - static TInterpreter *RealObject(); - static TInterpreter *ProxyObject(); + static TVirtualX *RealObject(); + static TVirtualX *ProxyObject(); 5. Implementation TGWin32ProxyDefs.h file contains a set of macros which very simplify implementation. - RETURN_PROXY_OBJECT macro implements ProxyObject() method, e.g. - RETURN_PROXY_OBJECT(Interpreter) + RETURN_PROXY_OBJECT(VirtualX) - the names of other macros say about itself. For example: - VOID_METHOD_ARG0(Interpreter,ClearFileBusy,1) - void TGWin32InterpreterProxy::ClearFileBusy() + VOID_METHOD_ARG0(VirtualX,SetFillAttributes,1) + void TGWin32VirtualXProxy::SetFillAttributes() RETURN_METHOD_ARG0_CONST(VirtualX,Visual_t,GetVisual) Visual_t TGWin32VirtualXProxy::GetVisual() const @@ -75,9 +74,6 @@ Howto create proxy class: RETURN_METHOD_ARG2(VirtualX,Int_t,OpenPixmap,UInt_t,w,UInt_t,h) Int_t TGWin32VirtualXProxy::OpenPixmap,UInt_t w,UInt_t h) - - few methods has _LOCK part in the name - VOID_METHOD_ARG1_LOCK(Interpreter,CreateListOfMethods,TClass*,cl) - */