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 <stdio.h>
17#include <string.h>
18#include <stdlib.h>
19#include <ctype.h>
20#include <limits.h>
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#ifdef _REENTRANT
812 // In some cases there can be problems due to XInitThreads, like when
813 // using Qt, so we allow for it to be turned off
814 if (gEnv->GetValue("X11.XInitThread", 1)) {
815 // Must be very first call before any X11 call !!
816 if (!XInitThreads())
817 Warning("OpenDisplay", "system has no X11 thread support");
818 }
819#endif
820
821 Display *dpy;
822 if (!(dpy = XOpenDisplay(dpyName)))
823 return -1;
824
825 // Set custom X11 error handlers
826 XSetErrorHandler(RootX11ErrorHandler);
827 XSetIOErrorHandler(RootX11IOErrorHandler);
828
829 if (gEnv->GetValue("X11.Sync", 0))
830 XSynchronize(dpy, 1);
831
832 // Init the GX11 class, sets a.o. fDisplay.
833 if (!Init(dpy))
834 return -1;
835
836 return ConnectionNumber(dpy);
837}
838
839////////////////////////////////////////////////////////////////////////////////
840/// Close connection to display server.
841
843{
844 XCloseDisplay((Display*)fDisplay);
845 fDisplay = nullptr;
846}
847
848////////////////////////////////////////////////////////////////////////////////
849/// Returns handle to display (might be useful in some cases where
850/// direct X11 manipulation outside of TVirtualX is needed, e.g. GL
851/// interface).
852
854{
855 return (Display_t) fDisplay;
856}
857
858////////////////////////////////////////////////////////////////////////////////
859/// Returns handle to visual (might be useful in some cases where
860/// direct X11 manipulation outside of TVirtualX is needed, e.g. GL
861/// interface).
862
864{
865 return (Visual_t) fVisual;
866}
867
868////////////////////////////////////////////////////////////////////////////////
869/// Returns handle to colormap (might be useful in some cases where
870/// direct X11 manipulation outside of TVirtualX is needed, e.g. GL
871/// interface).
872
874{
875 return (Colormap_t) fColormap;
876}
877
878////////////////////////////////////////////////////////////////////////////////
879/// Returns screen number (might be useful in some cases where
880/// direct X11 manipulation outside of TVirtualX is needed, e.g. GL
881/// interface).
882
884{
885 return fScreenNumber;
886}
887
888////////////////////////////////////////////////////////////////////////////////
889/// Returns depth of screen (number of bit planes). Equivalent to
890/// GetPlanes().
891
893{
894 return fDepth;
895}
896
897////////////////////////////////////////////////////////////////////////////////
898/// Return atom handle for atom_name. If it does not exist
899/// create it if only_if_exist is false. Atoms are used to communicate
900/// between different programs (i.e. window manager) via the X server.
901
902Atom_t TGX11::InternAtom(const char *atom_name, Bool_t only_if_exist)
903{
904 Atom a = XInternAtom((Display*)fDisplay, (char *)atom_name, (Bool)only_if_exist);
905
906 if (a == None) return kNone;
907 return (Atom_t) a;
908}
909
910////////////////////////////////////////////////////////////////////////////////
911/// Return handle to the default root window created when calling
912/// XOpenDisplay().
913
915{
916 return (Window_t) fRootWin;
917}
918
919////////////////////////////////////////////////////////////////////////////////
920/// Return the parent of the window.
921
923{
924 if (!id) return (Window_t)0;
925
926 Window root, parent;
927 Window *children = nullptr;
928 UInt_t nchildren;
929
930 XQueryTree((Display*)fDisplay, (Window) id, &root, &parent, &children, &nchildren);
931
932 if (children) XFree(children);
933
934 return (Window_t) parent;
935}
936
937
938////////////////////////////////////////////////////////////////////////////////
939/// Load font and query font. If font is not found 0 is returned,
940/// otherwise an opaque pointer to the FontStruct_t.
941/// Free the loaded font using DeleteFont().
942
943FontStruct_t TGX11::LoadQueryFont(const char *font_name)
944{
945 XFontStruct *fs = XLoadQueryFont((Display*)fDisplay, (char *)font_name);
946 return (FontStruct_t) fs;
947}
948
949////////////////////////////////////////////////////////////////////////////////
950/// Return handle to font described by font structure.
951
953{
954 if (fs) {
955 XFontStruct *fss = (XFontStruct *)fs;
956 return fss->fid;
957 }
958 return 0;
959}
960
961////////////////////////////////////////////////////////////////////////////////
962/// Explicitly delete font structure obtained with LoadQueryFont().
963
965{
966 if (fDisplay) XFreeFont((Display*)fDisplay, (XFontStruct *) fs);
967}
968
969////////////////////////////////////////////////////////////////////////////////
970/// Create a graphics context using the values set in gval (but only for
971/// those entries that are in the mask).
972
974{
975 RXGCValues xgval;
976 ULong_t xmask = 0;
977
978 if (gval)
979 MapGCValues(*gval, xmask, xgval);
980
981 if (!id || ((Drawable) id == fRootWin))
982 id = (Drawable_t) fVisRootWin;
983
984 GC gc = XCreateGC((Display*)fDisplay, (Drawable) id, xmask, &xgval);
985
986 if (gval && (gval->fMask & kGCFont))
987 MapGCFont((GContext_t)gc, gval->fFont);
988
989 return (GContext_t) gc;
990}
991
992////////////////////////////////////////////////////////////////////////////////
993/// Change entries in an existing graphics context, gc, by values from gval.
994
996{
997 RXGCValues xgval;
998 ULong_t xmask = 0;
999
1000 if (gval)
1001 MapGCValues(*gval, xmask, xgval);
1002
1003 XChangeGC((Display*)fDisplay, (GC) gc, xmask, &xgval);
1004
1005 if (gval && (gval->fMask & kGCFont))
1006 MapGCFont((GContext_t)gc, gval->fFont);
1007}
1008
1009////////////////////////////////////////////////////////////////////////////////
1010/// Copies graphics context from org to dest. Only the values specified
1011/// in mask are copied. If mask = 0 then copy all fields. Both org and
1012/// dest must exist.
1013
1015{
1017 RXGCValues xgval;
1018 ULong_t xmask;
1019
1020 if (!mask) {
1021 // in this case copy all fields
1022 mask = kMaxUInt;
1023 }
1024
1025 gval.fMask = mask; // only set fMask used to convert to xmask
1026 MapGCValues(gval, xmask, xgval);
1027
1028 XCopyGC((Display*)fDisplay, (GC) org, xmask, (GC) dest);
1029}
1030
1031////////////////////////////////////////////////////////////////////////////////
1032/// Explicitly delete a graphics context.
1033
1035{
1036 // Protection against deletion of global TGGC objects, which are
1037 // destructed after fDisplay has been closed.
1038 if (fDisplay)
1039 XFreeGC((Display*)fDisplay, (GC) gc);
1040}
1041
1042////////////////////////////////////////////////////////////////////////////////
1043/// Create cursor handle (just return cursor from cursor pool fCursors).
1044
1046{
1047 return (Cursor_t) fCursors[cursor];
1048}
1049
1050////////////////////////////////////////////////////////////////////////////////
1051/// Set the specified cursor.
1052
1054{
1055 if (!id) return;
1056
1057 XDefineCursor((Display*)fDisplay, (Window) id, (Cursor) curid);
1058}
1059
1060////////////////////////////////////////////////////////////////////////////////
1061/// Creates a pixmap of the width and height you specified
1062/// and returns a pixmap ID that identifies it.
1063
1065{
1066 return (Pixmap_t) XCreatePixmap((Display*)fDisplay, (Drawable) (id ? id : fRootWin), w, h, fDepth);
1067}
1068
1069////////////////////////////////////////////////////////////////////////////////
1070/// Create a pixmap from bitmap data. Ones will get foreground color and
1071/// zeroes background color.
1072
1075 Int_t depth)
1076{
1077 return (Pixmap_t) XCreatePixmapFromBitmapData((Display*)fDisplay, (id ? id : fRootWin), (char *)bitmap,
1078 width, height, forecolor, backcolor, depth);
1079}
1080
1081////////////////////////////////////////////////////////////////////////////////
1082/// Create a bitmap (i.e. pixmap with depth 1) from the bitmap data.
1083
1086{
1087 return (Pixmap_t) XCreateBitmapFromData((Display*)fDisplay, (id ? id : fRootWin), (char *)bitmap,
1088 width, height);
1089}
1090
1091////////////////////////////////////////////////////////////////////////////////
1092/// Explicitly delete pixmap resource.
1093
1095{
1096 if (fDisplay) XFreePixmap((Display*)fDisplay, (Pixmap) pmap);
1097}
1098
1099////////////////////////////////////////////////////////////////////////////////
1100/// Map a PictureAttributes_t to a XpmAttributes structure. If toxpm is
1101/// kTRUE map from attr to xpmattr, else map the other way.
1102
1104 Bool_t toxpm)
1105{
1106#ifdef XpmVersion
1107 if (toxpm) {
1108 Mask_t mask = attr.fMask;
1109 ULong_t xmask = 0;
1110
1111 if ((mask & kPAColormap)) {
1112 xmask |= XpmColormap;
1113 xpmattr.colormap = (Colormap)attr.fColormap;
1114 }
1115 if ((mask & kPADepth)) {
1116 xmask |= XpmDepth;
1117 xpmattr.depth = attr.fDepth;
1118 }
1119 if ((mask & kPASize)) {
1120 xmask |= XpmSize;
1121 xpmattr.width = attr.fWidth;
1122 xpmattr.height = attr.fHeight;
1123 }
1124 if ((mask & kPAHotspot)) {
1125 xmask |= XpmHotspot;
1126 xpmattr.x_hotspot = attr.fXHotspot;
1127 xpmattr.y_hotspot = attr.fYHotspot;
1128 }
1129 if ((mask & kPAReturnPixels)) {
1130 xmask |= XpmReturnPixels;
1131 xpmattr.pixels = nullptr; // output parameters
1132 xpmattr.npixels = 0;
1133 }
1134 if ((mask & kPACloseness)) {
1135 xmask |= XpmCloseness;
1136 xpmattr.closeness = attr.fCloseness;
1137 }
1138 xpmattr.valuemask = xmask;
1139 } else {
1140 ULong_t xmask = xpmattr.valuemask;
1141 Mask_t mask = 0;
1142
1143 attr.fPixels = nullptr;
1144 attr.fNpixels = 0;
1145
1146 if ((xmask & XpmColormap)) {
1147 mask |= kPAColormap;
1148 attr.fColormap = (Colormap_t)xpmattr.colormap;
1149 mask |= kPADepth;
1150 attr.fDepth = xpmattr.depth;
1151 }
1152 if ((xmask & XpmSize)) {
1153 mask |= kPASize;
1154 attr.fWidth = xpmattr.width;
1155 attr.fHeight = xpmattr.height;
1156 }
1157 if ((xmask & XpmHotspot)) {
1158 mask |= kPAHotspot;
1159 attr.fXHotspot = xpmattr.x_hotspot;
1160 attr.fYHotspot = xpmattr.y_hotspot;
1161 }
1162 if ((xmask & XpmReturnPixels)) {
1164 if (xpmattr.npixels) {
1165 attr.fPixels = new ULong_t[xpmattr.npixels];
1166 for (UInt_t i = 0; i < xpmattr.npixels; i++)
1167 attr.fPixels[i] = xpmattr.pixels[i];
1168 attr.fNpixels = xpmattr.npixels;
1169 }
1170 }
1171 if ((xmask & XpmCloseness)) {
1172 mask |= kPACloseness;
1173 attr.fCloseness = xpmattr.closeness;
1174 }
1175 attr.fMask = mask;
1176 }
1177#endif
1178}
1179
1180////////////////////////////////////////////////////////////////////////////////
1181/// Create a picture pixmap from data on file. The picture attributes
1182/// are used for input and output. Returns kTRUE in case of success,
1183/// kFALSE otherwise. If mask does not exist it is set to kNone.
1184
1188{
1189 if (strstr(filename, ".gif") || strstr(filename, ".GIF")) {
1190 pict = ReadGIF(0, 0, filename, id);
1191 pict_mask = kNone;
1192 attr.fDepth = fDepth;
1193 Int_t dummy;
1194 GetWindowSize(pict, dummy, dummy, attr.fWidth, attr.fHeight);
1195 return kTRUE;
1196 }
1197
1198#ifdef XpmVersion
1199 RXpmAttributes xpmattr;
1200
1201 MapPictureAttributes(attr, xpmattr);
1202
1203 // make sure pixel depth of pixmap is the same as in the visual
1204 if ((Drawable) id == fRootWin && fRootWin != fVisRootWin) {
1205 xpmattr.valuemask |= XpmDepth;
1206 xpmattr.depth = fDepth;
1207 }
1208
1209 Int_t res = XpmReadFileToPixmap((Display*)fDisplay, (id ? id : fRootWin), (char*)filename,
1210 (Pixmap*)&pict, (Pixmap*)&pict_mask, &xpmattr);
1211
1212 MapPictureAttributes(attr, xpmattr, kFALSE);
1213 XpmFreeAttributes(&xpmattr);
1214
1215 if (res == XpmSuccess || res == XpmColorError)
1216 return kTRUE;
1217
1218 if (pict) {
1219 XFreePixmap((Display*)fDisplay, (Pixmap)pict);
1220 pict = kNone;
1221 }
1222 if (pict_mask) {
1223 XFreePixmap((Display*)fDisplay, (Pixmap)pict_mask);
1224 pict_mask = kNone;
1225 }
1226#else
1227 Error("CreatePictureFromFile", "cannot get picture, not compiled with Xpm");
1228#endif
1229
1230 return kFALSE;
1231}
1232
1233////////////////////////////////////////////////////////////////////////////////
1234/// Create a picture pixmap from data. The picture attributes
1235/// are used for input and output. Returns kTRUE in case of success,
1236/// kFALSE otherwise. If mask does not exist it is set to kNone.
1237
1240{
1241#ifdef XpmVersion
1242 RXpmAttributes xpmattr;
1243
1244 MapPictureAttributes(attr, xpmattr);
1245
1246 // make sure pixel depth of pixmap is the same as in the visual
1247 if ((Drawable) id == fRootWin && fRootWin != fVisRootWin) {
1248 xpmattr.valuemask |= XpmDepth;
1249 xpmattr.depth = fDepth;
1250 }
1251
1252 Int_t res = XpmCreatePixmapFromData((Display*)fDisplay, (id ? id : fRootWin), data, (Pixmap*)&pict,
1253 (Pixmap*)&pict_mask, &xpmattr);
1254
1255 MapPictureAttributes(attr, xpmattr, kFALSE);
1256 XpmFreeAttributes(&xpmattr);
1257
1258 if (res == XpmSuccess || res == XpmColorError)
1259 return kTRUE;
1260
1261 if (pict) {
1262 XFreePixmap((Display*)fDisplay, (Pixmap)pict);
1263 pict = kNone;
1264 }
1265 if (pict_mask) {
1266 XFreePixmap((Display*)fDisplay, (Pixmap)pict_mask);
1267 pict_mask = kNone;
1268 }
1269#else
1270 Error("CreatePictureFromData", "cannot get picture, not compiled with Xpm");
1271#endif
1272
1273 return kFALSE;
1274}
1275
1276////////////////////////////////////////////////////////////////////////////////
1277/// Read picture data from file and store in ret_data. Returns kTRUE in
1278/// case of success, kFALSE otherwise.
1279
1280Bool_t TGX11::ReadPictureDataFromFile(const char *filename, char ***ret_data)
1281{
1282#ifdef XpmVersion
1283 if (XpmReadFileToData((char*)filename, ret_data) == XpmSuccess)
1284 return kTRUE;
1285#else
1286 Error("ReadPictureFromDataFile", "cannot get picture, not compiled with Xpm");
1287#endif
1288 return kFALSE;
1289}
1290
1291////////////////////////////////////////////////////////////////////////////////
1292/// Delete picture data created by the function ReadPictureDataFromFile.
1293
1295{
1296#ifdef XpmVersion
1297 // some older libXpm's don't have this function and it is typically
1298 // implemented with a simple free()
1299 // XpmFree(data);
1300 free(data);
1301#endif
1302}
1303
1304////////////////////////////////////////////////////////////////////////////////
1305/// Specify a dash pattern. Offset defines the phase of the pattern.
1306/// Each element in the dash_list array specifies the length (in pixels)
1307/// of a segment of the pattern. N defines the length of the list.
1308
1309void TGX11::SetDashes(GContext_t gc, Int_t offset, const char *dash_list, Int_t n)
1310{
1311 XSetDashes((Display*)fDisplay, (GC) gc, offset, (char *)dash_list, n);
1312}
1313
1314////////////////////////////////////////////////////////////////////////////////
1315/// Map a ColorStruct_t to a XColor structure.
1316
1318{
1319 xcolor.pixel = color->fPixel;
1320 xcolor.red = color->fRed;
1321 xcolor.green = color->fGreen;
1322 xcolor.blue = color->fBlue;
1323 xcolor.flags = color->fMask; //ident mapping
1324}
1325
1326////////////////////////////////////////////////////////////////////////////////
1327/// Parse string cname containing color name, like "green" or "#00FF00".
1328/// It returns a filled in ColorStruct_t. Returns kFALSE in case parsing
1329/// failed, kTRUE in case of success. On success, the ColorStruct_t
1330/// fRed, fGreen and fBlue fields are all filled in and the mask is set
1331/// for all three colors, but fPixel is not set.
1332
1334{
1335 XColor xc;
1336
1337 if (XParseColor((Display*)fDisplay, (Colormap)cmap, (char *)cname, &xc)) {
1338 color.fPixel = 0;
1339 color.fRed = xc.red;
1340 color.fGreen = xc.green;
1341 color.fBlue = xc.blue;
1342 color.fMask = kDoRed | kDoGreen | kDoBlue;
1343 return kTRUE;
1344 }
1345 return kFALSE;
1346}
1347
1348////////////////////////////////////////////////////////////////////////////////
1349/// Find and allocate a color cell according to the color values specified
1350/// in the ColorStruct_t. If no cell could be allocated it returns kFALSE,
1351/// otherwise kTRUE.
1352
1354{
1355 RXColor xc;
1356
1357 MapColorStruct(&color, xc);
1358
1359 color.fPixel = 0;
1360 if (AllocColor((Colormap)cmap, &xc)) {
1361 color.fPixel = xc.pixel;
1362 return kTRUE;
1363 }
1364
1365 return kFALSE;
1366}
1367
1368////////////////////////////////////////////////////////////////////////////////
1369/// Fill in the primary color components for a specific pixel value.
1370/// On input fPixel should be set on return the fRed, fGreen and
1371/// fBlue components will be set.
1372
1374{
1375 XColor xc;
1376
1377 xc.pixel = color.fPixel;
1378
1379 // still very slight dark shift ??
1380 //QueryColors((Colormap)cmap, &xc, 1);
1381 //printf("1 xc.red = %u, xc.green = %u, xc.blue = %u\n", xc.red, xc.green, xc.blue);
1382 XQueryColor((Display*)fDisplay, (Colormap)cmap, &xc);
1383 //printf("2 xc.red = %u, xc.green = %u, xc.blue = %u\n", xc.red, xc.green, xc.blue);
1384
1385 color.fRed = xc.red;
1386 color.fGreen = xc.green;
1387 color.fBlue = xc.blue;
1388}
1389
1390////////////////////////////////////////////////////////////////////////////////
1391/// Free color cell with specified pixel value.
1392
1394{
1395 if (fRedDiv == -1)
1396 XFreeColors((Display*)fDisplay, (Colormap)cmap, &pixel, 1, 0);
1397}
1398
1399////////////////////////////////////////////////////////////////////////////////
1400/// Returns number of pending events.
1401
1403{
1404 if (!fDisplay) return 0;
1405 return XPending((Display*)fDisplay);
1406}
1407
1408////////////////////////////////////////////////////////////////////////////////
1409/// Copies first pending event from event queue to Event_t structure
1410/// and removes event from queue. Not all of the event fields are valid
1411/// for each event type, except fType and fWindow.
1412
1414{
1415 XNextEvent((Display*)fDisplay, (XEvent*)fXEvent);
1416
1417 // fill in Event_t
1419}
1420
1421////////////////////////////////////////////////////////////////////////////////
1422/// Map modifier key state to or from X.
1423
1425{
1426 if (tox) {
1427 xstate = 0;
1428 if ((state & kKeyShiftMask))
1429 xstate |= ShiftMask;
1430 if ((state & kKeyLockMask))
1431 xstate |= LockMask;
1432 if ((state & kKeyControlMask))
1433 xstate |= ControlMask;
1434 if ((state & kKeyMod1Mask))
1435 xstate |= Mod1Mask;
1436 if ((state & kKeyMod2Mask))
1437 xstate |= Mod2Mask;
1438 if ((state & kKeyMod3Mask))
1439 xstate |= Mod3Mask;
1440 if ((state & kKeyMod4Mask))
1441 xstate |= Mod4Mask;
1442 if ((state & kKeyMod5Mask))
1443 xstate |= Mod5Mask;
1444 if ((state & kButton1Mask))
1445 xstate |= Button1Mask;
1446 if ((state & kButton2Mask))
1447 xstate |= Button2Mask;
1448 if ((state & kButton3Mask))
1449 xstate |= Button3Mask;
1450 if ((state & kAnyModifier))
1451 xstate |= AnyModifier; // or should it be = instead of |= ?
1452 } else {
1453 state = 0;
1454 if ((xstate & ShiftMask))
1455 state |= kKeyShiftMask;
1456 if ((xstate & LockMask))
1457 state |= kKeyLockMask;
1458 if ((xstate & ControlMask))
1459 state |= kKeyControlMask;
1460 if ((xstate & Mod1Mask))
1461 state |= kKeyMod1Mask;
1462 if ((xstate & Mod2Mask))
1463 state |= kKeyMod2Mask;
1464 if ((xstate & Mod3Mask))
1465 state |= kKeyMod3Mask;
1466 if ((xstate & Mod4Mask))
1467 state |= kKeyMod4Mask;
1468 if ((xstate & Mod5Mask))
1469 state |= kKeyMod5Mask;
1470 if ((xstate & Button1Mask))
1471 state |= kButton1Mask;
1472 if ((xstate & Button2Mask))
1473 state |= kButton2Mask;
1474 if ((xstate & Button3Mask))
1475 state |= kButton3Mask;
1476 if ((xstate & AnyModifier))
1477 state |= kAnyModifier; // idem
1478 }
1479}
1480
1481////////////////////////////////////////////////////////////////////////////////
1482/// Map Event_t structure to XEvent structure. If tox is false
1483/// map the other way.
1484
1485void TGX11::MapEvent(Event_t &ev, void *xevi, Bool_t tox)
1486{
1487 XEvent &xev = *(XEvent *)xevi;
1488
1489 if (tox) {
1490 // map from Event_t to XEvent
1491 xev.type = 0;
1492 if (ev.fType == kGKeyPress) xev.type = KeyPress;
1493 if (ev.fType == kKeyRelease) xev.type = KeyRelease;
1494 if (ev.fType == kButtonPress) xev.type = ButtonPress;
1495 if (ev.fType == kButtonRelease) xev.type = ButtonRelease;
1496 if (ev.fType == kMotionNotify) xev.type = MotionNotify;
1497 if (ev.fType == kEnterNotify) xev.type = EnterNotify;
1498 if (ev.fType == kLeaveNotify) xev.type = LeaveNotify;
1499 if (ev.fType == kFocusIn) xev.type = FocusIn;
1500 if (ev.fType == kFocusOut) xev.type = FocusOut;
1501 if (ev.fType == kExpose) xev.type = Expose;
1502 if (ev.fType == kConfigureNotify) xev.type = ConfigureNotify;
1503 if (ev.fType == kMapNotify) xev.type = MapNotify;
1504 if (ev.fType == kUnmapNotify) xev.type = UnmapNotify;
1505 if (ev.fType == kDestroyNotify) xev.type = DestroyNotify;
1506 if (ev.fType == kClientMessage) xev.type = ClientMessage;
1507 if (ev.fType == kSelectionClear) xev.type = SelectionClear;
1508 if (ev.fType == kSelectionRequest) xev.type = SelectionRequest;
1509 if (ev.fType == kSelectionNotify) xev.type = SelectionNotify;
1510 if (ev.fType == kColormapNotify) xev.type = ColormapNotify;
1511
1512 xev.xany.window = (Window) ev.fWindow;
1513 xev.xany.send_event = (Bool) ev.fSendEvent;
1514 xev.xany.display = (Display*)fDisplay;
1515
1516 if (ev.fType == kGKeyPress || ev.fType == kKeyRelease) {
1517 xev.xkey.time = (Time) ev.fTime;
1518 xev.xkey.x = ev.fX;
1519 xev.xkey.y = ev.fY;
1520 xev.xkey.x_root = ev.fXRoot;
1521 xev.xkey.y_root = ev.fYRoot;
1522 MapModifierState(ev.fState, xev.xkey.state, kTRUE); // key mask
1523 xev.xkey.keycode = ev.fCode; // key code
1524 }
1525 if (ev.fType == kSelectionNotify) {
1526 xev.xselection.time = (Time) ev.fTime;
1527 xev.xselection.requestor = (Window) ev.fUser[0];
1528 xev.xselection.selection = (Atom) ev.fUser[1];
1529 xev.xselection.target = (Atom) ev.fUser[2];
1530 xev.xselection.property = (Atom) ev.fUser[3];
1531 }
1532 if (ev.fType == kClientMessage) {
1533 xev.xclient.message_type = ev.fHandle;
1534 xev.xclient.format = ev.fFormat;
1535 xev.xclient.data.l[0] = ev.fUser[0];
1536 if (sizeof(ev.fUser[0]) > 4) {
1537 SplitLong(ev.fUser[1], xev.xclient.data.l[1], xev.xclient.data.l[3]);
1538 SplitLong(ev.fUser[2], xev.xclient.data.l[2], xev.xclient.data.l[4]);
1539 } else {
1540 xev.xclient.data.l[1] = ev.fUser[1];
1541 xev.xclient.data.l[2] = ev.fUser[2];
1542 xev.xclient.data.l[3] = ev.fUser[3];
1543 xev.xclient.data.l[4] = ev.fUser[4];
1544 }
1545 }
1546 } else {
1547 // map from XEvent to Event_t
1548 ev.fType = kOtherEvent;
1549 if (xev.type == KeyPress) ev.fType = kGKeyPress;
1550 if (xev.type == KeyRelease) ev.fType = kKeyRelease;
1551 if (xev.type == ButtonPress) ev.fType = kButtonPress;
1552 if (xev.type == ButtonRelease) ev.fType = kButtonRelease;
1553 if (xev.type == MotionNotify) ev.fType = kMotionNotify;
1554 if (xev.type == EnterNotify) ev.fType = kEnterNotify;
1555 if (xev.type == LeaveNotify) ev.fType = kLeaveNotify;
1556 if (xev.type == FocusIn) ev.fType = kFocusIn;
1557 if (xev.type == FocusOut) ev.fType = kFocusOut;
1558 if (xev.type == Expose) ev.fType = kExpose;
1559 if (xev.type == GraphicsExpose) ev.fType = kExpose;
1560 if (xev.type == ConfigureNotify) ev.fType = kConfigureNotify;
1561 if (xev.type == MapNotify) ev.fType = kMapNotify;
1562 if (xev.type == UnmapNotify) ev.fType = kUnmapNotify;
1563 if (xev.type == DestroyNotify) ev.fType = kDestroyNotify;
1564 if (xev.type == ClientMessage) ev.fType = kClientMessage;
1565 if (xev.type == SelectionClear) ev.fType = kSelectionClear;
1566 if (xev.type == SelectionRequest) ev.fType = kSelectionRequest;
1567 if (xev.type == SelectionNotify) ev.fType = kSelectionNotify;
1568 if (xev.type == ColormapNotify) ev.fType = kColormapNotify;
1569
1570 ev.fWindow = (Window_t) xev.xany.window;
1571 ev.fSendEvent = xev.xany.send_event ? kTRUE : kFALSE;
1572
1573 if (ev.fType == kGKeyPress || ev.fType == kKeyRelease) {
1574 ev.fTime = (Time_t) xev.xkey.time;
1575 ev.fX = xev.xkey.x;
1576 ev.fY = xev.xkey.y;
1577 ev.fXRoot = xev.xkey.x_root;
1578 ev.fYRoot = xev.xkey.y_root;
1579 MapModifierState(ev.fState, xev.xkey.state, kFALSE); // key mask
1580 ev.fCode = xev.xkey.keycode; // key code
1581 ev.fUser[0] = xev.xkey.subwindow; // child window
1582 }
1583 if (ev.fType == kButtonPress || ev.fType == kButtonRelease) {
1584 ev.fTime = (Time_t) xev.xbutton.time;
1585 ev.fX = xev.xbutton.x;
1586 ev.fY = xev.xbutton.y;
1587 ev.fXRoot = xev.xbutton.x_root;
1588 ev.fYRoot = xev.xbutton.y_root;
1589 MapModifierState(ev.fState, xev.xbutton.state, kFALSE); // button mask
1590 ev.fCode = xev.xbutton.button; // button code
1591 ev.fUser[0] = xev.xbutton.subwindow; // child window
1592 }
1593 if (ev.fType == kMotionNotify) {
1594 ev.fTime = (Time_t) xev.xmotion.time;
1595 ev.fX = xev.xmotion.x;
1596 ev.fY = xev.xmotion.y;
1597 ev.fXRoot = xev.xmotion.x_root;
1598 ev.fYRoot = xev.xmotion.y_root;
1599 MapModifierState(ev.fState, xev.xmotion.state, kFALSE); // key or button mask
1600 ev.fUser[0] = xev.xmotion.subwindow; // child window
1601 }
1602 if (ev.fType == kEnterNotify || ev.fType == kLeaveNotify) {
1603 ev.fTime = (Time_t) xev.xcrossing.time;
1604 ev.fX = xev.xcrossing.x;
1605 ev.fY = xev.xcrossing.y;
1606 ev.fXRoot = xev.xcrossing.x_root;
1607 ev.fYRoot = xev.xcrossing.y_root;
1608 ev.fCode = xev.xcrossing.mode; // NotifyNormal, NotifyGrab, NotifyUngrab
1609 MapModifierState(ev.fState, xev.xcrossing.state, kFALSE); // key or button mask
1610 }
1611 if (ev.fType == kFocusIn || ev.fType == kFocusOut) {
1612 // check this when porting to Win32 (see also TGTextEntry::HandleFocusChange)
1613 ev.fCode = xev.xfocus.mode; // NotifyNormal, NotifyGrab, NotifyUngrab
1614 ev.fState = xev.xfocus.detail; // NotifyPointer et al.
1615 }
1616 if (ev.fType == kExpose) {
1617 ev.fX = xev.xexpose.x;
1618 ev.fY = xev.xexpose.y;
1619 ev.fWidth = xev.xexpose.width; // width and
1620 ev.fHeight = xev.xexpose.height; // height of exposed area
1621 ev.fCount = xev.xexpose.count; // number of expose events still to come
1622 }
1623 if (ev.fType == kConfigureNotify) {
1624 ev.fX = xev.xconfigure.x;
1625 ev.fY = xev.xconfigure.y;
1626 ev.fWidth = xev.xconfigure.width;
1627 ev.fHeight = xev.xconfigure.height;
1628 }
1629 if (ev.fType == kMapNotify || ev.fType == kUnmapNotify) {
1630 ev.fHandle = xev.xmap.window; // window to be (un)mapped
1631 }
1632 if (ev.fType == kDestroyNotify) {
1633 ev.fHandle = xev.xdestroywindow.window; // window to be destroyed
1634 }
1635 if (ev.fType == kClientMessage) {
1636 ev.fHandle = xev.xclient.message_type;
1637 ev.fFormat = xev.xclient.format;
1638 ev.fUser[0] = xev.xclient.data.l[0];
1639 if (sizeof(ev.fUser[0]) > 4) {
1640 AsmLong(xev.xclient.data.l[1], xev.xclient.data.l[3], ev.fUser[1]);
1641 AsmLong(xev.xclient.data.l[2], xev.xclient.data.l[4], ev.fUser[2]);
1642 } else {
1643 ev.fUser[1] = xev.xclient.data.l[1];
1644 ev.fUser[2] = xev.xclient.data.l[2];
1645 ev.fUser[3] = xev.xclient.data.l[3];
1646 ev.fUser[4] = xev.xclient.data.l[4];
1647 }
1648 }
1649 if (ev.fType == kSelectionClear) {
1650 ev.fUser[0] = xev.xselectionclear.selection;
1651 }
1652 if (ev.fType == kSelectionRequest) {
1653 ev.fTime = (Time_t) xev.xselectionrequest.time;
1654 ev.fUser[0] = xev.xselectionrequest.requestor;
1655 ev.fUser[1] = xev.xselectionrequest.selection;
1656 ev.fUser[2] = xev.xselectionrequest.target;
1657 ev.fUser[3] = xev.xselectionrequest.property;
1658 }
1659 if (ev.fType == kSelectionNotify) {
1660 ev.fTime = (Time_t) xev.xselection.time;
1661 ev.fUser[0] = xev.xselection.requestor;
1662 ev.fUser[1] = xev.xselection.selection;
1663 ev.fUser[2] = xev.xselection.target;
1664 ev.fUser[3] = xev.xselection.property;
1665 }
1666 if (ev.fType == kColormapNotify) {
1667 ev.fHandle = xev.xcolormap.colormap;
1668 ev.fCode = xev.xcolormap.state; // ColormapUninstalled, ColormapInstalled
1669 ev.fState = xev.xcolormap.c_new; // true if new colormap
1670 }
1671 }
1672}
1673
1674////////////////////////////////////////////////////////////////////////////////
1675/// Sound bell. Percent is loudness from -100% .. 100%.
1676
1678{
1679 XBell((Display*)fDisplay, percent);
1680}
1681
1682////////////////////////////////////////////////////////////////////////////////
1683/// Copy a drawable (i.e. pixmap) to another drawable (pixmap, window).
1684/// The graphics context gc will be used and the source will be copied
1685/// from src_x,src_y,src_x+width,src_y+height to dest_x,dest_y.
1686
1690{
1691 if (!src || !dest) return;
1692
1693 XCopyArea((Display*)fDisplay, src, dest, (GC) gc, src_x, src_y, width, height,
1694 dest_x, dest_y);
1695}
1696
1697////////////////////////////////////////////////////////////////////////////////
1698/// Change window attributes.
1699
1701{
1702 if (!id) return;
1703
1705 ULong_t xmask = 0;
1706
1707 if (attr)
1708 MapSetWindowAttributes(attr, xmask, xattr);
1709
1710 XChangeWindowAttributes((Display*)fDisplay, (Window) id, xmask, &xattr);
1711
1712 if (attr && (attr->fMask & kWABorderWidth))
1713 XSetWindowBorderWidth((Display*)fDisplay, (Window) id, attr->fBorderWidth);
1714}
1715
1716////////////////////////////////////////////////////////////////////////////////
1717/// This function alters the property for the specified window and
1718/// causes the X server to generate a PropertyNotify event on that
1719/// window.
1720
1723{
1724 if (!id) return;
1725
1726 XChangeProperty((Display*)fDisplay, (Window) id, (Atom) property, (Atom) type,
1727 8, PropModeReplace, data, len);
1728}
1729
1730////////////////////////////////////////////////////////////////////////////////
1731/// Draw a line.
1732
1734{
1735 if (!id) return;
1736
1737 XDrawLine((Display*)fDisplay, (Drawable) id, (GC) gc, x1, y1, x2, y2);
1738}
1739
1740////////////////////////////////////////////////////////////////////////////////
1741/// Clear a window area to the background color.
1742
1744{
1745 if (!id) return;
1746
1747 XClearArea((Display*)fDisplay, (Window) id, x, y, w, h, False);
1748}
1749
1750////////////////////////////////////////////////////////////////////////////////
1751/// Check if there is for window "id" an event of type "type". If there
1752/// is fill in the event structure and return true. If no such event
1753/// return false.
1754
1756{
1757 if (!id) return kFALSE;
1758
1759 Event_t tev;
1760 XEvent xev;
1761
1762 tev.fCode = 0;
1763 tev.fState = 0;
1764 tev.fWindow = 0;
1765 tev.fUser[0] = tev.fUser[1] = tev.fUser[2] = tev.fUser[3] = tev.fUser[4] = 0;
1766 tev.fCount = 0;
1767 tev.fFormat = 0;
1768 tev.fHandle = 0;
1769 tev.fSendEvent = 0;
1770 tev.fTime = 0;
1771 tev.fX = tev.fY = 0;
1772 tev.fXRoot = tev.fYRoot = 0;
1773 tev.fType = type;
1774 MapEvent(tev, &xev);
1775
1776 Bool r = XCheckTypedWindowEvent((Display*)fDisplay, (Window) id, xev.type, &xev);
1777
1778 if (r) MapEvent(ev, &xev, kFALSE);
1779
1780 return r ? kTRUE : kFALSE;
1781}
1782
1783////////////////////////////////////////////////////////////////////////////////
1784/// Send event ev to window id.
1785
1787{
1788 if (!ev || !id) return;
1789
1790 XEvent xev;
1791
1792 MapEvent(*ev, &xev);
1793
1794 XSendEvent((Display*)fDisplay, (Window) id, False, None, &xev);
1795}
1796
1797////////////////////////////////////////////////////////////////////////////////
1798/// Tell WM to send message when window is closed via WM.
1799
1801{
1802 if (!id) return;
1803
1804 XSetWMProtocols((Display*)fDisplay, (Window) id, &gWM_DELETE_WINDOW, 1);
1805}
1806
1807////////////////////////////////////////////////////////////////////////////////
1808/// Turn key auto repeat on or off.
1809
1811{
1812 if (!fDisplay)
1813 return;
1814
1815 if (on)
1816 XAutoRepeatOn((Display*)fDisplay);
1817 else
1818 XAutoRepeatOff((Display*)fDisplay);
1819}
1820
1821////////////////////////////////////////////////////////////////////////////////
1822/// Establish passive grab on a certain key. That is, when a certain key
1823/// keycode is hit while certain modifier's (Shift, Control, Meta, Alt)
1824/// are active then the keyboard will be grabbed for window id.
1825/// When grab is false, ungrab the keyboard for this key and modifier.
1826
1828{
1829// if (!id) return;
1830
1831 UInt_t xmod;
1832
1834
1835 if (grab)
1836 XGrabKey((Display*)fDisplay, keycode, xmod, (Window) id, True,
1837 GrabModeAsync, GrabModeAsync);
1838 else
1839 XUngrabKey((Display*)fDisplay, keycode, xmod, (Window) id);
1840}
1841
1842////////////////////////////////////////////////////////////////////////////////
1843/// Establish passive grab on a certain mouse button. That is, when a
1844/// certain mouse button is hit while certain modifier's (Shift, Control,
1845/// Meta, Alt) are active then the mouse will be grabbed for window id.
1846/// When grab is false, ungrab the mouse button for this button and modifier.
1847
1850 Bool_t grab)
1851{
1852 if (!id) return;
1853
1854 UInt_t xmod;
1855
1857
1858 if (grab) {
1859 UInt_t xevmask;
1860 MapEventMask(evmask, xevmask);
1861
1862 XGrabButton((Display*)fDisplay, button, xmod, (Window) id, True, xevmask,
1863 GrabModeAsync, GrabModeAsync, (Window) confine,
1864 (Cursor) cursor);
1865 } else
1866 XUngrabButton((Display*)fDisplay, button, xmod, (Window) id);
1867}
1868
1869////////////////////////////////////////////////////////////////////////////////
1870/// Establish an active pointer grab. While an active pointer grab is in
1871/// effect, further pointer events are only reported to the grabbing
1872/// client window.
1873
1875 Cursor_t cursor, Bool_t grab, Bool_t owner_events)
1876{
1877// if (!id) return;
1878
1879 if (grab) {
1880 UInt_t xevmask;
1881 MapEventMask(evmask, xevmask);
1882
1883 XGrabPointer((Display*)fDisplay, (Window) id, (Bool) owner_events,
1884 xevmask, GrabModeAsync, GrabModeAsync, (Window) confine,
1885 (Cursor) cursor, CurrentTime);
1886 } else
1887 XUngrabPointer((Display*)fDisplay, CurrentTime);
1888}
1889
1890////////////////////////////////////////////////////////////////////////////////
1891/// Set window name.
1892
1894{
1895 if (!id) return;
1896
1897 XTextProperty wname;
1898
1899 if (XStringListToTextProperty(&name, 1, &wname) == 0) {
1900 Error("SetWindowName", "cannot allocate window name \"%s\"", name);
1901 return;
1902 }
1903 XSetWMName((Display*)fDisplay, (Window) id, &wname);
1904 XFree(wname.value);
1905}
1906
1907////////////////////////////////////////////////////////////////////////////////
1908/// Set window icon name.
1909
1911{
1912 if (!id) return;
1913
1914 XTextProperty wname;
1915
1916 if (XStringListToTextProperty(&name, 1, &wname) == 0) {
1917 Error("SetIconName", "cannot allocate icon name \"%s\"", name);
1918 return;
1919 }
1920 XSetWMIconName((Display*)fDisplay, (Window) id, &wname);
1921 XFree(wname.value);
1922}
1923
1924////////////////////////////////////////////////////////////////////////////////
1925/// Set pixmap the WM can use when the window is iconized.
1926
1928{
1929 if (!id) return;
1930
1931 XWMHints hints;
1932
1933 hints.flags = IconPixmapHint;
1934 hints.icon_pixmap = (Pixmap) pic;
1935
1936 XSetWMHints((Display*)fDisplay, (Window) id, &hints);
1937}
1938
1939////////////////////////////////////////////////////////////////////////////////
1940/// Set the windows class and resource name.
1941
1942void TGX11::SetClassHints(Window_t id, char *className, char *resourceName)
1943{
1944 if (!id) return;
1945
1946 XClassHint class_hints;
1947
1948 class_hints.res_class = className;
1949 class_hints.res_name = resourceName;
1950 XSetClassHint((Display*)fDisplay, (Window) id, &class_hints);
1951}
1952
1953////////////////////////////////////////////////////////////////////////////////
1954/// Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
1955
1957{
1958 if (!id) return;
1959
1960 MWMHintsProperty_t prop;
1961
1962 prop.fDecorations = value;
1963 prop.fFunctions = funcs;
1964 prop.fInputMode = input;
1966
1967 XChangeProperty((Display*)fDisplay, (Window) id, gMOTIF_WM_HINTS, gMOTIF_WM_HINTS, 32,
1968 PropModeReplace, (UChar_t *)&prop, kPropMWMHintElements);
1969}
1970
1971////////////////////////////////////////////////////////////////////////////////
1972/// Tell the window manager the desired window position.
1973
1975{
1976 if (!id) return;
1977
1978 XSizeHints hints;
1979
1980 hints.flags = USPosition | PPosition;
1981 hints.x = x;
1982 hints.y = y;
1983
1984 XSetWMNormalHints((Display*)fDisplay, (Window) id, &hints);
1985}
1986
1987////////////////////////////////////////////////////////////////////////////////
1988/// Tell the window manager the desired window size.
1989
1991{
1992 if (!id) return;
1993
1994 XSizeHints hints;
1995
1996 hints.flags = USSize | PSize | PBaseSize;
1997 hints.width = hints.base_width = w;
1998 hints.height = hints.base_height = h;
1999
2000 XSetWMNormalHints((Display*)fDisplay, (Window) id, &hints);
2001}
2002
2003////////////////////////////////////////////////////////////////////////////////
2004/// Give the window manager minimum and maximum size hints. Also
2005/// specify via winc and hinc the resize increments.
2006
2010{
2011 if (!id) return;
2012
2013 XSizeHints hints;
2014
2015 hints.flags = PMinSize | PMaxSize | PResizeInc;
2016 hints.min_width = (Int_t)wmin;
2017 hints.max_width = (Int_t)wmax;
2018 hints.min_height = (Int_t)hmin;
2019 hints.max_height = (Int_t)hmax;
2020 hints.width_inc = (Int_t)winc;
2021 hints.height_inc = (Int_t)hinc;
2022
2023 XSetWMNormalHints((Display*)fDisplay, (Window) id, &hints);
2024}
2025
2026////////////////////////////////////////////////////////////////////////////////
2027/// Set the initial state of the window. Either kNormalState or kIconicState.
2028
2030{
2031 if (!id) return;
2032
2033 XWMHints hints;
2034 Int_t xstate = NormalState;
2035
2036 if (state == kNormalState)
2037 xstate = NormalState;
2038 if (state == kIconicState)
2039 xstate = IconicState;
2040
2041 hints.flags = StateHint;
2042 hints.initial_state = xstate;
2043
2044 XSetWMHints((Display*)fDisplay, (Window) id, &hints);
2045}
2046
2047////////////////////////////////////////////////////////////////////////////////
2048/// Tell window manager that window is a transient window of main.
2049
2051{
2052 if (!id) return;
2053
2054 XSetTransientForHint((Display*)fDisplay, (Window) id, (Window) main_id);
2055}
2056
2057////////////////////////////////////////////////////////////////////////////////
2058/// Draw a string using a specific graphics context in position (x,y).
2059
2061 const char *s, Int_t len)
2062{
2063 if (!id) return;
2064
2065 XDrawString((Display*)fDisplay, (Drawable) id, (GC) gc, x, y, (char *) s, len);
2066}
2067
2068////////////////////////////////////////////////////////////////////////////////
2069/// Return length of string in pixels. Size depends on font.
2070
2072{
2073 return XTextWidth((XFontStruct*) font, (char*) s, len);
2074}
2075
2076////////////////////////////////////////////////////////////////////////////////
2077/// Return some font properties.
2078
2079void TGX11::GetFontProperties(FontStruct_t font, Int_t &max_ascent, Int_t &max_descent)
2080{
2081 XFontStruct *f = (XFontStruct *) font;
2082
2083 max_ascent = f->max_bounds.ascent;
2084 max_descent = f->max_bounds.descent;
2085}
2086
2087////////////////////////////////////////////////////////////////////////////////
2088/// Get current values from graphics context gc. Which values of the
2089/// context to get is encoded in the GCValues::fMask member. If fMask = 0
2090/// then copy all fields.
2091
2093{
2094 RXGCValues xgval;
2095 ULong_t xmask;
2096
2097 if (!gval.fMask) {
2098 // in this case copy all fields
2099 gval.fMask = kMaxUInt;
2100 }
2101
2102 MapGCValues(gval, xmask, xgval);
2103
2104 XGetGCValues((Display*)fDisplay, (GC) gc, xmask, &xgval);
2105
2106 MapGCValues(gval, xmask, xgval, kFALSE);
2107}
2108
2109////////////////////////////////////////////////////////////////////////////////
2110/// Retrieve associated font structure once we have the font handle.
2111/// Free returned FontStruct_t using FreeFontStruct().
2112
2114{
2115 XFontStruct *fs;
2116
2117 fs = XQueryFont((Display*)fDisplay, (Font) fh);
2118
2119 return (FontStruct_t) fs;
2120}
2121
2122////////////////////////////////////////////////////////////////////////////////
2123/// Free font structure returned by GetFontStruct().
2124
2126{
2127 // in XFree86 4.0 XFreeFontInfo() is broken, ok again in 4.0.1
2128 static int xfree86_400 = -1;
2129 if (xfree86_400 == -1) {
2130 if (strstr(XServerVendor((Display*)fDisplay), "XFree86") &&
2131 XVendorRelease((Display*)fDisplay) == 4000)
2132 xfree86_400 = 1;
2133 else
2134 xfree86_400 = 0;
2135 }
2136
2137 if (xfree86_400 == 0)
2138 XFreeFontInfo(nullptr, (XFontStruct *) fs, 1);
2139}
2140
2141////////////////////////////////////////////////////////////////////////////////
2142/// Clear window.
2143
2145{
2146 if (!id) return;
2147
2148 XClearWindow((Display*)fDisplay, (Window) id);
2149}
2150
2151////////////////////////////////////////////////////////////////////////////////
2152/// Convert a keysym to the appropriate keycode. For example keysym is
2153/// a letter and keycode is the matching keyboard key (which is dependent
2154/// on the current keyboard mapping).
2155
2157{
2158 UInt_t xkeysym;
2159 MapKeySym(keysym, xkeysym);
2160
2161 return XKeysymToKeycode((Display*)fDisplay, xkeysym);
2162}
2163
2164////////////////////////////////////////////////////////////////////////////////
2165/// Draw a filled rectangle. Filling is done according to the gc.
2166
2168{
2169 if (!id) return;
2170
2171 XFillRectangle((Display*)fDisplay, (Drawable) id, (GC) gc, x, y, w, h);
2172}
2173
2174////////////////////////////////////////////////////////////////////////////////
2175/// Draw a rectangle outline.
2176
2178{
2179 if (!id) return;
2180
2181 XDrawRectangle((Display*)fDisplay, (Drawable) id, (GC) gc, x, y, w, h);
2182}
2183
2184////////////////////////////////////////////////////////////////////////////////
2185/// Draws multiple line segments. Each line is specified by a pair of points.
2186
2188{
2189 if (!id) return;
2190
2191 XDrawSegments((Display*)fDisplay, (Drawable) id, (GC) gc, (XSegment *) seg, nseg);
2192}
2193
2194////////////////////////////////////////////////////////////////////////////////
2195/// Defines which input events the window is interested in. By default
2196/// events are propagated up the window stack. This mask can also be
2197/// set at window creation time via the SetWindowAttributes_t::fEventMask
2198/// attribute.
2199
2201{
2202 if (!id) return;
2203
2204 UInt_t xevmask;
2205
2206 MapEventMask(evmask, xevmask);
2207
2208 XSelectInput((Display*)fDisplay, (Window) id, xevmask);
2209}
2210
2211////////////////////////////////////////////////////////////////////////////////
2212/// Returns the window id of the window having the input focus.
2213
2215{
2216 Window focus;
2217 int return_to;
2218
2219 XGetInputFocus((Display*)fDisplay, &focus, &return_to);
2220 return (Window_t) focus;
2221}
2222
2223////////////////////////////////////////////////////////////////////////////////
2224/// Set keyboard input focus to window id.
2225
2227{
2228 if (!id) return;
2229
2230 XWindowAttributes xattr;
2231
2232 XGetWindowAttributes((Display*)fDisplay, (Window) id, &xattr);
2233
2234 if (xattr.map_state == IsViewable)
2235 XSetInputFocus((Display*)fDisplay, (Window) id, RevertToParent, CurrentTime);
2236}
2237
2238////////////////////////////////////////////////////////////////////////////////
2239/// Returns the window id of the current owner of the primary selection.
2240/// That is the window in which, for example some text is selected.
2241
2243{
2244 return (Window_t) XGetSelectionOwner((Display*)fDisplay, XA_PRIMARY);
2245}
2246
2247////////////////////////////////////////////////////////////////////////////////
2248/// Makes the window id the current owner of the primary selection.
2249/// That is the window in which, for example some text is selected.
2250
2252{
2253 if (!id) return;
2254
2255 XSetSelectionOwner((Display*)fDisplay, XA_PRIMARY, id, CurrentTime);
2256}
2257
2258////////////////////////////////////////////////////////////////////////////////
2259/// XConvertSelection() causes a SelectionRequest event to be sent to the
2260/// current primary selection owner. This event specifies the selection
2261/// property (primary selection), the format into which to convert that
2262/// data before storing it (target = XA_STRING), the property in which
2263/// the owner will place the information (sel_property), the window that
2264/// wants the information (id), and the time of the conversion request
2265/// (when).
2266/// The selection owner responds by sending a SelectionNotify event, which
2267/// confirms the selected atom and type.
2268
2270{
2271 if (!id) return;
2272
2273 XConvertSelection((Display*)fDisplay, XA_PRIMARY, XA_STRING, (Atom) clipboard,
2274 (Window) id, (Time) when);
2275}
2276
2277////////////////////////////////////////////////////////////////////////////////
2278/// Convert the keycode from the event structure to a key symbol (according
2279/// to the modifiers specified in the event structure and the current
2280/// keyboard mapping). In buf a null terminated ASCII string is returned
2281/// representing the string that is currently mapped to the key code.
2282
2283void TGX11::LookupString(Event_t *event, char *buf, Int_t buflen, UInt_t &keysym)
2284{
2285 XEvent xev;
2286 KeySym xkeysym;
2287
2288 MapEvent(*event, &xev);
2289
2290 int n = XLookupString(&xev.xkey, buf, buflen-1, &xkeysym, nullptr);
2291 if (n >= buflen)
2292 Error("LookupString", "buf too small, must be at least %d", n+1);
2293 else
2294 buf[n] = 0;
2295
2296 UInt_t ks, xks = (UInt_t) xkeysym;
2297 MapKeySym(ks, xks, kFALSE);
2298 keysym = (Int_t) ks;
2299}
2300
2301////////////////////////////////////////////////////////////////////////////////
2302/// Map to and from X key symbols. Keysym are the values returned by
2303/// XLookUpString.
2304
2305void TGX11::MapKeySym(UInt_t &keysym, UInt_t &xkeysym, Bool_t tox)
2306{
2307 if (tox) {
2308 xkeysym = XK_VoidSymbol;
2309 if (keysym < 127) {
2310 xkeysym = keysym;
2311 } else if (keysym >= kKey_F1 && keysym <= kKey_F35) {
2312 xkeysym = XK_F1 + (keysym - (UInt_t)kKey_F1); // function keys
2313 } else {
2314 for (int i = 0; gKeyMap[i].fKeySym; i++) { // any other keys
2315 if (keysym == (UInt_t) gKeyMap[i].fKeySym) {
2316 xkeysym = (UInt_t) gKeyMap[i].fXKeySym;
2317 break;
2318 }
2319 }
2320 }
2321 } else {
2322 keysym = kKey_Unknown;
2323 // commentary in X11/keysymdef says that X codes match ASCII
2324 if (xkeysym < 127) {
2325 keysym = xkeysym;
2326 } else if (xkeysym >= XK_F1 && xkeysym <= XK_F35) {
2327 keysym = kKey_F1 + (xkeysym - XK_F1); // function keys
2328 } else if (xkeysym >= XK_KP_0 && xkeysym <= XK_KP_9) {
2329 keysym = kKey_0 + (xkeysym - XK_KP_0); // numeric keypad keys
2330 } else {
2331 for (int i = 0; gKeyMap[i].fXKeySym; i++) { // any other keys
2332 if (xkeysym == gKeyMap[i].fXKeySym) {
2333 keysym = (UInt_t) gKeyMap[i].fKeySym;
2334 break;
2335 }
2336 }
2337 }
2338 }
2339}
2340
2341////////////////////////////////////////////////////////////////////////////////
2342/// Get contents of paste buffer atom into string. If del is true delete
2343/// the paste buffer afterwards.
2344
2346 Bool_t del)
2347{
2348 if (!id) return;
2349
2350 Atom actual_type, property = (Atom) atom;
2351 int actual_format;
2352 ULong_t nitems, bytes_after, nread;
2353 unsigned char *data;
2354
2355 nchar = 0;
2356 text = "";
2357
2358 if (property == None) return;
2359
2360 // get past buffer
2361 nread = 0;
2362 do {
2363 if (XGetWindowProperty((Display*)fDisplay, (Window) id, property,
2364 nread/4, 1024, (Bool)del,
2365 AnyPropertyType,
2366 &actual_type, &actual_format,
2367 &nitems, &bytes_after,
2368 (unsigned char **) &data)
2369 != Success)
2370 break;
2371
2372 if (actual_type != XA_STRING) break;
2373
2374 text.Insert((Int_t) nread, (const char *) data, (Int_t) nitems);
2375 nread += nitems;
2376 XFree(data);
2377
2378 } while (bytes_after > 0);
2379
2380 nchar = (Int_t) nread;
2381}
2382
2383////////////////////////////////////////////////////////////////////////////////
2384/// TranslateCoordinates translates coordinates from the frame of
2385/// reference of one window to another. If the point is contained
2386/// in a mapped child of the destination, the id of that child is
2387/// returned as well.
2388
2391{
2392 if (!src || !dest) return;
2393
2394 Window xchild;
2395
2396 XTranslateCoordinates((Display*)fDisplay, (Window) src, (Window) dest, src_x,
2397 src_y, &dest_x, &dest_y, &xchild);
2398 child = (Window_t) xchild;
2399}
2400
2401////////////////////////////////////////////////////////////////////////////////
2402/// Return geometry of window (should be called GetGeometry but signature
2403/// already used).
2404
2406{
2407 if (!id) return;
2408
2409 Window wdummy;
2410 UInt_t bdum, ddum;
2411
2412 XGetGeometry((Display*)fDisplay, (Drawable) id, &wdummy, &x, &y, &w, &h, &bdum, &ddum);
2413}
2414
2415////////////////////////////////////////////////////////////////////////////////
2416/// FillPolygon fills the region closed by the specified path.
2417/// The path is closed automatically if the last point in the list does
2418/// not coincide with the first point. All point coordinates are
2419/// treated as relative to the origin. For every pair of points
2420/// inside the polygon, the line segment connecting them does not
2421/// intersect the path.
2422
2424{
2425 if (!id) return;
2426
2427 XFillPolygon((Display*)fDisplay, (Window) id, (GC) gc, (XPoint *) points, npnt,
2428 Convex, CoordModeOrigin);
2429}
2430
2431////////////////////////////////////////////////////////////////////////////////
2432/// Returns the root window the pointer is logically on and the pointer
2433/// coordinates relative to the root window's origin.
2434/// The pointer coordinates returned to win_x and win_y are relative to
2435/// the origin of the specified window. In this case, QueryPointer returns
2436/// the child that contains the pointer, if any, or else kNone to
2437/// childw. QueryPointer returns the current logical state of the
2438/// keyboard buttons and the modifier keys in mask.
2439
2441 Int_t &root_x, Int_t &root_y, Int_t &win_x,
2442 Int_t &win_y, UInt_t &mask)
2443{
2444 if (!id) return;
2445
2446 Window xrootw, xchildw;
2447 UInt_t xmask;
2448
2449 XQueryPointer((Display*)fDisplay, (Window) id, &xrootw, &xchildw,
2450 &root_x, &root_y, &win_x, &win_y, &xmask);
2451
2452 rootw = (Window_t) xrootw;
2453 childw = (Window_t) xchildw;
2454
2455 MapModifierState(mask, xmask, kFALSE);
2456}
2457
2458////////////////////////////////////////////////////////////////////////////////
2459/// Set foreground color in graphics context (shortcut for ChangeGC with
2460/// only foreground mask set).
2461
2463{
2464 XSetForeground((Display*)fDisplay, (GC) gc, foreground);
2465}
2466
2467////////////////////////////////////////////////////////////////////////////////
2468/// Set clipping rectangles in graphics context. X, Y specify the origin
2469/// of the rectangles. Recs specifies an array of rectangles that define
2470/// the clipping mask and n is the number of rectangles.
2471
2473{
2474 XSetClipRectangles((Display*)fDisplay, (GC) gc, x, y, (XRectangle *) recs, n, Unsorted);
2475}
2476
2477////////////////////////////////////////////////////////////////////////////////
2478/// Flush (mode = 0, default) or synchronize (mode = 1) X output buffer.
2479/// Flush flushes output buffer. Sync flushes buffer and waits till all
2480/// requests have been processed by X server.
2481
2483{
2484 if (mode == 0)
2485 XFlush((Display*)fDisplay);
2486 if (mode == 1)
2487 XSync((Display*)fDisplay, False);
2488}
2489
2490////////////////////////////////////////////////////////////////////////////////
2491/// Create a new empty region.
2492
2494{
2495 return (Region_t) XCreateRegion();
2496}
2497
2498////////////////////////////////////////////////////////////////////////////////
2499/// Destroy region.
2500
2502{
2503 XDestroyRegion((Region)reg);
2504}
2505
2506////////////////////////////////////////////////////////////////////////////////
2507/// Union of rectangle with a region.
2508
2510{
2511 XRectangle *r = (XRectangle *) rect; // 1 on 1 mapping
2512 XUnionRectWithRegion(r, (Region) src, (Region) dest);
2513}
2514
2515////////////////////////////////////////////////////////////////////////////////
2516/// Create region for the polygon defined by the points array.
2517/// If winding is true use WindingRule else EvenOddRule as fill rule.
2518
2520{
2521 XPoint *p = (XPoint *) points;
2522 return (Region_t) XPolygonRegion(p, np, winding ? WindingRule : EvenOddRule);
2523}
2524
2525////////////////////////////////////////////////////////////////////////////////
2526/// Compute the union of rega and regb and return result region.
2527/// The output region may be the same result region.
2528
2530{
2531 XUnionRegion((Region) rega, (Region) regb, (Region) result);
2532}
2533
2534////////////////////////////////////////////////////////////////////////////////
2535/// Compute the intersection of rega and regb and return result region.
2536/// The output region may be the same as the result region.
2537
2539{
2540 XIntersectRegion((Region) rega, (Region) regb, (Region) result);
2541}
2542
2543////////////////////////////////////////////////////////////////////////////////
2544/// Subtract rega from regb.
2545
2547{
2548 XSubtractRegion((Region) rega, (Region) regb, (Region) result);
2549}
2550
2551////////////////////////////////////////////////////////////////////////////////
2552/// Calculate the difference between the union and intersection of
2553/// two regions.
2554
2556{
2557 XXorRegion((Region) rega, (Region) regb, (Region) result);
2558}
2559
2560////////////////////////////////////////////////////////////////////////////////
2561/// Return true if the region is empty.
2562
2564{
2565 return (Bool_t) XEmptyRegion((Region) reg);
2566}
2567
2568////////////////////////////////////////////////////////////////////////////////
2569/// Returns true if the point x,y is in the region.
2570
2572{
2573 return (Bool_t) XPointInRegion((Region) reg, x, y);
2574}
2575
2576////////////////////////////////////////////////////////////////////////////////
2577/// Returns true if two regions are equal.
2578
2580{
2581 return (Bool_t) XEqualRegion((Region) rega, (Region) regb);
2582}
2583
2584////////////////////////////////////////////////////////////////////////////////
2585/// Return smallest enclosing rectangle.
2586
2588{
2589 XClipBox((Region) reg, (XRectangle*) rect);
2590}
2591
2592////////////////////////////////////////////////////////////////////////////////
2593/// Return list of font names matching fontname regexp, like "-*-times-*".
2594
2595char **TGX11::ListFonts(const char *fontname, Int_t max, Int_t &count)
2596{
2597 char **fontlist;
2598 Int_t fontcount = 0;
2599 fontlist = XListFonts((Display*)fDisplay, (char *)fontname, max, &fontcount);
2600 count = fontcount;
2601 return fontlist;
2602}
2603
2604////////////////////////////////////////////////////////////////////////////////
2605/// Free list of font names.
2606
2607void TGX11::FreeFontNames(char **fontlist)
2608{
2609 XFreeFontNames(fontlist);
2610}
2611
2612////////////////////////////////////////////////////////////////////////////////
2613/// Create a client-side XImage. Returns handle to XImage.
2614
2616{
2617 Int_t bitmap_pad;
2618
2619 if (fDepth <= 8)
2620 bitmap_pad = 8;
2621 else if (fDepth <= 16)
2622 bitmap_pad = 16;
2623 else
2624 bitmap_pad = 32;
2625
2626 XImage *xim = XCreateImage((Display*)fDisplay, fVisual, fDepth, ZPixmap,
2627 0, nullptr, width, height, bitmap_pad, 0);
2628
2629 // use calloc since Xlib will use free() in XDestroyImage
2630 if (xim) xim->data = (char *) calloc(xim->bytes_per_line * xim->height, 1);
2631
2632 return (Drawable_t) xim;
2633}
2634
2635////////////////////////////////////////////////////////////////////////////////
2636/// Get size of XImage img.
2637
2639{
2640 width = ((XImage*)img)->width;
2641 height = ((XImage*)img)->height;
2642}
2643
2644////////////////////////////////////////////////////////////////////////////////
2645/// Set pixel at specified location in XImage img.
2646
2648{
2649 XPutPixel((XImage*) img, x, y, pixel);
2650}
2651
2652////////////////////////////////////////////////////////////////////////////////
2653/// Put (x,y,w,h) part of image img in window win at position dx,dy.
2654
2656 Int_t dy, Int_t x, Int_t y, UInt_t w, UInt_t h)
2657{
2658 if (!win) return;
2659
2660 XPutImage((Display*)fDisplay, (Drawable) win, (GC) gc, (XImage*) img,
2661 x, y, dx, dy, w, h);
2662}
2663
2664////////////////////////////////////////////////////////////////////////////////
2665/// Destroy XImage img.
2666
2668{
2669 XDestroyImage((XImage*) img);
2670}
2671
2672////////////////////////////////////////////////////////////////////////////////
2673/// The Nonrectangular Window Shape Extension adds nonrectangular
2674/// windows to the System.
2675/// This allows for making shaped (partially transparent) windows
2676
2678{
2679 XShapeCombineMask((Display*)fDisplay, (Window) id, ShapeBounding, x, y,
2680 (Pixmap) mask, ShapeSet);
2681}
2682
2683////////////////////////////////////////////////////////////////////////////////
2684/// Returns the width of the screen in millimeters.
2685
2687{
2688 return (UInt_t)WidthMMOfScreen(DefaultScreenOfDisplay((Display*)fDisplay));
2689}
2690
2691////////////////////////////////////////////////////////////////////////////////
2692/// Deletes the specified property only if the property was defined on the
2693/// specified window and causes the X server to generate a PropertyNotify
2694/// event on the window unless the property does not exist.
2695
2697{
2698 XDeleteProperty((Display*)fDisplay, win, prop);
2699}
2700
2701////////////////////////////////////////////////////////////////////////////////
2702/// Returns the actual type of the property; the actual format of the property;
2703/// the number of 8-bit, 16-bit, or 32-bit items transferred; the number of
2704/// bytes remaining to be read in the property; and a pointer to the data
2705/// actually returned.
2706
2710 unsigned char **prop_list)
2711{
2712 return XGetWindowProperty((Display*)fDisplay, win, prop, offset, length, del, req_type,
2713 act_type, act_format, nitems, bytes, prop_list);
2714}
2715
2716////////////////////////////////////////////////////////////////////////////////
2717/// Changes the specified dynamic parameters if the pointer is actively
2718/// grabbed by the client.
2719
2721{
2722 UInt_t xevmask;
2723 MapEventMask(mask, xevmask);
2724 if (cur == kNone)
2725 XChangeActivePointerGrab((Display*)fDisplay, xevmask, fCursors[kHand], CurrentTime);
2726 else
2727 XChangeActivePointerGrab((Display*)fDisplay, xevmask, cur, CurrentTime);
2728}
2729
2730////////////////////////////////////////////////////////////////////////////////
2731/// Requests that the specified selection be converted to the specified
2732/// target type.
2733
2736{
2737 XConvertSelection((Display*)fDisplay, sel, target, prop, win, stamp);
2738}
2739
2740////////////////////////////////////////////////////////////////////////////////
2741/// Changes the owner and last-change time for the specified selection
2742
2744{
2745 return XSetSelectionOwner((Display*)fDisplay, sel, owner, CurrentTime);
2746}
2747
2748////////////////////////////////////////////////////////////////////////////////
2749/// This function alters the property for the specified window and
2750/// causes the X server to generate a PropertyNotify event on that
2751/// window.
2752
2755{
2756 if (!id) return;
2757
2758 XChangeProperty((Display*)fDisplay, (Window) id, (Atom) property, (Atom) type,
2759 format, PropModeReplace, data, len);
2760}
2761
2762////////////////////////////////////////////////////////////////////////////////
2763/// Add XdndAware property and the list of drag and drop types to the
2764/// Window win.
2765
2767{
2768 unsigned char version = 4;
2769 Atom_t dndaware = InternAtom("XdndAware", kFALSE);
2770 XChangeProperty((Display*)fDisplay, (Window) win, (Atom) dndaware, (Atom) XA_ATOM,
2771 32, PropModeReplace, (unsigned char *) &version, 1);
2772
2773 if (typelist) {
2774 int n;
2775
2776 for (n = 0; typelist[n]; n++) { }
2777 if (n > 0) {
2778 XChangeProperty((Display*)fDisplay, win, dndaware, XA_ATOM, 32, PropModeAppend,
2779 (unsigned char *) typelist, n);
2780 }
2781 }
2782}
2783
2784////////////////////////////////////////////////////////////////////////////////
2785/// Add the list of drag and drop types to the Window win.
2786
2788{
2789 if (typelist) {
2790 int n;
2791 for (n = 0; typelist[n]; n++) { }
2792 if (n > 0) {
2793 XChangeProperty((Display*)fDisplay, win, prop, XA_ATOM, 32, PropModeAppend,
2794 (unsigned char *) typelist, n);
2795 }
2796 }
2797}
2798
2799////////////////////////////////////////////////////////////////////////////////
2800/// Recursively search in the children of Window for a Window which is at
2801/// location x, y and is DND aware, with a maximum depth of maxd.
2802/// Possibility to exclude dragwin and input.
2803
2805 int x, int y, int maxd)
2806{
2807 WindowAttributes_t wattr;
2808 static Atom_t *dndTypeList = nullptr;
2809
2810 if (!dndTypeList) {
2811 dndTypeList = new Atom_t[3];
2812 dndTypeList[0] = InternAtom("application/root", kFALSE);
2813 dndTypeList[1] = InternAtom("text/uri-list", kFALSE);
2814 dndTypeList[2] = 0;
2815 }
2816
2817 if (maxd <= 0) return kNone;
2818
2819 if (win == dragwin || win == input) return kNone;
2820
2821 GetWindowAttributes(win, wattr);
2822 if (wattr.fMapState != kIsUnmapped &&
2823 x >= wattr.fX && x < wattr.fX + wattr.fWidth &&
2824 y >= wattr.fY && y < wattr.fY + wattr.fHeight) {
2825
2826 if (IsDNDAware(win, dndTypeList)) return win;
2827
2828 Window r, p, *children;
2829 UInt_t numch;
2830 int i;
2831
2832 if (XQueryTree((Display*)fDisplay, win, &r, &p, &children, &numch)) {
2833 if (children && numch > 0) {
2834 r = kNone;
2835 // upon return from XQueryTree, children are listed in the current
2836 // stacking order, from bottom-most (first) to top-most (last)
2837 for (i = numch-1; i >= 0; --i) {
2838 r = FindRWindow((Window_t)children[i], dragwin, input,
2839 x - wattr.fX, y - wattr.fY, maxd-1);
2840 if (r != kNone) break;
2841 }
2842 XFree(children);
2843 if (r != kNone) return r;
2844 }
2845 return kNone; //win; // ?!?
2846 }
2847 }
2848 return kNone;
2849}
2850
2851////////////////////////////////////////////////////////////////////////////////
2852/// Checks if Window win is DND aware, and knows any of the DND formats
2853/// passed in argument.
2854
2856{
2857 Atom_t actual;
2858 Int_t format;
2859 ULong_t count, remaining;
2860 unsigned char *data = nullptr;
2861 Atom_t *types, *t;
2862 Int_t result = kTRUE;
2863 static Atom_t dndaware = kNone;
2864
2865 if (win == kNone) return kFALSE;
2866
2867 if (dndaware == kNone)
2868 dndaware = InternAtom("XdndAware", kFALSE);
2869
2870 XGetWindowProperty((Display*)fDisplay, win, dndaware, 0, 0x8000000L, kFALSE,
2871 XA_ATOM, &actual, &format, &count, &remaining, &data);
2872
2873 if ((actual != XA_ATOM) || (format != 32) || (count == 0) || !data) {
2874 if (data) XFree(data);
2875 return kFALSE;
2876 }
2877
2878 types = (Atom_t *) data;
2879
2880 if ((count > 1) && typelist) {
2881 result = kFALSE;
2882 for (t = typelist; *t; t++) {
2883 for (ULong_t j = 1; j < count; j++) {
2884 if (types[j] == *t) {
2885 result = kTRUE;
2886 break;
2887 }
2888 }
2889 if (result) break;
2890 }
2891 }
2892 XFree(data);
2893 return result;
2894}
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:540
#define f(i)
Definition RSha256.hxx:104
#define a(i)
Definition RSha256.hxx:99
#define h(i)
Definition RSha256.hxx:106
@ None
Definition RooMinuit.h:6
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
unsigned char UChar_t
Definition RtypesCore.h:38
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
unsigned long ULong_t
Definition RtypesCore.h:55
#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:197
R__EXTERN void Throw(int code)
If an exception context has been set (using the TRY and RETRY macros) jump back to where it was set.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t stamp
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg InternAtom
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t GetWindowSize
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t regb
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t pict_mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest_x
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t cursor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t hmin
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void cmap
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t atom
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t act_type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t pict
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t del
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t GetWindowAttributes
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t hmax
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pixel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmin
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void clipboard
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t act_format
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t rect
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t recs
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h prop
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t child
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char cname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void curid
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void foreground
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char bitmap
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t nitems
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char forecolor
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h req_type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void funcs
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src_y
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t win
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest_y
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t winc
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t modifier
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t 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:405
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:2519
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:2167
void SetPrimarySelectionOwner(Window_t id) override
Makes the window id the current owner of the primary selection.
Definition GX11Gui.cxx:2251
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:1084
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:1956
void GetRegionBox(Region_t reg, Rectangle_t *) override
Return smallest enclosing rectangle.
Definition GX11Gui.cxx:2587
void FreeFontStruct(FontStruct_t fs) override
Free font structure returned by GetFontStruct().
Definition GX11Gui.cxx:2125
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:2707
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:2269
void MapEvent(Event_t &ev, void *xev, Bool_t tox=kTRUE)
Map Event_t structure to XEvent structure.
Definition GX11Gui.cxx:1485
void ChangeGC(GContext_t gc, GCValues_t *gval) override
Change entries in an existing graphics context, gc, by values from gval.
Definition GX11Gui.cxx:995
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:2743
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:1064
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:943
void SetWMPosition(Window_t id, Int_t x, Int_t y) override
Tell the window manager the desired window position.
Definition GX11Gui.cxx:1974
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:922
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:2405
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:2720
void SetInputFocus(Window_t id) override
Set keyboard input focus to window id.
Definition GX11Gui.cxx:2226
void SetWMState(Window_t id, EInitialState state) override
Set the initial state of the window. Either kNormalState or kIconicState.
Definition GX11Gui.cxx:2029
Bool_t ReadPictureDataFromFile(const char *filename, char ***ret_data) override
Read picture data from file and store in ret_data.
Definition GX11Gui.cxx:1280
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:1827
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:2766
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:2855
void SetIconPixmap(Window_t id, Pixmap_t pic) override
Set pixmap the WM can use when the window is iconized.
Definition GX11Gui.cxx:1927
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:2472
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:2667
Int_t KeysymToKeycode(UInt_t keysym) override
Convert a keysym to the appropriate keycode.
Definition GX11Gui.cxx:2156
Int_t GetScreen() const override
Returns screen number (might be useful in some cases where direct X11 manipulation outside of TVirtua...
Definition GX11Gui.cxx:883
Int_t GetDepth() const override
Returns depth of screen (number of bit planes).
Definition GX11Gui.cxx:892
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:2345
void SelectInput(Window_t id, UInt_t evmask) override
Defines which input events the window is interested in.
Definition GX11Gui.cxx:2200
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:2538
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:1185
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:863
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:2571
void MapKeySym(UInt_t &keysym, UInt_t &xkeysym, Bool_t tox=kTRUE)
Map to and from X key symbols.
Definition GX11Gui.cxx:2305
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:2647
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:973
Window_t GetDefaultRootWindow() const override
Return handle to the default root window created when calling XOpenDisplay().
Definition GX11Gui.cxx:914
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:873
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:1014
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:853
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:2595
UInt_t ScreenWidthMM() const override
Returns the width of the screen in millimeters.
Definition GX11Gui.cxx:2686
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:2050
Window_t GetPrimarySelectionOwner() override
Returns the window id of the current owner of the primary selection.
Definition GX11Gui.cxx:2242
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:1874
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:1893
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:1848
void SetDashes(GContext_t gc, Int_t offset, const char *dash_list, Int_t n) override
Specify a dash pattern.
Definition GX11Gui.cxx:1309
void FreeFontNames(char **fontlist) override
Free list of font names.
Definition GX11Gui.cxx:2607
void Bell(Int_t percent) override
Sound bell. Percent is loudness from -100% .. 100%.
Definition GX11Gui.cxx:1677
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:2007
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:1755
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:1393
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:2638
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:2734
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:2753
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:2787
void CloseDisplay() override
Close connection to display server.
Definition GX11Gui.cxx:842
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:2555
void DeleteGC(GContext_t gc) override
Explicitly delete a graphics context.
Definition GX11Gui.cxx:1034
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:2389
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:2563
void QueryColor(Colormap_t cmap, ColorStruct_t &color) override
Fill in the primary color components for a specific pixel value.
Definition GX11Gui.cxx:1373
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:2187
void GetGCValues(GContext_t gc, GCValues_t &gval) override
Get current values from graphics context gc.
Definition GX11Gui.cxx:2092
Cursor_t CreateCursor(ECursor cursor) override
Create cursor handle (just return cursor from cursor pool fCursors).
Definition GX11Gui.cxx:1045
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:2804
FontStruct_t GetFontStruct(FontH_t fh) override
Retrieve associated font structure once we have the font handle.
Definition GX11Gui.cxx:2113
void DeleteFont(FontStruct_t fs) override
Explicitly delete font structure obtained with LoadQueryFont().
Definition GX11Gui.cxx:964
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:902
Drawable_t CreateImage(UInt_t width, UInt_t height) override
Create a client-side XImage. Returns handle to XImage.
Definition GX11Gui.cxx:2615
void UnionRectWithRegion(Rectangle_t *rect, Region_t src, Region_t dest) override
Union of rectangle with a region.
Definition GX11Gui.cxx:2509
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:2071
void DestroyRegion(Region_t reg) override
Destroy region.
Definition GX11Gui.cxx:2501
void DeletePictureData(void *data) override
Delete picture data created by the function ReadPictureDataFromFile.
Definition GX11Gui.cxx:1294
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:2283
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:1413
void DeletePixmap(Pixmap_t pmap) override
Explicitly delete pixmap resource.
Definition GX11Gui.cxx:1094
FontH_t GetFontHandle(FontStruct_t fs) override
Return handle to font described by font structure.
Definition GX11Gui.cxx:952
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:1743
void MapPictureAttributes(PictureAttributes_t &attr, RXpmAttributes &xpmattr, Bool_t toxpm=kTRUE)
Map a PictureAttributes_t to a XpmAttributes structure.
Definition GX11Gui.cxx:1103
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:1910
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:2060
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:1238
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:2677
Window_t GetInputFocus() override
Returns the window id of the window having the input focus.
Definition GX11Gui.cxx:2214
void WMDeleteNotify(Window_t id) override
Tell WM to send message when window is closed via WM.
Definition GX11Gui.cxx:1800
Int_t EventsPending() override
Returns number of pending events.
Definition GX11Gui.cxx:1402
void SetClassHints(Window_t id, char *className, char *resourceName) override
Set the windows class and resource name.
Definition GX11Gui.cxx:1942
void SendEvent(Window_t id, Event_t *ev) override
Send event ev to window id.
Definition GX11Gui.cxx:1786
void SetWMSize(Window_t id, UInt_t w, UInt_t h) override
Tell the window manager the desired window size.
Definition GX11Gui.cxx:1990
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:1333
Bool_t EqualRegion(Region_t rega, Region_t regb) override
Returns true if two regions are equal.
Definition GX11Gui.cxx:2579
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:2493
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:1721
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:2177
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:2462
void SetKeyAutoRepeat(Bool_t on=kTRUE) override
Turn key auto repeat on or off.
Definition GX11Gui.cxx:1810
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:2696
void ChangeWindowAttributes(Window_t id, SetWindowAttributes_t *attr) override
Change window attributes.
Definition GX11Gui.cxx:1700
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:2423
void GetFontProperties(FontStruct_t font, Int_t &max_ascent, Int_t &max_descent) override
Return some font properties.
Definition GX11Gui.cxx:2079
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:1687
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:1424
void SubtractRegion(Region_t rega, Region_t regb, Region_t result) override
Subtract rega from regb.
Definition GX11Gui.cxx:2546
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:1317
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:2529
void Update(Int_t mode=0) override
Flush (mode = 0, default) or synchronize (mode = 1) X output buffer.
Definition GX11Gui.cxx:2482
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:956
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:970
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:2849
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:567
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 dest(otri, vertexptr)
Definition triangle.c:1041
#define org(otri, vertexptr)
Definition triangle.c:1038
#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