Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
18class TGClient;
19class TGFontPool;
20class TGFont;
21class TGGCPool;
22class TGGC;
23class TGPicturePool;
24class TGPicture;
25class TGMimeTypes;
26
27
28class TGResourcePool : public TGObject {
29
30private:
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
89public:
90 TGResourcePool(TGClient *client);
91 ~TGResourcePool() override;
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
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
165
166 // Colormaps...
167
169
170 // Miscellaneous...
171
173
175
176 ClassDefOverride(TGResourcePool,0) // Graphics resource pool
177};
178
179#endif
Handle_t Atom_t
WM token.
Definition GuiTypes.h:37
Handle_t Pixmap_t
Pixmap handle.
Definition GuiTypes.h:30
Handle_t Cursor_t
Cursor handle.
Definition GuiTypes.h:34
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
Handle_t Colormap_t
Colormap handle.
Definition GuiTypes.h:33
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Window client.
Definition TGClient.h:37
Provides a pool of fonts.
Definition TGFont.h:217
Encapsulate fonts used in the GUI system.
Definition TGFont.h:140
Encapsulate a graphics context used in the low level graphics.
Definition TGGC.h:22
This class handles mime types, used by browsers to map file types to applications and icons.
Definition TGMimeTypes.h:47
This class is the baseclass for all ROOT GUI widgets.
Definition TGObject.h:21
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
This class implements a pool for the default GUI resource set, like GC's, colors, fonts,...
Cursor_t GetDefaultCursor() const
TGFont * fDocFixedFont
document fixed font
const TGGC * GetFrameHiliteGC() const
TGFont * fDefaultFont
default font
Pixel_t fDocForeColor
default document foreground color
const TGFont * GetMenuFont() const
Pixel_t fForeColor
default foreground color
const TGGC * GetDocumentBckgndGC() const
Colormap_t GetDefaultColormap() const
Pixel_t GetHighLightColor() const
TGGC * fDocGC
document gc
TGGC * fBlackGC
black gc
const TGFont * GetDocumentPropFont() const
const TGGC * GetSelectedGC() const
const TGGC * GetTipGC() const
Pixel_t fTipBackColor
default tip background color
Pixel_t fTipForeColor
default tip foreground color
Cursor_t fWaitCursor
wait cursor
Pixmap_t GetCheckeredBitmap() const
Pixel_t GetSelectedBgndColor() const
Pixel_t GetFrameFgndColor() const
Pixel_t fWhite
white color index
const TGGC * GetDocumentGC() const
const TGGC * GetFrameShadowGC() const
TGFont * fStatusFont
status bar font
TGGC * fHiliteGC
frame hilite gc
TGGC * fShadowGC
frame shadow gc
Pixel_t fHighLightColor
highlight color
const TGPicture * fDefaultBackPicture
default background picture
Pixmap_t GetCheckeredPixmap() const
const TGGC * GetSelectedBckgndGC() const
TGPicturePool * fPicturePool
picture pool manager
Pixel_t fBackColor
default background color
Cursor_t fTextCursor
text cursor
Cursor_t GetTextCursor() const
TGGC * fSelbgndGC
selection background gc
TGFont * fDocPropFont
document proportional font
const TGGC * GetWhiteGC() const
TGGC * fFocusGC
frame focus gc
TGFont * fIconFont
icon font
Pixel_t GetDocumentFgndColor() const
TGFontPool * fFontPool
font pool manager
const TGGC * GetFrameGC() const
TGMimeTypes * fMimeTypeList
list of mime types
Cursor_t fGrabCursor
grab cursor
const TGFont * GetDefaultFont() const
TGGC * fDocbgndGC
document background gc
Pixel_t fDocBackColor
default document background color
Atom_t GetClipboard() const
TGPicturePool * GetPicturePool() const
TGFont * fMenuFont
menu font
Pixel_t GetFrameHiliteColor() const
const TGFont * GetMenuHiliteFont() const
Pixel_t GetTipBgndColor() const
TGGC * fFrameGC
frame gc
Pixmap_t fCheckered
checkered pixmap
Pixel_t GetBlackColor() const
TGFont * fMenuHiFont
menu highlight font
Pixel_t GetWhiteColor() const
const TGFont * GetDocumentFixedFont() const
~TGResourcePool() override
Cleanup the resource pool...
const TGPicture * GetFrameBckgndPicture() const
TGGCPool * fGCPool
graphics drawing context pool manager
Cursor_t GetWaitCursor() const
Cursor_t GetGrabCursor() const
const TGGC * GetBlackGC() const
Pixel_t fBlack
black color index
Atom_t fClipboardAtom
handle to clipboard
Pixel_t fSelForeColor
default selection foreground color
Pixel_t fShadow
default shadow color
Pixmap_t fCheckeredBitmap
checkered bitmap
TGGC * fTipGC
tooltip gc
const TGGC * GetFrameBckgndGC() const
const TGFont * GetIconFont() const
Pixel_t GetDocumentBgndColor() const
Cursor_t fDefaultCursor
default cursor
Colormap_t fDefaultColormap
default colormap
const TGPicture * fDefaultDocBackPicture
default document background picture
TGFontPool * GetFontPool() const
TGGC * fSelGC
selection gc
TGGCPool * GetGCPool() const
TGMimeTypes * GetMimeTypes() const
const TGPicture * GetDocumentBckgndPicture() const
Pixel_t GetSelectedFgndColor() const
const TGFont * GetStatusFont() const
Pixel_t fHilite
default highlight color
Pixel_t fSelBackColor
default selection background color
Pixel_t GetTipFgndColor() const
const TGGC * GetFocusHiliteGC() const
TGGC * fBckgndGC
frame background gc
Pixel_t GetFrameShadowColor() const
TGGC * fWhiteGC
white gc
Pixel_t GetFrameBgndColor() const