/usr/include/root/TGPicture.h is in libroot-gui-dev 5.34.19+dfsg-1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | // @(#)root/gui:$Id$
// Author: Fons Rademakers 01/01/98
/*************************************************************************
* 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_TGPicture
#define ROOT_TGPicture
//////////////////////////////////////////////////////////////////////////
// //
// TGPicture, TGSelectdPicture & TGPicturePool //
// //
// The TGPicture class implements pictures and icons used in the //
// different GUI elements and widgets. The TGPicturePool class //
// implements a TGPicture cache. TGPictures are created, managed and //
// destroyed by the TGPicturePool. //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TRefCnt
#include "TRefCnt.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
#ifndef ROOT_TGClient
#include "TGClient.h"
#endif
#ifndef ROOT_TGGC
#include "TGGC.h"
#endif
class THashTable;
class TGPicture : public TObject, public TRefCnt {
friend class TGPicturePool;
protected:
TString fName; // name of picture
Bool_t fScaled; // kTRUE if picture is scaled
Pixmap_t fPic; // picture pixmap
Pixmap_t fMask; // picture mask pixmap
PictureAttributes_t fAttributes; // picture attributes
TGPicture(const char *name, Bool_t scaled = kFALSE):
fName(name), fScaled(scaled), fPic(kNone), fMask(kNone), fAttributes()
{
fAttributes.fPixels = 0;
SetRefCount(1);
}
TGPicture(const char *name, Pixmap_t pxmap, Pixmap_t mask = 0);
// override default of TObject
void Draw(Option_t * = "") { MayNotUse("Draw(Option_t*)"); }
public:
virtual ~TGPicture();
const char *GetName() const { return fName; }
UInt_t GetWidth() const { return fAttributes.fWidth; }
UInt_t GetHeight() const { return fAttributes.fHeight; }
Pixmap_t GetPicture() const { return fPic; }
Pixmap_t GetMask() const { return fMask; }
Bool_t IsScaled() const { return fScaled; }
ULong_t Hash() const { return fName.Hash(); }
static const char *HashName(const char *name, Int_t width, Int_t height);
virtual void Draw(Handle_t id, GContext_t gc, Int_t x, Int_t y) const;
void Print(Option_t *option="") const;
ClassDef(TGPicture,0) // Pictures and icons used by the GUI classes
};
class TGSelectedPicture : public TGPicture {
protected:
const TGClient *fClient; // client to which selected picture belongs
static TGGC *fgSelectedGC;
static TGGC &GetSelectedGC();
TGSelectedPicture(const TGSelectedPicture& gp):
TGPicture(gp), fClient(gp.fClient) { }
TGSelectedPicture& operator=(const TGSelectedPicture& gp)
{if(this!=&gp) { TGPicture::operator=(gp); fClient=gp.fClient;}
return *this;}
public:
TGSelectedPicture(const TGClient *client, const TGPicture *p);
virtual ~TGSelectedPicture();
ClassDef(TGSelectedPicture,0) // Selected looking picture
};
class TGPicturePool : public TObject {
protected:
const TGClient *fClient; // client for which we keep icon pool
TString fPath; // icon search path
THashTable *fPicList; // hash table containing the icons
TGPicturePool(const TGPicturePool&);
TGPicturePool& operator=(const TGPicturePool&);
public:
TGPicturePool(const TGClient *client, const char *path):
fClient(client), fPath(path), fPicList(0) { }
virtual ~TGPicturePool();
const char *GetPath() const { return fPath; }
const TGPicture *GetPicture(const char *name);
const TGPicture *GetPicture(const char *name, char **xpm);
const TGPicture *GetPicture(const char *name, UInt_t new_width, UInt_t new_height);
const TGPicture *GetPicture(const char *name, Pixmap_t pxmap, Pixmap_t mask = 0);
void FreePicture(const TGPicture *pic);
void Print(Option_t *option="") const;
ClassDef(TGPicturePool,0) // Picture and icon cache
};
#endif
|