Logo ROOT   6.12/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 #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
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:33
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:112
TGGCPool * fGCPool
#define ClassDef(name, id)
Definition: Rtypes.h:320
ULong_t Pixel_t
Definition: GuiTypes.h:39
Pixel_t GetDocumentBgndColor() const
Pixel_t GetFrameFgndColor() const
TGFont * fMenuFont
Pixel_t GetSelectedFgndColor() const
Handle_t Atom_t
Definition: GuiTypes.h:36
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:32
Pixel_t GetFrameHiliteColor() const
Cursor_t GetWaitCursor() const
Cursor_t GetDefaultCursor() const
Cursor_t fTextCursor
Definition: TGFont.h:149
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:29
Colormap_t fDefaultColormap
Pixel_t GetWhiteColor() const
const TGFont * GetDocumentFixedFont() const
TGFont * fDocFixedFont
TGFont * fDocPropFont
Cursor_t fWaitCursor
Definition: TGGC.h:31
const TGGC * GetFrameShadowGC() const
Pixel_t fBackColor
const TGGC * GetFrameBckgndGC() const
Colormap_t GetDefaultColormap() const