12 #ifndef ROOT_TGPicture
13 #define ROOT_TGPicture
36 class TGPicture :
public TObject,
public TRefCnt {
38 friend class TGPicturePool;
45 PictureAttributes_t fAttributes;
47 TGPicture(
const char *name, Bool_t scaled = kFALSE):
48 fName(name), fScaled(scaled), fPic(kNone), fMask(kNone), fAttributes()
50 fAttributes.fPixels = 0;
54 TGPicture(
const char *name, Pixmap_t pxmap, Pixmap_t mask = 0);
57 void Draw(Option_t * =
"") { MayNotUse(
"Draw(Option_t*)"); }
62 const char *GetName()
const {
return fName; }
63 UInt_t GetWidth()
const {
return fAttributes.fWidth; }
64 UInt_t GetHeight()
const {
return fAttributes.fHeight; }
65 Pixmap_t GetPicture()
const {
return fPic; }
66 Pixmap_t GetMask()
const {
return fMask; }
67 Bool_t IsScaled()
const {
return fScaled; }
68 ULong_t Hash()
const {
return fName.Hash(); }
69 static const char *HashName(
const char *name, Int_t width, Int_t height);
71 virtual void Draw(Handle_t
id, GContext_t gc, Int_t x, Int_t y)
const;
72 void Print(Option_t *option=
"")
const;
78 class TGSelectedPicture :
public TGPicture {
81 const TGClient *fClient;
83 static TGGC *fgSelectedGC;
84 static TGGC &GetSelectedGC();
86 TGSelectedPicture(
const TGSelectedPicture& gp):
87 TGPicture(gp), fClient(gp.fClient) { }
88 TGSelectedPicture& operator=(
const TGSelectedPicture& gp)
89 {
if(
this!=&gp) { TGPicture::operator=(gp); fClient=gp.fClient;}
93 TGSelectedPicture(
const TGClient *client,
const TGPicture *p);
94 virtual ~TGSelectedPicture();
96 ClassDef(TGSelectedPicture,0)
100 class TGPicturePool :
public TObject {
103 const TGClient *fClient;
105 THashTable *fPicList;
107 TGPicturePool(
const TGPicturePool&);
108 TGPicturePool& operator=(
const TGPicturePool&);
111 TGPicturePool(
const TGClient *client,
const char *path):
112 fClient(client), fPath(path), fPicList(0) { }
113 virtual ~TGPicturePool();
115 const char *GetPath()
const {
return fPath; }
116 const TGPicture *GetPicture(
const char *name);
117 const TGPicture *GetPicture(
const char *name,
char **xpm);
118 const TGPicture *GetPicture(
const char *name, UInt_t new_width, UInt_t new_height);
119 const TGPicture *GetPicture(
const char *name, Pixmap_t pxmap, Pixmap_t mask = 0);
120 void FreePicture(
const TGPicture *pic);
122 void Print(Option_t *option=
"")
const;
124 ClassDef(TGPicturePool,0)