Logo ROOT  
Reference Guide
TGClient.cxx
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 27/12/97
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, 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 
13  This source is based on Xclass95, a Win95-looking GUI toolkit.
14  Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.
15 
16  Xclass95 is free software; you can redistribute it and/or
17  modify it under the terms of the GNU Library General Public
18  License as published by the Free Software Foundation; either
19  version 2 of the License, or (at your option) any later version.
20 
21 **************************************************************************/
22 
23 //////////////////////////////////////////////////////////////////////////
24 // //
25 // TGClient //
26 // //
27 // Window client. In client server windowing systems, like X11 this //
28 // class is used to make the initial connection to the window server. //
29 // //
30 //////////////////////////////////////////////////////////////////////////
31 
32 #include "RConfigure.h"
33 
34 #include "TGClient.h"
35 #include "TROOT.h"
36 #include "TApplication.h"
37 #include "TSystem.h"
38 #include "TEnv.h"
39 #include "THashList.h"
40 #include "TSysEvtHandler.h"
41 #include "TVirtualX.h"
42 #include "TGWindow.h"
43 #include "TGResourcePool.h"
44 #include "TGGC.h"
45 #include "TGFont.h"
46 #include "TGMimeTypes.h"
47 #include "TGFrame.h"
48 #include "TGIdleHandler.h"
49 #include "TError.h"
50 #include "TGlobal.h"
51 #include "snprintf.h"
52 
53 // Global pointer to the TGClient object
54 static TGClient *gClientGlobal = nullptr;
55 
56 namespace {
57 static struct AddPseudoGlobals {
58 AddPseudoGlobals() {
59  // User "gCling" as synonym for "libCore static initialization has happened".
60  // This code here must not trigger it
61  TGlobalMappedFunction::MakeFunctor("gClient", "TGClient*", TGClient::Instance, [] {
62  TGClient::Instance(); // first ensure object is created;
63  return (void *) &gClientGlobal;
64  });
65 }
66 } gAddPseudoGlobals;
67 }
68 
69 // Initialize gClient in case libGui is loaded in batch mode
71 class TGClientInit {
72 public:
73  TGClientInit() {
74  TROOT *rootlocal = ROOT::Internal::gROOTLocal;
75  if (rootlocal && rootlocal->IsBatch()) {
76  // For now check if the heaeder files (or the module containing them)
77  // has been loaded in Cling.
78  // This is required because the dictionaries must be initialized
79  // __before__ the TGClient creation which will induce the creation
80  // of a TClass object which will need the dictionary for TGClient!
82  new TGClient();
83  }
85  }
86 };
87 static TGClientInit gClientInit;
88 
89 ////////////////////////////////////////////////////////////////////////////////
90 /// Returns global gClient (initialize graphics first, if not already done)
91 
93 {
96  return gClientGlobal;
97 }
98 
99 //----- Graphics Input handler -------------------------------------------------
100 ////////////////////////////////////////////////////////////////////////////////
101 
102 class TGInputHandler : public TFileHandler {
103 private:
104  TGClient *fClient; // connection to display server
105 public:
106  TGInputHandler(TGClient *c, Int_t fd) : TFileHandler(fd, 1) { fClient = c; }
107  Bool_t Notify();
108  // Important: don't override ReadNotify()
109 };
110 
111 ////////////////////////////////////////////////////////////////////////////////
112 /// Notify input from the display server.
113 
114 Bool_t TGInputHandler::Notify()
115 {
116  return fClient->HandleInput();
117 }
118 
119 
121 
122 ////////////////////////////////////////////////////////////////////////////////
123 /// Create a connection with the display sever on host dpyName and setup
124 /// the complete GUI system, i.e., graphics contexts, fonts, etc. for all
125 /// widgets.
126 
127 TGClient::TGClient(const char *dpyName)
128 {
129  fRoot = 0;
130  fPicturePool = 0;
131  fMimeTypeList = 0;
132  fWlist = 0;
133  fPlist = 0;
134  fUWHandlers = 0;
135  fIdleHandlers = 0;
136 
137  if (gClientGlobal) {
138  Error("TGClient", "only one instance of TGClient allowed");
139  MakeZombie();
140  return;
141  }
142 
143  // Set DISPLAY based on utmp (only if DISPLAY is not yet set).
144  gSystem->SetDisplay();
145 
146  // Open the connection to the display
147  if ((fXfd = gVirtualX->OpenDisplay(dpyName)) < 0) {
148  Error("TGClient", "can't open display \"%s\", switching to batch mode...\n In case you run from a remote ssh session, reconnect with ssh -Y",
149  gVirtualX->DisplayName(dpyName));
150  MakeZombie();
151  return;
152  }
153 
154  if (fXfd >= 0 && !ROOT::Internal::gROOTLocal->IsBatch()) {
155  TGInputHandler *xi = new TGInputHandler(this, fXfd);
156  if (fXfd) gSystem->AddFileHandler(xi);
157  // X11 events are handled via gXDisplay->Notify() in
158  // TUnixSystem::DispatchOneEvent(). When no events available we wait for
159  // events on all TFileHandlers including this one via a select() call.
160  // However, X11 events are always handled via gXDisplay->Notify() and not
161  // via the ReadNotify() (therefore TGInputHandler should not override
162  // TFileHandler::ReadNotify()).
163  gXDisplay = xi;
164  }
165 
166  // Initialize internal window list. Use a THashList for fast
167  // finding of windows based on window id (see GetWindowById()).
168 
169  fWlist = new THashList(200);
170  fPlist = new TList;
171 
172  // Create root window
173 
174  fDefaultRoot = fRoot = new TGFrame(this, gVirtualX->GetDefaultRootWindow());
175 
176  // Setup some atoms (defined in TVirtualX)...
177 
178  gWM_DELETE_WINDOW = gVirtualX->InternAtom("WM_DELETE_WINDOW", kFALSE);
179  gMOTIF_WM_HINTS = gVirtualX->InternAtom("_MOTIF_WM_HINTS", kFALSE);
180  gROOT_MESSAGE = gVirtualX->InternAtom("_ROOT_MESSAGE", kFALSE);
181 
182  // Create the graphics event handler, an object for the root window,
183  // a picture pool, mimetype list, etc...
184 
189 
190  fResourcePool = new TGResourcePool(this);
191 
195 
198 
199  // Set some color defaults...
200 
209 
210  fStyle = 0;
211  TString style = gEnv->GetValue("Gui.Style", "modern");
212  if (style.Contains("flat", TString::kIgnoreCase))
213  fStyle = 2;
214  else if (style.Contains("modern", TString::kIgnoreCase))
215  fStyle = 1;
216 
217  gClientGlobal = this;
218 }
219 
220 ////////////////////////////////////////////////////////////////////////////////
221 /// Returns current root (i.e. base) window. By changing the root
222 /// window one can change the window hierarchy, e.g. a top level
223 /// frame (TGMainFrame) can be embedded in another window.
224 
226 {
227  return fRoot;
228 }
229 
230 ////////////////////////////////////////////////////////////////////////////////
231 /// Returns the root (i.e. desktop) window. Should only be used as parent
232 /// for frames that will never be embedded, like popups, message boxes,
233 /// etc. (like TGToolTips, TGMessageBox, etc.).
234 
236 {
237  return fDefaultRoot;
238 }
239 
240 ////////////////////////////////////////////////////////////////////////////////
241 /// Sets the current root (i.e. base) window. By changing the root
242 /// window one can change the window hierarchy, e.g. a top level
243 /// frame (TGMainFrame) can be embedded in another window.
244 
246 {
247  fRoot = root ? root : fDefaultRoot;
248 }
249 
250 ////////////////////////////////////////////////////////////////////////////////
251 /// Set the button style (modern or classic).
252 
253 void TGClient::SetStyle(const char *style)
254 {
255  fStyle = 0;
256  if (style && strstr(style, "modern"))
257  fStyle = 1;
258 }
259 
260 ////////////////////////////////////////////////////////////////////////////////
261 /// Get display width.
262 
264 {
265  Int_t x, y;
266  UInt_t w, h;
267 
268  gVirtualX->GetGeometry(-1, x, y, w, h);
269 
270  return w;
271 }
272 
273 ////////////////////////////////////////////////////////////////////////////////
274 /// Get display height.
275 
277 {
278  Int_t x, y;
279  UInt_t w, h;
280 
281  gVirtualX->GetGeometry(-1, x, y, w, h);
282 
283  return h;
284 }
285 
286 ////////////////////////////////////////////////////////////////////////////////
287 /// Get picture from the picture pool. Picture must be freed using
288 /// TGClient::FreePicture(). If picture is not found 0 is returned.
289 
291 {
292  return fPicturePool->GetPicture(name);
293 }
294 
295 ////////////////////////////////////////////////////////////////////////////////
296 /// Get picture with specified size from pool (picture will be scaled if
297 /// necessary). Picture must be freed using TGClient::FreePicture(). If
298 /// picture is not found 0 is returned.
299 
301  UInt_t new_width, UInt_t new_height)
302 {
303  return fPicturePool->GetPicture(name, new_width, new_height);
304 }
305 
306 ////////////////////////////////////////////////////////////////////////////////
307 /// Free picture resource.
308 
310 {
311  if (pic) fPicturePool->FreePicture(pic);
312 }
313 
314 ////////////////////////////////////////////////////////////////////////////////
315 /// Get graphics context from the gc pool. Context must be freed via
316 /// TGClient::FreeGC(). If rw is true a new read/write-able GC
317 /// is returned, otherwise a shared read-only context is returned.
318 /// For historical reasons it is also possible to create directly a
319 /// TGGC object, but it is advised to use this new interface only.
320 
322 {
323  return fGCPool->GetGC(values, rw);
324 }
325 
326 ////////////////////////////////////////////////////////////////////////////////
327 /// Free a graphics context.
328 
329 void TGClient::FreeGC(const TGGC *gc)
330 {
331  fGCPool->FreeGC(gc);
332 }
333 
334 ////////////////////////////////////////////////////////////////////////////////
335 /// Free a graphics context.
336 
338 {
339  fGCPool->FreeGC(gc);
340 }
341 
342 ////////////////////////////////////////////////////////////////////////////////
343 /// Get a font from the font pool. Fonts must be freed via
344 /// TGClient::FreeFont(). Returns 0 in case of error or if font
345 /// does not exist. If fixedDefault is false the "fixed" font
346 /// will not be substituted as fallback when the asked for font
347 /// does not exist.
348 
349 TGFont *TGClient::GetFont(const char *font, Bool_t fixedDefault)
350 {
351  return fFontPool->GetFont(font, fixedDefault);
352 }
353 
354 ////////////////////////////////////////////////////////////////////////////////
355 /// Get again specified font. Will increase its usage count.
356 
358 {
359  return fFontPool->GetFont(font);
360 }
361 
362 ////////////////////////////////////////////////////////////////////////////////
363 /// Free a font.
364 
365 void TGClient::FreeFont(const TGFont *font)
366 {
367  fFontPool->FreeFont(font);
368 }
369 
370 ////////////////////////////////////////////////////////////////////////////////
371 /// Set redraw flags.
372 
374 {
375  if (gVirtualX->NeedRedraw((ULong_t)w,force)) return;
376  if (force) {
377  w->DoRedraw();
378  return;
379  }
380  w->fNeedRedraw = kTRUE;
382 }
383 
384 ////////////////////////////////////////////////////////////////////////////////
385 
387 {
388  w->fNeedRedraw = kFALSE;
389 }
390 
391 ////////////////////////////////////////////////////////////////////////////////
392 /// Get a color by name. If color is found return kTRUE and pixel is
393 /// set to the color's pixel value, kFALSE otherwise.
394 
395 Bool_t TGClient::GetColorByName(const char *name, Pixel_t &pixel) const
396 {
397  ColorStruct_t color;
398  WindowAttributes_t attributes = WindowAttributes_t();
399  Bool_t status = kTRUE;
400 
401  gVirtualX->GetWindowAttributes(fRoot->GetId(), attributes);
402  color.fPixel = 0;
403  if (!gVirtualX->ParseColor(attributes.fColormap, name, color)) {
404  Error("GetColorByName", "couldn't parse color %s", name);
405  status = kFALSE;
406  } else if (!gVirtualX->AllocColor(attributes.fColormap, color)) {
407  Warning("GetColorByName", "couldn't retrieve color %s.\n"
408  "Please close any other application, like netscape, "
409  "that might exhaust\nthe colormap and start ROOT again", name);
410  status = kFALSE;
411  }
412 
413  pixel = color.fPixel;
414 
415  return status;
416 }
417 
418 ////////////////////////////////////////////////////////////////////////////////
419 /// Get a font by name. If font is not found, fixed font is returned,
420 /// if fixed font also does not exist return 0 and print error.
421 /// The loaded font needs to be freed using TVirtualX::DeleteFont().
422 /// If fixedDefault is false the "fixed" font will not be substituted
423 /// as fallback when the asked for font does not exist.
424 
425 FontStruct_t TGClient::GetFontByName(const char *name, Bool_t fixedDefault) const
426 {
427  if (gROOT->IsBatch())
428  return (FontStruct_t) -1;
429 
430  FontStruct_t font = gVirtualX->LoadQueryFont(name);
431 
432  if (!font && fixedDefault) {
433  font = gVirtualX->LoadQueryFont("fixed");
434  if (font)
435  Warning("GetFontByName", "couldn't retrieve font %s, using \"fixed\"", name);
436  }
437  if (!font) {
438  if (fixedDefault)
439  Error("GetFontByName", "couldn't retrieve font %s nor backup font \"fixed\"", name);
440  else
441  Warning("GetFontByName", "couldn't retrieve font %s", name);
442  }
443 
444  return font;
445 }
446 
447 ////////////////////////////////////////////////////////////////////////////////
448 /// Return pixel value of hilite color based on base_color.
449 
451 {
452  ColorStruct_t color, white_p;
453  WindowAttributes_t attributes = WindowAttributes_t();
454 
455  gVirtualX->GetWindowAttributes(fRoot->GetId(), attributes);
456 
457  color.fPixel = base_color;
458  gVirtualX->QueryColor(attributes.fColormap, color);
459 
460  GetColorByName("white", white_p.fPixel);
461  gVirtualX->QueryColor(attributes.fColormap, white_p);
462 
463  color.fRed = TMath::Max((UShort_t)(white_p.fRed/5), color.fRed);
464  color.fGreen = TMath::Max((UShort_t)(white_p.fGreen/5), color.fGreen);
465  color.fBlue = TMath::Max((UShort_t)(white_p.fBlue/5), color.fBlue);
466 
467  color.fRed = (UShort_t)TMath::Min((Int_t)white_p.fRed, (Int_t)(color.fRed*140)/100);
468  color.fGreen = (UShort_t)TMath::Min((Int_t)white_p.fGreen, (Int_t)(color.fGreen*140)/100);
469  color.fBlue = (UShort_t)TMath::Min((Int_t)white_p.fBlue, (Int_t)(color.fBlue*140)/100);
470 
471  if (!gVirtualX->AllocColor(attributes.fColormap, color))
472  Error("GetHilite", "couldn't allocate hilight color");
473 
474  return color.fPixel;
475 }
476 
477 ////////////////////////////////////////////////////////////////////////////////
478 /// Return pixel value of shadow color based on base_color.
479 /// Shadow is 60% of base_color intensity.
480 
482 {
483  ColorStruct_t color;
484  WindowAttributes_t attributes = WindowAttributes_t();
485 
486  gVirtualX->GetWindowAttributes(fRoot->GetId(), attributes);
487 
488  color.fPixel = base_color;
489  gVirtualX->QueryColor(attributes.fColormap, color);
490 
491  color.fRed = (UShort_t)((color.fRed*60)/100);
492  color.fGreen = (UShort_t)((color.fGreen*60)/100);
493  color.fBlue = (UShort_t)((color.fBlue*60)/100);
494 
495  if (!gVirtualX->AllocColor(attributes.fColormap, color))
496  Error("GetShadow", "couldn't allocate shadow color");
497 
498  return color.fPixel;
499 }
500 
501 ////////////////////////////////////////////////////////////////////////////////
502 /// Free color.
503 
504 void TGClient::FreeColor(Pixel_t color) const
505 {
506  gVirtualX->FreeColor(fDefaultColormap, color);
507 }
508 
509 ////////////////////////////////////////////////////////////////////////////////
510 /// Add a TGWindow to the clients list of windows.
511 
513 {
514  fWlist->Add(w);
515 
516  // Emits signal
517  RegisteredWindow(w->GetId());
518 }
519 
520 ////////////////////////////////////////////////////////////////////////////////
521 /// Remove a TGWindow from the list of windows.
522 
524 {
525  fWlist->Remove(w);
526 }
527 
528 ////////////////////////////////////////////////////////////////////////////////
529 /// Add a popup menu to the list of popups. This list is used to pass
530 /// events to popup menus that are popped up over a transient window which
531 /// is waited for (see WaitFor()).
532 
534 {
535  fPlist->Add(w);
536 
537  // Emits signal
538  RegisteredWindow(w->GetId());
539 }
540 
541 ////////////////////////////////////////////////////////////////////////////////
542 /// Remove a popup menu from the list of popups.
543 
545 {
546  fPlist->Remove(w);
547 }
548 
549 ////////////////////////////////////////////////////////////////////////////////
550 /// Add handler for unknown (i.e. unregistered) windows.
551 
553 {
554  if (!fUWHandlers) {
555  fUWHandlers = new TList;
557  }
558 
559  fUWHandlers->Add(h);
560 }
561 
562 ////////////////////////////////////////////////////////////////////////////////
563 /// Remove handler for unknown (i.e. unregistered) windows.
564 
566 {
567  fUWHandlers->Remove(h);
568 }
569 
570 ////////////////////////////////////////////////////////////////////////////////
571 /// Add handler for idle events.
572 
574 {
575  if (!fIdleHandlers) {
576  fIdleHandlers = new TList;
578  }
579 
580  fIdleHandlers->Add(h);
581 }
582 
583 ////////////////////////////////////////////////////////////////////////////////
584 /// Remove handler for idle events.
585 
587 {
589 }
590 
591 ////////////////////////////////////////////////////////////////////////////////
592 /// Find a TGWindow via its handle. If window is not found return 0.
593 
595 {
596  TGWindow wt(wid);
597 
598  return (TGWindow *) fWlist->FindObject(&wt);
599 }
600 
601 ////////////////////////////////////////////////////////////////////////////////
602 /// Find a TGWindow via its name (unique name used in TGWindow::SavePrimitive).
603 /// If window is not found return 0.
604 
606 {
607  TIter next(fWlist);
608 
609  TObject *obj;
610  while ((obj = next())) {
611  TString n = obj->GetName();
612  if (n == name) {
613  return (TGWindow*)obj;
614  }
615  }
616  return 0;
617 }
618 
619 ////////////////////////////////////////////////////////////////////////////////
620 /// Closing down client: cleanup and close X connection.
621 
623 {
624  if (IsZombie())
625  return;
626 
627  if (fWlist)
628  fWlist->Delete("slow");
629  delete fWlist;
630  delete fPlist;
631  delete fUWHandlers;
632  delete fIdleHandlers;
633  delete fResourcePool;
634 
635  gVirtualX->CloseDisplay(); // this should do a cleanup of the remaining
636  // X allocated objects...
637 }
638 
639 ////////////////////////////////////////////////////////////////////////////////
640 /// Process one event. This method should only be called when there is
641 /// a GUI event ready to be processed. If event has been processed
642 /// kTRUE is returned. If processing of a specific event type for a specific
643 /// window was requested kFALSE is returned when specific event has been
644 /// processed, kTRUE otherwise. If no more pending events return kFALSE.
645 
647 {
648  Event_t event;
649 
650  if (!fRoot) return kFALSE;
651  if (gVirtualX->EventsPending()) {
652  gVirtualX->NextEvent(event);
653  if (fWaitForWindow == kNone) {
654  HandleEvent(&event);
655  if (fForceRedraw)
656  DoRedraw();
657  return kTRUE;
658  } else {
660  if ((event.fType == fWaitForEvent) && (event.fWindow == fWaitForWindow))
662  if (fForceRedraw)
663  DoRedraw();
664  return kTRUE;
665  }
666  }
667 
668  // if nothing else to do redraw windows that need redrawing
669  if (DoRedraw()) return kTRUE;
670 
671  // process one idle event if there is nothing else to do
672  if (ProcessIdleEvent()) return kTRUE;
673 
674  return kFALSE;
675 }
676 
677 ////////////////////////////////////////////////////////////////////////////////
678 /// Process one idle event.
679 
681 {
682  if (fIdleHandlers) {
684  if (ih) {
685  RemoveIdleHandler(ih);
686  ih->HandleEvent();
687  return kTRUE;
688  }
689  }
690  return kFALSE;
691 }
692 
693 ////////////////////////////////////////////////////////////////////////////////
694 /// Handles input from the display server. Returns kTRUE if one or more
695 /// events have been processed, kFALSE otherwise.
696 
698 {
699  Bool_t handledevent = kFALSE;
700 
701  while (ProcessOneEvent())
702  handledevent = kTRUE;
703  return handledevent;
704 }
705 
706 ////////////////////////////////////////////////////////////////////////////////
707 /// Wait for window to be destroyed.
708 
710 {
711  Window_t wsave = fWaitForWindow;
712  EGEventType esave = fWaitForEvent;
713 
714  fWaitForWindow = w->GetId();
716 
717  //Let VirtualX know, that we are
718  //in a nested loop for a window w.
719  //Noop on X11/win32gdk.
720  if (gVirtualX)
721  gVirtualX->BeginModalSessionFor(w->GetId());
722 
723  while (fWaitForWindow != kNone) {
724  if (esave == kUnmapNotify)
725  wsave = kNone;
726  gSystem->ProcessEvents();//gSystem->InnerLoop();
727  gSystem->Sleep(5);
728  }
729 
730  fWaitForWindow = wsave;
731  fWaitForEvent = esave;
732 }
733 
734 ////////////////////////////////////////////////////////////////////////////////
735 /// Wait for window to be unmapped.
736 
738 {
739  Window_t wsave = fWaitForWindow;
740  EGEventType esave = fWaitForEvent;
741 
742  fWaitForWindow = w->GetId();
744 
745  //Let VirtualX know, that we are
746  //in a nested loop for a window w.
747  //Noop on X11/win32gdk.
748  if (gVirtualX)
749  gVirtualX->BeginModalSessionFor(w->GetId());
750 
751  while (fWaitForWindow != kNone) {
752  gSystem->ProcessEvents();//gSystem->InnerLoop();
753  gSystem->Sleep(5);
754  }
755 
756  fWaitForWindow = wsave;
757  fWaitForEvent = esave;
758 }
759 
760 ////////////////////////////////////////////////////////////////////////////////
761 /// reset waiting
762 
764 {
765  if (fWaitForWindow == w->GetId()) fWaitForWindow = kNone;
766 }
767 
768 ////////////////////////////////////////////////////////////////////////////////
769 /// Like gSystem->ProcessEvents() but then only allow events for w to
770 /// be processed. For example to interrupt the processing and destroy
771 /// the window, call gROOT->SetInterrupt() before destroying the window.
772 
774 {
775  Window_t wsave = fWaitForWindow;
776  EGEventType esave = fWaitForEvent;
777 
778  fWaitForWindow = w->GetId();
780 
781  Bool_t intr = gSystem->ProcessEvents();
782 
783  fWaitForWindow = wsave;
784  fWaitForEvent = esave;
785 
786  return intr;
787 }
788 
789 ////////////////////////////////////////////////////////////////////////////////
790 /// Redraw all windows that need redrawing. Returns kFALSE if no redraw
791 /// was needed, kTRUE otherwise.
792 /// Only redraw the application's windows when the event queue
793 /// does not contain expose event anymore.
794 
796 {
797  if (!fGlobalNeedRedraw) return kFALSE;
798 
799  TGWindow *w;
800  TObjLink *lnk = fWlist->FirstLink();
801  while (lnk) {
802  w = (TGWindow *) lnk->GetObject();
803  if (w->fNeedRedraw) {
804  w->DoRedraw();
805  w->fNeedRedraw = kFALSE;
806  }
807  lnk = lnk->Next();
808  }
809 
812 
813  return kTRUE;
814 }
815 
816 ////////////////////////////////////////////////////////////////////////////////
817 /// Handle a GUI event.
818 
820 {
821  TGWindow *w;
822 
823  // Emit signal for event recorder(s)
824  if (event->fType != kConfigureNotify) {
825  ProcessedEvent(event, 0);
826  }
827 
828  // Find window where event happened
829  if ((w = GetWindowById(event->fWindow)) == 0) {
830  if (fUWHandlers && fUWHandlers->GetSize() > 0) {
831  TGUnknownWindowHandler *unkwh;
833  while ((unkwh = (TGUnknownWindowHandler*)it.Next())) {
834  if (unkwh->HandleEvent(event))
835  return kTRUE;
836  }
837  }
838  //Warning("HandleEvent", "unknown window %ld not handled\n",
839  // event->fWindow);
840  return kFALSE;
841  }
842 
843  // and let it handle the event
844  w->HandleEvent(event);
845 
846  return kTRUE;
847 }
848 
849 ////////////////////////////////////////////////////////////////////////////////
850 /// Handle masked events only if window wid is the window for which the
851 /// event was reported or if wid is a parent of the event window. The not
852 /// masked event are handled directly. The masked events are:
853 /// kButtonPress, kButtonRelease, kKeyPress, kKeyRelease, kEnterNotify,
854 /// kLeaveNotify, kMotionNotify.
855 
857 {
858  TGWindow *w, *ptr, *pop;
859 
860  if ((w = GetWindowById(event->fWindow)) == 0) return kFALSE;
861 
862  // Emit signal for event recorder(s)
863  if (event->fType != kConfigureNotify) {
864  ProcessedEvent(event, wid);
865  }
866 
867  // This breaks class member protection, but TGClient is a friend of
868  // TGWindow and _should_ know what to do and what *not* to do...
869 
870  for (ptr = w; ptr->fParent != 0; ptr = (TGWindow *) ptr->fParent) {
871  if ((ptr->fId == wid) ||
872  ((event->fType != kButtonPress) &&
873  (event->fType != kButtonRelease) &&
874  (event->fType != kGKeyPress) &&
875  (event->fType != kKeyRelease) &&
876  (event->fType != kEnterNotify) &&
877  (event->fType != kLeaveNotify) &&
878  (event->fType != kMotionNotify))) {
879  w->HandleEvent(event);
880  return kTRUE;
881  }
882  }
883 
884  // check if this is a popup menu
885  TIter next(fPlist);
886  while ((pop = (TGWindow *) next())) {
887  for (ptr = w; ptr->fParent != 0; ptr = (TGWindow *) ptr->fParent) {
888  if ((ptr->fId == pop->fId) &&
889  ((event->fType == kButtonPress) ||
890  (event->fType == kButtonRelease) ||
891  (event->fType == kGKeyPress) ||
892  (event->fType == kKeyRelease) ||
893  (event->fType == kEnterNotify) ||
894  (event->fType == kLeaveNotify) ||
895  (event->fType == kMotionNotify))) {
896  w->HandleEvent(event);
897  return kTRUE;
898  }
899  }
900  }
901 
902  if (event->fType == kButtonPress || event->fType == kGKeyPress)
903  gVirtualX->Bell(0);
904 
905  return kFALSE;
906 }
907 
908 ////////////////////////////////////////////////////////////////////////////////
909 /// Execute string "cmd" via the interpreter. Before executing replace
910 /// in the command string the token $MSG, $PARM1 and $PARM2 by msg,
911 /// parm1 and parm2, respectively. The function in cmd string must accept
912 /// these as longs.
913 
914 void TGClient::ProcessLine(TString cmd, Long_t msg, Long_t parm1, Long_t parm2)
915 {
916  if (cmd.IsNull()) return;
917 
918  char s[32];
919 
920  snprintf(s, sizeof(s), "%ld", msg);
921  cmd.ReplaceAll("$MSG", s);
922 
923  snprintf(s, sizeof(s), "%ld", parm1);
924  cmd.ReplaceAll("$PARM1", s);
925 
926  snprintf(s, sizeof(s), "%ld", parm2);
927  cmd.ReplaceAll("$PARM2", s);
928 
929  gROOT->ProcessLine(cmd.Data());
930 }
931 
932 ////////////////////////////////////////////////////////////////////////////////
933 /// Returns kTRUE if edit/guibuilding is forbidden.
934 
936 {
937  return (fDefaultRoot->GetEditDisabled() == 1);
938 }
939 
940 ////////////////////////////////////////////////////////////////////////////////
941 /// If on is kTRUE editting/guibuilding is forbidden.
942 
944 {
946 }
947 
948 ////////////////////////////////////////////////////////////////////////////////
949 /// Emits a signal when an event has been processed.
950 /// Used in TRecorder.
951 
953 {
954  Long_t args[2];
955  args[0] = (Long_t) event;
956  args[1] = (Long_t) wid;
957 
958  Emit("ProcessedEvent(Event_t*, Window_t)", args);
959 }
960 
961 ////////////////////////////////////////////////////////////////////////////////
962 /// Emits a signal when a Window has been registered in TGClient.
963 /// Used in TRecorder.
964 
966 {
967  Emit("RegisteredWindow(Window_t)", w);
968 }
TGClient::fMimeTypeList
TGMimeTypes * fMimeTypeList
Definition: TGClient.h:66
TGWindow::fNeedRedraw
Bool_t fNeedRedraw
Definition: TGWindow.h:37
c
#define c(i)
Definition: RSha256.hxx:101
TGClient::fXfd
Int_t fXfd
Definition: TGClient.h:61
gClientInit
static TGClientInit gClientInit
Definition: TGClient.cxx:87
Event_t::fType
EGEventType fType
Definition: GuiTypes.h:174
ColorStruct_t::fBlue
UShort_t fBlue
Definition: GuiTypes.h:313
TGClient::GetDefaultRoot
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:235
TGClient::RegisterPopup
void RegisterPopup(TGWindow *w)
Add a popup menu to the list of popups.
Definition: TGClient.cxx:533
TGClient::AddUnknownWindowHandler
void AddUnknownWindowHandler(TGUnknownWindowHandler *h)
Add handler for unknown (i.e. unregistered) windows.
Definition: TGClient.cxx:552
n
const Int_t n
Definition: legend1.C:16
TGClient::FreeFont
void FreeFont(const TGFont *font)
Free a font.
Definition: TGClient.cxx:365
TGClient::fDefaultRoot
TGWindow * fDefaultRoot
Definition: TGClient.h:59
TGClient::fForeColor
Pixel_t fForeColor
Definition: TGClient.h:52
TGFontPool::GetFont
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get the specified font.
Definition: TGFont.cxx:1545
gMOTIF_WM_HINTS
R__EXTERN Atom_t gMOTIF_WM_HINTS
Definition: TVirtualX.h:39
TGWindow
Definition: TGWindow.h:31
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TGClient::GetDisplayWidth
UInt_t GetDisplayWidth() const
Get display width.
Definition: TGClient.cxx:263
TGClient::RegisterWindow
void RegisterWindow(TGWindow *w)
Add a TGWindow to the clients list of windows.
Definition: TGClient.cxx:512
TGClient::fWlist
THashList * fWlist
Definition: TGClient.h:70
TGClient::GetWindowByName
TGWindow * GetWindowByName(const char *name) const
Find a TGWindow via its name (unique name used in TGWindow::SavePrimitive).
Definition: TGClient.cxx:605
ColorStruct_t::fPixel
ULong_t fPixel
Definition: GuiTypes.h:310
snprintf
#define snprintf
Definition: civetweb.c:1540
TGClient::RegisteredWindow
void RegisteredWindow(Window_t w)
Emits a signal when a Window has been registered in TGClient.
Definition: TGClient.cxx:965
TGPicture
Definition: TGPicture.h:36
TGClient::fPlist
TList * fPlist
Definition: TGClient.h:71
TGIdleHandler.h
TGResourcePool::GetGCPool
TGGCPool * GetGCPool() const
Definition: TGResourcePool.h:101
TGClient::ProcessLine
void ProcessLine(TString cmd, Long_t msg, Long_t parm1, Long_t parm2)
Execute string "cmd" via the interpreter.
Definition: TGClient.cxx:914
TMath::Max
Short_t Max(Short_t a, Short_t b)
Definition: TMathBase.h:212
kLeaveNotify
@ kLeaveNotify
Definition: GuiTypes.h:60
TGClient::ProcessEventsFor
Bool_t ProcessEventsFor(TGWindow *w)
Like gSystem->ProcessEvents() but then only allow events for w to be processed.
Definition: TGClient.cxx:773
TGIdleHandler
Definition: TGIdleHandler.h:29
TGClient::fUWHandlers
TList * fUWHandlers
Definition: TGClient.h:72
TGClient::fPicturePool
TGPicturePool * fPicturePool
Definition: TGClient.h:65
UShort_t
unsigned short UShort_t
Definition: RtypesCore.h:40
gEnv
R__EXTERN TEnv * gEnv
Definition: TEnv.h:171
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
ColorStruct_t
Definition: GuiTypes.h:309
TGClient::GetShadow
Pixel_t GetShadow(Pixel_t base_color) const
Return pixel value of shadow color based on base_color.
Definition: TGClient.cxx:481
TString::Data
const char * Data() const
Definition: TString.h:369
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
TGClient::RemoveUnknownWindowHandler
void RemoveUnknownWindowHandler(TGUnknownWindowHandler *h)
Remove handler for unknown (i.e. unregistered) windows.
Definition: TGClient.cxx:565
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGClient::AddIdleHandler
void AddIdleHandler(TGIdleHandler *h)
Add handler for idle events.
Definition: TGClient.cxx:573
TriggerDictionaryInitialization_libGui
void TriggerDictionaryInitialization_libGui()
TGFontPool::FreeFont
void FreeFont(const TGFont *font)
Free font. If ref count is 0 delete font.
Definition: TGFont.cxx:1705
TGClient::UnregisterPopup
void UnregisterPopup(TGWindow *w)
Remove a popup menu from the list of popups.
Definition: TGClient.cxx:544
FontStruct_t
Handle_t FontStruct_t
Definition: GuiTypes.h:38
TGClient::DoRedraw
Bool_t DoRedraw()
Redraw all windows that need redrawing.
Definition: TGClient.cxx:795
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:890
TGClient::RemoveIdleHandler
void RemoveIdleHandler(TGIdleHandler *h)
Remove handler for idle events.
Definition: TGClient.cxx:586
TGResourcePool::GetSelectedBgndColor
Pixel_t GetSelectedBgndColor() const
Definition: TGResourcePool.h:123
TString::kIgnoreCase
@ kIgnoreCase
Definition: TString.h:268
TGClient::fShadow
Pixel_t fShadow
Definition: TGClient.h:54
kConfigureNotify
@ kConfigureNotify
Definition: GuiTypes.h:61
TApplication::InitializeGraphics
void InitializeGraphics()
Initialize the graphics environment.
Definition: TApplication.cxx:260
TCollection::SetOwner
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
Definition: TCollection.cxx:746
GCValues_t
Definition: GuiTypes.h:223
TGClient::fStyle
UInt_t fStyle
Definition: TGClient.h:76
TGClient::WaitFor
void WaitFor(TGWindow *w)
Wait for window to be destroyed.
Definition: TGClient.cxx:709
kUnmapNotify
@ kUnmapNotify
Definition: GuiTypes.h:61
TGResourcePool::GetFontPool
TGFontPool * GetFontPool() const
Definition: TGResourcePool.h:102
WindowAttributes_t
Definition: GuiTypes.h:113
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
Int_t
int Int_t
Definition: RtypesCore.h:45
TGClient::fFontPool
TGFontPool * fFontPool
Definition: TGClient.h:64
TGClient::SetRoot
void SetRoot(TGWindow *root=0)
Sets the current root (i.e.
Definition: TGClient.cxx:245
kEnterNotify
@ kEnterNotify
Definition: GuiTypes.h:60
x
Double_t x[n]
Definition: legend1.C:17
TGMimeTypes.h
TGClient::WaitForUnmap
void WaitForUnmap(TGWindow *w)
Wait for window to be unmapped.
Definition: TGClient.cxx:737
TEnv::GetValue
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition: TEnv.cxx:491
TGClient::GetHilite
Pixel_t GetHilite(Pixel_t base_color) const
Return pixel value of hilite color based on base_color.
Definition: TGClient.cxx:450
TVirtualX.h
TGClient::FreePicture
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition: TGClient.cxx:309
TGWindow::GetEditDisabled
virtual UInt_t GetEditDisabled() const
Definition: TGWindow.h:113
TGClient::fSelBackColor
Pixel_t fSelBackColor
Definition: TGClient.h:55
TGClient::fDefaultColormap
Colormap_t fDefaultColormap
Definition: TGClient.h:67
TEnv.h
kDestroyNotify
@ kDestroyNotify
Definition: GuiTypes.h:61
TGClient::ProcessedEvent
void ProcessedEvent(Event_t *event, Window_t wid)
Emits a signal when an event has been processed.
Definition: TGClient.cxx:952
TString
Basic string class.
Definition: TString.h:136
TGFrame
Definition: TGFrame.h:105
TGClient::fResourcePool
TGResourcePool * fResourcePool
Definition: TGClient.h:62
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TGObject::GetId
Handle_t GetId() const
Definition: TGObject.h:47
TGWindow.h
TGGCPool::GetGC
TGGC * GetGC(GCValues_t *values, Bool_t rw=kFALSE)
Get the best matching graphics context depending on values.
Definition: TGGC.cxx:986
TGResourcePool
Definition: TGResourcePool.h:36
bool
TGResourcePool::GetWhiteColor
Pixel_t GetWhiteColor() const
Definition: TGResourcePool.h:109
TGClient::fWaitForWindow
Window_t fWaitForWindow
Definition: TGClient.h:75
TString::ReplaceAll
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
TROOT
ROOT top level object description.
Definition: TROOT.h:94
TListIter
Iterator of linked list.
Definition: TList.h:200
TGGCPool::FreeGC
void FreeGC(const TGGC *gc)
Delete graphics context if it is not used anymore.
Definition: TGGC.cxx:917
TROOT.h
GContext_t
Handle_t GContext_t
Definition: GuiTypes.h:37
TGWindow::DoRedraw
virtual void DoRedraw()
Definition: TGWindow.h:53
TGClient::GetFontByName
FontStruct_t GetFontByName(const char *name, Bool_t fixedDefault=kTRUE) const
Get a font by name.
Definition: TGClient.cxx:425
TApplication.h
style
TCanvas * style()
Definition: style.C:1
TListIter::Next
TObject * Next()
Return next object in the list. Returns 0 when no more objects in list.
Definition: TList.cxx:1112
TList::First
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:658
TObject::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:359
gXDisplay
R__EXTERN TFileHandler * gXDisplay
Definition: TSystem.h:560
kNone
const Handle_t kNone
Definition: GuiTypes.h:87
TGClient::GetColorByName
Bool_t GetColorByName(const char *name, Pixel_t &pixel) const
Get a color by name.
Definition: TGClient.cxx:395
TGPicturePool::GetPicture
const TGPicture * GetPicture(const char *name)
Get a picture from the picture pool.
Definition: TGPicture.cxx:80
TGClient::SetEditDisabled
void SetEditDisabled(Bool_t on=kTRUE)
If on is kTRUE editting/guibuilding is forbidden.
Definition: TGClient.cxx:943
TGClient::fIdleHandlers
TList * fIdleHandlers
Definition: TGClient.h:73
TList::FirstLink
virtual TObjLink * FirstLink() const
Definition: TList.h:108
TSystem.h
kOtherEvent
@ kOtherEvent
Definition: GuiTypes.h:63
kKeyRelease
@ kKeyRelease
Definition: GuiTypes.h:59
TGClient::GetDisplayHeight
UInt_t GetDisplayHeight() const
Get display height.
Definition: TGClient.cxx:276
TGlobalMappedFunction::MakeFunctor
static void MakeFunctor(const char *name, const char *type, GlobFunc &func)
Definition: TGlobal.h:73
THashList
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Definition: THashList.h:34
h
#define h(i)
Definition: RSha256.hxx:106
kGKeyPress
@ kGKeyPress
Definition: GuiTypes.h:59
TGClient::fBackColor
Pixel_t fBackColor
Definition: TGClient.h:51
TGClient::fGCPool
TGGCPool * fGCPool
Definition: TGClient.h:63
TGGC
Definition: TGGC.h:31
TGClient::ProcessOneEvent
Bool_t ProcessOneEvent()
Process one event.
Definition: TGClient.cxx:646
THashList::FindObject
TObject * FindObject(const char *name) const
Find object using its name.
Definition: THashList.cxx:262
TGGC.h
gWM_DELETE_WINDOW
R__EXTERN Atom_t gWM_DELETE_WINDOW
Definition: TVirtualX.h:38
TGObject::fId
Handle_t fId
Definition: TGObject.h:36
TGClient::HandleMaskEvent
Bool_t HandleMaskEvent(Event_t *event, Window_t wid)
Handle masked events only if window wid is the window for which the event was reported or if wid is a...
Definition: TGClient.cxx:856
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGResourcePool::GetDefaultColormap
Colormap_t GetDefaultColormap() const
Definition: TGResourcePool.h:176
ColorStruct_t::fGreen
UShort_t fGreen
Definition: GuiTypes.h:312
TGClient::fWaitForEvent
EGEventType fWaitForEvent
Definition: TGClient.h:74
kButtonPress
@ kButtonPress
Definition: GuiTypes.h:59
TGFrame.h
Long_t
long Long_t
Definition: RtypesCore.h:54
ColorStruct_t::fRed
UShort_t fRed
Definition: GuiTypes.h:311
TGClient::GetWindowById
TGWindow * GetWindowById(Window_t sw) const
Find a TGWindow via its handle. If window is not found return 0.
Definition: TGClient.cxx:594
TGClient::HandleEvent
Bool_t HandleEvent(Event_t *event)
Handle a GUI event.
Definition: TGClient.cxx:819
kButtonRelease
@ kButtonRelease
Definition: GuiTypes.h:59
TGClient::fWhite
Pixel_t fWhite
Definition: TGClient.h:57
TGResourcePool::GetMimeTypes
TGMimeTypes * GetMimeTypes() const
Definition: TGResourcePool.h:180
TGClient::HandleInput
Bool_t HandleInput()
Handles input from the display server.
Definition: TGClient.cxx:697
gClientGlobal
static TGClient * gClientGlobal
Definition: TGClient.cxx:54
TGClient::fSelForeColor
Pixel_t fSelForeColor
Definition: TGClient.h:56
gApplication
R__EXTERN TApplication * gApplication
Definition: TApplication.h:166
TGClient::GetPicture
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:290
TGlobal.h
TGIdleHandler::HandleEvent
virtual Bool_t HandleEvent()
Handle the idle event.
Definition: TGIdleHandler.cxx:53
Window_t
Handle_t Window_t
Definition: GuiTypes.h:28
TGClient::fGlobalNeedRedraw
Bool_t fGlobalNeedRedraw
Definition: TGClient.h:68
kMotionNotify
@ kMotionNotify
Definition: GuiTypes.h:60
TGClient::fRoot
TGWindow * fRoot
Definition: TGClient.h:60
y
Double_t y[n]
Definition: legend1.C:17
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
TObject::MakeZombie
void MakeZombie()
Definition: TObject.h:49
ROOT::Internal::gROOTLocal
R__EXTERN TROOT * gROOTLocal
Definition: TROOT.h:379
TSystem::Sleep
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
Definition: TSystem.cxx:438
TGClient.h
THashList::Remove
TObject * Remove(TObject *obj)
Remove object from the list.
Definition: THashList.cxx:378
gROOT_MESSAGE
R__EXTERN Atom_t gROOT_MESSAGE
Definition: TVirtualX.h:40
TObject::Warning
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:876
Event_t::fWindow
Window_t fWindow
Definition: GuiTypes.h:175
TMath::Min
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:180
unsigned int
TGClient::SetStyle
void SetStyle(UInt_t newstyle)
Definition: TGClient.h:151
THashList.h
THashList::Delete
void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition: THashList.cxx:207
TObject::IsZombie
R__ALWAYS_INLINE Bool_t IsZombie() const
Definition: TObject.h:134
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TGResourcePool::GetPicturePool
TGPicturePool * GetPicturePool() const
Definition: TGResourcePool.h:103
TGWindow::HandleEvent
virtual Bool_t HandleEvent(Event_t *)
Definition: TGWindow.h:104
TGClient::fBlack
Pixel_t fBlack
Definition: TGClient.h:58
TGClient::IsEditDisabled
Bool_t IsEditDisabled() const
Returns kTRUE if edit/guibuilding is forbidden.
Definition: TGClient.cxx:935
TGClient::GetGC
TGGC * GetGC(GCValues_t *values, Bool_t rw=kFALSE)
Get graphics context from the gc pool.
Definition: TGClient.cxx:321
TGClient::NeedRedraw
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:373
TString::IsNull
Bool_t IsNull() const
Definition: TString.h:407
TGClient::TGClient
TGClient(const TGClient &)
TApplication::NeedGraphicsLibs
static void NeedGraphicsLibs()
Static method.
Definition: TApplication.cxx:252
TROOT::IsBatch
Bool_t IsBatch() const
Definition: TROOT.h:280
TGClient::fHilite
Pixel_t fHilite
Definition: TGClient.h:53
TList::Remove
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:821
TCollection::GetSize
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
TSystem::AddFileHandler
virtual void AddFileHandler(TFileHandler *fh)
Add a file handler to the list of system file handlers.
Definition: TSystem.cxx:555
TList::Add
virtual void Add(TObject *obj)
Definition: TList.h:87
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TGWindow::SetEditDisabled
virtual void SetEditDisabled(UInt_t on=kEditDisable)
Definition: TGWindow.h:114
Event_t
Definition: GuiTypes.h:173
name
char name[80]
Definition: TGX11.cxx:110
TGClient::ProcessIdleEvent
Bool_t ProcessIdleEvent()
Process one idle event.
Definition: TGClient.cxx:680
TFileHandler
Definition: TSysEvtHandler.h:65
TGClient::GetFont
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get a font from the font pool.
Definition: TGClient.cxx:349
WindowAttributes_t::fColormap
Colormap_t fColormap
Definition: GuiTypes.h:127
TIter
Definition: TCollection.h:233
TGResourcePool::GetFrameFgndColor
Pixel_t GetFrameFgndColor() const
Definition: TGResourcePool.h:112
TGClient::fForceRedraw
Bool_t fForceRedraw
Definition: TGClient.h:69
TGUnknownWindowHandler::HandleEvent
virtual Bool_t HandleEvent(Event_t *)=0
TGClient::FreeColor
void FreeColor(Pixel_t color) const
Free color.
Definition: TGClient.cxx:504
TGResourcePool.h
TGUnknownWindowHandler
Definition: TGWindow.h:142
TGResourcePool::GetFrameBgndColor
Pixel_t GetFrameBgndColor() const
Definition: TGResourcePool.h:113
TGFont
Definition: TGFont.h:149
TGClient::Instance
static TGClient * Instance()
Returns global gClient (initialize graphics first, if not already done)
Definition: TGClient.cxx:92
TGClient::ResetWaitFor
void ResetWaitFor(TGWindow *w)
reset waiting
Definition: TGClient.cxx:763
TSystem::SetDisplay
virtual void SetDisplay()
Set DISPLAY environment variable based on utmp entry. Only for UNIX.
Definition: TSystem.cxx:232
TGResourcePool::GetBlackColor
Pixel_t GetBlackColor() const
Definition: TGResourcePool.h:110
TGClient::GetRoot
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition: TGClient.cxx:225
TGPicturePool::FreePicture
void FreePicture(const TGPicture *pic)
Remove picture from cache if nobody is using it anymore.
Definition: TGPicture.cxx:275
TGClient::CancelRedraw
void CancelRedraw(TGWindow *w)
Definition: TGClient.cxx:386
TGResourcePool::GetSelectedFgndColor
Pixel_t GetSelectedFgndColor() const
Definition: TGResourcePool.h:122
TGClient
Definition: TGClient.h:46
TSystem::ProcessEvents
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition: TSystem.cxx:417
EGEventType
EGEventType
Definition: GuiTypes.h:58
TGClient::~TGClient
virtual ~TGClient()
Closing down client: cleanup and close X connection.
Definition: TGClient.cxx:622
TGWindow::fParent
const TGWindow * fParent
Definition: TGWindow.h:36
TList
A doubly linked list.
Definition: TList.h:44
TGFont.h
TQObject::Emit
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
gROOT
#define gROOT
Definition: TROOT.h:406
int
TError.h
TFileHandler::Notify
virtual Bool_t Notify()
Notify when event occurred on descriptor associated with this handler.
Definition: TSysEvtHandler.cxx:71
TGClient::UnregisterWindow
void UnregisterWindow(TGWindow *w)
Remove a TGWindow from the list of windows.
Definition: TGClient.cxx:523
TGClient::FreeGC
void FreeGC(const TGGC *gc)
Free a graphics context.
Definition: TGClient.cxx:329
TSysEvtHandler.h