00001 // @(#)root/gui:$Id: TGObject.h 27658 2009-02-28 05:34:57Z pcanal $ 00002 // Author: Fons Rademakers 27/12/97 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TGObject 00013 #define ROOT_TGObject 00014 00015 00016 ////////////////////////////////////////////////////////////////////////// 00017 // // 00018 // TGObject // 00019 // // 00020 // This class is the baseclass for all ROOT GUI widgets. // 00021 // The ROOT GUI components emulate the Win95 look and feel and the code // 00022 // is based on the XClass'95 code (see Copyleft in source). // 00023 // // 00024 ////////////////////////////////////////////////////////////////////////// 00025 00026 #ifndef ROOT_TObject 00027 #include "TObject.h" 00028 #endif 00029 #ifndef ROOT_GuiTypes 00030 #include "GuiTypes.h" 00031 #endif 00032 00033 class TGClient; 00034 00035 00036 class TGObject : public TObject { 00037 00038 00039 protected: 00040 Handle_t fId; // X11/Win32 Window identifier 00041 TGClient *fClient; // Connection to display server 00042 00043 TGObject& operator=(const TGObject& tgo) 00044 {if(this!=&tgo) { TObject::operator=(tgo); fId=tgo.fId; 00045 fClient=tgo.fClient; } return *this; } 00046 00047 public: 00048 TGObject(): fId(0), fClient(0) { } 00049 TGObject(const TGObject& tgo): TObject(tgo), fId(tgo.fId), fClient(tgo.fClient) { } 00050 virtual ~TGObject() { } 00051 00052 Handle_t GetId() const { return fId; } 00053 TGClient *GetClient() const { return fClient; } 00054 ULong_t Hash() const { return (ULong_t) fId >> 0; } 00055 Bool_t IsEqual(const TObject *obj) const { return fId == ((const TGObject *) obj)->fId; } 00056 virtual void SaveAs(const char* filename = "", Option_t* option = "") const; 00057 00058 ClassDef(TGObject,0) //ROOT GUI base class 00059 }; 00060 00061 #endif