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