Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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; }
103  TGPicturePool *GetPicturePool() const { return fPicturePool; }
104 
105  //--- inline functions:
106 
107  // Color values...
108 
109  Pixel_t GetWhiteColor() const { return fWhite; }
110  Pixel_t GetBlackColor() const { return fBlack; }
111 
112  Pixel_t GetFrameFgndColor() const { return fForeColor; }
113  Pixel_t GetFrameBgndColor() const { return fBackColor; }
114  Pixel_t GetFrameHiliteColor() const { return fHilite; }
115  Pixel_t GetFrameShadowColor() const { return fShadow; }
116 
117  Pixel_t GetHighLightColor() const { return fHighLightColor; }
118 
119  Pixel_t GetDocumentFgndColor() const { return fDocForeColor; }
120  Pixel_t GetDocumentBgndColor() const { return fDocBackColor; }
121 
122  Pixel_t GetSelectedFgndColor() const { return fSelForeColor; }
123  Pixel_t GetSelectedBgndColor() const { return fSelBackColor; }
124 
125  Pixel_t GetTipFgndColor() const { return fTipForeColor; }
126  Pixel_t GetTipBgndColor() const { return fTipBackColor; }
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 
159  Pixmap_t GetCheckeredPixmap() const { return fCheckered; }
160  Pixmap_t GetCheckeredBitmap() const { return fCheckeredBitmap; }
161 
162  const TGPicture *GetFrameBckgndPicture() const
163  { return fDefaultBackPicture; }
164  const TGPicture *GetDocumentBckgndPicture() const
165  { return fDefaultDocBackPicture; }
166 
167  // Cursors...
168 
169  Cursor_t GetDefaultCursor() const { return fDefaultCursor; }
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 
176  Colormap_t GetDefaultColormap() const { return fDefaultColormap; }
177 
178  // Miscellaneous...
179 
180  TGMimeTypes *GetMimeTypes() const { return fMimeTypeList; }
181 
182  Atom_t GetClipboard() const { return fClipboardAtom; }
183 
184  ClassDef(TGResourcePool,0) // Graphics resource pool
185 };
186 
187 #endif