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