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 (!w) return;
376  if (gVirtualX->NeedRedraw((ULong_t)w,force)) return;
377  if (force) {
378  w->DoRedraw();
379  return;
380  }
381  w->fNeedRedraw = kTRUE;
383 }
384 
385 ////////////////////////////////////////////////////////////////////////////////
386 
388 {
389  w->fNeedRedraw = kFALSE;
390 }
391 
392 ////////////////////////////////////////////////////////////////////////////////
393 /// Get a color by name. If color is found return kTRUE and pixel is
394 /// set to the color's pixel value, kFALSE otherwise.
395 
396 Bool_t TGClient::GetColorByName(const char *name, Pixel_t &pixel) const
397 {
398  ColorStruct_t color;
399  WindowAttributes_t attributes = WindowAttributes_t();
400  Bool_t status = kTRUE;
401 
402  gVirtualX->GetWindowAttributes(fRoot->GetId(), attributes);
403  color.fPixel = 0;
404  if (!gVirtualX->ParseColor(attributes.fColormap, name, color)) {
405  Error("GetColorByName", "couldn't parse color %s", name);
406  status = kFALSE;
407  } else if (!gVirtualX->AllocColor(attributes.fColormap, color)) {
408  Warning("GetColorByName", "couldn't retrieve color %s.\n"
409  "Please close any other application, like netscape, "
410  "that might exhaust\nthe colormap and start ROOT again", name);
411  status = kFALSE;
412  }
413 
414  pixel = color.fPixel;
415 
416  return status;
417 }
418 
419 ////////////////////////////////////////////////////////////////////////////////
420 /// Get a font by name. If font is not found, fixed font is returned,
421 /// if fixed font also does not exist return 0 and print error.
422 /// The loaded font needs to be freed using TVirtualX::DeleteFont().
423 /// If fixedDefault is false the "fixed" font will not be substituted
424 /// as fallback when the asked for font does not exist.
425 
426 FontStruct_t TGClient::GetFontByName(const char *name, Bool_t fixedDefault) const
427 {
428  if (gROOT->IsBatch())
429  return (FontStruct_t) -1;
430 
431  FontStruct_t font = gVirtualX->LoadQueryFont(name);
432 
433  if (!font && fixedDefault) {
434  font = gVirtualX->LoadQueryFont("fixed");
435  if (font)
436  Warning("GetFontByName", "couldn't retrieve font %s, using \"fixed\"", name);
437  }
438  if (!font) {
439  if (fixedDefault)
440  Error("GetFontByName", "couldn't retrieve font %s nor backup font \"fixed\"", name);
441  else
442  Warning("GetFontByName", "couldn't retrieve font %s", name);
443  }
444 
445  return font;
446 }
447 
448 ////////////////////////////////////////////////////////////////////////////////
449 /// Return pixel value of hilite color based on base_color.
450 
452 {
453  ColorStruct_t color, white_p;
454  WindowAttributes_t attributes = WindowAttributes_t();
455 
456  gVirtualX->GetWindowAttributes(fRoot->GetId(), attributes);
457 
458  color.fPixel = base_color;
459  gVirtualX->QueryColor(attributes.fColormap, color);
460 
461  GetColorByName("white", white_p.fPixel);
462  gVirtualX->QueryColor(attributes.fColormap, white_p);
463 
464  color.fRed = TMath::Max((UShort_t)(white_p.fRed/5), color.fRed);
465  color.fGreen = TMath::Max((UShort_t)(white_p.fGreen/5), color.fGreen);
466  color.fBlue = TMath::Max((UShort_t)(white_p.fBlue/5), color.fBlue);
467 
468  color.fRed = (UShort_t)TMath::Min((Int_t)white_p.fRed, (Int_t)(color.fRed*140)/100);
469  color.fGreen = (UShort_t)TMath::Min((Int_t)white_p.fGreen, (Int_t)(color.fGreen*140)/100);
470  color.fBlue = (UShort_t)TMath::Min((Int_t)white_p.fBlue, (Int_t)(color.fBlue*140)/100);
471 
472  if (!gVirtualX->AllocColor(attributes.fColormap, color))
473  Error("GetHilite", "couldn't allocate hilight color");
474 
475  return color.fPixel;
476 }
477 
478 ////////////////////////////////////////////////////////////////////////////////
479 /// Return pixel value of shadow color based on base_color.
480 /// Shadow is 60% of base_color intensity.
481 
483 {
484  ColorStruct_t color;
485  WindowAttributes_t attributes = WindowAttributes_t();
486 
487  gVirtualX->GetWindowAttributes(fRoot->GetId(), attributes);
488 
489  color.fPixel = base_color;
490  gVirtualX->QueryColor(attributes.fColormap, color);
491 
492  color.fRed = (UShort_t)((color.fRed*60)/100);
493  color.fGreen = (UShort_t)((color.fGreen*60)/100);
494  color.fBlue = (UShort_t)((color.fBlue*60)/100);
495 
496  if (!gVirtualX->AllocColor(attributes.fColormap, color))
497  Error("GetShadow", "couldn't allocate shadow color");
498 
499  return color.fPixel;
500 }
501 
502 ////////////////////////////////////////////////////////////////////////////////
503 /// Free color.
504 
505 void TGClient::FreeColor(Pixel_t color) const
506 {
507  gVirtualX->FreeColor(fDefaultColormap, color);
508 }
509 
510 ////////////////////////////////////////////////////////////////////////////////
511 /// Add a TGWindow to the clients list of windows.
512 
514 {
515  fWlist->Add(w);
516 
517  // Emits signal
518  RegisteredWindow(w->GetId());
519 }
520 
521 ////////////////////////////////////////////////////////////////////////////////
522 /// Remove a TGWindow from the list of windows.
523 
525 {
526  fWlist->Remove(w);
527 }
528 
529 ////////////////////////////////////////////////////////////////////////////////
530 /// Add a popup menu to the list of popups. This list is used to pass
531 /// events to popup menus that are popped up over a transient window which
532 /// is waited for (see WaitFor()).
533 
535 {
536  fPlist->Add(w);
537 
538  // Emits signal
539  RegisteredWindow(w->GetId());
540 }
541 
542 ////////////////////////////////////////////////////////////////////////////////
543 /// Remove a popup menu from the list of popups.
544 
546 {
547  fPlist->Remove(w);
548 }
549 
550 ////////////////////////////////////////////////////////////////////////////////
551 /// Add handler for unknown (i.e. unregistered) windows.
552 
554 {
555  if (!fUWHandlers) {
556  fUWHandlers = new TList;
558  }
559 
560  fUWHandlers->Add(h);
561 }
562 
563 ////////////////////////////////////////////////////////////////////////////////
564 /// Remove handler for unknown (i.e. unregistered) windows.
565 
567 {
568  fUWHandlers->Remove(h);
569 }
570 
571 ////////////////////////////////////////////////////////////////////////////////
572 /// Add handler for idle events.
573 
575 {
576  if (!fIdleHandlers) {
577  fIdleHandlers = new TList;
579  }
580 
581  fIdleHandlers->Add(h);
582 }
583 
584 ////////////////////////////////////////////////////////////////////////////////
585 /// Remove handler for idle events.
586 
588 {
590 }
591 
592 ////////////////////////////////////////////////////////////////////////////////
593 /// Find a TGWindow via its handle. If window is not found return 0.
594 
596 {
597  TGWindow wt(wid);
598 
599  return (TGWindow *) fWlist->FindObject(&wt);
600 }
601 
602 ////////////////////////////////////////////////////////////////////////////////
603 /// Find a TGWindow via its name (unique name used in TGWindow::SavePrimitive).
604 /// If window is not found return 0.
605 
607 {
608  TIter next(fWlist);
609 
610  TObject *obj;
611  while ((obj = next())) {
612  TString n = obj->GetName();
613  if (n == name) {
614  return (TGWindow*)obj;
615  }
616  }
617  return 0;
618 }
619 
620 ////////////////////////////////////////////////////////////////////////////////
621 /// Closing down client: cleanup and close X connection.
622 
624 {
625  if (IsZombie())
626  return;
627 
628  if (fWlist)
629  fWlist->Delete("slow");
630  delete fWlist;
631  delete fPlist;
632  delete fUWHandlers;
633  delete fIdleHandlers;
634  delete fResourcePool;
635 
636  gVirtualX->CloseDisplay(); // this should do a cleanup of the remaining
637  // X allocated objects...
638 }
639 
640 ////////////////////////////////////////////////////////////////////////////////
641 /// Process one event. This method should only be called when there is
642 /// a GUI event ready to be processed. If event has been processed
643 /// kTRUE is returned. If processing of a specific event type for a specific
644 /// window was requested kFALSE is returned when specific event has been
645 /// processed, kTRUE otherwise. If no more pending events return kFALSE.
646 
648 {
649  Event_t event;
650 
651  if (!fRoot) return kFALSE;
652  if (gVirtualX->EventsPending()) {
653  gVirtualX->NextEvent(event);
654  if (fWaitForWindow == kNone) {
655  HandleEvent(&event);
656  if (fForceRedraw)
657  DoRedraw();
658  return kTRUE;
659  } else {
661  if ((event.fType == fWaitForEvent) && (event.fWindow == fWaitForWindow))
663  if (fForceRedraw)
664  DoRedraw();
665  return kTRUE;
666  }
667  }
668 
669  // if nothing else to do redraw windows that need redrawing
670  if (DoRedraw()) return kTRUE;
671 
672  // process one idle event if there is nothing else to do
673  if (ProcessIdleEvent()) return kTRUE;
674 
675  return kFALSE;
676 }
677 
678 ////////////////////////////////////////////////////////////////////////////////
679 /// Process one idle event.
680 
682 {
683  if (fIdleHandlers) {
685  if (ih) {
686  RemoveIdleHandler(ih);
687  ih->HandleEvent();
688  return kTRUE;
689  }
690  }
691  return kFALSE;
692 }
693 
694 ////////////////////////////////////////////////////////////////////////////////
695 /// Handles input from the display server. Returns kTRUE if one or more
696 /// events have been processed, kFALSE otherwise.
697 
699 {
700  Bool_t handledevent = kFALSE;
701 
702  while (ProcessOneEvent())
703  handledevent = kTRUE;
704  return handledevent;
705 }
706 
707 ////////////////////////////////////////////////////////////////////////////////
708 /// Wait for window to be destroyed.
709 
711 {
712  Window_t wsave = fWaitForWindow;
713  EGEventType esave = fWaitForEvent;
714 
715  fWaitForWindow = w->GetId();
717 
718  //Let VirtualX know, that we are
719  //in a nested loop for a window w.
720  //Noop on X11/win32gdk.
721  if (gVirtualX)
722  gVirtualX->BeginModalSessionFor(w->GetId());
723 
724  while (fWaitForWindow != kNone) {
725  if (esave == kUnmapNotify)
726  wsave = kNone;
727  gSystem->ProcessEvents();//gSystem->InnerLoop();
728  gSystem->Sleep(5);
729  }
730 
731  fWaitForWindow = wsave;
732  fWaitForEvent = esave;
733 }
734 
735 ////////////////////////////////////////////////////////////////////////////////
736 /// Wait for window to be unmapped.
737 
739 {
740  Window_t wsave = fWaitForWindow;
741  EGEventType esave = fWaitForEvent;
742 
743  fWaitForWindow = w->GetId();
745 
746  //Let VirtualX know, that we are
747  //in a nested loop for a window w.
748  //Noop on X11/win32gdk.
749  if (gVirtualX)
750  gVirtualX->BeginModalSessionFor(w->GetId());
751 
752  while (fWaitForWindow != kNone) {
753  gSystem->ProcessEvents();//gSystem->InnerLoop();
754  gSystem->Sleep(5);
755  }
756 
757  fWaitForWindow = wsave;
758  fWaitForEvent = esave;
759 }
760 
761 ////////////////////////////////////////////////////////////////////////////////
762 /// reset waiting
763 
765 {
766  if (fWaitForWindow == w->GetId()) fWaitForWindow = kNone;
767 }
768 
769 ////////////////////////////////////////////////////////////////////////////////
770 /// Like gSystem->ProcessEvents() but then only allow events for w to
771 /// be processed. For example to interrupt the processing and destroy
772 /// the window, call gROOT->SetInterrupt() before destroying the window.
773 
775 {
776  Window_t wsave = fWaitForWindow;
777  EGEventType esave = fWaitForEvent;
778 
779  fWaitForWindow = w->GetId();
781 
782  Bool_t intr = gSystem->ProcessEvents();
783 
784  fWaitForWindow = wsave;
785  fWaitForEvent = esave;
786 
787  return intr;
788 }
789 
790 ////////////////////////////////////////////////////////////////////////////////
791 /// Redraw all windows that need redrawing. Returns kFALSE if no redraw
792 /// was needed, kTRUE otherwise.
793 /// Only redraw the application's windows when the event queue
794 /// does not contain expose event anymore.
795 
797 {
798  if (!fGlobalNeedRedraw) return kFALSE;
799 
800  TGWindow *w;
801  TObjLink *lnk = fWlist->FirstLink();
802  while (lnk) {
803  w = (TGWindow *) lnk->GetObject();
804  if (w->fNeedRedraw) {
805  w->DoRedraw();
806  w->fNeedRedraw = kFALSE;
807  }
808  lnk = lnk->Next();
809  }
810 
813 
814  return kTRUE;
815 }
816 
817 ////////////////////////////////////////////////////////////////////////////////
818 /// Handle a GUI event.
819 
821 {
822  TGWindow *w;
823 
824  // Emit signal for event recorder(s)
825  if (event->fType != kConfigureNotify) {
826  ProcessedEvent(event, 0);
827  }
828 
829  // Find window where event happened
830  if ((w = GetWindowById(event->fWindow)) == 0) {
831  if (fUWHandlers && fUWHandlers->GetSize() > 0) {
832  TGUnknownWindowHandler *unkwh;
834  while ((unkwh = (TGUnknownWindowHandler*)it.Next())) {
835  if (unkwh->HandleEvent(event))
836  return kTRUE;
837  }
838  }
839  //Warning("HandleEvent", "unknown window %ld not handled\n",
840  // event->fWindow);
841  return kFALSE;
842  }
843 
844  // and let it handle the event
845  w->HandleEvent(event);
846 
847  return kTRUE;
848 }
849 
850 ////////////////////////////////////////////////////////////////////////////////
851 /// Handle masked events only if window wid is the window for which the
852 /// event was reported or if wid is a parent of the event window. The not
853 /// masked event are handled directly. The masked events are:
854 /// kButtonPress, kButtonRelease, kKeyPress, kKeyRelease, kEnterNotify,
855 /// kLeaveNotify, kMotionNotify.
856 
858 {
859  TGWindow *w, *ptr, *pop;
860 
861  if ((w = GetWindowById(event->fWindow)) == 0) return kFALSE;
862 
863  // Emit signal for event recorder(s)
864  if (event->fType != kConfigureNotify) {
865  ProcessedEvent(event, wid);
866  }
867 
868  // This breaks class member protection, but TGClient is a friend of
869  // TGWindow and _should_ know what to do and what *not* to do...
870 
871  for (ptr = w; ptr->fParent != 0; ptr = (TGWindow *) ptr->fParent) {
872  if ((ptr->fId == wid) ||
873  ((event->fType != kButtonPress) &&
874  (event->fType != kButtonRelease) &&
875  (event->fType != kGKeyPress) &&
876  (event->fType != kKeyRelease) &&
877  (event->fType != kEnterNotify) &&
878  (event->fType != kLeaveNotify) &&
879  (event->fType != kMotionNotify))) {
880  w->HandleEvent(event);
881  return kTRUE;
882  }
883  }
884 
885  // check if this is a popup menu
886  TIter next(fPlist);
887  while ((pop = (TGWindow *) next())) {
888  for (ptr = w; ptr->fParent != 0; ptr = (TGWindow *) ptr->fParent) {
889  if ((ptr->fId == pop->fId) &&
890  ((event->fType == kButtonPress) ||
891  (event->fType == kButtonRelease) ||
892  (event->fType == kGKeyPress) ||
893  (event->fType == kKeyRelease) ||
894  (event->fType == kEnterNotify) ||
895  (event->fType == kLeaveNotify) ||
896  (event->fType == kMotionNotify))) {
897  w->HandleEvent(event);
898  return kTRUE;
899  }
900  }
901  }
902 
903  if (event->fType == kButtonPress || event->fType == kGKeyPress)
904  gVirtualX->Bell(0);
905 
906  return kFALSE;
907 }
908 
909 ////////////////////////////////////////////////////////////////////////////////
910 /// Execute string "cmd" via the interpreter. Before executing replace
911 /// in the command string the token $MSG, $PARM1 and $PARM2 by msg,
912 /// parm1 and parm2, respectively. The function in cmd string must accept
913 /// these as longs.
914 
915 void TGClient::ProcessLine(TString cmd, Long_t msg, Long_t parm1, Long_t parm2)
916 {
917  if (cmd.IsNull()) return;
918 
919  char s[32];
920 
921  snprintf(s, sizeof(s), "%ld", msg);
922  cmd.ReplaceAll("$MSG", s);
923 
924  snprintf(s, sizeof(s), "%ld", parm1);
925  cmd.ReplaceAll("$PARM1", s);
926 
927  snprintf(s, sizeof(s), "%ld", parm2);
928  cmd.ReplaceAll("$PARM2", s);
929 
930  gROOT->ProcessLine(cmd.Data());
931 }
932 
933 ////////////////////////////////////////////////////////////////////////////////
934 /// Returns kTRUE if edit/guibuilding is forbidden.
935 
937 {
938  return (fDefaultRoot->GetEditDisabled() == 1);
939 }
940 
941 ////////////////////////////////////////////////////////////////////////////////
942 /// If on is kTRUE editting/guibuilding is forbidden.
943 
945 {
947 }
948 
949 ////////////////////////////////////////////////////////////////////////////////
950 /// Emits a signal when an event has been processed.
951 /// Used in TRecorder.
952 
954 {
955  Long_t args[2];
956  args[0] = (Long_t) event;
957  args[1] = (Long_t) wid;
958 
959  Emit("ProcessedEvent(Event_t*, Window_t)", args);
960 }
961 
962 ////////////////////////////////////////////////////////////////////////////////
963 /// Emits a signal when a Window has been registered in TGClient.
964 /// Used in TRecorder.
965 
967 {
968  Emit("RegisteredWindow(Window_t)", w);
969 }
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
of event (see EGEventType)
Definition: GuiTypes.h:175
ColorStruct_t::fBlue
UShort_t fBlue
blue component (0..65535)
Definition: GuiTypes.h:314
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:534
TGClient::AddUnknownWindowHandler
void AddUnknownWindowHandler(TGUnknownWindowHandler *h)
Add handler for unknown (i.e. unregistered) windows.
Definition: TGClient.cxx:553
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:513
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:606
ColorStruct_t::fPixel
ULong_t fPixel
color pixel value (index in color table)
Definition: GuiTypes.h:311
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:966
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:915
TMath::Max
Short_t Max(Short_t a, Short_t b)
Definition: TMathBase.h:212
kLeaveNotify
@ kLeaveNotify
Definition: GuiTypes.h:61
TGClient::ProcessEventsFor
Bool_t ProcessEventsFor(TGWindow *w)
Like gSystem->ProcessEvents() but then only allow events for w to be processed.
Definition: TGClient.cxx:774
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:310
TGClient::GetShadow
Pixel_t GetShadow(Pixel_t base_color) const
Return pixel value of shadow color based on base_color.
Definition: TGClient.cxx:482
TString::Data
const char * Data() const
Definition: TString.h:369
Pixel_t
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
TGClient::RemoveUnknownWindowHandler
void RemoveUnknownWindowHandler(TGUnknownWindowHandler *h)
Remove handler for unknown (i.e. unregistered) windows.
Definition: TGClient.cxx:566
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGClient::AddIdleHandler
void AddIdleHandler(TGIdleHandler *h)
Add handler for idle events.
Definition: TGClient.cxx:574
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:545
FontStruct_t
Handle_t FontStruct_t
Pointer to font structure.
Definition: GuiTypes.h:39
TGClient::DoRedraw
Bool_t DoRedraw()
Redraw all windows that need redrawing.
Definition: TGClient.cxx:796
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:587
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:62
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
Graphics context structure.
Definition: GuiTypes.h:224
TGClient::fStyle
UInt_t fStyle
Definition: TGClient.h:76
TGClient::WaitFor
void WaitFor(TGWindow *w)
Wait for window to be destroyed.
Definition: TGClient.cxx:710
kUnmapNotify
@ kUnmapNotify
Definition: GuiTypes.h:62
TGResourcePool::GetFontPool
TGFontPool * GetFontPool() const
Definition: TGResourcePool.h:102
WindowAttributes_t
Window attributes that can be inquired.
Definition: GuiTypes.h:114
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
kEnterNotify
@ kEnterNotify
Definition: GuiTypes.h:61
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:738
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:451
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:62
TGClient::ProcessedEvent
void ProcessedEvent(Event_t *event, Window_t wid)
Emits a signal when an event has been processed.
Definition: TGClient.cxx:953
TString
Basic string class.
Definition: TString.h:136
TGFrame
Definition: TGFrame.h:104
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
Graphics context handle.
Definition: GuiTypes.h:38
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:426
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:1113
TList::First
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:659
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:88
TGClient::SetRoot
void SetRoot(TGWindow *root=nullptr)
Sets the current root (i.e.
Definition: TGClient.cxx:245
TGClient::GetColorByName
Bool_t GetColorByName(const char *name, Pixel_t &pixel) const
Get a color by name.
Definition: TGClient.cxx:396
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:944
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:64
kKeyRelease
@ kKeyRelease
Definition: GuiTypes.h:60
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:60
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:647
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:857
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
green component (0..65535)
Definition: GuiTypes.h:313
TGClient::fWaitForEvent
EGEventType fWaitForEvent
Definition: TGClient.h:74
kButtonPress
@ kButtonPress
Definition: GuiTypes.h:60
TGFrame.h
Long_t
long Long_t
Definition: RtypesCore.h:54
ColorStruct_t::fRed
UShort_t fRed
red component (0..65535)
Definition: GuiTypes.h:312
TGClient::GetWindowById
TGWindow * GetWindowById(Window_t sw) const
Find a TGWindow via its handle. If window is not found return 0.
Definition: TGClient.cxx:595
TGClient::HandleEvent
Bool_t HandleEvent(Event_t *event)
Handle a GUI event.
Definition: TGClient.cxx:820
kButtonRelease
@ kButtonRelease
Definition: GuiTypes.h:60
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:698
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
Window handle.
Definition: GuiTypes.h:29
TGClient::fGlobalNeedRedraw
Bool_t fGlobalNeedRedraw
Definition: TGClient.h:68
kMotionNotify
@ kMotionNotify
Definition: GuiTypes.h:61
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
window reported event is relative to
Definition: GuiTypes.h:176
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:936
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
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:822
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
Event structure.
Definition: GuiTypes.h:174
name
char name[80]
Definition: TGX11.cxx:110
TGClient::ProcessIdleEvent
Bool_t ProcessIdleEvent()
Process one idle event.
Definition: TGClient.cxx:681
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
color map to be associated with window
Definition: GuiTypes.h:128
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:505
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:764
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:387
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:59
TGClient::~TGClient
virtual ~TGClient()
Closing down client: cleanup and close X connection.
Definition: TGClient.cxx:623
TGWindow::fParent
const TGWindow * fParent
Definition: TGWindow.h:36
TList
A doubly linked list.
Definition: TList.h:44
TGClient::TGClient
TGClient(const TGClient &)=delete
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:524
TGClient::FreeGC
void FreeGC(const TGGC *gc)
Free a graphics context.
Definition: TGClient.cxx:329
TSysEvtHandler.h