Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
GX11Gui.cxx
Go to the documentation of this file.
1// @(#)root/x11:$Id$
2// Author: Fons Rademakers 28/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// This file contains the implementation of the GUI methods of the
13// TGX11 class. Most of the methods are used by the machine independent
14// GUI classes (libGUI.so).
15
16#include <cstdio>
17#include <cstring>
18#include <cstdlib>
19#include <cctype>
20#include <climits>
21#include <unistd.h>
22
23#include <X11/Xlib.h>
24#include <X11/Xutil.h>
25#include <X11/Xatom.h>
26#include <X11/cursorfont.h>
27#include <X11/keysym.h>
28#include <X11/xpm.h>
29
30#include "TGX11.h"
31#include "TROOT.h"
32#include "TError.h"
33#include "TSystem.h"
34#include "TException.h"
35#include "TClassTable.h"
36#include "KeySymbols.h"
37#include "TEnv.h"
38
40
41//---- MWM Hints stuff
42
49
50//---- hints
51
55
58
59
60//---- Key symbol mapping
61
66
67//---- Mapping table of all non-trivial mappings (the ASCII keys map
68//---- one to one so are not included)
69
70static KeySymbolMap_t gKeyMap[] = {
72 { XK_Tab, kKey_Tab },
73#ifndef XK_ISO_Left_Tab
74 { 0xFE20, kKey_Backtab },
75#else
77#endif
85 { 0x1005FF60, kKey_SysReq }, // hardcoded Sun SysReq
86 { 0x1007ff00, kKey_SysReq }, // hardcoded X386 SysReq
87 { XK_Home, kKey_Home }, // cursor movement
88 { XK_End, kKey_End },
89 { XK_Left, kKey_Left },
90 { XK_Up, kKey_Up },
92 { XK_Down, kKey_Down },
94 { XK_Next, kKey_Next },
95 { XK_Shift_L, kKey_Shift }, // modifiers
100 { XK_Meta_L, kKey_Meta },
101 { XK_Meta_R, kKey_Meta },
102 { XK_Alt_L, kKey_Alt },
103 { XK_Alt_R, kKey_Alt },
107 { XK_KP_Space, kKey_Space }, // numeric keypad
108 { XK_KP_Tab, kKey_Tab },
110 { XK_KP_F1, kKey_F1 },
111 { XK_KP_F2, kKey_F2 },
112 { XK_KP_F3, kKey_F3 },
113 { XK_KP_F4, kKey_F4 },
116 { XK_KP_Up, kKey_Up },
123 { XK_KP_End, kKey_End },
129 { XK_KP_Add, kKey_Plus },
134 { 0, (EKeySym) 0 }
135};
136
142
143////////////////////////////////////////////////////////////////////////////////
144
146{
147 union { Long_t l; Int_t i[2]; } conv;
148
149 conv.l = ll;
150 i1 = conv.i[0];
151 i2 = conv.i[1];
152}
153
154////////////////////////////////////////////////////////////////////////////////
155
157{
158 union { Long_t l; Int_t i[2]; } conv;
159
160 conv.i[0] = (Int_t) i1;
161 conv.i[1] = (Int_t) i2;
162 ll = conv.l;
163}
164
165////////////////////////////////////////////////////////////////////////////////
166/// Handle X11 error.
167
169{
170 char msg[80];
171 XGetErrorText(disp, err->error_code, msg, 80);
172
173 if (!err->resourceid) return 0;
174
175 TObject *w = (TObject *)gROOT->ProcessLineFast(Form("gClient ? gClient->GetWindowById(%lu) : 0",
176 (ULong_t)err->resourceid));
177
178 if (!w) {
179 ::Error("RootX11ErrorHandler", "%s (XID: %u, XREQ: %u)", msg,
180 (UInt_t)err->resourceid, err->request_code);
181 } else {
182 ::Error("RootX11ErrorHandler", "%s (%s XID: %u, XREQ: %u)", msg, w->ClassName(),
183 (UInt_t)err->resourceid, err->request_code);
184 w->Print("tree");
185 }
186 if (TROOT::Initialized()) {
187 //Getlinem(kInit, "Root > ");
188 Throw(2);
189 }
190 return 0;
191}
192
193////////////////////////////////////////////////////////////////////////////////
194/// Handle X11 I/O error (happens when connection to display server
195/// is broken).
196
198{
199 ::Error("RootX11IOErrorHandler", "fatal X11 error (connection to server lost?!)");
200 fprintf(stderr,"\n**** Save data and exit application ****\n\n");
201 // delete X connection handler (to avoid looping in TSystem::DispatchOneEvent())
202 if (gXDisplay && gSystem) {
205 }
206 if (TROOT::Initialized()) {
207 //Getlinem(kInit, "Root > ");
208 Throw(2);
209 }
210 return 0;
211}
212
213
214////////////////////////////////////////////////////////////////////////////////
215/// Map window on screen.
216
218{
219 if (!id) return;
220
221 XMapWindow((Display*)fDisplay, (Window) id);
222}
223
224////////////////////////////////////////////////////////////////////////////////
225/// Map sub windows.
226
228{
229 if (!id) return;
230
231 XMapSubwindows((Display*)fDisplay, (Window) id);
232}
233
234////////////////////////////////////////////////////////////////////////////////
235/// Map window on screen and put on top of all windows.
236
238{
239 if (!id) return;
240
241 XMapRaised((Display*)fDisplay, (Window) id);
242}
243
244////////////////////////////////////////////////////////////////////////////////
245/// Unmap window from screen.
246
248{
249 if (!id) return;
250
251 XUnmapWindow((Display*)fDisplay, (Window) id);
252}
253
254////////////////////////////////////////////////////////////////////////////////
255/// Destroy window.
256
258{
259 if (!id) return;
260
261 XDestroyWindow((Display*)fDisplay, (Window) id);
262}
263
264////////////////////////////////////////////////////////////////////////////////
265/// Destroy subwindows of this window.
266
268{
269 if (!id) return;
270
271 XDestroySubwindows((Display*)fDisplay, (Window) id);
272}
273
274////////////////////////////////////////////////////////////////////////////////
275/// Put window on top of window stack.
276
278{
279 if (!id) return;
280
281 XRaiseWindow((Display*)fDisplay, (Window) id);
282}
283
284////////////////////////////////////////////////////////////////////////////////
285/// Lower window so it lays below all its siblings.
286
288{
289 if (!id) return;
290
291 XLowerWindow((Display*)fDisplay, (Window) id);
292}
293
294////////////////////////////////////////////////////////////////////////////////
295/// Move a window.
296
298{
299 if (!id) return;
300
301 XMoveWindow((Display*)fDisplay, (Window) id, x, y);
302}
303
304////////////////////////////////////////////////////////////////////////////////
305/// Move and resize a window.
306
308{
309 if (!id) return;
310
311 XMoveResizeWindow((Display*)fDisplay, (Window) id, x, y, w, h);
312}
313
314////////////////////////////////////////////////////////////////////////////////
315/// Resize the window.
316
318{
319 if (!id) return;
320
321 // protect against potential negative values
322 if (w >= (UInt_t)INT_MAX || h >= (UInt_t)INT_MAX)
323 return;
324 XResizeWindow((Display*)fDisplay, (Window) id, w, h);
325}
326
327////////////////////////////////////////////////////////////////////////////////
328/// Iconify the window.
329
331{
332 if (!id) return;
333
335}
336
337////////////////////////////////////////////////////////////////////////////////
338/// Reparent window to new parent window at position (x,y).
339
341{
342 if (!id) return;
343
344 XReparentWindow((Display*)fDisplay, (Window) id, (Window) pid, x, y);
345}
346
347////////////////////////////////////////////////////////////////////////////////
348/// Set the window background color.
349
351{
352 if (!id) return;
353
354 XSetWindowBackground((Display*)fDisplay, (Window) id, color);
355}
356
357////////////////////////////////////////////////////////////////////////////////
358/// Set pixmap as window background.
359
361{
362 if (!id) return;
363
364 XSetWindowBackgroundPixmap((Display*)fDisplay, (Window) id, (Pixmap) pxm);
365}
366
367////////////////////////////////////////////////////////////////////////////////
368/// Return handle to newly created X window.
369
371 UInt_t w, UInt_t h, UInt_t border,
374{
376 ULong_t xmask = 0;
377
378 if (attr)
380
381 if (depth == 0)
382 depth = fDepth;
383 if (!visual)
384 visual = fVisual;
385 if (fColormap && !(xmask & CWColormap)) {
386 xmask |= CWColormap;
387 xattr.colormap = fColormap;
388 }
389 if ((Window)parent == fRootWin && fRootWin != fVisRootWin) {
391 xattr.border_pixel = fBlackPixel;
392 }
393
394 return (Window_t) XCreateWindow((Display*)fDisplay, (Window) parent, x, y,
395 w, h, border, depth, clss, (Visual*)visual,
396 xmask, &xattr);
397}
398
399////////////////////////////////////////////////////////////////////////////////
400/// Map event mask to or from X.
401
403{
404 if (tox) {
406 if ((emask & kKeyPressMask))
408 if ((emask & kKeyReleaseMask))
410 if ((emask & kButtonPressMask))
416 if ((emask & kButtonMotionMask))
418 if ((emask & kExposureMask))
422 if ((emask & kEnterWindowMask))
424 if ((emask & kLeaveWindowMask))
426 if ((emask & kFocusChangeMask))
433 } else {
434 emask = 0;
435 if ((xemask & KeyPressMask))
437 if ((xemask & KeyReleaseMask))
439 if ((xemask & ButtonPressMask))
445 if ((xemask & ButtonMotionMask))
447 if ((xemask & ExposureMask))
451 if ((xemask & EnterWindowMask))
453 if ((xemask & LeaveWindowMask))
455 if ((xemask & FocusChangeMask))
461 }
462}
463
464////////////////////////////////////////////////////////////////////////////////
465/// Map a SetWindowAttributes_t to a XSetWindowAttributes structure.
466
469{
470 Mask_t mask = attr->fMask;
471 xmask = 0;
472
473 if ((mask & kWABackPixmap)) {
475 if (attr->fBackgroundPixmap == kNone)
476 xattr.background_pixmap = None;
477 else if (attr->fBackgroundPixmap == kParentRelative)
478 xattr.background_pixmap = ParentRelative;
479 else
480 xattr.background_pixmap = (Pixmap)attr->fBackgroundPixmap;
481 }
482 if ((mask & kWABackPixel)) {
484 xattr.background_pixel = attr->fBackgroundPixel;
485 }
486 if ((mask & kWABorderPixmap)) {
488 xattr.border_pixmap = (Pixmap)attr->fBorderPixmap;
489 }
490 if ((mask & kWABorderPixel)) {
492 xattr.border_pixel = attr->fBorderPixel;
493 }
494 if ((mask & kWABitGravity)) {
496 xattr.bit_gravity = attr->fBitGravity; //assume ident mapping (rdm)
497 }
498 if ((mask & kWAWinGravity)) {
500 xattr.win_gravity = attr->fWinGravity; // assume ident mapping (rdm)
501 }
502 if ((mask & kWABackingStore)) {
504 if (attr->fBackingStore == kNotUseful)
505 xattr.backing_store = NotUseful;
506 else if (attr->fBackingStore == kWhenMapped)
507 xattr.backing_store = WhenMapped;
508 else if (attr->fBackingStore == kAlways)
509 xattr.backing_store = Always;
510 else
511 xattr.backing_store = attr->fBackingStore;
512 }
513 if ((mask & kWABackingPlanes)) {
515 xattr.backing_planes = attr->fBackingPlanes;
516 }
517 if ((mask & kWABackingPixel)) {
519 xattr.backing_pixel = attr->fBackingPixel;
520 }
521 if ((mask & kWAOverrideRedirect)) {
523 xattr.override_redirect = attr->fOverrideRedirect;
524 }
525 if ((mask & kWASaveUnder)) {
527 xattr.save_under = (Bool)attr->fSaveUnder;
528 }
529 if ((mask & kWAEventMask)) {
531 UInt_t xmsk, msk = (UInt_t) attr->fEventMask;
533 xattr.event_mask = xmsk;
534 }
535 if ((mask & kWADontPropagate)) {
537 xattr.do_not_propagate_mask = attr->fDoNotPropagateMask;
538 }
539 if ((mask & kWAColormap)) {
540 xmask |= CWColormap;
541 xattr.colormap = (Colormap)attr->fColormap;
542 }
543 if ((mask & kWACursor)) {
544 xmask |= CWCursor;
545 if (attr->fCursor == kNone)
546 xattr.cursor = None;
547 else
548 xattr.cursor = (Cursor)attr->fCursor;
549 }
550}
551
552////////////////////////////////////////////////////////////////////////////////
553/// Map a GCValues_t to a XCGValues structure if tox is true. Map
554/// the other way in case tox is false.
555
558{
559 if (tox) {
560 // map GCValues_t to XGCValues
561 Mask_t mask = gval.fMask;
562 xmask = 0;
563
564 if ((mask & kGCFunction)) {
565 xmask |= GCFunction;
566 xgval.function = gval.fFunction; // ident mapping
567 }
568 if ((mask & kGCPlaneMask)) {
570 xgval.plane_mask = gval.fPlaneMask;
571 }
572 if ((mask & kGCForeground)) {
574 xgval.foreground = gval.fForeground;
575 }
576 if ((mask & kGCBackground)) {
578 xgval.background = gval.fBackground;
579 }
580 if ((mask & kGCLineWidth)) {
582 xgval.line_width = gval.fLineWidth;
583 }
584 if ((mask & kGCLineStyle)) {
586 xgval.line_style = gval.fLineStyle; // ident mapping
587 }
588 if ((mask & kGCCapStyle)) {
589 xmask |= GCCapStyle;
590 xgval.cap_style = gval.fCapStyle; // ident mapping
591 }
592 if ((mask & kGCJoinStyle)) {
594 xgval.join_style = gval.fJoinStyle; // ident mapping
595 }
596 if ((mask & kGCFillStyle)) {
598 xgval.fill_style = gval.fFillStyle; // ident mapping
599 }
600 if ((mask & kGCFillRule)) {
601 xmask |= GCFillRule;
602 xgval.fill_rule = gval.fFillRule; // ident mapping
603 }
604 if ((mask & kGCTile)) {
605 xmask |= GCTile;
606 xgval.tile = (Pixmap) gval.fTile;
607 }
608 if ((mask & kGCStipple)) {
609 xmask |= GCStipple;
610 xgval.stipple = (Pixmap) gval.fStipple;
611 }
612 if ((mask & kGCTileStipXOrigin)) {
614 xgval.ts_x_origin = gval.fTsXOrigin;
615 }
616 if ((mask & kGCTileStipYOrigin)) {
618 xgval.ts_y_origin = gval.fTsYOrigin;
619 }
620 if ((mask & kGCFont)) {
621 if (!fHasXft) {
622 xmask |= GCFont;
623 xgval.font = (Font) gval.fFont;
624 }
625 }
626 if ((mask & kGCSubwindowMode)) {
628 xgval.subwindow_mode = gval.fSubwindowMode; // ident mapping
629 }
630 if ((mask & kGCGraphicsExposures)) {
632 xgval.graphics_exposures = (Bool) gval.fGraphicsExposures;
633 }
634 if ((mask & kGCClipXOrigin)) {
636 xgval.clip_x_origin = gval.fClipXOrigin;
637 }
638 if ((mask & kGCClipYOrigin)) {
640 xgval.clip_y_origin = gval.fClipYOrigin;
641 }
642 if ((mask & kGCClipMask)) {
643 xmask |= GCClipMask;
644 xgval.clip_mask = (Pixmap) gval.fClipMask;
645 }
646 if ((mask & kGCDashOffset)) {
648 xgval.dash_offset = gval.fDashOffset;
649 }
650 if ((mask & kGCDashList)) {
651 xmask |= GCDashList;
652 xgval.dashes = gval.fDashes[0];
653 }
654 if ((mask & kGCArcMode)) {
655 xmask |= GCArcMode;
656 xgval.arc_mode = gval.fArcMode; // ident mapping
657 }
658
659 } else {
660 // map XValues to GCValues_t
661 Mask_t mask = 0;
662
663 if ((xmask & GCFunction)) {
664 mask |= kGCFunction;
665 gval.fFunction = (EGraphicsFunction) xgval.function; // ident mapping
666 }
667 if ((xmask & GCPlaneMask)) {
669 gval.fPlaneMask = xgval.plane_mask;
670 }
671 if ((xmask & GCForeground)) {
673 gval.fForeground = xgval.foreground;
674 }
675 if ((xmask & GCBackground)) {
677 gval.fBackground = xgval.background;
678 }
679 if ((xmask & GCLineWidth)) {
681 gval.fLineWidth = xgval.line_width;
682 }
683 if ((xmask & GCLineStyle)) {
685 gval.fLineStyle = xgval.line_style; // ident mapping
686 }
687 if ((xmask & GCCapStyle)) {
688 mask |= kGCCapStyle;
689 gval.fCapStyle = xgval.cap_style; // ident mapping
690 }
691 if ((xmask & GCJoinStyle)) {
693 gval.fJoinStyle = xgval.join_style; // ident mapping
694 }
695 if ((xmask & GCFillStyle)) {
697 gval.fFillStyle = xgval.fill_style; // ident mapping
698 }
699 if ((xmask & GCFillRule)) {
700 mask |= kGCFillRule;
701 gval.fFillRule = xgval.fill_rule; // ident mapping
702 }
703 if ((xmask & GCTile)) {
704 mask |= kGCTile;
705 gval.fTile = (Pixmap_t) xgval.tile;
706 }
707 if ((xmask & GCStipple)) {
708 mask |= kGCStipple;
709 gval.fStipple = (Pixmap_t) xgval.stipple;
710 }
711 if ((xmask & GCTileStipXOrigin)) {
713 gval.fTsXOrigin = xgval.ts_x_origin;
714 }
715 if ((xmask & GCTileStipYOrigin)) {
717 gval.fTsYOrigin = xgval.ts_y_origin;
718 }
719 if ((xmask & GCFont)) {
720 mask |= kGCFont;
721 gval.fFont = (FontH_t) xgval.font;
722 }
723 if ((xmask & GCSubwindowMode)) {
725 gval.fSubwindowMode = xgval.subwindow_mode; // ident mapping
726 }
727 if ((xmask & GCGraphicsExposures)) {
729 gval.fGraphicsExposures = (Bool_t) xgval.graphics_exposures;
730 }
731 if ((xmask & GCClipXOrigin)) {
733 gval.fClipXOrigin = xgval.clip_x_origin;
734 }
735 if ((xmask & GCClipYOrigin)) {
737 gval.fClipYOrigin = xgval.clip_y_origin;
738 }
739 if ((xmask & GCClipMask)) {
740 mask |= kGCClipMask;
741 gval.fClipMask = (Pixmap_t) xgval.clip_mask;
742 }
743 if ((xmask & GCDashOffset)) {
745 gval.fDashOffset = xgval.dash_offset;
746 }
747 if ((xmask & GCDashList)) {
748 mask |= kGCDashList;
749 gval.fDashes[0] = xgval.dashes;
750 gval.fDashLen = 1;
751 }
752 if ((xmask & GCArcMode)) {
753 mask |= kGCArcMode;
754 gval.fArcMode = xgval.arc_mode; // ident mapping
755 }
756 gval.fMask = mask;
757 }
758}
759
760////////////////////////////////////////////////////////////////////////////////
761/// Get window attributes and return filled in attributes structure.
762
764{
765 if (!id) return;
766
768
769 XGetWindowAttributes((Display*)fDisplay, id, &xattr);
770
771 attr.fX = xattr.x;
772 attr.fY = xattr.y;
773 attr.fWidth = xattr.width;
774 attr.fHeight = xattr.height;
775 attr.fBorderWidth = xattr.border_width;
776 attr.fDepth = xattr.depth;
777 attr.fVisual = xattr.visual;
778 attr.fRoot = (Window_t) xattr.root;
779 if (xattr.c_class == InputOutput) attr.fClass = kInputOutput;
780 if (xattr.c_class == InputOnly) attr.fClass = kInputOnly;
781 attr.fBitGravity = xattr.bit_gravity; // assume ident mapping (rdm)
782 attr.fWinGravity = xattr.win_gravity; // assume ident mapping (rdm)
783 if (xattr.backing_store == NotUseful) attr.fBackingStore = kNotUseful;
784 if (xattr.backing_store == WhenMapped) attr.fBackingStore = kWhenMapped;
785 if (xattr.backing_store == Always) attr.fBackingStore = kAlways;
786 attr.fBackingPlanes = xattr.backing_planes;
787 attr.fBackingPixel = xattr.backing_pixel;
788 attr.fSaveUnder = (Bool_t) xattr.save_under;
789 if ((Window) id == fRootWin)
790 attr.fColormap = (Colormap_t) fColormap;
791 else
792 attr.fColormap = (Colormap_t) xattr.colormap;
793 attr.fMapInstalled = (Bool_t) xattr.map_installed;
794 attr.fMapState = xattr.map_state; // ident mapping
795 attr.fAllEventMasks = xattr.all_event_masks; // not ident, but not used by GUI classes
796 attr.fYourEventMask = xattr.your_event_mask; // not ident, but not used by GUI classes
797 attr.fDoNotPropagateMask = xattr.do_not_propagate_mask;
798 attr.fOverrideRedirect = (Bool_t) xattr.override_redirect;
799 attr.fScreen = xattr.screen;
800}
801
802////////////////////////////////////////////////////////////////////////////////
803/// Open connection to display server (if such a thing exist on the
804/// current platform). On X11 this method returns on success the X
805/// display socket descriptor (> 0), 0 in case of batch mode and < 0
806/// in case of failure (cannot connect to display dpyName). It also
807/// initializes the TGX11 class via Init(). Called from TGClient ctor.
808
810{
811 // In some cases there can be problems due to XInitThreads, like when
812 // using Qt, so we allow for it to be turned off
813 if (gEnv->GetValue("X11.XInitThread", 1)) {
814 // Must be very first call before any X11 call !!
815 if (!XInitThreads())
816 Warning("OpenDisplay", "system has no X11 thread support");
817 }
818
819 Display *dpy;
820 if (!(dpy = XOpenDisplay(dpyName)))
821 return -1;
822
823 // Set custom X11 error handlers
826
827 if (gEnv->GetValue("X11.Sync", 0))
828 XSynchronize(dpy, 1);
829
830 // Init the GX11 class, sets a.o. fDisplay.
831 if (!Init(dpy))
832 return -1;
833
834 return ConnectionNumber(dpy);
835}
836
837////////////////////////////////////////////////////////////////////////////////
838/// Close connection to display server.
839
841{
842 XCloseDisplay((Display*)fDisplay);
843 fDisplay = nullptr;
844}
845
846////////////////////////////////////////////////////////////////////////////////
847/// Returns handle to display (might be useful in some cases where
848/// direct X11 manipulation outside of TVirtualX is needed, e.g. GL
849/// interface).
850
852{
853 return (Display_t) fDisplay;
854}
855
856////////////////////////////////////////////////////////////////////////////////
857/// Returns handle to visual (might be useful in some cases where
858/// direct X11 manipulation outside of TVirtualX is needed, e.g. GL
859/// interface).
860
862{
863 return (Visual_t) fVisual;
864}
865
866////////////////////////////////////////////////////////////////////////////////
867/// Returns handle to colormap (might be useful in some cases where
868/// direct X11 manipulation outside of TVirtualX is needed, e.g. GL
869/// interface).
870
872{
873 return (Colormap_t) fColormap;
874}
875
876////////////////////////////////////////////////////////////////////////////////
877/// Returns screen number (might be useful in some cases where
878/// direct X11 manipulation outside of TVirtualX is needed, e.g. GL
879/// interface).
880
882{
883 return fScreenNumber;
884}
885
886////////////////////////////////////////////////////////////////////////////////
887/// Returns depth of screen (number of bit planes). Equivalent to
888/// GetPlanes().
889
891{
892 return fDepth;
893}
894
895////////////////////////////////////////////////////////////////////////////////
896/// Return atom handle for atom_name. If it does not exist
897/// create it if only_if_exist is false. Atoms are used to communicate
898/// between different programs (i.e. window manager) via the X server.
899
901{
902 Atom a = XInternAtom((Display*)fDisplay, (char *)atom_name, (Bool)only_if_exist);
903
904 if (a == None) return kNone;
905 return (Atom_t) a;
906}
907
908////////////////////////////////////////////////////////////////////////////////
909/// Return handle to the default root window created when calling
910/// XOpenDisplay().
911
916
917////////////////////////////////////////////////////////////////////////////////
918/// Return the parent of the window.
919
921{
922 if (!id) return (Window_t)0;
923
924 Window root, parent;
925 Window *children = nullptr;
927
928 XQueryTree((Display*)fDisplay, (Window) id, &root, &parent, &children, &nchildren);
929
930 if (children) XFree(children);
931
932 return (Window_t) parent;
933}
934
935
936////////////////////////////////////////////////////////////////////////////////
937/// Load font and query font. If font is not found 0 is returned,
938/// otherwise an opaque pointer to the FontStruct_t.
939/// Free the loaded font using DeleteFont().
940
941FontStruct_t TGX11::LoadQueryFont(const char *font_name)
942{
943 XFontStruct *fs = XLoadQueryFont((Display*)fDisplay, (char *)font_name);
944 return (FontStruct_t) fs;
945}
946
947////////////////////////////////////////////////////////////////////////////////
948/// Return handle to font described by font structure.
949
951{
952 if (fs) {
954 return fss->fid;
955 }
956 return 0;
957}
958
959////////////////////////////////////////////////////////////////////////////////
960/// Explicitly delete font structure obtained with LoadQueryFont().
961
963{
964 if (fDisplay) XFreeFont((Display*)fDisplay, (XFontStruct *) fs);
965}
966
967////////////////////////////////////////////////////////////////////////////////
968/// Create a graphics context using the values set in gval (but only for
969/// those entries that are in the mask).
970
972{
974 ULong_t xmask = 0;
975
976 if (gval)
978
979 if (!id || ((Drawable) id == fRootWin))
980 id = (Drawable_t) fVisRootWin;
981
982 GC gc = XCreateGC((Display*)fDisplay, (Drawable) id, xmask, &xgval);
983
984 if (gval && (gval->fMask & kGCFont))
985 MapGCFont((GContext_t)gc, gval->fFont);
986
987 return (GContext_t) gc;
988}
989
990////////////////////////////////////////////////////////////////////////////////
991/// Change entries in an existing graphics context, gc, by values from gval.
992
994{
996 ULong_t xmask = 0;
997
998 if (gval)
1000
1001 XChangeGC((Display*)fDisplay, (GC) gc, xmask, &xgval);
1002
1003 if (gval && (gval->fMask & kGCFont))
1004 MapGCFont((GContext_t)gc, gval->fFont);
1005}
1006
1007////////////////////////////////////////////////////////////////////////////////
1008/// Copies graphics context from org to dest. Only the values specified
1009/// in mask are copied. If mask = 0 then copy all fields. Both org and
1010/// dest must exist.
1011
1013{
1016 ULong_t xmask;
1017
1018 if (!mask) {
1019 // in this case copy all fields
1020 mask = kMaxUInt;
1021 }
1022
1023 gval.fMask = mask; // only set fMask used to convert to xmask
1025
1026 XCopyGC((Display*)fDisplay, (GC) org, xmask, (GC) dest);
1027}
1028
1029////////////////////////////////////////////////////////////////////////////////
1030/// Explicitly delete a graphics context.
1031
1033{
1034 // Protection against deletion of global TGGC objects, which are
1035 // destructed after fDisplay has been closed.
1036 if (fDisplay)
1037 XFreeGC((Display*)fDisplay, (GC) gc);
1038}
1039
1040////////////////////////////////////////////////////////////////////////////////
1041/// Create cursor handle (just return cursor from cursor pool fCursors).
1042
1047
1048////////////////////////////////////////////////////////////////////////////////
1049/// Set the specified cursor.
1050
1052{
1053 if (!id) return;
1054
1055 XDefineCursor((Display*)fDisplay, (Window) id, (Cursor) curid);
1056}
1057
1058////////////////////////////////////////////////////////////////////////////////
1059/// Creates a pixmap of the width and height you specified
1060/// and returns a pixmap ID that identifies it.
1061
1063{
1064 return (Pixmap_t) XCreatePixmap((Display*)fDisplay, (Drawable) (id ? id : fRootWin), w, h, fDepth);
1065}
1066
1067////////////////////////////////////////////////////////////////////////////////
1068/// Create a pixmap from bitmap data. Ones will get foreground color and
1069/// zeroes background color.
1070
1078
1079////////////////////////////////////////////////////////////////////////////////
1080/// Create a bitmap (i.e. pixmap with depth 1) from the bitmap data.
1081
1084{
1085 return (Pixmap_t) XCreateBitmapFromData((Display*)fDisplay, (id ? id : fRootWin), (char *)bitmap,
1086 width, height);
1087}
1088
1089////////////////////////////////////////////////////////////////////////////////
1090/// Explicitly delete pixmap resource.
1091
1093{
1094 if (fDisplay) XFreePixmap((Display*)fDisplay, (Pixmap) pmap);
1095}
1096
1097////////////////////////////////////////////////////////////////////////////////
1098/// Map a PictureAttributes_t to a XpmAttributes structure. If toxpm is
1099/// kTRUE map from attr to xpmattr, else map the other way.
1100
1102 Bool_t toxpm)
1103{
1104#ifdef XpmVersion
1105 if (toxpm) {
1106 Mask_t mask = attr.fMask;
1107 ULong_t xmask = 0;
1108
1109 if ((mask & kPAColormap)) {
1110 xmask |= XpmColormap;
1111 xpmattr.colormap = (Colormap)attr.fColormap;
1112 }
1113 if ((mask & kPADepth)) {
1114 xmask |= XpmDepth;
1115 xpmattr.depth = attr.fDepth;
1116 }
1117 if ((mask & kPASize)) {
1118 xmask |= XpmSize;
1119 xpmattr.width = attr.fWidth;
1120 xpmattr.height = attr.fHeight;
1121 }
1122 if ((mask & kPAHotspot)) {
1123 xmask |= XpmHotspot;
1124 xpmattr.x_hotspot = attr.fXHotspot;
1125 xpmattr.y_hotspot = attr.fYHotspot;
1126 }
1127 if ((mask & kPAReturnPixels)) {
1129 xpmattr.pixels = nullptr; // output parameters
1130 xpmattr.npixels = 0;
1131 }
1132 if ((mask & kPACloseness)) {
1134 xpmattr.closeness = attr.fCloseness;
1135 }
1136 xpmattr.valuemask = xmask;
1137 } else {
1138 ULong_t xmask = xpmattr.valuemask;
1139 Mask_t mask = 0;
1140
1141 attr.fPixels = nullptr;
1142 attr.fNpixels = 0;
1143
1144 if ((xmask & XpmColormap)) {
1145 mask |= kPAColormap;
1146 attr.fColormap = (Colormap_t)xpmattr.colormap;
1147 mask |= kPADepth;
1148 attr.fDepth = xpmattr.depth;
1149 }
1150 if ((xmask & XpmSize)) {
1151 mask |= kPASize;
1152 attr.fWidth = xpmattr.width;
1153 attr.fHeight = xpmattr.height;
1154 }
1155 if ((xmask & XpmHotspot)) {
1156 mask |= kPAHotspot;
1157 attr.fXHotspot = xpmattr.x_hotspot;
1158 attr.fYHotspot = xpmattr.y_hotspot;
1159 }
1160 if ((xmask & XpmReturnPixels)) {
1162 if (xpmattr.npixels) {
1163 attr.fPixels = new ULong_t[xpmattr.npixels];
1164 for (UInt_t i = 0; i < xpmattr.npixels; i++)
1165 attr.fPixels[i] = xpmattr.pixels[i];
1166 attr.fNpixels = xpmattr.npixels;
1167 }
1168 }
1169 if ((xmask & XpmCloseness)) {
1170 mask |= kPACloseness;
1171 attr.fCloseness = xpmattr.closeness;
1172 }
1173 attr.fMask = mask;
1174 }
1175#endif
1176}
1177
1178////////////////////////////////////////////////////////////////////////////////
1179/// Create a picture pixmap from data on file. The picture attributes
1180/// are used for input and output. Returns kTRUE in case of success,
1181/// kFALSE otherwise. If mask does not exist it is set to kNone.
1182
1186{
1187 if (strstr(filename, ".gif") || strstr(filename, ".GIF")) {
1188 pict = ReadGIF(0, 0, filename, id);
1189 pict_mask = kNone;
1190 attr.fDepth = fDepth;
1191 Int_t dummy;
1192 GetWindowSize(pict, dummy, dummy, attr.fWidth, attr.fHeight);
1193 return kTRUE;
1194 }
1195
1196#ifdef XpmVersion
1198
1200
1201 // make sure pixel depth of pixmap is the same as in the visual
1202 if ((Drawable) id == fRootWin && fRootWin != fVisRootWin) {
1203 xpmattr.valuemask |= XpmDepth;
1204 xpmattr.depth = fDepth;
1205 }
1206
1207 Int_t res = XpmReadFileToPixmap((Display*)fDisplay, (id ? id : fRootWin), (char*)filename,
1208 (Pixmap*)&pict, (Pixmap*)&pict_mask, &xpmattr);
1209
1212
1213 if (res == XpmSuccess || res == XpmColorError)
1214 return kTRUE;
1215
1216 if (pict) {
1217 XFreePixmap((Display*)fDisplay, (Pixmap)pict);
1218 pict = kNone;
1219 }
1220 if (pict_mask) {
1221 XFreePixmap((Display*)fDisplay, (Pixmap)pict_mask);
1222 pict_mask = kNone;
1223 }
1224#else
1225 Error("CreatePictureFromFile", "cannot get picture, not compiled with Xpm");
1226#endif
1227
1228 return kFALSE;
1229}
1230
1231////////////////////////////////////////////////////////////////////////////////
1232/// Create a picture pixmap from data. The picture attributes
1233/// are used for input and output. Returns kTRUE in case of success,
1234/// kFALSE otherwise. If mask does not exist it is set to kNone.
1235
1238{
1239#ifdef XpmVersion
1241
1243
1244 // make sure pixel depth of pixmap is the same as in the visual
1245 if ((Drawable) id == fRootWin && fRootWin != fVisRootWin) {
1246 xpmattr.valuemask |= XpmDepth;
1247 xpmattr.depth = fDepth;
1248 }
1249
1250 Int_t res = XpmCreatePixmapFromData((Display*)fDisplay, (id ? id : fRootWin), data, (Pixmap*)&pict,
1251 (Pixmap*)&pict_mask, &xpmattr);
1252
1255
1256 if (res == XpmSuccess || res == XpmColorError)
1257 return kTRUE;
1258
1259 if (pict) {
1260 XFreePixmap((Display*)fDisplay, (Pixmap)pict);
1261 pict = kNone;
1262 }
1263 if (pict_mask) {
1264 XFreePixmap((Display*)fDisplay, (Pixmap)pict_mask);
1265 pict_mask = kNone;
1266 }
1267#else
1268 Error("CreatePictureFromData", "cannot get picture, not compiled with Xpm");
1269#endif
1270
1271 return kFALSE;
1272}
1273
1274////////////////////////////////////////////////////////////////////////////////
1275/// Read picture data from file and store in ret_data. Returns kTRUE in
1276/// case of success, kFALSE otherwise.
1277
1279{
1280#ifdef XpmVersion
1282 return kTRUE;
1283#else
1284 Error("ReadPictureFromDataFile", "cannot get picture, not compiled with Xpm");
1285#endif
1286 return kFALSE;
1287}
1288
1289////////////////////////////////////////////////////////////////////////////////
1290/// Delete picture data created by the function ReadPictureDataFromFile.
1291
1293{
1294#ifdef XpmVersion
1295 // some older libXpm's don't have this function and it is typically
1296 // implemented with a simple free()
1297 // XpmFree(data);
1298 free(data);
1299#endif
1300}
1301
1302////////////////////////////////////////////////////////////////////////////////
1303/// Specify a dash pattern. Offset defines the phase of the pattern.
1304/// Each element in the dash_list array specifies the length (in pixels)
1305/// of a segment of the pattern. N defines the length of the list.
1306
1308{
1309 XSetDashes((Display*)fDisplay, (GC) gc, offset, (char *)dash_list, n);
1310}
1311
1312////////////////////////////////////////////////////////////////////////////////
1313/// Map a ColorStruct_t to a XColor structure.
1314
1316{
1317 xcolor.pixel = color->fPixel;
1318 xcolor.red = color->fRed;
1319 xcolor.green = color->fGreen;
1320 xcolor.blue = color->fBlue;
1321 xcolor.flags = color->fMask; //ident mapping
1322}
1323
1324////////////////////////////////////////////////////////////////////////////////
1325/// Parse string cname containing color name, like "green" or "#00FF00".
1326/// It returns a filled in ColorStruct_t. Returns kFALSE in case parsing
1327/// failed, kTRUE in case of success. On success, the ColorStruct_t
1328/// fRed, fGreen and fBlue fields are all filled in and the mask is set
1329/// for all three colors, but fPixel is not set.
1330
1332{
1333 XColor xc;
1334
1335 if (XParseColor((Display*)fDisplay, (Colormap)cmap, (char *)cname, &xc)) {
1336 color.fPixel = 0;
1337 color.fRed = xc.red;
1338 color.fGreen = xc.green;
1339 color.fBlue = xc.blue;
1340 color.fMask = kDoRed | kDoGreen | kDoBlue;
1341 return kTRUE;
1342 }
1343 return kFALSE;
1344}
1345
1346////////////////////////////////////////////////////////////////////////////////
1347/// Find and allocate a color cell according to the color values specified
1348/// in the ColorStruct_t. If no cell could be allocated it returns kFALSE,
1349/// otherwise kTRUE.
1350
1352{
1353 RXColor xc;
1354
1355 MapColorStruct(&color, xc);
1356
1357 color.fPixel = 0;
1358 if (AllocColor((Colormap)cmap, &xc)) {
1359 color.fPixel = xc.pixel;
1360 return kTRUE;
1361 }
1362
1363 return kFALSE;
1364}
1365
1366////////////////////////////////////////////////////////////////////////////////
1367/// Fill in the primary color components for a specific pixel value.
1368/// On input fPixel should be set on return the fRed, fGreen and
1369/// fBlue components will be set.
1370
1372{
1373 XColor xc;
1374
1375 xc.pixel = color.fPixel;
1376
1377 // still very slight dark shift ??
1378 //QueryColors((Colormap)cmap, &xc, 1);
1379 //printf("1 xc.red = %u, xc.green = %u, xc.blue = %u\n", xc.red, xc.green, xc.blue);
1380 XQueryColor((Display*)fDisplay, (Colormap)cmap, &xc);
1381 //printf("2 xc.red = %u, xc.green = %u, xc.blue = %u\n", xc.red, xc.green, xc.blue);
1382
1383 color.fRed = xc.red;
1384 color.fGreen = xc.green;
1385 color.fBlue = xc.blue;
1386}
1387
1388////////////////////////////////////////////////////////////////////////////////
1389/// Free color cell with specified pixel value.
1390
1392{
1393 if (fRedDiv == -1)
1394 XFreeColors((Display*)fDisplay, (Colormap)cmap, &pixel, 1, 0);
1395}
1396
1397////////////////////////////////////////////////////////////////////////////////
1398/// Returns number of pending events.
1399
1401{
1402 if (!fDisplay) return 0;
1403 return XPending((Display*)fDisplay);
1404}
1405
1406////////////////////////////////////////////////////////////////////////////////
1407/// Copies first pending event from event queue to Event_t structure
1408/// and removes event from queue. Not all of the event fields are valid
1409/// for each event type, except fType and fWindow.
1410
1412{
1413 XNextEvent((Display*)fDisplay, (XEvent*)fXEvent);
1414
1415 // fill in Event_t
1416 MapEvent(event, fXEvent, kFALSE);
1417}
1418
1419////////////////////////////////////////////////////////////////////////////////
1420/// Map modifier key state to or from X.
1421
1423{
1424 if (tox) {
1425 xstate = 0;
1426 if ((state & kKeyShiftMask))
1427 xstate |= ShiftMask;
1428 if ((state & kKeyLockMask))
1429 xstate |= LockMask;
1430 if ((state & kKeyControlMask))
1432 if ((state & kKeyMod1Mask))
1433 xstate |= Mod1Mask;
1434 if ((state & kKeyMod2Mask))
1435 xstate |= Mod2Mask;
1436 if ((state & kKeyMod3Mask))
1437 xstate |= Mod3Mask;
1438 if ((state & kKeyMod4Mask))
1439 xstate |= Mod4Mask;
1440 if ((state & kKeyMod5Mask))
1441 xstate |= Mod5Mask;
1442 if ((state & kButton1Mask))
1444 if ((state & kButton2Mask))
1446 if ((state & kButton3Mask))
1448 if ((state & kAnyModifier))
1449 xstate |= AnyModifier; // or should it be = instead of |= ?
1450 } else {
1451 state = 0;
1452 if ((xstate & ShiftMask))
1453 state |= kKeyShiftMask;
1454 if ((xstate & LockMask))
1455 state |= kKeyLockMask;
1456 if ((xstate & ControlMask))
1457 state |= kKeyControlMask;
1458 if ((xstate & Mod1Mask))
1459 state |= kKeyMod1Mask;
1460 if ((xstate & Mod2Mask))
1461 state |= kKeyMod2Mask;
1462 if ((xstate & Mod3Mask))
1463 state |= kKeyMod3Mask;
1464 if ((xstate & Mod4Mask))
1465 state |= kKeyMod4Mask;
1466 if ((xstate & Mod5Mask))
1467 state |= kKeyMod5Mask;
1468 if ((xstate & Button1Mask))
1469 state |= kButton1Mask;
1470 if ((xstate & Button2Mask))
1471 state |= kButton2Mask;
1472 if ((xstate & Button3Mask))
1473 state |= kButton3Mask;
1474 if ((xstate & AnyModifier))
1475 state |= kAnyModifier; // idem
1476 }
1477}
1478
1479////////////////////////////////////////////////////////////////////////////////
1480/// Map Event_t structure to XEvent structure. If tox is false
1481/// map the other way.
1482
1484{
1485 XEvent &xev = *(XEvent *)xevi;
1486
1487 if (tox) {
1488 // map from Event_t to XEvent
1489 xev.type = 0;
1490 if (ev.fType == kGKeyPress) xev.type = KeyPress;
1491 if (ev.fType == kKeyRelease) xev.type = KeyRelease;
1492 if (ev.fType == kButtonPress) xev.type = ButtonPress;
1493 if (ev.fType == kButtonRelease) xev.type = ButtonRelease;
1494 if (ev.fType == kMotionNotify) xev.type = MotionNotify;
1495 if (ev.fType == kEnterNotify) xev.type = EnterNotify;
1496 if (ev.fType == kLeaveNotify) xev.type = LeaveNotify;
1497 if (ev.fType == kFocusIn) xev.type = FocusIn;
1498 if (ev.fType == kFocusOut) xev.type = FocusOut;
1499 if (ev.fType == kExpose) xev.type = Expose;
1500 if (ev.fType == kConfigureNotify) xev.type = ConfigureNotify;
1501 if (ev.fType == kMapNotify) xev.type = MapNotify;
1502 if (ev.fType == kUnmapNotify) xev.type = UnmapNotify;
1503 if (ev.fType == kDestroyNotify) xev.type = DestroyNotify;
1504 if (ev.fType == kClientMessage) xev.type = ClientMessage;
1505 if (ev.fType == kSelectionClear) xev.type = SelectionClear;
1506 if (ev.fType == kSelectionRequest) xev.type = SelectionRequest;
1507 if (ev.fType == kSelectionNotify) xev.type = SelectionNotify;
1508 if (ev.fType == kColormapNotify) xev.type = ColormapNotify;
1509
1510 xev.xany.window = (Window) ev.fWindow;
1511 xev.xany.send_event = (Bool) ev.fSendEvent;
1512 xev.xany.display = (Display*)fDisplay;
1513
1514 if (ev.fType == kGKeyPress || ev.fType == kKeyRelease) {
1515 xev.xkey.time = (Time) ev.fTime;
1516 xev.xkey.x = ev.fX;
1517 xev.xkey.y = ev.fY;
1518 xev.xkey.x_root = ev.fXRoot;
1519 xev.xkey.y_root = ev.fYRoot;
1520 MapModifierState(ev.fState, xev.xkey.state, kTRUE); // key mask
1521 xev.xkey.keycode = ev.fCode; // key code
1522 }
1523 if (ev.fType == kSelectionNotify) {
1524 xev.xselection.time = (Time) ev.fTime;
1525 xev.xselection.requestor = (Window) ev.fUser[0];
1526 xev.xselection.selection = (Atom) ev.fUser[1];
1527 xev.xselection.target = (Atom) ev.fUser[2];
1528 xev.xselection.property = (Atom) ev.fUser[3];
1529 }
1530 if (ev.fType == kClientMessage) {
1531 xev.xclient.message_type = ev.fHandle;
1532 xev.xclient.format = ev.fFormat;
1533 xev.xclient.data.l[0] = ev.fUser[0];
1534 if (sizeof(ev.fUser[0]) > 4) {
1535 SplitLong(ev.fUser[1], xev.xclient.data.l[1], xev.xclient.data.l[3]);
1536 SplitLong(ev.fUser[2], xev.xclient.data.l[2], xev.xclient.data.l[4]);
1537 } else {
1538 xev.xclient.data.l[1] = ev.fUser[1];
1539 xev.xclient.data.l[2] = ev.fUser[2];
1540 xev.xclient.data.l[3] = ev.fUser[3];
1541 xev.xclient.data.l[4] = ev.fUser[4];
1542 }
1543 }
1544 } else {
1545 // map from XEvent to Event_t
1546 ev.fType = kOtherEvent;
1547 if (xev.type == KeyPress) ev.fType = kGKeyPress;
1548 if (xev.type == KeyRelease) ev.fType = kKeyRelease;
1549 if (xev.type == ButtonPress) ev.fType = kButtonPress;
1550 if (xev.type == ButtonRelease) ev.fType = kButtonRelease;
1551 if (xev.type == MotionNotify) ev.fType = kMotionNotify;
1552 if (xev.type == EnterNotify) ev.fType = kEnterNotify;
1553 if (xev.type == LeaveNotify) ev.fType = kLeaveNotify;
1554 if (xev.type == FocusIn) ev.fType = kFocusIn;
1555 if (xev.type == FocusOut) ev.fType = kFocusOut;
1556 if (xev.type == Expose) ev.fType = kExpose;
1557 if (xev.type == GraphicsExpose) ev.fType = kExpose;
1558 if (xev.type == ConfigureNotify) ev.fType = kConfigureNotify;
1559 if (xev.type == MapNotify) ev.fType = kMapNotify;
1560 if (xev.type == UnmapNotify) ev.fType = kUnmapNotify;
1561 if (xev.type == DestroyNotify) ev.fType = kDestroyNotify;
1562 if (xev.type == ClientMessage) ev.fType = kClientMessage;
1563 if (xev.type == SelectionClear) ev.fType = kSelectionClear;
1564 if (xev.type == SelectionRequest) ev.fType = kSelectionRequest;
1565 if (xev.type == SelectionNotify) ev.fType = kSelectionNotify;
1566 if (xev.type == ColormapNotify) ev.fType = kColormapNotify;
1567
1568 ev.fWindow = (Window_t) xev.xany.window;
1569 ev.fSendEvent = xev.xany.send_event ? kTRUE : kFALSE;
1570
1571 if (ev.fType == kGKeyPress || ev.fType == kKeyRelease) {
1572 ev.fTime = (Time_t) xev.xkey.time;
1573 ev.fX = xev.xkey.x;
1574 ev.fY = xev.xkey.y;
1575 ev.fXRoot = xev.xkey.x_root;
1576 ev.fYRoot = xev.xkey.y_root;
1577 MapModifierState(ev.fState, xev.xkey.state, kFALSE); // key mask
1578 ev.fCode = xev.xkey.keycode; // key code
1579 ev.fUser[0] = xev.xkey.subwindow; // child window
1580 }
1581 if (ev.fType == kButtonPress || ev.fType == kButtonRelease) {
1582 ev.fTime = (Time_t) xev.xbutton.time;
1583 ev.fX = xev.xbutton.x;
1584 ev.fY = xev.xbutton.y;
1585 ev.fXRoot = xev.xbutton.x_root;
1586 ev.fYRoot = xev.xbutton.y_root;
1587 MapModifierState(ev.fState, xev.xbutton.state, kFALSE); // button mask
1588 ev.fCode = xev.xbutton.button; // button code
1589 ev.fUser[0] = xev.xbutton.subwindow; // child window
1590 }
1591 if (ev.fType == kMotionNotify) {
1592 ev.fTime = (Time_t) xev.xmotion.time;
1593 ev.fX = xev.xmotion.x;
1594 ev.fY = xev.xmotion.y;
1595 ev.fXRoot = xev.xmotion.x_root;
1596 ev.fYRoot = xev.xmotion.y_root;
1597 MapModifierState(ev.fState, xev.xmotion.state, kFALSE); // key or button mask
1598 ev.fUser[0] = xev.xmotion.subwindow; // child window
1599 }
1600 if (ev.fType == kEnterNotify || ev.fType == kLeaveNotify) {
1601 ev.fTime = (Time_t) xev.xcrossing.time;
1602 ev.fX = xev.xcrossing.x;
1603 ev.fY = xev.xcrossing.y;
1604 ev.fXRoot = xev.xcrossing.x_root;
1605 ev.fYRoot = xev.xcrossing.y_root;
1606 ev.fCode = xev.xcrossing.mode; // NotifyNormal, NotifyGrab, NotifyUngrab
1607 MapModifierState(ev.fState, xev.xcrossing.state, kFALSE); // key or button mask
1608 }
1609 if (ev.fType == kFocusIn || ev.fType == kFocusOut) {
1610 // check this when porting to Win32 (see also TGTextEntry::HandleFocusChange)
1611 ev.fCode = xev.xfocus.mode; // NotifyNormal, NotifyGrab, NotifyUngrab
1612 ev.fState = xev.xfocus.detail; // NotifyPointer et al.
1613 }
1614 if (ev.fType == kExpose) {
1615 ev.fX = xev.xexpose.x;
1616 ev.fY = xev.xexpose.y;
1617 ev.fWidth = xev.xexpose.width; // width and
1618 ev.fHeight = xev.xexpose.height; // height of exposed area
1619 ev.fCount = xev.xexpose.count; // number of expose events still to come
1620 }
1621 if (ev.fType == kConfigureNotify) {
1622 ev.fX = xev.xconfigure.x;
1623 ev.fY = xev.xconfigure.y;
1624 ev.fWidth = xev.xconfigure.width;
1625 ev.fHeight = xev.xconfigure.height;
1626 }
1627 if (ev.fType == kMapNotify || ev.fType == kUnmapNotify) {
1628 ev.fHandle = xev.xmap.window; // window to be (un)mapped
1629 }
1630 if (ev.fType == kDestroyNotify) {
1631 ev.fHandle = xev.xdestroywindow.window; // window to be destroyed
1632 }
1633 if (ev.fType == kClientMessage) {
1634 ev.fHandle = xev.xclient.message_type;
1635 ev.fFormat = xev.xclient.format;
1636 ev.fUser[0] = xev.xclient.data.l[0];
1637 if (sizeof(ev.fUser[0]) > 4) {
1638 AsmLong(xev.xclient.data.l[1], xev.xclient.data.l[3], ev.fUser[1]);
1639 AsmLong(xev.xclient.data.l[2], xev.xclient.data.l[4], ev.fUser[2]);
1640 } else {
1641 ev.fUser[1] = xev.xclient.data.l[1];
1642 ev.fUser[2] = xev.xclient.data.l[2];
1643 ev.fUser[3] = xev.xclient.data.l[3];
1644 ev.fUser[4] = xev.xclient.data.l[4];
1645 }
1646 }
1647 if (ev.fType == kSelectionClear) {
1648 ev.fUser[0] = xev.xselectionclear.selection;
1649 }
1650 if (ev.fType == kSelectionRequest) {
1651 ev.fTime = (Time_t) xev.xselectionrequest.time;
1652 ev.fUser[0] = xev.xselectionrequest.requestor;
1653 ev.fUser[1] = xev.xselectionrequest.selection;
1654 ev.fUser[2] = xev.xselectionrequest.target;
1655 ev.fUser[3] = xev.xselectionrequest.property;
1656 }
1657 if (ev.fType == kSelectionNotify) {
1658 ev.fTime = (Time_t) xev.xselection.time;
1659 ev.fUser[0] = xev.xselection.requestor;
1660 ev.fUser[1] = xev.xselection.selection;
1661 ev.fUser[2] = xev.xselection.target;
1662 ev.fUser[3] = xev.xselection.property;
1663 }
1664 if (ev.fType == kColormapNotify) {
1665 ev.fHandle = xev.xcolormap.colormap;
1666 ev.fCode = xev.xcolormap.state; // ColormapUninstalled, ColormapInstalled
1667 ev.fState = xev.xcolormap.c_new; // true if new colormap
1668 }
1669 }
1670}
1671
1672////////////////////////////////////////////////////////////////////////////////
1673/// Sound bell. Percent is loudness from -100% .. 100%.
1674
1676{
1677 XBell((Display*)fDisplay, percent);
1678}
1679
1680////////////////////////////////////////////////////////////////////////////////
1681/// Copy a drawable (i.e. pixmap) to another drawable (pixmap, window).
1682/// The graphics context gc will be used and the source will be copied
1683/// from src_x,src_y,src_x+width,src_y+height to dest_x,dest_y.
1684
1688{
1689 if (!src || !dest) return;
1690
1691 XCopyArea((Display*)fDisplay, src, dest, (GC) gc, src_x, src_y, width, height,
1692 dest_x, dest_y);
1693}
1694
1695////////////////////////////////////////////////////////////////////////////////
1696/// Change window attributes.
1697
1699{
1700 if (!id) return;
1701
1703 ULong_t xmask = 0;
1704
1705 if (attr)
1707
1709
1710 if (attr && (attr->fMask & kWABorderWidth))
1711 XSetWindowBorderWidth((Display*)fDisplay, (Window) id, attr->fBorderWidth);
1712}
1713
1714////////////////////////////////////////////////////////////////////////////////
1715/// This function alters the property for the specified window and
1716/// causes the X server to generate a PropertyNotify event on that
1717/// window.
1718
1721{
1722 if (!id) return;
1723
1724 XChangeProperty((Display*)fDisplay, (Window) id, (Atom) property, (Atom) type,
1725 8, PropModeReplace, data, len);
1726}
1727
1728////////////////////////////////////////////////////////////////////////////////
1729/// This function alters the property for the specified window and
1730/// causes the X server to generate a PropertyNotify event on that
1731/// window. Specifically for WSL (Windows Subsytem for Linux)
1732
1734{
1735 if (!id)
1736 return;
1737 static const char *property_names[] = {
1738 "_NET_WM_WINDOW_TYPE_COMBO",
1739 "_NET_WM_WINDOW_TYPE_POPUP_MENU",
1740 "_NET_WM_WINDOW_TYPE_TOOLTIP"
1741 };
1742 const char *property_name = property_names[hint];
1743 Atom_t property_type = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE", kFALSE);
1747}
1748
1749////////////////////////////////////////////////////////////////////////////////
1750/// Draw a line.
1751
1753{
1754 if (!id) return;
1755
1756 XDrawLine((Display*)fDisplay, (Drawable) id, (GC) gc, x1, y1, x2, y2);
1757}
1758
1759////////////////////////////////////////////////////////////////////////////////
1760/// Clear a window area to the background color.
1761
1763{
1764 if (!id) return;
1765
1766 XClearArea((Display*)fDisplay, (Window) id, x, y, w, h, False);
1767}
1768
1769////////////////////////////////////////////////////////////////////////////////
1770/// Check if there is for window "id" an event of type "type". If there
1771/// is fill in the event structure and return true. If no such event
1772/// return false.
1773
1775{
1776 if (!id) return kFALSE;
1777
1778 Event_t tev;
1779 XEvent xev;
1780
1781 tev.fCode = 0;
1782 tev.fState = 0;
1783 tev.fWindow = 0;
1784 tev.fUser[0] = tev.fUser[1] = tev.fUser[2] = tev.fUser[3] = tev.fUser[4] = 0;
1785 tev.fCount = 0;
1786 tev.fFormat = 0;
1787 tev.fHandle = 0;
1788 tev.fSendEvent = false;
1789 tev.fTime = 0;
1790 tev.fX = tev.fY = 0;
1791 tev.fXRoot = tev.fYRoot = 0;
1792 tev.fType = type;
1793 MapEvent(tev, &xev);
1794
1795 Bool r = XCheckTypedWindowEvent((Display*)fDisplay, (Window) id, xev.type, &xev);
1796
1797 if (r) MapEvent(ev, &xev, kFALSE);
1798
1799 return r ? kTRUE : kFALSE;
1800}
1801
1802////////////////////////////////////////////////////////////////////////////////
1803/// Send event ev to window id.
1804
1806{
1807 if (!ev || !id) return;
1808
1809 XEvent xev;
1810
1811 MapEvent(*ev, &xev);
1812
1813 XSendEvent((Display*)fDisplay, (Window) id, False, None, &xev);
1814}
1815
1816////////////////////////////////////////////////////////////////////////////////
1817/// Tell WM to send message when window is closed via WM.
1818
1820{
1821 if (!id) return;
1822
1823 XSetWMProtocols((Display*)fDisplay, (Window) id, &gWM_DELETE_WINDOW, 1);
1824}
1825
1826////////////////////////////////////////////////////////////////////////////////
1827/// Turn key auto repeat on or off.
1828
1830{
1831 if (!fDisplay)
1832 return;
1833
1834 if (on)
1835 XAutoRepeatOn((Display*)fDisplay);
1836 else
1837 XAutoRepeatOff((Display*)fDisplay);
1838}
1839
1840////////////////////////////////////////////////////////////////////////////////
1841/// Establish passive grab on a certain key. That is, when a certain key
1842/// keycode is hit while certain modifier's (Shift, Control, Meta, Alt)
1843/// are active then the keyboard will be grabbed for window id.
1844/// When grab is false, ungrab the keyboard for this key and modifier.
1845
1847{
1848// if (!id) return;
1849
1850 UInt_t xmod;
1851
1853
1854 if (grab)
1855 XGrabKey((Display*)fDisplay, keycode, xmod, (Window) id, True,
1857 else
1858 XUngrabKey((Display*)fDisplay, keycode, xmod, (Window) id);
1859}
1860
1861////////////////////////////////////////////////////////////////////////////////
1862/// Establish passive grab on a certain mouse button. That is, when a
1863/// certain mouse button is hit while certain modifier's (Shift, Control,
1864/// Meta, Alt) are active then the mouse will be grabbed for window id.
1865/// When grab is false, ungrab the mouse button for this button and modifier.
1866
1869 Bool_t grab)
1870{
1871 if (!id) return;
1872
1873 UInt_t xmod;
1874
1876
1877 if (grab) {
1880
1881 XGrabButton((Display*)fDisplay, button, xmod, (Window) id, True, xevmask,
1883 (Cursor) cursor);
1884 } else
1885 XUngrabButton((Display*)fDisplay, button, xmod, (Window) id);
1886}
1887
1888////////////////////////////////////////////////////////////////////////////////
1889/// Establish an active pointer grab. While an active pointer grab is in
1890/// effect, further pointer events are only reported to the grabbing
1891/// client window.
1892
1895{
1896// if (!id) return;
1897
1898 if (grab) {
1901
1902 XGrabPointer((Display*)fDisplay, (Window) id, (Bool) owner_events,
1905 } else
1907}
1908
1909////////////////////////////////////////////////////////////////////////////////
1910/// Set window name.
1911
1913{
1914 if (!id) return;
1915
1917
1918 if (XStringListToTextProperty(&name, 1, &wname) == 0) {
1919 Error("SetWindowName", "cannot allocate window name \"%s\"", name);
1920 return;
1921 }
1922 XSetWMName((Display*)fDisplay, (Window) id, &wname);
1923 XFree(wname.value);
1924}
1925
1926////////////////////////////////////////////////////////////////////////////////
1927/// Set window icon name.
1928
1930{
1931 if (!id) return;
1932
1934
1935 if (XStringListToTextProperty(&name, 1, &wname) == 0) {
1936 Error("SetIconName", "cannot allocate icon name \"%s\"", name);
1937 return;
1938 }
1939 XSetWMIconName((Display*)fDisplay, (Window) id, &wname);
1940 XFree(wname.value);
1941}
1942
1943////////////////////////////////////////////////////////////////////////////////
1944/// Set pixmap the WM can use when the window is iconized.
1945
1947{
1948 if (!id) return;
1949
1951
1952 hints.flags = IconPixmapHint;
1953 hints.icon_pixmap = (Pixmap) pic;
1954
1955 XSetWMHints((Display*)fDisplay, (Window) id, &hints);
1956}
1957
1958////////////////////////////////////////////////////////////////////////////////
1959/// Set the windows class and resource name.
1960
1961void TGX11::SetClassHints(Window_t id, char *className, char *resourceName)
1962{
1963 if (!id) return;
1964
1966
1967 class_hints.res_class = className;
1968 class_hints.res_name = resourceName;
1969 XSetClassHint((Display*)fDisplay, (Window) id, &class_hints);
1970}
1971
1972////////////////////////////////////////////////////////////////////////////////
1973/// Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
1974
1976{
1977 if (!id) return;
1978
1979 MWMHintsProperty_t prop;
1980
1981 prop.fDecorations = value;
1982 prop.fFunctions = funcs;
1983 prop.fInputMode = input;
1985
1988}
1989
1990////////////////////////////////////////////////////////////////////////////////
1991/// Tell the window manager the desired window position.
1992
1994{
1995 if (!id) return;
1996
1998
1999 hints.flags = USPosition | PPosition;
2000 hints.x = x;
2001 hints.y = y;
2002
2003 XSetWMNormalHints((Display*)fDisplay, (Window) id, &hints);
2004}
2005
2006////////////////////////////////////////////////////////////////////////////////
2007/// Tell the window manager the desired window size.
2008
2010{
2011 if (!id) return;
2012
2014
2015 hints.flags = USSize | PSize | PBaseSize;
2016 hints.width = hints.base_width = w;
2017 hints.height = hints.base_height = h;
2018
2019 XSetWMNormalHints((Display*)fDisplay, (Window) id, &hints);
2020}
2021
2022////////////////////////////////////////////////////////////////////////////////
2023/// Give the window manager minimum and maximum size hints. Also
2024/// specify via winc and hinc the resize increments.
2025
2029{
2030 if (!id) return;
2031
2033
2034 hints.flags = PMinSize | PMaxSize | PResizeInc;
2035 hints.min_width = (Int_t)wmin;
2036 hints.max_width = (Int_t)wmax;
2037 hints.min_height = (Int_t)hmin;
2038 hints.max_height = (Int_t)hmax;
2039 hints.width_inc = (Int_t)winc;
2040 hints.height_inc = (Int_t)hinc;
2041
2042 XSetWMNormalHints((Display*)fDisplay, (Window) id, &hints);
2043}
2044
2045////////////////////////////////////////////////////////////////////////////////
2046/// Set the initial state of the window. Either kNormalState or kIconicState.
2047
2049{
2050 if (!id) return;
2051
2054
2055 if (state == kNormalState)
2057 if (state == kIconicState)
2059
2060 hints.flags = StateHint;
2061 hints.initial_state = xstate;
2062
2063 XSetWMHints((Display*)fDisplay, (Window) id, &hints);
2064}
2065
2066////////////////////////////////////////////////////////////////////////////////
2067/// Tell window manager that window is a transient window of main.
2068
2070{
2071 if (!id) return;
2072
2074}
2075
2076////////////////////////////////////////////////////////////////////////////////
2077/// Draw a string using a specific graphics context in position (x,y).
2078
2080 const char *s, Int_t len)
2081{
2082 if (!id) return;
2083
2084 XDrawString((Display*)fDisplay, (Drawable) id, (GC) gc, x, y, (char *) s, len);
2085}
2086
2087////////////////////////////////////////////////////////////////////////////////
2088/// Return length of string in pixels. Size depends on font.
2089
2091{
2092 return XTextWidth((XFontStruct*) font, (char*) s, len);
2093}
2094
2095////////////////////////////////////////////////////////////////////////////////
2096/// Return some font properties.
2097
2099{
2100 XFontStruct *f = (XFontStruct *) font;
2101
2102 max_ascent = f->max_bounds.ascent;
2103 max_descent = f->max_bounds.descent;
2104}
2105
2106////////////////////////////////////////////////////////////////////////////////
2107/// Get current values from graphics context gc. Which values of the
2108/// context to get is encoded in the GCValues::fMask member. If fMask = 0
2109/// then copy all fields.
2110
2112{
2114 ULong_t xmask;
2115
2116 if (!gval.fMask) {
2117 // in this case copy all fields
2118 gval.fMask = kMaxUInt;
2119 }
2120
2122
2123 XGetGCValues((Display*)fDisplay, (GC) gc, xmask, &xgval);
2124
2126}
2127
2128////////////////////////////////////////////////////////////////////////////////
2129/// Retrieve associated font structure once we have the font handle.
2130/// Free returned FontStruct_t using FreeFontStruct().
2131
2133{
2134 XFontStruct *fs;
2135
2136 fs = XQueryFont((Display*)fDisplay, (Font) fh);
2137
2138 return (FontStruct_t) fs;
2139}
2140
2141////////////////////////////////////////////////////////////////////////////////
2142/// Free font structure returned by GetFontStruct().
2143
2145{
2146 // in XFree86 4.0 XFreeFontInfo() is broken, ok again in 4.0.1
2147 static int xfree86_400 = -1;
2148 if (xfree86_400 == -1) {
2149 if (strstr(XServerVendor((Display*)fDisplay), "XFree86") &&
2150 XVendorRelease((Display*)fDisplay) == 4000)
2151 xfree86_400 = 1;
2152 else
2153 xfree86_400 = 0;
2154 }
2155
2156 if (xfree86_400 == 0)
2157 XFreeFontInfo(nullptr, (XFontStruct *) fs, 1);
2158}
2159
2160////////////////////////////////////////////////////////////////////////////////
2161/// Clear window.
2162
2164{
2165 if (!id) return;
2166
2167 XClearWindow((Display*)fDisplay, (Window) id);
2168}
2169
2170////////////////////////////////////////////////////////////////////////////////
2171/// Convert a keysym to the appropriate keycode. For example keysym is
2172/// a letter and keycode is the matching keyboard key (which is dependent
2173/// on the current keyboard mapping).
2174
2182
2183////////////////////////////////////////////////////////////////////////////////
2184/// Draw a filled rectangle. Filling is done according to the gc.
2185
2187{
2188 if (!id) return;
2189
2190 XFillRectangle((Display*)fDisplay, (Drawable) id, (GC) gc, x, y, w, h);
2191}
2192
2193////////////////////////////////////////////////////////////////////////////////
2194/// Draw a rectangle outline.
2195
2197{
2198 if (!id) return;
2199
2200 XDrawRectangle((Display*)fDisplay, (Drawable) id, (GC) gc, x, y, w, h);
2201}
2202
2203////////////////////////////////////////////////////////////////////////////////
2204/// Draws multiple line segments. Each line is specified by a pair of points.
2205
2207{
2208 if (!id) return;
2209
2210 XDrawSegments((Display*)fDisplay, (Drawable) id, (GC) gc, (XSegment *) seg, nseg);
2211}
2212
2213////////////////////////////////////////////////////////////////////////////////
2214/// Defines which input events the window is interested in. By default
2215/// events are propagated up the window stack. This mask can also be
2216/// set at window creation time via the SetWindowAttributes_t::fEventMask
2217/// attribute.
2218
2220{
2221 if (!id) return;
2222
2224
2226
2227 XSelectInput((Display*)fDisplay, (Window) id, xevmask);
2228}
2229
2230////////////////////////////////////////////////////////////////////////////////
2231/// Returns the window id of the window having the input focus.
2232
2234{
2235 Window focus;
2236 int return_to;
2237
2238 XGetInputFocus((Display*)fDisplay, &focus, &return_to);
2239 return (Window_t) focus;
2240}
2241
2242////////////////////////////////////////////////////////////////////////////////
2243/// Set keyboard input focus to window id.
2244
2246{
2247 if (!id) return;
2248
2250
2251 XGetWindowAttributes((Display*)fDisplay, (Window) id, &xattr);
2252
2253 if (xattr.map_state == IsViewable)
2255}
2256
2257////////////////////////////////////////////////////////////////////////////////
2258/// Returns the window id of the current owner of the primary selection.
2259/// That is the window in which, for example some text is selected.
2260
2265
2266////////////////////////////////////////////////////////////////////////////////
2267/// Makes the window id the current owner of the primary selection.
2268/// That is the window in which, for example some text is selected.
2269
2271{
2272 if (!id) return;
2273
2275}
2276
2277////////////////////////////////////////////////////////////////////////////////
2278/// XConvertSelection() causes a SelectionRequest event to be sent to the
2279/// current primary selection owner. This event specifies the selection
2280/// property (primary selection), the format into which to convert that
2281/// data before storing it (target = XA_STRING), the property in which
2282/// the owner will place the information (sel_property), the window that
2283/// wants the information (id), and the time of the conversion request
2284/// (when).
2285/// The selection owner responds by sending a SelectionNotify event, which
2286/// confirms the selected atom and type.
2287
2289{
2290 if (!id) return;
2291
2293 (Window) id, (Time) when);
2294}
2295
2296////////////////////////////////////////////////////////////////////////////////
2297/// Convert the keycode from the event structure to a key symbol (according
2298/// to the modifiers specified in the event structure and the current
2299/// keyboard mapping). In buf a null terminated ASCII string is returned
2300/// representing the string that is currently mapped to the key code.
2301
2302void TGX11::LookupString(Event_t *event, char *buf, Int_t buflen, UInt_t &keysym)
2303{
2304 XEvent xev;
2306
2307 MapEvent(*event, &xev);
2308
2309 int n = XLookupString(&xev.xkey, buf, buflen-1, &xkeysym, nullptr);
2310 if (n >= buflen)
2311 Error("LookupString", "buf too small, must be at least %d", n+1);
2312 else
2313 buf[n] = 0;
2314
2315 UInt_t ks, xks = (UInt_t) xkeysym;
2317 keysym = (Int_t) ks;
2318}
2319
2320////////////////////////////////////////////////////////////////////////////////
2321/// Map to and from X key symbols. Keysym are the values returned by
2322/// XLookUpString.
2323
2325{
2326 if (tox) {
2328 if (keysym < 127) {
2329 xkeysym = keysym;
2330 } else if (keysym >= kKey_F1 && keysym <= kKey_F35) {
2331 xkeysym = XK_F1 + (keysym - (UInt_t)kKey_F1); // function keys
2332 } else {
2333 for (int i = 0; gKeyMap[i].fKeySym; i++) { // any other keys
2334 if (keysym == (UInt_t) gKeyMap[i].fKeySym) {
2335 xkeysym = (UInt_t) gKeyMap[i].fXKeySym;
2336 break;
2337 }
2338 }
2339 }
2340 } else {
2342 // commentary in X11/keysymdef says that X codes match ASCII
2343 if (xkeysym < 127) {
2344 keysym = xkeysym;
2345 } else if (xkeysym >= XK_F1 && xkeysym <= XK_F35) {
2346 keysym = kKey_F1 + (xkeysym - XK_F1); // function keys
2347 } else if (xkeysym >= XK_KP_0 && xkeysym <= XK_KP_9) {
2348 keysym = kKey_0 + (xkeysym - XK_KP_0); // numeric keypad keys
2349 } else {
2350 for (int i = 0; gKeyMap[i].fXKeySym; i++) { // any other keys
2351 if (xkeysym == gKeyMap[i].fXKeySym) {
2352 keysym = (UInt_t) gKeyMap[i].fKeySym;
2353 break;
2354 }
2355 }
2356 }
2357 }
2358}
2359
2360////////////////////////////////////////////////////////////////////////////////
2361/// Get contents of paste buffer atom into string. If del is true delete
2362/// the paste buffer afterwards.
2363
2365 Bool_t del)
2366{
2367 if (!id) return;
2368
2369 Atom actual_type, property = (Atom) atom;
2370 int actual_format;
2372 unsigned char *data;
2373
2374 nchar = 0;
2375 text = "";
2376
2377 if (property == None) return;
2378
2379 // get past buffer
2380 nread = 0;
2381 do {
2382 if (XGetWindowProperty((Display*)fDisplay, (Window) id, property,
2383 nread/4, 1024, (Bool)del,
2387 (unsigned char **) &data)
2388 != Success)
2389 break;
2390
2391 if (actual_type != XA_STRING) break;
2392
2393 text.Insert((Int_t) nread, (const char *) data, (Int_t) nitems);
2394 nread += nitems;
2395 XFree(data);
2396
2397 } while (bytes_after > 0);
2398
2399 nchar = (Int_t) nread;
2400}
2401
2402////////////////////////////////////////////////////////////////////////////////
2403/// TranslateCoordinates translates coordinates from the frame of
2404/// reference of one window to another. If the point is contained
2405/// in a mapped child of the destination, the id of that child is
2406/// returned as well.
2407
2410{
2411 if (!src || !dest) return;
2412
2413 Window xchild;
2414
2416 src_y, &dest_x, &dest_y, &xchild);
2417 child = (Window_t) xchild;
2418}
2419
2420////////////////////////////////////////////////////////////////////////////////
2421/// Return geometry of window (should be called GetGeometry but signature
2422/// already used).
2423
2425{
2426 if (!id) return;
2427
2428 Window wdummy;
2429 UInt_t bdum, ddum;
2430
2431 XGetGeometry((Display*)fDisplay, (Drawable) id, &wdummy, &x, &y, &w, &h, &bdum, &ddum);
2432}
2433
2434////////////////////////////////////////////////////////////////////////////////
2435/// FillPolygon fills the region closed by the specified path.
2436/// The path is closed automatically if the last point in the list does
2437/// not coincide with the first point. All point coordinates are
2438/// treated as relative to the origin. For every pair of points
2439/// inside the polygon, the line segment connecting them does not
2440/// intersect the path.
2441
2443{
2444 if (!id) return;
2445
2446 XFillPolygon((Display*)fDisplay, (Window) id, (GC) gc, (XPoint *) points, npnt,
2448}
2449
2450////////////////////////////////////////////////////////////////////////////////
2451/// Returns the root window the pointer is logically on and the pointer
2452/// coordinates relative to the root window's origin.
2453/// The pointer coordinates returned to win_x and win_y are relative to
2454/// the origin of the specified window. In this case, QueryPointer returns
2455/// the child that contains the pointer, if any, or else kNone to
2456/// childw. QueryPointer returns the current logical state of the
2457/// keyboard buttons and the modifier keys in mask.
2458
2462{
2463 if (!id) return;
2464
2466 UInt_t xmask;
2467
2468 XQueryPointer((Display*)fDisplay, (Window) id, &xrootw, &xchildw,
2469 &root_x, &root_y, &win_x, &win_y, &xmask);
2470
2471 rootw = (Window_t) xrootw;
2473
2475}
2476
2477////////////////////////////////////////////////////////////////////////////////
2478/// Set foreground color in graphics context (shortcut for ChangeGC with
2479/// only foreground mask set).
2480
2485
2486////////////////////////////////////////////////////////////////////////////////
2487/// Set clipping rectangles in graphics context. X, Y specify the origin
2488/// of the rectangles. Recs specifies an array of rectangles that define
2489/// the clipping mask and n is the number of rectangles.
2490
2495
2496////////////////////////////////////////////////////////////////////////////////
2497/// Flush (mode = 0, default) or synchronize (mode = 1) X output buffer.
2498/// Flush flushes output buffer. Sync flushes buffer and waits till all
2499/// requests have been processed by X server.
2500
2502{
2503 if (mode == 0)
2504 XFlush((Display*)fDisplay);
2505 if (mode == 1)
2506 XSync((Display*)fDisplay, False);
2507}
2508
2509////////////////////////////////////////////////////////////////////////////////
2510/// Create a new empty region.
2511
2516
2517////////////////////////////////////////////////////////////////////////////////
2518/// Destroy region.
2519
2524
2525////////////////////////////////////////////////////////////////////////////////
2526/// Union of rectangle with a region.
2527
2533
2534////////////////////////////////////////////////////////////////////////////////
2535/// Create region for the polygon defined by the points array.
2536/// If winding is true use WindingRule else EvenOddRule as fill rule.
2537
2543
2544////////////////////////////////////////////////////////////////////////////////
2545/// Compute the union of rega and regb and return result region.
2546/// The output region may be the same result region.
2547
2552
2553////////////////////////////////////////////////////////////////////////////////
2554/// Compute the intersection of rega and regb and return result region.
2555/// The output region may be the same as the result region.
2556
2561
2562////////////////////////////////////////////////////////////////////////////////
2563/// Subtract rega from regb.
2564
2569
2570////////////////////////////////////////////////////////////////////////////////
2571/// Calculate the difference between the union and intersection of
2572/// two regions.
2573
2578
2579////////////////////////////////////////////////////////////////////////////////
2580/// Return true if the region is empty.
2581
2586
2587////////////////////////////////////////////////////////////////////////////////
2588/// Returns true if the point x,y is in the region.
2589
2594
2595////////////////////////////////////////////////////////////////////////////////
2596/// Returns true if two regions are equal.
2597
2602
2603////////////////////////////////////////////////////////////////////////////////
2604/// Return smallest enclosing rectangle.
2605
2610
2611////////////////////////////////////////////////////////////////////////////////
2612/// Return list of font names matching fontname regexp, like "-*-times-*".
2613
2614char **TGX11::ListFonts(const char *fontname, Int_t max, Int_t &count)
2615{
2616 char **fontlist;
2617 Int_t fontcount = 0;
2618 fontlist = XListFonts((Display*)fDisplay, (char *)fontname, max, &fontcount);
2619 count = fontcount;
2620 return fontlist;
2621}
2622
2623////////////////////////////////////////////////////////////////////////////////
2624/// Free list of font names.
2625
2630
2631////////////////////////////////////////////////////////////////////////////////
2632/// Create a client-side XImage. Returns handle to XImage.
2633
2635{
2637
2638 if (fDepth <= 8)
2639 bitmap_pad = 8;
2640 else if (fDepth <= 16)
2641 bitmap_pad = 16;
2642 else
2643 bitmap_pad = 32;
2644
2646 0, nullptr, width, height, bitmap_pad, 0);
2647
2648 // use calloc since Xlib will use free() in XDestroyImage
2649 if (xim) xim->data = (char *) calloc(xim->bytes_per_line * xim->height, 1);
2650
2651 return (Drawable_t) xim;
2652}
2653
2654////////////////////////////////////////////////////////////////////////////////
2655/// Get size of XImage img.
2656
2658{
2659 width = ((XImage*)img)->width;
2660 height = ((XImage*)img)->height;
2661}
2662
2663////////////////////////////////////////////////////////////////////////////////
2664/// Set pixel at specified location in XImage img.
2665
2670
2671////////////////////////////////////////////////////////////////////////////////
2672/// Put (x,y,w,h) part of image img in window win at position dx,dy.
2673
2676{
2677 if (!win) return;
2678
2679 XPutImage((Display*)fDisplay, (Drawable) win, (GC) gc, (XImage*) img,
2680 x, y, dx, dy, w, h);
2681}
2682
2683////////////////////////////////////////////////////////////////////////////////
2684/// Destroy XImage img.
2685
2690
2691////////////////////////////////////////////////////////////////////////////////
2692/// The Nonrectangular Window Shape Extension adds nonrectangular
2693/// windows to the System.
2694/// This allows for making shaped (partially transparent) windows
2695
2697{
2698 XShapeCombineMask((Display*)fDisplay, (Window) id, ShapeBounding, x, y,
2699 (Pixmap) mask, ShapeSet);
2700}
2701
2702////////////////////////////////////////////////////////////////////////////////
2703/// Returns the width of the screen in millimeters.
2704
2709
2710////////////////////////////////////////////////////////////////////////////////
2711/// Deletes the specified property only if the property was defined on the
2712/// specified window and causes the X server to generate a PropertyNotify
2713/// event on the window unless the property does not exist.
2714
2719
2720////////////////////////////////////////////////////////////////////////////////
2721/// Returns the actual type of the property; the actual format of the property;
2722/// the number of 8-bit, 16-bit, or 32-bit items transferred; the number of
2723/// bytes remaining to be read in the property; and a pointer to the data
2724/// actually returned.
2725
2734
2735////////////////////////////////////////////////////////////////////////////////
2736/// Changes the specified dynamic parameters if the pointer is actively
2737/// grabbed by the client.
2738
2748
2749////////////////////////////////////////////////////////////////////////////////
2750/// Requests that the specified selection be converted to the specified
2751/// target type.
2752
2758
2759////////////////////////////////////////////////////////////////////////////////
2760/// Changes the owner and last-change time for the specified selection
2761
2763{
2764 return XSetSelectionOwner((Display*)fDisplay, sel, owner, CurrentTime);
2765}
2766
2767////////////////////////////////////////////////////////////////////////////////
2768/// This function alters the property for the specified window and
2769/// causes the X server to generate a PropertyNotify event on that
2770/// window.
2771
2774{
2775 if (!id) return;
2776
2777 XChangeProperty((Display*)fDisplay, (Window) id, (Atom) property, (Atom) type,
2779}
2780
2781////////////////////////////////////////////////////////////////////////////////
2782/// Add XdndAware property and the list of drag and drop types to the
2783/// Window win.
2784
2786{
2787 unsigned char version = 4;
2788 Atom_t dndaware = InternAtom("XdndAware", kFALSE);
2790 32, PropModeReplace, (unsigned char *) &version, 1);
2791
2792 if (typelist) {
2793 int n;
2794
2795 for (n = 0; typelist[n]; n++) { }
2796 if (n > 0) {
2798 (unsigned char *) typelist, n);
2799 }
2800 }
2801}
2802
2803////////////////////////////////////////////////////////////////////////////////
2804/// Add the list of drag and drop types to the Window win.
2805
2807{
2808 if (typelist) {
2809 int n;
2810 for (n = 0; typelist[n]; n++) { }
2811 if (n > 0) {
2813 (unsigned char *) typelist, n);
2814 }
2815 }
2816}
2817
2818////////////////////////////////////////////////////////////////////////////////
2819/// Recursively search in the children of Window for a Window which is at
2820/// location x, y and is DND aware, with a maximum depth of maxd.
2821/// Possibility to exclude dragwin and input.
2822
2824 int x, int y, int maxd)
2825{
2827 static Atom_t *dndTypeList = nullptr;
2828
2829 if (!dndTypeList) {
2830 dndTypeList = new Atom_t[3];
2831 dndTypeList[0] = InternAtom("application/root", kFALSE);
2832 dndTypeList[1] = InternAtom("text/uri-list", kFALSE);
2833 dndTypeList[2] = 0;
2834 }
2835
2836 if (maxd <= 0) return kNone;
2837
2838 if (win == dragwin || win == input) return kNone;
2839
2841 if (wattr.fMapState != kIsUnmapped &&
2842 x >= wattr.fX && x < wattr.fX + wattr.fWidth &&
2843 y >= wattr.fY && y < wattr.fY + wattr.fHeight) {
2844
2845 if (IsDNDAware(win, dndTypeList)) return win;
2846
2847 Window r, p, *children;
2848 UInt_t numch;
2849 int i;
2850
2851 if (XQueryTree((Display*)fDisplay, win, &r, &p, &children, &numch)) {
2852 if (children && numch > 0) {
2853 r = kNone;
2854 // upon return from XQueryTree, children are listed in the current
2855 // stacking order, from bottom-most (first) to top-most (last)
2856 for (i = numch-1; i >= 0; --i) {
2857 r = FindRWindow((Window_t)children[i], dragwin, input,
2858 x - wattr.fX, y - wattr.fY, maxd-1);
2859 if (r != kNone) break;
2860 }
2861 XFree(children);
2862 if (r != kNone) return r;
2863 }
2864 return kNone; //win; // ?!?
2865 }
2866 }
2867 return kNone;
2868}
2869
2870////////////////////////////////////////////////////////////////////////////////
2871/// Checks if Window win is DND aware, and knows any of the DND formats
2872/// passed in argument.
2873
2875{
2876 Atom_t actual;
2877 Int_t format;
2878 ULong_t count, remaining;
2879 unsigned char *data = nullptr;
2880 Atom_t *types, *t;
2881 Int_t result = kTRUE;
2882 static Atom_t dndaware = kNone;
2883
2884 if (win == kNone) return kFALSE;
2885
2886 if (dndaware == kNone)
2887 dndaware = InternAtom("XdndAware", kFALSE);
2888
2889 XGetWindowProperty((Display*)fDisplay, win, dndaware, 0, 0x8000000L, kFALSE,
2890 XA_ATOM, &actual, &format, &count, &remaining, &data);
2891
2892 if ((actual != XA_ATOM) || (format != 32) || (count == 0) || !data) {
2893 if (data) XFree(data);
2894 return kFALSE;
2895 }
2896
2897 types = (Atom_t *) data;
2898
2899 if ((count > 1) && typelist) {
2900 result = kFALSE;
2901 for (t = typelist; *t; t++) {
2902 for (ULong_t j = 1; j < count; j++) {
2903 if (types[j] == *t) {
2904 result = kTRUE;
2905 break;
2906 }
2907 }
2908 if (result) break;
2909 }
2910 }
2911 XFree(data);
2912 return result;
2913}
const Int_t kPropMotifWMHintsElements
Definition GX11Gui.cxx:56
static KeySymbolMap_t gKeyMap[]
Definition GX11Gui.cxx:70
static Int_t RootX11IOErrorHandler(Display *)
Handle X11 I/O error (happens when connection to display server is broken).
Definition GX11Gui.cxx:197
const ULong_t kMWMHintsInputMode
Definition GX11Gui.cxx:54
const ULong_t kMWMHintsDecorations
Definition GX11Gui.cxx:53
const Int_t kPropMWMHintElements
Definition GX11Gui.cxx:57
const ULong_t kMWMHintsFunctions
Definition GX11Gui.cxx:52
void AsmLong(Long_t i1, Long_t i2, Long_t &ll)
Definition GX11Gui.cxx:156
static Int_t RootX11ErrorHandler(Display *disp, XErrorEvent *err)
Handle X11 error.
Definition GX11Gui.cxx:168
void SplitLong(Long_t ll, Long_t &i1, Long_t &i2)
Definition GX11Gui.cxx:145
Handle_t Atom_t
WM token.
Definition GuiTypes.h:38
Handle_t Region_t
Region handle.
Definition GuiTypes.h:33
const Mask_t kGCCapStyle
Definition GuiTypes.h:293
const Mask_t kGCArcMode
Definition GuiTypes.h:309
EGEventType
Definition GuiTypes.h:60
@ kSelectionClear
Definition GuiTypes.h:64
@ kColormapNotify
Definition GuiTypes.h:65
@ kConfigureNotify
Definition GuiTypes.h:63
@ kGKeyPress
Definition GuiTypes.h:61
@ kExpose
Definition GuiTypes.h:63
@ kUnmapNotify
Definition GuiTypes.h:63
@ kButtonRelease
Definition GuiTypes.h:61
@ kSelectionNotify
Definition GuiTypes.h:64
@ kButtonPress
Definition GuiTypes.h:61
@ kFocusOut
Definition GuiTypes.h:62
@ kDestroyNotify
Definition GuiTypes.h:63
@ kMotionNotify
Definition GuiTypes.h:62
@ kFocusIn
Definition GuiTypes.h:62
@ kClientMessage
Definition GuiTypes.h:64
@ kEnterNotify
Definition GuiTypes.h:62
@ kSelectionRequest
Definition GuiTypes.h:64
@ kMapNotify
Definition GuiTypes.h:63
@ kOtherEvent
Definition GuiTypes.h:65
@ kKeyRelease
Definition GuiTypes.h:61
@ kLeaveNotify
Definition GuiTypes.h:62
const Mask_t kWABorderPixel
Definition GuiTypes.h:143
const Mask_t kWAOverrideRedirect
Definition GuiTypes.h:150
const Mask_t kWABitGravity
Definition GuiTypes.h:145
const Mask_t kGCDashOffset
Definition GuiTypes.h:307
const Mask_t kGCBackground
Definition GuiTypes.h:290
const Mask_t kGCForeground
Definition GuiTypes.h:289
const Mask_t kPAReturnPixels
Definition GuiTypes.h:342
const Mask_t kGCLineStyle
Definition GuiTypes.h:292
const Mask_t kWADontPropagate
Definition GuiTypes.h:153
const Mask_t kKeyMod5Mask
Definition GuiTypes.h:203
const Mask_t kGCSubwindowMode
Definition GuiTypes.h:302
const Mask_t kGCLineWidth
Definition GuiTypes.h:291
ECursor
Definition GuiTypes.h:373
@ kHand
Definition GuiTypes.h:375
Handle_t Pixmap_t
Pixmap handle.
Definition GuiTypes.h:31
const Mask_t kKeyMod4Mask
Definition GuiTypes.h:202
const Mask_t kPADepth
Definition GuiTypes.h:339
const Mask_t kGCTile
Definition GuiTypes.h:297
const Mask_t kWAColormap
Definition GuiTypes.h:154
const Mask_t kButtonMotionMask
Definition GuiTypes.h:165
const Mask_t kKeyMod3Mask
Definition GuiTypes.h:201
const Mask_t kGCClipXOrigin
Definition GuiTypes.h:304
const Mask_t kWABackingStore
Definition GuiTypes.h:147
const Mask_t kFocusChangeMask
Definition GuiTypes.h:170
const Mask_t kKeyLockMask
Definition GuiTypes.h:197
const Mask_t kButtonPressMask
Definition GuiTypes.h:162
const Mask_t kPACloseness
Definition GuiTypes.h:343
Handle_t FontH_t
Font handle (as opposed to Font_t which is an index)
Definition GuiTypes.h:36
const Mask_t kKeyMod1Mask
typically the Alt key
Definition GuiTypes.h:199
Handle_t Visual_t
Visual handle.
Definition GuiTypes.h:28
const Mask_t kGCDashList
Definition GuiTypes.h:308
const Mask_t kExposureMask
Definition GuiTypes.h:166
const Mask_t kWAEventMask
Definition GuiTypes.h:152
const Mask_t kGCFillStyle
Definition GuiTypes.h:295
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
const Mask_t kGCJoinStyle
Definition GuiTypes.h:294
const Mask_t kKeyReleaseMask
Definition GuiTypes.h:161
const Mask_t kDoRed
Definition GuiTypes.h:320
const Mask_t kWASaveUnder
Definition GuiTypes.h:151
const Mask_t kWABackPixel
Definition GuiTypes.h:141
Handle_t Display_t
Display handle.
Definition GuiTypes.h:27
const Mask_t kWAWinGravity
Definition GuiTypes.h:146
const Mask_t kGCFunction
Definition GuiTypes.h:287
const Mask_t kOwnerGrabButtonMask
Definition GuiTypes.h:171
const Mask_t kAnyModifier
Definition GuiTypes.h:211
EGraphicsFunction
Definition GuiTypes.h:68
const Mask_t kKeyPressMask
Definition GuiTypes.h:160
ULong_t Time_t
Event time.
Definition GuiTypes.h:43
Handle_t GContext_t
Graphics context handle.
Definition GuiTypes.h:39
EInitialState
Initial window mapping state.
Definition GuiTypes.h:346
@ kNormalState
Definition GuiTypes.h:347
@ kIconicState
Definition GuiTypes.h:348
const Mask_t kButton1Mask
Definition GuiTypes.h:204
const Mask_t kGCTileStipXOrigin
Definition GuiTypes.h:299
Handle_t Drawable_t
Drawable handle.
Definition GuiTypes.h:32
const Mask_t kWABackingPixel
Definition GuiTypes.h:149
const Mask_t kColormapChangeMask
Definition GuiTypes.h:172
const Mask_t kGCFont
Definition GuiTypes.h:301
const Mask_t kPointerMotionMask
Definition GuiTypes.h:164
const Mask_t kKeyShiftMask
Definition GuiTypes.h:196
Handle_t Cursor_t
Cursor handle.
Definition GuiTypes.h:35
const Handle_t kNone
Definition GuiTypes.h:89
const Mask_t kKeyControlMask
Definition GuiTypes.h:198
const Mask_t kKeyMod2Mask
typically mod on numeric keys
Definition GuiTypes.h:200
const Mask_t kButton3Mask
Definition GuiTypes.h:206
const Mask_t kLeaveWindowMask
Definition GuiTypes.h:169
const Mask_t kStructureNotifyMask
Definition GuiTypes.h:167
@ kInputOutput
Definition GuiTypes.h:48
@ kWhenMapped
Definition GuiTypes.h:46
@ kNotUseful
Definition GuiTypes.h:46
@ kIsUnmapped
Definition GuiTypes.h:47
@ kAlways
Definition GuiTypes.h:46
@ kInputOnly
Definition GuiTypes.h:48
const Mask_t kButton2Mask
Definition GuiTypes.h:205
const Handle_t kParentRelative
Definition GuiTypes.h:91
const Mask_t kPAColormap
Definition GuiTypes.h:338
const Mask_t kGCFillRule
Definition GuiTypes.h:296
const Mask_t kGCPlaneMask
Definition GuiTypes.h:288
const Mask_t kGCStipple
Definition GuiTypes.h:298
const Mask_t kButtonReleaseMask
Definition GuiTypes.h:163
const Mask_t kGCGraphicsExposures
Definition GuiTypes.h:303
const Mask_t kGCClipYOrigin
Definition GuiTypes.h:305
const Mask_t kDoGreen
Definition GuiTypes.h:321
const Mask_t kWABorderPixmap
Definition GuiTypes.h:142
const Mask_t kPASize
width and height
Definition GuiTypes.h:340
const Mask_t kEnterWindowMask
Definition GuiTypes.h:168
const Mask_t kGCClipMask
Definition GuiTypes.h:306
const Mask_t kDoBlue
Definition GuiTypes.h:322
const Mask_t kPAHotspot
x and y hotspot
Definition GuiTypes.h:341
const Mask_t kGCTileStipYOrigin
Definition GuiTypes.h:300
const Mask_t kWACursor
Definition GuiTypes.h:155
EMouseButton
Button names.
Definition GuiTypes.h:215
Handle_t Colormap_t
Colormap handle.
Definition GuiTypes.h:34
const Mask_t kWABackPixmap
Definition GuiTypes.h:140
const Mask_t kWABorderWidth
Definition GuiTypes.h:144
ULongptr_t Handle_t
Generic resource handle.
Definition GuiTypes.h:26
Handle_t FontStruct_t
Pointer to font structure.
Definition GuiTypes.h:40
const Mask_t kWABackingPlanes
Definition GuiTypes.h:148
EKeySym
Definition KeySymbols.h:25
@ kKey_Right
Definition KeySymbols.h:42
@ kKey_Down
Definition KeySymbols.h:43
@ kKey_Unknown
Definition KeySymbols.h:189
@ kKey_Meta
Definition KeySymbols.h:51
@ kKey_Print
Definition KeySymbols.h:35
@ kKey_Space
Definition KeySymbols.h:93
@ kKey_F1
Definition KeySymbols.h:57
@ kKey_PageDown
Definition KeySymbols.h:47
@ kKey_F4
Definition KeySymbols.h:60
@ kKey_CapsLock
Definition KeySymbols.h:53
@ kKey_Up
Definition KeySymbols.h:41
@ kKey_Return
Definition KeySymbols.h:30
@ kKey_Alt
Definition KeySymbols.h:52
@ kKey_Next
Definition KeySymbols.h:46
@ kKey_Comma
Definition KeySymbols.h:105
@ kKey_ScrollLock
Definition KeySymbols.h:55
@ kKey_Asterisk
Definition KeySymbols.h:103
@ kKey_Delete
Definition KeySymbols.h:33
@ kKey_0
Definition KeySymbols.h:109
@ kKey_Prior
Definition KeySymbols.h:44
@ kKey_F3
Definition KeySymbols.h:59
@ kKey_Left
Definition KeySymbols.h:40
@ kKey_Escape
Definition KeySymbols.h:26
@ kKey_Shift
Definition KeySymbols.h:49
@ kKey_Backspace
Definition KeySymbols.h:29
@ kKey_Home
Definition KeySymbols.h:38
@ kKey_F35
Definition KeySymbols.h:91
@ kKey_Insert
Definition KeySymbols.h:32
@ kKey_Enter
Definition KeySymbols.h:31
@ kKey_Plus
Definition KeySymbols.h:104
@ kKey_Control
Definition KeySymbols.h:50
@ kKey_Tab
Definition KeySymbols.h:27
@ kKey_Slash
Definition KeySymbols.h:108
@ kKey_Period
Definition KeySymbols.h:107
@ kKey_Backtab
Definition KeySymbols.h:28
@ kKey_SysReq
Definition KeySymbols.h:36
@ kKey_End
Definition KeySymbols.h:39
@ kKey_Equal
Definition KeySymbols.h:122
@ kKey_NumLock
Definition KeySymbols.h:54
@ kKey_F2
Definition KeySymbols.h:58
@ kKey_PageUp
Definition KeySymbols.h:45
@ kKey_Pause
Definition KeySymbols.h:34
@ kKey_Minus
Definition KeySymbols.h:106
#define SafeDelete(p)
Definition RConfig.hxx:525
#define f(i)
Definition RSha256.hxx:104
#define a(i)
Definition RSha256.hxx:99
#define h(i)
Definition RSha256.hxx:106
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:77
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char)
Definition RtypesCore.h:52
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
Definition RtypesCore.h:69
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
Definition RtypesCore.h:68
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
Definition RtypesCore.h:60
constexpr UInt_t kMaxUInt
Definition RtypesCore.h:118
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
#define BIT(n)
Definition Rtypes.h:91
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TEnv * gEnv
Definition TEnv.h:126
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:208
R__EXTERN void Throw(int code)
If an exception context has been set (using the TRY and RETRY macros) jump back to where it was set.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t stamp
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg InternAtom
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t GetWindowSize
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t regb
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t pict_mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest_x
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t cursor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t hmin
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void cmap
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t atom
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t act_type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t pict
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t del
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t GetWindowAttributes
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t hmax
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pixel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmin
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void clipboard
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t act_format
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t rect
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t recs
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h prop
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t child
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char cname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void curid
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void foreground
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char bitmap
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t nitems
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char forecolor
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h req_type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void funcs
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src_y
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t win
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest_y
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t winc
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t modifier
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t org
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char backcolor
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t npnt
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t nchar
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char fontname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src_x
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t Atom_t typelist
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void main_id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t grab
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void when
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t bytes
Option_t Option_t TPoint TPoint percent
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t evmask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize fs
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t gval
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t rega
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void reg
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmax
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t property
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pxm
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t hinc
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t confine
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void gc
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t button
Option_t Option_t TPoint TPoint const char text
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char atom_name
Option_t Option_t TPoint TPoint const char y1
unsigned long KeySym
Definition TGWin32.h:52
char name[80]
Definition TGX11.cxx:148
XID Colormap
Definition TGX11.h:37
XID Window
Definition TGX11.h:38
XID Drawable
Definition TGX11.h:35
XID Cursor
Definition TGX11.h:36
#define gROOT
Definition TROOT.h:417
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2496
R__EXTERN TSystem * gSystem
Definition TSystem.h:582
R__EXTERN TFileHandler * gXDisplay
Definition TSystem.h:583
#define gVirtualX
Definition TVirtualX.h:377
R__EXTERN Atom_t gMOTIF_WM_HINTS
Definition TVirtualX.h:39
R__EXTERN Atom_t gWM_DELETE_WINDOW
Definition TVirtualX.h:38
#define free
Definition civetweb.c:1578
#define calloc
Definition civetweb.c:1576
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition TEnv.cxx:511
void * fDisplay
Pointer to display.
Definition TGX11.h:100
Region_t PolygonRegion(Point_t *points, Int_t np, Bool_t winding) override
Create region for the polygon defined by the points array.
Definition GX11Gui.cxx:2538
void FillRectangle(Drawable_t id, GContext_t gc, Int_t x, Int_t y, UInt_t w, UInt_t h) override
Draw a filled rectangle. Filling is done according to the gc.
Definition GX11Gui.cxx:2186
void SetPrimarySelectionOwner(Window_t id) override
Makes the window id the current owner of the primary selection.
Definition GX11Gui.cxx:2270
Pixmap_t CreateBitmap(Drawable_t id, const char *bitmap, UInt_t width, UInt_t height) override
Create a bitmap (i.e. pixmap with depth 1) from the bitmap data.
Definition GX11Gui.cxx:1082
Colormap fColormap
Default colormap, 0 if b/w.
Definition TGX11.h:104
void SetMWMHints(Window_t id, UInt_t value, UInt_t funcs, UInt_t input) override
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
Definition GX11Gui.cxx:1975
void GetRegionBox(Region_t reg, Rectangle_t *) override
Return smallest enclosing rectangle.
Definition GX11Gui.cxx:2606
void FreeFontStruct(FontStruct_t fs) override
Free font structure returned by GetFontStruct().
Definition GX11Gui.cxx:2144
Int_t GetProperty(Window_t, Atom_t, Long_t, Long_t, Bool_t, Atom_t, Atom_t *, Int_t *, ULong_t *, ULong_t *, unsigned char **) override
Returns the actual type of the property; the actual format of the property; the number of 8-bit,...
Definition GX11Gui.cxx:2726
void ConvertPrimarySelection(Window_t id, Atom_t clipboard, Time_t when) override
XConvertSelection() causes a SelectionRequest event to be sent to the current primary selection owner...
Definition GX11Gui.cxx:2288
void MapEvent(Event_t &ev, void *xev, Bool_t tox=kTRUE)
Map Event_t structure to XEvent structure.
Definition GX11Gui.cxx:1483
void ChangeGC(GContext_t gc, GCValues_t *gval) override
Change entries in an existing graphics context, gc, by values from gval.
Definition GX11Gui.cxx:993
void ResizeWindow(Int_t wid) override
Resize the current window if necessary.
Definition TGX11.cxx:2052
Bool_t SetSelectionOwner(Window_t, Atom_t &) override
Changes the owner and last-change time for the specified selection.
Definition GX11Gui.cxx:2762
Pixmap_t CreatePixmap(Drawable_t id, UInt_t w, UInt_t h) override
Creates a pixmap of the width and height you specified and returns a pixmap ID that identifies it.
Definition GX11Gui.cxx:1062
void IconifyWindow(Window_t id) override
Iconify the window.
Definition GX11Gui.cxx:330
void SetWindowBackgroundPixmap(Window_t id, Pixmap_t pxm) override
Set pixmap as window background.
Definition GX11Gui.cxx:360
FontStruct_t LoadQueryFont(const char *font_name) override
Load font and query font.
Definition GX11Gui.cxx:941
void SetWMPosition(Window_t id, Int_t x, Int_t y) override
Tell the window manager the desired window position.
Definition GX11Gui.cxx:1993
void SetCursor(Int_t win, ECursor cursor) override
Set the cursor.
Definition TGX11.cxx:2211
Int_t fScreenNumber
Screen number.
Definition TGX11.h:107
Window_t GetParent(Window_t id) const override
Return the parent of the window.
Definition GX11Gui.cxx:920
void GetWindowSize(Drawable_t id, Int_t &x, Int_t &y, UInt_t &w, UInt_t &h) override
Return geometry of window (should be called GetGeometry but signature already used).
Definition GX11Gui.cxx:2424
void ChangeActivePointerGrab(Window_t, UInt_t, Cursor_t) override
Changes the specified dynamic parameters if the pointer is actively grabbed by the client.
Definition GX11Gui.cxx:2739
void SetInputFocus(Window_t id) override
Set keyboard input focus to window id.
Definition GX11Gui.cxx:2245
void SetWMState(Window_t id, EInitialState state) override
Set the initial state of the window. Either kNormalState or kIconicState.
Definition GX11Gui.cxx:2048
Bool_t ReadPictureDataFromFile(const char *filename, char ***ret_data) override
Read picture data from file and store in ret_data.
Definition GX11Gui.cxx:1278
void SetWindowHint(Window_t id, EWindowHint hint) override
This function alters the property for the specified window and causes the X server to generate a Prop...
Definition GX11Gui.cxx:1733
Cursor fCursors[kNumCursors]
List of cursors.
Definition TGX11.h:71
void GrabKey(Window_t id, Int_t keycode, UInt_t modifier, Bool_t grab=kTRUE) override
Establish passive grab on a certain key.
Definition GX11Gui.cxx:1846
Bool_t AllocColor(Colormap cmap, RXColor *color)
Allocate color in colormap.
Definition TGX11.cxx:344
void GetWindowAttributes(Window_t id, WindowAttributes_t &attr) override
Get window attributes and return filled in attributes structure.
Definition GX11Gui.cxx:763
void MapSubwindows(Window_t id) override
Map sub windows.
Definition GX11Gui.cxx:227
void SetDNDAware(Window_t, Atom_t *) override
Add XdndAware property and the list of drag and drop types to the Window win.
Definition GX11Gui.cxx:2785
Bool_t IsDNDAware(Window_t win, Atom_t *typelist) override
Checks if Window win is DND aware, and knows any of the DND formats passed in argument.
Definition GX11Gui.cxx:2874
void SetIconPixmap(Window_t id, Pixmap_t pic) override
Set pixmap the WM can use when the window is iconized.
Definition GX11Gui.cxx:1946
void MapEventMask(UInt_t &emask, UInt_t &xemask, Bool_t tox=kTRUE)
Map event mask to or from X.
Definition GX11Gui.cxx:402
void SetClipRectangles(GContext_t gc, Int_t x, Int_t y, Rectangle_t *recs, Int_t n) override
Set clipping rectangles in graphics context.
Definition GX11Gui.cxx:2491
void LowerWindow(Window_t id) override
Lower window so it lays below all its siblings.
Definition GX11Gui.cxx:287
void DeleteImage(Drawable_t img) override
Destroy XImage img.
Definition GX11Gui.cxx:2686
Int_t KeysymToKeycode(UInt_t keysym) override
Convert a keysym to the appropriate keycode.
Definition GX11Gui.cxx:2175
Int_t GetScreen() const override
Returns screen number (might be useful in some cases where direct X11 manipulation outside of TVirtua...
Definition GX11Gui.cxx:881
Int_t GetDepth() const override
Returns depth of screen (number of bit planes).
Definition GX11Gui.cxx:890
void GetPasteBuffer(Window_t id, Atom_t atom, TString &text, Int_t &nchar, Bool_t del) override
Get contents of paste buffer atom into string.
Definition GX11Gui.cxx:2364
void SelectInput(Window_t id, UInt_t evmask) override
Defines which input events the window is interested in.
Definition GX11Gui.cxx:2219
void MapWindow(Window_t id) override
Map window on screen.
Definition GX11Gui.cxx:217
void IntersectRegion(Region_t rega, Region_t regb, Region_t result) override
Compute the intersection of rega and regb and return result region.
Definition GX11Gui.cxx:2557
Bool_t CreatePictureFromFile(Drawable_t id, const char *filename, Pixmap_t &pict, Pixmap_t &pict_mask, PictureAttributes_t &attr) override
Create a picture pixmap from data on file.
Definition GX11Gui.cxx:1183
Visual_t GetVisual() const override
Returns handle to visual (might be useful in some cases where direct X11 manipulation outside of TVir...
Definition GX11Gui.cxx:861
Bool_t PointInRegion(Int_t x, Int_t y, Region_t reg) override
Returns true if the point x,y is in the region.
Definition GX11Gui.cxx:2590
void MapKeySym(UInt_t &keysym, UInt_t &xkeysym, Bool_t tox=kTRUE)
Map to and from X key symbols.
Definition GX11Gui.cxx:2324
void PutPixel(Drawable_t id, Int_t x, Int_t y, ULong_t pixel) override
Set pixel at specified location in XImage img.
Definition GX11Gui.cxx:2666
GContext_t CreateGC(Drawable_t id, GCValues_t *gval) override
Create a graphics context using the values set in gval (but only for those entries that are in the ma...
Definition GX11Gui.cxx:971
Window_t GetDefaultRootWindow() const override
Return handle to the default root window created when calling XOpenDisplay().
Definition GX11Gui.cxx:912
Bool_t fHasXft
True when XftFonts are used.
Definition TGX11.h:119
void MoveResizeWindow(Window_t id, Int_t x, Int_t y, UInt_t w, UInt_t h) override
Move and resize a window.
Definition GX11Gui.cxx:307
Colormap_t GetColormap() const override
Returns handle to colormap (might be useful in some cases where direct X11 manipulation outside of TV...
Definition GX11Gui.cxx:871
void UnmapWindow(Window_t id) override
Unmap window from screen.
Definition GX11Gui.cxx:247
void CopyGC(GContext_t org, GContext_t dest, Mask_t mask) override
Copies graphics context from org to dest.
Definition GX11Gui.cxx:1012
Display_t GetDisplay() const override
Returns handle to display (might be useful in some cases where direct X11 manipulation outside of TVi...
Definition GX11Gui.cxx:851
void MoveWindow(Int_t wid, Int_t x, Int_t y) override
Move the window wid.
Definition TGX11.cxx:1254
char ** ListFonts(const char *fontname, Int_t max, Int_t &count) override
Return list of font names matching fontname regexp, like "-*-times-*".
Definition GX11Gui.cxx:2614
UInt_t ScreenWidthMM() const override
Returns the width of the screen in millimeters.
Definition GX11Gui.cxx:2705
void MapGCValues(GCValues_t &gval, ULong_t &xmask, RXGCValues &xgval, Bool_t tox=kTRUE)
Map a GCValues_t to a XCGValues structure if tox is true.
Definition GX11Gui.cxx:556
void DestroySubwindows(Window_t id) override
Destroy subwindows of this window.
Definition GX11Gui.cxx:267
Drawable fRootWin
Root window used as parent of all windows.
Definition TGX11.h:102
void SetWMTransientHint(Window_t id, Window_t main_id) override
Tell window manager that window is a transient window of main.
Definition GX11Gui.cxx:2069
Window_t GetPrimarySelectionOwner() override
Returns the window id of the current owner of the primary selection.
Definition GX11Gui.cxx:2261
void GrabPointer(Window_t id, UInt_t evmask, Window_t confine, Cursor_t cursor, Bool_t grab=kTRUE, Bool_t owner_events=kTRUE) override
Establish an active pointer grab.
Definition GX11Gui.cxx:1893
void ClearWindow() override
Clear current window.
Definition TGX11.cxx:386
void * fXEvent
Current native (X11) event.
Definition TGX11.h:72
void SetWindowName(Window_t id, char *name) override
Set window name.
Definition GX11Gui.cxx:1912
void RaiseWindow(Window_t id) override
Put window on top of window stack.
Definition GX11Gui.cxx:277
void GrabButton(Window_t id, EMouseButton button, UInt_t modifier, UInt_t evmask, Window_t confine, Cursor_t cursor, Bool_t grab=kTRUE) override
Establish passive grab on a certain mouse button.
Definition GX11Gui.cxx:1867
void SetDashes(GContext_t gc, Int_t offset, const char *dash_list, Int_t n) override
Specify a dash pattern.
Definition GX11Gui.cxx:1307
void FreeFontNames(char **fontlist) override
Free list of font names.
Definition GX11Gui.cxx:2626
void Bell(Int_t percent) override
Sound bell. Percent is loudness from -100% .. 100%.
Definition GX11Gui.cxx:1675
void SetWMSizeHints(Window_t id, UInt_t wmin, UInt_t hmin, UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc) override
Give the window manager minimum and maximum size hints.
Definition GX11Gui.cxx:2026
Bool_t CheckEvent(Window_t id, EGEventType type, Event_t &ev) override
Check if there is for window "id" an event of type "type".
Definition GX11Gui.cxx:1774
Drawable fVisRootWin
Root window with fVisual to be used to create GC's and XImages.
Definition TGX11.h:103
void FreeColor(Colormap_t cmap, ULong_t pixel) override
Free color cell with specified pixel value.
Definition GX11Gui.cxx:1391
Int_t fRedDiv
Red value divider, -1 if no TrueColor visual.
Definition TGX11.h:112
Int_t fDepth
Number of color planes.
Definition TGX11.h:111
void MapRaised(Window_t id) override
Map window on screen and put on top of all windows.
Definition GX11Gui.cxx:237
Bool_t Init(void *display) override
Initialize X11 system. Returns kFALSE in case of failure.
Definition TGX11.cxx:319
void GetImageSize(Drawable_t id, UInt_t &width, UInt_t &height) override
Get size of XImage img.
Definition GX11Gui.cxx:2657
void ConvertSelection(Window_t, Atom_t &, Atom_t &, Atom_t &, Time_t &) override
Requests that the specified selection be converted to the specified target type.
Definition GX11Gui.cxx:2753
void ChangeProperties(Window_t id, Atom_t property, Atom_t type, Int_t format, UChar_t *data, Int_t len) override
This function alters the property for the specified window and causes the X server to generate a Prop...
Definition GX11Gui.cxx:2772
void SetTypeList(Window_t win, Atom_t prop, Atom_t *typelist) override
Add the list of drag and drop types to the Window win.
Definition GX11Gui.cxx:2806
void CloseDisplay() override
Close connection to display server.
Definition GX11Gui.cxx:840
void XorRegion(Region_t rega, Region_t regb, Region_t result) override
Calculate the difference between the union and intersection of two regions.
Definition GX11Gui.cxx:2574
void DeleteGC(GContext_t gc) override
Explicitly delete a graphics context.
Definition GX11Gui.cxx:1032
void TranslateCoordinates(Window_t src, Window_t dest, Int_t src_x, Int_t src_y, Int_t &dest_x, Int_t &dest_y, Window_t &child) override
TranslateCoordinates translates coordinates from the frame of reference of one window to another.
Definition GX11Gui.cxx:2408
void SetWindowBackground(Window_t id, ULong_t color) override
Set the window background color.
Definition GX11Gui.cxx:350
Bool_t EmptyRegion(Region_t reg) override
Return true if the region is empty.
Definition GX11Gui.cxx:2582
void QueryColor(Colormap_t cmap, ColorStruct_t &color) override
Fill in the primary color components for a specific pixel value.
Definition GX11Gui.cxx:1371
void DrawSegments(Drawable_t id, GContext_t gc, Segment_t *seg, Int_t nseg) override
Draws multiple line segments. Each line is specified by a pair of points.
Definition GX11Gui.cxx:2206
void GetGCValues(GContext_t gc, GCValues_t &gval) override
Get current values from graphics context gc.
Definition GX11Gui.cxx:2111
Cursor_t CreateCursor(ECursor cursor) override
Create cursor handle (just return cursor from cursor pool fCursors).
Definition GX11Gui.cxx:1043
ULong_t fBlackPixel
Value of black pixel in colormap.
Definition TGX11.h:105
Window_t FindRWindow(Window_t win, Window_t dragwin, Window_t input, int x, int y, int maxd) override
Recursively search in the children of Window for a Window which is at location x, y and is DND aware,...
Definition GX11Gui.cxx:2823
FontStruct_t GetFontStruct(FontH_t fh) override
Retrieve associated font structure once we have the font handle.
Definition GX11Gui.cxx:2132
void DeleteFont(FontStruct_t fs) override
Explicitly delete font structure obtained with LoadQueryFont().
Definition GX11Gui.cxx:962
void QueryPointer(Int_t &ix, Int_t &iy) override
Query pointer position.
Definition TGX11.cxx:1594
void DestroyWindow(Window_t id) override
Destroy window.
Definition GX11Gui.cxx:257
Atom_t InternAtom(const char *atom_name, Bool_t only_if_exist) override
Return atom handle for atom_name.
Definition GX11Gui.cxx:900
Drawable_t CreateImage(UInt_t width, UInt_t height) override
Create a client-side XImage. Returns handle to XImage.
Definition GX11Gui.cxx:2634
void UnionRectWithRegion(Rectangle_t *rect, Region_t src, Region_t dest) override
Union of rectangle with a region.
Definition GX11Gui.cxx:2528
Int_t TextWidth(FontStruct_t font, const char *s, Int_t len) override
Return length of string in pixels. Size depends on font.
Definition GX11Gui.cxx:2090
void DestroyRegion(Region_t reg) override
Destroy region.
Definition GX11Gui.cxx:2520
void DeletePictureData(void *data) override
Delete picture data created by the function ReadPictureDataFromFile.
Definition GX11Gui.cxx:1292
void LookupString(Event_t *event, char *buf, Int_t buflen, UInt_t &keysym) override
Convert the keycode from the event structure to a key symbol (according to the modifiers specified in...
Definition GX11Gui.cxx:2302
void NextEvent(Event_t &event) override
Copies first pending event from event queue to Event_t structure and removes event from queue.
Definition GX11Gui.cxx:1411
void DeletePixmap(Pixmap_t pmap) override
Explicitly delete pixmap resource.
Definition GX11Gui.cxx:1092
FontH_t GetFontHandle(FontStruct_t fs) override
Return handle to font described by font structure.
Definition GX11Gui.cxx:950
void ClearArea(Window_t id, Int_t x, Int_t y, UInt_t w, UInt_t h) override
Clear a window area to the background color.
Definition GX11Gui.cxx:1762
void MapPictureAttributes(PictureAttributes_t &attr, RXpmAttributes &xpmattr, Bool_t toxpm=kTRUE)
Map a PictureAttributes_t to a XpmAttributes structure.
Definition GX11Gui.cxx:1101
Int_t OpenDisplay(void *display)
Open the display. Return -1 if the opening fails, 0 when ok.
Definition TGX11.cxx:1265
void SetIconName(Window_t id, char *name) override
Set window icon name.
Definition GX11Gui.cxx:1929
void DrawString(Drawable_t id, GContext_t gc, Int_t x, Int_t y, const char *s, Int_t len) override
Draw a string using a specific graphics context in position (x,y).
Definition GX11Gui.cxx:2079
void ReparentWindow(Window_t id, Window_t pid, Int_t x, Int_t y) override
Reparent window to new parent window at position (x,y).
Definition GX11Gui.cxx:340
Bool_t CreatePictureFromData(Drawable_t id, char **data, Pixmap_t &pict, Pixmap_t &pict_mask, PictureAttributes_t &attr) override
Create a picture pixmap from data.
Definition GX11Gui.cxx:1236
void ShapeCombineMask(Window_t id, Int_t x, Int_t y, Pixmap_t mask) override
The Nonrectangular Window Shape Extension adds nonrectangular windows to the System.
Definition GX11Gui.cxx:2696
Window_t GetInputFocus() override
Returns the window id of the window having the input focus.
Definition GX11Gui.cxx:2233
void WMDeleteNotify(Window_t id) override
Tell WM to send message when window is closed via WM.
Definition GX11Gui.cxx:1819
Int_t EventsPending() override
Returns number of pending events.
Definition GX11Gui.cxx:1400
void SetClassHints(Window_t id, char *className, char *resourceName) override
Set the windows class and resource name.
Definition GX11Gui.cxx:1961
void SendEvent(Window_t id, Event_t *ev) override
Send event ev to window id.
Definition GX11Gui.cxx:1805
void SetWMSize(Window_t id, UInt_t w, UInt_t h) override
Tell the window manager the desired window size.
Definition GX11Gui.cxx:2009
Bool_t ParseColor(Colormap_t cmap, const char *cname, ColorStruct_t &color) override
Parse string cname containing color name, like "green" or "#00FF00".
Definition GX11Gui.cxx:1331
Bool_t EqualRegion(Region_t rega, Region_t regb) override
Returns true if two regions are equal.
Definition GX11Gui.cxx:2598
RVisual * fVisual
Pointer to visual used by all windows.
Definition TGX11.h:101
Region_t CreateRegion() override
Create a new empty region.
Definition GX11Gui.cxx:2512
void DrawLine(Int_t x1, Int_t y1, Int_t x2, Int_t y2) override
Draw a line.
Definition TGX11.cxx:593
void ChangeProperty(Window_t id, Atom_t property, Atom_t type, UChar_t *data, Int_t len) override
This function alters the property for the specified window and causes the X server to generate a Prop...
Definition GX11Gui.cxx:1719
Window_t CreateWindow(Window_t parent, Int_t x, Int_t y, UInt_t w, UInt_t h, UInt_t border, Int_t depth, UInt_t clss, void *visual, SetWindowAttributes_t *attr, UInt_t wtype) override
Return handle to newly created X window.
Definition GX11Gui.cxx:370
void DrawRectangle(Drawable_t id, GContext_t gc, Int_t x, Int_t y, UInt_t w, UInt_t h) override
Draw a rectangle outline.
Definition GX11Gui.cxx:2196
void SetForeground(GContext_t gc, ULong_t foreground) override
Set foreground color in graphics context (shortcut for ChangeGC with only foreground mask set).
Definition GX11Gui.cxx:2481
void SetKeyAutoRepeat(Bool_t on=kTRUE) override
Turn key auto repeat on or off.
Definition GX11Gui.cxx:1829
void DeleteProperty(Window_t, Atom_t &) override
Deletes the specified property only if the property was defined on the specified window and causes th...
Definition GX11Gui.cxx:2715
void ChangeWindowAttributes(Window_t id, SetWindowAttributes_t *attr) override
Change window attributes.
Definition GX11Gui.cxx:1698
void FillPolygon(Window_t id, GContext_t gc, Point_t *points, Int_t npnt) override
FillPolygon fills the region closed by the specified path.
Definition GX11Gui.cxx:2442
void GetFontProperties(FontStruct_t font, Int_t &max_ascent, Int_t &max_descent) override
Return some font properties.
Definition GX11Gui.cxx:2098
void MapSetWindowAttributes(SetWindowAttributes_t *attr, ULong_t &xmask, RXSetWindowAttributes &xattr)
Map a SetWindowAttributes_t to a XSetWindowAttributes structure.
Definition GX11Gui.cxx:467
void CopyArea(Drawable_t src, Drawable_t dest, GContext_t gc, Int_t src_x, Int_t src_y, UInt_t width, UInt_t height, Int_t dest_x, Int_t dest_y) override
Copy a drawable (i.e.
Definition GX11Gui.cxx:1685
void PutImage(Int_t offset, Int_t itran, Int_t x0, Int_t y0, Int_t nx, Int_t ny, Int_t xmin, Int_t ymin, Int_t xmax, Int_t ymax, UChar_t *image, Drawable_t id)
Draw image.
Definition TGX11.cxx:2974
void MapModifierState(UInt_t &state, UInt_t &xstate, Bool_t tox=kTRUE)
Map modifier key state to or from X.
Definition GX11Gui.cxx:1422
void SubtractRegion(Region_t rega, Region_t regb, Region_t result) override
Subtract rega from regb.
Definition GX11Gui.cxx:2565
Pixmap_t ReadGIF(Int_t x0, Int_t y0, const char *file, Window_t id=0) override
If id is NULL - loads the specified gif file at position [x0,y0] in the current window.
Definition TGX11.cxx:3045
void MapColorStruct(ColorStruct_t *color, RXColor &xcolor)
Map a ColorStruct_t to a XColor structure.
Definition GX11Gui.cxx:1315
void UnionRegion(Region_t rega, Region_t regb, Region_t result) override
Compute the union of rega and regb and return result region.
Definition GX11Gui.cxx:2548
void Update(Int_t mode=0) override
Flush (mode = 0, default) or synchronize (mode = 1) X output buffer.
Definition GX11Gui.cxx:2501
Mother of all ROOT objects.
Definition TObject.h:42
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:1084
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1098
SCoord_t fY
Definition TPoint.h:36
SCoord_t fX
Definition TPoint.h:35
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
Definition TROOT.cxx:3067
Basic string class.
Definition TString.h:138
virtual TFileHandler * RemoveFileHandler(TFileHandler *fh)
Remove a file handler from the list of file handlers.
Definition TSystem.cxx:566
virtual void MapGCFont(GContext_t, FontStruct_t)
Map the XftFont with the Graphics Context using it.
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
void XShapeCombineMask(Display *, Window, int, int, int, Pixmap, int)
#define ShapeSet
Definition shapeconst.h:40
#define ShapeBounding
Definition shapeconst.h:46
ULong_t fPixel
color pixel value (index in color table)
Definition GuiTypes.h:312
UShort_t fRed
red component (0..65535)
Definition GuiTypes.h:313
UShort_t fGreen
green component (0..65535)
Definition GuiTypes.h:314
UShort_t fBlue
blue component (0..65535)
Definition GuiTypes.h:315
UShort_t fMask
mask telling which color components are valid
Definition GuiTypes.h:316
Event structure.
Definition GuiTypes.h:175
Graphics context structure.
Definition GuiTypes.h:225
KeySym fXKeySym
Definition GX11Gui.cxx:63
EKeySym fKeySym
Definition GX11Gui.cxx:64
Handle_t fDecorations
Definition GX11Gui.cxx:46
Handle_t fFunctions
Definition GX11Gui.cxx:45
Point structure (maps to the X11 XPoint structure)
Definition GuiTypes.h:357
Rectangle structure (maps to the X11 XRectangle structure)
Definition GuiTypes.h:362
Used for drawing line segments (maps to the X11 XSegments structure)
Definition GuiTypes.h:352
Attributes that can be used when creating or changing a window.
Definition GuiTypes.h:94
Window attributes that can be inquired.
Definition GuiTypes.h:115
TLine l
Definition textangle.C:4
#define XA_ATOM
Definition xatom.h:13
#define XA_PRIMARY
Definition xatom.h:10
#define XA_STRING
Definition xatom.h:40
unsigned long Atom
Definition xatom.h:9