TGResourcePool.h

Go to the documentation of this file.
00001 // @(#)root/gui:$Id: TGResourcePool.h 23115 2008-04-10 13:35:37Z rdm $
00002 // Author: Fons Rademakers   19/5/2003
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2003, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGResourcePool
00013 #define ROOT_TGResourcePool
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 // TGResourcePool                                                       //
00018 //                                                                      //
00019 // This class implements a pool for the default GUI resource set,       //
00020 // like GC's, colors, fonts, etc..                                      //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TGObject
00025 #include "TGObject.h"
00026 #endif
00027 
00028 class TGClient;
00029 class TGFontPool;
00030 class TGFont;
00031 class TGGCPool;
00032 class TGGC;
00033 class TGPicturePool;
00034 class TGPicture;
00035 class TGMimeTypes;
00036 
00037 
00038 class TGResourcePool : public TGObject {
00039 
00040 private:
00041    Pixel_t          fBackColor;        // default background color
00042    Pixel_t          fForeColor;        // default foreground color
00043    Pixel_t          fHilite;           // default hilite color
00044    Pixel_t          fShadow;           // default shadow color
00045    Pixel_t          fSelBackColor;     // default selection background color
00046    Pixel_t          fSelForeColor;     // default selection foreground color
00047    Pixel_t          fDocBackColor;     // default document background color
00048    Pixel_t          fDocForeColor;     // default document foreground color
00049    Pixel_t          fTipBackColor;     // default tip background color
00050    Pixel_t          fTipForeColor;     // default tip foreground color
00051    Pixel_t          fWhite;            // white color index
00052    Pixel_t          fBlack;            // black color index
00053 
00054    TGFontPool      *fFontPool;         // font pool manager
00055 
00056    TGFont          *fDefaultFont;      // default font
00057    TGFont          *fMenuFont;         // menu font
00058    TGFont          *fMenuHiFont;       // menu highlight font
00059    TGFont          *fDocFixedFont;     // document fixed font
00060    TGFont          *fDocPropFont;      // document proportional font
00061    TGFont          *fIconFont;         // icon font
00062    TGFont          *fStatusFont;       // status bar font
00063 
00064    TGPicturePool   *fPicturePool;        // picture pool manager
00065 
00066    const TGPicture *fDefaultBackPicture;    // default background picture
00067    const TGPicture *fDefaultDocBackPicture; // default document background picture
00068 
00069    TGGCPool        *fGCPool;           // graphics drawing context pool manager
00070 
00071    TGGC            *fWhiteGC;          // white gc
00072    TGGC            *fBlackGC;          // black gc
00073    TGGC            *fFrameGC;          // frame gc
00074    TGGC            *fBckgndGC;         // frame background gc
00075    TGGC            *fHiliteGC;         // frame hilite gc
00076    TGGC            *fShadowGC;         // frame shadow gc
00077    TGGC            *fFocusGC;          // frame focus gc
00078    TGGC            *fDocGC;            // document gc
00079    TGGC            *fDocbgndGC;        // document background gc
00080    TGGC            *fSelGC;            // selection gc
00081    TGGC            *fSelbgndGC;        // selection background gc
00082    TGGC            *fTipGC;            // tooltip gc
00083 
00084    Pixmap_t        fCheckered;         // checkered pixmap
00085    Pixmap_t        fCheckeredBitmap;   // checkered bitmap
00086 
00087    Cursor_t        fDefaultCursor;     // default cursor
00088    Cursor_t        fGrabCursor;        // grab cursor
00089    Cursor_t        fTextCursor;        // text cursor
00090    Cursor_t        fWaitCursor;        // wait cursor
00091 
00092    Colormap_t      fDefaultColormap;   // default colormap
00093 
00094    Atom_t          fClipboardAtom;     // handle to clipboard
00095 
00096    TGMimeTypes    *fMimeTypeList;      // list of mime types
00097 
00098 public:
00099    TGResourcePool(TGClient *client);
00100    virtual ~TGResourcePool();
00101 
00102    TGGCPool       *GetGCPool() const { return fGCPool; }
00103    TGFontPool     *GetFontPool() const { return fFontPool; }
00104    TGPicturePool  *GetPicturePool() const { return fPicturePool; }
00105 
00106    //--- inline functions:
00107 
00108    // Color values...
00109 
00110    Pixel_t GetWhiteColor()        const { return fWhite; }
00111    Pixel_t GetBlackColor()        const { return fBlack; }
00112 
00113    Pixel_t GetFrameFgndColor()    const { return fForeColor; }
00114    Pixel_t GetFrameBgndColor()    const { return fBackColor; }
00115    Pixel_t GetFrameHiliteColor()  const { return fHilite; }
00116    Pixel_t GetFrameShadowColor()  const { return fShadow; }
00117 
00118    Pixel_t GetDocumentFgndColor() const { return fDocForeColor; }
00119    Pixel_t GetDocumentBgndColor() const { return fDocBackColor; }
00120 
00121    Pixel_t GetSelectedFgndColor() const { return fSelForeColor; }
00122    Pixel_t GetSelectedBgndColor() const { return fSelBackColor; }
00123 
00124    Pixel_t GetTipFgndColor()      const { return fTipForeColor; }
00125    Pixel_t GetTipBgndColor()      const { return fTipBackColor; }
00126 
00127    // Fonts...
00128 
00129    const TGFont *GetDefaultFont()       const { return fDefaultFont; }
00130    const TGFont *GetMenuFont()          const { return fMenuFont; }
00131    const TGFont *GetMenuHiliteFont()    const { return fMenuHiFont; }
00132    const TGFont *GetDocumentFixedFont() const { return fDocFixedFont; }
00133    const TGFont *GetDocumentPropFont()  const { return fDocPropFont; }
00134    const TGFont *GetIconFont()          const { return fIconFont; }
00135    const TGFont *GetStatusFont()        const { return fStatusFont; }
00136 
00137    // GCs...
00138 
00139    const TGGC *GetWhiteGC()          const { return fWhiteGC; }
00140    const TGGC *GetBlackGC()          const { return fBlackGC; }
00141 
00142    const TGGC *GetFrameGC()          const { return fFrameGC; }
00143    const TGGC *GetFrameBckgndGC()    const { return fBckgndGC; }
00144    const TGGC *GetFrameHiliteGC()    const { return fHiliteGC; }
00145    const TGGC *GetFrameShadowGC()    const { return fShadowGC; }
00146    const TGGC *GetFocusHiliteGC()    const { return fFocusGC; }
00147 
00148    const TGGC *GetDocumentGC()       const { return fDocGC; }
00149    const TGGC *GetDocumentBckgndGC() const { return fDocbgndGC; }
00150 
00151    const TGGC *GetSelectedGC()       const { return fSelGC; }
00152    const TGGC *GetSelectedBckgndGC() const { return fSelbgndGC; }
00153 
00154    const TGGC *GetTipGC()            const { return fTipGC; }
00155 
00156    // Pixmaps...
00157 
00158    Pixmap_t GetCheckeredPixmap() const { return fCheckered; }
00159    Pixmap_t GetCheckeredBitmap() const { return fCheckeredBitmap; }
00160 
00161    const TGPicture *GetFrameBckgndPicture() const
00162          { return fDefaultBackPicture; }
00163    const TGPicture *GetDocumentBckgndPicture() const
00164          { return fDefaultDocBackPicture; }
00165 
00166    // Cursors...
00167 
00168    Cursor_t GetDefaultCursor() const { return fDefaultCursor; }
00169    Cursor_t GetGrabCursor()    const { return fGrabCursor; }
00170    Cursor_t GetTextCursor()    const { return fTextCursor; }
00171    Cursor_t GetWaitCursor()    const { return fWaitCursor; }
00172 
00173    // Colormaps...
00174 
00175    Colormap_t GetDefaultColormap() const { return fDefaultColormap; }
00176 
00177    // Miscellaneous...
00178 
00179    TGMimeTypes *GetMimeTypes() const { return fMimeTypeList; }
00180 
00181    Atom_t       GetClipboard() const { return fClipboardAtom; }
00182 
00183    ClassDef(TGResourcePool,0)  // Graphics resource pool
00184 };
00185 
00186 #endif

Generated on Tue Jul 5 14:20:07 2011 for ROOT_528-00b_version by  doxygen 1.5.1