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