Logo ROOT   6.16/01
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
26class TGClient;
27class TGFontPool;
28class TGFont;
29class TGGCPool;
30class TGGC;
31class TGPicturePool;
32class TGPicture;
33class TGMimeTypes;
34
35
36class TGResourcePool : public TGObject {
37
38private:
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
97public:
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
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
173
174 // Colormaps...
175
177
178 // Miscellaneous...
179
181
183
184 ClassDef(TGResourcePool,0) // Graphics resource pool
185};
186
187#endif
Handle_t Cursor_t
Definition: GuiTypes.h:33
Handle_t Pixmap_t
Definition: GuiTypes.h:29
Handle_t Colormap_t
Definition: GuiTypes.h:32
Handle_t Atom_t
Definition: GuiTypes.h:36
ULong_t Pixel_t
Definition: GuiTypes.h:39
#define ClassDef(name, id)
Definition: Rtypes.h:324
Definition: TGFont.h:149
Definition: TGGC.h:112
Definition: TGGC.h:31
Cursor_t GetDefaultCursor() const
TGFont * fDocFixedFont
const TGGC * GetFrameHiliteGC() const
TGFont * fDefaultFont
Pixel_t fDocForeColor
const TGFont * GetMenuFont() const
Pixel_t fForeColor
const TGGC * GetDocumentBckgndGC() const
Colormap_t GetDefaultColormap() const
Pixel_t GetHighLightColor() const
const TGFont * GetDocumentPropFont() const
const TGGC * GetSelectedGC() const
const TGGC * GetTipGC() const
Pixel_t fTipBackColor
Pixel_t fTipForeColor
Cursor_t fWaitCursor
Pixmap_t GetCheckeredBitmap() const
Pixel_t GetSelectedBgndColor() const
virtual ~TGResourcePool()
Cleanup the resource pool...
Pixel_t GetFrameFgndColor() const
const TGGC * GetDocumentGC() const
const TGGC * GetFrameShadowGC() const
TGFont * fStatusFont
Pixel_t fHighLightColor
const TGPicture * fDefaultBackPicture
Pixmap_t GetCheckeredPixmap() const
const TGGC * GetSelectedBckgndGC() const
TGPicturePool * fPicturePool
Pixel_t fBackColor
Cursor_t fTextCursor
Cursor_t GetTextCursor() const
TGFont * fDocPropFont
const TGGC * GetWhiteGC() const
TGFont * fIconFont
Pixel_t GetDocumentFgndColor() const
TGFontPool * fFontPool
const TGGC * GetFrameGC() const
TGMimeTypes * fMimeTypeList
Cursor_t fGrabCursor
const TGFont * GetDefaultFont() const
Pixel_t fDocBackColor
Atom_t GetClipboard() const
TGPicturePool * GetPicturePool() const
TGFont * fMenuFont
Pixel_t GetFrameHiliteColor() const
const TGFont * GetMenuHiliteFont() const
Pixel_t GetTipBgndColor() const
Pixmap_t fCheckered
Pixel_t GetBlackColor() const
TGFont * fMenuHiFont
Pixel_t GetWhiteColor() const
const TGFont * GetDocumentFixedFont() const
TGResourcePool(TGClient *client)
Create the global GUI resource pool manager.
const TGPicture * GetFrameBckgndPicture() const
TGGCPool * fGCPool
Cursor_t GetWaitCursor() const
Cursor_t GetGrabCursor() const
const TGGC * GetBlackGC() const
Atom_t fClipboardAtom
Pixel_t fSelForeColor
Pixmap_t fCheckeredBitmap
const TGGC * GetFrameBckgndGC() const
const TGFont * GetIconFont() const
Pixel_t GetDocumentBgndColor() const
Cursor_t fDefaultCursor
Colormap_t fDefaultColormap
const TGPicture * fDefaultDocBackPicture
TGFontPool * GetFontPool() const
TGGCPool * GetGCPool() const
TGMimeTypes * GetMimeTypes() const
const TGPicture * GetDocumentBckgndPicture() const
Pixel_t GetSelectedFgndColor() const
const TGFont * GetStatusFont() const
Pixel_t fSelBackColor
Pixel_t GetTipFgndColor() const
const TGGC * GetFocusHiliteGC() const
Pixel_t GetFrameShadowColor() const
Pixel_t GetFrameBgndColor() const