Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGWin32.cxx
Go to the documentation of this file.
1// @(#)root/win32gdk:$Id$
2// Author: Rene Brun, Olivier Couet, Fons Rademakers, Valeri Onuchin, Bertrand Bellenot 27/11/01
3
4/*************************************************************************
5 * Copyright (C) 1995-2001, 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/// \defgroup win32 Win32 backend
13/// \brief Interface to Windows graphics.
14/// \ingroup GraphicsBackends
15
16/** \class TGWin32
17\ingroup win32
18This class is the basic interface to the Win32 graphics system.
19It is an implementation of the abstract TVirtualX class.
20
21This code was initially developed in the context of HIGZ and PAW
22by Olivier Couet (package X11INT).
23*/
24
25#include <ft2build.h>
26#include FT_FREETYPE_H
27#include FT_GLYPH_H
28#include "TGWin32.h"
29#include <stdio.h>
30#include <string.h>
31#include <stdlib.h>
32#include <ctype.h>
33#include <limits.h>
34#include <process.h>
35#include <wchar.h>
36#include "gdk/gdkkeysyms.h"
37#include "xatom.h"
38#include <winuser.h>
39
40#include "TROOT.h"
41#include "TApplication.h"
42#include "TColor.h"
43#include "TPoint.h"
44#include "TMath.h"
45#include "TStorage.h"
46#include "TStyle.h"
47#include "TSystem.h"
48#include "TError.h"
49#include "TException.h"
50#include "TClassTable.h"
51#include "KeySymbols.h"
52#include "TWinNTSystem.h"
54#include "TWin32SplashThread.h"
55#include "TString.h"
56#include "TObjString.h"
57#include "TObjArray.h"
58#include "TExMap.h"
59#include "TEnv.h"
60#include "RStipples.h"
61#include "GuiTypes.h"
62
63#include "gifencode.h"
64#include "gifdecode.h"
65
66// DND protocol version
67#define XDND_PROTOCOL_VERSION 5
68#ifndef IDC_HAND
69#define IDC_HAND MAKEINTRESOURCE(32649)
70#endif
71
72#ifdef _WIN64
73#define MAKELONGLONG(lo, hi) ((LONGLONG)lo + ((LONGLONG)hi << 32))
74#else
75#define MAKELONGLONG(lo, hi) MAKELONG(lo, hi)
76#endif
77
78extern "C" {
80 GdkGC *gc,
81 gint filled,
82 gint x,
83 gint y,
84 gint width,
85 gint height);
87 GdkGC *gc,
88 gint filled,
89 gint x,
90 gint y,
91 gint width,
94 gint angle2);
96 GdkGC *gc,
97 gint filled,
101 GdkFont *font,
102 GdkGC *gc,
103 gint x,
104 gint y,
105 const gchar *text,
108 GdkGC *gc,
110 gint npoints);
112 GdkGC *gc,
114 gint nsegs);
116 GdkGC *gc,
118 gint npoints);
119
120};
121
124
125const int kMAXGC = 7,
126 kGCline = 0, kGCmark = 1, kGCfill = 2,
127 kGCtext = 3, kGCinvt = 4, kGCdash = 5, kGCpxmp = 6;
128
129
130//////////// internal classes & structures (very private) ////////////////
131
132struct XWindow_t {
133 Int_t open = 0; ///< 1 if the window is open, 0 if not
134 Int_t shared = 0; ///< 1 if Qt window
135 Int_t double_buffer = 0; ///< 1 if the double buffer is on, 0 if not
136 Int_t ispixmap = 0; ///< 1 if pixmap, 0 if not
137 GdkDrawable *drawing = nullptr;///< drawing area, equal to window or buffer
138 GdkDrawable *window = nullptr; ///< win32 window
139 GdkDrawable *buffer = nullptr; ///< pixmap used for double buffer
140 UInt_t width = 0; ///< width of the window
141 UInt_t height = 0; ///< height of the window
142 Int_t clip = 0; ///< 1 if the clipping is on
143 Int_t xclip = 0; ///< x coordinate of the clipping rectangle
144 Int_t yclip = 0; ///< y coordinate of the clipping rectangle
145 UInt_t wclip = 0; ///< width of the clipping rectangle
146 UInt_t hclip = 0; ///< height of the clipping rectangle
147 std::vector<ULong_t> new_colors; ///< new image colors for transparency (after processing)
148 GdkGC *fGClist[kMAXGC]; ///< array of GC objects for concrete window
150 TAttLine fAttLine = {-1, -1, -1}; ///< current line attributes
151 GdkLineStyle lineStyle = GDK_LINE_SOLID; ///< current line style
152 Int_t lineWidth = 0; ///< current line width
153 std::vector<gint8> dashList; ///< Gtk array for dashes
154 Int_t dashLength = 0; ///< total length of dashes
155 Int_t dashOffset = 0; ///< current dash offset
156 TAttFill fAttFill = {-1, -1}; ///< current fill attributes
157 Int_t fillHollow = 0; ///< Flag if fill style is hollow
158 Int_t fillFasi = -1; ///< fasi parameter for fill pattern
159 GdkPixmap *fillPattern = nullptr; ///< current fill pattern
160 TAttMarker fAttMarker = { -1, -1, -1 }; ///< current marker attribute
161 Int_t markerType = 0; ///< 4 differen kinds of marker
162 Int_t markerSize = 0; ///< size of simple markers
163 std::vector<GdkPoint> markerShape; ///< marker shape points
164 Int_t markerLineWidth = 0; ///< line width used for marker
165 TAttText fAttText; ///< current text attributes
166 EAlign textAlign = kAlignNone; ///< selected text align
167 FT_Vector alignVector; ///< alignment vector
168};
169
170
171/////////////////////////////////// globals //////////////////////////////////
173
174namespace {
175/////////////////////////////////// globals //////////////////////////////////
176
178static XWindow_t *gCws; // gCws: pointer to the current window
179static XWindow_t *gTws; // gTws: temporary pointer
180
181const Int_t kBIGGEST_RGB_VALUE = 65535;
182
183static GdkGC *gGCecho; // Input echo - global
184
185//
186// Text management
187//
188static const char *gTextFont = "arial.ttf"; // Current font
189
190//
191// Markers
192//
194static int gMarkerCapStyle = GDK_CAP_ROUND;
196
197//
198// Keep style values for line GdkGC
199//
200static int gCapStyle = GDK_CAP_BUTT;
201static int gJoinStyle = GDK_JOIN_MITER;
202
203//
204// Event masks
205//
206static ULong_t gMouseMask =
210static ULong_t gKeybdMask =
213
214//
215// Data to create an invisible cursor
216//
217const char null_cursor_bits[] = {
218 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
219 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
220 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
221};
222static GdkCursor *gNullCursor;
223
224static bool gdk_initialized = false;
225
226//---- MWM Hints stuff
227
228struct MWMHintsProperty_t {
229 Handle_t fFlags;
230 Handle_t fFunctions;
231 Handle_t fDecorations;
232 Int_t fInputMode;
233};
234
235//---- hints
236
240
243
244
245//---- Key symbol mapping
246
247struct KeySymbolMap_t {
248 KeySym fXKeySym;
249 EKeySym fKeySym;
250};
251
252static const char *keyCodeToString[] = {
253 "", /* 0x000 */
254 "", /* 0x001, VK_LBUTTON */
255 "", /* 0x002, VK_RBUTTON */
256 "", /* 0x003, VK_CANCEL */
257 "", /* 0x004, VK_MBUTTON */
258 "", /* 0x005 */
259 "", /* 0x006 */
260 "", /* 0x007 */
261 "\015", /* 0x008, VK_BACK */
262 "\t", /* 0x009, VK_TAB */
263 "", /* 0x00A */
264 "", /* 0x00B */
265 "", /* 0x00C, VK_CLEAR */
266 "\r", /* 0x00D, VK_RETURN */
267 "", /* 0x00E */
268 "", /* 0x00F */
269 "", /* 0x010, VK_SHIFT */
270 "", /* 0x011, VK_CONTROL */
271 "", /* 0x012, VK_MENU */
272 "", /* 0x013, VK_PAUSE */
273 "", /* 0x014, VK_CAPITAL */
274 "", /* 0x015, VK_KANA */
275 "", /* 0x016 */
276 "", /* 0x017 */
277 "", /* 0x018 */
278 "", /* 0x019, VK_KANJI */
279 "", /* 0x01A */
280 "", /* 0x01B, VK_ESCAPE */
281 "", /* 0x01C, VK_CONVERT */
282 "", /* 0x01D, VK_NONCONVERT */
283 "", /* 0x01E */
284 "", /* 0x01F */
285 " ", /* 0x020, VK_SPACE */
286 "", /* 0x021, VK_PRIOR */
287 "", /* 0x022, VK_NEXT */
288 "", /* 0x023, VK_END */
289 "", /* 0x024, VK_HOME */
290 "", /* 0x025, VK_LEFT */
291 "", /* 0x026, VK_UP */
292 "", /* 0x027, VK_RIGHT */
293 "", /* 0x028, VK_DOWN */
294 "", /* 0x029, VK_SELECT */
295 "", /* 0x02A, VK_PRINT */
296 "", /* 0x02B, VK_EXECUTE */
297 "", /* 0x02C, VK_SNAPSHOT */
298 "", /* 0x02D, VK_INSERT */
299 "\037", /* 0x02E, VK_DELETE */
300 "", /* 0x02F, VK_HELP */
301};
302
303//---- Mapping table of all non-trivial mappings (the ASCII keys map
304//---- one to one so are not included)
305
306static KeySymbolMap_t gKeyMap[] = {
308 {GDK_Tab, kKey_Tab},
309#ifndef GDK_ISO_Left_Tab
310 {0xFE20, kKey_Backtab},
311#else
313#endif
321 {0x1005FF60, kKey_SysReq}, // hardcoded Sun SysReq
322 {0x1007ff00, kKey_SysReq}, // hardcoded X386 SysReq
323 {GDK_Home, kKey_Home}, // cursor movement
324 {GDK_End, kKey_End},
326 {GDK_Up, kKey_Up},
331 {GDK_Shift_L, kKey_Shift}, // modifiers
343 {GDK_KP_Space, kKey_Space}, // numeric keypad
353 {0, (EKeySym) 0}
354};
355
356
357/////////////////////static auxilary functions /////////////////////////////////
358////////////////////////////////////////////////////////////////////////////////
359
360static Int_t _lookup_string(Event_t * event, char *buf, Int_t buflen)
361{
362 int i;
363 int n = event->fUser[1];
364 if (n > 0) {
365 for (i = 0; i < n; i++) {
366 buf[i] = event->fUser[2 + i];
367 }
368 buf[n] = 0;
369 } else {
370 buf[0] = 0;
371 }
372 if (event->fCode <= 0x20) {
373 strncpy(buf, keyCodeToString[event->fCode], buflen - 1);
374 }
375 return n;
376}
377
378////////////////////////////////////////////////////////////////////////////////
379
381{
382 union {
383 Longptr_t l;
384 Int_t i[2];
385 } conv;
386
387 conv.l = 0L;
388 conv.i[0] = 0;
389 conv.i[1] = 0;
390
391 conv.l = ll;
392 i1 = conv.i[0];
393 i2 = conv.i[1];
394}
395
396////////////////////////////////////////////////////////////////////////////////
397
399{
400 union {
401 Longptr_t l;
402 Int_t i[2];
403 } conv;
404
405 conv.i[0] = (Int_t)i1;
406 conv.i[1] = (Int_t)i2;
407 ll = conv.l;
408}
409
410////////////////////////////////////////////////////////////////////////////////
411/// Make sure the child window is visible.
412
414{
415 ::ShowWindow(hwndChild, SW_SHOWNORMAL);
417 if (child)
418 ((GdkWindowPrivate *) child)->mapped = TRUE;
419 return TRUE;
420}
421
422////////////////////////////////////////////////////////////////////////////////
423
424static void _ChangeProperty(HWND w, char *np, char *dp, int n, Atom_t type)
425{
427 char *p;
428
429 hMem = ::GetProp(w, np);
430 if (hMem != NULL) {
432 }
433 hMem = ::GlobalAlloc(GHND, n + sizeof(Atom_t));
434 p = (char *) ::GlobalLock(hMem);
435 memcpy(p, &type, sizeof(Atom_t));
436 memcpy(p + sizeof(Atom_t), dp, n);
437 ::GlobalUnlock(hMem);
438 ::SetProp(w, np, hMem);
440}
441
442////////////////////////////////////////////////////////////////////////////////
443///
444
446 int format, int mode, const unsigned char *data,
447 int nelements)
448{
449 char *atomName;
450 char buffer[256];
451 int len;
452 char propName[32];
453
455 len = (int) ::GlobalGetAtomName(property, buffer, sizeof(buffer));
456 if ((atomName = (char *) malloc(len + 1)) == NULL) {
457 return;
458 } else {
459 strcpy(atomName, buffer);
460 }
461 sprintf(propName, "#0x%0.4tx", (ULongptr_t) atomName);
463 free(atomName);
464 }
465}
466
467////////////////////////////////////////////////////////////////////////////////
468///
469
475{
476 if (!id) return 0;
477
478 char *data, *destPtr;
479 char propName[32];
480 HGLOBAL handle;
481 HWND w;
482
483 w = (HWND) GDK_DRAWABLE_XID(id);
484
486 handle = ::GetClipboardData(CF_TEXT);
487 if (handle != NULL) {
488 data = (char *) ::GlobalLock(handle);
491 destPtr = (char *) *prop_return;
492 while (*data != '\0') {
493 if (*data != '\r') {
494 *destPtr = *data;
495 destPtr++;
496 }
497 data++;
498 }
499 *destPtr = '\0';
500 ::GlobalUnlock(handle);
503 }
505 return 1;
506 }
507 if (delete_it) {
509 }
510 return 1;
511}
512
513////////////////////////////////////////////////////////////////////////////////
514///
515
517{
518 if (!id) return 0;
519
520 GdkImage *image = (GdkImage *)id;
522
523 if (image->depth == 1) {
524 pixel = (((char *) image->mem)[y * image->bpl + (x >> 3)] & (1 << (7 - (x & 0x7)))) != 0;
525 } else {
526 UChar_t *pixelp = (UChar_t *) image->mem + y * image->bpl + x * image->bpp;
527 switch (image->bpp) {
528 case 1:
529 pixel = *pixelp;
530 break;
531 // Windows is always LSB, no need to check image->byte_order.
532 case 2:
533 pixel = pixelp[0] | (pixelp[1] << 8);
534 break;
535 case 3:
536 pixel = pixelp[0] | (pixelp[1] << 8) | (pixelp[2] << 16);
537 break;
538 case 4:
539 pixel = pixelp[0] | (pixelp[1] << 8) | (pixelp[2] << 16);
540 break;
541 }
542 }
543 return pixel;
544}
545
546////////////////////////////////////////////////////////////////////////////////
547/// debug function for printing event mask
548
549static char *EventMask2String(UInt_t evmask)
550{
551 static char bfr[500];
552 char *p = bfr;
553
554 *p = '\0';
555#define BITmask(x) \
556 if (evmask & k##x##Mask) \
557 p += sprintf (p, "%s" #x, (p > bfr ? " " : ""))
569#undef BITmask
570
571 return bfr;
572}
573
574///////////////////////////////////////////////////////////////////////////////
575class TGWin32MainThread {
576
577public:
578 void *fHandle; // handle of server (aka command) thread
579 DWORD fId; // id of server (aka command) thread
580 static LPCRITICAL_SECTION fCritSec; // general mutex
581 static LPCRITICAL_SECTION fMessageMutex; // message queue mutex
582
583 TGWin32MainThread();
585 static void LockMSG();
586 static void UnlockMSG();
587};
588
589TGWin32MainThread *gMainThread = 0;
590LPCRITICAL_SECTION TGWin32MainThread::fCritSec = 0;
591LPCRITICAL_SECTION TGWin32MainThread::fMessageMutex = 0;
592
593
594////////////////////////////////////////////////////////////////////////////////
595/// dtor
596
597TGWin32MainThread::~TGWin32MainThread()
598{
599 if (fCritSec) {
600 ::LeaveCriticalSection(fCritSec);
601 ::DeleteCriticalSection(fCritSec);
602 delete fCritSec;
603 }
604 fCritSec = 0;
605
606 if (fMessageMutex) {
607 ::LeaveCriticalSection(fMessageMutex);
608 ::DeleteCriticalSection(fMessageMutex);
609 delete fMessageMutex;
610 }
611 fMessageMutex = 0;
612
613 if(fHandle) {
614 ::PostThreadMessage(fId, WM_QUIT, 0, 0);
615 ::CloseHandle(fHandle);
616 }
617 fHandle = 0;
618}
619
620////////////////////////////////////////////////////////////////////////////////
621/// lock message queue
622
623void TGWin32MainThread::LockMSG()
624{
625 if (fMessageMutex) ::EnterCriticalSection(fMessageMutex);
626}
627
628////////////////////////////////////////////////////////////////////////////////
629/// unlock message queue
630
631void TGWin32MainThread::UnlockMSG()
632{
633 if (fMessageMutex) ::LeaveCriticalSection(fMessageMutex);
634}
635
636
637////////////////////////////////////////////////////////////////////////////////
638/// Windows timer handling events while moving/resizing windows
639
641{
643 //gVirtualX->UpdateWindow(1); // cause problems with OpenGL in pad...
644}
645
646////////////////////////////////////////////////////////////////////////////////
647/// Message processing function for the GUI thread.
648/// Kicks in once TGWin32 becomes active, and "replaces" the dummy one
649/// in TWinNTSystem; see TWinNTSystem.cxx's GUIThreadMessageProcessingLoop().
650
652{
653 Bool_t ret = kFALSE;
654 static Int_t m_timer = 0;
655
656 if ( (msg->message == WM_NCLBUTTONDOWN) ) {
657 if (m_timer == 0)
658 m_timer = SetTimer(NULL, 1, 20, (TIMERPROC) MyTimerProc);
659 }
660 else if (msg->message == WM_NCMOUSELEAVE ) {
661 if (m_timer) {
662 KillTimer(NULL, m_timer);
663 }
664 m_timer = 0;
665 }
666
667 if (msg->message == TGWin32ProxyBase::fgPostMessageId) {
668 if (msg->wParam) {
670 proxy->ExecuteCallBack(kTRUE);
671 } else {
672 ret = kTRUE;
673 }
674 } else if (msg->message == TGWin32ProxyBase::fgPingMessageId) {
676 } else {
677 //if ( (msg->message >= WM_NCMOUSEMOVE) &&
678 // (msg->message <= WM_NCMBUTTONDBLCLK) ) {
679 // TGWin32ProxyBase::GlobalLock();
680 //}
681 TGWin32MainThread::LockMSG();
684 TGWin32MainThread::UnlockMSG();
685 }
686 return ret;
687}
688
689
690///////////////////////////////////////////////////////////////////////////////
691class TGWin32RefreshTimer : public TTimer {
692
693public:
694 TGWin32RefreshTimer() : TTimer(10, kTRUE) { if (gSystem) gSystem->AddTimer(this); }
696 Bool_t Notify()
697 {
698 Reset();
699 MSG msg;
700
701 while (::PeekMessage(&msg, NULL, NULL, NULL, PM_NOREMOVE)) {
703 if (!gVirtualX)
704 Sleep(200); // avoid start-up race
705 if (gVirtualX)
707 }
708 return kFALSE;
709 }
710};
711/*
712////////////////////////////////////////////////////////////////////////////////
713/// thread for processing windows messages (aka Main/Server thread)
714
715static DWORD WINAPI MessageProcessingLoop(void *p)
716{
717 MSG msg;
718 Int_t erret;
719 Bool_t endLoop = kFALSE;
720 TGWin32RefreshTimer *refersh = 0;
721
722 // force to create message queue
723 ::PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE);
724
725 // periodically we refresh windows
726 // Don't create refresh timer if the application has been created inside PVSS
727 if (gApplication) {
728 TString arg = gSystem->BaseName(gApplication->Argv(0));
729 if (!arg.Contains("PVSS"))
730 refersh = new TGWin32RefreshTimer();
731 }
732
733 while (!endLoop) {
734 erret = ::GetMessage(&msg, NULL, NULL, NULL);
735 if (erret <= 0) endLoop = kTRUE;
736 endLoop = MessageProcessingFunc(&msg);
737 }
738
739 TGWin32::Instance()->CloseDisplay();
740 if (refersh)
741 delete refersh;
742
743 // exit thread
744 if (erret == -1) {
745 erret = ::GetLastError();
746 Error("MsgLoop", "Error in GetMessage");
747 ::ExitThread(-1);
748 } else {
749 ::ExitThread(0);
750 }
751 return 0;
752}
753*/
754
755////////////////////////////////////////////////////////////////////////////////
756/// constructor
757
758TGWin32MainThread::TGWin32MainThread()
759{
760 fCritSec = new CRITICAL_SECTION;
762 fMessageMutex = new CRITICAL_SECTION;
763 ::InitializeCriticalSection(fMessageMutex);
764 fHandle = ((TWinNTSystem*)gSystem)->GetGUIThreadHandle();
765 fId = ((TWinNTSystem*)gSystem)->GetGUIThreadId();
766 ((TWinNTSystem*)gSystem)->SetGUIThreadMsgHandler(GUIThreadMessageFunc);
767}
768
769} // unnamed namespace
770
771///////////////////////// TGWin32 implementation ///////////////////////////////
772
773////////////////////////////////////////////////////////////////////////////////
774/// Default constructor.
775
776TGWin32::TGWin32(): fRefreshTimer(0)
777{
778 fScreenNumber = 0;
779 fColors = 0;
780}
781
782////////////////////////////////////////////////////////////////////////////////
783/// Normal Constructor.
784
785TGWin32::TGWin32(const char *name, const char *title) : TVirtualX(name,title), fRefreshTimer(0)
786{
787 fScreenNumber = 0;
790 fTextMagnitude = 1;
791 fCharacterUpX = 1;
792 fCharacterUpY = 1;
794 fXEvent = 0;
795
796 fColors = new TExMap;
797
798 if (gApplication) {
800 if (!arg.Contains("PVSS"))
801 fRefreshTimer = new TGWin32RefreshTimer();
802 } else {
803 fRefreshTimer = new TGWin32RefreshTimer();
804 }
805
806 // initialize GUI thread and proxy objects
807 if (!gROOT->IsBatch() && !gMainThread) {
808 gMainThread = new TGWin32MainThread();
812 }
813}
814
815////////////////////////////////////////////////////////////////////////////////
816/// destructor.
817
819{
820 CloseDisplay();
821 if (fRefreshTimer)
822 delete fRefreshTimer;
823 if (!fColors) return;
824 Long64_t key, value;
826 while (it.Next(key, value)) {
827 XColor_t *col = (XColor_t *) value;
828 delete col;
829 }
830 delete fColors;
831}
832
833////////////////////////////////////////////////////////////////////////////////
834/// returns kTRUE if we are inside cmd/server thread
835
837{
838#ifdef OLD_THREAD_IMPLEMENTATION
841#else
842 return kTRUE;
843#endif
844}
845
846////////////////////////////////////////////////////////////////////////////////
847/// close display (terminate server/gMainThread thread)
848
850{
851 // disable any processing while exiting
853
854 // terminate server thread
855 gPtr2VirtualX = 0;
857
858 // The lock above does not work, so at least
859 // minimize the risk
860 TGWin32MainThread *delThread = gMainThread;
861 if (gMainThread) {
862 gMainThread = 0;
863 delete delThread;
864 }
865
867
868 // terminate ROOT logo splash thread
870 if (gSplash) {
871 gSplash = 0;
872 delete delSplash;
873 }
874
876
878
879 gROOT->SetBatch(kTRUE); // no GUI is possible
880}
881
882////////////////////////////////////////////////////////////////////////////////
883///
884
886{
887 if (gMainThread && gMainThread->fCritSec) ::EnterCriticalSection(gMainThread->fCritSec);
888}
889
890////////////////////////////////////////////////////////////////////////////////
891///
892
894{
895 if (gMainThread && gMainThread->fCritSec) ::LeaveCriticalSection(gMainThread->fCritSec);
896}
897
898////////////////////////////////////////////////////////////////////////////////
899/// Initialize Win32 system. Returns kFALSE in case of failure.
900
901Bool_t TGWin32::Init(void *display)
902{
903 if (!gdk_initialized) {
904 if (!gdk_init_check(NULL, NULL)) return kFALSE;
905 gdk_initialized = true;
906 }
907
908 if (!gClipboardAtom) {
909 gClipboardAtom = gdk_atom_intern("CLIPBOARD", kFALSE);
910 }
911
912 return kTRUE;
913}
914
915////////////////////////////////////////////////////////////////////////////////
916/// Open the display. Return -1 if the opening fails, 0 when ok.
917
919{
921 GdkColor fore, back;
922 GdkColor color;
923
926 return -1;
927
928 if (!Init((void*)dpyName)) {
929 return -1;
930 }
931
932 if (gDebug <= 4) {
934 } else {
935 gdk_debug_level = 0;
936 }
937
938 fore.red = fore.green = fore.blue = 0;
939 back.red = back.green = back.blue = 0;
940 color.red = color.green = color.blue = 0;
941
942 fScreenNumber = 0; //DefaultScreen(fDisplay);
946
947 GetColor(1).fDefined = kTRUE; // default foreground
949
950 GetColor(0).fDefined = kTRUE; // default background
952
953 // Create input echo graphic context
955 gdk_color_black(fColormap, &echov.foreground); // = BlackPixel(fDisplay, fScreenNumber);
956 gdk_color_white(fColormap, &echov.background); // = WhitePixel(fDisplay, fScreenNumber);
957 echov.function = GDK_INVERT;
958 echov.subwindow_mode = GDK_CLIP_BY_CHILDREN;
959 gGCecho =
965 // Create a null cursor
967 (const char *)null_cursor_bits, 16,16);
968
970 (const char *)null_cursor_bits, 16, 16);
971
973 &fore, &back, 0, 0);
974 // Create cursors
975 if (gEnv->GetValue("Win32.UseSysPointers", 0)) {
994 }
995 else {
1012 //fCursors[kWatch] = gdk_cursor_new(GDK_WATCH);
1015 }
1018
1019 // Setup color information
1021
1023 for (int i = 0; i < int(sizeof(fVisual->blue_mask)*kBitsPerByte); i++) {
1024 if (fBlueShift == -1 && ((fVisual->blue_mask >> i) & 1)) {
1025 fBlueShift = i;
1026 }
1027 if ((fVisual->blue_mask >> i) == 1) {
1028 fBlueDiv = sizeof(UShort_t)*kBitsPerByte - i - 1 + fBlueShift;
1029 break;
1030 }
1031 }
1032 for (int i = 0; i < int(sizeof(fVisual->green_mask)*kBitsPerByte); i++) {
1033 if (fGreenShift == -1 && ((fVisual->green_mask >> i) & 1)) {
1034 fGreenShift = i;
1035 }
1036 if ((fVisual->green_mask >> i) == 1) {
1037 fGreenDiv = sizeof(UShort_t)*kBitsPerByte - i - 1 + fGreenShift;
1038 break;
1039 }
1040 }
1041 for (int i = 0; i < int(sizeof(fVisual->red_mask)*kBitsPerByte); i++) {
1042 if (fRedShift == -1 && ((fVisual->red_mask >> i) & 1)) {
1043 fRedShift = i;
1044 }
1045 if ((fVisual->red_mask >> i) == 1) {
1046 fRedDiv = sizeof(UShort_t)*kBitsPerByte - i - 1 + fRedShift;
1047 break;
1048 }
1049 }
1050 }
1051
1052 SetName("Win32TTF");
1053 SetTitle("ROOT interface to Win32 with TrueType fonts");
1054
1055 if (!TTF::IsInitialized()) TTF::Init();
1056
1057 if (fDepth > 8) {
1059 } else {
1061 }
1062
1065 return 0;
1066}
1067
1068////////////////////////////////////////////////////////////////////////////////
1069/// Allocate color in colormap. If we are on an <= 8 plane machine
1070/// we will use XAllocColor. If we are on a >= 15 (15, 16 or 24) plane
1071/// true color machine we will calculate the pixel value using:
1072/// for 15 and 16 bit true colors have 6 bits precision per color however
1073/// only the 5 most significant bits are used in the color index.
1074/// Except for 16 bits where green uses all 6 bits. I.e.:
1075/// 15 bits = rrrrrgggggbbbbb
1076/// 16 bits = rrrrrggggggbbbbb
1077/// for 24 bits each r, g and b are represented by 8 bits.
1078///
1079/// Since all colors are set with a max of 65535 (16 bits) per r, g, b
1080/// we just right shift them by 10, 11 and 10 bits for 16 planes, and
1081/// (10, 10, 10 for 15 planes) and by 8 bits for 24 planes.
1082/// Returns kFALSE in case color allocation failed.
1083
1085{
1086 if (fRedDiv == -1) {
1087 if ( gdk_color_alloc((GdkColormap *)cmap, (GdkColor *)color) ) return kTRUE;
1088 } else {
1089 color->pixel = (color->red >> fRedDiv) << fRedShift |
1090 (color->green >> fGreenDiv) << fGreenShift |
1091 (color->blue >> fBlueDiv) << fBlueShift;
1092 return kTRUE;
1093 }
1094
1095 return kFALSE;
1096}
1097
1098////////////////////////////////////////////////////////////////////////////////
1099/// Returns the current RGB value for the pixel in the XColor structure.
1100
1102{
1103 ULong_t r, g, b;
1104
1105 if (fRedDiv == -1) {
1109 } else {
1110 for (Int_t i = 0; i < ncolors; i++) {
1111 r = (color[i].pixel & fVisual->red_mask) >> fRedShift;
1112 color[i].red = UShort_t(r*kBIGGEST_RGB_VALUE/(fVisual->red_mask >> fRedShift));
1113
1114 g = (color[i].pixel & fVisual->green_mask) >> fGreenShift;
1115 color[i].green = UShort_t(g*kBIGGEST_RGB_VALUE/(fVisual->green_mask >> fGreenShift));
1116
1117 b = (color[i].pixel & fVisual->blue_mask) >> fBlueShift;
1118 color[i].blue = UShort_t(b*kBIGGEST_RGB_VALUE/(fVisual->blue_mask >> fBlueShift));
1119 }
1120 }
1121}
1122
1123////////////////////////////////////////////////////////////////////////////////
1124/// Compute alignment variables. The alignment is done on the horizontal string
1125/// then the rotation is applied on the alignment variables.
1126/// SetRotation and LayoutGlyphs should have been called before.
1127
1129{
1130 auto ctxt = (XWindow_t *) wctxt;
1131
1132 auto align = ctxt->textAlign;
1133
1134 // vertical alignment
1135 if (align == kTLeft || align == kTCenter || align == kTRight) {
1136 ctxt->alignVector.y = TTF::GetAscent();
1137 } else if (align == kMLeft || align == kMCenter || align == kMRight) {
1138 ctxt->alignVector.y = TTF::GetAscent()/2;
1139 } else {
1140 ctxt->alignVector.y = 0;
1141 }
1142 // horizontal alignment
1143 if (align == kTRight || align == kMRight || align == kBRight) {
1144 ctxt->alignVector.x = TTF::GetWidth();
1145 } else if (align == kTCenter || align == kMCenter || align == kBCenter) {
1146 ctxt->alignVector.x = TTF::GetWidth()/2;
1147 } else {
1148 ctxt->alignVector.x = 0;
1149 }
1150
1151 FT_Vector_Transform(&ctxt->alignVector, TTF::GetRotMatrix());
1152 ctxt->alignVector.x = ctxt->alignVector.x >> 6;
1153 ctxt->alignVector.y = ctxt->alignVector.y >> 6;
1154}
1155
1156////////////////////////////////////////////////////////////////////////////////
1157/// Draw FT_Bitmap bitmap to xim image at position bx,by using specified
1158/// foreground color.
1159
1162{
1163 UChar_t d = 0, *s = source->buffer;
1164
1165 if (TTF::GetSmoothing()) {
1166
1167 static GdkColor col[5];
1168 GdkColor *bcol = 0, *bc;
1169 Int_t x, y;
1170
1171 // background kClear, i.e. transparent, we take as background color
1172 // the average of the rgb values of all pixels covered by this character
1173 if (back == (ULong_t) -1 && (UInt_t)source->width) {
1174 ULong_t r, g, b;
1175 Int_t dots, dotcnt;
1176 const Int_t maxdots = 50000;
1177
1178 dots = Int_t(source->width * source->rows);
1179 dots = dots > maxdots ? maxdots : dots;
1180 bcol = new GdkColor[dots];
1181 if (!bcol) return;
1182
1183 bc = bcol;
1184 dotcnt = 0;
1185 for (y = 0; y < (int) source->rows; y++) {
1186 for (x = 0; x < (int) source->width; x++, bc++) {
1187 bc->pixel = GetPixelImage((Drawable_t)xim, bx + x, by + y);
1188 if (++dotcnt >= maxdots) break;
1189 }
1190 }
1192 r = g = b = 0;
1193 bc = bcol;
1194 dotcnt = 0;
1195 for (y = 0; y < (int) source->rows; y++) {
1196 for (x = 0; x < (int) source->width; x++, bc++) {
1197 r += bc->red;
1198 g += bc->green;
1199 b += bc->blue;
1200 if (++dotcnt >= maxdots) break;
1201 }
1202 }
1203 if (dots != 0) {
1204 r /= dots;
1205 g /= dots;
1206 b /= dots;
1207 }
1208 bc = &col[0];
1209 if (bc->red == r && bc->green == g && bc->blue == b) {
1210 bc->pixel = back;
1211 } else {
1212 bc->pixel = ~back;
1213 bc->red = (UShort_t) r;
1214 bc->green = (UShort_t) g;
1215 bc->blue = (UShort_t) b;
1216 }
1217 }
1218 delete [] bcol;
1219
1220 // if fore or background have changed from previous character
1221 // recalculate the 3 smooting colors (interpolation between fore-
1222 // and background colors)
1223 if (fore != col[4].pixel || back != col[0].pixel) {
1224 col[4].pixel = fore;
1225 if (back != (ULong_t) -1) {
1226 col[3].pixel = back;
1227 QueryColors(fColormap, &col[3], 2);
1228 col[0] = col[3];
1229 } else {
1230 QueryColors(fColormap, &col[4], 1);
1231 }
1232
1233 // interpolate between fore and backgound colors
1234 for (x = 3; x > 0; x--) {
1235 col[x].red = (col[4].red *x + col[0].red *(4-x)) /4;
1236 col[x].green = (col[4].green*x + col[0].green*(4-x)) /4;
1237 col[x].blue = (col[4].blue *x + col[0].blue *(4-x)) /4;
1238 if (!AllocColor(fColormap, &col[x])) {
1239 Warning("DrawImage", "cannot allocate smoothing color");
1240 col[x].pixel = col[x+1].pixel;
1241 }
1242 }
1243 }
1244
1245 // put smoothed character, character pixmap values are an index
1246 // into the 5 colors used for aliasing (4 = foreground, 0 = background)
1247 for (y = 0; y < (int) source->rows; y++) {
1248 for (x = 0; x < (int) source->width; x++) {
1249 d = *s++ & 0xff;
1250 d = ((d + 10) * 5) / 256;
1251 if (d > 4) d = 4;
1252 if (d && x < (int) source->width) {
1253 ULong_t p = col[d].pixel;
1254 PutPixel((Drawable_t)xim, bx + x, by + y, p);
1255 }
1256 }
1257 }
1258 } else {
1259 // no smoothing, just put character using foreground color
1260 UChar_t* row=s;
1261 for (int y = 0; y < (int) source->rows; y++) {
1262 int n = 0;
1263 s = row;
1264 for (int x = 0; x < (int) source->width; x++) {
1265 if (n == 0) d = *s++;
1266 if (TESTBIT(d,7-n)) {
1267 PutPixel((Drawable_t)xim, bx + x, by + y, fore);
1268 }
1269 if (++n == (int) kBitsPerByte) n = 0;
1270 }
1271 row += source->pitch;
1272 }
1273 }
1274}
1275
1276////////////////////////////////////////////////////////////////////////////////
1277/// Draw text using TrueType fonts. If TrueType fonts are not available the
1278/// text is drawn with TGWin32::DrawText.
1279
1285
1286////////////////////////////////////////////////////////////////////////////////
1287/// Draw text using TrueType fonts on specified window.
1288/// If TrueType fonts are not available the
1289/// text is drawn with TGWin32::DrawText.
1290
1292 const char *text, ETextMode mode)
1293{
1294 if (!wctxt) return;
1295
1296 if (!TTF::IsInitialized()) TTF::Init();
1300 Align(wctxt);
1302}
1303
1304////////////////////////////////////////////////////////////////////////////////
1305/// Draw text using TrueType fonts. If TrueType fonts are not available the
1306/// text is drawn with TGWin32::DrawText.
1307
1309 const wchar_t *text, ETextMode mode)
1310{
1312}
1313
1314////////////////////////////////////////////////////////////////////////////////
1315/// Draw text using TrueType fonts on specified window.
1316/// If TrueType fonts are not available the
1317/// text is drawn with TGWin32::DrawText.
1318
1320 const wchar_t *text, ETextMode mode)
1321{
1322 if (!wctxt) return;
1323
1324 if (!TTF::IsInitialized()) TTF::Init();
1328 Align(wctxt);
1330}
1331
1332////////////////////////////////////////////////////////////////////////////////
1333/// Get the background of the current window in an XImage.
1334
1336{
1337 auto ctxt = (XWindow_t *) wctxt;
1338
1339 UInt_t width;
1340 UInt_t height;
1341 Int_t xy;
1342 GetWindowSize((Drawable_t) ctxt->drawing, xy, xy, width, height);
1343
1344 if (x < 0) {
1345 w += x;
1346 x = 0;
1347 }
1348 if (y < 0) {
1349 h += y;
1350 y = 0;
1351 }
1352
1353 if (x+w > width) w = width - x;
1354 if (y+h > height) h = height - y;
1355
1356 return gdk_image_get(ctxt->drawing, x, y, w, h);
1357}
1358
1359////////////////////////////////////////////////////////////////////////////////
1360/// Test if there is really something to render
1361
1363{
1364 auto ctxt = (XWindow_t *) wctxt;
1365
1366 UInt_t width;
1367 UInt_t height;
1368 Int_t xy;
1369 GetWindowSize((Drawable_t) ctxt->drawing, xy, xy, width, height);
1370
1371 // If w or h is 0, very likely the string is only blank characters
1372 if ((int)w == 0 || (int)h == 0) return kFALSE;
1373
1374 // If string falls outside window, there is probably no need to draw it.
1375 if (x + (int)w <= 0 || x >= (int)width) return kFALSE;
1376 if (y + (int)h <= 0 || y >= (int)height) return kFALSE;
1377
1378 return kTRUE;
1379}
1380
1381////////////////////////////////////////////////////////////////////////////////
1382/// Perform the string rendering in the pad.
1383/// LayoutGlyphs should have been called before.
1384
1386{
1387 auto ctxt = (XWindow_t *) wctxt;
1388
1391
1392 // compute the size and position of the XImage that will contain the text
1393 Int_t Xoff = 0; if (TTF::GetBox().xMin < 0) Xoff = -TTF::GetBox().xMin;
1394 Int_t Yoff = 0; if (TTF::GetBox().yMin < 0) Yoff = -TTF::GetBox().yMin;
1395 Int_t w = TTF::GetBox().xMax + Xoff;
1396 Int_t h = TTF::GetBox().yMax + Yoff;
1397 Int_t x1 = x - Xoff - ctxt->alignVector.x;
1398 Int_t y1 = y + Yoff + ctxt->alignVector.y - h;
1399
1400 if (!IsVisible(wctxt, x1, y1, w, h)) {
1401 return;
1402 }
1403
1404 // create the XImage that will contain the text
1407
1408 // use malloc since Xlib will use free() in XDestroyImage
1409// xim->data = (char *) malloc(xim->bytes_per_line * h);
1410// memset(xim->data, 0, xim->bytes_per_line * h);
1411
1412 ULong_t pixel;
1413 ULong_t bg;
1414
1415 gdk_gc_get_values(ctxt->fGClist[kGCtext], &gcvals);
1416
1417 // get the background
1418 if (mode == kClear) {
1419 // if mode == kClear we need to get an image of the background
1421 if (!bim) {
1422 Error("DrawText", "error getting background image");
1423 return;
1424 }
1425
1426 // and copy it into the text image
1427 Int_t xo = 0, yo = 0;
1428 if (x1 < 0) xo = -x1;
1429 if (y1 < 0) yo = -y1;
1430
1431 for (int yp = 0; yp < (int) bim->height; yp++) {
1432 for (int xp = 0; xp < (int) bim->width; xp++) {
1435 }
1436 }
1437
1439
1440 bg = (ULong_t) -1;
1441 } else {
1442 // if mode == kOpaque its simple, we just draw the background
1443
1445 if (!bim) {
1446 pixel = gcvals.background.pixel;
1447 } else {
1449 }
1450 Int_t xo = 0, yo = 0;
1451 if (x1 < 0) xo = -x1;
1452 if (y1 < 0) yo = -y1;
1453
1454 for (int yp = 0; yp < h; yp++) {
1455 for (int xp = 0; xp < (int) w; xp++) {
1457 }
1458 }
1459 if (bim) {
1461 bg = (ULong_t) -1;
1462 } else {
1463 bg = pixel;
1464 }
1465 }
1466
1467 // paint the glyphs in the XImage
1469 for (int n = 0; n < TTF::GetNumGlyphs(); n++, glyph++) {
1470 if (FT_Glyph_To_Bitmap(&glyph->fImage,
1473 0, 1 )) continue;
1475 FT_Bitmap* source = &bitmap->bitmap;
1476 Int_t bx, by;
1477
1478 bx = bitmap->left+Xoff;
1479 by = h - bitmap->top-Yoff;
1480 DrawImage(source, gcvals.foreground.pixel, bg, xim, bx, by);
1481 }
1482
1483 // put the Ximage on the screen
1484 gdk_draw_image(ctxt->drawing, ctxt->fGClist[kGCpxmp], xim, 0, 0, x1, y1, w, h);
1485
1487}
1488
1489////////////////////////////////////////////////////////////////////////////////
1490/// Set specified font.
1491
1493{
1495
1496 TAttText arg(gCws->fAttText);
1498
1500}
1501
1502////////////////////////////////////////////////////////////////////////////////
1503/// Set text font to specified name.
1504/// mode : loading flag
1505/// mode=0 : search if the font exist (kCheck)
1506/// mode=1 : search the font and load it if it exists (kLoad)
1507/// font : font name
1508///
1509/// Set text font to specified name. This function returns 0 if
1510/// the specified font is found, 1 if not.
1511
1513{
1514 return TTF::SetTextFont(fontname);
1515}
1516
1517////////////////////////////////////////////////////////////////////////////////
1518/// Set current text size.
1519
1521{
1523
1524 TAttText arg(gCws->fAttText);
1525 arg.SetTextSize(textsize);
1526
1528}
1529
1530////////////////////////////////////////////////////////////////////////////////
1531/// Clear current window.
1532
1537
1538////////////////////////////////////////////////////////////////////////////////
1539/// Clear specified window.
1540
1542{
1543 auto ctxt = (XWindow_t *) wctxt;
1544 if (!ctxt)
1545 return;
1546
1547 if (!ctxt->ispixmap && !ctxt->double_buffer) {
1548 gdk_window_set_background(ctxt->drawing, (GdkColor *) & GetColor(0).color);
1549 gdk_window_clear(ctxt->drawing);
1550 GdiFlush();
1551 } else {
1552 SetColor(ctxt, ctxt->fGClist[kGCpxmp], 0);
1553 gdk_win32_draw_rectangle(ctxt->drawing, ctxt->fGClist[kGCpxmp], 1,
1554 0, 0, ctxt->width, ctxt->height);
1555 SetColor(ctxt, ctxt->fGClist[kGCpxmp], 1);
1556 }
1557}
1558
1559////////////////////////////////////////////////////////////////////////////////
1560/// Delete current pixmap.
1561
1563{
1564 CloseWindow();
1565}
1566
1567////////////////////////////////////////////////////////////////////////////////
1568/// Delete current window.
1569
1571{
1572 if (!gCws->shared) {
1573 if (gCws->ispixmap) {
1574 gdk_pixmap_unref(gCws->window);
1575 } else {
1576 gdk_window_destroy(gCws->window, kTRUE);
1577 }
1578 }
1579
1580 if (gCws->fillPattern) {
1581 gdk_pixmap_unref(gCws->fillPattern);
1582 gCws->fillPattern = nullptr;
1583 }
1584
1585 if (gCws->buffer) {
1586 gdk_pixmap_unref(gCws->buffer);
1587 }
1588 if (!gCws->new_colors.empty()) {
1590 (GdkColor *)gCws->new_colors.data(), gCws->new_colors.size());
1591
1592 gCws->new_colors.clear();
1593 }
1594
1595 for (int i = 0; i < kMAXGC; i++)
1596 gdk_gc_unref(gCws->fGClist[i]); // gdk_gc_unref is equivalent to gdk_gc_destroy
1597
1598 GdiFlush();
1599 gCws->open = 0;
1600
1601 for (auto iter = fWindows.begin(); iter != fWindows.end(); ++iter)
1602 if (iter->second.get() == gCws) {
1603 fWindows.erase(iter);
1604 gCws = nullptr;
1605 break;
1606 }
1607
1608 if (gCws)
1609 Fatal("CloseWindow", "Not found gCws in list of windows");
1610
1611 // make first window in list the current window
1612 for (auto iter = fWindows.begin(); iter != fWindows.end(); ++iter)
1613 if (iter->second && iter->second->open) {
1614 gCws = iter->second.get();
1615 return;
1616 }
1617}
1618
1619////////////////////////////////////////////////////////////////////////////////
1620/// Copy the pixmap wid at the position xpos, ypos in the current window.
1621
1623{
1625}
1626
1627////////////////////////////////////////////////////////////////////////////////
1628/// Draw a box.
1629/// mode=0 hollow (kHollow)
1630/// mode=1 solid (kSolid)
1631
1632void TGWin32::DrawBox(int x1, int y1, int x2, int y2, EBoxMode mode)
1633{
1635}
1636
1637////////////////////////////////////////////////////////////////////////////////
1638/// Draw a box on specified window.
1639/// mode=0 hollow (kHollow)
1640/// mode=1 solid (kSolid)
1641
1643{
1644 auto ctxt = (XWindow_t *) wctxt;
1645 if (!ctxt)
1646 return;
1647
1648 Int_t x = TMath::Min(x1, x2);
1649 Int_t y = TMath::Min(y1, y2);
1650 Int_t w = TMath::Abs(x2 - x1);
1651 Int_t h = TMath::Abs(y2 - y1);
1652
1653 switch (mode) {
1654 case kHollow:
1655 gdk_win32_draw_rectangle(ctxt->drawing, ctxt->fGClist[kGCline], 0, x, y, w, h);
1656 break;
1657
1658 case kFilled:
1659 gdk_win32_draw_rectangle(ctxt->drawing, ctxt->fGClist[kGCfill], 1, x, y, w, h);
1660 break;
1661
1662 default:
1663 break;
1664 }
1665}
1666
1667////////////////////////////////////////////////////////////////////////////////
1668/// Draw a cell array.
1669/// x1,y1 : left down corner
1670/// x2,y2 : right up corner
1671/// nx,ny : array size
1672/// ic : array
1673///
1674/// Draw a cell array. The drawing is done with the pixel presicion
1675/// if (X2-X1)/NX (or Y) is not a exact pixel number the position of
1676/// the top rigth corner may be wrong.
1677
1679 Int_t nx, Int_t ny, Int_t *ic)
1680{
1681 if (!gCws) return;
1682
1683 int current_icol = -1;
1684 int w = TMath::Max((x2 - x1) / (nx), 1);
1685 int h = TMath::Max((y1 - y2) / (ny), 1);
1686 int ix = x1;
1687
1688 for (int i = 0; i < nx; i++) {
1689 int iy = y1 - h;
1690 for (int j = 0; j < ny; j++) {
1691 int icol = ic[i + (nx * j)];
1692 if (icol != current_icol) {
1693 gdk_gc_set_foreground(gCws->fGClist[kGCfill], (GdkColor *) & GetColor(icol).color);
1695 }
1696
1697 gdk_win32_draw_rectangle(gCws->drawing, gCws->fGClist[kGCfill], kTRUE, ix, iy, w, h);
1698 iy = iy - h;
1699 }
1700 ix = ix + w;
1701 }
1702}
1703
1704////////////////////////////////////////////////////////////////////////////////
1705/// Fill area described by polygon.
1706/// n : number of points
1707/// xy(2,n) : list of points
1708
1713
1714////////////////////////////////////////////////////////////////////////////////
1715/// Fill area described by polygon in a specified window.
1716/// n : number of points
1717/// xy(2,n) : list of points
1718
1720{
1721 auto ctxt = (XWindow_t *) wctxt;
1722 if (!ctxt)
1723 return;
1724
1725 std::vector<GdkPoint> xy(n);
1726 for (int i = 0; i < n; i++) {
1727 xy[i].x = xyt[i].fX;
1728 xy[i].y = xyt[i].fY;
1729 }
1730
1731 if (ctxt->fillHollow) {
1732 gdk_win32_draw_lines(ctxt->drawing, ctxt->fGClist[kGCfill], xy.data(), n);
1733 } else {
1734 gdk_win32_draw_polygon(ctxt->drawing, ctxt->fGClist[kGCfill], 1, xy.data(), n);
1735 }
1736}
1737
1738////////////////////////////////////////////////////////////////////////////////
1739/// Draw a line.
1740/// x1,y1 : begin of line
1741/// x2,y2 : end of line
1742
1747
1748////////////////////////////////////////////////////////////////////////////////
1749/// Draw a line on specified window.
1750/// x1,y1 : begin of line
1751/// x2,y2 : end of line
1752
1754{
1755 auto ctxt = (XWindow_t *) wctxt;
1756 if (!ctxt)
1757 return;
1758
1759 if (ctxt->lineStyle == GDK_LINE_SOLID) {
1760 gdk_draw_line(ctxt->drawing, ctxt->fGClist[kGCline], x1, y1, x2, y2);
1761 } else {
1762 gdk_gc_set_dashes(ctxt->fGClist[kGCdash], ctxt->dashOffset, ctxt->dashList.data(), ctxt->dashList.size());
1763 gdk_draw_line(ctxt->drawing, ctxt->fGClist[kGCdash], x1, y1, x2, y2);
1764 }
1765}
1766
1767////////////////////////////////////////////////////////////////////////////////
1768/// Draw a line through all points.
1769/// n : number of points
1770/// xy : list of points
1771
1776
1777////////////////////////////////////////////////////////////////////////////////
1778/// Draw a line through all points in specified window.
1779/// n : number of points
1780/// xy : list of points
1781
1783{
1784 auto ctxt = (XWindow_t *) wctxt;
1785 if (!ctxt || (n < 1))
1786 return;
1787
1788 std::vector<GdkPoint> xy(n);
1789 for (int i = 0; i < n; i++) {
1790 xy[i].x = xyt[i].fX;
1791 xy[i].y = xyt[i].fY;
1792 }
1793
1794 if (n > 1) {
1795 if (ctxt->lineStyle == GDK_LINE_SOLID) {
1796 gdk_win32_draw_lines(ctxt->drawing, ctxt->fGClist[kGCline], xy.data(), n);
1797 } else {
1798 gdk_gc_set_dashes(ctxt->fGClist[kGCdash], ctxt->dashOffset, ctxt->dashList.data(), ctxt->dashList.size());
1799 gdk_win32_draw_lines(ctxt->drawing, ctxt->fGClist[kGCdash], xy.data(), n);
1800
1801 // calculate length of line to update dash offset
1802 for (int i = 1; i < n; i++) {
1803 int dx = xy[i].x - xy[i - 1].x;
1804 int dy = xy[i].y - xy[i - 1].y;
1805
1806 if (dx < 0) dx = -dx;
1807 if (dy < 0) dy = -dy;
1808 ctxt->dashOffset += dx > dy ? dx : dy;
1809 }
1810 ctxt->dashOffset %= ctxt->dashLength;
1811 }
1812 } else {
1813 gdk_win32_draw_points(ctxt->drawing,
1814 ctxt->fGClist[ctxt->lineStyle == GDK_LINE_SOLID ? kGCline : kGCdash],
1815 xy.data(), 1);
1816 }
1817}
1818
1819////////////////////////////////////////////////////////////////////////////////
1820/// Draw N segments on specified window
1821/// n : number of segments
1822/// xy : list of points, 2*N size
1823
1825{
1826 for(Int_t i = 0; i < 2*n; i += 2)
1827 DrawPolyLineW(wctxt, 2, &xyt[i]);
1828}
1829
1830
1831////////////////////////////////////////////////////////////////////////////////
1832/// Draw n markers with the current attributes at position x, y.
1833/// n : number of markers to draw
1834/// xy : x,y coordinates of markers
1835
1840
1841////////////////////////////////////////////////////////////////////////////////
1842/// Draw n markers with the current attributes at position x, y in specified window.
1843/// n : number of markers to draw
1844/// xy : x,y coordinates of markers
1845
1847{
1848 auto ctxt = (XWindow_t *) wctxt;
1849 if (!ctxt) return;
1850
1851 if ((ctxt->markerShape.size() == 0) && (ctxt->markerSize <= 0)) {
1852 std::vector<GdkPoint> xy(n);
1853 for (int i = 0; i < n; i++) {
1854 xy[i].x = xyt[i].fX;
1855 xy[i].y = xyt[i].fY;
1856 }
1857
1858 gdk_win32_draw_points(ctxt->drawing, ctxt->fGClist[kGCmark], xy.data(), n);
1859 } else {
1860 int r = ctxt->markerSize / 2;
1861 auto &shape = ctxt->markerShape;
1862
1863 for (int m = 0; m < n; m++) {
1864 int hollow = 0;
1865 switch (ctxt->markerType) {
1866 case 0: // hollow circle
1867 gdk_win32_draw_arc(ctxt->drawing, ctxt->fGClist[kGCmark], kFALSE, xyt[m].fX - r, xyt[m].fY - r,
1868 ctxt->markerSize, ctxt->markerSize, 0, 23040);
1869 break;
1870
1871 case 1: // filled circle
1872 gdk_win32_draw_arc(ctxt->drawing, ctxt->fGClist[kGCmark], kTRUE, xyt[m].fX - r, xyt[m].fY - r,
1873 ctxt->markerSize, ctxt->markerSize, 0, 23040);
1874 break;
1875
1876 case 2: // hollow polygon
1877 hollow = 1;
1878 case 3: // filled polygon
1879 for (size_t i = 0; i < shape.size(); i++) {
1880 shape[i].x += xyt[m].fX;
1881 shape[i].y += xyt[m].fY;
1882 }
1883 if (hollow) {
1884 gdk_win32_draw_lines(ctxt->drawing, ctxt->fGClist[kGCmark], shape.data(), shape.size());
1885 } else {
1886 gdk_win32_draw_polygon(ctxt->drawing, ctxt->fGClist[kGCmark], 1, shape.data(), shape.size());
1887 }
1888 for (size_t i = 0; i < shape.size(); i++) {
1889 shape[i].x -= xyt[m].fX;
1890 shape[i].y -= xyt[m].fY;
1891 }
1892 break;
1893
1894 case 4: // segmented line
1895 for (size_t i = 0; i < shape.size(); i += 2) {
1896 gdk_draw_line(ctxt->drawing, ctxt->fGClist[kGCmark],
1897 xyt[m].fX + shape[i].x,
1898 xyt[m].fY + shape[i].y,
1899 xyt[m].fX + shape[i+1].x,
1900 xyt[m].fY + shape[i+1].y);
1901 }
1902 break;
1903 }
1904 }
1905 }
1906}
1907
1908////////////////////////////////////////////////////////////////////////////////
1909/// Return character up vector.
1910
1916
1917////////////////////////////////////////////////////////////////////////////////
1918/// Return reference to internal color structure associated
1919/// to color index cid.
1920
1922{
1923 XColor_t *col = (XColor_t*) fColors->GetValue(cid);
1924 if (!col) {
1925 col = new XColor_t;
1926 fColors->Add(cid, (Longptr_t) col);
1927 }
1928 return *col;
1929}
1930
1931////////////////////////////////////////////////////////////////////////////////
1932/// Return current window pointer. Protected method used by TGWin32TTF.
1933
1935{
1936 return (Window_t)(gCws ? gCws->drawing : 0);
1937}
1938
1939////////////////////////////////////////////////////////////////////////////////
1940/// Return desired Graphics Context ("which" maps directly on gGCList[]).
1941/// Protected method used by TGWin32TTF.
1942
1944{
1945 if (which >= kMAXGC || which < 0) {
1946 Error("GetGC", "trying to get illegal GdkGC (which = %d)", which);
1947 return 0;
1948 }
1949
1950 if (!gCws) {
1951 Error("GetGC", "No current window selected");
1952 return nullptr;
1953 }
1954 return gCws->fGClist[which];
1955}
1956
1957////////////////////////////////////////////////////////////////////////////////
1958/// Query the double buffer value for the window wid.
1959
1961{
1962 if (fWindows.count(wid) == 0)
1963 return 0;
1964
1965 gTws = fWindows[wid].get();
1966
1967 if (!gTws->open) {
1968 return -1;
1969 } else {
1970 return gTws->double_buffer;
1971 }
1972}
1973
1974////////////////////////////////////////////////////////////////////////////////
1975/// Return position and size of window wid.
1976/// wid : window identifier
1977/// x,y : window position (output)
1978/// w,h : window size (output)
1979/// if wid < 0 the size of the display is returned
1980
1981void TGWin32::GetGeometry(int wid, int &x, int &y, unsigned int &w,
1982 unsigned int &h)
1983{
1984 if (wid < 0) {
1985 x = 0;
1986 y = 0;
1987
1988 w = gdk_screen_width();
1989 h = gdk_screen_height();
1990 } else {
1991 int depth;
1992 int width, height;
1993
1994 if (fWindows.count(wid) == 0) return;
1995
1996 gTws = fWindows[wid].get();
1997 gdk_window_get_geometry((GdkDrawable *) gTws->window, &x, &y,
1998 &width, &height, &depth);
1999
2001
2002 if (width > 0 && height > 0) {
2003 gTws->width = width;
2004 gTws->height = height;
2005 }
2006 w = gTws->width;
2007 h = gTws->height;
2008 }
2009}
2010
2011////////////////////////////////////////////////////////////////////////////////
2012/// Return hostname on which the display is opened.
2013
2014const char *TGWin32::DisplayName(const char *dpyName)
2015{
2016 return "localhost"; //return gdk_get_display();
2017}
2018
2019////////////////////////////////////////////////////////////////////////////////
2020/// Get maximum number of planes.
2021
2026
2027////////////////////////////////////////////////////////////////////////////////
2028/// Get rgb values for color "index".
2029
2030void TGWin32::GetRGB(int index, float &r, float &g, float &b)
2031{
2032 if (index == 0) {
2033 r = g = b = 1.0;
2034 } else if (index == 1) {
2035 r = g = b = 0.0;
2036 } else {
2037 XColor_t &col = GetColor(index);
2038 r = ((float) col.color.red) / ((float) kBIGGEST_RGB_VALUE);
2039 g = ((float) col.color.green) / ((float) kBIGGEST_RGB_VALUE);
2040 b = ((float) col.color.blue) / ((float) kBIGGEST_RGB_VALUE);
2041 }
2042}
2043
2044////////////////////////////////////////////////////////////////////////////////
2045/// Return the size of a character string.
2046/// iw : text width
2047/// ih : text height
2048/// mess : message
2049
2056
2057////////////////////////////////////////////////////////////////////////////////
2058/// Return the X11 window identifier.
2059/// wid : Workstation identifier (input)
2060
2062{
2063 if (fWindows.count(wid) == 0) return 0;
2064 return (Window_t) fWindows[wid]->window;
2065}
2066
2067////////////////////////////////////////////////////////////////////////////////
2068/// Move the window wid.
2069/// wid : GdkWindow identifier.
2070/// x : x new window position
2071/// y : y new window position
2072
2074{
2075 if (fWindows.count(wid) == 0) return;
2076
2077 gTws = fWindows[wid].get();
2078 if (!gTws->open) return;
2079
2080 // prevent hiding the titlebar
2081 if (x == 0 && y == 0) {
2082 x = 1; y = 1;
2083 }
2084 gdk_window_move((GdkDrawable *) gTws->window, x, y);
2085}
2086
2087////////////////////////////////////////////////////////////////////////////////
2088/// Add new window handle
2089/// Only for private usage
2090
2092{
2093 Int_t maxid = 0;
2094 for (auto & pair : fWindows) {
2095 if (pair.first > maxid)
2096 maxid = pair.first;
2097 }
2098
2099 if (fWindows.size() == (size_t) maxid) {
2100 // all ids are in use - just add maximal+1
2101 maxid++;
2102 } else
2103 for (int id = 1; id < maxid; id++) {
2104 if (fWindows.count(id) == 0) {
2105 maxid = id;
2106 break;
2107 }
2108 }
2109
2110 fWindows.emplace(maxid, std::make_unique<XWindow_t>());
2111
2112 auto ctxt = fWindows[maxid].get();
2113 ctxt->open = 1;
2114 ctxt->shared = 0;
2115 ctxt->drawing = nullptr;
2116 ctxt->window = nullptr;
2117 ctxt->buffer = nullptr;
2118
2119 ctxt->drawMode = TVirtualX::kCopy;
2120
2121 // Create primitives graphic contexts
2122 for (int i = 0; i < kMAXGC; i++) {
2123 ctxt->fGClist[i] = gdk_gc_new(GDK_ROOT_PARENT());
2124 gdk_gc_set_foreground(ctxt->fGClist[i], &GetColor(1).color);
2125 gdk_gc_set_background(ctxt->fGClist[i], &GetColor(0).color);
2126 }
2127
2128 return maxid;
2129}
2130
2131
2132////////////////////////////////////////////////////////////////////////////////
2133/// Open a new pixmap.
2134/// w,h : Width and height of the pixmap.
2135
2136Int_t TGWin32::OpenPixmap(unsigned int w, unsigned int h)
2137{
2138 int wval, hval;
2139 int ww, hh, depth;
2140 wval = w;
2141 hval = h;
2142
2143 int wid = AddWindowHandle();
2144
2145 gCws = fWindows[wid].get();
2146 gCws->ispixmap = 1;
2147
2150 gdk_drawable_get_size((GdkDrawable *) gCws->window, &ww, &hh);
2151
2152 for (int i = 0; i < kMAXGC; i++)
2153 gdk_gc_set_clip_mask(gCws->fGClist[i], (GdkDrawable *)None);
2154
2155 SetColor(gCws, gCws->fGClist[kGCpxmp], 0);
2156 gdk_win32_draw_rectangle(gCws->window, gCws->fGClist[kGCpxmp], kTRUE,
2157 0, 0, ww, hh);
2158 SetColor(gCws, gCws->fGClist[kGCpxmp], 1);
2159
2160 // Initialise the window structure
2161 gCws->drawing = gCws->window;
2162 gCws->double_buffer = 0;
2163 gCws->clip = 0;
2164 gCws->width = wval;
2165 gCws->height = hval;
2166
2167 return wid;
2168}
2169
2170////////////////////////////////////////////////////////////////////////////////
2171/// Open window and return window number.
2172/// Return -1 if window initialization fails.
2173
2175{
2176 GdkWindowAttr attributes;
2177 unsigned long attr_mask = 0;
2178 int xval, yval;
2179 int wval, hval, depth;
2180
2181 int wid = AddWindowHandle();
2182
2183 gCws = fWindows[wid].get();
2184 gCws->ispixmap = 0;
2185
2186 GdkWindow *wind = (GdkWindow *) win;
2187
2189
2190 // Create window
2191 attributes.wclass = GDK_INPUT_OUTPUT;
2192 attributes.event_mask = 0L; //GDK_ALL_EVENTS_MASK;
2193 attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK |
2195// GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK;
2196 if (xval >= 0) {
2197 attributes.x = xval;
2198 } else {
2199 attributes.x = -1.0 * xval;
2200 }
2201
2202 if (yval >= 0) {
2203 attributes.y = yval;
2204 } else {
2205 attributes.y = -1.0 * yval;
2206 }
2207 attributes.width = wval;
2208 attributes.height = hval;
2209 attributes.colormap = gdk_colormap_get_system();
2210 attributes.visual = gdk_window_get_visual(wind);
2211 attributes.override_redirect = TRUE;
2212
2213 if ((attributes.y > 0) && (attributes.x > 0)) {
2216 } else {
2218 }
2219
2220 if (attributes.visual != NULL) {
2222 }
2223 attributes.window_type = GDK_WINDOW_CHILD;
2224 gCws->window = gdk_window_new(wind, &attributes, attr_mask);
2225 HWND window = (HWND)GDK_DRAWABLE_XID((GdkWindow *)gCws->window);
2226 ::ShowWindow(window, SW_SHOWNORMAL);
2227 ::ShowWindow(window, SW_RESTORE);
2228 ::BringWindowToTop(window);
2229
2230 if (!fUseSysPointers) {
2233 }
2234
2235 // Initialise the window structure
2236
2237 gCws->drawing = gCws->window;
2238 gCws->double_buffer = 0;
2239 gCws->clip = 0;
2240 gCws->width = wval;
2241 gCws->height = hval;
2242
2243 return wid;
2244}
2245
2246////////////////////////////////////////////////////////////////////////////////
2247/// Query pointer position.
2248/// ix : X coordinate of pointer
2249/// iy : Y coordinate of pointer
2250/// (both coordinates are relative to the origin of the root window)
2251
2253{
2254 //GdkModifierType mask;
2255 //GdkWindow *retw = gdk_window_get_pointer((GdkWindow *) gCws->window,
2256 // &ix, &iy, &mask);
2257 POINT cpt;
2258 GetCursorPos(&cpt);
2259 ix = cpt.x;
2260 iy = cpt.y;
2261}
2262
2263////////////////////////////////////////////////////////////////////////////////
2264/// Remove the pixmap pix.
2265
2270
2271////////////////////////////////////////////////////////////////////////////////
2272/// Request Locator position.
2273/// x,y : cursor position at moment of button press (output)
2274/// ctyp : cursor type (input)
2275/// ctyp=1 tracking cross
2276/// ctyp=2 cross-hair
2277/// ctyp=3 rubber circle
2278/// ctyp=4 rubber band
2279/// ctyp=5 rubber rectangle
2280///
2281/// mode : input mode
2282/// mode=0 request
2283/// mode=1 sample
2284///
2285/// Request locator:
2286/// return button number 1 = left is pressed
2287/// 2 = middle is pressed
2288/// 3 = right is pressed
2289/// in sample mode:
2290/// 11 = left is released
2291/// 12 = middle is released
2292/// 13 = right is released
2293/// -1 = nothing is pressed or released
2294/// -2 = leave the window
2295/// else = keycode (keyboard is pressed)
2296
2298{
2299 static int xloc = 0;
2300 static int yloc = 0;
2301 static int xlocp = 0;
2302 static int ylocp = 0;
2303 static GdkCursor *cursor = NULL;
2304 Int_t xtmp, ytmp;
2305
2306 GdkEvent *event;
2307 int button_press;
2308 int radius;
2309
2310 // Change the cursor shape
2311 if (cursor == NULL) {
2312 if (ctyp > 1) {
2315 } else {
2316 if (fUseSysPointers)
2318 else
2321 }
2322 }
2323
2324 // Event loop
2325 button_press = 0;
2326
2327 // Set max response time to 2 minutes to avoid timeout
2328 // in TGWin32ProxyBase::ForwardCallBack during RequestLocator
2330 while (button_press == 0) {
2331 event = gdk_event_get();
2332
2333 switch (ctyp) {
2334
2335 case 1:
2336 break;
2337
2338 case 2:
2339 gdk_draw_line(gCws->window, gGCecho, xloc, 0, xloc, gCws->height);
2340 gdk_draw_line(gCws->window, gGCecho, 0, yloc, gCws->width, yloc);
2341 break;
2342
2343 case 3:
2344 radius = (int) TMath::Sqrt((double)((xloc - xlocp) * (xloc - xlocp) +
2345 (yloc - ylocp) * (yloc - ylocp)));
2346
2348 xlocp - radius, ylocp - radius,
2349 2 * radius, 2 * radius, 0, 23040);
2350 break;
2351
2352 case 4:
2354 break;
2355
2356 case 5:
2360 break;
2361
2362 default:
2363 break;
2364 }
2365
2366 xloc = event->button.x;
2367 yloc = event->button.y;
2368
2369 switch (event->type) {
2370
2371 case GDK_LEAVE_NOTIFY:
2372 if (mode == 0) {
2373 while (1) {
2374 event = gdk_event_get();
2375
2376 if (event->type == GDK_ENTER_NOTIFY) {
2377 gdk_event_free(event);
2378 break;
2379 }
2380 gdk_event_free(event);
2381 }
2382 } else {
2383 button_press = -2;
2384 }
2385 break;
2386
2387 case GDK_BUTTON_PRESS:
2388 button_press = event->button.button;
2389 xlocp = event->button.x;
2390 ylocp = event->button.y;
2392 cursor = 0;
2393 break;
2394
2395 case GDK_BUTTON_RELEASE:
2396 if (mode == 1) {
2397 button_press = 10 + event->button.button;
2398 xlocp = event->button.x;
2399 ylocp = event->button.y;
2400 }
2401 break;
2402
2403 case GDK_KEY_PRESS:
2404 if (mode == 1) {
2405 button_press = event->key.keyval;
2406 xlocp = event->button.x;
2407 ylocp = event->button.y;
2408 }
2409 break;
2410
2411 case GDK_KEY_RELEASE:
2412 if (mode == 1) {
2413 button_press = -1 * (int)(event->key.keyval);
2414 xlocp = event->button.x;
2415 ylocp = event->button.y;
2416 }
2417 break;
2418
2419 default:
2420 break;
2421 }
2422
2423 xtmp = event->button.x;
2424 ytmp = event->button.y;
2425
2426 gdk_event_free(event);
2427
2428 if (mode == 1) {
2429 if (button_press == 0) {
2430 button_press = -1;
2431 }
2432 break;
2433 }
2434 }
2436
2437 x = xtmp;
2438 y = ytmp;
2439
2440 return button_press;
2441}
2442
2443////////////////////////////////////////////////////////////////////////////////
2444/// Request a string.
2445/// x,y : position where text is displayed
2446/// text : text displayed (input), edited text (output)
2447///
2448/// Request string:
2449/// text is displayed and can be edited with Emacs-like keybinding
2450/// return termination code (0 for ESC, 1 for RETURN)
2451
2453{
2454 static GdkCursor *cursor = NULL;
2455 static int percent = 0; // bell volume
2456 static GdkWindow *CurWnd;
2458 GdkEvent *event;
2459 KeySym keysym;
2460 int key = -1;
2461 size_t len_text = strlen(text);
2462 size_t nt; // defined length of text
2463 size_t pt; // cursor position in text
2464
2465 CurWnd = (GdkWindow *)gCws->window;
2466 // change the cursor shape
2467 if (cursor == NULL) {
2468 if (fUseSysPointers)
2470 else
2472 }
2473 if (cursor != 0) {
2475 }
2476 for (nt = len_text; nt > 0 && text[nt - 1] == ' '; nt--);
2477
2478 pt = nt;
2479 focuswindow = ::SetFocus((HWND)GDK_DRAWABLE_XID(CurWnd));
2480
2481 // Set max response time to 2 minutes to avoid timeout
2482 // in TGWin32ProxyBase::ForwardCallBack during RequestString
2486 do {
2487 char tmp[2];
2488 char keybuf[8];
2489 char nbytes;
2490 UInt_t dx, ddx, h;
2491 size_t i;
2492
2493 if (EventsPending()) {
2494 event = gdk_event_get();
2495 } else {
2497 ::SleepEx(10, kTRUE);
2498 continue;
2499 }
2500
2501 DrawText(x, y, 0.0, 1.0, text, kOpaque);
2503 DrawText(x+dx, y, 0.0, 1.0, " ", kOpaque);
2504
2505 if (pt == 0) {
2506 dx = 0;
2507 } else {
2508 char *stmp = new char[pt+1];
2509 strncpy(stmp, text, pt);
2510 stmp[pt] = '\0';
2512 dx = ddx;
2513 delete[] stmp;
2514 }
2515
2516 if (pt < len_text) {
2517 tmp[0] = text[pt];
2518 tmp[1] = '\0';
2519 DrawText(x+dx, y, 0.0, 1.0, tmp, kOpaque);
2520 } else {
2521 DrawText(x+dx, y, 0.0, 1.0, " ", kOpaque);
2522 }
2523
2524 if (event != NULL) {
2525 switch (event->type) {
2526 case GDK_BUTTON_PRESS:
2527 case GDK_ENTER_NOTIFY:
2528 focuswindow = ::SetFocus((HWND)GDK_DRAWABLE_XID(CurWnd));
2529 break;
2530
2531 case GDK_LEAVE_NOTIFY:
2532 ::SetFocus(focuswindow);
2533 break;
2534 case GDK_KEY_PRESS:
2535 nbytes = event->key.length;
2536 for (i = 0; i < nbytes; i++) {
2537 keybuf[i] = event->key.string[i];
2538 }
2539 keysym = event->key.keyval;
2540 switch (keysym) { // map cursor keys
2541 case GDK_BackSpace:
2542 keybuf[0] = 0x08; // backspace
2543 nbytes = 1;
2544 break;
2545 case GDK_Return:
2546 keybuf[0] = 0x0d; // return
2547 nbytes = 1;
2548 break;
2549 case GDK_Delete:
2550 keybuf[0] = 0x7f; // del
2551 nbytes = 1;
2552 break;
2553 case GDK_Escape:
2554 keybuf[0] = 0x1b; // esc
2555 nbytes = 1;
2556 break;
2557 case GDK_Home:
2558 keybuf[0] = 0x01; // home
2559 nbytes = 1;
2560 break;
2561 case GDK_Left:
2562 keybuf[0] = 0x02; // backward
2563 nbytes = 1;
2564 break;
2565 case GDK_Right:
2566 keybuf[0] = 0x06; // forward
2567 nbytes = 1;
2568 break;
2569 case GDK_End:
2570 keybuf[0] = 0x05; // end
2571 nbytes = 1;
2572 break;
2573 }
2574 if (nbytes == 1) {
2575 if (isascii(keybuf[0]) && isprint(keybuf[0])) {
2576 // insert character
2577 if (nt < len_text) {
2578 nt++;
2579 }
2580 for (i = nt - 1; i > pt; i--) {
2581 text[i] = text[i - 1];
2582 }
2583 if (pt < len_text) {
2584 text[pt] = keybuf[0];
2585 pt++;
2586 }
2587 } else {
2588 switch (keybuf[0]) {
2589 // Emacs-like editing keys
2590
2591 case 0x08: //'\010': // backspace
2592 case 0x7f: //'\177': // delete
2593 // delete backward
2594 if (pt > 0) {
2595 for (i = pt; i < nt; i++) {
2596 text[i - 1] = text[i];
2597 }
2598 text[nt - 1] = ' ';
2599 nt--;
2600 pt--;
2601 }
2602 break;
2603 case 0x01: //'\001': // ^A
2604 // beginning of line
2605 pt = 0;
2606 break;
2607 case 0x02: //'\002': // ^B
2608 // move backward
2609 if (pt > 0) {
2610 pt--;
2611 }
2612 break;
2613 case 0x04: //'\004': // ^D
2614 // delete forward
2615 if (pt > 0) {
2616 for (i = pt; i < nt; i++) {
2617 text[i - 1] = text[i];
2618 }
2619 text[nt - 1] = ' ';
2620 pt--;
2621 }
2622 break;
2623 case 0x05: //'\005': // ^E
2624 // end of line
2625 pt = nt;
2626 break;
2627
2628 case 0x06: //'\006': // ^F
2629 // move forward
2630 if (pt < nt) {
2631 pt++;
2632 }
2633 break;
2634 case 0x0b: //'\013': // ^K
2635 // delete to end of line
2636 for (i = pt; i < nt; i++)
2637 text[i] = ' ';
2638 nt = pt;
2639 break;
2640 case 0x14: //'\024': // ^T
2641 // transpose
2642 if (pt > 0) {
2643 char c = text[pt];
2644 text[pt] = text[pt - 1];
2645 text[pt - 1] = c;
2646 }
2647 break;
2648 case 0x0A: //'\012': // newline
2649 case 0x0D: //'\015': // return
2650 key = 1;
2651 break;
2652 case 0x1B: //'\033': // escape
2653 key = 0;
2654 break;
2655
2656 default:
2657 gSystem->Beep();
2658 break;
2659 }
2660 }
2661 }
2662 default:
2663 SetInputFocus((Window_t)gCws->window);
2664 break;
2665 }
2666 gdk_event_free(event);
2667 }
2668 } while (key < 0);
2670 ::SetFocus(focuswindow);
2672
2674 if (cursor != 0) {
2676 cursor = 0;
2677 }
2678
2679 return key;
2680}
2681
2682////////////////////////////////////////////////////////////////////////////////
2683/// Rescale the window wid.
2684/// wid : GdkWindow identifier
2685/// w : Width
2686/// h : Heigth
2687
2688void TGWin32::RescaleWindow(int wid, unsigned int w, unsigned int h)
2689{
2690 if (fWindows.count(wid) == 0) return;
2691
2692 gTws = fWindows[wid].get();
2693 if (!gTws->open)
2694 return;
2695
2696 // don't do anything when size did not change
2697 if (gTws->width == w && gTws->height == h)
2698 return;
2699
2700 gdk_window_resize((GdkWindow *) gTws->window, w, h);
2701
2702 if (gTws->buffer) {
2703 // don't free and recreate pixmap when new pixmap is smaller
2704 if (gTws->width < w || gTws->height < h) {
2705 gdk_pixmap_unref(gTws->buffer);
2706 gTws->buffer = gdk_pixmap_new(GDK_ROOT_PARENT(), // NULL,
2708 }
2709 for (int i = 0; i < kMAXGC; i++)
2710 gdk_gc_set_clip_mask(gTws->fGClist[i], (GdkBitmap *)None);
2711 SetColor(gTws, gTws->fGClist[kGCpxmp], 0);
2712 gdk_win32_draw_rectangle(gTws->buffer, gTws->fGClist[kGCpxmp], 1, 0, 0, w, h);
2713 SetColor(gTws, gTws->fGClist[kGCpxmp], 1);
2714
2715 if (gTws->double_buffer)
2716 gTws->drawing = gTws->buffer;
2717 }
2718 gTws->width = w;
2719 gTws->height = h;
2720}
2721
2722////////////////////////////////////////////////////////////////////////////////
2723/// Resize a pixmap.
2724/// wid : pixmap to be resized
2725/// w,h : Width and height of the pixmap
2726
2727int TGWin32::ResizePixmap(int wid, unsigned int w, unsigned int h)
2728{
2729 int wval, hval;
2730 int ww, hh, depth;
2731 wval = w;
2732 hval = h;
2733
2734 if (fWindows.count(wid) == 0) return 0;
2735
2736 gTws = fWindows[wid].get();
2737
2738 // don't do anything when size did not change
2739 // if (gTws->width == wval && gTws->height == hval) return 0;
2740
2741 // due to round-off errors in TPad::Resize() we might get +/- 1 pixel
2742 // change, in those cases don't resize pixmap
2743 if (gTws->width >= wval - 1 && gTws->width <= wval + 1 &&
2744 gTws->height >= hval - 1 && gTws->height <= hval + 1)
2745 return 0;
2746
2747 // don't free and recreate pixmap when new pixmap is smaller
2748 if (gTws->width < wval || gTws->height < hval) {
2749 gdk_pixmap_unref((GdkPixmap *)gTws->window);
2752 }
2753
2754 gdk_drawable_get_size(gTws->window, &ww, &hh);
2755
2756 for (int i = 0; i < kMAXGC; i++)
2757 gdk_gc_set_clip_mask(gTws->fGClist[i], (GdkDrawable *)None);
2758
2759 SetColor(gTws, gTws->fGClist[kGCpxmp], 0);
2760 gdk_win32_draw_rectangle(gTws->window, gTws->fGClist[kGCpxmp], kTRUE, 0, 0, ww, hh);
2761 SetColor(gTws, gTws->fGClist[kGCpxmp], 1);
2762
2763 // Initialise the window structure
2764 gTws->drawing = gTws->window;
2765 gTws->width = wval;
2766 gTws->height = hval;
2767 return 1;
2768}
2769
2770////////////////////////////////////////////////////////////////////////////////
2771/// Resize the current window if necessary.
2772
2774{
2775 if (fWindows.count(wid) == 0) return;
2776
2777 int xval = 0, yval = 0, wval = 0, hval = 0, depth = 0;
2778
2779 gTws = fWindows[wid].get();
2780
2781 auto win = (GdkWindow *) gTws->window;
2783 &wval, &hval, &depth);
2784
2785 // don't do anything when size did not change
2786 if (gTws->width == wval && gTws->height == hval) {
2787 return;
2788 }
2789
2790 gdk_window_resize((GdkWindow *) gTws->window, wval, hval);
2791
2792 if (gTws->buffer) {
2793 if (gTws->width < wval || gTws->height < hval) {
2794 gdk_pixmap_unref((GdkPixmap *)gTws->buffer);
2797 wval, hval, depth);
2798 }
2799
2800 for (int i = 0; i < kMAXGC; i++)
2801 gdk_gc_set_clip_mask(gTws->fGClist[i], (GdkDrawable *)None);
2802
2803 SetColor(gTws, gTws->fGClist[kGCpxmp], 0);
2804 gdk_win32_draw_rectangle(gTws->buffer, gTws->fGClist[kGCpxmp], kTRUE, 0, 0, wval, hval);
2805
2806 SetColor(gTws, gTws->fGClist[kGCpxmp], 1);
2807
2808 if (gTws->double_buffer)
2809 gTws->drawing = gTws->buffer;
2810 }
2811
2812 gTws->width = wval;
2813 gTws->height = hval;
2814}
2815
2816////////////////////////////////////////////////////////////////////////////////
2817/// Select window to which subsequent output is directed.
2818
2820{
2821 if (fWindows.count(wid) == 0) return;
2822
2823 if (!fWindows[wid]->open) return;
2824
2825 gCws = fWindows[wid].get();
2826
2827 if (gCws->clip && !gCws->ispixmap && !gCws->double_buffer) {
2829 rect.x = gCws->xclip;
2830 rect.y = gCws->yclip;
2831 rect.width = gCws->wclip;
2832 rect.height = gCws->hclip;
2833
2834 for (int i = 0; i < kMAXGC; i++)
2835 gdk_gc_set_clip_rectangle(gCws->fGClist[i], &rect);
2836 } else {
2837 for (int i = 0; i < kMAXGC; i++)
2838 gdk_gc_set_clip_mask(gCws->fGClist[i], (GdkDrawable *)None);
2839 }
2840}
2841
2842////////////////////////////////////////////////////////////////////////////////
2843/// Set character up vector.
2844
2846{
2847 if (chupx == fCharacterUpX && chupy == fCharacterUpY) return;
2848
2849 if (chupx == 0 && chupy == 0) {
2850 fTextAngle = 0;
2851 } else if (chupx == 0 && chupy == 1) {
2852 fTextAngle = 0;
2853 } else if (chupx == -1 && chupy == 0) {
2854 fTextAngle = 90;
2855 } else if (chupx == 0 && chupy == -1) {
2856 fTextAngle = 180;
2857 } else if (chupx == 1 && chupy == 0) {
2858 fTextAngle = 270;
2859 } else {
2860 fTextAngle =
2861 ((TMath::
2863 180.) / 3.14159) - 90;
2864 if (chupy < 0) fTextAngle = 180 - fTextAngle;
2865 if (TMath::Abs(fTextAngle) <= 0.01) fTextAngle = 0;
2866 }
2869}
2870
2871////////////////////////////////////////////////////////////////////////////////
2872/// Turn off the clipping for the window wid.
2873
2875{
2876 if (fWindows.count(wid) == 0) return;
2877
2878 gTws = fWindows[wid].get();
2879 gTws->clip = 0;
2880
2881 for (int i = 0; i < kMAXGC; i++)
2882 gdk_gc_set_clip_mask(gTws->fGClist[i], (GdkDrawable *)None);
2883}
2884
2885////////////////////////////////////////////////////////////////////////////////
2886/// Set clipping region for the window wid.
2887/// wid : GdkWindow indentifier
2888/// x,y : origin of clipping rectangle
2889/// w,h : size of clipping rectangle;
2890
2891void TGWin32::SetClipRegion(int wid, int x, int y, unsigned int w,
2892 unsigned int h)
2893{
2894 if (fWindows.count(wid) == 0) return;
2895
2896 gTws = fWindows[wid].get();
2897 gTws->xclip = x;
2898 gTws->yclip = y;
2899 gTws->wclip = w;
2900 gTws->hclip = h;
2901 gTws->clip = 1;
2902
2903 if (gTws->clip && !gTws->ispixmap && !gTws->double_buffer) {
2905 rect.x = gTws->xclip;
2906 rect.y = gTws->yclip;
2907 rect.width = gTws->wclip;
2908 rect.height = gTws->hclip;
2909
2910 for (int i = 0; i < kMAXGC; i++)
2911 gdk_gc_set_clip_rectangle(gTws->fGClist[i], &rect);
2912 }
2913}
2914
2915////////////////////////////////////////////////////////////////////////////////
2916/// Return pixel value associated to specified ROOT color number.
2917
2919{
2920 TColor *color = gROOT->GetColor(ci);
2921 if (color)
2922 SetRGB(ci, color->GetRed(), color->GetGreen(), color->GetBlue());
2923 XColor_t &col = GetColor(ci);
2924 return col.color.pixel;
2925}
2926
2927////////////////////////////////////////////////////////////////////////////////
2928/// Set the foreground color in GdkGC.
2929
2931{
2933 GdkColor color;
2934
2935 if (ci <= 0) ci = 10; //white
2936
2937 TColor *clr = gROOT->GetColor(ci);
2938 if (clr)
2939 SetRGB(ci, clr->GetRed(), clr->GetGreen(), clr->GetBlue());
2940
2941 XColor_t &col = GetColor(ci);
2942 if (fColormap && !col.fDefined) {
2943 col = GetColor(0);
2944 } else if (!fColormap && (ci < 0 || ci > 1)) {
2945 col = GetColor(0);
2946 }
2947
2948 if (ctxt && ctxt->drawMode == kXor) {
2950
2951 color.pixel = col.color.pixel ^ gcvals.background.pixel;
2952 color.red = GetRValue(color.pixel);
2953 color.green = GetGValue(color.pixel);
2954 color.blue = GetBValue(color.pixel);
2955 gdk_gc_set_foreground(gc, &color);
2956
2957 } else {
2959
2960 // make sure that foreground and background are different
2962
2963 if (gcvals.foreground.pixel != gcvals.background.pixel) {
2965 }
2966 }
2967}
2968
2969////////////////////////////////////////////////////////////////////////////////
2970/// Set the cursor.
2971
2973{
2974 if (fWindows.count(wid) == 0) return;
2975
2976 gTws = fWindows[wid].get();
2978}
2979
2980////////////////////////////////////////////////////////////////////////////////
2981/// Set the specified cursor.
2982
2984{
2985 if (!id) return;
2986
2987 static GdkWindow *lid = 0;
2988 static GdkCursor *lcur = 0;
2989
2990 if ((lid == (GdkWindow *)id) && (lcur==(GdkCursor *)curid)) return;
2991 lid = (GdkWindow *)id;
2992 lcur = (GdkCursor *)curid;
2993
2995}
2996
2997////////////////////////////////////////////////////////////////////////////////
2998/// Set the double buffer on/off on window wid.
2999/// wid : GdkWindow identifier.
3000/// 999 means all the opened windows.
3001/// mode : 1 double buffer is on
3002/// 0 double buffer is off
3003
3005{
3006 if (wid == 999) {
3007 for (auto & pair : fWindows) {
3008 gTws = pair.second.get();
3009 if (gTws->open) {
3010 switch (mode) {
3011 case 1:
3013 break;
3014 default:
3016 break;
3017 }
3018 }
3019 }
3020 } else {
3021 if (fWindows.count(wid) == 0) return;
3022
3023 gTws = fWindows[wid].get();
3024 if (!gTws->open) return;
3025
3026 switch (mode) {
3027 case 1:
3029 return;
3030 default:
3032 return;
3033 }
3034 }
3035}
3036
3037////////////////////////////////////////////////////////////////////////////////
3038/// Turn double buffer mode off.
3039
3041{
3042 if (!gTws->double_buffer) return;
3043 gTws->double_buffer = 0;
3044 gTws->drawing = gTws->window;
3045}
3046
3047////////////////////////////////////////////////////////////////////////////////
3048/// Turn double buffer mode on.
3049
3051{
3052 if (fWindows.size() == 0 || !gTws || gTws->double_buffer || gTws->ispixmap) return;
3053
3054 if (!gTws->buffer) {
3055 gTws->buffer = gdk_pixmap_new(GDK_ROOT_PARENT(), //NULL,
3056 gTws->width, gTws->height,
3058 SetColor(gTws, gTws->fGClist[kGCpxmp], 0);
3059 gdk_win32_draw_rectangle(gTws->buffer, gTws->fGClist[kGCpxmp], 1, 0, 0,
3060 gTws->width, gTws->height);
3061 SetColor(gTws, gTws->fGClist[kGCpxmp], 1);
3062 }
3063 for (int i = 0; i < kMAXGC; i++)
3064 gdk_gc_set_clip_mask(gTws->fGClist[i], (GdkBitmap *)None);
3065 gTws->double_buffer = 1;
3066 gTws->drawing = gTws->buffer;
3067}
3068
3069////////////////////////////////////////////////////////////////////////////////
3070/// Set the drawing mode.
3071/// mode : drawing mode
3072/// mode=1 copy
3073/// mode=2 xor
3074/// mode=3 invert
3075/// mode=4 set the suitable mode for cursor echo according to
3076/// the vendor
3077
3082
3083////////////////////////////////////////////////////////////////////////////////
3084/// Set color index for fill areas.
3085
3087{
3088 if (cindex < 0) return;
3089
3091
3092 TAttFill arg(gCws->fAttFill);
3093 arg.SetFillColor(cindex);
3094
3096}
3097
3098////////////////////////////////////////////////////////////////////////////////
3099/// Return current fill color
3100
3102{
3103 // TODO: remove in ROOT7, no longer used in ROOT
3104
3105 return gCws ? gCws->fAttFill.GetFillColor() : TAttFill::GetFillColor();
3106}
3107
3108////////////////////////////////////////////////////////////////////////////////
3109/// Set fill area style.
3110/// fstyle : compound fill area interior style
3111/// fstyle = 1000*interiorstyle + styleindex
3112
3114{
3116
3117 TAttFill arg(gCws->fAttFill);
3118 arg.SetFillStyle(fstyle);
3119
3121}
3122
3123////////////////////////////////////////////////////////////////////////////////
3124/// Return current fill style
3125
3127{
3128 // TODO: remove in ROOT7, no longer used in ROOT
3129
3130 return gCws ? gCws->fAttFill.GetFillStyle() : TAttFill::GetFillStyle();
3131}
3132
3133////////////////////////////////////////////////////////////////////////////////
3134/// Set fill attributes for specified window
3135
3137{
3138 auto ctxt = (XWindow_t *) wctxt;
3139 if (!ctxt)
3140 return;
3141
3142 Int_t cindex = att.GetFillColor();
3143 if (!gStyle->GetFillColor() && cindex > 1)
3144 cindex = 0;
3145 if (cindex >= 0)
3146 SetColor(ctxt, ctxt->fGClist[kGCfill], Int_t(cindex));
3147 ctxt->fAttFill.SetFillColor(cindex);
3148
3149 Int_t style = att.GetFillStyle() / 1000;
3150 Int_t fasi = att.GetFillStyle() % 1000;
3151
3152 switch (style) {
3153 case 1: // solid
3154 ctxt->fillHollow = 0;
3156 break;
3157
3158 case 2: // pattern
3159 ctxt->fillHollow = 1;
3160 break;
3161
3162 case 3: // hatch
3163 ctxt->fillHollow = 0;
3165
3166 if (fasi != ctxt->fillFasi) {
3167 if (ctxt->fillPattern) {
3168 gdk_pixmap_unref(ctxt->fillPattern);
3169 ctxt->fillPattern = nullptr;
3170 }
3171 int stn = (fasi >= 1 && fasi <=25) ? fasi : 2;
3172 char pattern[32];
3173 for (int i = 0; i < 32; ++i)
3174 pattern[i] = ~gStipples[stn][i];
3176 (const char *)&pattern, 16, 16);
3177 gdk_gc_set_stipple(ctxt->fGClist[kGCfill], ctxt->fillPattern);
3178 ctxt->fillFasi = fasi;
3179 }
3180 break;
3181
3182 default:
3183 ctxt->fillHollow = 1;
3184 }
3185
3186 ctxt->fAttFill.SetFillStyle(att.GetFillStyle());
3187}
3188
3189////////////////////////////////////////////////////////////////////////////////
3190/// Set input on or off.
3191
3193{
3195}
3196
3197////////////////////////////////////////////////////////////////////////////////
3198/// Set color index for lines.
3199
3201{
3202 if (cindex < 0) return;
3203
3205
3206 TAttLine arg(gCws->fAttLine);
3207 arg.SetLineColor(cindex);
3208
3210}
3211
3212////////////////////////////////////////////////////////////////////////////////
3213/// Set line type.
3214/// n : length of dash list
3215/// dash(n) : dash segment lengths
3216///
3217/// if n <= 0 use solid lines
3218/// if n > 0 use dashed lines described by DASH(N)
3219/// e.g. N=4,DASH=(6,3,1,3) gives a dashed-dotted line with dash length 6
3220/// and a gap of 7 between dashes
3221
3222void TGWin32::SetLineType(int /* n */ , int * /* dash */)
3223{
3224 Warning("SetLineType", "DEPRECATED, use SetAttLine() instead");
3225}
3226
3227////////////////////////////////////////////////////////////////////////////////
3228/// Set line style.
3229
3231{
3233
3234 TAttLine arg(gCws->fAttLine);
3235 arg.SetLineStyle(lstyle);
3236
3238}
3239
3240////////////////////////////////////////////////////////////////////////////////
3241/// Return current line style
3242
3244{
3245 // TODO: remove in ROOT7, no longer used in ROOT
3246
3247 return gCws ? gCws->fAttLine.GetLineStyle() : TAttLine::GetLineStyle();
3248}
3249
3250////////////////////////////////////////////////////////////////////////////////
3251/// Set line width.
3252/// width : line width in pixels
3253
3255{
3257
3258 TAttLine arg(gCws->fAttLine);
3259 arg.SetLineWidth(width);
3260
3262}
3263
3264////////////////////////////////////////////////////////////////////////////////
3265/// Return current line width
3266
3268{
3269 // TODO: remove in ROOT7, no longer used in ROOT
3270
3271 return gCws ? gCws->fAttLine.GetLineWidth() : TAttLine::GetLineWidth();
3272}
3273
3274////////////////////////////////////////////////////////////////////////////////
3275/// Set line attributes for specified window.
3276
3278{
3279 auto ctxt = (XWindow_t *) wctxt;
3280 if (!ctxt)
3281 return;
3282
3283 SetColor(ctxt, ctxt->fGClist[kGCline], att.GetLineColor());
3284 SetColor(ctxt, ctxt->fGClist[kGCdash], att.GetLineColor());
3285
3286 if (ctxt->fAttLine.GetLineStyle() != att.GetLineStyle()) { //set style index only if different
3287 if (att.GetLineStyle() <= 1)
3288 ctxt->dashList.clear();
3289 else if (att.GetLineStyle() == 2)
3290 ctxt->dashList = { 3, 3 };
3291 else if (att.GetLineStyle() == 3)
3292 ctxt->dashList = { 1, 2 };
3293 else if (att.GetLineStyle() == 4) {
3294 ctxt->dashList = { 3, 4, 1, 4} ;
3295 } else {
3296 TString st = (TString)gStyle->GetLineStyleString(att.GetLineStyle());
3297 auto tokens = st.Tokenize(" ");
3298 Int_t nt = tokens->GetEntries();
3299 ctxt->dashList.resize(nt);
3300 for (Int_t j = 0; j < nt; ++j) {
3301 Int_t it;
3302 sscanf(tokens->At(j)->GetName(), "%d", &it);
3303 ctxt->dashList[j] = (Int_t) (it/4);
3304 }
3305 delete tokens;
3306 }
3307 ctxt->dashLength = 0;
3308 for (auto elem : ctxt->dashList)
3309 ctxt->dashLength += elem;
3310 ctxt->dashOffset = 0;
3311 ctxt->lineStyle = ctxt->dashList.size() == 0 ? GDK_LINE_SOLID : GDK_LINE_ON_OFF_DASH;
3312 }
3313
3314 ctxt->lineWidth = att.GetLineWidth();
3315 if (ctxt->lineWidth == 1 && ctxt->lineStyle == GDK_LINE_SOLID)
3316 ctxt->lineWidth = 0;
3317
3318 if (ctxt->lineStyle == GDK_LINE_SOLID) {
3319 gdk_gc_set_line_attributes(ctxt->fGClist[kGCline], ctxt->lineWidth,
3320 ctxt->lineStyle,
3323 } else {
3324 gdk_gc_set_line_attributes(ctxt->fGClist[kGCdash], ctxt->lineWidth,
3325 ctxt->lineStyle,
3328 }
3329
3330 ctxt->fAttLine = att;
3331}
3332
3333
3334////////////////////////////////////////////////////////////////////////////////
3335/// Set color index for markers.
3336
3338{
3339 if (cindex < 0) return;
3340
3342
3343 TAttMarker arg(gCws->fAttMarker);
3345
3347}
3348
3349////////////////////////////////////////////////////////////////////////////////
3350/// Set marker size index.
3351/// msize : marker scale factor
3352
3354{
3355 if ((msize == TAttMarker::GetMarkerSize()) || (msize < 0))
3356 return;
3357
3359
3360 TAttMarker arg(gCws->fAttMarker);
3361 arg.SetMarkerSize(msize);
3362
3364}
3365
3366////////////////////////////////////////////////////////////////////////////////
3367/// Set marker style.
3368
3370{
3372 return;
3373
3375
3376 TAttMarker arg(gCws->fAttMarker);
3378
3380}
3381
3382////////////////////////////////////////////////////////////////////////////////
3383/// Set marker attributes for speicfied window
3384
3386{
3387 auto ctxt = (XWindow_t *) wctxt;
3388 if (!ctxt)
3389 return;
3390
3391 SetColor(ctxt, ctxt->fGClist[kGCmark], att.GetMarkerColor());
3392
3393 Bool_t changed = (att.GetMarkerSize() != ctxt->fAttMarker.GetMarkerSize()) ||
3394 (att.GetMarkerStyle() != ctxt->fAttMarker.GetMarkerStyle());
3395
3396 ctxt->fAttMarker = att;
3397
3398 if (!changed)
3399 return;
3400
3401 auto markerstyle = TAttMarker::GetMarkerStyleBase(att.GetMarkerStyle());
3402 ctxt->markerLineWidth = TAttMarker::GetMarkerLineWidth(att.GetMarkerStyle());
3403
3404 // The fast pixel markers need to be treated separately
3405 if (markerstyle == 1 || markerstyle == 6 || markerstyle == 7) {
3407 } else {
3408 gdk_gc_set_line_attributes(ctxt->fGClist[kGCmark], ctxt->markerLineWidth,
3409 (GdkLineStyle) gMarkerLineStyle,
3412 }
3413
3414 Float_t markerSizeReduced = att.GetMarkerSize() - TMath::Floor(ctxt->markerLineWidth/2.)/4.;
3415 Int_t im = Int_t(4 * markerSizeReduced + 0.5);
3416
3417 auto& shape = ctxt->markerShape;
3418 ctxt->markerSize = 0;
3419 ctxt->markerType = 0;
3420
3421 if (markerstyle == 2) {
3422 // + shaped marker
3423 shape.resize(4);
3424 shape[0].x = -im;
3425 shape[0].y = 0;
3426 shape[1].x = im;
3427 shape[1].y = 0;
3428 shape[2].x = 0;
3429 shape[2].y = -im;
3430 shape[3].x = 0;
3431 shape[3].y = im;
3432 ctxt->markerType = 4;
3433 } else if (markerstyle == 3 || markerstyle == 31) {
3434 // * shaped marker
3435 shape.resize(8);
3436 shape[0].x = -im;
3437 shape[0].y = 0;
3438 shape[1].x = im;
3439 shape[1].y = 0;
3440 shape[2].x = 0;
3441 shape[2].y = -im;
3442 shape[3].x = 0;
3443 shape[3].y = im;
3444 im = Int_t(0.707 * Float_t(im) + 0.5);
3445 shape[4].x = -im;
3446 shape[4].y = -im;
3447 shape[5].x = im;
3448 shape[5].y = im;
3449 shape[6].x = -im;
3450 shape[6].y = im;
3451 shape[7].x = im;
3452 shape[7].y = -im;
3453 ctxt->markerType = 4;
3454 } else if (markerstyle == 4 || markerstyle == 24) {
3455 // O shaped marker
3456 shape.resize(0);
3457 ctxt->markerType = 0;
3458 ctxt->markerSize = im * 2;
3459 } else if (markerstyle == 5) {
3460 // X shaped marker
3461 im = Int_t(0.707 * Float_t(im) + 0.5);
3462 shape.resize(4);
3463 shape[0].x = -im;
3464 shape[0].y = -im;
3465 shape[1].x = im;
3466 shape[1].y = im;
3467 shape[2].x = -im;
3468 shape[2].y = im;
3469 shape[3].x = im;
3470 shape[3].y = -im;
3471 ctxt->markerType = 4;
3472 } else if (markerstyle == 6) {
3473 // + shaped marker (with 1 pixel)
3474 shape.resize(4);
3475 shape[0].x = -1;
3476 shape[0].y = 0;
3477 shape[1].x = 1;
3478 shape[1].y = 0;
3479 shape[2].x = 0;
3480 shape[2].y = -1;
3481 shape[3].x = 0;
3482 shape[3].y = 1;
3483 ctxt->markerType = 4;
3484 } else if (markerstyle == 7) {
3485 // . shaped marker (with 9 pixel)
3486 shape.resize(6);
3487 shape[0].x = -1;
3488 shape[0].y = 1;
3489 shape[1].x = 1;
3490 shape[1].y = 1;
3491 shape[2].x = -1;
3492 shape[2].y = 0;
3493 shape[3].x = 1;
3494 shape[3].y = 0;
3495 shape[4].x = -1;
3496 shape[4].y = -1;
3497 shape[5].x = 1;
3498 shape[5].y = -1;
3499 ctxt->markerType = 4;
3500 } else if (markerstyle == 8 || markerstyle == 20) {
3501 // O shaped marker (filled)
3502 shape.resize(0);
3503 ctxt->markerType = 0;
3504 ctxt->markerSize = im * 2;
3505 } else if (markerstyle == 21) {
3506 // full square
3507 shape.resize(5);
3508 shape[0].x = -im;
3509 shape[0].y = -im;
3510 shape[1].x = im;
3511 shape[1].y = -im;
3512 shape[2].x = im;
3513 shape[2].y = im;
3514 shape[3].x = -im;
3515 shape[3].y = im;
3516 shape[4].x = -im;
3517 shape[4].y = -im;
3518 ctxt->markerType = 3;
3519 } else if (markerstyle == 22) {
3520 // full triangle up
3521 shape.resize(4);
3522 shape[0].x = -im;
3523 shape[0].y = im;
3524 shape[1].x = im;
3525 shape[1].y = im;
3526 shape[2].x = 0;
3527 shape[2].y = -im;
3528 shape[3].x = -im;
3529 shape[3].y = im;
3530 ctxt->markerType = 3;
3531 } else if (markerstyle == 23) {
3532 // full triangle down
3533 shape.resize(4);
3534 shape[0].x = 0;
3535 shape[0].y = im;
3536 shape[1].x = im;
3537 shape[1].y = -im;
3538 shape[2].x = -im;
3539 shape[2].y = -im;
3540 shape[3].x = 0;
3541 shape[3].y = im;
3542 ctxt->markerType = 3;
3543 } else if (markerstyle == 25) {
3544 // open square
3545 shape.resize(5);
3546 shape[0].x = -im;
3547 shape[0].y = -im;
3548 shape[1].x = im;
3549 shape[1].y = -im;
3550 shape[2].x = im;
3551 shape[2].y = im;
3552 shape[3].x = -im;
3553 shape[3].y = im;
3554 shape[4].x = -im;
3555 shape[4].y = -im;
3556 ctxt->markerType = 2;
3557 } else if (markerstyle == 26) {
3558 // open triangle up
3559 shape.resize(4);
3560 shape[0].x = -im;
3561 shape[0].y = im;
3562 shape[1].x = im;
3563 shape[1].y = im;
3564 shape[2].x = 0;
3565 shape[2].y = -im;
3566 shape[3].x = -im;
3567 shape[3].y = im;
3568 ctxt->markerType = 2;
3569 } else if (markerstyle == 27) {
3570 // open losange
3571 Int_t imx = Int_t(2.66 * markerSizeReduced + 0.5);
3572 shape.resize(5);
3573 shape[0].x = -imx;
3574 shape[0].y = 0;
3575 shape[1].x = 0;
3576 shape[1].y = -im;
3577 shape[2].x = imx;
3578 shape[2].y = 0;
3579 shape[3].x = 0;
3580 shape[3].y = im;
3581 shape[4].x = -imx;
3582 shape[4].y = 0;
3583 ctxt->markerType = 2;
3584 } else if (markerstyle == 28) {
3585 // open cross
3586 Int_t imx = Int_t(1.33 * markerSizeReduced + 0.5);
3587 shape.resize(13);
3588 shape[0].x = -im;
3589 shape[0].y = -imx;
3590 shape[1].x = -imx;
3591 shape[1].y = -imx;
3592 shape[2].x = -imx;
3593 shape[2].y = -im;
3594 shape[3].x = imx;
3595 shape[3].y = -im;
3596 shape[4].x = imx;
3597 shape[4].y = -imx;
3598 shape[5].x = im;
3599 shape[5].y = -imx;
3600 shape[6].x = im;
3601 shape[6].y = imx;
3602 shape[7].x = imx;
3603 shape[7].y = imx;
3604 shape[8].x = imx;
3605 shape[8].y = im;
3606 shape[9].x = -imx;
3607 shape[9].y = im;
3608 shape[10].x = -imx;
3609 shape[10].y = imx;
3610 shape[11].x = -im;
3611 shape[11].y = imx;
3612 shape[12].x = -im;
3613 shape[12].y = -imx;
3614 ctxt->markerType = 2;
3615 } else if (markerstyle == 29) {
3616 // full star pentagone
3617 Int_t im1 = Int_t(0.66 * markerSizeReduced + 0.5);
3618 Int_t im2 = Int_t(2.00 * markerSizeReduced + 0.5);
3619 Int_t im3 = Int_t(2.66 * markerSizeReduced + 0.5);
3620 Int_t im4 = Int_t(1.33 * markerSizeReduced + 0.5);
3621 shape.resize(11);
3622 shape[0].x = -im;
3623 shape[0].y = im4;
3624 shape[1].x = -im2;
3625 shape[1].y = -im1;
3626 shape[2].x = -im3;
3627 shape[2].y = -im;
3628 shape[3].x = 0;
3629 shape[3].y = -im2;
3630 shape[4].x = im3;
3631 shape[4].y = -im;
3632 shape[5].x = im2;
3633 shape[5].y = -im1;
3634 shape[6].x = im;
3635 shape[6].y = im4;
3636 shape[7].x = im4;
3637 shape[7].y = im4;
3638 shape[8].x = 0;
3639 shape[8].y = im;
3640 shape[9].x = -im4;
3641 shape[9].y = im4;
3642 shape[10].x = -im;
3643 shape[10].y = im4;
3644 ctxt->markerType = 3;
3645 } else if (markerstyle == 30) {
3646 // open star pentagone
3647 Int_t im1 = Int_t(0.66 * markerSizeReduced + 0.5);
3648 Int_t im2 = Int_t(2.00 * markerSizeReduced + 0.5);
3649 Int_t im3 = Int_t(2.66 * markerSizeReduced + 0.5);
3650 Int_t im4 = Int_t(1.33 * markerSizeReduced + 0.5);
3651 shape.resize(11);
3652 shape[0].x = -im;
3653 shape[0].y = im4;
3654 shape[1].x = -im2;
3655 shape[1].y = -im1;
3656 shape[2].x = -im3;
3657 shape[2].y = -im;
3658 shape[3].x = 0;
3659 shape[3].y = -im2;
3660 shape[4].x = im3;
3661 shape[4].y = -im;
3662 shape[5].x = im2;
3663 shape[5].y = -im1;
3664 shape[6].x = im;
3665 shape[6].y = im4;
3666 shape[7].x = im4;
3667 shape[7].y = im4;
3668 shape[8].x = 0;
3669 shape[8].y = im;
3670 shape[9].x = -im4;
3671 shape[9].y = im4;
3672 shape[10].x = -im;
3673 shape[10].y = im4;
3674 ctxt->markerType = 2;
3675 } else if (markerstyle == 32) {
3676 // open triangle down
3677 shape.resize(4);
3678 shape[0].x = 0; shape[0].y = im;
3679 shape[1].x = im; shape[1].y = -im;
3680 shape[2].x = -im; shape[2].y = -im;
3681 shape[3].x = 0; shape[3].y = im;
3682 ctxt->markerType = 2;
3683 } else if (markerstyle == 33) {
3684 // full losange
3685 Int_t imx = Int_t(2.66*markerSizeReduced + 0.5);
3686 shape.resize(5);
3687 shape[0].x =-imx; shape[0].y = 0;
3688 shape[1].x = 0; shape[1].y = -im;
3689 shape[2].x = imx; shape[2].y = 0;
3690 shape[3].x = 0; shape[3].y = im;
3691 shape[4].x =-imx; shape[4].y = 0;
3692 ctxt->markerType = 3;
3693 } else if (markerstyle == 34) {
3694 // full cross
3695 Int_t imx = Int_t(1.33*markerSizeReduced + 0.5);
3696 shape.resize(13);
3697 shape[0].x = -im; shape[0].y =-imx;
3698 shape[1].x =-imx; shape[1].y =-imx;
3699 shape[2].x =-imx; shape[2].y = -im;
3700 shape[3].x = imx; shape[3].y = -im;
3701 shape[4].x = imx; shape[4].y =-imx;
3702 shape[5].x = im; shape[5].y =-imx;
3703 shape[6].x = im; shape[6].y = imx;
3704 shape[7].x = imx; shape[7].y = imx;
3705 shape[8].x = imx; shape[8].y = im;
3706 shape[9].x =-imx; shape[9].y = im;
3707 shape[10].x=-imx; shape[10].y= imx;
3708 shape[11].x= -im; shape[11].y= imx;
3709 shape[12].x= -im; shape[12].y=-imx;
3710 ctxt->markerType = 3;
3711 } else if (markerstyle == 35) {
3712 // square with diagonal cross
3713 shape.resize(8);
3714 shape[0].x = -im; shape[0].y = -im;
3715 shape[1].x = im; shape[1].y = -im;
3716 shape[2].x = im; shape[2].y = im;
3717 shape[3].x = -im; shape[3].y = im;
3718 shape[4].x = -im; shape[4].y = -im;
3719 shape[5].x = im; shape[5].y = im;
3720 shape[6].x = -im; shape[6].y = im;
3721 shape[7].x = im; shape[7].y = -im;
3722 ctxt->markerType = 2;
3723 } else if (markerstyle == 36) {
3724 // diamond with cross
3725 shape.resize(8);
3726 shape[0].x =-im; shape[0].y = 0;
3727 shape[1].x = 0; shape[1].y = -im;
3728 shape[2].x = im; shape[2].y = 0;
3729 shape[3].x = 0; shape[3].y = im;
3730 shape[4].x =-im; shape[4].y = 0;
3731 shape[5].x = im; shape[5].y = 0;
3732 shape[6].x = 0; shape[6].y = im;
3733 shape[7].x = 0; shape[7].y =-im;
3734 ctxt->markerType = 2;
3735 } else if (markerstyle == 37) {
3736 // open three triangles
3737 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3738 shape.resize(10);
3739 shape[0].x = 0; shape[0].y = 0;
3740 shape[1].x =-im2; shape[1].y = im;
3741 shape[2].x = -im; shape[2].y = 0;
3742 shape[3].x = 0; shape[3].y = 0;
3743 shape[4].x =-im2; shape[4].y = -im;
3744 shape[5].x = im2; shape[5].y = -im;
3745 shape[6].x = 0; shape[6].y = 0;
3746 shape[7].x = im; shape[7].y = 0;
3747 shape[8].x = im2; shape[8].y = im;
3748 shape[9].x = 0; shape[9].y = 0;
3749 ctxt->markerType = 2;
3750 } else if (markerstyle == 38) {
3751 // + shaped marker with octagon
3752 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3753 shape.resize(15);
3754 shape[0].x = -im; shape[0].y = 0;
3755 shape[1].x = -im; shape[1].y =-im2;
3756 shape[2].x =-im2; shape[2].y =-im;
3757 shape[3].x = im2; shape[3].y = -im;
3758 shape[4].x = im; shape[4].y =-im2;
3759 shape[5].x = im; shape[5].y = im2;
3760 shape[6].x = im2; shape[6].y = im;
3761 shape[7].x =-im2; shape[7].y = im;
3762 shape[8].x = -im; shape[8].y = im2;
3763 shape[9].x = -im; shape[9].y = 0;
3764 shape[10].x = im; shape[10].y = 0;
3765 shape[11].x = 0; shape[11].y = 0;
3766 shape[12].x = 0; shape[12].y = -im;
3767 shape[13].x = 0; shape[13].y = im;
3768 shape[14].x = 0; shape[14].y = 0;
3769 ctxt->markerType = 2;
3770 } else if (markerstyle == 39) {
3771 // filled three triangles
3772 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3773 shape.resize(9);
3774 shape[0].x = 0; shape[0].y = 0;
3775 shape[1].x =-im2; shape[1].y = im;
3776 shape[2].x = -im; shape[2].y = 0;
3777 shape[3].x = 0; shape[3].y = 0;
3778 shape[4].x =-im2; shape[4].y = -im;
3779 shape[5].x = im2; shape[5].y = -im;
3780 shape[6].x = 0; shape[6].y = 0;
3781 shape[7].x = im; shape[7].y = 0;
3782 shape[8].x = im2; shape[8].y = im;
3783 ctxt->markerType = 3;
3784 } else if (markerstyle == 40) {
3785 // four open triangles X
3786 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3787 shape.resize(13);
3788 shape[0].x = 0; shape[0].y = 0;
3789 shape[1].x = im2; shape[1].y = im;
3790 shape[2].x = im; shape[2].y = im2;
3791 shape[3].x = 0; shape[3].y = 0;
3792 shape[4].x = im; shape[4].y = -im2;
3793 shape[5].x = im2; shape[5].y = -im;
3794 shape[6].x = 0; shape[6].y = 0;
3795 shape[7].x = -im2; shape[7].y = -im;
3796 shape[8].x = -im; shape[8].y = -im2;
3797 shape[9].x = 0; shape[9].y = 0;
3798 shape[10].x = -im; shape[10].y = im2;
3799 shape[11].x = -im2; shape[11].y = im;
3800 shape[12].x = 0; shape[12].y = 0;
3801 ctxt->markerType = 2;
3802 } else if (markerstyle == 41) {
3803 // four filled triangles X
3804 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3805 shape.resize(13);
3806 shape[0].x = 0; shape[0].y = 0;
3807 shape[1].x = im2; shape[1].y = im;
3808 shape[2].x = im; shape[2].y = im2;
3809 shape[3].x = 0; shape[3].y = 0;
3810 shape[4].x = im; shape[4].y = -im2;
3811 shape[5].x = im2; shape[5].y = -im;
3812 shape[6].x = 0; shape[6].y = 0;
3813 shape[7].x = -im2; shape[7].y = -im;
3814 shape[8].x = -im; shape[8].y = -im2;
3815 shape[9].x = 0; shape[9].y = 0;
3816 shape[10].x = -im; shape[10].y = im2;
3817 shape[11].x = -im2; shape[11].y = im;
3818 shape[12].x = 0; shape[12].y = 0;
3819 ctxt->markerType = 3;
3820 } else if (markerstyle == 42) {
3821 // open double diamonds
3823 shape.resize(9);
3824 shape[0].x= 0; shape[0].y= im;
3825 shape[1].x= -imx; shape[1].y= imx;
3826 shape[2].x = -im; shape[2].y = 0;
3827 shape[3].x = -imx; shape[3].y = -imx;
3828 shape[4].x = 0; shape[4].y = -im;
3829 shape[5].x = imx; shape[5].y = -imx;
3830 shape[6].x = im; shape[6].y = 0;
3831 shape[7].x= imx; shape[7].y= imx;
3832 shape[8].x= 0; shape[8].y= im;
3833 ctxt->markerType = 2;
3834 } else if (markerstyle == 43) {
3835 // filled double diamonds
3837 shape.resize(9);
3838 shape[0].x = 0; shape[0].y = im;
3839 shape[1].x = -imx; shape[1].y = imx;
3840 shape[2].x = -im; shape[2].y = 0;
3841 shape[3].x = -imx; shape[3].y = -imx;
3842 shape[4].x = 0; shape[4].y = -im;
3843 shape[5].x = imx; shape[5].y = -imx;
3844 shape[6].x = im; shape[6].y = 0;
3845 shape[7].x = imx; shape[7].y = imx;
3846 shape[8].x = 0; shape[8].y = im;
3847 ctxt->markerType = 3;
3848 } else if (markerstyle == 44) {
3849 // open four triangles plus
3850 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3851 shape.resize(11);
3852 shape[0].x = 0; shape[0].y = 0;
3853 shape[1].x = im2; shape[1].y = im;
3854 shape[2].x = -im2; shape[2].y = im;
3855 shape[3].x = im2; shape[3].y = -im;
3856 shape[4].x = -im2; shape[4].y = -im;
3857 shape[5].x = 0; shape[5].y = 0;
3858 shape[6].x = im; shape[6].y = im2;
3859 shape[7].x = im; shape[7].y = -im2;
3860 shape[8].x = -im; shape[8].y = im2;
3861 shape[9].x = -im; shape[9].y = -im2;
3862 shape[10].x = 0; shape[10].y = 0;
3863 ctxt->markerType = 2;
3864 } else if (markerstyle == 45) {
3865 // filled four triangles plus
3866 Int_t im0 = Int_t(0.4*markerSizeReduced + 0.5);
3867 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3868 shape.resize(13);
3869 shape[0].x = im0; shape[0].y = im0;
3870 shape[1].x = im2; shape[1].y = im;
3871 shape[2].x = -im2; shape[2].y = im;
3872 shape[3].x = -im0; shape[3].y = im0;
3873 shape[4].x = -im; shape[4].y = im2;
3874 shape[5].x = -im; shape[5].y = -im2;
3875 shape[6].x = -im0; shape[6].y = -im0;
3876 shape[7].x = -im2; shape[7].y = -im;
3877 shape[8].x = im2; shape[8].y = -im;
3878 shape[9].x = im0; shape[9].y = -im0;
3879 shape[10].x = im; shape[10].y = -im2;
3880 shape[11].x = im; shape[11].y = im2;
3881 shape[12].x = im0; shape[12].y = im0;
3882 ctxt->markerType = 3;
3883 } else if (markerstyle == 46) {
3884 // open four triangles X
3885 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3886 shape.resize(13);
3887 shape[0].x = 0; shape[0].y = im2;
3888 shape[1].x = -im2; shape[1].y = im;
3889 shape[2].x = -im; shape[2].y = im2;
3890 shape[3].x = -im2; shape[3].y = 0;
3891 shape[4].x = -im; shape[4].y = -im2;
3892 shape[5].x = -im2; shape[5].y = -im;
3893 shape[6].x = 0; shape[6].y = -im2;
3894 shape[7].x = im2; shape[7].y = -im;
3895 shape[8].x = im; shape[8].y = -im2;
3896 shape[9].x = im2; shape[9].y = 0;
3897 shape[10].x = im; shape[10].y = im2;
3898 shape[11].x = im2; shape[11].y = im;
3899 shape[12].x = 0; shape[12].y = im2;
3900 ctxt->markerType = 2;
3901 } else if (markerstyle == 47) {
3902 // filled four triangles X
3903 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3904 shape.resize(13);
3905 shape[0].x = 0; shape[0].y = im2;
3906 shape[1].x = -im2; shape[1].y = im;
3907 shape[2].x = -im; shape[2].y = im2;
3908 shape[3].x = -im2; shape[3].y = 0;
3909 shape[4].x = -im; shape[4].y = -im2;
3910 shape[5].x = -im2; shape[5].y = -im;
3911 shape[6].x = 0; shape[6].y = -im2;
3912 shape[7].x = im2; shape[7].y = -im;
3913 shape[8].x = im; shape[8].y = -im2;
3914 shape[9].x = im2; shape[9].y = 0;
3915 shape[10].x = im; shape[10].y = im2;
3916 shape[11].x = im2; shape[11].y = im;
3917 shape[12].x = 0; shape[12].y = im2;
3918 ctxt->markerType = 3;
3919 } else if (markerstyle == 48) {
3920 // four filled squares X
3921 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3922 shape.resize(17);
3923 shape[0].x = 0; shape[0].y = im2*1.005;
3924 shape[1].x = -im2; shape[1].y = im;
3925 shape[2].x = -im; shape[2].y = im2;
3926 shape[3].x = -im2; shape[3].y = 0;
3927 shape[4].x = -im; shape[4].y = -im2;
3928 shape[5].x = -im2; shape[5].y = -im;
3929 shape[6].x = 0; shape[6].y = -im2;
3930 shape[7].x = im2; shape[7].y = -im;
3931 shape[8].x = im; shape[8].y = -im2;
3932 shape[9].x = im2; shape[9].y = 0;
3933 shape[10].x = im; shape[10].y = im2;
3934 shape[11].x = im2; shape[11].y = im;
3935 shape[12].x = 0; shape[12].y = im2*0.995;
3936 shape[13].x = im2*0.995; shape[13].y = 0;
3937 shape[14].x = 0; shape[14].y = -im2*0.995;
3938 shape[15].x = -im2*0.995; shape[15].y = 0;
3939 shape[16].x = 0; shape[16].y = im2*0.995;
3940 ctxt->markerType = 3;
3941 } else if (markerstyle == 49) {
3942 // four filled squares plus
3943 Int_t imx = Int_t(1.33*markerSizeReduced + 0.5);
3944 shape.resize(17);
3945 shape[0].x =-imx; shape[0].y =-imx*1.005;
3946 shape[1].x =-imx; shape[1].y = -im;
3947 shape[2].x = imx; shape[2].y = -im;
3948 shape[3].x = imx; shape[3].y =-imx;
3949 shape[4].x = im; shape[4].y =-imx;
3950 shape[5].x = im; shape[5].y = imx;
3951 shape[6].x = imx; shape[6].y = imx;
3952 shape[7].x = imx; shape[7].y = im;
3953 shape[8].x =-imx; shape[8].y = im;
3954 shape[9].x =-imx; shape[9].y = imx;
3955 shape[10].x = -im; shape[10].y = imx;
3956 shape[11].x = -im; shape[11].y =-imx;
3957 shape[12].x =-imx; shape[12].y =-imx*0.995;
3958 shape[13].x =-imx; shape[13].y = imx;
3959 shape[14].x = imx; shape[14].y = imx;
3960 shape[15].x = imx; shape[15].y =-imx;
3961 shape[16].x =-imx; shape[16].y =-imx*1.005;
3962 ctxt->markerType = 3;
3963 } else {
3964 // single dot
3965 shape.resize(0);
3966 ctxt->markerType = 0;
3967 ctxt->markerSize = 0;
3968 }
3969}
3970
3971////////////////////////////////////////////////////////////////////////////////
3972/// Set text attributes for speicfied window
3973
3975{
3976 auto ctxt = (XWindow_t *) wctxt;
3977 if (!ctxt)
3978 return;
3979
3980 Int_t txalh = att.GetTextAlign() / 10;
3981 Int_t txalv = att.GetTextAlign() % 10;
3982
3983 ctxt->textAlign = kAlignNone;
3984
3985 switch (txalh) {
3986 case 0 :
3987 case 1 :
3988 switch (txalv) { //left
3989 case 1 :
3990 ctxt->textAlign = kBLeft; //bottom
3991 break;
3992 case 2 :
3993 ctxt->textAlign = kMLeft; //middle
3994 break;
3995 case 3 :
3996 ctxt->textAlign = kTLeft; //top
3997 break;
3998 }
3999 break;
4000 case 2 :
4001 switch (txalv) { //center
4002 case 1 :
4003 ctxt->textAlign = kBCenter; //bottom
4004 break;
4005 case 2 :
4006 ctxt->textAlign = kMCenter; //middle
4007 break;
4008 case 3 :
4009 ctxt->textAlign = kTCenter; //top
4010 break;
4011 }
4012 break;
4013 case 3 :
4014 switch (txalv) { //right
4015 case 1 :
4016 ctxt->textAlign = kBRight; //bottom
4017 break;
4018 case 2 :
4019 ctxt->textAlign = kMRight; //center
4020 break;
4021 case 3 :
4022 ctxt->textAlign = kTRight; //top
4023 break;
4024 }
4025 break;
4026 }
4027
4028 SetColor(ctxt, ctxt->fGClist[kGCtext], att.GetTextColor());
4029
4030 GdkGCValues values;
4031 gdk_gc_get_values(ctxt->fGClist[kGCtext], &values);
4032 gdk_gc_set_foreground(ctxt->fGClist[kGCinvt], &values.background);
4033 gdk_gc_set_background(ctxt->fGClist[kGCinvt], &values.foreground);
4034 gdk_gc_set_background(ctxt->fGClist[kGCtext], (GdkColor *) & GetColor(0).color);
4035
4036 TTF::SetTextFont(att.GetTextFont());
4037 TTF::SetTextSize(att.GetTextSize());
4038
4039 ctxt->fAttText = att;
4040}
4041
4042
4043////////////////////////////////////////////////////////////////////////////////
4044/// Set opacity of a current window. This image manipulation routine works
4045/// by adding to a percent amount of neutral to each pixels RGB.
4046/// Since it requires quite some additional color map entries is it
4047/// only supported on displays with more than > 8 color planes (> 256
4048/// colors)
4049
4054
4055////////////////////////////////////////////////////////////////////////////////
4056/// Set color intensities for given color index.
4057/// cindex : color index
4058/// r,g,b : red, green, blue intensities between 0.0 and 1.0
4059
4060void TGWin32::SetRGB(int cindex, float r, float g, float b)
4061{
4062 GdkColor xcol;
4063
4064 if (fColormap && cindex >= 0) {
4065 xcol.red = (unsigned short) (r * kBIGGEST_RGB_VALUE);
4066 xcol.green = (unsigned short) (g * kBIGGEST_RGB_VALUE);
4067 xcol.blue = (unsigned short) (b * kBIGGEST_RGB_VALUE);
4068 xcol.pixel = RGB(xcol.red, xcol.green, xcol.blue);
4069
4070 XColor_t &col = GetColor(cindex);
4071 if (col.fDefined) {
4072 // if color is already defined with same rgb just return
4073 if (col.color.red == xcol.red && col.color.green == xcol.green &&
4074 col.color.blue == xcol.blue)
4075 return;
4076 col.fDefined = kFALSE;
4078 (GdkColor *)&col, 1);
4079 }
4080
4082 if (ret != 0) {
4083 col.fDefined = kTRUE;
4084 col.color.pixel = xcol.pixel;
4085 col.color.red = xcol.red;
4086 col.color.green = xcol.green;
4087 col.color.blue = xcol.blue;
4088 }
4089 }
4090}
4091
4092////////////////////////////////////////////////////////////////////////////////
4093/// Set text alignment.
4094/// txalh : horizontal text alignment
4095/// txalv : vertical text alignment
4096
4098{
4100
4101 TAttText arg(gCws->fAttText);
4102 arg.SetTextAlign(talign);
4103
4105}
4106
4107////////////////////////////////////////////////////////////////////////////////
4108/// Set color index for text.
4109
4111{
4112 if (cindex < 0) return;
4113
4115
4116 TAttText arg(gCws->fAttText);
4117 arg.SetTextColor(cindex);
4118
4120}
4121
4122////////////////////////////////////////////////////////////////////////////////
4123
4124void TGWin32::Sync(int /* mode */)
4125{
4126}
4127
4128////////////////////////////////////////////////////////////////////////////////
4129/// Update display.
4130/// mode : (1) update
4131/// (0) sync
4132///
4133/// Synchronise client and server once (not permanent).
4134/// Copy the pixmap gCws->drawing on the window gCws->window
4135/// if the double buffer is on.
4136
4141
4142////////////////////////////////////////////////////////////////////////////////
4143/// Update current window
4144/// mode : (1) update
4145/// (0) sync
4146///
4147/// Synchronise client and server once (not permanent).
4148/// Copy the pixmap ctxt->drawing on the window ctxt->window
4149/// if the double buffer is on.
4150
4152{
4153 auto ctxt = (XWindow_t *) wctxt;
4154
4155 if (ctxt && ctxt->double_buffer) {
4156 gdk_window_copy_area(ctxt->window, ctxt->fGClist[kGCpxmp], 0, 0,
4157 ctxt->drawing, 0, 0, ctxt->width, ctxt->height);
4158 }
4159 Update(mode);
4160}
4161
4162////////////////////////////////////////////////////////////////////////////////
4163/// Set opacity of a specified window. This image manipulation routine works
4164/// by adding to a percent amount of neutral to each pixels RGB.
4165/// Since it requires quite some additional color map entries is it
4166/// only supported on displays with more than > 8 color planes (> 256
4167/// colors)
4168
4170{
4172
4173 if ((depth <= 8) || (percent <= 0)) return;
4174 if (percent > 100) percent = 100;
4175
4176 auto ctxt = (XWindow_t *) wctxt;
4177
4178 // get pixmap from server as image
4179 GdkImage *image = gdk_image_get((GdkDrawable*)ctxt->drawing, 0, 0,
4180 ctxt->width, ctxt->height);
4181
4182 if (!image) return;
4183
4184 std::vector<ULong_t> orgcolors;
4185
4186 // collect different image colors
4187 for (UInt_t y = 0; y < ctxt->height; y++) {
4188 for (UInt_t x = 0; x < ctxt->width; x++) {
4190 if (std::find(orgcolors.begin(), orgcolors.end(), pixel) == orgcolors.end())
4191 orgcolors.emplace_back(pixel);
4192 }
4193 }
4194 if (orgcolors.empty()) {
4196 return;
4197 }
4198
4199 if (!ctxt->new_colors.empty()) {
4200 gdk_colors_free((GdkColormap *)fColormap, ctxt->new_colors.data(), ctxt->new_colors.size(), 0);
4201 ctxt->new_colors.clear();
4202 }
4203
4204 std::vector<GdkColor> xcol(orgcolors.size());
4205
4206 for (std::size_t i = 0; i < orgcolors.size(); i++) {
4207 xcol[i].pixel = orgcolors[i];
4208 xcol[i].red = xcol[i].green = xcol[i].blue = 0;
4209 }
4210
4212 gdk_color_context_query_colors(cc, xcol.data(), orgcolors.size());
4214
4215 // create new colors mixing: "100-percent" of old color and "percent" of new background color
4216 XColor_t &bkgr = GetColor(ctxt->fAttFill.GetFillColor());
4217
4218 for (std::size_t i = 0; i < orgcolors.size(); i++) {
4219 xcol[i].red = (UShort_t) TMath::Min((Int_t) xcol[i].red * (100 - percent) / 100 + bkgr.color.red * percent / 100, kBIGGEST_RGB_VALUE);
4220 xcol[i].green = (UShort_t) TMath::Min((Int_t) xcol[i].green * (100 - percent) / 100 + bkgr.color.green * percent / 100, kBIGGEST_RGB_VALUE);
4221 xcol[i].blue = (UShort_t) TMath::Min((Int_t) xcol[i].blue * (100 - percent) / 100 + bkgr.color.blue * percent / 100, kBIGGEST_RGB_VALUE);
4222
4224
4225 if (!ret) {
4226 Warning("SetOpacityW",
4227 "failed to allocate color %hd, %hd, %hd", xcol[i].red,
4228 xcol[i].green, xcol[i].blue);
4229 // assumes that in case of failure xcol[i].pixel is not changed
4230 }
4231 }
4232
4233 ctxt->new_colors.resize(orgcolors.size());
4234
4235 for (std::size_t i = 0; i < orgcolors.size(); i++)
4236 ctxt->new_colors[i] = xcol[i].pixel;
4237
4238 // put opaque colors in image
4239 for (UInt_t y = 0; y < ctxt->height; y++) {
4240 for (UInt_t x = 0; x < ctxt->width; x++) {
4242 auto iter = std::find(orgcolors.begin(), orgcolors.end(), pixel);
4243 if (iter != orgcolors.end()) {
4244 auto idx = iter - orgcolors.begin();
4245 PutPixel((Drawable_t)image, x, y, ctxt->new_colors[idx]);
4246 }
4247 }
4248 }
4249
4250 // put image back in pixmap on server
4251 gdk_draw_image(ctxt->drawing, ctxt->fGClist[kGCpxmp], (GdkImage *)image,
4252 0, 0, 0, 0, ctxt->width, ctxt->height);
4253 GdiFlush();
4254
4255 // clean up
4257}
4258
4259////////////////////////////////////////////////////////////////////////////////
4260/// Copy the pixmap wid at the position xpos, ypos in the specified window.
4261
4263{
4264 if (fWindows.count(wid) == 0)
4265 return;
4266
4267 auto ctxt = (XWindow_t *) wctxt;
4268
4269 gTws = fWindows[wid].get();
4270 gdk_window_copy_area(ctxt->drawing, gTws->fGClist[kGCpxmp], xpos, ypos, gTws->drawing,
4271 0, 0, gTws->width, gTws->height);
4272 GdiFlush();
4273}
4274
4275
4276////////////////////////////////////////////////////////////////////////////////
4277/// Set pointer position.
4278/// ix : New X coordinate of pointer
4279/// iy : New Y coordinate of pointer
4280/// Coordinates are relative to the origin of the window id
4281/// or to the origin of the current window if id == 0.
4282
4283void TGWin32::Warp(int ix, int iy, Window_t id)
4284{
4285 if (!id) return;
4286
4287 POINT cpt, tmp;
4288 HWND dw;
4289 if (!id)
4290 dw = (HWND) GDK_DRAWABLE_XID((GdkWindow *)gCws->window);
4291 else
4293 GetCursorPos(&cpt);
4294 tmp.x = ix > 0 ? ix : cpt.x;
4295 tmp.y = iy > 0 ? iy : cpt.y;
4297 SetCursorPos(tmp.x, tmp.y);
4298}
4299
4300////////////////////////////////////////////////////////////////////////////////
4301/// Write the pixmap wid in the bitmap file pxname.
4302/// wid : Pixmap address
4303/// w,h : Width and height of the pixmap.
4304/// lenname : pixmap name length
4305/// pxname : pixmap name
4306
4307void TGWin32::WritePixmap(int wid, unsigned int w, unsigned int h,
4308 char *pxname)
4309{
4310 int wval, hval;
4311 wval = w;
4312 hval = h;
4313
4314 if (fWindows.count(wid) == 0) return;
4315 gTws = fWindows[wid].get();
4316// XWriteBitmapFile(fDisplay,pxname,(Pixmap)gTws->drawing,wval,hval,-1,-1);
4317}
4318
4320 private:
4321 GdkImage *fImage = nullptr;
4322 protected:
4323 void get_scline(int y, int width, unsigned char *buf) override
4324 {
4325 for (int x = 0; x < width; x++) {
4327 buf[x] = 0;
4328
4329 auto iter = std::find(orgcolors.begin(), orgcolors.end(), pixel);
4330 if (iter != orgcolors.end()) {
4331 auto idx = iter - orgcolors.begin();
4332 if (idx < 256)
4333 buf[x] = (unsigned char) idx;
4334 }
4335 }
4336 }
4337 public:
4338 std::vector<ULong_t> orgcolors;
4339
4341};
4342
4343
4344////////////////////////////////////////////////////////////////////////////////
4345/// Writes the current window into GIF file.
4346
4348{
4349 return WriteGIFW((WinContext_t)gCws, name);
4350}
4351
4352////////////////////////////////////////////////////////////////////////////////
4353/// Writes the specified window into GIF file.
4354
4356{
4357 auto ctxt = (XWindow_t *) wctxt;
4358 if (!ctxt)
4359 return 0;
4360
4361 GdkImage *image = gdk_image_get((GdkDrawable*)ctxt->drawing, 0, 0,
4362 ctxt->width, ctxt->height);
4363 if (!image) {
4364 Error("WriteGIFW", "Cannot create image for writing GIF. Try in batch mode.");
4365 return 0;
4366 }
4367
4369
4370 /// Collect R G B of colors of the palette used by the image.
4371 /// The image pixels are changed to index values in these R G B arrays.
4372 /// This produces a colormap with only the used colors (so even on displays
4373 /// with more than 8 planes we will be able to create GIF's when the image
4374 /// contains no more than 256 different colors). If it does contain more
4375 /// colors we will have to use GIFquantize to reduce the number of colors.
4376
4377 // collect different image colors
4378 for (UInt_t x = 0; x < ctxt->width; x++) {
4379 for (UInt_t y = 0; y < ctxt->height; y++) {
4381 if (std::find(gif.orgcolors.begin(), gif.orgcolors.end(), pixel) == gif.orgcolors.end())
4382 gif.orgcolors.emplace_back(pixel);
4383 }
4384 }
4385
4386 auto ncolors = gif.orgcolors.size();
4387
4388 if (ncolors > 256) {
4389 Error("WriteGIFW", "can not create GIF of image containing more than 256 colors");
4391 return 0;
4392 }
4393
4394 // get RGB values belonging to pixels
4395 std::vector<GdkColor> xcol(ncolors);
4396
4397 for (std::size_t i = 0; i < ncolors; i++) {
4398 xcol[i].pixel = gif.orgcolors[i];
4399 xcol[i].red = GetRValue(xcol[i].pixel);
4400 xcol[i].green = GetGValue(xcol[i].pixel);
4401 xcol[i].blue = GetBValue(xcol[i].pixel);
4402 }
4403
4407
4408 UShort_t maxcol = 0;
4409 for (std::size_t i = 0; i < ncolors; i++) {
4413 }
4414 if (maxcol == 0)
4415 maxcol = 255;
4416
4417 std::vector<unsigned char> r(ncolors), b(ncolors), g(ncolors);
4418
4419 for (std::size_t i = 0; i < ncolors; i++) {
4420 r[i] = (unsigned char) (xcol[i].red * 255 / maxcol);
4421 g[i] = (unsigned char) (xcol[i].green * 255 / maxcol);
4422 b[i] = (unsigned char) (xcol[i].blue * 255 / maxcol);
4423 }
4424
4425 Int_t ret = 0;
4426
4427 if (gif.OpenFile(name, "wb")) {
4428 auto len = gif.GIFencode(ctxt->width, ctxt->height, ncolors, r.data(), g.data(), b.data());
4429 if (len > 0)
4430 ret = 1;
4431 gif.CloseFile();
4432 } else {
4433 Error("WriteGIFW", "cannot write file: %s",name);
4434 }
4436
4437 return ret;
4438}
4439
4440////////////////////////////////////////////////////////////////////////////////
4441/// Draw image.
4442
4446{
4447 const int MAX_SEGMENT = 20;
4448 int i, n, x, y, xcur, x1, x2, y1, y2;
4449 unsigned char *jimg, *jbase, icol;
4450 int nlines[256];
4452 GdkDrawable *id;
4453 GdkGC *lineGC;
4454
4455 if (wid) {
4456 id = (GdkDrawable*) wid;
4458 } else {
4459 id = gCws->drawing;
4460 lineGC = gCws->fGClist[kGCline];
4461 }
4462
4463 for (i = 0; i < 256; i++) nlines[i] = 0;
4464
4465 x1 = x0 + xmin;
4466 y1 = y0 + ny - ymax - 1;
4467 x2 = x0 + xmax;
4468 y2 = y0 + ny - ymin - 1;
4469 jbase = image + (ymin - 1) * nx + xmin;
4470
4471 for (y = y2; y >= y1; y--) {
4472 xcur = x1;
4473 jbase += nx;
4474 for (jimg = jbase, icol = *jimg++, x = x1 + 1; x <= x2; jimg++, x++) {
4475 if (icol != *jimg) {
4476 if (icol != itran) {
4477 n = nlines[icol]++;
4478 lines[icol][n].x1 = xcur;
4479 lines[icol][n].y1 = y;
4480 lines[icol][n].x2 = x - 1;
4481 lines[icol][n].y2 = y;
4482 if (nlines[icol] == MAX_SEGMENT) {
4483 SetColor(wid ? nullptr : gCws, lineGC, (int) icol + offset);
4485 (GdkSegment *) &lines[icol][0], MAX_SEGMENT);
4486 nlines[icol] = 0;
4487 }
4488 }
4489 icol = *jimg;
4490 xcur = x;
4491 }
4492 }
4493 if (icol != itran) {
4494 n = nlines[icol]++;
4495 lines[icol][n].x1 = xcur;
4496 lines[icol][n].y1 = y;
4497 lines[icol][n].x2 = x - 1;
4498 lines[icol][n].y2 = y;
4499 if (nlines[icol] == MAX_SEGMENT) {
4500 SetColor(wid ? nullptr : gCws, lineGC, (int) icol + offset);
4502 (GdkSegment *)&lines[icol][0], MAX_SEGMENT);
4503 nlines[icol] = 0;
4504 }
4505 }
4506 }
4507
4508 for (i = 0; i < 256; i++) {
4509 if (nlines[i] != 0) {
4510 SetColor(wid ? nullptr : gCws, lineGC, i + offset);
4512 (GdkSegment *)&lines[icol][0], nlines[i]);
4513 }
4514 }
4515
4516 if (wid)
4518
4519}
4520
4521////////////////////////////////////////////////////////////////////////////////
4522/// If id is NULL - loads the specified gif file at position [x0,y0] in the
4523/// current window. Otherwise creates pixmap from gif file
4524
4525Pixmap_t TGWin32::ReadGIF(int x0, int y0, const char *file, Window_t id)
4526{
4528 unsigned char *GIFarr, *PIXarr, R[256], G[256], B[256], *j1, *j2, icol;
4529 int i, j, k, width, height, ncolor, irep, offset;
4530 float rr, gg, bb;
4531 Pixmap_t pic = 0;
4532
4533 FILE *fd = fopen(file, "r+b");
4534 if (!fd) {
4535 Error("ReadGIF", "unable to open GIF file");
4536 return pic;
4537 }
4538
4539 fseek(fd, 0L, 2);
4540 filesize = Seek_t(ftell(fd));
4541 fseek(fd, 0L, 0);
4542
4543 if (!(GIFarr = (unsigned char *) calloc(filesize + 256, 1))) {
4544 fclose(fd);
4545 Error("ReadGIF", "unable to allocate array for gif");
4546 return pic;
4547 }
4548
4549 if (fread(GIFarr, filesize, 1, fd) != 1) {
4550 fclose(fd);
4551 Error("ReadGIF", "GIF file read failed");
4552 free(GIFarr);
4553 return pic;
4554 }
4555 fclose(fd);
4556
4557 irep = TGifDecode::GIFinfo(GIFarr, &width, &height, &ncolor);
4558 if (irep != 0) {
4559 return pic;
4560 }
4561
4562 if (!(PIXarr = (unsigned char *) calloc((width * height), 1))) {
4563 Error("ReadGIF", "unable to allocate array for image");
4564 return pic;
4565 }
4566
4568
4569 irep = gif.GIFdecode(GIFarr, PIXarr, &width, &height, &ncolor, R, G, B);
4570 if (irep != 0) {
4571 return pic;
4572 }
4573 // S E T P A L E T T E
4574
4575 offset = 8;
4576
4577 for (i = 0; i < ncolor; i++) {
4578 rr = R[i] / 255.;
4579 gg = G[i] / 255.;
4580 bb = B[i] / 255.;
4581 j = i + offset;
4582 SetRGB(j, rr, gg, bb);
4583 }
4584
4585 // O U T P U T I M A G E
4586
4587 for (i = 1; i <= height / 2; i++) {
4588 j1 = PIXarr + (i - 1) * width;
4589 j2 = PIXarr + (height - i) * width;
4590 for (k = 0; k < width; k++) {
4591 icol = *j1;
4592 *j1++ = *j2;
4593 *j2++ = icol;
4594 }
4595 }
4596
4597 if (id)
4598 pic = CreatePixmap(id, width, height);
4599 PutImage(offset, -1, x0, y0, width, height, 0, 0, width-1, height-1, PIXarr, pic);
4600
4601 if (pic)
4602 return pic;
4603 if (gCws->drawing)
4604 return (Pixmap_t)gCws->drawing;
4605 return 0;
4606}
4607
4608//////////////////////////// GWin32Gui //////////////////////////////////////////
4609////////////////////////////////////////////////////////////////////////////////
4610/// Map window on screen.
4611
4613{
4614 if (!id) return;
4615
4618 (GetParent(id) == GetDefaultRootWindow())) {
4619 HWND window = (HWND)GDK_DRAWABLE_XID((GdkWindow *)id);
4620 ::SetForegroundWindow(window);
4621 }
4622}
4623
4624////////////////////////////////////////////////////////////////////////////////
4625///
4626
4628{
4629 if (!id) return;
4630
4633}
4634
4635////////////////////////////////////////////////////////////////////////////////
4636/// Map window on screen and put on top of all windows.
4637
4639{
4640 if (!id) return;
4641
4643 HWND window = (HWND)GDK_DRAWABLE_XID((GdkWindow *)id);
4646 ::BringWindowToTop(window);
4648 ::SetForegroundWindow(window);
4649 }
4650
4651 if (gConsoleWindow && (hwnd == (HWND)gConsoleWindow)) {
4652 RECT r1, r2, r3;
4656 if (!::IntersectRect(&r3, &r2, &r1)) {
4658 }
4659 }
4660}
4661
4662////////////////////////////////////////////////////////////////////////////////
4663/// Unmap window from screen.
4664
4666{
4667 if (!id) return;
4668
4669 gdk_window_hide((GdkWindow *) id);
4670}
4671
4672////////////////////////////////////////////////////////////////////////////////
4673/// Destroy window.
4674
4676{
4677 if (!id) return;
4678
4679 // we need to unmap the window before to destroy it, in order to properly
4680 // receive kUnmapNotify needed by gClient->WaitForUnmap()...
4681 gdk_window_hide((GdkWindow *) id);
4683}
4684
4685////////////////////////////////////////////////////////////////////////////////
4686/// Destroy all internal subwindows
4687
4689{
4690 if (!id) return;
4691
4693}
4694
4695////////////////////////////////////////////////////////////////////////////////
4696/// Put window on top of window stack.
4697
4699{
4700 if (!id) return;
4701
4702 HWND window = (HWND)GDK_DRAWABLE_XID((GdkWindow *)id);
4704 ::SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0,
4706 }
4707 else {
4708 ::BringWindowToTop(window);
4710 ::SetForegroundWindow(window);
4711 }
4712}
4713
4714////////////////////////////////////////////////////////////////////////////////
4715/// Lower window so it lays below all its siblings.
4716
4718{
4719 if (!id) return;
4720
4721 HWND window = (HWND)GDK_DRAWABLE_XID((GdkWindow *)id);
4722 ::SetWindowPos(window, HWND_BOTTOM, 0, 0, 0, 0,
4724}
4725
4726////////////////////////////////////////////////////////////////////////////////
4727/// Move a window.
4728
4730{
4731 if (!id) return;
4732
4733 // prevent hiding the titlebar
4734 if (x == 0 && y == 0) {
4735 x = 1; y = 1;
4736 }
4737 gdk_window_move((GdkDrawable *) id, x, y);
4738}
4739
4740////////////////////////////////////////////////////////////////////////////////
4741/// Move and resize a window.
4742
4744 UInt_t h)
4745{
4746 if (!id) return;
4747
4748 // prevent hiding the titlebar
4749 if (x == 0 && y == 0) {
4750 x = 1; y = 1;
4751 }
4752 gdk_window_move_resize((GdkWindow *) id, x, y, w, h);
4753}
4754
4755////////////////////////////////////////////////////////////////////////////////
4756/// Resize the window.
4757
4759{
4760 if (!id) return;
4761
4762 // protect against potential negative values
4763 if (w >= (UInt_t)INT_MAX || h >= (UInt_t)INT_MAX)
4764 return;
4765 gdk_window_resize((GdkWindow *) id, w, h);
4766}
4767
4768////////////////////////////////////////////////////////////////////////////////
4769/// Iconify the window.
4770
4772{
4773 if (!id) return;
4774
4777}
4778
4779////////////////////////////////////////////////////////////////////////////////
4780/// Reparent window, make pid the new parent and position the window at
4781/// position (x,y) in new parent.
4782
4784{
4785 if (!id) return;
4786
4787 gdk_window_reparent((GdkWindow *)id, (GdkWindow *)pid, x, y);
4788}
4789
4790////////////////////////////////////////////////////////////////////////////////
4791/// Set the window background color.
4792
4794{
4795 if (!id) return;
4796
4797 GdkColor back;
4798 back.pixel = color;
4799 back.red = GetRValue(color);
4800 back.green = GetGValue(color);
4801 back.blue = GetBValue(color);
4802
4803 gdk_window_set_background((GdkWindow *) id, &back);
4804}
4805
4806////////////////////////////////////////////////////////////////////////////////
4807/// Set pixmap as window background.
4808
4810{
4811 if (!id) return;
4812
4814}
4815
4816////////////////////////////////////////////////////////////////////////////////
4817/// Return handle to newly created gdk window.
4818
4820 UInt_t w, UInt_t h, UInt_t border,
4823 UInt_t wtype)
4824{
4827 GdkColor background_color;
4828 ULong_t xmask = 0;
4829
4830 if (attr) {
4832 xattr.window_type = GDK_WINDOW_CHILD;
4833 if (wtype & kMainFrame) {
4834 xattr.window_type = GDK_WINDOW_TOPLEVEL;
4835 }
4836 if (wtype & kTransientFrame) {
4837 xattr.window_type = GDK_WINDOW_DIALOG;
4838 }
4839 if (wtype & kTempFrame) {
4840 xattr.window_type = GDK_WINDOW_TEMP;
4841 }
4842 newWin = gdk_window_new((GdkWindow *) parent, &xattr, xmask);
4843 } else {
4844 xattr.width = w;
4845 xattr.height = h;
4846 xattr.wclass = GDK_INPUT_OUTPUT;
4847 xattr.event_mask = 0L; //GDK_ALL_EVENTS_MASK;
4850// GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK;
4851 if (x >= 0) {
4852 xattr.x = x;
4853 } else {
4854 xattr.x = -1.0 * x;
4855 }
4856 if (y >= 0) {
4857 xattr.y = y;
4858 } else {
4859 xattr.y = -1.0 * y;
4860 }
4861 xattr.colormap = gdk_colormap_get_system();
4862 xattr.cursor = NULL;
4863 xattr.override_redirect = TRUE;
4864 if ((xattr.y > 0) && (xattr.x > 0)) {
4867 } else {
4869 }
4870 if (visual != NULL) {
4871 xattr.visual = (GdkVisual *) visual;
4873 } else {
4874 xattr.visual = gdk_visual_get_system();
4876 }
4877 xattr.window_type = GDK_WINDOW_CHILD;
4878 if (wtype & kMainFrame) {
4879 xattr.window_type = GDK_WINDOW_TOPLEVEL;
4880 }
4881 if (wtype & kTransientFrame) {
4882 xattr.window_type = GDK_WINDOW_DIALOG;
4883 }
4884 if (wtype & kTempFrame) {
4885 xattr.window_type = GDK_WINDOW_TEMP;
4886 }
4887 newWin = gdk_window_new((GdkWindow *) parent, &xattr, xmask);
4889 }
4890 if (border > 0) {
4893 }
4894 if (attr) {
4895 if ((attr->fMask & kWABackPixmap)) {
4896 if (attr->fBackgroundPixmap == kNone) {
4898 } else if (attr->fBackgroundPixmap == kParentRelative) {
4900 } else {
4902 (GdkPixmap *) attr->
4903 fBackgroundPixmap, 0);
4904 }
4905 }
4906 if ((attr->fMask & kWABackPixel)) {
4907 background_color.pixel = attr->fBackgroundPixel;
4908 background_color.red = GetRValue(attr->fBackgroundPixel);
4909 background_color.green = GetGValue(attr->fBackgroundPixel);
4910 background_color.blue = GetBValue(attr->fBackgroundPixel);
4912 }
4913 }
4914 if (!fUseSysPointers) {
4917 }
4918 return (Window_t) newWin;
4919}
4920
4921////////////////////////////////////////////////////////////////////////////////
4922/// Map event mask to or from gdk.
4923
4925{
4926 if (tox) {
4927 Long_t lxemask = 0L;
4928 if ((emask & kKeyPressMask)) {
4930 }
4931 if ((emask & kKeyReleaseMask)) {
4933 }
4934 if ((emask & kButtonPressMask)) {
4936 }
4937 if ((emask & kButtonReleaseMask)) {
4939 }
4940 if ((emask & kPointerMotionMask)) {
4942 }
4943 if ((emask & kButtonMotionMask)) {
4945 }
4946 if ((emask & kExposureMask)) {
4948 }
4949 if ((emask & kStructureNotifyMask)) {
4951 }
4952 if ((emask & kEnterWindowMask)) {
4954 }
4955 if ((emask & kLeaveWindowMask)) {
4957 }
4958 if ((emask & kFocusChangeMask)) {
4960 }
4961 xemask = (UInt_t) lxemask;
4962 } else {
4963 emask = 0;
4964 if ((xemask & GDK_KEY_PRESS_MASK)) {
4966 }
4967 if ((xemask & GDK_KEY_RELEASE_MASK)) {
4969 }
4970 if ((xemask & GDK_BUTTON_PRESS_MASK)) {
4972 }
4975 }
4978 }
4981 }
4982 if ((xemask & GDK_EXPOSURE_MASK)) {
4984 }
4985 if ((xemask & GDK_STRUCTURE_MASK)) {
4987 }
4988 if ((xemask & GDK_ENTER_NOTIFY_MASK)) {
4990 }
4991 if ((xemask & GDK_LEAVE_NOTIFY_MASK)) {
4993 }
4994 if ((xemask & GDK_FOCUS_CHANGE_MASK)) {
4996 }
4997 }
4998}
4999
5000////////////////////////////////////////////////////////////////////////////////
5001/// Map a SetWindowAttributes_t to a GdkWindowAttr structure.
5002
5004 ULong_t & xmask,
5006{
5007 Mask_t mask = attr->fMask;
5008 xmask = 0;
5009
5010 if ((mask & kWAOverrideRedirect)) {
5012 xattr.override_redirect = attr->fOverrideRedirect;
5013 }
5014 if ((mask & kWAEventMask)) {
5015 UInt_t xmsk, msk = (UInt_t) attr->fEventMask;
5017 xattr.event_mask = xmsk;
5018 }
5019 if ((mask & kWAColormap)) {
5021 xattr.colormap = (GdkColormap *) attr->fColormap;
5022 }
5023 if ((mask & kWACursor)) {
5025 if (attr->fCursor != kNone) {
5026 xattr.cursor = (GdkCursor *) attr->fCursor;
5027 }
5028 }
5029 xattr.wclass = GDK_INPUT_OUTPUT;
5030}
5031
5032////////////////////////////////////////////////////////////////////////////////
5033/// Map a GCValues_t to a XCGValues structure if tox is true. Map
5034/// the other way in case tox is false.
5035
5038{
5039 if (tox) {
5040 // map GCValues_t to XGCValues
5041 Mask_t mask = gval.fMask;
5042 xmask = 0;
5043
5044 if ((mask & kGCFunction)) {
5046 switch (gval.fFunction) {
5047 case kGXclear:
5048 xgval.function = GDK_CLEAR;
5049 break;
5050 case kGXand:
5051 xgval.function = GDK_AND;
5052 break;
5053 case kGXandReverse:
5054 xgval.function = GDK_AND_REVERSE;
5055 break;
5056 case kGXcopy:
5057 xgval.function = GDK_COPY;
5058 break;
5059 case kGXandInverted:
5060 xgval.function = GDK_AND_INVERT;
5061 break;
5062 case kGXnoop:
5063 xgval.function = GDK_NOOP;
5064 break;
5065 case kGXxor:
5066 xgval.function = GDK_XOR;
5067 break;
5068 case kGXor:
5069 xgval.function = GDK_OR;
5070 break;
5071 case kGXequiv:
5072 xgval.function = GDK_EQUIV;
5073 break;
5074 case kGXinvert:
5075 xgval.function = GDK_INVERT;
5076 break;
5077 case kGXorReverse:
5078 xgval.function = GDK_OR_REVERSE;
5079 break;
5080 case kGXcopyInverted:
5081 xgval.function = GDK_COPY_INVERT;
5082 break;
5083 case kGXorInverted:
5084 xgval.function = GDK_OR_INVERT;
5085 break;
5086 case kGXnand:
5087 xgval.function = GDK_NAND;
5088 break;
5089 case kGXset:
5090 xgval.function = GDK_SET;
5091 break;
5092 }
5093 }
5094 if (mask & kGCSubwindowMode) {
5096 if (gval.fSubwindowMode == kIncludeInferiors) {
5097 xgval.subwindow_mode = GDK_INCLUDE_INFERIORS;
5098 } else {
5099 xgval.subwindow_mode = GDK_CLIP_BY_CHILDREN;
5100 }
5101 }
5102 if (mask & kGCForeground) {
5104 xgval.foreground.pixel = gval.fForeground;
5105 xgval.foreground.red = GetRValue(gval.fForeground);
5106 xgval.foreground.green = GetGValue(gval.fForeground);
5107 xgval.foreground.blue = GetBValue(gval.fForeground);
5108 }
5109 if (mask & kGCBackground) {
5111 xgval.background.pixel = gval.fBackground;
5112 xgval.background.red = GetRValue(gval.fBackground);
5113 xgval.background.green = GetGValue(gval.fBackground);
5114 xgval.background.blue = GetBValue(gval.fBackground);
5115 }
5116 if (mask & kGCLineWidth) {
5118 xgval.line_width = gval.fLineWidth;
5119 }
5120 if (mask & kGCLineStyle) {
5122 xgval.line_style = (GdkLineStyle) gval.fLineStyle; // ident mapping
5123 }
5124 if (mask & kGCCapStyle) {
5126 xgval.cap_style = (GdkCapStyle) gval.fCapStyle; // ident mapping
5127 }
5128 if (mask & kGCJoinStyle) {
5130 xgval.join_style = (GdkJoinStyle) gval.fJoinStyle; // ident mapping
5131 }
5132 if ((mask & kGCFillStyle)) {
5133 xmask |= GDK_GC_FILL;
5134 xgval.fill = (GdkFill) gval.fFillStyle; // ident mapping
5135 }
5136 if ((mask & kGCTile)) {
5137 xmask |= GDK_GC_TILE;
5138 xgval.tile = (GdkPixmap *) gval.fTile;
5139 }
5140 if ((mask & kGCStipple)) {
5142 xgval.stipple = (GdkPixmap *) gval.fStipple;
5143 }
5144 if ((mask & kGCTileStipXOrigin)) {
5146 xgval.ts_x_origin = gval.fTsXOrigin;
5147 }
5148 if ((mask & kGCTileStipYOrigin)) {
5150 xgval.ts_y_origin = gval.fTsYOrigin;
5151 }
5152 if ((mask & kGCFont)) {
5153 xmask |= GDK_GC_FONT;
5154 xgval.font = (GdkFont *) gval.fFont;
5155 }
5156 if ((mask & kGCGraphicsExposures)) {
5158 xgval.graphics_exposures = gval.fGraphicsExposures;
5159 }
5160 if ((mask & kGCClipXOrigin)) {
5162 xgval.clip_x_origin = gval.fClipXOrigin;
5163 }
5164 if ((mask & kGCClipYOrigin)) {
5166 xgval.clip_y_origin = gval.fClipYOrigin;
5167 }
5168 if ((mask & kGCClipMask)) {
5170 xgval.clip_mask = (GdkPixmap *) gval.fClipMask;
5171 }
5172 } else {
5173 // map XValues to GCValues_t
5174 Mask_t mask = 0;
5175
5176 if ((xmask & GDK_GC_FUNCTION)) {
5177 mask |= kGCFunction;
5178 gval.fFunction = (EGraphicsFunction) xgval.function; // ident mapping
5179 switch (xgval.function) {
5180 case GDK_CLEAR:
5181 gval.fFunction = kGXclear;
5182 break;
5183 case GDK_AND:
5184 gval.fFunction = kGXand;
5185 break;
5186 case GDK_AND_REVERSE:
5187 gval.fFunction = kGXandReverse;
5188 break;
5189 case GDK_COPY:
5190 gval.fFunction = kGXcopy;
5191 break;
5192 case GDK_AND_INVERT:
5193 gval.fFunction = kGXandInverted;
5194 break;
5195 case GDK_NOOP:
5196 gval.fFunction = kGXnoop;
5197 break;
5198 case GDK_XOR:
5199 gval.fFunction = kGXxor;
5200 break;
5201 case GDK_OR:
5202 gval.fFunction = kGXor;
5203 break;
5204 case GDK_EQUIV:
5205 gval.fFunction = kGXequiv;
5206 break;
5207 case GDK_INVERT:
5208 gval.fFunction = kGXinvert;
5209 break;
5210 case GDK_OR_REVERSE:
5211 gval.fFunction = kGXorReverse;
5212 break;
5213 case GDK_COPY_INVERT:
5214 gval.fFunction = kGXcopyInverted;
5215 break;
5216 case GDK_OR_INVERT:
5217 gval.fFunction = kGXorInverted;
5218 break;
5219 case GDK_NAND:
5220 gval.fFunction = kGXnand;
5221 break;
5222 case GDK_SET:
5223 gval.fFunction = kGXset;
5224 break;
5225 }
5226 }
5227 if (xmask & GDK_GC_SUBWINDOW) {
5229 if (xgval.subwindow_mode == GDK_INCLUDE_INFERIORS)
5230 gval.fSubwindowMode = kIncludeInferiors;
5231 else
5232 gval.fSubwindowMode = kClipByChildren;
5233 }
5234 if ((xmask & GDK_GC_FOREGROUND)) {
5236 gval.fForeground = xgval.foreground.pixel;
5237 }
5238 if ((xmask & GDK_GC_BACKGROUND)) {
5240 gval.fBackground = xgval.background.pixel;
5241 }
5242 if ((xmask & GDK_GC_LINE_WIDTH)) {
5243 mask |= kGCLineWidth;
5244 gval.fLineWidth = xgval.line_width;
5245 }
5246 if ((xmask & GDK_GC_LINE_STYLE)) {
5247 mask |= kGCLineStyle;
5248 gval.fLineStyle = xgval.line_style; // ident mapping
5249 }
5250 if ((xmask & GDK_GC_CAP_STYLE)) {
5251 mask |= kGCCapStyle;
5252 gval.fCapStyle = xgval.cap_style; // ident mapping
5253 }
5254 if ((xmask & GDK_GC_JOIN_STYLE)) {
5255 mask |= kGCJoinStyle;
5256 gval.fJoinStyle = xgval.join_style; // ident mapping
5257 }
5258 if ((xmask & GDK_GC_FILL)) {
5259 mask |= kGCFillStyle;
5260 gval.fFillStyle = xgval.fill; // ident mapping
5261 }
5262 if ((xmask & GDK_GC_TILE)) {
5263 mask |= kGCTile;
5264 gval.fTile = (Pixmap_t) xgval.tile;
5265 }
5266 if ((xmask & GDK_GC_STIPPLE)) {
5267 mask |= kGCStipple;
5268 gval.fStipple = (Pixmap_t) xgval.stipple;
5269 }
5270 if ((xmask & GDK_GC_TS_X_ORIGIN)) {
5272 gval.fTsXOrigin = xgval.ts_x_origin;
5273 }
5274 if ((xmask & GDK_GC_TS_Y_ORIGIN)) {
5276 gval.fTsYOrigin = xgval.ts_y_origin;
5277 }
5278 if ((xmask & GDK_GC_FONT)) {
5279 mask |= kGCFont;
5280 gval.fFont = (FontH_t) xgval.font;
5281 }
5282 if ((xmask & GDK_GC_EXPOSURES)) {
5284 gval.fGraphicsExposures = (Bool_t) xgval.graphics_exposures;
5285 }
5286 if ((xmask & GDK_GC_CLIP_X_ORIGIN)) {
5288 gval.fClipXOrigin = xgval.clip_x_origin;
5289 }
5290 if ((xmask & GDK_GC_CLIP_Y_ORIGIN)) {
5292 gval.fClipYOrigin = xgval.clip_y_origin;
5293 }
5294 if ((xmask & GDK_GC_CLIP_MASK)) {
5295 mask |= kGCClipMask;
5296 gval.fClipMask = (Pixmap_t) xgval.clip_mask;
5297 }
5298 gval.fMask = mask;
5299 }
5300}
5301
5302////////////////////////////////////////////////////////////////////////////////
5303/// Get window attributes and return filled in attributes structure.
5304
5306{
5307 if (!id) return;
5308
5312
5314 &attr.fWidth, &attr.fHeight, &attr.fDepth);
5315 attr.fX = ((rcWind.right - rcWind.left) - rcClient.right) / 2;
5316 attr.fY = ((rcWind.bottom - rcWind.top) - rcClient.bottom) - attr.fX;
5317
5318 attr.fRoot = (Window_t) GDK_ROOT_PARENT();
5320 attr.fBorderWidth = 0;
5321 attr.fVisual = gdk_window_get_visual((GdkWindow *) id);
5322 attr.fClass = kInputOutput;
5323 attr.fBackingStore = kNotUseful;
5324 attr.fSaveUnder = kFALSE;
5325 attr.fMapInstalled = kTRUE;
5326 attr.fOverrideRedirect = kFALSE; // boolean value for override-redirect
5327
5328 if (!gdk_window_is_visible((GdkWindow *) id)) {
5329 attr.fMapState = kIsUnmapped;
5330 } else if (!gdk_window_is_viewable((GdkWindow *) id)) {
5331 attr.fMapState = kIsUnviewable;
5332 } else {
5333 attr.fMapState = kIsViewable;
5334 }
5335
5337 UInt_t evmask;
5339
5340 attr.fYourEventMask = evmask;
5341}
5342
5343////////////////////////////////////////////////////////////////////////////////
5344///
5345
5347{
5348 return 0;
5349}
5350
5351////////////////////////////////////////////////////////////////////////////////
5352/// Get maximum number of planes.
5353
5355{
5357}
5358
5359////////////////////////////////////////////////////////////////////////////////
5360/// Return atom handle for atom_name. If it does not exist
5361/// create it if only_if_exist is false. Atoms are used to communicate
5362/// between different programs (i.e. window manager) via the X server.
5363
5365{
5367
5368 if (a == None) return kNone;
5369 return (Atom_t) a;
5370}
5371
5372////////////////////////////////////////////////////////////////////////////////
5373/// Return handle to the default root window created when calling
5374/// XOpenDisplay().
5375
5380
5381////////////////////////////////////////////////////////////////////////////////
5382/// Return the parent of the window.
5383
5385{
5386 if (!id) return (Window_t)0;
5387
5389}
5390
5391////////////////////////////////////////////////////////////////////////////////
5392/// Load font and query font. If font is not found 0 is returned,
5393/// otherwise an opaque pointer to the FontStruct_t.
5394/// Free the loaded font using DeleteFont().
5395
5397{
5398 char family[100], weight[32], slant[32], fontname[256];
5400
5401 numfields = sscanf(font_name, "%s -%d%n", family, &pixel, &n1);
5402 if (numfields == 2) {
5403 sprintf(weight,"medium");
5404 if (strstr(font_name, "bold"))
5405 sprintf(weight,"bold");
5406 sprintf(slant,"r");
5407 if (strstr(font_name, "italic"))
5408 sprintf(slant,"i");
5409 sprintf(fontname, "-*-%s-%s-%s-*-*-%d-*-*-*-*-*-iso8859-1",
5410 family, weight, slant, pixel);
5411 }
5412 else
5413 sprintf(fontname, "%s", font_name);
5415}
5416
5417////////////////////////////////////////////////////////////////////////////////
5418/// Return handle to font described by font structure.
5419
5421{
5422 if (fs) {
5423 return (FontH_t)gdk_font_ref((GdkFont *) fs);
5424 }
5425 return 0;
5426}
5427
5428////////////////////////////////////////////////////////////////////////////////
5429/// Explicitely delete font structure obtained with LoadQueryFont().
5430
5435
5436////////////////////////////////////////////////////////////////////////////////
5437/// Create a graphics context using the values set in gval (but only for
5438/// those entries that are in the mask).
5439
5441{
5442 if (!id) return (GContext_t)0;
5443
5445 ULong_t xmask = 0;
5446
5448
5449 xgval.subwindow_mode = GDK_CLIP_BY_CHILDREN; // GDK_INCLUDE_INFERIORS;
5450
5453 return (GContext_t) gc;
5454}
5455
5456////////////////////////////////////////////////////////////////////////////////
5457/// Change entries in an existing graphics context, gc, by values from gval.
5458
5460{
5462 ULong_t xmask = 0;
5463 Mask_t mask = 0;
5464
5465 if (gval) {
5466 mask = gval->fMask;
5468 }
5469 if (mask & kGCForeground) {
5470 gdk_gc_set_foreground((GdkGC *) gc, &xgval.foreground);
5471 }
5472 if (mask & kGCBackground) {
5473 gdk_gc_set_background((GdkGC *) gc, &xgval.background);
5474 }
5475 if (mask & kGCFont) {
5476 gdk_gc_set_font((GdkGC *) gc, xgval.font);
5477 }
5478 if (mask & kGCFunction) {
5479 gdk_gc_set_function((GdkGC *) gc, xgval.function);
5480 }
5481 if (mask & kGCFillStyle) {
5482 gdk_gc_set_fill((GdkGC *) gc, xgval.fill);
5483 }
5484 if (mask & kGCTile) {
5485 gdk_gc_set_tile((GdkGC *) gc, xgval.tile);
5486 }
5487 if (mask & kGCStipple) {
5488 gdk_gc_set_stipple((GdkGC *) gc, xgval.stipple);
5489 }
5491 gdk_gc_set_ts_origin((GdkGC *) gc, xgval.ts_x_origin,
5492 xgval.ts_y_origin);
5493 }
5494 if ((mask & kGCClipXOrigin) || (mask & kGCClipYOrigin)) {
5495 gdk_gc_set_clip_origin((GdkGC *) gc, xgval.clip_x_origin,
5496 xgval.clip_y_origin);
5497 }
5498 if (mask & kGCClipMask) {
5499 gdk_gc_set_clip_mask((GdkGC *) gc, xgval.clip_mask);
5500 }
5501 if (mask & kGCGraphicsExposures) {
5502 gdk_gc_set_exposures((GdkGC *) gc, xgval.graphics_exposures);
5503 }
5504 if (mask & kGCLineWidth) {
5506 }
5507 if (mask & kGCLineStyle) {
5509 }
5510 if (mask & kGCCapStyle) {
5512 }
5513 if (mask & kGCJoinStyle) {
5515 }
5516 if (mask & kGCSubwindowMode) {
5517 gdk_gc_set_subwindow((GdkGC *) gc, xgval.subwindow_mode);
5518 }
5519}
5520
5521////////////////////////////////////////////////////////////////////////////////
5522/// Copies graphics context from org to dest. Only the values specified
5523/// in mask are copied. Both org and dest must exist.
5524
5526{
5529 ULong_t xmask;
5530
5531 if (!mask) {
5532 // in this case copy all fields
5533 mask = (Mask_t) - 1;
5534 }
5535
5536 gval.fMask = mask; // only set fMask used to convert to xmask
5538
5539 gdk_gc_copy((GdkGC *) dest, (GdkGC *) org);
5540}
5541
5542////////////////////////////////////////////////////////////////////////////////
5543/// Explicitely delete a graphics context.
5544
5549
5550////////////////////////////////////////////////////////////////////////////////
5551/// Create cursor handle (just return cursor from cursor pool fCursors).
5552
5557
5558////////////////////////////////////////////////////////////////////////////////
5559/// Creates a pixmap of the width and height you specified
5560/// and returns a pixmap ID that identifies it.
5561
5569
5570////////////////////////////////////////////////////////////////////////////////
5571/// Create a pixmap from bitmap data. Ones will get foreground color and
5572/// zeroes background color.
5573
5577 Int_t depth)
5578{
5579 GdkColor fore, back;
5580 fore.pixel = forecolor;
5581 fore.red = GetRValue(forecolor);
5582 fore.green = GetGValue(forecolor);
5583 fore.blue = GetBValue(forecolor);
5584
5585 back.pixel = backcolor;
5586 back.red = GetRValue(backcolor);
5587 back.green = GetGValue(backcolor);
5588 back.blue = GetBValue(backcolor);
5589
5590 GdkWindow *wid = (GdkWindow *)id;
5591 if (!id) wid = GDK_ROOT_PARENT();
5592
5594 height, depth, &fore, &back);
5595}
5596
5597////////////////////////////////////////////////////////////////////////////////
5598/// Create a bitmap (i.e. pixmap with depth 1) from the bitmap data.
5599
5602{
5603 GdkWindow *wid = (GdkWindow *)id;
5604 if (!id) wid = GDK_ROOT_PARENT();
5605
5607 (char *)bitmap, width, height);
5608 return ret;
5609}
5610
5611////////////////////////////////////////////////////////////////////////////////
5612/// Explicitely delete pixmap resource.
5613
5615{
5616 gdk_pixmap_unref((GdkPixmap *) pmap);
5617}
5618
5619////////////////////////////////////////////////////////////////////////////////
5620/// Create a picture pixmap from data on file. The picture attributes
5621/// are used for input and output. Returns kTRUE in case of success,
5622/// kFALSE otherwise. If mask does not exist it is set to kNone.
5623
5625 Pixmap_t & pict,
5628{
5630 if (strstr(filename, ".xpm") || strstr(filename, ".XPM")) {
5631 GdkWindow *wid = (GdkWindow *)id;
5632 if (!id) wid = GDK_ROOT_PARENT();
5633
5635 filename);
5637 } else if (strstr(filename, ".gif") || strstr(filename, ".GIF")) {
5638 pict = ReadGIF(0, 0, filename, id);
5639 pict_mask = kNone;
5640 }
5641
5642 gdk_drawable_get_size((GdkPixmap *) pict, (int *) &attr.fWidth,
5643 (int *) &attr.fHeight);
5644 if (pict) {
5645 return kTRUE;
5646 }
5647 if (pict_mask) {
5648 pict_mask = kNone;
5649 }
5650 return kFALSE;
5651}
5652
5653////////////////////////////////////////////////////////////////////////////////
5654/// Create a pixture pixmap from data. The picture attributes
5655/// are used for input and output. Returns kTRUE in case of success,
5656/// kFALSE otherwise. If mask does not exist it is set to kNone.
5657
5659 Pixmap_t & pict,
5662{
5664 GdkWindow *wid = (GdkWindow *)id;
5665 if (!id) wid = GDK_ROOT_PARENT();
5666
5668 data);
5670
5671 if (pict) {
5672 return kTRUE;
5673 }
5674 if (pict_mask) {
5675 pict_mask = kNone;
5676 }
5677 return kFALSE;
5678}
5679
5680////////////////////////////////////////////////////////////////////////////////
5681/// Read picture data from file and store in ret_data. Returns kTRUE in
5682/// case of success, kFALSE otherwise.
5683
5685{
5686 Bool_t ret = kFALSE;
5688 ret_data = 0;
5689
5690 if (pxm==NULL) return kFALSE;
5691
5692 HBITMAP hbm = (HBITMAP)GDK_DRAWABLE_XID(pxm);
5693 BITMAP bitmap;
5694
5695 ret = ::GetObject(hbm, sizeof(HBITMAP), (LPVOID)&bitmap);
5696 ret_data = (char ***)&bitmap.bmBits;
5698 return ret;
5699}
5700
5701////////////////////////////////////////////////////////////////////////////////
5702/// Delete picture data created by the function ReadPictureDataFromFile.
5703
5705{
5706 free(data);
5707}
5708
5709////////////////////////////////////////////////////////////////////////////////
5710/// Specify a dash pattertn. Offset defines the phase of the pattern.
5711/// Each element in the dash_list array specifies the length (in pixels)
5712/// of a segment of the pattern. N defines the length of the list.
5713
5715 Int_t n)
5716{
5717 int i;
5718 gint8 dashes[32];
5719 for (i = 0; i < n; i++) {
5720 dashes[i] = (gint8) dash_list[i];
5721 }
5722 for (i = n; i < 32; i++) {
5723 dashes[i] = (gint8) 0;
5724 }
5725
5727}
5728
5729////////////////////////////////////////////////////////////////////////////////
5730/// Map a ColorStruct_t to a XColor structure.
5731
5733{
5734 xcolor.pixel = color->fPixel;
5735 xcolor.red = color->fRed;
5736 xcolor.green = color->fGreen;
5737 xcolor.blue = color->fBlue;
5738}
5739
5740////////////////////////////////////////////////////////////////////////////////
5741/// Parse string cname containing color name, like "green" or "#00FF00".
5742/// It returns a filled in ColorStruct_t. Returns kFALSE in case parsing
5743/// failed, kTRUE in case of success. On success, the ColorStruct_t
5744/// fRed, fGreen and fBlue fields are all filled in and the mask is set
5745/// for all three colors, but fPixel is not set.
5746
5748 ColorStruct_t & color)
5749{
5750 GdkColor xc;
5751
5752 if (gdk_color_parse((char *)cname, &xc)) {
5753 color.fPixel = xc.pixel = RGB(xc.red, xc.green, xc.blue);
5754 color.fRed = xc.red;
5755 color.fGreen = xc.green;
5756 color.fBlue = xc.blue;
5757 return kTRUE;
5758 }
5759 return kFALSE;
5760}
5761
5762////////////////////////////////////////////////////////////////////////////////
5763/// Find and allocate a color cell according to the color values specified
5764/// in the ColorStruct_t. If no cell could be allocated it returns kFALSE,
5765/// otherwise kTRUE.
5766
5768{
5769 int status;
5770 GdkColor xc;
5771
5772 xc.red = color.fRed;
5773 xc.green = color.fGreen;
5774 xc.blue = color.fBlue;
5775
5777 color.fPixel = xc.pixel;
5778
5779 return kTRUE; // status != 0 ? kTRUE : kFALSE;
5780}
5781
5782////////////////////////////////////////////////////////////////////////////////
5783/// Fill in the primary color components for a specific pixel value.
5784/// On input fPixel should be set on return the fRed, fGreen and
5785/// fBlue components will be set.
5786
5788{
5789 GdkColor xc;
5790 xc.pixel = color.fPixel;
5791
5795
5796 color.fPixel = xc.pixel;
5797 color.fRed = xc.red;
5798 color.fGreen = xc.green;
5799 color.fBlue = xc.blue;
5800}
5801
5802////////////////////////////////////////////////////////////////////////////////
5803/// Free color cell with specified pixel value.
5804
5806{
5807 // FIXME: to be implemented.
5808}
5809
5810////////////////////////////////////////////////////////////////////////////////
5811/// Check if there is for window "id" an event of type "type". If there
5812/// is fill in the event structure and return true. If no such event
5813/// return false.
5814
5816{
5817 if (!id) return kFALSE;
5818
5819 Event_t tev;
5820 GdkEvent xev;
5821
5822 tev.fType = type;
5823 tev.fWindow = (Window_t) id;
5824 tev.fTime = 0;
5825 tev.fX = tev.fY = 0;
5826 tev.fXRoot = tev.fYRoot = 0;
5827 tev.fCode = 0;
5828 tev.fState = 0;
5829 tev.fWidth = tev.fHeight = 0;
5830 tev.fCount = 0;
5831 tev.fSendEvent = kFALSE;
5832 tev.fHandle = 0;
5833 tev.fFormat = 0;
5834 tev.fUser[0] = tev.fUser[1] = tev.fUser[2] = tev.fUser[3] = tev.fUser[4] = 0L;
5835
5836 TGWin32MainThread::LockMSG();
5837 MapEvent(tev, xev, kTRUE);
5839
5840 if (r) MapEvent(ev, xev, kFALSE);
5841 TGWin32MainThread::UnlockMSG();
5842
5843 return r ? kTRUE : kFALSE;
5844}
5845
5846////////////////////////////////////////////////////////////////////////////////
5847/// Send event ev to window id.
5848
5850{
5851 if (!ev || !id) return;
5852
5853 TGWin32MainThread::LockMSG();
5854 GdkEvent xev;
5855 MapEvent(*ev, xev, kTRUE);
5857 TGWin32MainThread::UnlockMSG();
5858}
5859
5860////////////////////////////////////////////////////////////////////////////////
5861/// Returns number of pending events.
5862
5864{
5865 Int_t ret = 0;
5866
5867 TGWin32MainThread::LockMSG();
5869 if (list != nullptr)
5870 ret = g_list_length(list);
5871 TGWin32MainThread::UnlockMSG();
5872
5873 return ret;
5874}
5875
5876////////////////////////////////////////////////////////////////////////////////
5877/// Copies first pending event from event queue to Event_t structure
5878/// and removes event from queue. Not all of the event fields are valid
5879/// for each event type, except fType and fWindow.
5880
5882{
5883 TGWin32MainThread::LockMSG();
5885
5886 // fill in Event_t
5887 event.fType = kOtherEvent; // bb add
5888 if (xev == NULL) {
5889 TGWin32MainThread::UnlockMSG();
5890 return;
5891 }
5892 MapEvent(event, *xev, kFALSE);
5894 TGWin32MainThread::UnlockMSG();
5895}
5896
5897////////////////////////////////////////////////////////////////////////////////
5898/// Map modifier key state to or from X.
5899
5901{
5902 if (tox) {
5903 xstate = state;
5904 if (state & kAnyModifier) {
5906 }
5907 } else {
5908 state = xstate;
5909 }
5910}
5911
5912static void _set_event_time(GdkEvent &event, UInt_t time)
5913{
5914 // set gdk event time
5915
5916 switch (event.type) {
5917 case GDK_MOTION_NOTIFY:
5918 event.motion.time = time;
5919 case GDK_BUTTON_PRESS:
5920 case GDK_2BUTTON_PRESS:
5921 case GDK_3BUTTON_PRESS:
5922 case GDK_BUTTON_RELEASE:
5923 case GDK_SCROLL:
5924 event.button.time = time;
5925 case GDK_KEY_PRESS:
5926 case GDK_KEY_RELEASE:
5927 event.key.time = time;
5928 case GDK_ENTER_NOTIFY:
5929 case GDK_LEAVE_NOTIFY:
5930 event.crossing.time = time;
5932 event.property.time = time;
5936 event.selection.time = time;
5937 case GDK_PROXIMITY_IN:
5938 case GDK_PROXIMITY_OUT:
5939 event.proximity.time = time;
5940 case GDK_DRAG_ENTER:
5941 case GDK_DRAG_LEAVE:
5942 case GDK_DRAG_MOTION:
5943 case GDK_DRAG_STATUS:
5944 case GDK_DROP_START:
5945 case GDK_DROP_FINISHED:
5946 event.dnd.time = time;
5947 default: /* use current time */
5948 break;
5949 }
5950}
5951
5952////////////////////////////////////////////////////////////////////////////////
5953/// Map Event_t structure to gdk_event structure. If tox is false
5954/// map the other way.
5955
5957{
5958 if (tox) {
5959 // map from Event_t to gdk_event
5960 xev.type = GDK_NOTHING;
5961 if (ev.fType == kGKeyPress)
5962 xev.type = GDK_KEY_PRESS;
5963 if (ev.fType == kKeyRelease)
5964 xev.type = GDK_KEY_RELEASE;
5965 if (ev.fType == kButtonPress)
5966 xev.type = GDK_BUTTON_PRESS;
5967 if (ev.fType == kButtonRelease)
5968 xev.type = GDK_BUTTON_RELEASE;
5969 if (ev.fType == kMotionNotify)
5970 xev.type = GDK_MOTION_NOTIFY;
5971 if (ev.fType == kEnterNotify)
5972 xev.type = GDK_ENTER_NOTIFY;
5973 if (ev.fType == kLeaveNotify)
5974 xev.type = GDK_LEAVE_NOTIFY;
5975 if (ev.fType == kExpose)
5976 xev.type = GDK_EXPOSE;
5977 if (ev.fType == kConfigureNotify)
5978 xev.type = GDK_CONFIGURE;
5979 if (ev.fType == kMapNotify)
5980 xev.type = GDK_MAP;
5981 if (ev.fType == kUnmapNotify)
5982 xev.type = GDK_UNMAP;
5983 if (ev.fType == kDestroyNotify)
5984 xev.type = GDK_DESTROY;
5985 if (ev.fType == kClientMessage)
5986 xev.type = GDK_CLIENT_EVENT;
5987 if (ev.fType == kSelectionClear)
5988 xev.type = GDK_SELECTION_CLEAR;
5989 if (ev.fType == kSelectionRequest)
5991 if (ev.fType == kSelectionNotify)
5993
5994 xev.any.type = xev.type;
5995 xev.any.send_event = ev.fSendEvent;
5996 if (ev.fType == kDestroyNotify) {
5997 xev.any.window = (GdkWindow *) ev.fWindow;
5998 }
5999 if (ev.fType == kFocusIn) {
6000 xev.type = GDK_FOCUS_CHANGE;
6001 xev.focus_change.type = xev.type;
6002 xev.focus_change.window = (GdkWindow *) ev.fWindow;
6003 xev.focus_change.in = TRUE;
6004 }
6005 if (ev.fType == kFocusOut) {
6006 xev.type = GDK_FOCUS_CHANGE;
6007 xev.focus_change.type = xev.type;
6008 xev.focus_change.window = (GdkWindow *) ev.fWindow;
6009 xev.focus_change.in = FALSE;
6010 }
6011 if (ev.fType == kGKeyPress || ev.fType == kKeyRelease) {
6012 xev.key.window = (GdkWindow *) ev.fWindow;
6013 xev.key.type = xev.type;
6014 MapModifierState(ev.fState, xev.key.state, kTRUE); // key mask
6015 xev.key.keyval = ev.fCode; // key code
6016 }
6017 if (ev.fType == kButtonPress || ev.fType == kButtonRelease) {
6018 xev.button.window = (GdkWindow *) ev.fWindow;
6019 xev.button.type = xev.type;
6020 xev.button.x = ev.fX;
6021 xev.button.y = ev.fY;
6022 xev.button.x_root = ev.fXRoot;
6023 xev.button.y_root = ev.fYRoot;
6024 MapModifierState(ev.fState, xev.button.state, kTRUE); // button mask
6025 xev.button.button = ev.fCode; // button code
6026 }
6027 if (ev.fType == kSelectionNotify) {
6028 xev.selection.window = (GdkWindow *) ev.fUser[0];
6029 xev.selection.requestor = (ULongptr_t) ev.fUser[0];
6030 xev.selection.selection = (GdkAtom) ev.fUser[1];
6031 xev.selection.target = (GdkAtom) ev.fUser[2];
6032 xev.selection.property = (GdkAtom) ev.fUser[3];
6033 xev.selection.type = xev.type;
6034 }
6035 if (ev.fType == kClientMessage) {
6036 if ((ev.fFormat == 32) && (ev.fHandle == gWM_DELETE_WINDOW)) {
6037 xev.type = GDK_DELETE;
6038 xev.any.type = xev.type;
6039 xev.any.window = (GdkWindow *) ev.fWindow;
6040 } else {
6041 xev.client.window = (GdkWindow *) ev.fWindow;
6042 xev.client.type = xev.type;
6043 xev.client.message_type = (GdkAtom) ev.fHandle;
6044 xev.client.data_format = ev.fFormat;
6045 xev.client.data.l[0] = ev.fUser[0];
6046 if (sizeof(ev.fUser[0]) > 4) {
6047 SplitLong(ev.fUser[1], xev.client.data.l[1], xev.client.data.l[3]);
6048 SplitLong(ev.fUser[2], xev.client.data.l[2], xev.client.data.l[4]);
6049 } else {
6050 xev.client.data.l[1] = ev.fUser[1];
6051 xev.client.data.l[2] = ev.fUser[2];
6052 xev.client.data.l[3] = ev.fUser[3];
6053 xev.client.data.l[4] = ev.fUser[4];
6054 }
6055 }
6056 }
6057 if (ev.fType == kMotionNotify) {
6058 xev.motion.window = (GdkWindow *) ev.fWindow;
6059 xev.motion.type = xev.type;
6060 xev.motion.x = ev.fX;
6061 xev.motion.y = ev.fY;
6062 xev.motion.x_root = ev.fXRoot;
6063 xev.motion.y_root = ev.fYRoot;
6064 }
6065 if ((ev.fType == kEnterNotify) || (ev.fType == kLeaveNotify)) {
6066 xev.crossing.window = (GdkWindow *) ev.fWindow;
6067 xev.crossing.type = xev.type;
6068 xev.crossing.x = ev.fX;
6069 xev.crossing.y = ev.fY;
6070 xev.crossing.x_root = ev.fXRoot;
6071 xev.crossing.y_root = ev.fYRoot;
6072 xev.crossing.mode = (GdkCrossingMode) ev.fCode; // NotifyNormal, NotifyGrab, NotifyUngrab
6073 MapModifierState(ev.fState, xev.crossing.state, kTRUE); // key or button mask
6074 }
6075 if (ev.fType == kExpose) {
6076 xev.expose.window = (GdkWindow *) ev.fWindow;
6077 xev.expose.type = xev.type;
6078 xev.expose.area.x = ev.fX;
6079 xev.expose.area.y = ev.fY;
6080 xev.expose.area.width = ev.fWidth; // width and
6081 xev.expose.area.height = ev.fHeight; // height of exposed area
6082 xev.expose.count = ev.fCount; // number of expose events still to come
6083 }
6084 if (ev.fType == kConfigureNotify) {
6085 xev.configure.window = (GdkWindow *) ev.fWindow;
6086 xev.configure.type = xev.type;
6087 xev.configure.x = ev.fX;
6088 xev.configure.y = ev.fY;
6089 xev.configure.width = ev.fWidth;
6090 xev.configure.height = ev.fHeight;
6091 }
6092 if (ev.fType == kSelectionClear) {
6093 xev.selection.window = (GdkWindow *) ev.fWindow;
6094 xev.selection.type = xev.type;
6095 xev.selection.selection = ev.fUser[0];
6096 }
6097 if (ev.fType == kSelectionRequest) {
6098 xev.selection.window = (GdkWindow *) ev.fUser[0];
6099 xev.selection.type = xev.type;
6100 xev.selection.selection = ev.fUser[1];
6101 xev.selection.target = ev.fUser[2];
6102 xev.selection.property = ev.fUser[3];
6103 }
6104 if ((ev.fType == kMapNotify) || (ev.fType == kUnmapNotify)) {
6105 xev.any.window = (GdkWindow *) ev.fWindow;
6106 }
6107 if (xev.type != GDK_CLIENT_EVENT)
6108 _set_event_time(xev, ev.fTime);
6109 } else {
6110 // map from gdk_event to Event_t
6111 ev.fType = kOtherEvent;
6112 if (xev.type == GDK_KEY_PRESS)
6113 ev.fType = kGKeyPress;
6114 if (xev.type == GDK_KEY_RELEASE)
6115 ev.fType = kKeyRelease;
6116 if (xev.type == GDK_BUTTON_PRESS)
6117 ev.fType = kButtonPress;
6118 if (xev.type == GDK_BUTTON_RELEASE)
6119 ev.fType = kButtonRelease;
6120 if (xev.type == GDK_MOTION_NOTIFY)
6121 ev.fType = kMotionNotify;
6122 if (xev.type == GDK_ENTER_NOTIFY)
6123 ev.fType = kEnterNotify;
6124 if (xev.type == GDK_LEAVE_NOTIFY)
6125 ev.fType = kLeaveNotify;
6126 if (xev.type == GDK_EXPOSE)
6127 ev.fType = kExpose;
6128 if (xev.type == GDK_CONFIGURE)
6129 ev.fType = kConfigureNotify;
6130 if (xev.type == GDK_MAP)
6131 ev.fType = kMapNotify;
6132 if (xev.type == GDK_UNMAP)
6133 ev.fType = kUnmapNotify;
6134 if (xev.type == GDK_DESTROY)
6135 ev.fType = kDestroyNotify;
6136 if (xev.type == GDK_SELECTION_CLEAR)
6137 ev.fType = kSelectionClear;
6138 if (xev.type == GDK_SELECTION_REQUEST)
6139 ev.fType = kSelectionRequest;
6140 if (xev.type == GDK_SELECTION_NOTIFY)
6141 ev.fType = kSelectionNotify;
6142
6143 ev.fSendEvent = kFALSE; //xev.any.send_event ? kTRUE : kFALSE;
6144 ev.fTime = gdk_event_get_time((GdkEvent *)&xev);
6145 ev.fWindow = (Window_t) xev.any.window;
6146
6147 if ((xev.type == GDK_MAP) || (xev.type == GDK_UNMAP)) {
6148 ev.fWindow = (Window_t) xev.any.window;
6149 }
6150 if (xev.type == GDK_DELETE) {
6151 ev.fWindow = (Window_t) xev.any.window;
6152 ev.fType = kClientMessage;
6153 ev.fFormat = 32;
6154 ev.fHandle = gWM_DELETE_WINDOW;
6155 ev.fUser[0] = (Longptr_t) gWM_DELETE_WINDOW;
6156 if (sizeof(ev.fUser[0]) > 4) {
6157 AsmLong(xev.client.data.l[1], xev.client.data.l[3], ev.fUser[1]);
6158 AsmLong(xev.client.data.l[2], xev.client.data.l[4], ev.fUser[2]);
6159 } else {
6160 ev.fUser[1] = 0; // xev.client.data.l[1];
6161 ev.fUser[2] = 0; // xev.client.data.l[2];
6162 ev.fUser[3] = 0; // xev.client.data.l[3];
6163 ev.fUser[4] = 0; // xev.client.data.l[4];
6164 }
6165 }
6166 if (xev.type == GDK_DESTROY) {
6167 ev.fType = kDestroyNotify;
6168 ev.fHandle = (Window_t) xev.any.window; // window to be destroyed
6169 ev.fWindow = (Window_t) xev.any.window;
6170 }
6171 if (xev.type == GDK_FOCUS_CHANGE) {
6172 ev.fWindow = (Window_t) xev.focus_change.window;
6173 ev.fCode = kNotifyNormal;
6174 ev.fState = 0;
6175 if (xev.focus_change.in == TRUE) {
6176 ev.fType = kFocusIn;
6177 } else {
6178 ev.fType = kFocusOut;
6179 }
6180 }
6181 if (ev.fType == kGKeyPress || ev.fType == kKeyRelease) {
6182 ev.fWindow = (Window_t) xev.key.window;
6183 MapModifierState(ev.fState, xev.key.state, kFALSE); // key mask
6184 ev.fCode = xev.key.keyval; // key code
6185 ev.fUser[1] = xev.key.length;
6186 if (xev.key.length > 0) ev.fUser[2] = xev.key.string[0];
6187 if (xev.key.length > 1) ev.fUser[3] = xev.key.string[1];
6188 if (xev.key.length > 2) ev.fUser[4] = xev.key.string[2];
6189 HWND tmpwin = (HWND) GetWindow((HWND) GDK_DRAWABLE_XID((GdkWindow *)xev.key.window), GW_CHILD);
6190 if (tmpwin) {
6191 ev.fUser[0] = (ULongptr_t) gdk_xid_table_lookup((HANDLE)tmpwin);
6192 } else {
6193 ev.fUser[0] = (ULongptr_t) xev.key.window;
6194 }
6195 }
6196 if (ev.fType == kButtonPress || ev.fType == kButtonRelease) {
6197 ev.fWindow = (Window_t) xev.button.window;
6198 ev.fX = xev.button.x;
6199 ev.fY = xev.button.y;
6200 ev.fXRoot = xev.button.x_root;
6201 ev.fYRoot = xev.button.y_root;
6202 MapModifierState(ev.fState, xev.button.state, kFALSE); // button mask
6203 ev.fCode = xev.button.button; // button code
6204 POINT tpoint;
6205 tpoint.x = xev.button.x;
6206 tpoint.y = xev.button.y;
6208 if (tmpwin) {
6209 ev.fUser[0] = (ULongptr_t) gdk_xid_table_lookup((HANDLE)tmpwin);
6210 } else {
6211 ev.fUser[0] = (ULongptr_t) 0;
6212 }
6213 }
6214 if (ev.fType == kMotionNotify) {
6215 ev.fWindow = (Window_t) xev.motion.window;
6216 ev.fX = xev.motion.x;
6217 ev.fY = xev.motion.y;
6218 ev.fXRoot = xev.motion.x_root;
6219 ev.fYRoot = xev.motion.y_root;
6220 MapModifierState(ev.fState, xev.motion.state, kFALSE); // key or button mask
6221
6222 POINT tpoint;
6223 tpoint.x = xev.button.x;
6224 tpoint.y = xev.button.y;
6226 if (tmpwin) {
6227 ev.fUser[0] = (ULongptr_t)gdk_xid_table_lookup((HANDLE)tmpwin);
6228 } else {
6229 ev.fUser[0] = (ULongptr_t) xev.motion.window;
6230 }
6231 }
6232 if (ev.fType == kEnterNotify || ev.fType == kLeaveNotify) {
6233 ev.fWindow = (Window_t) xev.crossing.window;
6234 ev.fX = xev.crossing.x;
6235 ev.fY = xev.crossing.y;
6236 ev.fXRoot = xev.crossing.x_root;
6237 ev.fYRoot = xev.crossing.y_root;
6238 ev.fCode = xev.crossing.mode; // NotifyNormal, NotifyGrab, NotifyUngrab
6239 MapModifierState(ev.fState, xev.crossing.state, kFALSE); // key or button mask
6240 }
6241 if (ev.fType == kExpose) {
6242 ev.fWindow = (Window_t) xev.expose.window;
6243 ev.fX = xev.expose.area.x;
6244 ev.fY = xev.expose.area.y;
6245 ev.fWidth = xev.expose.area.width; // width and
6246 ev.fHeight = xev.expose.area.height; // height of exposed area
6247 ev.fCount = xev.expose.count; // number of expose events still to come
6248 }
6249 if (ev.fType == kConfigureNotify) {
6250 ev.fWindow = (Window_t) xev.configure.window;
6251 ev.fX = xev.configure.x;
6252 ev.fY = xev.configure.y;
6253 ev.fWidth = xev.configure.width;
6254 ev.fHeight = xev.configure.height;
6255 }
6256 if (xev.type == GDK_CLIENT_EVENT) {
6257 ev.fWindow = (Window_t) xev.client.window;
6258 ev.fType = kClientMessage;
6259 ev.fHandle = xev.client.message_type;
6260 ev.fFormat = xev.client.data_format;
6261 ev.fUser[0] = xev.client.data.l[0];
6262 if (sizeof(ev.fUser[0]) > 4) {
6263 AsmLong(xev.client.data.l[1], xev.client.data.l[3], ev.fUser[1]);
6264 AsmLong(xev.client.data.l[2], xev.client.data.l[4], ev.fUser[2]);
6265 } else {
6266 ev.fUser[1] = xev.client.data.l[1];
6267 ev.fUser[2] = xev.client.data.l[2];
6268 ev.fUser[3] = xev.client.data.l[3];
6269 ev.fUser[4] = xev.client.data.l[4];
6270 }
6271 }
6272 if (ev.fType == kSelectionClear) {
6273 ev.fWindow = (Window_t) xev.selection.window;
6274 ev.fUser[0] = xev.selection.selection;
6275 }
6276 if (ev.fType == kSelectionRequest) {
6277 ev.fWindow = (Window_t) xev.selection.window;
6278 ev.fUser[0] = (ULongptr_t) xev.selection.window;
6279 ev.fUser[1] = xev.selection.selection;
6280 ev.fUser[2] = xev.selection.target;
6281 ev.fUser[3] = xev.selection.property;
6282 }
6283 if (ev.fType == kSelectionNotify) {
6284 ev.fWindow = (Window_t) xev.selection.window;
6285 ev.fUser[0] = (ULongptr_t) xev.selection.window;
6286 ev.fUser[1] = xev.selection.selection;
6287 ev.fUser[2] = xev.selection.target;
6288 ev.fUser[3] = xev.selection.property;
6289 }
6290 if (xev.type == GDK_SCROLL) {
6291 ev.fType = kButtonRelease;
6292 if (xev.scroll.direction == GDK_SCROLL_UP) {
6293 ev.fCode = kButton4;
6294 } else if (xev.scroll.direction == GDK_SCROLL_DOWN) {
6295 ev.fCode = kButton5;
6296 }
6297 ev.fWindow = (Window_t) xev.scroll.window;
6298 ev.fX = xev.scroll.x;
6299 ev.fY = xev.scroll.y;
6300 ev.fXRoot = xev.scroll.x_root;
6301 ev.fYRoot = xev.scroll.y_root;
6302 POINT tpoint;
6303 tpoint.x = xev.scroll.x;
6304 tpoint.y = xev.scroll.y;
6306 if (tmpwin) {
6307 ev.fUser[0] = (ULongptr_t)gdk_xid_table_lookup((HANDLE)tmpwin);
6308 } else {
6309 ev.fUser[0] = (ULongptr_t) 0;
6310 }
6311 }
6312 }
6313}
6314
6315////////////////////////////////////////////////////////////////////////////////
6316///
6317
6319{
6320 gSystem->Beep();
6321}
6322
6323////////////////////////////////////////////////////////////////////////////////
6324/// Copy a drawable (i.e. pixmap) to another drawable (pixmap, window).
6325/// The graphics context gc will be used and the source will be copied
6326/// from src_x,src_y,src_x+width,src_y+height to dest_x,dest_y.
6327
6337
6338////////////////////////////////////////////////////////////////////////////////
6339/// Change window attributes.
6340
6342{
6343 if (!id) return;
6344
6345 GdkColor color;
6347 Mask_t evmask;
6348
6349 if (attr && (attr->fMask & kWAEventMask)) {
6350 evmask = (Mask_t) attr->fEventMask;
6353 }
6354 if (attr && (attr->fMask & kWABackPixel)) {
6355 color.pixel = attr->fBackgroundPixel;
6356 color.red = GetRValue(attr->fBackgroundPixel);
6357 color.green = GetGValue(attr->fBackgroundPixel);
6358 color.blue = GetBValue(attr->fBackgroundPixel);
6359 gdk_window_set_background((GdkWindow *) id, &color);
6360 }
6361// if (attr && (attr->fMask & kWAOverrideRedirect))
6362// gdk_window_set_override_redirect ((GdkWindow *) id, attr->fOverrideRedirect);
6363 if (attr && (attr->fMask & kWABackPixmap)) {
6365 (GdkPixmap *) attr->fBackgroundPixmap, 0);
6366 }
6367 if (attr && (attr->fMask & kWACursor)) {
6368 gdk_window_set_cursor((GdkWindow *) id, (GdkCursor *) attr->fCursor);
6369 }
6370 if (attr && (attr->fMask & kWAColormap)) {
6371 gdk_window_set_colormap((GdkWindow *) id,(GdkColormap *) attr->fColormap);
6372 }
6373 if (attr && (attr->fMask & kWABorderWidth)) {
6374 if (attr->fBorderWidth > 0) {
6377 }
6378 }
6379}
6380
6381////////////////////////////////////////////////////////////////////////////////
6382/// This function alters the property for the specified window and
6383/// causes the X server to generate a PropertyNotify event on that
6384/// window.
6385
6387 UChar_t * data, Int_t len)
6388{
6389 if (!id) return;
6390
6393}
6394
6395////////////////////////////////////////////////////////////////////////////////
6396/// Draw a line.
6397
6399 Int_t x2, Int_t y2)
6400{
6401 if (!id) return;
6402
6403 gdk_draw_line((GdkDrawable *) id, (GdkGC *) gc, x1, y1, x2, y2);
6404}
6405
6406////////////////////////////////////////////////////////////////////////////////
6407/// Clear a window area to the bakcground color.
6408
6410{
6411 if (!id) return;
6412
6413 gdk_window_clear_area((GdkWindow *) id, x, y, w, h);
6414}
6415
6416////////////////////////////////////////////////////////////////////////////////
6417/// Tell WM to send message when window is closed via WM.
6418
6420{
6421 if (!id) return;
6422
6423 Atom prop;
6424 prop = (Atom_t) gdk_atom_intern("WM_DELETE_WINDOW", FALSE);
6425
6428 (unsigned char *) &gWM_DELETE_WINDOW, 1);
6429}
6430
6431////////////////////////////////////////////////////////////////////////////////
6432/// Turn key auto repeat on or off.
6433
6435{
6436 if (on) {
6438 } else {
6440 }
6441}
6442
6443////////////////////////////////////////////////////////////////////////////////
6444/// Establish passive grab on a certain key. That is, when a certain key
6445/// keycode is hit while certain modifier's (Shift, Control, Meta, Alt)
6446/// are active then the keyboard will be grabed for window id.
6447/// When grab is false, ungrab the keyboard for this key and modifier.
6448
6450{
6451 UInt_t xmod;
6452
6454
6455 if (grab) {
6457 } else {
6459 }
6460}
6461
6462////////////////////////////////////////////////////////////////////////////////
6463/// Establish passive grab on a certain mouse button. That is, when a
6464/// certain mouse button is hit while certain modifier's (Shift, Control,
6465/// Meta, Alt) are active then the mouse will be grabed for window id.
6466/// When grab is false, ungrab the mouse button for this button and modifier.
6467
6470 Bool_t grab)
6471{
6473 UInt_t xmod;
6474
6475 if (!id) return;
6476
6478
6479 if (grab) {
6483 } else {
6485 }
6486}
6487
6488////////////////////////////////////////////////////////////////////////////////
6489/// Establish an active pointer grab. While an active pointer grab is in
6490/// effect, further pointer events are only reported to the grabbing
6491/// client window.
6492
6509
6510////////////////////////////////////////////////////////////////////////////////
6511/// Set window name.
6512
6514{
6515 if (!id) return;
6516
6518}
6519
6520////////////////////////////////////////////////////////////////////////////////
6521/// Set window icon name.
6522
6524{
6525 if (!id) return;
6526
6528}
6529
6530////////////////////////////////////////////////////////////////////////////////
6531/// Set pixmap the WM can use when the window is iconized.
6532
6534{
6535 if (!id) return;
6536
6538}
6539
6540#define safestrlen(s) ((s) ? strlen(s) : 0)
6541
6542////////////////////////////////////////////////////////////////////////////////
6543/// Set the windows class and resource name.
6544
6545void TGWin32::SetClassHints(Window_t id, char *className, char *resourceName)
6546{
6547 if (!id) return;
6548
6549 char *class_string;
6550 char *s;
6551 size_t len_nm, len_cl;
6552 GdkAtom prop;
6553
6554 prop = gdk_atom_intern("WM_CLASS", kFALSE);
6555
6557 len_cl = safestrlen(className);
6558
6559 if ((class_string = s =
6560 (char *) malloc((unsigned) (len_nm + len_cl + 2)))) {
6561 if (len_nm) {
6562 strcpy(s, resourceName);
6563 s += len_nm + 1;
6564 } else
6565 *s++ = '\0';
6566 if (len_cl) {
6567 strcpy(s, className);
6568 } else {
6569 *s = '\0';
6570 }
6571
6575 (unsigned char *) class_string,
6576 (Int_t)(len_nm + len_cl + 2));
6578 }
6579}
6580
6581////////////////////////////////////////////////////////////////////////////////
6582/// Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
6583
6592
6593////////////////////////////////////////////////////////////////////////////////
6594///
6595
6597{
6598 if (!id) return;
6599
6600 // prevent hiding the titlebar
6601 if (x == 0 && y == 0) {
6602 x = 1; y = 1;
6603 }
6604 gdk_window_move((GdkDrawable *) id, x, y);
6605}
6606
6607////////////////////////////////////////////////////////////////////////////////
6608///
6609
6611{
6612 if (!id) return;
6613
6614 gdk_window_resize((GdkWindow *) id, w, h);
6615}
6616
6617////////////////////////////////////////////////////////////////////////////////
6618/// Give the window manager minimum and maximum size hints. Also
6619/// specify via winc and hinc the resize increments.
6620
6624{
6625 if (!id) return;
6626
6628 GdkWindowHints flags;
6629
6632 hints.min_width = (Int_t) wmin;
6633 hints.max_width = (Int_t) wmax;
6634 hints.min_height = (Int_t) hmin;
6635 hints.max_height = (Int_t) hmax;
6636 hints.width_inc = (Int_t) winc;
6637 hints.height_inc = (Int_t) hinc;
6638
6640 (GdkWindowHints) flags);
6641}
6642
6643////////////////////////////////////////////////////////////////////////////////
6644/// Set the initial state of the window. Either kNormalState or kIconicState.
6645
6647{
6648 if (!id) return;
6649
6650#if 0
6653
6654 if (state == kNormalState)
6656 if (state == kIconicState)
6658
6659 hints.flags = StateHint;
6660 hints.initial_state = xstate;
6661
6662 XSetWMHints((GdkWindow *) id, &hints);
6663#endif
6664}
6665
6666////////////////////////////////////////////////////////////////////////////////
6667/// Tell window manager that window is a transient window of gdk_parent_root.
6668
6670{
6671 if (!id) return;
6672
6674}
6675
6676////////////////////////////////////////////////////////////////////////////////
6677/// Draw a string using a specific graphics context in position (x,y).
6678
6680 const char *s, Int_t len)
6681{
6682 if (!id) return;
6683
6684 GdkGCValues values;
6685 gdk_gc_get_values((GdkGC *) gc, &values);
6686 gdk_win32_draw_text((GdkDrawable *) id, (GdkFont *) values.font,
6687 (GdkGC *) gc, x, y, (const gchar *)s, len);
6688}
6689
6690////////////////////////////////////////////////////////////////////////////////
6691/// Return length of string in pixels. Size depends on font.
6692
6694{
6695 return gdk_text_width((GdkFont *)font, s, len);
6696}
6697
6698////////////////////////////////////////////////////////////////////////////////
6699/// Return some font properties.
6700
6703{
6704 GdkFont *f = (GdkFont *) font;
6705 max_ascent = f->ascent;
6706 max_descent = f->descent;
6707}
6708
6709////////////////////////////////////////////////////////////////////////////////
6710/// Get current values from graphics context gc. Which values of the
6711/// context to get is encoded in the GCValues::fMask member.
6712
6722
6723////////////////////////////////////////////////////////////////////////////////
6724/// Retrieve associated font structure once we have the font handle.
6725/// Free returned FontStruct_t using FreeFontStruct().
6726
6731
6732////////////////////////////////////////////////////////////////////////////////
6733/// Free font structure returned by GetFontStruct().
6734
6739
6740////////////////////////////////////////////////////////////////////////////////
6741/// Clear window.
6742
6744{
6745 if (!id) return;
6746
6748}
6749
6750////////////////////////////////////////////////////////////////////////////////
6751/// Convert a keysym to the appropriate keycode. For example keysym is
6752/// a letter and keycode is the matching keyboard key (which is dependend
6753/// on the current keyboard mapping).
6754
6761
6762////////////////////////////////////////////////////////////////////////////////
6763/// Draw a filled rectangle. Filling is done according to the gc.
6764
6766 UInt_t w, UInt_t h)
6767{
6768 if (!id) return;
6769
6771}
6772
6773////////////////////////////////////////////////////////////////////////////////
6774/// Draw a rectangle outline.
6775
6777 UInt_t w, UInt_t h)
6778{
6779 if (!id) return;
6780
6782}
6783
6784////////////////////////////////////////////////////////////////////////////////
6785/// Draws multiple line segments. Each line is specified by a pair of points.
6786
6788 Int_t nseg)
6789{
6790 if (!id) return;
6791
6793}
6794
6795////////////////////////////////////////////////////////////////////////////////
6796/// Defines which input events the window is interested in. By default
6797/// events are propageted up the window stack. This mask can also be
6798/// set at window creation time via the SetWindowAttributes_t::fEventMask
6799/// attribute.
6800
6802{
6803 if (!id) return;
6804
6808}
6809
6810////////////////////////////////////////////////////////////////////////////////
6811/// Returns the window id of the window having the input focus.
6812
6818
6819////////////////////////////////////////////////////////////////////////////////
6820/// Set keyboard input focus to window id.
6821
6823{
6824 if (!id) return;
6825
6827 ::SetFocus(hwnd);
6828}
6829
6830////////////////////////////////////////////////////////////////////////////////
6831/// Returns the window id of the current owner of the primary selection.
6832/// That is the window in which, for example some text is selected.
6833
6838
6839////////////////////////////////////////////////////////////////////////////////
6840/// Makes the window id the current owner of the primary selection.
6841/// That is the window in which, for example some text is selected.
6842
6844{
6845 if (!id) return;
6846
6848}
6849
6850////////////////////////////////////////////////////////////////////////////////
6851/// XConvertSelection() causes a SelectionRequest event to be sent to the
6852/// current primary selection owner. This event specifies the selection
6853/// property (primary selection), the format into which to convert that
6854/// data before storing it (target = XA_STRING), the property in which
6855/// the owner will place the information (sel_property), the window that
6856/// wants the information (id), and the time of the conversion request
6857/// (when).
6858/// The selection owner responds by sending a SelectionNotify event, which
6859/// confirms the selected atom and type.
6860
6862{
6863 if (!id) return;
6864
6866 gdk_atom_intern("GDK_TARGET_STRING", 0), when);
6867}
6868
6869////////////////////////////////////////////////////////////////////////////////
6870/// Convert the keycode from the event structure to a key symbol (according
6871/// to the modifiers specified in the event structure and the current
6872/// keyboard mapping). In buf a null terminated ASCII string is returned
6873/// representing the string that is currently mapped to the key code.
6874
6875void TGWin32::LookupString(Event_t * event, char *buf, Int_t buflen,
6876 UInt_t & keysym)
6877{
6878 _lookup_string(event, buf, buflen);
6879 UInt_t ks, xks = (UInt_t) event->fCode;
6881 keysym = (Int_t) ks;
6882}
6883
6884////////////////////////////////////////////////////////////////////////////////
6885/// Map to and from X key symbols. Keysym are the values returned by
6886/// XLookUpString.
6887
6889{
6890 if (tox) {
6892 if (keysym < 127) {
6893 xkeysym = keysym;
6894 } else if (keysym >= kKey_F1 && keysym <= kKey_F35) {
6895 xkeysym = GDK_F1 + (keysym - (UInt_t) kKey_F1); // function keys
6896 } else {
6897 for (int i = 0; gKeyMap[i].fKeySym; i++) { // any other keys
6898 if (keysym == (UInt_t) gKeyMap[i].fKeySym) {
6899 xkeysym = (UInt_t) gKeyMap[i].fXKeySym;
6900 break;
6901 }
6902 }
6903 }
6904 } else {
6906 // commentary in X11/keysymdef says that X codes match ASCII
6907 if (xkeysym < 127) {
6908 keysym = xkeysym;
6909 } else if (xkeysym >= GDK_F1 && xkeysym <= GDK_F35) {
6910 keysym = kKey_F1 + (xkeysym - GDK_F1); // function keys
6911 } else if (xkeysym >= GDK_KP_0 && xkeysym <= GDK_KP_9) {
6912 keysym = kKey_0 + (xkeysym - GDK_KP_0); // numeric keypad keys
6913 } else {
6914 for (int i = 0; gKeyMap[i].fXKeySym; i++) { // any other keys
6915 if (xkeysym == gKeyMap[i].fXKeySym) {
6916 keysym = (UInt_t) gKeyMap[i].fKeySym;
6917 break;
6918 }
6919 }
6920 }
6921 }
6922}
6923
6924////////////////////////////////////////////////////////////////////////////////
6925/// Get contents of paste buffer atom into string. If del is true delete
6926/// the paste buffer afterwards.
6927
6929 Int_t & nchar, Bool_t del)
6930{
6931 if (!id) return;
6932
6933 char *data;
6934 int nread, actual_format;
6935
6937 (unsigned char **) &data,
6938 (GdkAtom *) & atom, &actual_format);
6939
6940 if ((nread == 0) || (data == NULL)) {
6941 nchar = 0;
6942 return;
6943 }
6944
6945 text.Insert(0, (const char *) data);
6946 nchar = 1; //strlen(data);
6947 g_free(data);
6948
6949 // if (del)
6951 gdk_atom_intern("GDK_SELECTION", FALSE));
6952}
6953
6954////////////////////////////////////////////////////////////////////////////////
6955/// TranslateCoordinates translates coordinates from the frame of
6956/// reference of one window to another. If the point is contained
6957/// in a mapped child of the destination, the id of that child is
6958/// returned as well.
6959
6963 Window_t &child)
6964{
6965 if (!src || !dest) return;
6966
6967 HWND sw, dw, ch = NULL;
6968 POINT point;
6971 point.x = src_x;
6972 point.y = src_y;
6973 ::MapWindowPoints(sw, // handle of window to be mapped from
6974 dw, // handle to window to be mapped to
6975 &point, // pointer to array with points to map
6976 1); // number of structures in array
6979
6980 if (child == src) {
6981 child = (Window_t) 0;
6982 }
6983 dest_x = point.x;
6984 dest_y = point.y;
6985}
6986
6987////////////////////////////////////////////////////////////////////////////////
6988/// Return geometry of window (should be called GetGeometry but signature
6989/// already used).
6990
6992 UInt_t & w, UInt_t & h)
6993{
6994 if (!id) return;
6995
6996 Int_t ddum;
6998 x = y = 0;
6999 gdk_drawable_get_size((GdkDrawable *)id, (int*)&w, (int*)&h);
7000 }
7001 else {
7002 gdk_window_get_geometry((GdkDrawable *) id, &x, &y, (int*)&w,
7003 (int*)&h, &ddum);
7004 }
7005}
7006
7007////////////////////////////////////////////////////////////////////////////////
7008/// FillPolygon fills the region closed by the specified path.
7009/// The path is closed automatically if the last point in the list does
7010/// not coincide with the first point. All point coordinates are
7011/// treated as relative to the origin. For every pair of points
7012/// inside the polygon, the line segment connecting them does not
7013/// intersect the path.
7014
7016 Int_t npnt)
7017{
7018 if (!id) return;
7019
7021}
7022
7023////////////////////////////////////////////////////////////////////////////////
7024/// Returns the root window the pointer is logically on and the pointer
7025/// coordinates relative to the root window's origin.
7026/// The pointer coordinates returned to win_x and win_y are relative to
7027/// the origin of the specified window. In this case, QueryPointer returns
7028/// the child that contains the pointer, if any, or else kNone to
7029/// childw. QueryPointer returns the current logical state of the
7030/// keyboard buttons and the modifier keys in mask.
7031
7035 UInt_t &mask)
7036{
7037 if (!id) return;
7038
7039 POINT currPt;
7040 HWND chw, window;
7041 UInt_t umask = 0;
7042 BYTE kbd[256];
7043
7044 window = (HWND)GDK_DRAWABLE_XID((GdkWindow *)id);
7049 root_x = currPt.x;
7050 root_y = currPt.y;
7051
7052 ::ScreenToClient(window, &currPt);
7053 win_x = currPt.x;
7054 win_y = currPt.y;
7055
7057
7058 if (kbd[VK_SHIFT] & 0x80) {
7060 }
7061 if (kbd[VK_CAPITAL] & 0x80) {
7063 }
7064 if (kbd[VK_CONTROL] & 0x80) {
7066 }
7067 if (kbd[VK_MENU] & 0x80) {
7069 }
7070 if (kbd[VK_LBUTTON] & 0x80) {
7072 }
7073 if (kbd[VK_MBUTTON] & 0x80) {
7075 }
7076 if (kbd[VK_RBUTTON] & 0x80) {
7078 }
7079
7081}
7082
7083////////////////////////////////////////////////////////////////////////////////
7084/// Set foreground color in graphics context (shortcut for ChangeGC with
7085/// only foreground mask set).
7086
7088{
7089 GdkColor fore;
7090 fore.pixel = foreground;
7091 fore.red = GetRValue(foreground);
7092 fore.green = GetGValue(foreground);
7093 fore.blue = GetBValue(foreground);
7095}
7096
7097////////////////////////////////////////////////////////////////////////////////
7098/// Set clipping rectangles in graphics context. X, Y specify the origin
7099/// of the rectangles. Recs specifies an array of rectangles that define
7100/// the clipping mask and n is the number of rectangles.
7101
7104{
7105 Int_t i;
7107
7108 for (i = 0; i < n; i++) {
7109 grects[i].x = x+recs[i].fX;
7110 grects[i].y = y+recs[i].fY;
7111 grects[i].width = recs[i].fWidth;
7112 grects[i].height = recs[i].fHeight;
7113 }
7114
7115 for (i = 0; i < n; i++) {
7117 }
7118 delete [] grects;
7119}
7120
7121////////////////////////////////////////////////////////////////////////////////
7122/// Flush (mode = 0, default) or synchronize (mode = 1) X output buffer.
7123/// Flush flushes output buffer. Sync flushes buffer and waits till all
7124/// requests have been processed by X server.
7125
7127{
7128 GdiFlush();
7129}
7130
7131////////////////////////////////////////////////////////////////////////////////
7132/// Create a new empty region.
7133
7138
7139////////////////////////////////////////////////////////////////////////////////
7140/// Destroy region.
7141
7146
7147////////////////////////////////////////////////////////////////////////////////
7148/// Union of rectangle with a region.
7149
7151{
7153 r.x = rect->fX;
7154 r.y = rect->fY;
7155 r.width = rect->fWidth;
7156 r.height = rect->fHeight;
7158}
7159
7160////////////////////////////////////////////////////////////////////////////////
7161/// Create region for the polygon defined by the points array.
7162/// If winding is true use WindingRule else EvenOddRule as fill rule.
7163
7169
7170////////////////////////////////////////////////////////////////////////////////
7171/// Compute the union of rega and regb and return result region.
7172/// The output region may be the same result region.
7173
7178
7179////////////////////////////////////////////////////////////////////////////////
7180/// Compute the intersection of rega and regb and return result region.
7181/// The output region may be the same as the result region.
7182
7188
7189////////////////////////////////////////////////////////////////////////////////
7190/// Subtract rega from regb.
7191
7196
7197////////////////////////////////////////////////////////////////////////////////
7198/// Calculate the difference between the union and intersection of
7199/// two regions.
7200
7205
7206////////////////////////////////////////////////////////////////////////////////
7207/// Return true if the region is empty.
7208
7213
7214////////////////////////////////////////////////////////////////////////////////
7215/// Returns true if the point x,y is in the region.
7216
7221
7222////////////////////////////////////////////////////////////////////////////////
7223/// Returns true if two regions are equal.
7224
7229
7230////////////////////////////////////////////////////////////////////////////////
7231/// Return smallest enclosing rectangle.
7232
7234{
7237 rect->fX = r.x;
7238 rect->fY = r.y;
7239 rect->fWidth = r.width;
7240 rect->fHeight = r.height;
7241}
7242
7243////////////////////////////////////////////////////////////////////////////////
7244/// Return list of font names matching "fontname".
7245
7246char **TGWin32::ListFonts(const char *fontname, Int_t /*max*/, Int_t &count)
7247{
7248 char foundry[32], family[100], weight[32], slant[32], font_name[256];
7249 char **fontlist;
7250 Int_t n1, fontcount = 0;
7251
7252 sscanf(fontname, "-%30[^-]-%100[^-]-%30[^-]-%30[^-]-%n",
7253 foundry, family, weight, slant, &n1);
7254 // replace "medium" by "normal"
7255 if(!stricmp(weight,"medium")) {
7256 sprintf(weight,"normal");
7257 }
7258 // since all sizes are allowed with TTF, just forget it...
7259 sprintf(font_name, "-%s-%s-%s-%s-*", foundry, family, weight, slant);
7260 fontlist = gdk_font_list_new(font_name, &fontcount);
7261 count = fontcount;
7262
7263 if (fontcount > 0) return fontlist;
7264 return 0;
7265}
7266
7267////////////////////////////////////////////////////////////////////////////////
7268///
7269
7274
7275////////////////////////////////////////////////////////////////////////////////
7276///
7277
7283
7284////////////////////////////////////////////////////////////////////////////////
7285///
7286
7288{
7289 width = ((GdkImage*)id)->width;
7290 height = ((GdkImage*)id)->height;
7291}
7292
7293////////////////////////////////////////////////////////////////////////////////
7294///
7295
7297{
7298 if (!id) return;
7299
7300 GdkImage *image = (GdkImage *)id;
7301 if (image->depth == 1) {
7302 if (pixel & 1) {
7303 ((UChar_t *) image->mem)[y * image->bpl + (x >> 3)] |= (1 << (7 - (x & 0x7)));
7304 } else {
7305 ((UChar_t *) image->mem)[y * image->bpl + (x >> 3)] &= ~(1 << (7 - (x & 0x7)));
7306 }
7307 } else {
7308 UChar_t *pixelp = (UChar_t *) image->mem + y * image->bpl + x * image->bpp;
7309 // Windows is always LSB, no need to check image->byte_order.
7310 switch (image->bpp) {
7311 case 4:
7312 pixelp[3] = 0;
7313 case 3:
7314 pixelp[2] = ((pixel >> 16) & 0xFF);
7315 case 2:
7316 pixelp[1] = ((pixel >> 8) & 0xFF);
7317 case 1:
7318 pixelp[0] = (pixel & 0xFF);
7319 }
7320 }
7321}
7322
7323////////////////////////////////////////////////////////////////////////////////
7324///
7325
7328{
7329 if (!id) return;
7330
7332 x, y, dx, dy, w, h);
7333 ::GdiFlush();
7334}
7335
7336////////////////////////////////////////////////////////////////////////////////
7337///
7338
7343
7344////////////////////////////////////////////////////////////////////////////////
7345/// Gets DIB bits
7346/// x, y, width, height - position of bitmap
7347/// returns a pointer on bitmap bits array
7348/// in format:
7349/// b1, g1, r1, 0, b2, g2, r2, 0 ... bn, gn, rn, 0 ...
7350///
7351/// Pixels are numbered from left to right and from top to bottom.
7352/// By default all pixels from the whole drawable are returned.
7353
7356{
7357 HDC hdc, memdc;
7360 BITMAP bm;
7361 HBITMAP ximage = 0;
7362 VOID *bmbits = 0;
7363 unsigned char *ret = 0;
7364
7367 oldbitmap1 = ::SelectObject(hdc, GDK_DRAWABLE_XID(wid));
7368 ::GetObject(GDK_DRAWABLE_XID(wid), sizeof(BITMAP), &bm);
7369 } else {
7371 }
7373
7374 bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
7375 bmi.bmiHeader.biWidth = width;
7376 bmi.bmiHeader.biHeight = -1 * (int)(height);
7377 bmi.bmiHeader.biPlanes = 1;
7378 bmi.bmiHeader.biBitCount = 32;
7379 bmi.bmiHeader.biCompression = BI_RGB;
7380 bmi.bmiHeader.biSizeImage = 0;
7381 bmi.bmiHeader.biXPelsPerMeter = bmi.bmiHeader.biYPelsPerMeter = 0;
7382 bmi.bmiHeader.biClrUsed = 0;
7383 bmi.bmiHeader.biClrImportant = 0;
7384
7386
7387 if (ximage && bmbits) {
7388 oldbitmap2 = ::SelectObject(memdc, ximage);
7389 ::BitBlt(memdc, x, y, width, height, hdc, 0, 0, SRCCOPY);
7390 ::SelectObject(memdc, oldbitmap2);
7391 }
7394 ::SelectObject(hdc, oldbitmap1);
7395 ::DeleteDC(hdc);
7396 } else {
7398 }
7399 if (ximage && bmbits) {
7400 ULong_t sz = width*height*4;
7401 ret = new unsigned char[sz];
7402 memcpy(ret, bmbits, sz);
7404 }
7405 return ret;
7406}
7407
7408////////////////////////////////////////////////////////////////////////////////
7409/// create an image from RGB data. RGB data is in format :
7410/// b1, g1, r1, 0, b2, g2, r2, 0 ... bn, gn, rn, 0 ..
7411///
7412/// Pixels are numbered from left to right and from top to bottom.
7413/// Note that data must be 32-bit aligned
7414
7416{
7418 bmp_info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
7419 bmp_info.bmiHeader.biWidth = width;
7420 bmp_info.bmiHeader.biHeight = -1 * (int)(height);
7421 bmp_info.bmiHeader.biPlanes = 1;
7422 bmp_info.bmiHeader.biBitCount = 32;
7423 bmp_info.bmiHeader.biCompression = BI_RGB;
7424 bmp_info.bmiHeader.biSizeImage = 0;
7425 bmp_info.bmiHeader.biClrUsed = 0;
7426 bmp_info.bmiHeader.biXPelsPerMeter = 0L;
7427 bmp_info.bmiHeader.biYPelsPerMeter = 0L;
7428 bmp_info.bmiHeader.biClrImportant = 0;
7429 bmp_info.bmiColors[0].rgbRed = 0;
7430 bmp_info.bmiColors[0].rgbGreen = 0;
7431 bmp_info.bmiColors[0].rgbBlue = 0;
7432 bmp_info.bmiColors[0].rgbReserved = 0;
7433
7434 HDC hdc = ::GetDC(NULL);
7435 HBITMAP hbitmap = ::CreateDIBitmap(hdc, &bmp_info.bmiHeader, CBM_INIT,
7436 (void *)bits, &bmp_info, DIB_RGB_COLORS);
7438
7439 SIZE size;
7440 // For an obscure reason, we have to set the size of the
7441 // bitmap this way before to call gdk_pixmap_foreign_new
7442 // otherwise, it fails...
7444
7446}
7447
7448////////////////////////////////////////////////////////////////////////////////
7449///register pixmap created by TGWin32GLManager
7450
7452{
7453 HBITMAP hBmp = reinterpret_cast<HBITMAP>(pix);
7454 SIZE sz = SIZE();
7455
7457 GdkPixmap *newPix = gdk_pixmap_foreign_new(reinterpret_cast<ULongptr_t>(hBmp));
7458
7460
7461 gCws = fWindows[wid].get();
7462 gCws->ispixmap = 1;
7463 gCws->window = newPix;
7464 gCws->drawing = gCws->window;
7465 gCws->double_buffer = 0;
7466 gCws->clip = 0;
7467 gCws->width = w;
7468 gCws->height = h;
7469
7470 return wid;
7471}
7472
7473////////////////////////////////////////////////////////////////////////////////
7474/// Register a window created by Qt as a ROOT window (like InitWindow()).
7475
7477{
7479
7480 gCws = fWindows[wid].get();
7481
7482 gCws->shared = true;
7483 gCws->ispixmap = 0;
7484
7485 gCws->window = gdk_window_foreign_new(qwid);
7486
7487 gCws->drawing = gCws->window;
7488 gCws->double_buffer = 0;
7489 gCws->clip = 0;
7490 gCws->width = w;
7491 gCws->height = h;
7492
7493 return wid;
7494}
7495
7496////////////////////////////////////////////////////////////////////////////////
7497/// Remove a window created by Qt.
7498
7504
7505////////////////////////////////////////////////////////////////////////////////
7506/// Returns window context for specified win id
7507
7509{
7510 if (fWindows.count(wid) == 0)
7511 return (WinContext_t) nullptr;
7512 return (WinContext_t) fWindows[wid].get();
7513}
7514
7515////////////////////////////////////////////////////////////////////////////////
7516/// The Nonrectangular Window Shape Extension adds nonrectangular
7517/// windows to the System.
7518/// This allows for making shaped (partially transparent) windows
7519
7524
7525////////////////////////////////////////////////////////////////////////////////
7526/// Returns the width of the screen in millimeters.
7527
7529{
7530 return (UInt_t)gdk_screen_width_mm();
7531}
7532
7533//------------------------------ Drag and Drop ---------------------------------
7534
7535////////////////////////////////////////////////////////////////////////////////
7536/// Deletes the specified property on the specified window.
7537
7547
7548////////////////////////////////////////////////////////////////////////////////
7549/// Returns the actual type of the property, the actual format of the property,
7550/// and a pointer to the data actually returned.
7551
7555 unsigned char **prop_list)
7556{
7557 HGLOBAL hdata;
7558 UChar_t *ptr, *data;
7559 UInt_t i, n, length;
7560
7562 if (hWnd == NULL)
7563 return 0;
7564
7565 Atom_t dndproxy = InternAtom("XdndProxy", kFALSE);
7566 Atom_t dndtypelist = InternAtom("XdndTypeList", kFALSE);
7567
7568 if (prop == dndproxy)
7569 return 0;
7570 if (prop == dndtypelist) {
7571 *act_type = XA_ATOM;
7572 *prop_list = (unsigned char *)GetProp(hWnd, (LPCTSTR)MAKELONGLONG(prop,0));
7573 for (n = 0; prop_list[n]; n++);
7574 *nitems = n;
7575 return n;
7576 }
7577 else {
7579 return 0;
7580 }
7582 ptr = (UChar_t *)GlobalLock(hdata);
7584 data = (UChar_t *)malloc(length + 1);
7585 for (i = 0; i < length; i++) {
7586 data[i] = ptr[i];
7587 }
7588 GlobalUnlock(hdata);
7590 *prop_list = data;
7591 *bytes = *nitems = length;
7592 return length;
7593 }
7594 return 0;
7595}
7596
7597////////////////////////////////////////////////////////////////////////////////
7598/// Changes the active cursor of the specified window.
7599
7609
7610////////////////////////////////////////////////////////////////////////////////
7611/// Get Clipboard data.
7612
7615{
7616 HGLOBAL hdata;
7617
7619 RegisterWindowMessage("gdk-selection-notify");
7622 return;
7623 }
7626 if (hdata == 0)
7627 return;
7628 /* Send ourselves an ersatz selection notify message so that we actually
7629 * fetch the data.
7630 */
7632}
7633
7634////////////////////////////////////////////////////////////////////////////////
7635/// Assigns owner of Clipboard.
7636
7638{
7640 RegisterWindowMessage("gdk-selection-request");
7645 if (owner) {
7647 }
7648 return kTRUE;
7649}
7650
7651////////////////////////////////////////////////////////////////////////////////
7652/// Put data into Clipboard.
7653
7656{
7657 HGLOBAL hdata;
7658 Int_t i;
7659 UChar_t *ptr;
7660
7661 if (data == 0 || len == 0)
7662 return;
7664 return;
7665 }
7667 ptr = (UChar_t *)GlobalLock(hdata);
7668 for (i = 0; i < len; i++) {
7669 *ptr++ = *data++;
7670 }
7671 GlobalUnlock(hdata);
7674}
7675
7676////////////////////////////////////////////////////////////////////////////////
7677/// Add the list of drag and drop types to the Window win.
7678
7685
7686////////////////////////////////////////////////////////////////////////////////
7687/// Recursively search in the children of Window for a Window which is at
7688/// location x, y and is DND aware, with a maximum depth of maxd.
7689/// Possibility to exclude dragwin and input.
7690
7692 int x, int y, int maxd)
7693{
7694 POINT point;
7695 POINT cpt;
7696 RECT rect;
7697 HWND hwnd, hwndc;
7698 HWND hwndt;
7700 Atom_t version = 0;
7701 Atom_t dndaware = InternAtom("XdndAware", kFALSE);
7702
7703 cpt.x = x;
7704 cpt.y = y;
7706 cpt, CWP_ALL);
7707 while (hwnd) {
7709 if (PtInRect(&rect, cpt)) {
7712 if (win && win != dragwin && win != input)
7713 return win;
7714 }
7715 Bool_t done = kFALSE;
7716 hwndt = hwnd;
7717 while (!done) {
7718 point = cpt;
7719 ::MapWindowPoints(NULL, hwndt, &point, 1);
7720 hwndc = ChildWindowFromPoint (hwndt, point);
7723 if (win && win != dragwin && win != input)
7724 return win;
7725 }
7726 if (hwndc == NULL)
7727 done = TRUE;
7728 else if (hwndc == hwndt)
7729 done = TRUE;
7730 else
7731 hwndt = hwndc;
7734 if (win && win != dragwin && win != input)
7735 return win;
7736 }
7737 }
7738 }
7740 }
7741 return kNone;
7742}
7743
7744////////////////////////////////////////////////////////////////////////////////
7745/// Checks if Window win is DND aware, and knows any of the DND formats
7746/// passed in argument.
7747
7749{
7750 if (!win) return kFALSE;
7751
7752 Atom_t version = 0;
7753 Atom_t dndaware = InternAtom("XdndAware", kFALSE);
7754 HWND window = (HWND)GDK_DRAWABLE_XID((GdkWindow *)win);
7755 while (window) {
7757 if (version) return kTRUE;
7758 window = ::GetParent(window);
7759 }
7760 return kFALSE;
7761}
7762
7763////////////////////////////////////////////////////////////////////////////////
7764/// Add XdndAware property and the list of drag and drop types to the
7765/// Window win.
7766
7768{
7769 int n;
7770 if (!id) return;
7771
7773 GWL_EXSTYLE);
7776 Atom_t dndaware = InternAtom("XdndAware", kFALSE);
7779 (HANDLE)XDND_PROTOCOL_VERSION);
7780
7781 if (typelist == 0)
7782 return;
7783 for (n = 0; typelist[n]; n++);
7784 Atom_t dndtypelist = InternAtom("XdndTypeList", kFALSE);
7787 (HANDLE)typelist);
7788
7789}
7790
7791////////////////////////////////////////////////////////////////////////////////
7792/// Set user thread id. This is used when an extra thread is created
7793/// to process events.
7794
7796{
7797 if (id == 0) {
7799 }
7800 else {
7802 }
7803}
7804
7805////////////////////////////////////////////////////////////////////////////////
7806/// Set window draw mode
7807
7809{
7810 // set TVirtualX member to support old interface
7811 fDrawMode = mode;
7812
7813 auto ctxt = (XWindow_t *) wctxt;
7814 if (!ctxt)
7815 return;
7816
7817 GdkFunction func = GDK_COPY;
7818 if (mode == kXor)
7819 func = GDK_XOR;
7820 else if (mode == kInvert)
7821 func = GDK_INVERT;
7822
7823 for (int i = 0; i < kMAXGC; i++) {
7824 if (ctxt->fGClist[i])
7825 gdk_gc_set_function(ctxt->fGClist[i], func);
7826 }
7827
7828 ctxt->drawMode = mode;
7829}
7830
7831////////////////////////////////////////////////////////////////////////////////
7832/// Returns window draw mode
7833
7835{
7836 auto ctxt = (XWindow_t *) wctxt;
7837 return ctxt ? ctxt->drawMode : kCopy;
7838}
const Int_t kPropMotifWMHintsElements
Definition GX11Gui.cxx:56
static KeySymbolMap_t gKeyMap[]
Definition GX11Gui.cxx:70
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
void SplitLong(Long_t ll, Long_t &i1, Long_t &i2)
Definition GX11Gui.cxx:145
Handle_t Atom_t
WM token.
Definition GuiTypes.h:38
Handle_t Region_t
Region handle.
Definition GuiTypes.h:33
const Mask_t kGCCapStyle
Definition GuiTypes.h:293
Handle_t WinContext_t
Window drawing context.
Definition GuiTypes.h:30
EGEventType
Definition GuiTypes.h:60
@ kSelectionClear
Definition GuiTypes.h:64
@ kConfigureNotify
Definition GuiTypes.h:63
@ kGKeyPress
Definition GuiTypes.h:61
@ kExpose
Definition GuiTypes.h:63
@ kUnmapNotify
Definition GuiTypes.h:63
@ kButtonRelease
Definition GuiTypes.h:61
@ kSelectionNotify
Definition GuiTypes.h:64
@ kButtonPress
Definition GuiTypes.h:61
@ kFocusOut
Definition GuiTypes.h:62
@ kDestroyNotify
Definition GuiTypes.h:63
@ kMotionNotify
Definition GuiTypes.h:62
@ kFocusIn
Definition GuiTypes.h:62
@ kClientMessage
Definition GuiTypes.h:64
@ kEnterNotify
Definition GuiTypes.h:62
@ kSelectionRequest
Definition GuiTypes.h:64
@ kMapNotify
Definition GuiTypes.h:63
@ kOtherEvent
Definition GuiTypes.h:65
@ kKeyRelease
Definition GuiTypes.h:61
@ kLeaveNotify
Definition GuiTypes.h:62
const Mask_t kWAOverrideRedirect
Definition GuiTypes.h:150
const Mask_t kGCBackground
Definition GuiTypes.h:290
const Mask_t kGCForeground
Definition GuiTypes.h:289
const Mask_t kGCLineStyle
Definition GuiTypes.h:292
const Mask_t kGCSubwindowMode
Definition GuiTypes.h:302
const Mask_t kGCLineWidth
Definition GuiTypes.h:291
ECursor
Definition GuiTypes.h:373
@ kRightSide
Definition GuiTypes.h:374
@ kBottomSide
Definition GuiTypes.h:374
@ kArrowRight
Definition GuiTypes.h:376
@ kTopLeft
Definition GuiTypes.h:373
@ kBottomRight
Definition GuiTypes.h:373
@ kArrowVer
Definition GuiTypes.h:375
@ kCaret
Definition GuiTypes.h:376
@ kTopSide
Definition GuiTypes.h:374
@ kLeftSide
Definition GuiTypes.h:374
@ kWatch
Definition GuiTypes.h:376
@ kMove
Definition GuiTypes.h:375
@ kTopRight
Definition GuiTypes.h:373
@ kBottomLeft
Definition GuiTypes.h:373
@ kHand
Definition GuiTypes.h:375
@ kCross
Definition GuiTypes.h:375
@ kRotate
Definition GuiTypes.h:375
@ kNoDrop
Definition GuiTypes.h:376
@ kArrowHor
Definition GuiTypes.h:375
@ kPointer
Definition GuiTypes.h:376
Handle_t Pixmap_t
Pixmap handle.
Definition GuiTypes.h:31
const Mask_t kGCTile
Definition GuiTypes.h:297
const Mask_t kWAColormap
Definition GuiTypes.h:154
const Mask_t kButtonMotionMask
Definition GuiTypes.h:165
const Mask_t kGCClipXOrigin
Definition GuiTypes.h:304
const Mask_t kFocusChangeMask
Definition GuiTypes.h:170
const Mask_t kButtonPressMask
Definition GuiTypes.h:162
Handle_t FontH_t
Font handle (as opposed to Font_t which is an index)
Definition GuiTypes.h:36
@ kNotifyNormal
Definition GuiTypes.h:220
const Mask_t kExposureMask
Definition GuiTypes.h:166
const Mask_t kWAEventMask
Definition GuiTypes.h:152
const Mask_t kGCFillStyle
Definition GuiTypes.h:295
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
const Mask_t kGCJoinStyle
Definition GuiTypes.h:294
const Mask_t kKeyReleaseMask
Definition GuiTypes.h:161
const Mask_t kWABackPixel
Definition GuiTypes.h:141
Handle_t Display_t
Display handle.
Definition GuiTypes.h:27
const Mask_t kGCFunction
Definition GuiTypes.h:287
const Mask_t kAnyModifier
Definition GuiTypes.h:211
EGraphicsFunction
Definition GuiTypes.h:68
@ kGXorReverse
src OR NOT dst
Definition GuiTypes.h:80
@ kGXnand
NOT src OR NOT dst.
Definition GuiTypes.h:83
@ kGXandReverse
src AND NOT dst
Definition GuiTypes.h:71
@ kGXor
src OR dst
Definition GuiTypes.h:76
@ kGXcopy
src
Definition GuiTypes.h:72
@ kGXorInverted
NOT src OR dst.
Definition GuiTypes.h:82
@ kGXandInverted
NOT src AND dst.
Definition GuiTypes.h:73
@ kGXequiv
NOT src XOR dst.
Definition GuiTypes.h:78
@ kGXset
1
Definition GuiTypes.h:84
@ kGXnoop
dst
Definition GuiTypes.h:74
@ kGXinvert
NOT dst.
Definition GuiTypes.h:79
@ kGXxor
src XOR dst
Definition GuiTypes.h:75
@ kGXand
src AND dst
Definition GuiTypes.h:70
@ kGXclear
0
Definition GuiTypes.h:69
@ kGXcopyInverted
NOT src.
Definition GuiTypes.h:81
const Mask_t kKeyPressMask
Definition GuiTypes.h:160
ULong_t Time_t
Event time.
Definition GuiTypes.h:43
Handle_t GContext_t
Graphics context handle.
Definition GuiTypes.h:39
EInitialState
Initial window mapping state.
Definition GuiTypes.h:346
@ kNormalState
Definition GuiTypes.h:347
@ kIconicState
Definition GuiTypes.h:348
const Mask_t kGCTileStipXOrigin
Definition GuiTypes.h:299
Handle_t Drawable_t
Drawable handle.
Definition GuiTypes.h:32
const Mask_t kGCFont
Definition GuiTypes.h:301
const Mask_t kPointerMotionMask
Definition GuiTypes.h:164
@ kTempFrame
Definition GuiTypes.h:394
@ kTransientFrame
Definition GuiTypes.h:393
@ kMainFrame
Definition GuiTypes.h:381
Handle_t Cursor_t
Cursor handle.
Definition GuiTypes.h:35
const Handle_t kNone
Definition GuiTypes.h:89
const Mask_t kLeaveWindowMask
Definition GuiTypes.h:169
const Mask_t kStructureNotifyMask
Definition GuiTypes.h:167
@ kIsViewable
Definition GuiTypes.h:47
@ kInputOutput
Definition GuiTypes.h:48
@ kClipByChildren
Definition GuiTypes.h:54
@ kIsUnviewable
Definition GuiTypes.h:47
@ kNotUseful
Definition GuiTypes.h:46
@ kIsUnmapped
Definition GuiTypes.h:47
@ kIncludeInferiors
Definition GuiTypes.h:54
const Handle_t kParentRelative
Definition GuiTypes.h:91
UInt_t Mask_t
Structure mask type.
Definition GuiTypes.h:42
const Mask_t kGCStipple
Definition GuiTypes.h:298
const Mask_t kButtonReleaseMask
Definition GuiTypes.h:163
const Mask_t kGCGraphicsExposures
Definition GuiTypes.h:303
const Mask_t kGCClipYOrigin
Definition GuiTypes.h:305
const Mask_t kEnterWindowMask
Definition GuiTypes.h:168
const Mask_t kGCClipMask
Definition GuiTypes.h:306
const Mask_t kGCTileStipYOrigin
Definition GuiTypes.h:300
const Mask_t kWACursor
Definition GuiTypes.h:155
EMouseButton
Button names.
Definition GuiTypes.h:215
@ kButton4
Definition GuiTypes.h:216
@ kButton5
Definition GuiTypes.h:216
Handle_t Colormap_t
Colormap handle.
Definition GuiTypes.h:34
const Mask_t kWABackPixmap
Definition GuiTypes.h:140
const Mask_t kWABorderWidth
Definition GuiTypes.h:144
ULongptr_t Handle_t
Generic resource handle.
Definition GuiTypes.h:26
Handle_t FontStruct_t
Pointer to font structure.
Definition GuiTypes.h:40
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_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_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_Pause
Definition KeySymbols.h:34
@ kKey_Minus
Definition KeySymbols.h:106
#define d(i)
Definition RSha256.hxx:102
#define b(i)
Definition RSha256.hxx:100
#define f(i)
Definition RSha256.hxx:104
#define c(i)
Definition RSha256.hxx:101
#define g(i)
Definition RSha256.hxx:105
#define a(i)
Definition RSha256.hxx:99
#define h(i)
Definition RSha256.hxx:106
const unsigned char gStipples[26][32]
Definition RStipples.h:24
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
short Style_t
Style number (short)
Definition RtypesCore.h:96
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:77
unsigned short UShort_t
Unsigned Short integer 2 bytes (unsigned short)
Definition RtypesCore.h:54
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
short Color_t
Color number (short)
Definition RtypesCore.h:99
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
Definition RtypesCore.h:89
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char)
Definition RtypesCore.h:52
constexpr ULong_t kBitsPerByte
Definition RtypesCore.h:130
int Seek_t
File pointer (int).
Definition RtypesCore.h:67
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
Definition RtypesCore.h:69
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
Definition RtypesCore.h:68
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
Definition RtypesCore.h:60
unsigned long ULongptr_t
Unsigned integer large enough to hold a pointer (platform-dependent)
Definition RtypesCore.h:90
short Width_t
Line width (short)
Definition RtypesCore.h:98
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
short Font_t
Font number (short)
Definition RtypesCore.h:95
short Short_t
Signed Short integer 2 bytes (short)
Definition RtypesCore.h:53
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
#define BIT(n)
Definition Rtypes.h:91
#define TESTBIT(n, i)
Definition Rtypes.h:94
R__EXTERN TApplication * gApplication
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TEnv * gEnv
Definition TEnv.h:170
#define CALLBACK
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pix
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 chupy
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 cindex
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t pict_mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest_x
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t cursor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t hmin
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void cmap
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t atom
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t act_type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t pict
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t del
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t 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 wid
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 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 qwid
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 mgn
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 index
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 fontnumber
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
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 markerstyle
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 chupx
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 CreatePixmap
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char pxname
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 PutPixel
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 textsize
Option_t Option_t TPoint TPoint angle
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 xy
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void xpos
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest_y
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t winc
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t modifier
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t org
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char backcolor
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void SetInputFocus
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 SetCursor
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 ypos
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 DrawText
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 style
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
const int kGCpxmp
Definition TGWin32.cxx:127
void gdk_win32_draw_segments(GdkDrawable *drawable, GdkGC *gc, GdkSegment *segs, gint nsegs)
#define XDND_PROTOCOL_VERSION
Definition TGWin32.cxx:67
#define BITmask(x)
static void _set_event_time(GdkEvent &event, UInt_t time)
Definition TGWin32.cxx:5912
void gdk_win32_draw_text(GdkDrawable *drawable, GdkFont *font, GdkGC *gc, gint x, gint y, const gchar *text, gint text_length)
void gdk_win32_draw_polygon(GdkDrawable *drawable, GdkGC *gc, gint filled, GdkPoint *points, gint npoints)
const int kMAXGC
Definition TGWin32.cxx:125
void gdk_win32_draw_lines(GdkDrawable *drawable, GdkGC *gc, GdkPoint *points, gint npoints)
const int kGCline
Definition TGWin32.cxx:126
void gdk_win32_draw_points(GdkDrawable *drawable, GdkGC *gc, GdkPoint *points, gint npoints)
const int kGCinvt
Definition TGWin32.cxx:127
const int kGCtext
Definition TGWin32.cxx:127
void gdk_win32_draw_arc(GdkDrawable *drawable, GdkGC *gc, gint filled, gint x, gint y, gint width, gint height, gint angle1, gint angle2)
int gdk_debug_level
Definition TGWin32.cxx:172
#define IDC_HAND
Definition TGWin32.cxx:69
EAlign
Definition TGWin32.cxx:122
@ kBRight
Definition TGWin32.cxx:123
@ kTRight
Definition TGWin32.cxx:122
@ kTLeft
Definition TGWin32.cxx:122
@ kBCenter
Definition TGWin32.cxx:123
@ kBLeft
Definition TGWin32.cxx:123
@ kAlignNone
Definition TGWin32.cxx:122
@ kMLeft
Definition TGWin32.cxx:122
@ kMCenter
Definition TGWin32.cxx:122
@ kTCenter
Definition TGWin32.cxx:122
@ kMRight
Definition TGWin32.cxx:122
void gdk_win32_draw_rectangle(GdkDrawable *drawable, GdkGC *gc, gint filled, gint x, gint y, gint width, gint height)
const int kGCmark
Definition TGWin32.cxx:126
#define MAKELONGLONG(lo, hi)
Definition TGWin32.cxx:75
const int kGCfill
Definition TGWin32.cxx:126
const int kGCdash
Definition TGWin32.cxx:127
#define safestrlen(s)
Definition TGWin32.cxx:6540
unsigned long KeySym
Definition TGWin32.h:54
static int gMarkerJoinStyle
Definition TGX11.cxx:156
static int gMarkerLineStyle
Definition TGX11.cxx:154
static ULong_t gKeybdMask
Definition TGX11.cxx:171
static int gCapStyle
Definition TGX11.cxx:161
static GC gGCecho
Definition TGX11.cxx:91
static Cursor gNullCursor
Definition TGX11.cxx:181
char name[80]
Definition TGX11.cxx:148
static XWindow_t * gTws
Definition TGX11.cxx:137
const int kMAXGC
Definition TGX11.cxx:87
const char null_cursor_bits[]
Definition TGX11.cxx:177
const Int_t kBIGGEST_RGB_VALUE
Definition TGX11.cxx:139
static ULong_t gMouseMask
Definition TGX11.cxx:167
static int gJoinStyle
Definition TGX11.cxx:162
static int gMarkerCapStyle
Definition TGX11.cxx:155
static XFontStruct * gTextFont
Definition TGX11.cxx:151
static XWindow_t * gCws
Definition TGX11.cxx:136
float xmin
float ymin
float xmax
float ymax
Int_t gDebug
Global variable setting the debug level. Set to 0 to disable, increase it in steps of 1 to increase t...
Definition TROOT.cxx:783
#define gROOT
Definition TROOT.h:426
R__EXTERN TStyle * gStyle
Definition TStyle.h:442
R__EXTERN TSystem * gSystem
Definition TSystem.h:582
#define gVirtualX
Definition TVirtualX.h:368
R__EXTERN TVirtualX *(* gPtr2VirtualX)()
Definition TVirtualX.h:369
R__EXTERN Atom_t gWM_DELETE_WINDOW
Definition TVirtualX.h:38
R__EXTERN TWin32SplashThread * gSplash
R__EXTERN ULongptr_t gConsoleWindow
segment * segs
Definition X3DBuffer.c:23
#define free
Definition civetweb.c:1578
#define calloc
Definition civetweb.c:1576
#define malloc
Definition civetweb.c:1575
const_iterator begin() const
const_iterator end() const
char ** Argv() const
Fill Area Attributes class.
Definition TAttFill.h:21
virtual Color_t GetFillColor() const
Return the fill area color.
Definition TAttFill.h:32
virtual Style_t GetFillStyle() const
Return the fill area style.
Definition TAttFill.h:33
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:40
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition TAttFill.h:42
Line Attributes class.
Definition TAttLine.h:21
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition TAttLine.h:46
virtual Width_t GetLineWidth() const
Return the line width.
Definition TAttLine.h:38
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition TAttLine.h:47
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition TAttLine.h:44
virtual Style_t GetLineStyle() const
Return the line style.
Definition TAttLine.h:37
Marker Attributes class.
Definition TAttMarker.h:21
virtual Style_t GetMarkerStyle() const
Return the marker style.
Definition TAttMarker.h:34
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition TAttMarker.h:41
virtual Size_t GetMarkerSize() const
Return the marker size.
Definition TAttMarker.h:35
static Width_t GetMarkerLineWidth(Style_t style)
Internal helper function that returns the line width of the given marker style (0 = filled marker)
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Definition TAttMarker.h:43
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition TAttMarker.h:48
static Style_t GetMarkerStyleBase(Style_t style)
Internal helper function that returns the corresponding marker style with line width 1 for the given ...
Text Attributes class.
Definition TAttText.h:21
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition TAttText.h:46
Float_t fTextAngle
Text angle.
Definition TAttText.h:24
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
Definition TAttText.h:48
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Definition TAttText.h:50
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition TAttText.h:51
Float_t fTextSize
Text size.
Definition TAttText.h:25
The color creation and management class.
Definition TColor.h:22
Float_t GetRed() const
Definition TColor.h:61
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition TColor.cxx:1926
Float_t GetBlue() const
Definition TColor.h:63
Float_t GetGreen() const
Definition TColor.h:62
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition TEnv.cxx:503
Bool_t Next(ULong64_t &hash, Long64_t &key, Long64_t &value)
Get next entry from TExMap. Returns kFALSE at end of map.
Definition TExMap.cxx:410
This class stores a (key,value) pair using an external hash.
Definition TExMap.h:33
void Add(ULong64_t hash, Long64_t key, Long64_t value)
Add an (key,value) pair to the table. The key should be unique.
Definition TExMap.cxx:87
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
Definition TExMap.cxx:173
Proxy classes provide thread-safe interface to global objects.
static ULong_t fgPingMessageId
ping message ID
static void GlobalUnlock()
unlock any proxy (client thread)
static UInt_t fMaxResponseTime
max period for waiting response from server thread
static void GlobalLock()
lock any proxy (client thread)
static ULong_t fgUserThreadId
user (e.g. python) thread ID
static ULong_t fgPostMessageId
post message ID
static ULong_t fgMainThreadId
main thread ID
static TVirtualX * fgRealObject
static TVirtualX * ProxyObject()
static TVirtualX * RealObject()
void DrawFillAreaW(WinContext_t wctxt, Int_t n, TPoint *xy) override
Fill area described by polygon in a specified window.
Definition TGWin32.cxx:1719
void DrawImage(FT_Bitmap *source, ULong_t fore, ULong_t back, GdkImage *xim, Int_t bx, Int_t by)
Draw FT_Bitmap bitmap to xim image at position bx,by using specified foreground color.
Definition TGWin32.cxx:1160
Cursor_t CreateCursor(ECursor cursor) override
Create cursor handle (just return cursor from cursor pool fCursors).
Definition TGWin32.cxx:5553
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 TGWin32.cxx:6621
void SetDoubleBuffer(Int_t wid, Int_t mode) override
Set the double buffer on/off on window wid.
Definition TGWin32.cxx:3004
void DrawText(Int_t x, Int_t y, Float_t angle, Float_t mgn, const char *text, ETextMode mode) override
Draw text using TrueType fonts.
Definition TGWin32.cxx:1280
Int_t GetDoubleBuffer(Int_t wid) override
Query the double buffer value for the window wid.
Definition TGWin32.cxx:1960
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 TGWin32.cxx:6787
void MapModifierState(UInt_t &state, UInt_t &xstate, Bool_t tox=kTRUE)
Map modifier key state to or from X.
Definition TGWin32.cxx:5900
GdkImage * GetBackground(WinContext_t wctxt, Int_t x, Int_t y, UInt_t w, UInt_t h)
Get the background of the current window in an XImage.
Definition TGWin32.cxx:1335
void SetFillColor(Color_t cindex) override
Set color index for fill areas.
Definition TGWin32.cxx:3086
void DestroyRegion(Region_t reg) override
Destroy region.
Definition TGWin32.cxx:7142
void GetRGB(Int_t index, Float_t &r, Float_t &g, Float_t &b) override
Get rgb values for color "index".
Definition TGWin32.cxx:2030
void SetColor(XWindow_t *ctxt, GdkGC *gc, Int_t ci)
Set the foreground color in GdkGC.
Definition TGWin32.cxx:2930
void DeleteGC(GContext_t gc) override
Explicitely delete a graphics context.
Definition TGWin32.cxx:5545
void ClearWindow() override
Clear current window.
Definition TGWin32.cxx:1533
void MapSetWindowAttributes(SetWindowAttributes_t *attr, ULong_t &xmask, GdkWindowAttr &xattr)
Map a SetWindowAttributes_t to a GdkWindowAttr structure.
Definition TGWin32.cxx:5003
Window_t GetInputFocus() override
Returns the window id of the window having the input focus.
Definition TGWin32.cxx:6813
virtual void GetTextExtent(UInt_t &w, UInt_t &h, char *mess) override
Return the size of a character string.
Definition TGWin32.cxx:2050
void SetRGB(Int_t cindex, Float_t r, Float_t g, Float_t b) override
Set color intensities for given color index.
Definition TGWin32.cxx:4060
void SetFillStyle(Style_t style) override
Set fill area style.
Definition TGWin32.cxx:3113
void SetDoubleBufferON() override
Turn double buffer mode on.
Definition TGWin32.cxx:3050
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 TGWin32.cxx:7520
void SetOpacity(Int_t percent) override
Set opacity of a current window.
Definition TGWin32.cxx:4050
char ** ListFonts(const char *fontname, Int_t max, Int_t &count) override
Return list of font names matching "fontname".
Definition TGWin32.cxx:7246
void GetFontProperties(FontStruct_t font, Int_t &max_ascent, Int_t &max_descent) override
Return some font properties.
Definition TGWin32.cxx:6701
FontStruct_t LoadQueryFont(const char *font_name) override
Load font and query font.
Definition TGWin32.cxx:5396
void ChangeProperties(Window_t id, Atom_t property, Atom_t type, Int_t format, UChar_t *data, Int_t len) override
Put data into Clipboard.
Definition TGWin32.cxx:7654
void SetDrawMode(EDrawMode mode) override
Set the drawing mode.
Definition TGWin32.cxx:3078
void CloseWindow() override
Delete current window.
Definition TGWin32.cxx:1570
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 TGWin32.cxx:6960
void RaiseWindow(Window_t id) override
Put window on top of window stack.
Definition TGWin32.cxx:4698
Bool_t ParseColor(Colormap_t cmap, const char *cname, ColorStruct_t &color) override
Parse string cname containing color name, like "green" or "#00FF00".
Definition TGWin32.cxx:5747
Float_t fCharacterUpY
Character Up vector along Y.
Definition TGWin32.h:108
Int_t KeysymToKeycode(UInt_t keysym) override
Convert a keysym to the appropriate keycode.
Definition TGWin32.cxx:6755
Int_t InitWindow(ULongptr_t window) override
Open window and return window number.
Definition TGWin32.cxx:2174
void SetTextFont(Font_t fontnumber) override
Set specified font.
Definition TGWin32.cxx:1492
void SetAttLine(WinContext_t wctxt, const TAttLine &att) override
Set line attributes for specified window.
Definition TGWin32.cxx:3277
Int_t fDepth
Number of color planes.
Definition TGWin32.h:110
void DrawLine(Int_t x1, Int_t y1, Int_t x2, Int_t y2) override
Draw a line.
Definition TGWin32.cxx:1743
void GetGeometry(Int_t wid, Int_t &x, Int_t &y, UInt_t &w, UInt_t &h) override
Return position and size of window wid.
Definition TGWin32.cxx:1981
void GetPlanes(Int_t &nplanes) override
Get maximum number of planes.
Definition TGWin32.cxx:2022
Float_t fTextMagnitude
Text Magnitude.
Definition TGWin32.h:109
void RescaleWindow(Int_t wid, UInt_t w, UInt_t h) override
Rescale the window wid.
Definition TGWin32.cxx:2688
void ChangeWindowAttributes(Window_t id, SetWindowAttributes_t *attr) override
Change window attributes.
Definition TGWin32.cxx:6341
void SetIconPixmap(Window_t id, Pixmap_t pic) override
Set pixmap the WM can use when the window is iconized.
Definition TGWin32.cxx:6533
void UnionRectWithRegion(Rectangle_t *rect, Region_t src, Region_t dest) override
Union of rectangle with a region.
Definition TGWin32.cxx:7150
Int_t RequestLocator(Int_t mode, Int_t ctyp, Int_t &x, Int_t &y) override
Request Locator position.
Definition TGWin32.cxx:2297
void SetClassHints(Window_t id, char *className, char *resourceName) override
Set the windows class and resource name.
Definition TGWin32.cxx:6545
WinContext_t GetWindowContext(Int_t wid) override
Returns window context for specified win id.
Definition TGWin32.cxx:7508
void ClearArea(Window_t id, Int_t x, Int_t y, UInt_t w, UInt_t h) override
Clear a window area to the bakcground color.
Definition TGWin32.cxx:6409
void DeleteProperty(Window_t, Atom_t &) override
Deletes the specified property on the specified window.
Definition TGWin32.cxx:7538
Window_t GetParent(Window_t id) const override
Return the parent of the window.
Definition TGWin32.cxx:5384
void DrawLineW(WinContext_t wctxt, Int_t x1, Int_t y1, Int_t x2, Int_t y2) override
Draw a line on specified window.
Definition TGWin32.cxx:1753
void GetImageSize(Drawable_t id, UInt_t &width, UInt_t &height) override
Returns the width and height of the image id.
Definition TGWin32.cxx:7287
void Update(Int_t mode=0) override
Flush (mode = 0, default) or synchronize (mode = 1) X output buffer.
Definition TGWin32.cxx:7126
TGWin32()
Default constructor.
Definition TGWin32.cxx:776
void SetCharacterUp(Float_t chupx, Float_t chupy) override
Set character up vector.
Definition TGWin32.cxx:2845
void SetOpacityW(WinContext_t wctxt, Int_t percent) override
Set opacity of a specified window.
Definition TGWin32.cxx:4169
GdkColormap * fColormap
Default colormap, 0 if b/w.
Definition TGWin32.h:103
ULong_t GetPixel(Color_t cindex) override
Return pixel value associated to specified ROOT color number.
Definition TGWin32.cxx:2918
void SendEvent(Window_t id, Event_t *ev) override
Send event ev to window id.
Definition TGWin32.cxx:5849
Int_t RequestString(Int_t x, Int_t y, char *text) override
Request a string.
Definition TGWin32.cxx:2452
Int_t AddWindowHandle()
Add new window handle Only for private usage.
Definition TGWin32.cxx:2091
void SetUserThreadId(ULong_t id)
Set user thread id.
Definition TGWin32.cxx:7795
Bool_t IsVisible(WinContext_t wctxt, Int_t x, Int_t y, UInt_t w, UInt_t h)
Test if there is really something to render.
Definition TGWin32.cxx:1362
Int_t fBlueDiv
Blue value divider.
Definition TGWin32.h:113
void Align(WinContext_t wctxt)
Compute alignment variables.
Definition TGWin32.cxx:1128
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 TGWin32.cxx:5815
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 TGWin32.cxx:6468
void DrawCellArray(Int_t x1, Int_t y1, Int_t x2, Int_t y2, Int_t nx, Int_t ny, Int_t *ic) override
Draw a cell array.
Definition TGWin32.cxx:1678
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 TGWin32.cxx:5440
GdkVisual * fVisual
Definition TGWin32.h:102
Int_t fGreenShift
Bits to left shift green.
Definition TGWin32.h:115
Bool_t ReadPictureDataFromFile(const char *filename, char ***ret_data) override
Read picture data from file and store in ret_data.
Definition TGWin32.cxx:5684
void DrawBoxW(WinContext_t wctxt, Int_t x1, Int_t y1, Int_t x2, Int_t y2, EBoxMode mode) override
Draw a box on specified window.
Definition TGWin32.cxx:1642
void UpdateWindowW(WinContext_t wctxt, Int_t mode) override
Update current window mode : (1) update (0) sync.
Definition TGWin32.cxx:4151
void MapSubwindows(Window_t id) override
Maps all subwindows for the specified window "id" in top-to-bottom stacking order.
Definition TGWin32.cxx:4627
void Bell(Int_t percent) override
Sets the sound bell. Percent is loudness from -100% to 100%.
Definition TGWin32.cxx:6318
void SetCursor(Int_t wid, ECursor cursor) override
Set the cursor.
Definition TGWin32.cxx:2972
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 TGWin32.cxx:7748
void LowerWindow(Window_t id) override
Lower window so it lays below all its siblings.
Definition TGWin32.cxx:4717
void ReparentWindow(Window_t id, Window_t pid, Int_t x, Int_t y) override
Reparent window, make pid the new parent and position the window at position (x,y) in new parent.
Definition TGWin32.cxx:4783
void UnmapWindow(Window_t id) override
Unmap window from screen.
Definition TGWin32.cxx:4665
void CloseDisplay() override
close display (terminate server/gMainThread thread)
Definition TGWin32.cxx:849
void SetWMTransientHint(Window_t id, Window_t main_id) override
Tell window manager that window is a transient window of gdk_parent_root.
Definition TGWin32.cxx:6669
void SetWMPosition(Window_t id, Int_t x, Int_t y) override
Tells the window manager the desired position [x,y] of window "id".
Definition TGWin32.cxx:6596
void DrawTextW(WinContext_t wctxt, Int_t x, Int_t y, Float_t angle, Float_t mgn, const char *text, ETextMode mode) override
Draw text using TrueType fonts on specified window.
Definition TGWin32.cxx:1291
void DestroySubwindows(Window_t id) override
Destroy all internal subwindows.
Definition TGWin32.cxx:4688
unsigned char * GetColorBits(Drawable_t wid, Int_t x, Int_t y, UInt_t width, UInt_t height) override
Gets DIB bits x, y, width, height - position of bitmap returns a pointer on bitmap bits array in form...
Definition TGWin32.cxx:7354
Int_t TextWidth(FontStruct_t font, const char *s, Int_t len) override
Return length of string in pixels. Size depends on font.
Definition TGWin32.cxx:6693
void Sync(Int_t mode) override
Set synchronisation on or off.
Definition TGWin32.cxx:4124
void Warp(Int_t ix, Int_t iy, Window_t id=0) override
Set pointer position.
Definition TGWin32.cxx:4283
void WritePixmap(Int_t wid, UInt_t w, UInt_t h, char *pxname) override
Write the pixmap wid in the bitmap file pxname.
Definition TGWin32.cxx:4307
void MapEventMask(UInt_t &emask, UInt_t &xemask, Bool_t tox=kTRUE)
Map event mask to or from gdk.
Definition TGWin32.cxx:4924
Float_t fCharacterUpX
Character Up vector along X.
Definition TGWin32.h:107
void GetGCValues(GContext_t gc, GCValues_t &gval) override
Get current values from graphics context gc.
Definition TGWin32.cxx:6713
void SetMarkerSize(Float_t markersize) override
Set marker size index.
Definition TGWin32.cxx:3353
Window_t GetWindowID(Int_t wid) override
Return the X11 window identifier.
Definition TGWin32.cxx:2061
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 TGWin32.cxx:7691
void XorRegion(Region_t rega, Region_t regb, Region_t result) override
Calculate the difference between the union and intersection of two regions.
Definition TGWin32.cxx:7201
Bool_t fHasTTFonts
True when TrueType fonts are used.
Definition TGWin32.h:105
void MapEvent(Event_t &ev, GdkEvent &xev, Bool_t tox=kTRUE)
Map Event_t structure to gdk_event structure.
Definition TGWin32.cxx:5956
void IconifyWindow(Window_t id) override
Iconify the window.
Definition TGWin32.cxx:4771
Int_t fRedShift
Bits to left shift red, -1 if no TrueColor visual.
Definition TGWin32.h:114
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 TGWin32.cxx:5600
void FreeFontStruct(FontStruct_t fs) override
Free font structure returned by GetFontStruct().
Definition TGWin32.cxx:6735
void CopyPixmapW(WinContext_t wctxt, Int_t wid, Int_t xpos, Int_t ypos) override
Copy the pixmap wid at the position xpos, ypos in the specified window.
Definition TGWin32.cxx:4262
Bool_t EqualRegion(Region_t rega, Region_t regb) override
Returns true if two regions are equal.
Definition TGWin32.cxx:7225
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 TGWin32.cxx:6765
FontStruct_t GetFontStruct(FontH_t fh) override
Retrieve associated font structure once we have the font handle.
Definition TGWin32.cxx:6727
void GetCharacterUp(Float_t &chupx, Float_t &chupy) override
Return character up vector.
Definition TGWin32.cxx:1911
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 TGWin32.cxx:6679
void SetAttText(WinContext_t wctxt, const TAttText &att) override
Set text attributes for speicfied window.
Definition TGWin32.cxx:3974
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 TGWin32.cxx:7217
std::unordered_map< Int_t, std::unique_ptr< XWindow_t > > fWindows
Definition TGWin32.h:78
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 TGWin32.cxx:7015
void SetWMState(Window_t id, EInitialState state) override
Set the initial state of the window. Either kNormalState or kIconicState.
Definition TGWin32.cxx:6646
void DrawPolyLineW(WinContext_t wctxt, Int_t n, TPoint *xy) override
Draw a line through all points in specified window.
Definition TGWin32.cxx:1782
void DeleteFont(FontStruct_t fs) override
Explicitely delete font structure obtained with LoadQueryFont().
Definition TGWin32.cxx:5431
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 TGWin32.cxx:6493
Int_t fScreenNumber
Screen number.
Definition TGWin32.h:104
void RenderString(WinContext_t wctxt, Int_t x, Int_t y, ETextMode mode)
Perform the string rendering in the pad.
Definition TGWin32.cxx:1385
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 TGWin32.cxx:6861
Region_t PolygonRegion(Point_t *points, Int_t np, Bool_t winding) override
Create region for the polygon defined by the points array.
Definition TGWin32.cxx:7164
void MapGCValues(GCValues_t &gval, ULong_t &xmask, GdkGCValues &xgval, Bool_t tox=kTRUE)
Map a GCValues_t to a XCGValues structure if tox is true.
Definition TGWin32.cxx:5036
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 TGWin32.cxx:7102
void SetTextColor(Color_t cindex) override
Set color index for text.
Definition TGWin32.cxx:4110
void SetWindowName(Window_t id, char *name) override
Set window name.
Definition TGWin32.cxx:6513
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 gdk window.
Definition TGWin32.cxx:4819
void ChangeActivePointerGrab(Window_t, UInt_t, Cursor_t) override
Changes the active cursor of the specified window.
Definition TGWin32.cxx:7600
void MoveWindow(Int_t wid, Int_t x, Int_t y) override
Move the window wid.
Definition TGWin32.cxx:2073
void WMDeleteNotify(Window_t id) override
Tell WM to send message when window is closed via WM.
Definition TGWin32.cxx:6419
Style_t GetLineStyle() const override
Return current line style.
Definition TGWin32.cxx:3243
void SetForeground(GContext_t gc, ULong_t foreground) override
Set foreground color in graphics context (shortcut for ChangeGC with only foreground mask set).
Definition TGWin32.cxx:7087
void DestroyWindow(Window_t id) override
Destroy window.
Definition TGWin32.cxx:4675
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, and a pointer to the data...
Definition TGWin32.cxx:7552
Int_t EventsPending() override
Returns number of pending events.
Definition TGWin32.cxx:5863
static void Unlock()
Definition TGWin32.cxx:893
void SetPrimarySelectionOwner(Window_t id) override
Makes the window id the current owner of the primary selection.
Definition TGWin32.cxx:6843
void SetLineStyle(Style_t linestyle) override
Set line style.
Definition TGWin32.cxx:3230
void FreeColor(Colormap_t cmap, ULong_t pixel) override
Free color cell with specified pixel value.
Definition TGWin32.cxx:5805
TObject * fRefreshTimer
TGWin32RefreshTimer for GUI thread message handler.
Definition TGWin32.h:118
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 TGWin32.cxx:6584
void QueryColor(Colormap_t cmap, ColorStruct_t &color) override
Fill in the primary color components for a specific pixel value.
Definition TGWin32.cxx:5787
void IntersectRegion(Region_t rega, Region_t regb, Region_t result) override
Compute the intersection of rega and regb and return result region.
Definition TGWin32.cxx:7183
void QueryColors(GdkColormap *cmap, GdkColor *colors, Int_t ncolors)
Returns the current RGB value for the pixel in the XColor structure.
Definition TGWin32.cxx:1101
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 TGWin32.cxx:6875
void MoveResizeWindow(Window_t id, Int_t x, Int_t y, UInt_t w, UInt_t h) override
Move and resize a window.
Definition TGWin32.cxx:4743
void SetAttFill(WinContext_t wctxt, const TAttFill &att) override
Set fill attributes for specified window.
Definition TGWin32.cxx:3136
Bool_t EmptyRegion(Region_t reg) override
Return true if the region is empty.
Definition TGWin32.cxx:7209
void MapColorStruct(ColorStruct_t *color, GdkColor &xcolor)
Map a ColorStruct_t to a XColor structure.
Definition TGWin32.cxx:5732
Int_t ResizePixmap(Int_t wid, UInt_t w, UInt_t h) override
Resize a pixmap.
Definition TGWin32.cxx:2727
void SetWMSize(Window_t id, UInt_t w, UInt_t h) override
Tells window manager the desired size of window "id".
Definition TGWin32.cxx:6610
static void Lock()
Definition TGWin32.cxx:885
void ClosePixmap() override
Delete current pixmap.
Definition TGWin32.cxx:1562
Handle_t fXEvent
Current native (GDK) event.
Definition TGWin32.h:117
void RemovePixmap(GdkDrawable *pix)
Remove the pixmap pix.
Definition TGWin32.cxx:2266
void SelectWindow(Int_t wid) override
Select window to which subsequent output is directed.
Definition TGWin32.cxx:2819
Int_t fRedDiv
Red value divider, -1 if no TrueColor visual.
Definition TGWin32.h:111
void SetLineType(Int_t n, Int_t *dash) override
Set line type.
Definition TGWin32.cxx:3222
void SetTextAlign(Short_t talign=11) override
Set text alignment.
Definition TGWin32.cxx:4097
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 TGWin32.cxx:6386
Region_t CreateRegion() override
Create a new empty region.
Definition TGWin32.cxx:7134
const char * DisplayName(const char *dpyName=0) override
Return hostname on which the display is opened.
Definition TGWin32.cxx:2014
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 TGWin32.cxx:4443
void SetTextSize(Float_t textsize) override
Set current text size.
Definition TGWin32.cxx:1520
void DrawPolyMarker(Int_t n, TPoint *xy) override
Draw n markers with the current attributes at position x, y.
Definition TGWin32.cxx:1836
Display_t GetDisplay() const override
Returns handle to display (might be useful in some cases where direct X11 manipulation outside of TVi...
Definition TGWin32.cxx:5346
void DrawBox(Int_t x1, Int_t y1, Int_t x2, Int_t y2, EBoxMode mode) override
Draw a box.
Definition TGWin32.cxx:1632
GdkGC * GetGC(Int_t which) const
Return desired Graphics Context ("which" maps directly on gGCList[]).
Definition TGWin32.cxx:1943
void ChangeGC(GContext_t gc, GCValues_t *gval) override
Change entries in an existing graphics context, gc, by values from gval.
Definition TGWin32.cxx:5459
void SetMarkerColor(Color_t cindex) override
Set color index for markers.
Definition TGWin32.cxx:3337
void GrabKey(Window_t id, Int_t keycode, UInt_t modifier, Bool_t grab=kTRUE) override
Establish passive grab on a certain key.
Definition TGWin32.cxx:6449
void SubtractRegion(Region_t rega, Region_t regb, Region_t result) override
Subtract rega from regb.
Definition TGWin32.cxx:7192
XColor_t & GetColor(Int_t cid)
Return reference to internal color structure associated to color index cid.
Definition TGWin32.cxx:1921
void DrawLinesSegmentsW(WinContext_t wctxt, Int_t n, TPoint *xy) override
Draw N segments on specified window n : number of segments xy : list of points, 2*N size.
Definition TGWin32.cxx:1824
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 TGWin32.cxx:6776
void SetDashes(GContext_t gc, Int_t offset, const char *dash_list, Int_t n) override
Specify a dash pattertn.
Definition TGWin32.cxx:5714
void DeletePixmap(Pixmap_t pmap) override
Explicitely delete pixmap resource.
Definition TGWin32.cxx:5614
void FreeFontNames(char **fontlist) override
Frees the specified the array of strings "fontlist".
Definition TGWin32.cxx:7270
void MapWindow(Window_t id) override
Map window on screen.
Definition TGWin32.cxx:4612
Int_t WriteGIF(char *name) override
Writes the current window into GIF file.
Definition TGWin32.cxx:4347
void DeleteImage(Drawable_t img) override
Deallocates the memory associated with the image img.
Definition TGWin32.cxx:7339
void PutPixel(Drawable_t id, Int_t x, Int_t y, ULong_t pixel) override
Overwrites the pixel in the image with the specified pixel value.
Definition TGWin32.cxx:7296
void ConvertSelection(Window_t, Atom_t &, Atom_t &, Atom_t &, Time_t &) override
Get Clipboard data.
Definition TGWin32.cxx:7613
void SetIconName(Window_t id, char *name) override
Set window icon name.
Definition TGWin32.cxx:6523
Bool_t SetSelectionOwner(Window_t, Atom_t &) override
Assigns owner of Clipboard.
Definition TGWin32.cxx:7637
Window_t GetPrimarySelectionOwner() override
Returns the window id of the current owner of the primary selection.
Definition TGWin32.cxx:6834
Width_t GetLineWidth() const override
Return current line width.
Definition TGWin32.cxx:3267
void SetMarkerStyle(Style_t markerstyle) override
Set marker style.
Definition TGWin32.cxx:3369
void DeletePictureData(void *data) override
Delete picture data created by the function ReadPictureDataFromFile.
Definition TGWin32.cxx:5704
void DrawFillArea(Int_t n, TPoint *xy) override
Fill area described by polygon.
Definition TGWin32.cxx:1709
void GetWindowAttributes(Window_t id, WindowAttributes_t &attr) override
Get window attributes and return filled in attributes structure.
Definition TGWin32.cxx:5305
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 TGWin32.cxx:6991
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 TGWin32.cxx:7679
Bool_t CreatePictureFromData(Drawable_t id, char **data, Pixmap_t &pict, Pixmap_t &pict_mask, PictureAttributes_t &attr) override
Create a pixture pixmap from data.
Definition TGWin32.cxx:5658
Int_t OpenPixmap(UInt_t w, UInt_t h) override
Open a new pixmap.
Definition TGWin32.cxx:2136
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 TGWin32.cxx:4525
Pixmap_t CreatePixmapFromData(unsigned char *bits, UInt_t width, UInt_t height) override
create an image from RGB data.
Definition TGWin32.cxx:7415
Int_t WriteGIFW(WinContext_t wctxt, const char *name) override
Writes the specified window into GIF file.
Definition TGWin32.cxx:4355
void NextEvent(Event_t &event) override
Copies first pending event from event queue to Event_t structure and removes event from queue.
Definition TGWin32.cxx:5881
void MapKeySym(UInt_t &keysym, UInt_t &xkeysym, Bool_t tox=kTRUE)
Map to and from X key symbols.
Definition TGWin32.cxx:6888
Bool_t AllocColor(GdkColormap *cmap, GdkColor *color)
Allocate color in colormap.
Definition TGWin32.cxx:1084
void SetAttMarker(WinContext_t wctxt, const TAttMarker &att) override
Set marker attributes for speicfied window.
Definition TGWin32.cxx:3385
Bool_t IsCmdThread() const override
returns kTRUE if we are inside cmd/server thread
Definition TGWin32.cxx:836
void SetClipOFF(Int_t wid) override
Turn off the clipping for the window wid.
Definition TGWin32.cxx:2874
void SetLineWidth(Width_t width) override
Set line width.
Definition TGWin32.cxx:3254
void SetInputFocus(Window_t id) override
Set keyboard input focus to window id.
Definition TGWin32.cxx:6822
void CopyPixmap(Int_t wid, Int_t xpos, Int_t ypos) override
Copy the pixmap wid at the position xpos, ypos in the current window.
Definition TGWin32.cxx:1622
Window_t GetCurrentWindow() const override
Return current window pointer. Protected method used by TGWin32TTF.
Definition TGWin32.cxx:1934
void MapRaised(Window_t id) override
Map window on screen and put on top of all windows.
Definition TGWin32.cxx:4638
Style_t GetFillStyle() const override
Return current fill style.
Definition TGWin32.cxx:3126
void ClearWindowW(WinContext_t wctxt) override
Clear specified window.
Definition TGWin32.cxx:1541
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 TGWin32.cxx:6328
void SelectInput(Window_t id, UInt_t evmask) override
Defines which input events the window is interested in.
Definition TGWin32.cxx:6801
Atom_t InternAtom(const char *atom_name, Bool_t only_if_exist) override
Return atom handle for atom_name.
Definition TGWin32.cxx:5364
void ResizeWindow(Int_t wid) override
Resize the current window if necessary.
Definition TGWin32.cxx:2773
Int_t OpenDisplay(const char *dpyName=0) override
Open the display. Return -1 if the opening fails, 0 when ok.
Definition TGWin32.cxx:918
void SetDNDAware(Window_t win, Atom_t *typelist) override
Add XdndAware property and the list of drag and drop types to the Window win.
Definition TGWin32.cxx:7767
void UnionRegion(Region_t rega, Region_t regb, Region_t result) override
Compute the union of rega and regb and return result region.
Definition TGWin32.cxx:7174
void SetWindowBackgroundPixmap(Window_t id, Pixmap_t pxm) override
Set pixmap as window background.
Definition TGWin32.cxx:4809
void SetClipRegion(Int_t wid, Int_t x, Int_t y, UInt_t w, UInt_t h) override
Set clipping region for the window wid.
Definition TGWin32.cxx:2891
Color_t GetFillColor() const override
Return current fill color.
Definition TGWin32.cxx:3101
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 TGWin32.cxx:6928
void SetKeyAutoRepeat(Bool_t on=kTRUE) override
Turn key auto repeat on or off.
Definition TGWin32.cxx:6434
void DrawPolyLine(Int_t n, TPoint *xy) override
Draw a line through all points.
Definition TGWin32.cxx:1772
void CopyGC(GContext_t org, GContext_t dest, Mask_t mask) override
Copies graphics context from org to dest.
Definition TGWin32.cxx:5525
Int_t fBlueShift
Bits to left shift blue.
Definition TGWin32.h:116
GdkCursor * fCursors[kNumCursors]
List of cursors.
Definition TGWin32.h:80
void SetLineColor(Color_t cindex) override
Set color index for lines.
Definition TGWin32.cxx:3200
Bool_t Init(void *display=0) override
Initialize Win32 system. Returns kFALSE in case of failure.
Definition TGWin32.cxx:901
void QueryPointer(Int_t &ix, Int_t &iy) override
Query pointer position.
Definition TGWin32.cxx:2252
void SetDrawModeW(WinContext_t wctxt, EDrawMode mode) override
Set window draw mode.
Definition TGWin32.cxx:7808
void UpdateWindow(Int_t mode) override
Update display.
Definition TGWin32.cxx:4137
void GetRegionBox(Region_t reg, Rectangle_t *) override
Return smallest enclosing rectangle.
Definition TGWin32.cxx:7233
virtual ~TGWin32()
destructor.
Definition TGWin32.cxx:818
Int_t AddWindow(ULongptr_t qwid, UInt_t w, UInt_t h) override
Register a window created by Qt as a ROOT window (like InitWindow()).
Definition TGWin32.cxx:7476
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 TGWin32.cxx:5624
void DrawPolyMarkerW(WinContext_t wctxt, Int_t n, TPoint *xy) override
Draw n markers with the current attributes at position x, y in specified window.
Definition TGWin32.cxx:1846
Bool_t fUseSysPointers
True when using system mouse pointers.
Definition TGWin32.h:106
void SetDoubleBufferOFF() override
Turn double buffer mode off.
Definition TGWin32.cxx:3040
Int_t fGreenDiv
Green value divider.
Definition TGWin32.h:112
UInt_t ScreenWidthMM() const override
Returns the width of the screen in millimeters.
Definition TGWin32.cxx:7528
Int_t AddPixmap(ULongptr_t pix, UInt_t w, UInt_t h) override
register pixmap created by TGWin32GLManager
Definition TGWin32.cxx:7451
Window_t GetDefaultRootWindow() const override
Return handle to the default root window created when calling XOpenDisplay().
Definition TGWin32.cxx:5376
Int_t GetDepth() const override
Get maximum number of planes.
Definition TGWin32.cxx:5354
void SetWindowBackground(Window_t id, ULong_t color) override
Set the window background color.
Definition TGWin32.cxx:4793
FontH_t GetFontHandle(FontStruct_t fs) override
Return handle to font described by font structure.
Definition TGWin32.cxx:5420
EDrawMode GetDrawModeW(WinContext_t wctxt) override
Returns window draw mode.
Definition TGWin32.cxx:7834
void SetInput(Int_t inp)
Set input on or off.
Definition TGWin32.cxx:3192
void RemoveWindow(ULongptr_t qwid) override
Remove a window created by Qt.
Definition TGWin32.cxx:7499
TExMap * fColors
Hash list of colors.
Definition TGWin32.h:79
Drawable_t CreateImage(UInt_t width, UInt_t height) override
Allocates the memory needed for an drawable.
Definition TGWin32.cxx:7278
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 TGWin32.cxx:5562
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:173
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:149
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:1081
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1095
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition TObject.cxx:1123
SCoord_t fY
Definition TPoint.h:36
SCoord_t fX
Definition TPoint.h:35
Basic string class.
Definition TString.h:138
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:641
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
Definition TStyle.cxx:1167
void Beep(Int_t freq=-1, Int_t duration=-1, Bool_t setDefault=kFALSE)
Beep for duration milliseconds with a tone of frequency freq.
Definition TSystem.cxx:322
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
Definition TSystem.cxx:469
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition TSystem.cxx:944
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition TSystem.cxx:414
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
Definition TSystem.cxx:479
TTF helper class containing glyphs description.
Definition TTF.h:65
static Bool_t IsInitialized()
Definition TTF.cxx:614
static void PrepareString(const char *string)
Put the characters in "string" in the "glyphs" array.
Definition TTF.cxx:271
static void Init()
Initialise the TrueType fonts interface.
Definition TTF.cxx:64
static void LayoutGlyphs()
Compute the glyphs positions, fgAscent and fgWidth (needed for alignment).
Definition TTF.cxx:202
static void SetSmoothing(Bool_t state)
Set smoothing (anti-aliasing) flag.
Definition TTF.cxx:370
static void SetRotationMatrix(Float_t angle)
Set the rotation matrix used to rotate the font outlines.
Definition TTF.cxx:347
static void SetTextFont(Font_t fontnumber)
Set specified font.
Definition TTF.cxx:495
static Int_t GetAscent()
Definition TTF.cxx:628
static void GetTextExtent(UInt_t &w, UInt_t &h, char *text)
Get width (w) and height (h) when text is horizontal.
Definition TTF.cxx:153
static TTGlyph * GetGlyphs()
Definition TTF.cxx:663
static Int_t GetNumGlyphs()
Definition TTF.cxx:635
static Int_t GetWidth()
Definition TTF.cxx:621
static const FT_BBox & GetBox()
Definition TTF.cxx:656
static Bool_t GetSmoothing()
Definition TTF.cxx:607
static void SetTextSize(Float_t textsize)
Set current text size.
Definition TTF.cxx:566
static FT_Matrix * GetRotMatrix()
Definition TTF.cxx:642
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51
Semi-Abstract base class defining a generic interface to the underlying, low level,...
Definition TVirtualX.h:46
EDrawMode fDrawMode
Definition TVirtualX.h:55
std::vector< ULong_t > orgcolors
Definition TGWin32.cxx:4338
void get_scline(int y, int width, unsigned char *buf) override
Definition TGWin32.cxx:4323
TWin32GifEncode(GdkImage *image)
Definition TGWin32.cxx:4340
GdkImage * fImage
Definition TGWin32.cxx:4321
Class providing an interface to the Windows NT Operating System.
TPaveText * pt
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
#define G(x, y, z)
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
Definition TMath.h:643
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Definition TMathBase.h:249
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
Definition TMath.h:691
Double_t Sqrt(Double_t x)
Returns the square root of x.
Definition TMath.h:673
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Definition TMathBase.h:197
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:122
ULong_t fPixel
color pixel value (index in color table)
Definition GuiTypes.h:312
UShort_t fRed
red component (0..65535)
Definition GuiTypes.h:313
UShort_t fGreen
green component (0..65535)
Definition GuiTypes.h:314
UShort_t fBlue
blue component (0..65535)
Definition GuiTypes.h:315
Event structure.
Definition GuiTypes.h:175
UInt_t fCode
key or button code
Definition GuiTypes.h:181
Graphics context structure.
Definition GuiTypes.h:225
Point structure (maps to the X11 XPoint structure)
Definition GuiTypes.h:357
Rectangle structure (maps to the X11 XRectangle structure)
Definition GuiTypes.h:362
Used for drawing line segments (maps to the X11 XSegments structure)
Definition GuiTypes.h:352
Attributes that can be used when creating or changing a window.
Definition GuiTypes.h:94
Window attributes that can be inquired.
Definition GuiTypes.h:115
Description of a X11 color.
Definition TGWin32.h:60
Bool_t fDefined
true if pixel value is defined
Definition TGWin32.h:62
GdkColor color
Definition TGWin32.h:61
Description of a X11 window.
Definition TGWin32.cxx:132
TAttText fAttText
current text attributes
Definition TGWin32.cxx:165
EAlign textAlign
selected text align
Definition TGWin32.cxx:166
Int_t yclip
y coordinate of the clipping rectangle
Definition TGWin32.cxx:144
Int_t shared
1 if Qt window
Definition TGWin32.cxx:134
GdkDrawable * window
win32 window
Definition TGWin32.cxx:138
std::vector< gint8 > dashList
Gtk array for dashes.
Definition TGWin32.cxx:153
UInt_t hclip
height of the clipping rectangle
Definition TGWin32.cxx:146
Int_t double_buffer
1 if the double buffer is on, 0 if not
Definition TGWin32.cxx:135
Int_t ispixmap
1 if pixmap, 0 if not
Definition TGWin32.cxx:136
Int_t open
1 if the window is open, 0 if not
Definition TGWin32.cxx:133
Int_t lineWidth
current line width
Definition TGWin32.cxx:152
Int_t dashOffset
current dash offset
Definition TGWin32.cxx:155
Int_t fillFasi
fasi parameter for fill pattern
Definition TGWin32.cxx:158
Int_t markerLineWidth
line width used for marker
Definition TGWin32.cxx:164
GdkDrawable * buffer
pixmap used for double buffer
Definition TGWin32.cxx:139
Int_t xclip
x coordinate of the clipping rectangle
Definition TGWin32.cxx:143
Int_t fillHollow
Flag if fill style is hollow.
Definition TGWin32.cxx:157
TVirtualX::EDrawMode drawMode
current draw mode
Definition TGWin32.cxx:149
FT_Vector alignVector
alignment vector
Definition TGWin32.cxx:167
Int_t dashLength
total length of dashes
Definition TGWin32.cxx:154
UInt_t height
height of the window
Definition TGWin32.cxx:141
GdkDrawable * drawing
drawing area, equal to window or buffer
Definition TGWin32.cxx:137
GdkGC * fGClist[kMAXGC]
array of GC objects for concrete window
Definition TGWin32.cxx:148
Int_t markerSize
size of simple markers
Definition TGWin32.cxx:162
UInt_t width
width of the window
Definition TGWin32.cxx:140
GdkLineStyle lineStyle
current line style
Definition TGWin32.cxx:151
TAttLine fAttLine
current line attributes
Definition TGWin32.cxx:150
Int_t markerType
4 differen kinds of marker
Definition TGWin32.cxx:161
TAttMarker fAttMarker
current marker attribute
Definition TGWin32.cxx:160
GdkPixmap * fillPattern
current fill pattern
Definition TGWin32.cxx:159
TAttFill fAttFill
current fill attributes
Definition TGWin32.cxx:156
Int_t clip
1 if the clipping is on
Definition TGWin32.cxx:142
std::vector< ULong_t > new_colors
new image colors for transparency (after processing)
Definition TGWin32.cxx:147
UInt_t wclip
width of the clipping rectangle
Definition TGWin32.cxx:145
std::vector< GdkPoint > markerShape
marker shape points
Definition TGWin32.cxx:163
TMarker m
Definition textangle.C:8
TLine l
Definition textangle.C:4
#define XA_ATOM
Definition xatom.h:13
#define XA_WM_CLASS
Definition xatom.h:76
#define XA_STRING
Definition xatom.h:40
unsigned long Atom
Definition xatom.h:9