ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TGObject.h
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 27/12/97
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGObject
13 #define ROOT_TGObject
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TGObject //
19 // //
20 // This class is the baseclass for all ROOT GUI widgets. //
21 // The ROOT GUI components emulate the Win95 look and feel and the code //
22 // is based on the XClass'95 code (see Copyleft in source). //
23 // //
24 //////////////////////////////////////////////////////////////////////////
25 
26 #ifndef ROOT_TObject
27 #include "TObject.h"
28 #endif
29 #ifndef ROOT_GuiTypes
30 #include "GuiTypes.h"
31 #endif
32 
33 class TGClient;
34 
35 
36 class TGObject : public TObject {
37 
38 
39 protected:
40  Handle_t fId; // X11/Win32 Window identifier
41  TGClient *fClient; // Connection to display server
42 
44  {if(this!=&tgo) { TObject::operator=(tgo); fId=tgo.fId;
45  fClient=tgo.fClient; } return *this; }
46 
47 public:
48  TGObject(): fId(0), fClient(0) { }
49  TGObject(const TGObject& tgo): TObject(tgo), fId(tgo.fId), fClient(tgo.fClient) { }
50  virtual ~TGObject() { }
51 
52  Handle_t GetId() const { return fId; }
53  TGClient *GetClient() const { return fClient; }
54  ULong_t Hash() const { return (ULong_t) fId >> 0; }
55  Bool_t IsEqual(const TObject *obj) const;
56  virtual void SaveAs(const char* filename = "", Option_t* option = "") const;
57 
58  ClassDef(TGObject,0) //ROOT GUI base class
59 };
60 
61 #endif
virtual ~TGObject()
Definition: TGObject.h:50
const char Option_t
Definition: RtypesCore.h:62
static const char * filename()
bool Bool_t
Definition: RtypesCore.h:59
TGObject(const TGObject &tgo)
Definition: TGObject.h:49
#define ClassDef(name, id)
Definition: Rtypes.h:254
TObject & operator=(const TObject &rhs)
TObject assignment operator.
Definition: TObject.cxx:102
virtual void SaveAs(const char *filename="", Option_t *option="") const
Save this object in the file specified by filename.
Bool_t IsEqual(const TObject *obj) const
Equal comparison (TGObjects are equal if they have the same window identifier).
Definition: TGObject.cxx:68
ULong_t Hash() const
Return hash value for this object.
Definition: TGObject.h:54
TGClient * GetClient() const
Definition: TGObject.h:53
unsigned long ULong_t
Definition: RtypesCore.h:51
TGObject & operator=(const TGObject &tgo)
Definition: TGObject.h:43
Handle_t fId
Definition: TGObject.h:40
Mother of all ROOT objects.
Definition: TObject.h:58
TGClient * fClient
Definition: TGObject.h:41
TGObject()
Definition: TGObject.h:48
TObject * obj
Handle_t GetId() const
Definition: TGObject.h:52
ULong_t Handle_t
Definition: GuiTypes.h:27