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
48};
49
50//---- hints
51
55
58
59
60//---- Key symbol mapping
61
65};
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[] = {
71 { XK_Escape, kKey_Escape },
72 { XK_Tab, kKey_Tab },
73#ifndef XK_ISO_Left_Tab
74 { 0xFE20, kKey_Backtab },
75#else
76 { XK_ISO_Left_Tab, kKey_Backtab },
77#endif
78 { XK_BackSpace, kKey_Backspace },
79 { XK_Return, kKey_Return },
80 { XK_Insert, kKey_Insert },
81 { XK_Delete, kKey_Delete },
82 { XK_Clear, kKey_Delete },
83 { XK_Pause, kKey_Pause },
84 { XK_Print, kKey_Print },
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 },
91 { XK_Right, kKey_Right },
92 { XK_Down, kKey_Down },
93 { XK_Prior, kKey_Prior },
94 { XK_Next, kKey_Next },
95 { XK_Shift_L, kKey_Shift }, // modifiers
96 { XK_Shift_R, kKey_Shift },
97 { XK_Shift_Lock, kKey_Shift },
98 { XK_Control_L, kKey_Control },
99 { XK_Control_R, kKey_Control },
100 { XK_Meta_L, kKey_Meta },
101 { XK_Meta_R, kKey_Meta },
102 { XK_Alt_L, kKey_Alt },
103 { XK_Alt_R, kKey_Alt },
104 { XK_Caps_Lock, kKey_CapsLock },
105 { XK_Num_Lock, kKey_NumLock },
106 { XK_Scroll_Lock, kKey_ScrollLock },
107 { XK_KP_Space, kKey_Space }, // numeric keypad
108 { XK_KP_Tab, kKey_Tab },
109 { XK_KP_Enter, kKey_Enter },
110 { XK_KP_F1, kKey_F1 },
111 { XK_KP_F2, kKey_F2 },
112 { XK_KP_F3, kKey_F3 },
113 { XK_KP_F4, kKey_F4 },
114 { XK_KP_Home, kKey_Home },
115 { XK_KP_Left, kKey_Left },
116 { XK_KP_Up, kKey_Up },
117 { XK_KP_Right, kKey_Right },
118 { XK_KP_Down, kKey_Down },
119 { XK_KP_Prior, kKey_Prior },
120 { XK_KP_Page_Up, kKey_PageUp },
121 { XK_KP_Next, kKey_Next },
122 { XK_KP_Page_Down, kKey_PageDown },
123 { XK_KP_End, kKey_End },
124 { XK_KP_Begin, kKey_Home },
125 { XK_KP_Insert, kKey_Insert },
126 { XK_KP_Delete, kKey_Delete },
127 { XK_KP_Equal, kKey_Equal },
128 { XK_KP_Multiply, kKey_Asterisk },
129 { XK_KP_Add, kKey_Plus },
130 { XK_KP_Separator, kKey_Comma },
131 { XK_KP_Subtract, kKey_Minus },
132 { XK_KP_Decimal, kKey_Period },
133 { XK_KP_Divide, kKey_Slash },
134 { 0, (EKeySym) 0 }
135};
136
142
143////////////////////////////////////////////////////////////////////////////////
144
145inline void SplitLong(Long_t ll, Long_t &i1, Long_t &i2)
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
156inline void AsmLong(Long_t i1, Long_t i2, Long_t &ll)
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
168static Int_t RootX11ErrorHandler(Display *disp, XErrorEvent *err)
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
334 XIconifyWindow((Display*)fDisplay, (Window) id, fScreenNumber);
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,
372 Int_t depth, UInt_t clss,
373 void *visual, SetWindowAttributes_t *attr, UInt_t)
374{
376 ULong_t xmask = 0;
377
378 if (attr)
379 MapSetWindowAttributes(attr, xmask, xattr);
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) {
390 xmask |= CWBorderPixel;
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
402void TGX11::MapEventMask(UInt_t &emask, UInt_t &xemask, Bool_t tox)
403{
404 if (tox) {
405 Long_t lxemask = NoEventMask;
406 if ((emask & kKeyPressMask))
407 lxemask |= KeyPressMask;
408 if ((emask & kKeyReleaseMask))
409 lxemask |= KeyReleaseMask;
410 if ((emask & kButtonPressMask))
411 lxemask |= ButtonPressMask;
412 if ((emask & kButtonReleaseMask))
413 lxemask |= ButtonReleaseMask;
414 if ((emask & kPointerMotionMask))
415 lxemask |= PointerMotionMask;
416 if ((emask & kButtonMotionMask))
417 lxemask |= ButtonMotionMask;
418 if ((emask & kExposureMask))
419 lxemask |= ExposureMask;
420 if ((emask & kStructureNotifyMask))
421 lxemask |= StructureNotifyMask;
422 if ((emask & kEnterWindowMask))
423 lxemask |= EnterWindowMask;
424 if ((emask & kLeaveWindowMask))
425 lxemask |= LeaveWindowMask;
426 if ((emask & kFocusChangeMask))
427 lxemask |= FocusChangeMask;
428 if ((emask & kOwnerGrabButtonMask))
429 lxemask |= OwnerGrabButtonMask;
430 if ((emask & kColormapChangeMask))
431 lxemask |= ColormapChangeMask;
432 xemask = (UInt_t)lxemask;
433 } else {
434 emask = 0;
435 if ((xemask & KeyPressMask))
436 emask |= kKeyPressMask;
437 if ((xemask & KeyReleaseMask))
438 emask |= kKeyReleaseMask;
439 if ((xemask & ButtonPressMask))
440 emask |= kButtonPressMask;
441 if ((xemask & ButtonReleaseMask))
442 emask |= kButtonReleaseMask;
443 if ((xemask & PointerMotionMask))
444 emask |= kPointerMotionMask;
445 if ((xemask & ButtonMotionMask))
446 emask |= kButtonMotionMask;
447 if ((xemask & ExposureMask))
448 emask |= kExposureMask;
449 if ((xemask & StructureNotifyMask))
450 emask |= kStructureNotifyMask;
451 if ((xemask & EnterWindowMask))
452 emask |= kEnterWindowMask;
453 if ((xemask & LeaveWindowMask))
454 emask |= kLeaveWindowMask;
455 if ((xemask & FocusChangeMask))
456 emask |= kFocusChangeMask;
457 if ((xemask & OwnerGrabButtonMask))
458 emask |= kOwnerGrabButtonMask;
459 if ((xemask & ColormapChangeMask))
460 emask |= kColormapChangeMask;
461 }
462}
463
464////////////////////////////////////////////////////////////////////////////////
465/// Map a SetWindowAttributes_t to a XSetWindowAttributes structure.
466
468 ULong_t &xmask, RXSetWindowAttributes &xattr)
469{
470 Mask_t mask = attr->fMask;
471 xmask = 0;
472
473 if ((mask & kWABackPixmap)) {
474 xmask |= CWBackPixmap;
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)) {
483 xmask |= CWBackPixel;
484 xattr.background_pixel = attr->fBackgroundPixel;
485 }
486 if ((mask & kWABorderPixmap)) {
487 xmask |= CWBorderPixmap;
488 xattr.border_pixmap = (Pixmap)attr->fBorderPixmap;
489 }
490 if ((mask & kWABorderPixel)) {
491 xmask |= CWBorderPixel;
492 xattr.border_pixel = attr->fBorderPixel;
493 }
494 if ((mask & kWABitGravity)) {
495 xmask |= CWBitGravity;
496 xattr.bit_gravity = attr->fBitGravity; //assume ident mapping (rdm)
497 }
498 if ((mask & kWAWinGravity)) {
499 xmask |= CWWinGravity;
500 xattr.win_gravity = attr->fWinGravity; // assume ident mapping (rdm)
501 }
502 if ((mask & kWABackingStore)) {
503 xmask |= CWBackingStore;
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)) {
514 xmask |= CWBackingPlanes;
515 xattr.backing_planes = attr->fBackingPlanes;
516 }
517 if ((mask & kWABackingPixel)) {
518 xmask |= CWBackingPixel;
519 xattr.backing_pixel = attr->fBackingPixel;
520 }
521 if ((mask & kWAOverrideRedirect)) {
522 xmask |= CWOverrideRedirect;
523 xattr.override_redirect = attr->fOverrideRedirect;
524 }
525 if ((mask & kWASaveUnder)) {
526 xmask |= CWSaveUnder;
527 xattr.save_under = (Bool)attr->fSaveUnder;
528 }
529 if ((mask & kWAEventMask)) {
530 xmask |= CWEventMask;
531 UInt_t xmsk, msk = (UInt_t) attr->fEventMask;
532 MapEventMask(msk, xmsk, kTRUE);
533 xattr.event_mask = xmsk;
534 }
535 if ((mask & kWADontPropagate)) {
536 xmask |= CWDontPropagate;
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
557 ULong_t &xmask, RXGCValues &xgval, Bool_t tox)
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)) {
569 xmask |= GCPlaneMask;
570 xgval.plane_mask = gval.fPlaneMask;
571 }
572 if ((mask & kGCForeground)) {
573 xmask |= GCForeground;
574 xgval.foreground = gval.fForeground;
575 }
576 if ((mask & kGCBackground)) {
577 xmask |= GCBackground;
578 xgval.background = gval.fBackground;
579 }
580 if ((mask & kGCLineWidth)) {
581 xmask |= GCLineWidth;
582 xgval.line_width = gval.fLineWidth;
583 }
584 if ((mask & kGCLineStyle)) {
585 xmask |= GCLineStyle;
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)) {
593 xmask |= GCJoinStyle;
594 xgval.join_style = gval.fJoinStyle; // ident mapping
595 }
596 if ((mask & kGCFillStyle)) {
597 xmask |= GCFillStyle;
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)) {
613 xmask |= GCTileStipXOrigin;
614 xgval.ts_x_origin = gval.fTsXOrigin;
615 }
616 if ((mask & kGCTileStipYOrigin)) {
617 xmask |= GCTileStipYOrigin;
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)) {
627 xmask |= GCSubwindowMode;
628 xgval.subwindow_mode = gval.fSubwindowMode; // ident mapping
629 }
630 if ((mask & kGCGraphicsExposures)) {
631 xmask |= GCGraphicsExposures;
632 xgval.graphics_exposures = (Bool) gval.fGraphicsExposures;
633 }
634 if ((mask & kGCClipXOrigin)) {
635 xmask |= GCClipXOrigin;
636 xgval.clip_x_origin = gval.fClipXOrigin;
637 }
638 if ((mask & kGCClipYOrigin)) {
639 xmask |= GCClipYOrigin;
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)) {
647 xmask |= GCDashOffset;
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
767 XWindowAttributes xattr;
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
809Int_t TGX11::OpenDisplay(const char *dpyName)
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
824 XSetErrorHandler(RootX11ErrorHandler);
825 XSetIOErrorHandler(RootX11IOErrorHandler);
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
900Atom_t TGX11::InternAtom(const char *atom_name, Bool_t only_if_exist)
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
913{
914 return (Window_t) fRootWin;
915}
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;
926 UInt_t nchildren;
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) {
953 XFontStruct *fss = (XFontStruct *)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{
973 RXGCValues xgval;
974 ULong_t xmask = 0;
975
976 if (gval)
977 MapGCValues(*gval, xmask, xgval);
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{
995 RXGCValues xgval;
996 ULong_t xmask = 0;
997
998 if (gval)
999 MapGCValues(*gval, xmask, xgval);
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{
1015 RXGCValues xgval;
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
1024 MapGCValues(gval, xmask, xgval);
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
1044{
1045 return (Cursor_t) fCursors[cursor];
1046}
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
1073 Int_t depth)
1074{
1075 return (Pixmap_t) XCreatePixmapFromBitmapData((Display*)fDisplay, (id ? id : fRootWin), (char *)bitmap,
1076 width, height, forecolor, backcolor, depth);
1077}
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)) {
1128 xmask |= XpmReturnPixels;
1129 xpmattr.pixels = nullptr; // output parameters
1130 xpmattr.npixels = 0;
1131 }
1132 if ((mask & kPACloseness)) {
1133 xmask |= XpmCloseness;
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
1197 RXpmAttributes xpmattr;
1198
1199 MapPictureAttributes(attr, xpmattr);
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
1210 MapPictureAttributes(attr, xpmattr, kFALSE);
1211 XpmFreeAttributes(&xpmattr);
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
1240 RXpmAttributes xpmattr;
1241
1242 MapPictureAttributes(attr, xpmattr);
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
1253 MapPictureAttributes(attr, xpmattr, kFALSE);
1254 XpmFreeAttributes(&xpmattr);
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
1278Bool_t TGX11::ReadPictureDataFromFile(const char *filename, char ***ret_data)
1279{
1280#ifdef XpmVersion
1281 if (XpmReadFileToData((char*)filename, ret_data) == XpmSuccess)
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
1307void TGX11::SetDashes(GContext_t gc, Int_t offset, const char *dash_list, Int_t n)
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))
1431 xstate |= ControlMask;
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))
1443 xstate |= Button1Mask;
1444 if ((state & kButton2Mask))
1445 xstate |= Button2Mask;
1446 if ((state & kButton3Mask))
1447 xstate |= Button3Mask;
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
1483void TGX11::MapEvent(Event_t &ev, void *xevi, Bool_t tox)
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)
1706 MapSetWindowAttributes(attr, xmask, xattr);
1707
1708 XChangeWindowAttributes((Display*)fDisplay, (Window) id, xmask, &xattr);
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/// Draw a line.
1730
1732{
1733 if (!id) return;
1734
1735 XDrawLine((Display*)fDisplay, (Drawable) id, (GC) gc, x1, y1, x2, y2);
1736}
1737
1738////////////////////////////////////////////////////////////////////////////////
1739/// Clear a window area to the background color.
1740
1742{
1743 if (!id) return;
1744
1745 XClearArea((Display*)fDisplay, (Window) id, x, y, w, h, False);
1746}
1747
1748////////////////////////////////////////////////////////////////////////////////
1749/// Check if there is for window "id" an event of type "type". If there
1750/// is fill in the event structure and return true. If no such event
1751/// return false.
1752
1754{
1755 if (!id) return kFALSE;
1756
1757 Event_t tev;
1758 XEvent xev;
1759
1760 tev.fCode = 0;
1761 tev.fState = 0;
1762 tev.fWindow = 0;
1763 tev.fUser[0] = tev.fUser[1] = tev.fUser[2] = tev.fUser[3] = tev.fUser[4] = 0;
1764 tev.fCount = 0;
1765 tev.fFormat = 0;
1766 tev.fHandle = 0;
1767 tev.fSendEvent = false;
1768 tev.fTime = 0;
1769 tev.fX = tev.fY = 0;
1770 tev.fXRoot = tev.fYRoot = 0;
1771 tev.fType = type;
1772 MapEvent(tev, &xev);
1773
1774 Bool r = XCheckTypedWindowEvent((Display*)fDisplay, (Window) id, xev.type, &xev);
1775
1776 if (r) MapEvent(ev, &xev, kFALSE);
1777
1778 return r ? kTRUE : kFALSE;
1779}
1780
1781////////////////////////////////////////////////////////////////////////////////
1782/// Send event ev to window id.
1783
1785{
1786 if (!ev || !id) return;
1787
1788 XEvent xev;
1789
1790 MapEvent(*ev, &xev);
1791
1792 XSendEvent((Display*)fDisplay, (Window) id, False, None, &xev);
1793}
1794
1795////////////////////////////////////////////////////////////////////////////////
1796/// Tell WM to send message when window is closed via WM.
1797
1799{
1800 if (!id) return;
1801
1802 XSetWMProtocols((Display*)fDisplay, (Window) id, &gWM_DELETE_WINDOW, 1);
1803}
1804
1805////////////////////////////////////////////////////////////////////////////////
1806/// Turn key auto repeat on or off.
1807
1809{
1810 if (!fDisplay)
1811 return;
1812
1813 if (on)
1814 XAutoRepeatOn((Display*)fDisplay);
1815 else
1816 XAutoRepeatOff((Display*)fDisplay);
1817}
1818
1819////////////////////////////////////////////////////////////////////////////////
1820/// Establish passive grab on a certain key. That is, when a certain key
1821/// keycode is hit while certain modifier's (Shift, Control, Meta, Alt)
1822/// are active then the keyboard will be grabbed for window id.
1823/// When grab is false, ungrab the keyboard for this key and modifier.
1824
1826{
1827// if (!id) return;
1828
1829 UInt_t xmod;
1830
1832
1833 if (grab)
1834 XGrabKey((Display*)fDisplay, keycode, xmod, (Window) id, True,
1835 GrabModeAsync, GrabModeAsync);
1836 else
1837 XUngrabKey((Display*)fDisplay, keycode, xmod, (Window) id);
1838}
1839
1840////////////////////////////////////////////////////////////////////////////////
1841/// Establish passive grab on a certain mouse button. That is, when a
1842/// certain mouse button is hit while certain modifier's (Shift, Control,
1843/// Meta, Alt) are active then the mouse will be grabbed for window id.
1844/// When grab is false, ungrab the mouse button for this button and modifier.
1845
1848 Bool_t grab)
1849{
1850 if (!id) return;
1851
1852 UInt_t xmod;
1853
1855
1856 if (grab) {
1857 UInt_t xevmask;
1858 MapEventMask(evmask, xevmask);
1859
1860 XGrabButton((Display*)fDisplay, button, xmod, (Window) id, True, xevmask,
1861 GrabModeAsync, GrabModeAsync, (Window) confine,
1862 (Cursor) cursor);
1863 } else
1864 XUngrabButton((Display*)fDisplay, button, xmod, (Window) id);
1865}
1866
1867////////////////////////////////////////////////////////////////////////////////
1868/// Establish an active pointer grab. While an active pointer grab is in
1869/// effect, further pointer events are only reported to the grabbing
1870/// client window.
1871
1873 Cursor_t cursor, Bool_t grab, Bool_t owner_events)
1874{
1875// if (!id) return;
1876
1877 if (grab) {
1878 UInt_t xevmask;
1879 MapEventMask(evmask, xevmask);
1880
1881 XGrabPointer((Display*)fDisplay, (Window) id, (Bool) owner_events,
1882 xevmask, GrabModeAsync, GrabModeAsync, (Window) confine,
1883 (Cursor) cursor, CurrentTime);
1884 } else
1885 XUngrabPointer((Display*)fDisplay, CurrentTime);
1886}
1887
1888////////////////////////////////////////////////////////////////////////////////
1889/// Set window name.
1890
1892{
1893 if (!id) return;
1894
1895 XTextProperty wname;
1896
1897 if (XStringListToTextProperty(&name, 1, &wname) == 0) {
1898 Error("SetWindowName", "cannot allocate window name \"%s\"", name);
1899 return;
1900 }
1901 XSetWMName((Display*)fDisplay, (Window) id, &wname);
1902 XFree(wname.value);
1903}
1904
1905////////////////////////////////////////////////////////////////////////////////
1906/// Set window icon name.
1907
1909{
1910 if (!id) return;
1911
1912 XTextProperty wname;
1913
1914 if (XStringListToTextProperty(&name, 1, &wname) == 0) {
1915 Error("SetIconName", "cannot allocate icon name \"%s\"", name);
1916 return;
1917 }
1918 XSetWMIconName((Display*)fDisplay, (Window) id, &wname);
1919 XFree(wname.value);
1920}
1921
1922////////////////////////////////////////////////////////////////////////////////
1923/// Set pixmap the WM can use when the window is iconized.
1924
1926{
1927 if (!id) return;
1928
1929 XWMHints hints;
1930
1931 hints.flags = IconPixmapHint;
1932 hints.icon_pixmap = (Pixmap) pic;
1933
1934 XSetWMHints((Display*)fDisplay, (Window) id, &hints);
1935}
1936
1937////////////////////////////////////////////////////////////////////////////////
1938/// Set the windows class and resource name.
1939
1940void TGX11::SetClassHints(Window_t id, char *className, char *resourceName)
1941{
1942 if (!id) return;
1943
1944 XClassHint class_hints;
1945
1946 class_hints.res_class = className;
1947 class_hints.res_name = resourceName;
1948 XSetClassHint((Display*)fDisplay, (Window) id, &class_hints);
1949}
1950
1951////////////////////////////////////////////////////////////////////////////////
1952/// Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
1953
1955{
1956 if (!id) return;
1957
1958 MWMHintsProperty_t prop;
1959
1960 prop.fDecorations = value;
1961 prop.fFunctions = funcs;
1962 prop.fInputMode = input;
1964
1965 XChangeProperty((Display*)fDisplay, (Window) id, gMOTIF_WM_HINTS, gMOTIF_WM_HINTS, 32,
1966 PropModeReplace, (UChar_t *)&prop, kPropMWMHintElements);
1967}
1968
1969////////////////////////////////////////////////////////////////////////////////
1970/// Tell the window manager the desired window position.
1971
1973{
1974 if (!id) return;
1975
1976 XSizeHints hints;
1977
1978 hints.flags = USPosition | PPosition;
1979 hints.x = x;
1980 hints.y = y;
1981
1982 XSetWMNormalHints((Display*)fDisplay, (Window) id, &hints);
1983}
1984
1985////////////////////////////////////////////////////////////////////////////////
1986/// Tell the window manager the desired window size.
1987
1989{
1990 if (!id) return;
1991
1992 XSizeHints hints;
1993
1994 hints.flags = USSize | PSize | PBaseSize;
1995 hints.width = hints.base_width = w;
1996 hints.height = hints.base_height = h;
1997
1998 XSetWMNormalHints((Display*)fDisplay, (Window) id, &hints);
1999}
2000
2001////////////////////////////////////////////////////////////////////////////////
2002/// Give the window manager minimum and maximum size hints. Also
2003/// specify via winc and hinc the resize increments.
2004
2008{
2009 if (!id) return;
2010
2011 XSizeHints hints;
2012
2013 hints.flags = PMinSize | PMaxSize | PResizeInc;
2014 hints.min_width = (Int_t)wmin;
2015 hints.max_width = (Int_t)wmax;
2016 hints.min_height = (Int_t)hmin;
2017 hints.max_height = (Int_t)hmax;
2018 hints.width_inc = (Int_t)winc;
2019 hints.height_inc = (Int_t)hinc;
2020
2021 XSetWMNormalHints((Display*)fDisplay, (Window) id, &hints);
2022}
2023
2024////////////////////////////////////////////////////////////////////////////////
2025/// Set the initial state of the window. Either kNormalState or kIconicState.
2026
2028{
2029 if (!id) return;
2030
2031 XWMHints hints;
2032 Int_t xstate = NormalState;
2033
2034 if (state == kNormalState)
2035 xstate = NormalState;
2036 if (state == kIconicState)
2037 xstate = IconicState;
2038
2039 hints.flags = StateHint;
2040 hints.initial_state = xstate;
2041
2042 XSetWMHints((Display*)fDisplay, (Window) id, &hints);
2043}
2044
2045////////////////////////////////////////////////////////////////////////////////
2046/// Tell window manager that window is a transient window of main.
2047
2049{
2050 if (!id) return;
2051
2052 XSetTransientForHint((Display*)fDisplay, (Window) id, (Window) main_id);
2053}
2054
2055////////////////////////////////////////////////////////////////////////////////
2056/// Draw a string using a specific graphics context in position (x,y).
2057
2059 const char *s, Int_t len)
2060{
2061 if (!id) return;
2062
2063 XDrawString((Display*)fDisplay, (Drawable) id, (GC) gc, x, y, (char *) s, len);
2064}
2065
2066////////////////////////////////////////////////////////////////////////////////
2067/// Return length of string in pixels. Size depends on font.
2068
2070{
2071 return XTextWidth((XFontStruct*) font, (char*) s, len);
2072}
2073
2074////////////////////////////////////////////////////////////////////////////////
2075/// Return some font properties.
2076
2077void TGX11::GetFontProperties(FontStruct_t font, Int_t &max_ascent, Int_t &max_descent)
2078{
2079 XFontStruct *f = (XFontStruct *) font;
2080
2081 max_ascent = f->max_bounds.ascent;
2082 max_descent = f->max_bounds.descent;
2083}
2084
2085////////////////////////////////////////////////////////////////////////////////
2086/// Get current values from graphics context gc. Which values of the
2087/// context to get is encoded in the GCValues::fMask member. If fMask = 0
2088/// then copy all fields.
2089
2091{
2092 RXGCValues xgval;
2093 ULong_t xmask;
2094
2095 if (!gval.fMask) {
2096 // in this case copy all fields
2097 gval.fMask = kMaxUInt;
2098 }
2099
2100 MapGCValues(gval, xmask, xgval);
2101
2102 XGetGCValues((Display*)fDisplay, (GC) gc, xmask, &xgval);
2103
2104 MapGCValues(gval, xmask, xgval, kFALSE);
2105}
2106
2107////////////////////////////////////////////////////////////////////////////////
2108/// Retrieve associated font structure once we have the font handle.
2109/// Free returned FontStruct_t using FreeFontStruct().
2110
2112{
2113 XFontStruct *fs;
2114
2115 fs = XQueryFont((Display*)fDisplay, (Font) fh);
2116
2117 return (FontStruct_t) fs;
2118}
2119
2120////////////////////////////////////////////////////////////////////////////////
2121/// Free font structure returned by GetFontStruct().
2122
2124{
2125 // in XFree86 4.0 XFreeFontInfo() is broken, ok again in 4.0.1
2126 static int xfree86_400 = -1;
2127 if (xfree86_400 == -1) {
2128 if (strstr(XServerVendor((Display*)fDisplay), "XFree86") &&
2129 XVendorRelease((Display*)fDisplay) == 4000)
2130 xfree86_400 = 1;
2131 else
2132 xfree86_400 = 0;
2133 }
2134
2135 if (xfree86_400 == 0)
2136 XFreeFontInfo(nullptr, (XFontStruct *) fs, 1);
2137}
2138
2139////////////////////////////////////////////////////////////////////////////////
2140/// Clear window.
2141
2143{
2144 if (!id) return;
2145
2146 XClearWindow((Display*)fDisplay, (Window) id);
2147}
2148
2149////////////////////////////////////////////////////////////////////////////////
2150/// Convert a keysym to the appropriate keycode. For example keysym is
2151/// a letter and keycode is the matching keyboard key (which is dependent
2152/// on the current keyboard mapping).
2153
2155{
2156 UInt_t xkeysym;
2157 MapKeySym(keysym, xkeysym);
2158
2159 return XKeysymToKeycode((Display*)fDisplay, xkeysym);
2160}
2161
2162////////////////////////////////////////////////////////////////////////////////
2163/// Draw a filled rectangle. Filling is done according to the gc.
2164
2166{
2167 if (!id) return;
2168
2169 XFillRectangle((Display*)fDisplay, (Drawable) id, (GC) gc, x, y, w, h);
2170}
2171
2172////////////////////////////////////////////////////////////////////////////////
2173/// Draw a rectangle outline.
2174
2176{
2177 if (!id) return;
2178
2179 XDrawRectangle((Display*)fDisplay, (Drawable) id, (GC) gc, x, y, w, h);
2180}
2181
2182////////////////////////////////////////////////////////////////////////////////
2183/// Draws multiple line segments. Each line is specified by a pair of points.
2184
2186{
2187 if (!id) return;
2188
2189 XDrawSegments((Display*)fDisplay, (Drawable) id, (GC) gc, (XSegment *) seg, nseg);
2190}
2191
2192////////////////////////////////////////////////////////////////////////////////
2193/// Defines which input events the window is interested in. By default
2194/// events are propagated up the window stack. This mask can also be
2195/// set at window creation time via the SetWindowAttributes_t::fEventMask
2196/// attribute.
2197
2199{
2200 if (!id) return;
2201
2202 UInt_t xevmask;
2203
2204 MapEventMask(evmask, xevmask);
2205
2206 XSelectInput((Display*)fDisplay, (Window) id, xevmask);
2207}
2208
2209////////////////////////////////////////////////////////////////////////////////
2210/// Returns the window id of the window having the input focus.
2211
2213{
2214 Window focus;
2215 int return_to;
2216
2217 XGetInputFocus((Display*)fDisplay, &focus, &return_to);
2218 return (Window_t) focus;
2219}
2220
2221////////////////////////////////////////////////////////////////////////////////
2222/// Set keyboard input focus to window id.
2223
2225{
2226 if (!id) return;
2227
2228 XWindowAttributes xattr;
2229
2230 XGetWindowAttributes((Display*)fDisplay, (Window) id, &xattr);
2231
2232 if (xattr.map_state == IsViewable)
2233 XSetInputFocus((Display*)fDisplay, (Window) id, RevertToParent, CurrentTime);
2234}
2235
2236////////////////////////////////////////////////////////////////////////////////
2237/// Returns the window id of the current owner of the primary selection.
2238/// That is the window in which, for example some text is selected.
2239
2241{
2242 return (Window_t) XGetSelectionOwner((Display*)fDisplay, XA_PRIMARY);
2243}
2244
2245////////////////////////////////////////////////////////////////////////////////
2246/// Makes the window id the current owner of the primary selection.
2247/// That is the window in which, for example some text is selected.
2248
2250{
2251 if (!id) return;
2252
2253 XSetSelectionOwner((Display*)fDisplay, XA_PRIMARY, id, CurrentTime);
2254}
2255
2256////////////////////////////////////////////////////////////////////////////////
2257/// XConvertSelection() causes a SelectionRequest event to be sent to the
2258/// current primary selection owner. This event specifies the selection
2259/// property (primary selection), the format into which to convert that
2260/// data before storing it (target = XA_STRING), the property in which
2261/// the owner will place the information (sel_property), the window that
2262/// wants the information (id), and the time of the conversion request
2263/// (when).
2264/// The selection owner responds by sending a SelectionNotify event, which
2265/// confirms the selected atom and type.
2266
2268{
2269 if (!id) return;
2270
2271 XConvertSelection((Display*)fDisplay, XA_PRIMARY, XA_STRING, (Atom) clipboard,
2272 (Window) id, (Time) when);
2273}
2274
2275////////////////////////////////////////////////////////////////////////////////
2276/// Convert the keycode from the event structure to a key symbol (according
2277/// to the modifiers specified in the event structure and the current
2278/// keyboard mapping). In buf a null terminated ASCII string is returned
2279/// representing the string that is currently mapped to the key code.
2280
2281void TGX11::LookupString(Event_t *event, char *buf, Int_t buflen, UInt_t &keysym)
2282{
2283 XEvent xev;
2284 KeySym xkeysym;
2285
2286 MapEvent(*event, &xev);
2287
2288 int n = XLookupString(&xev.xkey, buf, buflen-1, &xkeysym, nullptr);
2289 if (n >= buflen)
2290 Error("LookupString", "buf too small, must be at least %d", n+1);
2291 else
2292 buf[n] = 0;
2293
2294 UInt_t ks, xks = (UInt_t) xkeysym;
2295 MapKeySym(ks, xks, kFALSE);
2296 keysym = (Int_t) ks;
2297}
2298
2299////////////////////////////////////////////////////////////////////////////////
2300/// Map to and from X key symbols. Keysym are the values returned by
2301/// XLookUpString.
2302
2303void TGX11::MapKeySym(UInt_t &keysym, UInt_t &xkeysym, Bool_t tox)
2304{
2305 if (tox) {
2306 xkeysym = XK_VoidSymbol;
2307 if (keysym < 127) {
2308 xkeysym = keysym;
2309 } else if (keysym >= kKey_F1 && keysym <= kKey_F35) {
2310 xkeysym = XK_F1 + (keysym - (UInt_t)kKey_F1); // function keys
2311 } else {
2312 for (int i = 0; gKeyMap[i].fKeySym; i++) { // any other keys
2313 if (keysym == (UInt_t) gKeyMap[i].fKeySym) {
2314 xkeysym = (UInt_t) gKeyMap[i].fXKeySym;
2315 break;
2316 }
2317 }
2318 }
2319 } else {
2320 keysym = kKey_Unknown;
2321 // commentary in X11/keysymdef says that X codes match ASCII
2322 if (xkeysym < 127) {
2323 keysym = xkeysym;
2324 } else if (xkeysym >= XK_F1 && xkeysym <= XK_F35) {
2325 keysym = kKey_F1 + (xkeysym - XK_F1); // function keys
2326 } else if (xkeysym >= XK_KP_0 && xkeysym <= XK_KP_9) {
2327 keysym = kKey_0 + (xkeysym - XK_KP_0); // numeric keypad keys
2328 } else {
2329 for (int i = 0; gKeyMap[i].fXKeySym; i++) { // any other keys
2330 if (xkeysym == gKeyMap[i].fXKeySym) {
2331 keysym = (UInt_t) gKeyMap[i].fKeySym;
2332 break;
2333 }
2334 }
2335 }
2336 }
2337}
2338
2339////////////////////////////////////////////////////////////////////////////////
2340/// Get contents of paste buffer atom into string. If del is true delete
2341/// the paste buffer afterwards.
2342
2344 Bool_t del)
2345{
2346 if (!id) return;
2347
2348 Atom actual_type, property = (Atom) atom;
2349 int actual_format;
2350 ULong_t nitems, bytes_after, nread;
2351 unsigned char *data;
2352
2353 nchar = 0;
2354 text = "";
2355
2356 if (property == None) return;
2357
2358 // get past buffer
2359 nread = 0;
2360 do {
2361 if (XGetWindowProperty((Display*)fDisplay, (Window) id, property,
2362 nread/4, 1024, (Bool)del,
2363 AnyPropertyType,
2364 &actual_type, &actual_format,
2365 &nitems, &bytes_after,
2366 (unsigned char **) &data)
2367 != Success)
2368 break;
2369
2370 if (actual_type != XA_STRING) break;
2371
2372 text.Insert((Int_t) nread, (const char *) data, (Int_t) nitems);
2373 nread += nitems;
2374 XFree(data);
2375
2376 } while (bytes_after > 0);
2377
2378 nchar = (Int_t) nread;
2379}
2380
2381////////////////////////////////////////////////////////////////////////////////
2382/// TranslateCoordinates translates coordinates from the frame of
2383/// reference of one window to another. If the point is contained
2384/// in a mapped child of the destination, the id of that child is
2385/// returned as well.
2386
2389{
2390 if (!src || !dest) return;
2391
2392 Window xchild;
2393
2394 XTranslateCoordinates((Display*)fDisplay, (Window) src, (Window) dest, src_x,
2395 src_y, &dest_x, &dest_y, &xchild);
2396 child = (Window_t) xchild;
2397}
2398
2399////////////////////////////////////////////////////////////////////////////////
2400/// Return geometry of window (should be called GetGeometry but signature
2401/// already used).
2402
2404{
2405 if (!id) return;
2406
2407 Window wdummy;
2408 UInt_t bdum, ddum;
2409
2410 XGetGeometry((Display*)fDisplay, (Drawable) id, &wdummy, &x, &y, &w, &h, &bdum, &ddum);
2411}
2412
2413////////////////////////////////////////////////////////////////////////////////
2414/// FillPolygon fills the region closed by the specified path.
2415/// The path is closed automatically if the last point in the list does
2416/// not coincide with the first point. All point coordinates are
2417/// treated as relative to the origin. For every pair of points
2418/// inside the polygon, the line segment connecting them does not
2419/// intersect the path.
2420
2422{
2423 if (!id) return;
2424
2425 XFillPolygon((Display*)fDisplay, (Window) id, (GC) gc, (XPoint *) points, npnt,
2426 Convex, CoordModeOrigin);
2427}
2428
2429////////////////////////////////////////////////////////////////////////////////
2430/// Returns the root window the pointer is logically on and the pointer
2431/// coordinates relative to the root window's origin.
2432/// The pointer coordinates returned to win_x and win_y are relative to
2433/// the origin of the specified window. In this case, QueryPointer returns
2434/// the child that contains the pointer, if any, or else kNone to
2435/// childw. QueryPointer returns the current logical state of the
2436/// keyboard buttons and the modifier keys in mask.
2437
2439 Int_t &root_x, Int_t &root_y, Int_t &win_x,
2440 Int_t &win_y, UInt_t &mask)
2441{
2442 if (!id) return;
2443
2444 Window xrootw, xchildw;
2445 UInt_t xmask;
2446
2447 XQueryPointer((Display*)fDisplay, (Window) id, &xrootw, &xchildw,
2448 &root_x, &root_y, &win_x, &win_y, &xmask);
2449
2450 rootw = (Window_t) xrootw;
2451 childw = (Window_t) xchildw;
2452
2453 MapModifierState(mask, xmask, kFALSE);
2454}
2455
2456////////////////////////////////////////////////////////////////////////////////
2457/// Set foreground color in graphics context (shortcut for ChangeGC with
2458/// only foreground mask set).
2459
2461{
2462 XSetForeground((Display*)fDisplay, (GC) gc, foreground);
2463}
2464
2465////////////////////////////////////////////////////////////////////////////////
2466/// Set clipping rectangles in graphics context. X, Y specify the origin
2467/// of the rectangles. Recs specifies an array of rectangles that define
2468/// the clipping mask and n is the number of rectangles.
2469
2471{
2472 XSetClipRectangles((Display*)fDisplay, (GC) gc, x, y, (XRectangle *) recs, n, Unsorted);
2473}
2474
2475////////////////////////////////////////////////////////////////////////////////
2476/// Flush (mode = 0, default) or synchronize (mode = 1) X output buffer.
2477/// Flush flushes output buffer. Sync flushes buffer and waits till all
2478/// requests have been processed by X server.
2479
2481{
2482 if (mode == 0)
2483 XFlush((Display*)fDisplay);
2484 if (mode == 1)
2485 XSync((Display*)fDisplay, False);
2486}
2487
2488////////////////////////////////////////////////////////////////////////////////
2489/// Create a new empty region.
2490
2492{
2493 return (Region_t) XCreateRegion();
2494}
2495
2496////////////////////////////////////////////////////////////////////////////////
2497/// Destroy region.
2498
2500{
2501 XDestroyRegion((Region)reg);
2502}
2503
2504////////////////////////////////////////////////////////////////////////////////
2505/// Union of rectangle with a region.
2506
2508{
2509 XRectangle *r = (XRectangle *) rect; // 1 on 1 mapping
2510 XUnionRectWithRegion(r, (Region) src, (Region) dest);
2511}
2512
2513////////////////////////////////////////////////////////////////////////////////
2514/// Create region for the polygon defined by the points array.
2515/// If winding is true use WindingRule else EvenOddRule as fill rule.
2516
2518{
2519 XPoint *p = (XPoint *) points;
2520 return (Region_t) XPolygonRegion(p, np, winding ? WindingRule : EvenOddRule);
2521}
2522
2523////////////////////////////////////////////////////////////////////////////////
2524/// Compute the union of rega and regb and return result region.
2525/// The output region may be the same result region.
2526
2528{
2529 XUnionRegion((Region) rega, (Region) regb, (Region) result);
2530}
2531
2532////////////////////////////////////////////////////////////////////////////////
2533/// Compute the intersection of rega and regb and return result region.
2534/// The output region may be the same as the result region.
2535
2537{
2538 XIntersectRegion((Region) rega, (Region) regb, (Region) result);
2539}
2540
2541////////////////////////////////////////////////////////////////////////////////
2542/// Subtract rega from regb.
2543
2545{
2546 XSubtractRegion((Region) rega, (Region) regb, (Region) result);
2547}
2548
2549////////////////////////////////////////////////////////////////////////////////
2550/// Calculate the difference between the union and intersection of
2551/// two regions.
2552
2554{
2555 XXorRegion((Region) rega, (Region) regb, (Region) result);
2556}
2557
2558////////////////////////////////////////////////////////////////////////////////
2559/// Return true if the region is empty.
2560
2562{
2563 return (Bool_t) XEmptyRegion((Region) reg);
2564}
2565
2566////////////////////////////////////////////////////////////////////////////////
2567/// Returns true if the point x,y is in the region.
2568
2570{
2571 return (Bool_t) XPointInRegion((Region) reg, x, y);
2572}
2573
2574////////////////////////////////////////////////////////////////////////////////
2575/// Returns true if two regions are equal.
2576
2578{
2579 return (Bool_t) XEqualRegion((Region) rega, (Region) regb);
2580}
2581
2582////////////////////////////////////////////////////////////////////////////////
2583/// Return smallest enclosing rectangle.
2584
2586{
2587 XClipBox((Region) reg, (XRectangle*) rect);
2588}
2589
2590////////////////////////////////////////////////////////////////////////////////
2591/// Return list of font names matching fontname regexp, like "-*-times-*".
2592
2593char **TGX11::ListFonts(const char *fontname, Int_t max, Int_t &count)
2594{
2595 char **fontlist;
2596 Int_t fontcount = 0;
2597 fontlist = XListFonts((Display*)fDisplay, (char *)fontname, max, &fontcount);
2598 count = fontcount;
2599 return fontlist;
2600}
2601
2602////////////////////////////////////////////////////////////////////////////////
2603/// Free list of font names.
2604
2605void TGX11::FreeFontNames(char **fontlist)
2606{
2607 XFreeFontNames(fontlist);
2608}
2609
2610////////////////////////////////////////////////////////////////////////////////
2611/// Create a client-side XImage. Returns handle to XImage.
2612
2614{
2615 Int_t bitmap_pad;
2616
2617 if (fDepth <= 8)
2618 bitmap_pad = 8;
2619 else if (fDepth <= 16)
2620 bitmap_pad = 16;
2621 else
2622 bitmap_pad = 32;
2623
2624 XImage *xim = XCreateImage((Display*)fDisplay, fVisual, fDepth, ZPixmap,
2625 0, nullptr, width, height, bitmap_pad, 0);
2626
2627 // use calloc since Xlib will use free() in XDestroyImage
2628 if (xim) xim->data = (char *) calloc(xim->bytes_per_line * xim->height, 1);
2629
2630 return (Drawable_t) xim;
2631}
2632
2633////////////////////////////////////////////////////////////////////////////////
2634/// Get size of XImage img.
2635
2637{
2638 width = ((XImage*)img)->width;
2639 height = ((XImage*)img)->height;
2640}
2641
2642////////////////////////////////////////////////////////////////////////////////
2643/// Set pixel at specified location in XImage img.
2644
2646{
2647 XPutPixel((XImage*) img, x, y, pixel);
2648}
2649
2650////////////////////////////////////////////////////////////////////////////////
2651/// Put (x,y,w,h) part of image img in window win at position dx,dy.
2652
2654 Int_t dy, Int_t x, Int_t y, UInt_t w, UInt_t h)
2655{
2656 if (!win) return;
2657
2658 XPutImage((Display*)fDisplay, (Drawable) win, (GC) gc, (XImage*) img,
2659 x, y, dx, dy, w, h);
2660}
2661
2662////////////////////////////////////////////////////////////////////////////////
2663/// Destroy XImage img.
2664
2666{
2667 XDestroyImage((XImage*) img);
2668}
2669
2670////////////////////////////////////////////////////////////////////////////////
2671/// The Nonrectangular Window Shape Extension adds nonrectangular
2672/// windows to the System.
2673/// This allows for making shaped (partially transparent) windows
2674
2676{
2677 XShapeCombineMask((Display*)fDisplay, (Window) id, ShapeBounding, x, y,
2678 (Pixmap) mask, ShapeSet);
2679}
2680
2681////////////////////////////////////////////////////////////////////////////////
2682/// Returns the width of the screen in millimeters.
2683
2685{
2686 return (UInt_t)WidthMMOfScreen(DefaultScreenOfDisplay((Display*)fDisplay));
2687}
2688
2689////////////////////////////////////////////////////////////////////////////////
2690/// Deletes the specified property only if the property was defined on the
2691/// specified window and causes the X server to generate a PropertyNotify
2692/// event on the window unless the property does not exist.
2693
2695{
2696 XDeleteProperty((Display*)fDisplay, win, prop);
2697}
2698
2699////////////////////////////////////////////////////////////////////////////////
2700/// Returns the actual type of the property; the actual format of the property;
2701/// the number of 8-bit, 16-bit, or 32-bit items transferred; the number of
2702/// bytes remaining to be read in the property; and a pointer to the data
2703/// actually returned.
2704
2708 unsigned char **prop_list)
2709{
2710 return XGetWindowProperty((Display*)fDisplay, win, prop, offset, length, del, req_type,
2711 act_type, act_format, nitems, bytes, prop_list);
2712}
2713
2714////////////////////////////////////////////////////////////////////////////////
2715/// Changes the specified dynamic parameters if the pointer is actively
2716/// grabbed by the client.
2717
2719{
2720 UInt_t xevmask;
2721 MapEventMask(mask, xevmask);
2722 if (cur == kNone)
2723 XChangeActivePointerGrab((Display*)fDisplay, xevmask, fCursors[kHand], CurrentTime);
2724 else
2725 XChangeActivePointerGrab((Display*)fDisplay, xevmask, cur, CurrentTime);
2726}
2727
2728////////////////////////////////////////////////////////////////////////////////
2729/// Requests that the specified selection be converted to the specified
2730/// target type.
2731
2734{
2735 XConvertSelection((Display*)fDisplay, sel, target, prop, win, stamp);
2736}
2737
2738////////////////////////////////////////////////////////////////////////////////
2739/// Changes the owner and last-change time for the specified selection
2740
2742{
2743 return XSetSelectionOwner((Display*)fDisplay, sel, owner, CurrentTime);
2744}
2745
2746////////////////////////////////////////////////////////////////////////////////
2747/// This function alters the property for the specified window and
2748/// causes the X server to generate a PropertyNotify event on that
2749/// window.
2750
2753{
2754 if (!id) return;
2755
2756 XChangeProperty((Display*)fDisplay, (Window) id, (Atom) property, (Atom) type,
2757 format, PropModeReplace, data, len);
2758}
2759
2760////////////////////////////////////////////////////////////////////////////////
2761/// Add XdndAware property and the list of drag and drop types to the
2762/// Window win.
2763
2765{
2766 unsigned char version = 4;
2767 Atom_t dndaware = InternAtom("XdndAware", kFALSE);
2768 XChangeProperty((Display*)fDisplay, (Window) win, (Atom) dndaware, (Atom) XA_ATOM,
2769 32, PropModeReplace, (unsigned char *) &version, 1);
2770
2771 if (typelist) {
2772 int n;
2773
2774 for (n = 0; typelist[n]; n++) { }
2775 if (n > 0) {
2776 XChangeProperty((Display*)fDisplay, win, dndaware, XA_ATOM, 32, PropModeAppend,
2777 (unsigned char *) typelist, n);
2778 }
2779 }
2780}
2781
2782////////////////////////////////////////////////////////////////////////////////
2783/// Add the list of drag and drop types to the Window win.
2784
2786{
2787 if (typelist) {
2788 int n;
2789 for (n = 0; typelist[n]; n++) { }
2790 if (n > 0) {
2791 XChangeProperty((Display*)fDisplay, win, prop, XA_ATOM, 32, PropModeAppend,
2792 (unsigned char *) typelist, n);
2793 }
2794 }
2795}
2796
2797////////////////////////////////////////////////////////////////////////////////
2798/// Recursively search in the children of Window for a Window which is at
2799/// location x, y and is DND aware, with a maximum depth of maxd.
2800/// Possibility to exclude dragwin and input.
2801
2803 int x, int y, int maxd)
2804{
2805 WindowAttributes_t wattr;
2806 static Atom_t *dndTypeList = nullptr;
2807
2808 if (!dndTypeList) {
2809 dndTypeList = new Atom_t[3];
2810 dndTypeList[0] = InternAtom("application/root", kFALSE);
2811 dndTypeList[1] = InternAtom("text/uri-list", kFALSE);
2812 dndTypeList[2] = 0;
2813 }
2814
2815 if (maxd <= 0) return kNone;
2816
2817 if (win == dragwin || win == input) return kNone;
2818
2819 GetWindowAttributes(win, wattr);
2820 if (wattr.fMapState != kIsUnmapped &&
2821 x >= wattr.fX && x < wattr.fX + wattr.fWidth &&
2822 y >= wattr.fY && y < wattr.fY + wattr.fHeight) {
2823
2824 if (IsDNDAware(win, dndTypeList)) return win;
2825
2826 Window r, p, *children;
2827 UInt_t numch;
2828 int i;
2829
2830 if (XQueryTree((Display*)fDisplay, win, &r, &p, &children, &numch)) {
2831 if (children && numch > 0) {
2832 r = kNone;
2833 // upon return from XQueryTree, children are listed in the current
2834 // stacking order, from bottom-most (first) to top-most (last)
2835 for (i = numch-1; i >= 0; --i) {
2836 r = FindRWindow((Window_t)children[i], dragwin, input,
2837 x - wattr.fX, y - wattr.fY, maxd-1);
2838 if (r != kNone) break;
2839 }
2840 XFree(children);
2841 if (r != kNone) return r;
2842 }
2843 return kNone; //win; // ?!?
2844 }
2845 }
2846 return kNone;
2847}
2848
2849////////////////////////////////////////////////////////////////////////////////
2850/// Checks if Window win is DND aware, and knows any of the DND formats
2851/// passed in argument.
2852
2854{
2855 Atom_t actual;
2856 Int_t format;
2857 ULong_t count, remaining;
2858 unsigned char *data = nullptr;
2859 Atom_t *types, *t;
2860 Int_t result = kTRUE;
2861 static Atom_t dndaware = kNone;
2862
2863 if (win == kNone) return kFALSE;
2864
2865 if (dndaware == kNone)
2866 dndaware = InternAtom("XdndAware", kFALSE);
2867
2868 XGetWindowProperty((Display*)fDisplay, win, dndaware, 0, 0x8000000L, kFALSE,
2869 XA_ATOM, &actual, &format, &count, &remaining, &data);
2870
2871 if ((actual != XA_ATOM) || (format != 32) || (count == 0) || !data) {
2872 if (data) XFree(data);
2873 return kFALSE;
2874 }
2875
2876 types = (Atom_t *) data;
2877
2878 if ((count > 1) && typelist) {
2879 result = kFALSE;
2880 for (t = typelist; *t; t++) {
2881 for (ULong_t j = 1; j < count; j++) {
2882 if (types[j] == *t) {
2883 result = kTRUE;
2884 break;
2885 }
2886 }
2887 if (result) break;
2888 }
2889 }
2890 XFree(data);
2891 return result;
2892}
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:37
Handle_t Region_t
Region handle.
Definition GuiTypes.h:32
const Mask_t kGCCapStyle
Definition GuiTypes.h:292
const Mask_t kGCArcMode
Definition GuiTypes.h:308
EGEventType
Definition GuiTypes.h:59
@ kSelectionClear
Definition GuiTypes.h:63
@ kColormapNotify
Definition GuiTypes.h:64
@ kConfigureNotify
Definition GuiTypes.h:62
@ kGKeyPress
Definition GuiTypes.h:60
@ kExpose
Definition GuiTypes.h:62
@ kUnmapNotify
Definition GuiTypes.h:62
@ kButtonRelease
Definition GuiTypes.h:60
@ kSelectionNotify
Definition GuiTypes.h:63
@ kButtonPress
Definition GuiTypes.h:60
@ kFocusOut
Definition GuiTypes.h:61
@ kDestroyNotify
Definition GuiTypes.h:62
@ kMotionNotify
Definition GuiTypes.h:61
@ kFocusIn
Definition GuiTypes.h:61
@ kClientMessage
Definition GuiTypes.h:63
@ kEnterNotify
Definition GuiTypes.h:61
@ kSelectionRequest
Definition GuiTypes.h:63
@ kMapNotify
Definition GuiTypes.h:62
@ kOtherEvent
Definition GuiTypes.h:64
@ kKeyRelease
Definition GuiTypes.h:60
@ kLeaveNotify
Definition GuiTypes.h:61
const Mask_t kWABorderPixel
Definition GuiTypes.h:142
const Mask_t kWAOverrideRedirect
Definition GuiTypes.h:149
const Mask_t kWABitGravity
Definition GuiTypes.h:144
const Mask_t kGCDashOffset
Definition GuiTypes.h:306
const Mask_t kGCBackground
Definition GuiTypes.h:289
const Mask_t kGCForeground
Definition GuiTypes.h:288
const Mask_t kPAReturnPixels
Definition GuiTypes.h:341
const Mask_t kGCLineStyle
Definition GuiTypes.h:291
const Mask_t kWADontPropagate
Definition GuiTypes.h:152
const Mask_t kKeyMod5Mask
Definition GuiTypes.h:202
const Mask_t kGCSubwindowMode
Definition GuiTypes.h:301
const Mask_t kGCLineWidth
Definition GuiTypes.h:290
ECursor
Definition GuiTypes.h:372
@ kHand
Definition GuiTypes.h:374
Handle_t Pixmap_t
Pixmap handle.
Definition GuiTypes.h:30
const Mask_t kKeyMod4Mask
Definition GuiTypes.h:201
const Mask_t kPADepth
Definition GuiTypes.h:338
const Mask_t kGCTile
Definition GuiTypes.h:296
const Mask_t kWAColormap
Definition GuiTypes.h:153
const Mask_t kButtonMotionMask
Definition GuiTypes.h:164
const Mask_t kKeyMod3Mask
Definition GuiTypes.h:200
const Mask_t kGCClipXOrigin
Definition GuiTypes.h:303
const Mask_t kWABackingStore
Definition GuiTypes.h:146
const Mask_t kFocusChangeMask
Definition GuiTypes.h:169
const Mask_t kKeyLockMask
Definition GuiTypes.h:196
const Mask_t kButtonPressMask
Definition GuiTypes.h:161
const Mask_t kPACloseness
Definition GuiTypes.h:342
Handle_t FontH_t
Font handle (as opposed to Font_t which is an index)
Definition GuiTypes.h:35
const Mask_t kKeyMod1Mask
typically the Alt key
Definition GuiTypes.h:198
Handle_t Visual_t
Visual handle.
Definition GuiTypes.h:28
const Mask_t kGCDashList
Definition GuiTypes.h:307
const Mask_t kExposureMask
Definition GuiTypes.h:165
const Mask_t kWAEventMask
Definition GuiTypes.h:151
const Mask_t kGCFillStyle
Definition GuiTypes.h:294
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
const Mask_t kGCJoinStyle
Definition GuiTypes.h:293
const Mask_t kKeyReleaseMask
Definition GuiTypes.h:160
const Mask_t kDoRed
Definition GuiTypes.h:319
const Mask_t kWASaveUnder
Definition GuiTypes.h:150
const Mask_t kWABackPixel
Definition GuiTypes.h:140
Handle_t Display_t
Display handle.
Definition GuiTypes.h:27
const Mask_t kWAWinGravity
Definition GuiTypes.h:145
const Mask_t kGCFunction
Definition GuiTypes.h:286
const Mask_t kOwnerGrabButtonMask
Definition GuiTypes.h:170
const Mask_t kAnyModifier
Definition GuiTypes.h:210
EGraphicsFunction
Definition GuiTypes.h:67
const Mask_t kKeyPressMask
Definition GuiTypes.h:159
ULong_t Time_t
Event time.
Definition GuiTypes.h:42
Handle_t GContext_t
Graphics context handle.
Definition GuiTypes.h:38
EInitialState
Initial window mapping state.
Definition GuiTypes.h:345
@ kNormalState
Definition GuiTypes.h:346
@ kIconicState
Definition GuiTypes.h:347
const Mask_t kButton1Mask
Definition GuiTypes.h:203
const Mask_t kGCTileStipXOrigin
Definition GuiTypes.h:298
Handle_t Drawable_t
Drawable handle.
Definition GuiTypes.h:31
const Mask_t kWABackingPixel
Definition GuiTypes.h:148
const Mask_t kColormapChangeMask
Definition GuiTypes.h:171
const Mask_t kGCFont
Definition GuiTypes.h:300
const Mask_t kPointerMotionMask
Definition GuiTypes.h:163
const Mask_t kKeyShiftMask
Definition GuiTypes.h:195
Handle_t Cursor_t
Cursor handle.
Definition GuiTypes.h:34
const Handle_t kNone
Definition GuiTypes.h:88
const Mask_t kKeyControlMask
Definition GuiTypes.h:197
const Mask_t kKeyMod2Mask
typically mod on numeric keys
Definition GuiTypes.h:199
const Mask_t kButton3Mask
Definition GuiTypes.h:205
const Mask_t kLeaveWindowMask
Definition GuiTypes.h:168
const Mask_t kStructureNotifyMask
Definition GuiTypes.h:166
@ kInputOutput
Definition GuiTypes.h:47
@ kWhenMapped
Definition GuiTypes.h:45
@ kNotUseful
Definition GuiTypes.h:45
@ kIsUnmapped
Definition GuiTypes.h:46
@ kAlways
Definition GuiTypes.h:45
@ kInputOnly
Definition GuiTypes.h:47
const Mask_t kButton2Mask
Definition GuiTypes.h:204
const Handle_t kParentRelative
Definition GuiTypes.h:90
const Mask_t kPAColormap
Definition GuiTypes.h:337
const Mask_t kGCFillRule
Definition GuiTypes.h:295
const Mask_t kGCPlaneMask
Definition GuiTypes.h:287
const Mask_t kGCStipple
Definition GuiTypes.h:297
const Mask_t kButtonReleaseMask
Definition GuiTypes.h:162
const Mask_t kGCGraphicsExposures
Definition GuiTypes.h:302
const Mask_t kGCClipYOrigin
Definition GuiTypes.h:304
const Mask_t kDoGreen
Definition GuiTypes.h:320
const Mask_t kWABorderPixmap
Definition GuiTypes.h:141
const Mask_t kPASize
width and height
Definition GuiTypes.h:339
const Mask_t kEnterWindowMask
Definition GuiTypes.h:167
const Mask_t kGCClipMask
Definition GuiTypes.h:305
const Mask_t kDoBlue
Definition GuiTypes.h:321
const Mask_t kPAHotspot
x and y hotspot
Definition GuiTypes.h:340
const Mask_t kGCTileStipYOrigin
Definition GuiTypes.h:299
const Mask_t kWACursor
Definition GuiTypes.h:154
EMouseButton
Button names.
Definition GuiTypes.h:214
Handle_t Colormap_t
Colormap handle.
Definition GuiTypes.h:33
const Mask_t kWABackPixmap
Definition GuiTypes.h:139
const Mask_t kWABorderWidth
Definition GuiTypes.h:143
ULongptr_t Handle_t
Generic resource handle.
Definition GuiTypes.h:26
Handle_t FontStruct_t
Pointer to font structure.
Definition GuiTypes.h:39
const Mask_t kWABackingPlanes
Definition GuiTypes.h:147
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:550
#define f(i)
Definition RSha256.hxx:104
#define a(i)
Definition RSha256.hxx:99
#define h(i)
Definition RSha256.hxx:106
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
unsigned char UChar_t
Definition RtypesCore.h:38
unsigned long ULong_t
Definition RtypesCore.h:55
long Long_t
Definition RtypesCore.h:54
unsigned int UInt_t
Definition RtypesCore.h:46
constexpr UInt_t kMaxUInt
Definition RtypesCore.h:111
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define BIT(n)
Definition Rtypes.h:85
R__EXTERN TEnv * gEnv
Definition TEnv.h:170
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:185
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 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 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 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:50
char name[80]
Definition TGX11.cxx:110
XID Colormap
Definition TGX11.h:38
XID Window
Definition TGX11.h:39
XID Drawable
Definition TGX11.h:36
XID Cursor
Definition TGX11.h:37
#define gROOT
Definition TROOT.h:406
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2467
R__EXTERN TSystem * gSystem
Definition TSystem.h:560
R__EXTERN TFileHandler * gXDisplay
Definition TSystem.h:561
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:1539
#define calloc
Definition civetweb.c:1537
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition TEnv.cxx:491
void * fDisplay
Pointer to display.
Definition TGX11.h:128
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:2517
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:2165
void SetPrimarySelectionOwner(Window_t id) override
Makes the window id the current owner of the primary selection.
Definition GX11Gui.cxx:2249
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:132
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:1954
void GetRegionBox(Region_t reg, Rectangle_t *) override
Return smallest enclosing rectangle.
Definition GX11Gui.cxx:2585
void FreeFontStruct(FontStruct_t fs) override
Free font structure returned by GetFontStruct().
Definition GX11Gui.cxx:2123
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:2705
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:2267
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:1919
Bool_t SetSelectionOwner(Window_t, Atom_t &) override
Changes the owner and last-change time for the specified selection.
Definition GX11Gui.cxx:2741
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:1972
void SetCursor(Int_t win, ECursor cursor) override
Set the cursor.
Definition TGX11.cxx:2076
Int_t fScreenNumber
Screen number.
Definition TGX11.h:135
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:2403
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:2718
void SetInputFocus(Window_t id) override
Set keyboard input focus to window id.
Definition GX11Gui.cxx:2224
void SetWMState(Window_t id, EInitialState state) override
Set the initial state of the window. Either kNormalState or kIconicState.
Definition GX11Gui.cxx:2027
Bool_t ReadPictureDataFromFile(const char *filename, char ***ret_data) override
Read picture data from file and store in ret_data.
Definition GX11Gui.cxx:1278
Cursor fCursors[kNumCursors]
List of cursors.
Definition TGX11.h:89
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:1825
Bool_t AllocColor(Colormap cmap, RXColor *color)
Allocate color in colormap.
Definition TGX11.cxx:366
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:2764
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:2853
void SetIconPixmap(Window_t id, Pixmap_t pic) override
Set pixmap the WM can use when the window is iconized.
Definition GX11Gui.cxx:1925
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:2470
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:2665
Int_t KeysymToKeycode(UInt_t keysym) override
Convert a keysym to the appropriate keycode.
Definition GX11Gui.cxx:2154
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:2343
void SelectInput(Window_t id, UInt_t evmask) override
Defines which input events the window is interested in.
Definition GX11Gui.cxx:2198
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:2536
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:2569
void MapKeySym(UInt_t &keysym, UInt_t &xkeysym, Bool_t tox=kTRUE)
Map to and from X key symbols.
Definition GX11Gui.cxx:2303
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:2645
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:150
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:1080
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:2593
UInt_t ScreenWidthMM() const override
Returns the width of the screen in millimeters.
Definition GX11Gui.cxx:2684
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:130
void SetWMTransientHint(Window_t id, Window_t main_id) override
Tell window manager that window is a transient window of main.
Definition GX11Gui.cxx:2048
Window_t GetPrimarySelectionOwner() override
Returns the window id of the current owner of the primary selection.
Definition GX11Gui.cxx:2240
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:1872
void ClearWindow() override
Clear current window.
Definition TGX11.cxx:422
void * fXEvent
Current native (X11) event.
Definition TGX11.h:90
void SetWindowName(Window_t id, char *name) override
Set window name.
Definition GX11Gui.cxx:1891
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:1846
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:2605
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:2005
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:1753
Drawable fVisRootWin
Root window with fVisual to be used to create GC's and XImages.
Definition TGX11.h:131
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:143
Int_t fDepth
Number of color planes.
Definition TGX11.h:142
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:342
void GetImageSize(Drawable_t id, UInt_t &width, UInt_t &height) override
Get size of XImage img.
Definition GX11Gui.cxx:2636
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:2732
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:2751
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:2785
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:2553
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:2387
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:2561
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:2185
void GetGCValues(GContext_t gc, GCValues_t &gval) override
Get current values from graphics context gc.
Definition GX11Gui.cxx:2090
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:133
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:2802
FontStruct_t GetFontStruct(FontH_t fh) override
Retrieve associated font structure once we have the font handle.
Definition GX11Gui.cxx:2111
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:1454
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:2613
void UnionRectWithRegion(Rectangle_t *rect, Region_t src, Region_t dest) override
Union of rectangle with a region.
Definition GX11Gui.cxx:2507
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:2069
void DestroyRegion(Region_t reg) override
Destroy region.
Definition GX11Gui.cxx:2499
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:2281
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:1741
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:1091
void SetIconName(Window_t id, char *name) override
Set window icon name.
Definition GX11Gui.cxx:1908
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:2058
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:2675
Window_t GetInputFocus() override
Returns the window id of the window having the input focus.
Definition GX11Gui.cxx:2212
void WMDeleteNotify(Window_t id) override
Tell WM to send message when window is closed via WM.
Definition GX11Gui.cxx:1798
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:1940
void SendEvent(Window_t id, Event_t *ev) override
Send event ev to window id.
Definition GX11Gui.cxx:1784
void SetWMSize(Window_t id, UInt_t w, UInt_t h) override
Tell the window manager the desired window size.
Definition GX11Gui.cxx:1988
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:2577
RVisual * fVisual
Pointer to visual used by all windows.
Definition TGX11.h:129
Region_t CreateRegion() override
Create a new empty region.
Definition GX11Gui.cxx:2491
void DrawLine(Int_t x1, Int_t y1, Int_t x2, Int_t y2) override
Draw a line.
Definition TGX11.cxx:608
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:2175
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:2460
void SetKeyAutoRepeat(Bool_t on=kTRUE) override
Turn key auto repeat on or off.
Definition GX11Gui.cxx:1808
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:2694
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:2421
void GetFontProperties(FontStruct_t font, Int_t &max_ascent, Int_t &max_descent) override
Return some font properties.
Definition GX11Gui.cxx:2077
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:3450
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:2544
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:3515
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:2527
void Update(Int_t mode=0) override
Flush (mode = 0, default) or synchronize (mode = 1) X output buffer.
Definition GX11Gui.cxx:2480
Mother of all ROOT objects.
Definition TObject.h:41
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:962
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:976
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:2848
Basic string class.
Definition TString.h:139
virtual TFileHandler * RemoveFileHandler(TFileHandler *fh)
Remove a file handler from the list of file handlers.
Definition TSystem.cxx:551
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:311
UShort_t fRed
red component (0..65535)
Definition GuiTypes.h:312
UShort_t fGreen
green component (0..65535)
Definition GuiTypes.h:313
UShort_t fBlue
blue component (0..65535)
Definition GuiTypes.h:314
UShort_t fMask
mask telling which color components are valid
Definition GuiTypes.h:315
Event structure.
Definition GuiTypes.h:174
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:175
Int_t fY
pointer x, y coordinates in event window
Definition GuiTypes.h:178
Int_t fXRoot
Definition GuiTypes.h:179
Bool_t fSendEvent
true if event came from SendEvent
Definition GuiTypes.h:184
Handle_t fHandle
general resource handle (used for atoms or windows)
Definition GuiTypes.h:185
Int_t fFormat
Next fields only used by kClientMessageEvent.
Definition GuiTypes.h:186
UInt_t fWidth
Definition GuiTypes.h:182
UInt_t fHeight
width and height of exposed area
Definition GuiTypes.h:182
Int_t fCount
if non-zero, at least this many more exposes
Definition GuiTypes.h:183
Window_t fWindow
window reported event is relative to
Definition GuiTypes.h:176
UInt_t fState
key or button mask
Definition GuiTypes.h:181
Int_t fYRoot
coordinates relative to root
Definition GuiTypes.h:179
Int_t fX
Definition GuiTypes.h:178
Time_t fTime
time event event occurred in ms
Definition GuiTypes.h:177
UInt_t fCode
key or button code
Definition GuiTypes.h:180
Longptr_t fUser[5]
5 longs can be used by client message events NOTE: only [0], [1] and [2] may be used.
Definition GuiTypes.h:187
Graphics context structure.
Definition GuiTypes.h:224
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:356
Rectangle structure (maps to the X11 XRectangle structure)
Definition GuiTypes.h:361
Used for drawing line segments (maps to the X11 XSegments structure)
Definition GuiTypes.h:351
Attributes that can be used when creating or changing a window.
Definition GuiTypes.h:93
Window attributes that can be inquired.
Definition GuiTypes.h:114
Int_t fMapState
kIsUnmapped, kIsUnviewable, kIsViewable
Definition GuiTypes.h:130
Int_t fHeight
width and height of window
Definition GuiTypes.h:116
Int_t fY
location of window
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