42 class TGUnknownWindowHandler;
46 class TGClient :
public TObject,
public TQObject {
55 Pixel_t fSelBackColor;
56 Pixel_t fSelForeColor;
59 TGWindow *fDefaultRoot;
62 TGResourcePool *fResourcePool;
64 TGFontPool *fFontPool;
65 TGPicturePool *fPicturePool;
66 TGMimeTypes *fMimeTypeList;
67 Colormap_t fDefaultColormap;
68 Bool_t fGlobalNeedRedraw;
74 EGEventType fWaitForEvent;
75 Window_t fWaitForWindow;
78 TGClient(
const TGClient&);
79 TGClient& operator=(
const TGClient&);
81 Bool_t ProcessOneEvent();
82 Bool_t ProcessIdleEvent();
86 TGClient(
const char *dpyName = 0);
89 const TGWindow *GetRoot()
const;
90 const TGWindow *GetDefaultRoot()
const;
91 void SetRoot(TGWindow *root = 0);
92 TGWindow *GetWindowById(Window_t sw)
const;
93 TGWindow *GetWindowByName(
const char *name)
const;
95 UInt_t GetDisplayWidth()
const;
96 UInt_t GetDisplayHeight()
const;
98 Bool_t IsEditable()
const {
return fRoot != fDefaultRoot; }
99 Bool_t IsEditDisabled()
const;
100 void SetEditDisabled(Bool_t on = kTRUE);
102 FontStruct_t GetFontByName(
const char *name, Bool_t fixedDefault = kTRUE)
const;
103 Bool_t GetColorByName(
const char *name, Pixel_t &pixel)
const;
104 Pixel_t GetHilite(Pixel_t base_color)
const;
105 Pixel_t GetShadow(Pixel_t base_color)
const;
106 void FreeColor(Pixel_t color)
const;
107 void ForceRedraw() { fForceRedraw = kTRUE; }
108 void NeedRedraw(TGWindow *w, Bool_t force = kFALSE);
109 void CancelRedraw(TGWindow *w);
110 void RegisterWindow(TGWindow *w);
111 void UnregisterWindow(TGWindow *w);
112 void RegisterPopup(TGWindow *w);
113 void UnregisterPopup(TGWindow *w);
114 void AddUnknownWindowHandler(TGUnknownWindowHandler *h);
115 void RemoveUnknownWindowHandler(TGUnknownWindowHandler *h);
116 void AddIdleHandler(TGIdleHandler *h);
117 void RemoveIdleHandler(TGIdleHandler *h);
118 Bool_t HandleInput();
119 void ProcessLine(TString cmd, Long_t msg, Long_t parm1, Long_t parm2);
120 void WaitFor(TGWindow *w);
121 void WaitForUnmap(TGWindow *w);
122 void ResetWaitFor(TGWindow *w);
123 EGEventType GetWaitForEvent()
const {
return fWaitForEvent;}
124 Window_t GetWaitForWindow()
const {
return fWaitForWindow; }
125 void SetWaitForWindow(Window_t wid) {fWaitForWindow = wid;}
126 Bool_t ProcessEventsFor(TGWindow *w);
128 Bool_t HandleEvent(Event_t *event);
129 Bool_t HandleMaskEvent(Event_t *event, Window_t wid);
130 void RegisteredWindow(Window_t w);
131 void ProcessedEvent(Event_t *event, Window_t wid);
133 const TGResourcePool *GetResourcePool()
const {
return fResourcePool; }
135 TGPicturePool *GetPicturePool()
const {
return fPicturePool; }
136 const TGPicture *GetPicture(
const char *name);
137 const TGPicture *GetPicture(
const char *name, UInt_t new_width, UInt_t new_height);
138 void FreePicture(
const TGPicture *pic);
140 TGGCPool *GetGCPool()
const {
return fGCPool; }
141 TGGC *GetGC(GCValues_t *values, Bool_t rw = kFALSE);
142 void FreeGC(
const TGGC *gc);
143 void FreeGC(GContext_t gc);
145 TGFontPool *GetFontPool()
const {
return fFontPool; }
146 TGFont *GetFont(
const char *font, Bool_t fixedDefault = kTRUE);
147 TGFont *GetFont(
const TGFont *font);
148 void FreeFont(
const TGFont *font);
150 UInt_t GetStyle()
const {
return fStyle; }
151 void SetStyle(UInt_t newstyle) { fStyle = newstyle; }
152 void SetStyle(
const char *style);
154 Colormap_t GetDefaultColormap()
const {
return fDefaultColormap; }
155 TGMimeTypes *GetMimeTypeList()
const {
return fMimeTypeList; }
157 THashList *GetListOfWindows()
const {
return fWlist; }
158 TList *GetListOfPopups()
const {
return fPlist; }
160 static TGClient *Instance();
166 #define gClient (TGClient::Instance())