Logo ROOT  
Reference Guide
TGResourcePool.h
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 19/5/2003
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2003, 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_TGResourcePool
13 #define ROOT_TGResourcePool
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TGResourcePool //
18 // //
19 // This class implements a pool for the default GUI resource set, //
20 // like GC's, colors, fonts, etc.. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TGObject.h"
25 
26 class TGClient;
27 class TGFontPool;
28 class TGFont;
29 class TGGCPool;
30 class TGGC;
31 class TGPicturePool;
32 class TGPicture;
33 class TGMimeTypes;
34 
35 
36 class TGResourcePool : public TGObject {
37 
38 private:
39  Pixel_t fBackColor; // default background color
40  Pixel_t fForeColor; // default foreground color
41  Pixel_t fHilite; // default hilite color
42  Pixel_t fShadow; // default shadow color
43  Pixel_t fHighLightColor; // highlight color
44  Pixel_t fSelBackColor; // default selection background color
45  Pixel_t fSelForeColor; // default selection foreground color
46  Pixel_t fDocBackColor; // default document background color
47  Pixel_t fDocForeColor; // default document foreground color
48  Pixel_t fTipBackColor; // default tip background color
49  Pixel_t fTipForeColor; // default tip foreground color
50  Pixel_t fWhite; // white color index
51  Pixel_t fBlack; // black color index
52 
53  TGFontPool *fFontPool; // font pool manager
54 
55  TGFont *fDefaultFont; // default font
56  TGFont *fMenuFont; // menu font
57  TGFont *fMenuHiFont; // menu highlight font
58  TGFont *fDocFixedFont; // document fixed font
59  TGFont *fDocPropFont; // document proportional font
60  TGFont *fIconFont; // icon font
61  TGFont *fStatusFont; // status bar font
62 
63  TGPicturePool *fPicturePool; // picture pool manager
64 
65  const TGPicture *fDefaultBackPicture; // default background picture
66  const TGPicture *fDefaultDocBackPicture; // default document background picture
67 
68  TGGCPool *fGCPool; // graphics drawing context pool manager
69 
70  TGGC *fWhiteGC; // white gc
71  TGGC *fBlackGC; // black gc
72  TGGC *fFrameGC; // frame gc
73  TGGC *fBckgndGC; // frame background gc
74  TGGC *fHiliteGC; // frame hilite gc
75  TGGC *fShadowGC; // frame shadow gc
76  TGGC *fFocusGC; // frame focus gc
77  TGGC *fDocGC; // document gc
78  TGGC *fDocbgndGC; // document background gc
79  TGGC *fSelGC; // selection gc
80  TGGC *fSelbgndGC; // selection background gc
81  TGGC *fTipGC; // tooltip gc
82 
83  Pixmap_t fCheckered; // checkered pixmap
84  Pixmap_t fCheckeredBitmap; // checkered bitmap
85 
86  Cursor_t fDefaultCursor; // default cursor
87  Cursor_t fGrabCursor; // grab cursor
88  Cursor_t fTextCursor; // text cursor
89  Cursor_t fWaitCursor; // wait cursor
90 
91  Colormap_t fDefaultColormap; // default colormap
92 
93  Atom_t fClipboardAtom; // handle to clipboard
94 
95  TGMimeTypes *fMimeTypeList; // list of mime types
96 
97 public:
98  TGResourcePool(TGClient *client);
99  virtual ~TGResourcePool();
100 
101  TGGCPool *GetGCPool() const { return fGCPool; }
102  TGFontPool *GetFontPool() const { return fFontPool; }
104 
105  //--- inline functions:
106 
107  // Color values...
108 
109  Pixel_t GetWhiteColor() const { return fWhite; }
110  Pixel_t GetBlackColor() const { return fBlack; }
111 
114  Pixel_t GetFrameHiliteColor() const { return fHilite; }
115  Pixel_t GetFrameShadowColor() const { return fShadow; }
116 
118 
121 
124 
127 
128  // Fonts...
129 
130  const TGFont *GetDefaultFont() const { return fDefaultFont; }
131  const TGFont *GetMenuFont() const { return fMenuFont; }
132  const TGFont *GetMenuHiliteFont() const { return fMenuHiFont; }
133  const TGFont *GetDocumentFixedFont() const { return fDocFixedFont; }
134  const TGFont *GetDocumentPropFont() const { return fDocPropFont; }
135  const TGFont *GetIconFont() const { return fIconFont; }
136  const TGFont *GetStatusFont() const { return fStatusFont; }
137 
138  // GCs...
139 
140  const TGGC *GetWhiteGC() const { return fWhiteGC; }
141  const TGGC *GetBlackGC() const { return fBlackGC; }
142 
143  const TGGC *GetFrameGC() const { return fFrameGC; }
144  const TGGC *GetFrameBckgndGC() const { return fBckgndGC; }
145  const TGGC *GetFrameHiliteGC() const { return fHiliteGC; }
146  const TGGC *GetFrameShadowGC() const { return fShadowGC; }
147  const TGGC *GetFocusHiliteGC() const { return fFocusGC; }
148 
149  const TGGC *GetDocumentGC() const { return fDocGC; }
150  const TGGC *GetDocumentBckgndGC() const { return fDocbgndGC; }
151 
152  const TGGC *GetSelectedGC() const { return fSelGC; }
153  const TGGC *GetSelectedBckgndGC() const { return fSelbgndGC; }
154 
155  const TGGC *GetTipGC() const { return fTipGC; }
156 
157  // Pixmaps...
158 
161 
163  { return fDefaultBackPicture; }
165  { return fDefaultDocBackPicture; }
166 
167  // Cursors...
168 
170  Cursor_t GetGrabCursor() const { return fGrabCursor; }
171  Cursor_t GetTextCursor() const { return fTextCursor; }
172  Cursor_t GetWaitCursor() const { return fWaitCursor; }
173 
174  // Colormaps...
175 
177 
178  // Miscellaneous...
179 
181 
182  Atom_t GetClipboard() const { return fClipboardAtom; }
183 
184  ClassDef(TGResourcePool,0) // Graphics resource pool
185 };
186 
187 #endif
TGResourcePool::fFontPool
TGFontPool * fFontPool
Definition: TGResourcePool.h:53
TGObject
Definition: TGObject.h:32
TGResourcePool::GetDocumentGC
const TGGC * GetDocumentGC() const
Definition: TGResourcePool.h:149
Pixmap_t
Handle_t Pixmap_t
Definition: GuiTypes.h:29
TGResourcePool::fSelBackColor
Pixel_t fSelBackColor
Definition: TGResourcePool.h:44
TGResourcePool::GetDefaultFont
const TGFont * GetDefaultFont() const
Definition: TGResourcePool.h:130
TGPicture
Definition: TGPicture.h:36
TGResourcePool::fPicturePool
TGPicturePool * fPicturePool
Definition: TGResourcePool.h:63
TGResourcePool::fStatusFont
TGFont * fStatusFont
Definition: TGResourcePool.h:61
TGResourcePool::GetGCPool
TGGCPool * GetGCPool() const
Definition: TGResourcePool.h:101
TGResourcePool::fDocbgndGC
TGGC * fDocbgndGC
Definition: TGResourcePool.h:78
TGResourcePool::GetFrameHiliteGC
const TGGC * GetFrameHiliteGC() const
Definition: TGResourcePool.h:145
TGResourcePool::GetTextCursor
Cursor_t GetTextCursor() const
Definition: TGResourcePool.h:171
TGResourcePool::GetCheckeredPixmap
Pixmap_t GetCheckeredPixmap() const
Definition: TGResourcePool.h:159
TGResourcePool::GetDocumentBckgndPicture
const TGPicture * GetDocumentBckgndPicture() const
Definition: TGResourcePool.h:164
TGResourcePool::GetFrameHiliteColor
Pixel_t GetFrameHiliteColor() const
Definition: TGResourcePool.h:114
TGResourcePool::fBackColor
Pixel_t fBackColor
Definition: TGResourcePool.h:39
TGResourcePool::fSelGC
TGGC * fSelGC
Definition: TGResourcePool.h:79
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
TGResourcePool::fBckgndGC
TGGC * fBckgndGC
Definition: TGResourcePool.h:73
TGResourcePool::fFrameGC
TGGC * fFrameGC
Definition: TGResourcePool.h:72
TGResourcePool::fSelbgndGC
TGGC * fSelbgndGC
Definition: TGResourcePool.h:80
TGResourcePool::GetSelectedBgndColor
Pixel_t GetSelectedBgndColor() const
Definition: TGResourcePool.h:123
TGResourcePool::fDocForeColor
Pixel_t fDocForeColor
Definition: TGResourcePool.h:47
TGResourcePool::fShadow
Pixel_t fShadow
Definition: TGResourcePool.h:42
TGResourcePool::fDocPropFont
TGFont * fDocPropFont
Definition: TGResourcePool.h:59
TGResourcePool::fTipGC
TGGC * fTipGC
Definition: TGResourcePool.h:81
TGResourcePool::GetFontPool
TGFontPool * GetFontPool() const
Definition: TGResourcePool.h:102
TGResourcePool::GetTipFgndColor
Pixel_t GetTipFgndColor() const
Definition: TGResourcePool.h:125
TGResourcePool::fTipBackColor
Pixel_t fTipBackColor
Definition: TGResourcePool.h:48
TGResourcePool::fDefaultDocBackPicture
const TGPicture * fDefaultDocBackPicture
Definition: TGResourcePool.h:66
TGResourcePool::GetTipGC
const TGGC * GetTipGC() const
Definition: TGResourcePool.h:155
TGResourcePool::GetCheckeredBitmap
Pixmap_t GetCheckeredBitmap() const
Definition: TGResourcePool.h:160
TGResourcePool::GetGrabCursor
Cursor_t GetGrabCursor() const
Definition: TGResourcePool.h:170
TGResourcePool::GetDefaultCursor
Cursor_t GetDefaultCursor() const
Definition: TGResourcePool.h:169
TGResourcePool::GetFrameBckgndGC
const TGGC * GetFrameBckgndGC() const
Definition: TGResourcePool.h:144
TGObject.h
TGResourcePool::GetMenuHiliteFont
const TGFont * GetMenuHiliteFont() const
Definition: TGResourcePool.h:132
TGResourcePool
Definition: TGResourcePool.h:36
TGResourcePool::GetWhiteColor
Pixel_t GetWhiteColor() const
Definition: TGResourcePool.h:109
Cursor_t
Handle_t Cursor_t
Definition: GuiTypes.h:33
TGResourcePool::fHiliteGC
TGGC * fHiliteGC
Definition: TGResourcePool.h:74
TGFontPool
Definition: TGFont.h:226
TGResourcePool::GetSelectedBckgndGC
const TGGC * GetSelectedBckgndGC() const
Definition: TGResourcePool.h:153
TGResourcePool::GetHighLightColor
Pixel_t GetHighLightColor() const
Definition: TGResourcePool.h:117
TGResourcePool::fForeColor
Pixel_t fForeColor
Definition: TGResourcePool.h:40
TGResourcePool::fGCPool
TGGCPool * fGCPool
Definition: TGResourcePool.h:68
TGResourcePool::GetDocumentFgndColor
Pixel_t GetDocumentFgndColor() const
Definition: TGResourcePool.h:119
TGResourcePool::GetDocumentFixedFont
const TGFont * GetDocumentFixedFont() const
Definition: TGResourcePool.h:133
TGResourcePool::GetDocumentPropFont
const TGFont * GetDocumentPropFont() const
Definition: TGResourcePool.h:134
TGResourcePool::fWhiteGC
TGGC * fWhiteGC
Definition: TGResourcePool.h:70
TGResourcePool::fIconFont
TGFont * fIconFont
Definition: TGResourcePool.h:60
TGResourcePool::GetSelectedGC
const TGGC * GetSelectedGC() const
Definition: TGResourcePool.h:152
TGResourcePool::fDocBackColor
Pixel_t fDocBackColor
Definition: TGResourcePool.h:46
TGResourcePool::fDefaultColormap
Colormap_t fDefaultColormap
Definition: TGResourcePool.h:91
Colormap_t
Handle_t Colormap_t
Definition: GuiTypes.h:32
TGGC
Definition: TGGC.h:31
Atom_t
Handle_t Atom_t
Definition: GuiTypes.h:36
TGResourcePool::fTipForeColor
Pixel_t fTipForeColor
Definition: TGResourcePool.h:49
TGResourcePool::GetDefaultColormap
Colormap_t GetDefaultColormap() const
Definition: TGResourcePool.h:176
TGResourcePool::fCheckeredBitmap
Pixmap_t fCheckeredBitmap
Definition: TGResourcePool.h:84
TGResourcePool::fGrabCursor
Cursor_t fGrabCursor
Definition: TGResourcePool.h:87
TGResourcePool::fDefaultFont
TGFont * fDefaultFont
Definition: TGResourcePool.h:55
TGResourcePool::fMenuFont
TGFont * fMenuFont
Definition: TGResourcePool.h:56
TGResourcePool::fFocusGC
TGGC * fFocusGC
Definition: TGResourcePool.h:76
TGResourcePool::GetMimeTypes
TGMimeTypes * GetMimeTypes() const
Definition: TGResourcePool.h:180
TGPicturePool
Definition: TGPicture.h:100
TGResourcePool::fCheckered
Pixmap_t fCheckered
Definition: TGResourcePool.h:83
TGResourcePool::fBlack
Pixel_t fBlack
Definition: TGResourcePool.h:51
TGResourcePool::GetFrameBckgndPicture
const TGPicture * GetFrameBckgndPicture() const
Definition: TGResourcePool.h:162
TGMimeTypes
Definition: TGMimeTypes.h:50
TGResourcePool::GetDocumentBgndColor
Pixel_t GetDocumentBgndColor() const
Definition: TGResourcePool.h:120
TGResourcePool::fDefaultCursor
Cursor_t fDefaultCursor
Definition: TGResourcePool.h:86
TGResourcePool::GetBlackGC
const TGGC * GetBlackGC() const
Definition: TGResourcePool.h:141
TGResourcePool::fSelForeColor
Pixel_t fSelForeColor
Definition: TGResourcePool.h:45
TGResourcePool::GetPicturePool
TGPicturePool * GetPicturePool() const
Definition: TGResourcePool.h:103
TGResourcePool::fMenuHiFont
TGFont * fMenuHiFont
Definition: TGResourcePool.h:57
TGResourcePool::GetWaitCursor
Cursor_t GetWaitCursor() const
Definition: TGResourcePool.h:172
TGResourcePool::GetIconFont
const TGFont * GetIconFont() const
Definition: TGResourcePool.h:135
TGResourcePool::fMimeTypeList
TGMimeTypes * fMimeTypeList
Definition: TGResourcePool.h:95
TGResourcePool::fDocGC
TGGC * fDocGC
Definition: TGResourcePool.h:77
TGResourcePool::fDocFixedFont
TGFont * fDocFixedFont
Definition: TGResourcePool.h:58
TGGCPool
Definition: TGGC.h:112
TGResourcePool::GetFocusHiliteGC
const TGGC * GetFocusHiliteGC() const
Definition: TGResourcePool.h:147
TGResourcePool::GetDocumentBckgndGC
const TGGC * GetDocumentBckgndGC() const
Definition: TGResourcePool.h:150
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGResourcePool::TGResourcePool
TGResourcePool(TGClient *client)
Create the global GUI resource pool manager.
Definition: TGResourcePool.cxx:60
TGResourcePool::fWhite
Pixel_t fWhite
Definition: TGResourcePool.h:50
TGResourcePool::GetWhiteGC
const TGGC * GetWhiteGC() const
Definition: TGResourcePool.h:140
TGResourcePool::fShadowGC
TGGC * fShadowGC
Definition: TGResourcePool.h:75
TGResourcePool::GetFrameFgndColor
Pixel_t GetFrameFgndColor() const
Definition: TGResourcePool.h:112
TGResourcePool::fHilite
Pixel_t fHilite
Definition: TGResourcePool.h:41
TGResourcePool::fBlackGC
TGGC * fBlackGC
Definition: TGResourcePool.h:71
TGResourcePool::GetFrameBgndColor
Pixel_t GetFrameBgndColor() const
Definition: TGResourcePool.h:113
TGResourcePool::fTextCursor
Cursor_t fTextCursor
Definition: TGResourcePool.h:88
TGResourcePool::fWaitCursor
Cursor_t fWaitCursor
Definition: TGResourcePool.h:89
TGFont
Definition: TGFont.h:149
TGResourcePool::GetFrameShadowGC
const TGGC * GetFrameShadowGC() const
Definition: TGResourcePool.h:146
TGResourcePool::GetStatusFont
const TGFont * GetStatusFont() const
Definition: TGResourcePool.h:136
TGResourcePool::fHighLightColor
Pixel_t fHighLightColor
Definition: TGResourcePool.h:43
TGResourcePool::GetBlackColor
Pixel_t GetBlackColor() const
Definition: TGResourcePool.h:110
TGResourcePool::fDefaultBackPicture
const TGPicture * fDefaultBackPicture
Definition: TGResourcePool.h:65
TGResourcePool::GetSelectedFgndColor
Pixel_t GetSelectedFgndColor() const
Definition: TGResourcePool.h:122
TGClient
Definition: TGClient.h:46
TGResourcePool::fClipboardAtom
Atom_t fClipboardAtom
Definition: TGResourcePool.h:93
TGResourcePool::~TGResourcePool
virtual ~TGResourcePool()
Cleanup the resource pool...
Definition: TGResourcePool.cxx:243
TGResourcePool::GetTipBgndColor
Pixel_t GetTipBgndColor() const
Definition: TGResourcePool.h:126
TGResourcePool::GetClipboard
Atom_t GetClipboard() const
Definition: TGResourcePool.h:182
TGResourcePool::GetFrameShadowColor
Pixel_t GetFrameShadowColor() const
Definition: TGResourcePool.h:115
TGResourcePool::GetFrameGC
const TGGC * GetFrameGC() const
Definition: TGResourcePool.h:143
TGResourcePool::GetMenuFont
const TGFont * GetMenuFont() const
Definition: TGResourcePool.h:131