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; x++, bc++) {
1184 bc->pixel = GetPixelImage((Drawable_t)xim, bx + x, by + y);
1185 if (++dotcnt >= maxdots) break;
1186 }
1187 }
1189 r = g = b = 0;
1190 bc = bcol;
1191 dotcnt = 0;
1192 for (y = 0; y < (int) source->rows; y++) {
1193 for (x = 0; x < (int) source->width; x++, bc++) {
1194 r += bc->red;
1195 g += bc->green;
1196 b += bc->blue;
1197 if (++dotcnt >= maxdots) break;
1198 }
1199 }
1200 if (dots != 0) {
1201 r /= dots;
1202 g /= dots;
1203 b /= dots;
1204 }
1205 bc = &col[0];
1206 if (bc->red == r && bc->green == g && bc->blue == b) {
1207 bc->pixel = back;
1208 } else {
1209 bc->pixel = ~back;
1210 bc->red = (UShort_t) r;
1211 bc->green = (UShort_t) g;
1212 bc->blue = (UShort_t) b;
1213 }
1214 }
1215 delete [] bcol;
1216
1217 // if fore or background have changed from previous character
1218 // recalculate the 3 smooting colors (interpolation between fore-
1219 // and background colors)
1220 if (fore != col[4].pixel || back != col[0].pixel) {
1221 col[4].pixel = fore;
1222 if (back != (ULong_t) -1) {
1223 col[3].pixel = back;
1224 QueryColors(fColormap, &col[3], 2);
1225 col[0] = col[3];
1226 } else {
1227 QueryColors(fColormap, &col[4], 1);
1228 }
1229
1230 // interpolate between fore and backgound colors
1231 for (x = 3; x > 0; x--) {
1232 col[x].red = (col[4].red *x + col[0].red *(4-x)) /4;
1233 col[x].green = (col[4].green*x + col[0].green*(4-x)) /4;
1234 col[x].blue = (col[4].blue *x + col[0].blue *(4-x)) /4;
1235 if (!AllocColor(fColormap, &col[x])) {
1236 Warning("DrawImage", "cannot allocate smoothing color");
1237 col[x].pixel = col[x+1].pixel;
1238 }
1239 }
1240 }
1241
1242 // put smoothed character, character pixmap values are an index
1243 // into the 5 colors used for aliasing (4 = foreground, 0 = background)
1244 for (y = 0; y < (int) source->rows; y++) {
1245 for (x = 0; x < (int) source->width; x++) {
1246 d = *s++ & 0xff;
1247 d = ((d + 10) * 5) / 256;
1248 if (d > 4) d = 4;
1249 if (d && x < (int) source->width) {
1250 ULong_t p = col[d].pixel;
1251 PutPixel((Drawable_t)xim, bx + x, by + y, p);
1252 }
1253 }
1254 }
1255 } else {
1256 // no smoothing, just put character using foreground color
1257 UChar_t* row=s;
1258 for (int y = 0; y < (int) source->rows; y++) {
1259 int n = 0;
1260 s = row;
1261 for (int x = 0; x < (int) source->width; x++) {
1262 if (n == 0) d = *s++;
1263 if (TESTBIT(d,7-n)) {
1264 PutPixel((Drawable_t)xim, bx + x, by + y, fore);
1265 }
1266 if (++n == (int) kBitsPerByte) n = 0;
1267 }
1268 row += source->pitch;
1269 }
1270 }
1271}
1272
1273////////////////////////////////////////////////////////////////////////////////
1274/// Draw text using TrueType fonts. If TrueType fonts are not available the
1275/// text is drawn with TGWin32::DrawText.
1276
1282
1283////////////////////////////////////////////////////////////////////////////////
1284/// Draw text using TrueType fonts on specified window.
1285/// If TrueType fonts are not available the
1286/// text is drawn with TGWin32::DrawText.
1287
1289 const char *text, ETextMode mode)
1290{
1291 if (!wctxt) return;
1292
1293 if (!TTF::IsInitialized()) TTF::Init();
1297 Align(wctxt);
1299}
1300
1301////////////////////////////////////////////////////////////////////////////////
1302/// Draw text using TrueType fonts. If TrueType fonts are not available the
1303/// text is drawn with TGWin32::DrawText.
1304
1306 const wchar_t *text, ETextMode mode)
1307{
1309}
1310
1311////////////////////////////////////////////////////////////////////////////////
1312/// Draw text using TrueType fonts on specified window.
1313/// If TrueType fonts are not available the
1314/// text is drawn with TGWin32::DrawText.
1315
1317 const wchar_t *text, ETextMode mode)
1318{
1319 if (!wctxt) return;
1320
1321 if (!TTF::IsInitialized()) TTF::Init();
1325 Align(wctxt);
1327}
1328
1329////////////////////////////////////////////////////////////////////////////////
1330/// Get the background of the current window in an XImage.
1331
1333{
1334 auto ctxt = (XWindow_t *) wctxt;
1335
1336 UInt_t width;
1337 UInt_t height;
1338 Int_t xy;
1339 GetWindowSize((Drawable_t) ctxt->drawing, xy, xy, width, height);
1340
1341 if (x < 0) {
1342 w += x;
1343 x = 0;
1344 }
1345 if (y < 0) {
1346 h += y;
1347 y = 0;
1348 }
1349
1350 if (x+w > width) w = width - x;
1351 if (y+h > height) h = height - y;
1352
1353 return gdk_image_get(ctxt->drawing, x, y, w, h);
1354}
1355
1356////////////////////////////////////////////////////////////////////////////////
1357/// Test if there is really something to render
1358
1360{
1361 auto ctxt = (XWindow_t *) wctxt;
1362
1363 UInt_t width;
1364 UInt_t height;
1365 Int_t xy;
1366 GetWindowSize((Drawable_t) ctxt->drawing, xy, xy, width, height);
1367
1368 // If w or h is 0, very likely the string is only blank characters
1369 if ((int)w == 0 || (int)h == 0) return kFALSE;
1370
1371 // If string falls outside window, there is probably no need to draw it.
1372 if (x + (int)w <= 0 || x >= (int)width) return kFALSE;
1373 if (y + (int)h <= 0 || y >= (int)height) return kFALSE;
1374
1375 return kTRUE;
1376}
1377
1378////////////////////////////////////////////////////////////////////////////////
1379/// Perform the string rendering in the pad.
1380/// LayoutGlyphs should have been called before.
1381
1383{
1384 auto ctxt = (XWindow_t *) wctxt;
1385
1388
1389 // compute the size and position of the XImage that will contain the text
1390 Int_t Xoff = 0; if (TTF::GetBox().xMin < 0) Xoff = -TTF::GetBox().xMin;
1391 Int_t Yoff = 0; if (TTF::GetBox().yMin < 0) Yoff = -TTF::GetBox().yMin;
1392 Int_t w = TTF::GetBox().xMax + Xoff;
1393 Int_t h = TTF::GetBox().yMax + Yoff;
1394 Int_t x1 = x - Xoff - ctxt->alignVector.x;
1395 Int_t y1 = y + Yoff + ctxt->alignVector.y - h;
1396
1397 if (!IsVisible(wctxt, x1, y1, w, h)) {
1398 return;
1399 }
1400
1401 // create the XImage that will contain the text
1404
1405 // use malloc since Xlib will use free() in XDestroyImage
1406// xim->data = (char *) malloc(xim->bytes_per_line * h);
1407// memset(xim->data, 0, xim->bytes_per_line * h);
1408
1409 ULong_t pixel;
1410 ULong_t bg;
1411
1412 gdk_gc_get_values(ctxt->fGClist[kGCtext], &gcvals);
1413
1414 // get the background
1415 if (mode == kClear) {
1416 // if mode == kClear we need to get an image of the background
1418 if (!bim) {
1419 Error("DrawText", "error getting background image");
1420 return;
1421 }
1422
1423 // and copy it into the text image
1424 Int_t xo = 0, yo = 0;
1425 if (x1 < 0) xo = -x1;
1426 if (y1 < 0) yo = -y1;
1427
1428 for (int yp = 0; yp < (int) bim->height; yp++) {
1429 for (int xp = 0; xp < (int) bim->width; xp++) {
1432 }
1433 }
1434
1436
1437 bg = (ULong_t) -1;
1438 } else {
1439 // if mode == kOpaque its simple, we just draw the background
1440
1442 if (!bim) {
1443 pixel = gcvals.background.pixel;
1444 } else {
1446 }
1447 Int_t xo = 0, yo = 0;
1448 if (x1 < 0) xo = -x1;
1449 if (y1 < 0) yo = -y1;
1450
1451 for (int yp = 0; yp < h; yp++) {
1452 for (int xp = 0; xp < (int) w; xp++) {
1454 }
1455 }
1456 if (bim) {
1458 bg = (ULong_t) -1;
1459 } else {
1460 bg = pixel;
1461 }
1462 }
1463
1464 // paint the glyphs in the XImage
1466 for (int n = 0; n < TTF::GetNumGlyphs(); n++, glyph++) {
1467 if (FT_Glyph_To_Bitmap(&glyph->fImage,
1470 0, 1 )) continue;
1472 FT_Bitmap* source = &bitmap->bitmap;
1473 Int_t bx, by;
1474
1475 bx = bitmap->left+Xoff;
1476 by = h - bitmap->top-Yoff;
1477 DrawImage(source, gcvals.foreground.pixel, bg, xim, bx, by);
1478 }
1479
1480 // put the Ximage on the screen
1481 gdk_draw_image(ctxt->drawing, ctxt->fGClist[kGCpxmp], xim, 0, 0, x1, y1, w, h);
1482
1484}
1485
1486////////////////////////////////////////////////////////////////////////////////
1487/// Set specified font.
1488
1490{
1492
1493 TAttText arg(gCws->fAttText);
1495
1497}
1498
1499////////////////////////////////////////////////////////////////////////////////
1500/// Set text font to specified name.
1501/// mode : loading flag
1502/// mode=0 : search if the font exist (kCheck)
1503/// mode=1 : search the font and load it if it exists (kLoad)
1504/// font : font name
1505///
1506/// Set text font to specified name. This function returns 0 if
1507/// the specified font is found, 1 if not.
1508
1510{
1511 return TTF::SetTextFont(fontname);
1512}
1513
1514////////////////////////////////////////////////////////////////////////////////
1515/// Set current text size.
1516
1518{
1520
1521 TAttText arg(gCws->fAttText);
1522 arg.SetTextSize(textsize);
1523
1525}
1526
1527////////////////////////////////////////////////////////////////////////////////
1528/// Clear current window.
1529
1534
1535////////////////////////////////////////////////////////////////////////////////
1536/// Clear specified window.
1537
1539{
1540 auto ctxt = (XWindow_t *) wctxt;
1541 if (!ctxt)
1542 return;
1543
1544 if (!ctxt->ispixmap && !ctxt->double_buffer) {
1545 gdk_window_set_background(ctxt->drawing, (GdkColor *) & GetColor(0).color);
1546 gdk_window_clear(ctxt->drawing);
1547 GdiFlush();
1548 } else {
1549 SetColor(ctxt, ctxt->fGClist[kGCpxmp], 0);
1550 gdk_win32_draw_rectangle(ctxt->drawing, ctxt->fGClist[kGCpxmp], 1,
1551 0, 0, ctxt->width, ctxt->height);
1552 SetColor(ctxt, ctxt->fGClist[kGCpxmp], 1);
1553 }
1554}
1555
1556////////////////////////////////////////////////////////////////////////////////
1557/// Delete current pixmap.
1558
1560{
1561 CloseWindow();
1562}
1563
1564////////////////////////////////////////////////////////////////////////////////
1565/// Delete current window.
1566
1568{
1569 if (!gCws->shared) {
1570 if (gCws->ispixmap) {
1571 gdk_pixmap_unref(gCws->window);
1572 } else {
1573 gdk_window_destroy(gCws->window, kTRUE);
1574 }
1575 }
1576
1577 if (gCws->fillPattern) {
1578 gdk_pixmap_unref(gCws->fillPattern);
1579 gCws->fillPattern = nullptr;
1580 }
1581
1582 if (gCws->buffer) {
1583 gdk_pixmap_unref(gCws->buffer);
1584 }
1585 if (!gCws->new_colors.empty()) {
1587 (GdkColor *)gCws->new_colors.data(), gCws->new_colors.size());
1588
1589 gCws->new_colors.clear();
1590 }
1591
1592 for (int i = 0; i < kMAXGC; i++)
1593 gdk_gc_unref(gCws->fGClist[i]); // gdk_gc_unref is equivalent to gdk_gc_destroy
1594
1595 GdiFlush();
1596 gCws->open = 0;
1597
1598 for (auto iter = fWindows.begin(); iter != fWindows.end(); ++iter)
1599 if (iter->second.get() == gCws) {
1600 fWindows.erase(iter);
1601 gCws = nullptr;
1602 break;
1603 }
1604
1605 if (gCws)
1606 Fatal("CloseWindow", "Not found gCws in list of windows");
1607
1608 // make first window in list the current window
1609 for (auto iter = fWindows.begin(); iter != fWindows.end(); ++iter)
1610 if (iter->second && iter->second->open) {
1611 gCws = iter->second.get();
1612 return;
1613 }
1614}
1615
1616////////////////////////////////////////////////////////////////////////////////
1617/// Copy the pixmap wid at the position xpos, ypos in the current window.
1618
1620{
1622}
1623
1624////////////////////////////////////////////////////////////////////////////////
1625/// Draw a box.
1626/// mode=0 hollow (kHollow)
1627/// mode=1 solid (kSolid)
1628
1629void TGWin32::DrawBox(int x1, int y1, int x2, int y2, EBoxMode mode)
1630{
1632}
1633
1634////////////////////////////////////////////////////////////////////////////////
1635/// Draw a box on specified window.
1636/// mode=0 hollow (kHollow)
1637/// mode=1 solid (kSolid)
1638
1640{
1641 auto ctxt = (XWindow_t *) wctxt;
1642 if (!ctxt)
1643 return;
1644
1645 Int_t x = TMath::Min(x1, x2);
1646 Int_t y = TMath::Min(y1, y2);
1647 Int_t w = TMath::Abs(x2 - x1);
1648 Int_t h = TMath::Abs(y2 - y1);
1649
1650 switch (mode) {
1651 case kHollow:
1652 gdk_win32_draw_rectangle(ctxt->drawing, ctxt->fGClist[kGCline], 0, x, y, w, h);
1653 break;
1654
1655 case kFilled:
1656 gdk_win32_draw_rectangle(ctxt->drawing, ctxt->fGClist[kGCfill], 1, x, y, w, h);
1657 break;
1658
1659 default:
1660 break;
1661 }
1662}
1663
1664////////////////////////////////////////////////////////////////////////////////
1665/// Draw a cell array.
1666/// x1,y1 : left down corner
1667/// x2,y2 : right up corner
1668/// nx,ny : array size
1669/// ic : array
1670///
1671/// Draw a cell array. The drawing is done with the pixel presicion
1672/// if (X2-X1)/NX (or Y) is not a exact pixel number the position of
1673/// the top rigth corner may be wrong.
1674
1676 Int_t nx, Int_t ny, Int_t *ic)
1677{
1678 if (!gCws) return;
1679
1680 int current_icol = -1;
1681 int w = TMath::Max((x2 - x1) / (nx), 1);
1682 int h = TMath::Max((y1 - y2) / (ny), 1);
1683 int ix = x1;
1684
1685 for (int i = 0; i < nx; i++) {
1686 int iy = y1 - h;
1687 for (int j = 0; j < ny; j++) {
1688 int icol = ic[i + (nx * j)];
1689 if (icol != current_icol) {
1690 gdk_gc_set_foreground(gCws->fGClist[kGCfill], (GdkColor *) & GetColor(icol).color);
1692 }
1693
1694 gdk_win32_draw_rectangle(gCws->drawing, gCws->fGClist[kGCfill], kTRUE, ix, iy, w, h);
1695 iy = iy - h;
1696 }
1697 ix = ix + w;
1698 }
1699}
1700
1701////////////////////////////////////////////////////////////////////////////////
1702/// Fill area described by polygon.
1703/// n : number of points
1704/// xy(2,n) : list of points
1705
1710
1711////////////////////////////////////////////////////////////////////////////////
1712/// Fill area described by polygon in a specified window.
1713/// n : number of points
1714/// xy(2,n) : list of points
1715
1717{
1718 auto ctxt = (XWindow_t *) wctxt;
1719 if (!ctxt)
1720 return;
1721
1722 std::vector<GdkPoint> xy(n);
1723 for (int i = 0; i < n; i++) {
1724 xy[i].x = xyt[i].fX;
1725 xy[i].y = xyt[i].fY;
1726 }
1727
1728 if (ctxt->fillHollow) {
1729 gdk_win32_draw_lines(ctxt->drawing, ctxt->fGClist[kGCfill], xy.data(), n);
1730 } else {
1731 gdk_win32_draw_polygon(ctxt->drawing, ctxt->fGClist[kGCfill], 1, xy.data(), n);
1732 }
1733}
1734
1735////////////////////////////////////////////////////////////////////////////////
1736/// Draw a line.
1737/// x1,y1 : begin of line
1738/// x2,y2 : end of line
1739
1744
1745////////////////////////////////////////////////////////////////////////////////
1746/// Draw a line on specified window.
1747/// x1,y1 : begin of line
1748/// x2,y2 : end of line
1749
1751{
1752 auto ctxt = (XWindow_t *) wctxt;
1753 if (!ctxt)
1754 return;
1755
1756 if (ctxt->lineStyle == GDK_LINE_SOLID) {
1757 gdk_draw_line(ctxt->drawing, ctxt->fGClist[kGCline], x1, y1, x2, y2);
1758 } else {
1759 gdk_gc_set_dashes(ctxt->fGClist[kGCdash], ctxt->dashOffset, ctxt->dashList.data(), ctxt->dashList.size());
1760 gdk_draw_line(ctxt->drawing, ctxt->fGClist[kGCdash], x1, y1, x2, y2);
1761 }
1762}
1763
1764////////////////////////////////////////////////////////////////////////////////
1765/// Draw a line through all points.
1766/// n : number of points
1767/// xy : list of points
1768
1773
1774////////////////////////////////////////////////////////////////////////////////
1775/// Draw a line through all points in specified window.
1776/// n : number of points
1777/// xy : list of points
1778
1780{
1781 auto ctxt = (XWindow_t *) wctxt;
1782 if (!ctxt || (n < 1))
1783 return;
1784
1785 std::vector<GdkPoint> xy(n);
1786 for (int i = 0; i < n; i++) {
1787 xy[i].x = xyt[i].fX;
1788 xy[i].y = xyt[i].fY;
1789 }
1790
1791 if (n > 1) {
1792 if (ctxt->lineStyle == GDK_LINE_SOLID) {
1793 gdk_win32_draw_lines(ctxt->drawing, ctxt->fGClist[kGCline], xy.data(), n);
1794 } else {
1795 gdk_gc_set_dashes(ctxt->fGClist[kGCdash], ctxt->dashOffset, ctxt->dashList.data(), ctxt->dashList.size());
1796 gdk_win32_draw_lines(ctxt->drawing, ctxt->fGClist[kGCdash], xy.data(), n);
1797
1798 // calculate length of line to update dash offset
1799 for (int i = 1; i < n; i++) {
1800 int dx = xy[i].x - xy[i - 1].x;
1801 int dy = xy[i].y - xy[i - 1].y;
1802
1803 if (dx < 0) dx = -dx;
1804 if (dy < 0) dy = -dy;
1805 ctxt->dashOffset += dx > dy ? dx : dy;
1806 }
1807 ctxt->dashOffset %= ctxt->dashLength;
1808 }
1809 } else {
1810 gdk_win32_draw_points(ctxt->drawing,
1811 ctxt->fGClist[ctxt->lineStyle == GDK_LINE_SOLID ? kGCline : kGCdash],
1812 xy.data(), 1);
1813 }
1814}
1815
1816////////////////////////////////////////////////////////////////////////////////
1817/// Draw N segments on specified window
1818/// n : number of segments
1819/// xy : list of points, 2*N size
1820
1822{
1823 for(Int_t i = 0; i < 2*n; i += 2)
1824 DrawPolyLineW(wctxt, 2, &xyt[i]);
1825}
1826
1827
1828////////////////////////////////////////////////////////////////////////////////
1829/// Draw n markers with the current attributes at position x, y.
1830/// n : number of markers to draw
1831/// xy : x,y coordinates of markers
1832
1837
1838////////////////////////////////////////////////////////////////////////////////
1839/// Draw n markers with the current attributes at position x, y in specified window.
1840/// n : number of markers to draw
1841/// xy : x,y coordinates of markers
1842
1844{
1845 auto ctxt = (XWindow_t *) wctxt;
1846 if (!ctxt) return;
1847
1848 if ((ctxt->markerShape.size() == 0) && (ctxt->markerSize <= 0)) {
1849 std::vector<GdkPoint> xy(n);
1850 for (int i = 0; i < n; i++) {
1851 xy[i].x = xyt[i].fX;
1852 xy[i].y = xyt[i].fY;
1853 }
1854
1855 gdk_win32_draw_points(ctxt->drawing, ctxt->fGClist[kGCmark], xy.data(), n);
1856 } else {
1857 int r = ctxt->markerSize / 2;
1858 auto &shape = ctxt->markerShape;
1859
1860 for (int m = 0; m < n; m++) {
1861 int hollow = 0;
1862 switch (ctxt->markerType) {
1863 case 0: // hollow circle
1864 gdk_win32_draw_arc(ctxt->drawing, ctxt->fGClist[kGCmark], kFALSE, xyt[m].fX - r, xyt[m].fY - r,
1865 ctxt->markerSize, ctxt->markerSize, 0, 23040);
1866 break;
1867
1868 case 1: // filled circle
1869 gdk_win32_draw_arc(ctxt->drawing, ctxt->fGClist[kGCmark], kTRUE, xyt[m].fX - r, xyt[m].fY - r,
1870 ctxt->markerSize, ctxt->markerSize, 0, 23040);
1871 break;
1872
1873 case 2: // hollow polygon
1874 hollow = 1;
1875 case 3: // filled polygon
1876 for (size_t i = 0; i < shape.size(); i++) {
1877 shape[i].x += xyt[m].fX;
1878 shape[i].y += xyt[m].fY;
1879 }
1880 if (hollow) {
1881 gdk_win32_draw_lines(ctxt->drawing, ctxt->fGClist[kGCmark], shape.data(), shape.size());
1882 } else {
1883 gdk_win32_draw_polygon(ctxt->drawing, ctxt->fGClist[kGCmark], 1, shape.data(), shape.size());
1884 }
1885 for (size_t i = 0; i < shape.size(); i++) {
1886 shape[i].x -= xyt[m].fX;
1887 shape[i].y -= xyt[m].fY;
1888 }
1889 break;
1890
1891 case 4: // segmented line
1892 for (size_t i = 0; i < shape.size(); i += 2) {
1893 gdk_draw_line(ctxt->drawing, ctxt->fGClist[kGCmark],
1894 xyt[m].fX + shape[i].x,
1895 xyt[m].fY + shape[i].y,
1896 xyt[m].fX + shape[i+1].x,
1897 xyt[m].fY + shape[i+1].y);
1898 }
1899 break;
1900 }
1901 }
1902 }
1903}
1904
1905////////////////////////////////////////////////////////////////////////////////
1906/// Return character up vector.
1907
1913
1914////////////////////////////////////////////////////////////////////////////////
1915/// Return reference to internal color structure associated
1916/// to color index cid.
1917
1919{
1920 XColor_t *col = (XColor_t*) fColors->GetValue(cid);
1921 if (!col) {
1922 col = new XColor_t;
1923 fColors->Add(cid, (Longptr_t) col);
1924 }
1925 return *col;
1926}
1927
1928////////////////////////////////////////////////////////////////////////////////
1929/// Return current window pointer. Protected method used by TGWin32TTF.
1930
1932{
1933 return (Window_t)(gCws ? gCws->drawing : 0);
1934}
1935
1936////////////////////////////////////////////////////////////////////////////////
1937/// Return desired Graphics Context ("which" maps directly on gGCList[]).
1938/// Protected method used by TGWin32TTF.
1939
1941{
1942 if (which >= kMAXGC || which < 0) {
1943 Error("GetGC", "trying to get illegal GdkGC (which = %d)", which);
1944 return 0;
1945 }
1946
1947 if (!gCws) {
1948 Error("GetGC", "No current window selected");
1949 return nullptr;
1950 }
1951 return gCws->fGClist[which];
1952}
1953
1954////////////////////////////////////////////////////////////////////////////////
1955/// Query the double buffer value for the window wid.
1956
1958{
1959 if (fWindows.count(wid) == 0)
1960 return 0;
1961
1962 gTws = fWindows[wid].get();
1963
1964 if (!gTws->open) {
1965 return -1;
1966 } else {
1967 return gTws->double_buffer;
1968 }
1969}
1970
1971////////////////////////////////////////////////////////////////////////////////
1972/// Return position and size of window wid.
1973/// wid : window identifier
1974/// x,y : window position (output)
1975/// w,h : window size (output)
1976/// if wid < 0 the size of the display is returned
1977
1978void TGWin32::GetGeometry(int wid, int &x, int &y, unsigned int &w,
1979 unsigned int &h)
1980{
1981 if (wid < 0) {
1982 x = 0;
1983 y = 0;
1984
1985 w = gdk_screen_width();
1986 h = gdk_screen_height();
1987 } else {
1988 int depth;
1989 int width, height;
1990
1991 if (fWindows.count(wid) == 0) return;
1992
1993 gTws = fWindows[wid].get();
1994 gdk_window_get_geometry((GdkDrawable *) gTws->window, &x, &y,
1995 &width, &height, &depth);
1996
1998
1999 if (width > 0 && height > 0) {
2000 gTws->width = width;
2001 gTws->height = height;
2002 }
2003 w = gTws->width;
2004 h = gTws->height;
2005 }
2006}
2007
2008////////////////////////////////////////////////////////////////////////////////
2009/// Return hostname on which the display is opened.
2010
2011const char *TGWin32::DisplayName(const char *dpyName)
2012{
2013 return "localhost"; //return gdk_get_display();
2014}
2015
2016////////////////////////////////////////////////////////////////////////////////
2017/// Get maximum number of planes.
2018
2023
2024////////////////////////////////////////////////////////////////////////////////
2025/// Get rgb values for color "index".
2026
2027void TGWin32::GetRGB(int index, float &r, float &g, float &b)
2028{
2029 if (index == 0) {
2030 r = g = b = 1.0;
2031 } else if (index == 1) {
2032 r = g = b = 0.0;
2033 } else {
2034 XColor_t &col = GetColor(index);
2035 r = ((float) col.color.red) / ((float) kBIGGEST_RGB_VALUE);
2036 g = ((float) col.color.green) / ((float) kBIGGEST_RGB_VALUE);
2037 b = ((float) col.color.blue) / ((float) kBIGGEST_RGB_VALUE);
2038 }
2039}
2040
2041////////////////////////////////////////////////////////////////////////////////
2042/// Return the size of a character string.
2043/// iw : text width
2044/// ih : text height
2045/// mess : message
2046
2053
2054////////////////////////////////////////////////////////////////////////////////
2055/// Return the X11 window identifier.
2056/// wid : Workstation identifier (input)
2057
2059{
2060 if (fWindows.count(wid) == 0) return 0;
2061 return (Window_t) fWindows[wid]->window;
2062}
2063
2064////////////////////////////////////////////////////////////////////////////////
2065/// Move the window wid.
2066/// wid : GdkWindow identifier.
2067/// x : x new window position
2068/// y : y new window position
2069
2071{
2072 if (fWindows.count(wid) == 0) return;
2073
2074 gTws = fWindows[wid].get();
2075 if (!gTws->open) return;
2076
2077 // prevent hiding the titlebar
2078 if (x == 0 && y == 0) {
2079 x = 1; y = 1;
2080 }
2081 gdk_window_move((GdkDrawable *) gTws->window, x, y);
2082}
2083
2084////////////////////////////////////////////////////////////////////////////////
2085/// Add new window handle
2086/// Only for private usage
2087
2089{
2090 Int_t maxid = 0;
2091 for (auto & pair : fWindows) {
2092 if (pair.first > maxid)
2093 maxid = pair.first;
2094 }
2095
2096 if (fWindows.size() == (size_t) maxid) {
2097 // all ids are in use - just add maximal+1
2098 maxid++;
2099 } else
2100 for (int id = 1; id < maxid; id++) {
2101 if (fWindows.count(id) == 0) {
2102 maxid = id;
2103 break;
2104 }
2105 }
2106
2107 fWindows.emplace(maxid, std::make_unique<XWindow_t>());
2108
2109 auto ctxt = fWindows[maxid].get();
2110 ctxt->open = 1;
2111 ctxt->shared = 0;
2112 ctxt->drawing = nullptr;
2113 ctxt->window = nullptr;
2114 ctxt->buffer = nullptr;
2115
2116 ctxt->drawMode = TVirtualX::kCopy;
2117
2118 // Create primitives graphic contexts
2119 for (int i = 0; i < kMAXGC; i++) {
2120 ctxt->fGClist[i] = gdk_gc_new(GDK_ROOT_PARENT());
2121 gdk_gc_set_foreground(ctxt->fGClist[i], &GetColor(1).color);
2122 gdk_gc_set_background(ctxt->fGClist[i], &GetColor(0).color);
2123 }
2124
2125 return maxid;
2126}
2127
2128
2129////////////////////////////////////////////////////////////////////////////////
2130/// Open a new pixmap.
2131/// w,h : Width and height of the pixmap.
2132
2133Int_t TGWin32::OpenPixmap(unsigned int w, unsigned int h)
2134{
2135 int wval, hval;
2136 int ww, hh, depth;
2137 wval = w;
2138 hval = h;
2139
2140 int wid = AddWindowHandle();
2141
2142 gCws = fWindows[wid].get();
2143 gCws->ispixmap = 1;
2144
2147 gdk_drawable_get_size((GdkDrawable *) gCws->window, &ww, &hh);
2148
2149 for (int i = 0; i < kMAXGC; i++)
2150 gdk_gc_set_clip_mask(gCws->fGClist[i], (GdkDrawable *)None);
2151
2152 SetColor(gCws, gCws->fGClist[kGCpxmp], 0);
2153 gdk_win32_draw_rectangle(gCws->window, gCws->fGClist[kGCpxmp], kTRUE,
2154 0, 0, ww, hh);
2155 SetColor(gCws, gCws->fGClist[kGCpxmp], 1);
2156
2157 // Initialise the window structure
2158 gCws->drawing = gCws->window;
2159 gCws->double_buffer = 0;
2160 gCws->clip = 0;
2161 gCws->width = wval;
2162 gCws->height = hval;
2163
2164 return wid;
2165}
2166
2167////////////////////////////////////////////////////////////////////////////////
2168/// Open window and return window number.
2169/// Return -1 if window initialization fails.
2170
2172{
2173 GdkWindowAttr attributes;
2174 unsigned long attr_mask = 0;
2175 int xval, yval;
2176 int wval, hval, depth;
2177
2178 int wid = AddWindowHandle();
2179
2180 gCws = fWindows[wid].get();
2181 gCws->ispixmap = 0;
2182
2183 GdkWindow *wind = (GdkWindow *) win;
2184
2186
2187 // Create window
2188 attributes.wclass = GDK_INPUT_OUTPUT;
2189 attributes.event_mask = 0L; //GDK_ALL_EVENTS_MASK;
2190 attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK |
2192// GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK;
2193 if (xval >= 0) {
2194 attributes.x = xval;
2195 } else {
2196 attributes.x = -1.0 * xval;
2197 }
2198
2199 if (yval >= 0) {
2200 attributes.y = yval;
2201 } else {
2202 attributes.y = -1.0 * yval;
2203 }
2204 attributes.width = wval;
2205 attributes.height = hval;
2206 attributes.colormap = gdk_colormap_get_system();
2207 attributes.visual = gdk_window_get_visual(wind);
2208 attributes.override_redirect = TRUE;
2209
2210 if ((attributes.y > 0) && (attributes.x > 0)) {
2213 } else {
2215 }
2216
2217 if (attributes.visual != NULL) {
2219 }
2220 attributes.window_type = GDK_WINDOW_CHILD;
2221 gCws->window = gdk_window_new(wind, &attributes, attr_mask);
2222 HWND window = (HWND)GDK_DRAWABLE_XID((GdkWindow *)gCws->window);
2223 ::ShowWindow(window, SW_SHOWNORMAL);
2224 ::ShowWindow(window, SW_RESTORE);
2225 ::BringWindowToTop(window);
2226
2227 if (!fUseSysPointers) {
2230 }
2231
2232 // Initialise the window structure
2233
2234 gCws->drawing = gCws->window;
2235 gCws->double_buffer = 0;
2236 gCws->clip = 0;
2237 gCws->width = wval;
2238 gCws->height = hval;
2239
2240 return wid;
2241}
2242
2243////////////////////////////////////////////////////////////////////////////////
2244/// Query pointer position.
2245/// ix : X coordinate of pointer
2246/// iy : Y coordinate of pointer
2247/// (both coordinates are relative to the origin of the root window)
2248
2250{
2251 //GdkModifierType mask;
2252 //GdkWindow *retw = gdk_window_get_pointer((GdkWindow *) gCws->window,
2253 // &ix, &iy, &mask);
2254 POINT cpt;
2255 GetCursorPos(&cpt);
2256 ix = cpt.x;
2257 iy = cpt.y;
2258}
2259
2260////////////////////////////////////////////////////////////////////////////////
2261/// Remove the pixmap pix.
2262
2267
2268////////////////////////////////////////////////////////////////////////////////
2269/// Request Locator position.
2270/// x,y : cursor position at moment of button press (output)
2271/// ctyp : cursor type (input)
2272/// ctyp=1 tracking cross
2273/// ctyp=2 cross-hair
2274/// ctyp=3 rubber circle
2275/// ctyp=4 rubber band
2276/// ctyp=5 rubber rectangle
2277///
2278/// mode : input mode
2279/// mode=0 request
2280/// mode=1 sample
2281///
2282/// Request locator:
2283/// return button number 1 = left is pressed
2284/// 2 = middle is pressed
2285/// 3 = right is pressed
2286/// in sample mode:
2287/// 11 = left is released
2288/// 12 = middle is released
2289/// 13 = right is released
2290/// -1 = nothing is pressed or released
2291/// -2 = leave the window
2292/// else = keycode (keyboard is pressed)
2293
2295{
2296 static int xloc = 0;
2297 static int yloc = 0;
2298 static int xlocp = 0;
2299 static int ylocp = 0;
2300 static GdkCursor *cursor = NULL;
2301 Int_t xtmp, ytmp;
2302
2303 GdkEvent *event;
2304 int button_press;
2305 int radius;
2306
2307 // Change the cursor shape
2308 if (cursor == NULL) {
2309 if (ctyp > 1) {
2312 } else {
2313 if (fUseSysPointers)
2315 else
2318 }
2319 }
2320
2321 // Event loop
2322 button_press = 0;
2323
2324 // Set max response time to 2 minutes to avoid timeout
2325 // in TGWin32ProxyBase::ForwardCallBack during RequestLocator
2327 while (button_press == 0) {
2328 event = gdk_event_get();
2329
2330 switch (ctyp) {
2331
2332 case 1:
2333 break;
2334
2335 case 2:
2336 gdk_draw_line(gCws->window, gGCecho, xloc, 0, xloc, gCws->height);
2337 gdk_draw_line(gCws->window, gGCecho, 0, yloc, gCws->width, yloc);
2338 break;
2339
2340 case 3:
2341 radius = (int) TMath::Sqrt((double)((xloc - xlocp) * (xloc - xlocp) +
2342 (yloc - ylocp) * (yloc - ylocp)));
2343
2345 xlocp - radius, ylocp - radius,
2346 2 * radius, 2 * radius, 0, 23040);
2347 break;
2348
2349 case 4:
2351 break;
2352
2353 case 5:
2357 break;
2358
2359 default:
2360 break;
2361 }
2362
2363 xloc = event->button.x;
2364 yloc = event->button.y;
2365
2366 switch (event->type) {
2367
2368 case GDK_LEAVE_NOTIFY:
2369 if (mode == 0) {
2370 while (1) {
2371 event = gdk_event_get();
2372
2373 if (event->type == GDK_ENTER_NOTIFY) {
2374 gdk_event_free(event);
2375 break;
2376 }
2377 gdk_event_free(event);
2378 }
2379 } else {
2380 button_press = -2;
2381 }
2382 break;
2383
2384 case GDK_BUTTON_PRESS:
2385 button_press = event->button.button;
2386 xlocp = event->button.x;
2387 ylocp = event->button.y;
2389 cursor = 0;
2390 break;
2391
2392 case GDK_BUTTON_RELEASE:
2393 if (mode == 1) {
2394 button_press = 10 + event->button.button;
2395 xlocp = event->button.x;
2396 ylocp = event->button.y;
2397 }
2398 break;
2399
2400 case GDK_KEY_PRESS:
2401 if (mode == 1) {
2402 button_press = event->key.keyval;
2403 xlocp = event->button.x;
2404 ylocp = event->button.y;
2405 }
2406 break;
2407
2408 case GDK_KEY_RELEASE:
2409 if (mode == 1) {
2410 button_press = -1 * (int)(event->key.keyval);
2411 xlocp = event->button.x;
2412 ylocp = event->button.y;
2413 }
2414 break;
2415
2416 default:
2417 break;
2418 }
2419
2420 xtmp = event->button.x;
2421 ytmp = event->button.y;
2422
2423 gdk_event_free(event);
2424
2425 if (mode == 1) {
2426 if (button_press == 0) {
2427 button_press = -1;
2428 }
2429 break;
2430 }
2431 }
2433
2434 x = xtmp;
2435 y = ytmp;
2436
2437 return button_press;
2438}
2439
2440////////////////////////////////////////////////////////////////////////////////
2441/// Request a string.
2442/// x,y : position where text is displayed
2443/// text : text displayed (input), edited text (output)
2444///
2445/// Request string:
2446/// text is displayed and can be edited with Emacs-like keybinding
2447/// return termination code (0 for ESC, 1 for RETURN)
2448
2450{
2451 static GdkCursor *cursor = NULL;
2452 static int percent = 0; // bell volume
2453 static GdkWindow *CurWnd;
2455 GdkEvent *event;
2456 KeySym keysym;
2457 int key = -1;
2458 size_t len_text = strlen(text);
2459 size_t nt; // defined length of text
2460 size_t pt; // cursor position in text
2461
2462 CurWnd = (GdkWindow *)gCws->window;
2463 // change the cursor shape
2464 if (cursor == NULL) {
2465 if (fUseSysPointers)
2467 else
2469 }
2470 if (cursor != 0) {
2472 }
2473 for (nt = len_text; nt > 0 && text[nt - 1] == ' '; nt--);
2474
2475 pt = nt;
2476 focuswindow = ::SetFocus((HWND)GDK_DRAWABLE_XID(CurWnd));
2477
2478 // Set max response time to 2 minutes to avoid timeout
2479 // in TGWin32ProxyBase::ForwardCallBack during RequestString
2483 do {
2484 char tmp[2];
2485 char keybuf[8];
2486 char nbytes;
2487 UInt_t dx, ddx, h;
2488 size_t i;
2489
2490 if (EventsPending()) {
2491 event = gdk_event_get();
2492 } else {
2494 ::SleepEx(10, kTRUE);
2495 continue;
2496 }
2497
2498 DrawText(x, y, 0.0, 1.0, text, kOpaque);
2500 DrawText(x+dx, y, 0.0, 1.0, " ", kOpaque);
2501
2502 if (pt == 0) {
2503 dx = 0;
2504 } else {
2505 char *stmp = new char[pt+1];
2506 strncpy(stmp, text, pt);
2507 stmp[pt] = '\0';
2509 dx = ddx;
2510 delete[] stmp;
2511 }
2512
2513 if (pt < len_text) {
2514 tmp[0] = text[pt];
2515 tmp[1] = '\0';
2516 DrawText(x+dx, y, 0.0, 1.0, tmp, kOpaque);
2517 } else {
2518 DrawText(x+dx, y, 0.0, 1.0, " ", kOpaque);
2519 }
2520
2521 if (event != NULL) {
2522 switch (event->type) {
2523 case GDK_BUTTON_PRESS:
2524 case GDK_ENTER_NOTIFY:
2525 focuswindow = ::SetFocus((HWND)GDK_DRAWABLE_XID(CurWnd));
2526 break;
2527
2528 case GDK_LEAVE_NOTIFY:
2529 ::SetFocus(focuswindow);
2530 break;
2531 case GDK_KEY_PRESS:
2532 nbytes = event->key.length;
2533 for (i = 0; i < nbytes; i++) {
2534 keybuf[i] = event->key.string[i];
2535 }
2536 keysym = event->key.keyval;
2537 switch (keysym) { // map cursor keys
2538 case GDK_BackSpace:
2539 keybuf[0] = 0x08; // backspace
2540 nbytes = 1;
2541 break;
2542 case GDK_Return:
2543 keybuf[0] = 0x0d; // return
2544 nbytes = 1;
2545 break;
2546 case GDK_Delete:
2547 keybuf[0] = 0x7f; // del
2548 nbytes = 1;
2549 break;
2550 case GDK_Escape:
2551 keybuf[0] = 0x1b; // esc
2552 nbytes = 1;
2553 break;
2554 case GDK_Home:
2555 keybuf[0] = 0x01; // home
2556 nbytes = 1;
2557 break;
2558 case GDK_Left:
2559 keybuf[0] = 0x02; // backward
2560 nbytes = 1;
2561 break;
2562 case GDK_Right:
2563 keybuf[0] = 0x06; // forward
2564 nbytes = 1;
2565 break;
2566 case GDK_End:
2567 keybuf[0] = 0x05; // end
2568 nbytes = 1;
2569 break;
2570 }
2571 if (nbytes == 1) {
2572 if (isascii(keybuf[0]) && isprint(keybuf[0])) {
2573 // insert character
2574 if (nt < len_text) {
2575 nt++;
2576 }
2577 for (i = nt - 1; i > pt; i--) {
2578 text[i] = text[i - 1];
2579 }
2580 if (pt < len_text) {
2581 text[pt] = keybuf[0];
2582 pt++;
2583 }
2584 } else {
2585 switch (keybuf[0]) {
2586 // Emacs-like editing keys
2587
2588 case 0x08: //'\010': // backspace
2589 case 0x7f: //'\177': // delete
2590 // delete backward
2591 if (pt > 0) {
2592 for (i = pt; i < nt; i++) {
2593 text[i - 1] = text[i];
2594 }
2595 text[nt - 1] = ' ';
2596 nt--;
2597 pt--;
2598 }
2599 break;
2600 case 0x01: //'\001': // ^A
2601 // beginning of line
2602 pt = 0;
2603 break;
2604 case 0x02: //'\002': // ^B
2605 // move backward
2606 if (pt > 0) {
2607 pt--;
2608 }
2609 break;
2610 case 0x04: //'\004': // ^D
2611 // delete forward
2612 if (pt > 0) {
2613 for (i = pt; i < nt; i++) {
2614 text[i - 1] = text[i];
2615 }
2616 text[nt - 1] = ' ';
2617 pt--;
2618 }
2619 break;
2620 case 0x05: //'\005': // ^E
2621 // end of line
2622 pt = nt;
2623 break;
2624
2625 case 0x06: //'\006': // ^F
2626 // move forward
2627 if (pt < nt) {
2628 pt++;
2629 }
2630 break;
2631 case 0x0b: //'\013': // ^K
2632 // delete to end of line
2633 for (i = pt; i < nt; i++)
2634 text[i] = ' ';
2635 nt = pt;
2636 break;
2637 case 0x14: //'\024': // ^T
2638 // transpose
2639 if (pt > 0) {
2640 char c = text[pt];
2641 text[pt] = text[pt - 1];
2642 text[pt - 1] = c;
2643 }
2644 break;
2645 case 0x0A: //'\012': // newline
2646 case 0x0D: //'\015': // return
2647 key = 1;
2648 break;
2649 case 0x1B: //'\033': // escape
2650 key = 0;
2651 break;
2652
2653 default:
2654 gSystem->Beep();
2655 break;
2656 }
2657 }
2658 }
2659 default:
2660 SetInputFocus((Window_t)gCws->window);
2661 break;
2662 }
2663 gdk_event_free(event);
2664 }
2665 } while (key < 0);
2667 ::SetFocus(focuswindow);
2669
2671 if (cursor != 0) {
2673 cursor = 0;
2674 }
2675
2676 return key;
2677}
2678
2679////////////////////////////////////////////////////////////////////////////////
2680/// Rescale the window wid.
2681/// wid : GdkWindow identifier
2682/// w : Width
2683/// h : Heigth
2684
2685void TGWin32::RescaleWindow(int wid, unsigned int w, unsigned int h)
2686{
2687 if (fWindows.count(wid) == 0) return;
2688
2689 gTws = fWindows[wid].get();
2690 if (!gTws->open)
2691 return;
2692
2693 // don't do anything when size did not change
2694 if (gTws->width == w && gTws->height == h)
2695 return;
2696
2697 gdk_window_resize((GdkWindow *) gTws->window, w, h);
2698
2699 if (gTws->buffer) {
2700 // don't free and recreate pixmap when new pixmap is smaller
2701 if (gTws->width < w || gTws->height < h) {
2702 gdk_pixmap_unref(gTws->buffer);
2703 gTws->buffer = gdk_pixmap_new(GDK_ROOT_PARENT(), // NULL,
2705 }
2706 for (int i = 0; i < kMAXGC; i++)
2707 gdk_gc_set_clip_mask(gTws->fGClist[i], (GdkBitmap *)None);
2708 SetColor(gTws, gTws->fGClist[kGCpxmp], 0);
2709 gdk_win32_draw_rectangle(gTws->buffer, gTws->fGClist[kGCpxmp], 1, 0, 0, w, h);
2710 SetColor(gTws, gTws->fGClist[kGCpxmp], 1);
2711
2712 if (gTws->double_buffer)
2713 gTws->drawing = gTws->buffer;
2714 }
2715 gTws->width = w;
2716 gTws->height = h;
2717}
2718
2719////////////////////////////////////////////////////////////////////////////////
2720/// Resize a pixmap.
2721/// wid : pixmap to be resized
2722/// w,h : Width and height of the pixmap
2723
2724int TGWin32::ResizePixmap(int wid, unsigned int w, unsigned int h)
2725{
2726 int wval, hval;
2727 int ww, hh, depth;
2728 wval = w;
2729 hval = h;
2730
2731 if (fWindows.count(wid) == 0) return 0;
2732
2733 gTws = fWindows[wid].get();
2734
2735 // don't do anything when size did not change
2736 // if (gTws->width == wval && gTws->height == hval) return 0;
2737
2738 // due to round-off errors in TPad::Resize() we might get +/- 1 pixel
2739 // change, in those cases don't resize pixmap
2740 if (gTws->width >= wval - 1 && gTws->width <= wval + 1 &&
2741 gTws->height >= hval - 1 && gTws->height <= hval + 1)
2742 return 0;
2743
2744 // don't free and recreate pixmap when new pixmap is smaller
2745 if (gTws->width < wval || gTws->height < hval) {
2746 gdk_pixmap_unref((GdkPixmap *)gTws->window);
2749 }
2750
2751 gdk_drawable_get_size(gTws->window, &ww, &hh);
2752
2753 for (int i = 0; i < kMAXGC; i++)
2754 gdk_gc_set_clip_mask(gTws->fGClist[i], (GdkDrawable *)None);
2755
2756 SetColor(gTws, gTws->fGClist[kGCpxmp], 0);
2757 gdk_win32_draw_rectangle(gTws->window, gTws->fGClist[kGCpxmp], kTRUE, 0, 0, ww, hh);
2758 SetColor(gTws, gTws->fGClist[kGCpxmp], 1);
2759
2760 // Initialise the window structure
2761 gTws->drawing = gTws->window;
2762 gTws->width = wval;
2763 gTws->height = hval;
2764 return 1;
2765}
2766
2767////////////////////////////////////////////////////////////////////////////////
2768/// Resize the current window if necessary.
2769
2771{
2772 if (fWindows.count(wid) == 0) return;
2773
2774 int xval = 0, yval = 0, wval = 0, hval = 0, depth = 0;
2775
2776 gTws = fWindows[wid].get();
2777
2778 auto win = (GdkWindow *) gTws->window;
2780 &wval, &hval, &depth);
2781
2782 // don't do anything when size did not change
2783 if (gTws->width == wval && gTws->height == hval) {
2784 return;
2785 }
2786
2787 gdk_window_resize((GdkWindow *) gTws->window, wval, hval);
2788
2789 if (gTws->buffer) {
2790 if (gTws->width < wval || gTws->height < hval) {
2791 gdk_pixmap_unref((GdkPixmap *)gTws->buffer);
2794 wval, hval, depth);
2795 }
2796
2797 for (int i = 0; i < kMAXGC; i++)
2798 gdk_gc_set_clip_mask(gTws->fGClist[i], (GdkDrawable *)None);
2799
2800 SetColor(gTws, gTws->fGClist[kGCpxmp], 0);
2801 gdk_win32_draw_rectangle(gTws->buffer, gTws->fGClist[kGCpxmp], kTRUE, 0, 0, wval, hval);
2802
2803 SetColor(gTws, gTws->fGClist[kGCpxmp], 1);
2804
2805 if (gTws->double_buffer)
2806 gTws->drawing = gTws->buffer;
2807 }
2808
2809 gTws->width = wval;
2810 gTws->height = hval;
2811}
2812
2813////////////////////////////////////////////////////////////////////////////////
2814/// Select window to which subsequent output is directed.
2815
2817{
2818 if (fWindows.count(wid) == 0) return;
2819
2820 if (!fWindows[wid]->open) return;
2821
2822 gCws = fWindows[wid].get();
2823
2824 if (gCws->clip && !gCws->ispixmap && !gCws->double_buffer) {
2826 rect.x = gCws->xclip;
2827 rect.y = gCws->yclip;
2828 rect.width = gCws->wclip;
2829 rect.height = gCws->hclip;
2830
2831 for (int i = 0; i < kMAXGC; i++)
2832 gdk_gc_set_clip_rectangle(gCws->fGClist[i], &rect);
2833 } else {
2834 for (int i = 0; i < kMAXGC; i++)
2835 gdk_gc_set_clip_mask(gCws->fGClist[i], (GdkDrawable *)None);
2836 }
2837}
2838
2839////////////////////////////////////////////////////////////////////////////////
2840/// Set character up vector.
2841
2843{
2844 if (chupx == fCharacterUpX && chupy == fCharacterUpY) return;
2845
2846 if (chupx == 0 && chupy == 0) {
2847 fTextAngle = 0;
2848 } else if (chupx == 0 && chupy == 1) {
2849 fTextAngle = 0;
2850 } else if (chupx == -1 && chupy == 0) {
2851 fTextAngle = 90;
2852 } else if (chupx == 0 && chupy == -1) {
2853 fTextAngle = 180;
2854 } else if (chupx == 1 && chupy == 0) {
2855 fTextAngle = 270;
2856 } else {
2857 fTextAngle =
2858 ((TMath::
2860 180.) / 3.14159) - 90;
2861 if (chupy < 0) fTextAngle = 180 - fTextAngle;
2862 if (TMath::Abs(fTextAngle) <= 0.01) fTextAngle = 0;
2863 }
2866}
2867
2868////////////////////////////////////////////////////////////////////////////////
2869/// Turn off the clipping for the window wid.
2870
2872{
2873 if (fWindows.count(wid) == 0) return;
2874
2875 gTws = fWindows[wid].get();
2876 gTws->clip = 0;
2877
2878 for (int i = 0; i < kMAXGC; i++)
2879 gdk_gc_set_clip_mask(gTws->fGClist[i], (GdkDrawable *)None);
2880}
2881
2882////////////////////////////////////////////////////////////////////////////////
2883/// Set clipping region for the window wid.
2884/// wid : GdkWindow indentifier
2885/// x,y : origin of clipping rectangle
2886/// w,h : size of clipping rectangle;
2887
2888void TGWin32::SetClipRegion(int wid, int x, int y, unsigned int w,
2889 unsigned int h)
2890{
2891 if (fWindows.count(wid) == 0) return;
2892
2893 gTws = fWindows[wid].get();
2894 gTws->xclip = x;
2895 gTws->yclip = y;
2896 gTws->wclip = w;
2897 gTws->hclip = h;
2898 gTws->clip = 1;
2899
2900 if (gTws->clip && !gTws->ispixmap && !gTws->double_buffer) {
2902 rect.x = gTws->xclip;
2903 rect.y = gTws->yclip;
2904 rect.width = gTws->wclip;
2905 rect.height = gTws->hclip;
2906
2907 for (int i = 0; i < kMAXGC; i++)
2908 gdk_gc_set_clip_rectangle(gTws->fGClist[i], &rect);
2909 }
2910}
2911
2912////////////////////////////////////////////////////////////////////////////////
2913/// Return pixel value associated to specified ROOT color number.
2914
2916{
2917 TColor *color = gROOT->GetColor(ci);
2918 if (color)
2919 SetRGB(ci, color->GetRed(), color->GetGreen(), color->GetBlue());
2920 XColor_t &col = GetColor(ci);
2921 return col.color.pixel;
2922}
2923
2924////////////////////////////////////////////////////////////////////////////////
2925/// Set the foreground color in GdkGC.
2926
2928{
2930 GdkColor color;
2931
2932 if (ci <= 0) ci = 10; //white
2933
2934 TColor *clr = gROOT->GetColor(ci);
2935 if (clr)
2936 SetRGB(ci, clr->GetRed(), clr->GetGreen(), clr->GetBlue());
2937
2938 XColor_t &col = GetColor(ci);
2939 if (fColormap && !col.fDefined) {
2940 col = GetColor(0);
2941 } else if (!fColormap && (ci < 0 || ci > 1)) {
2942 col = GetColor(0);
2943 }
2944
2945 if (ctxt && ctxt->drawMode == kXor) {
2947
2948 color.pixel = col.color.pixel ^ gcvals.background.pixel;
2949 color.red = GetRValue(color.pixel);
2950 color.green = GetGValue(color.pixel);
2951 color.blue = GetBValue(color.pixel);
2952 gdk_gc_set_foreground(gc, &color);
2953
2954 } else {
2956
2957 // make sure that foreground and background are different
2959
2960 if (gcvals.foreground.pixel != gcvals.background.pixel) {
2962 }
2963 }
2964}
2965
2966////////////////////////////////////////////////////////////////////////////////
2967/// Set the cursor.
2968
2970{
2971 if (fWindows.count(wid) == 0) return;
2972
2973 gTws = fWindows[wid].get();
2975}
2976
2977////////////////////////////////////////////////////////////////////////////////
2978/// Set the specified cursor.
2979
2981{
2982 if (!id) return;
2983
2984 static GdkWindow *lid = 0;
2985 static GdkCursor *lcur = 0;
2986
2987 if ((lid == (GdkWindow *)id) && (lcur==(GdkCursor *)curid)) return;
2988 lid = (GdkWindow *)id;
2989 lcur = (GdkCursor *)curid;
2990
2992}
2993
2994////////////////////////////////////////////////////////////////////////////////
2995/// Set the double buffer on/off on window wid.
2996/// wid : GdkWindow identifier.
2997/// 999 means all the opened windows.
2998/// mode : 1 double buffer is on
2999/// 0 double buffer is off
3000
3002{
3003 if (wid == 999) {
3004 for (auto & pair : fWindows) {
3005 gTws = pair.second.get();
3006 if (gTws->open) {
3007 switch (mode) {
3008 case 1:
3010 break;
3011 default:
3013 break;
3014 }
3015 }
3016 }
3017 } else {
3018 if (fWindows.count(wid) == 0) return;
3019
3020 gTws = fWindows[wid].get();
3021 if (!gTws->open) return;
3022
3023 switch (mode) {
3024 case 1:
3026 return;
3027 default:
3029 return;
3030 }
3031 }
3032}
3033
3034////////////////////////////////////////////////////////////////////////////////
3035/// Turn double buffer mode off.
3036
3038{
3039 if (!gTws->double_buffer) return;
3040 gTws->double_buffer = 0;
3041 gTws->drawing = gTws->window;
3042}
3043
3044////////////////////////////////////////////////////////////////////////////////
3045/// Turn double buffer mode on.
3046
3048{
3049 if (fWindows.size() == 0 || !gTws || gTws->double_buffer || gTws->ispixmap) return;
3050
3051 if (!gTws->buffer) {
3052 gTws->buffer = gdk_pixmap_new(GDK_ROOT_PARENT(), //NULL,
3053 gTws->width, gTws->height,
3055 SetColor(gTws, gTws->fGClist[kGCpxmp], 0);
3056 gdk_win32_draw_rectangle(gTws->buffer, gTws->fGClist[kGCpxmp], 1, 0, 0,
3057 gTws->width, gTws->height);
3058 SetColor(gTws, gTws->fGClist[kGCpxmp], 1);
3059 }
3060 for (int i = 0; i < kMAXGC; i++)
3061 gdk_gc_set_clip_mask(gTws->fGClist[i], (GdkBitmap *)None);
3062 gTws->double_buffer = 1;
3063 gTws->drawing = gTws->buffer;
3064}
3065
3066////////////////////////////////////////////////////////////////////////////////
3067/// Set the drawing mode.
3068/// mode : drawing mode
3069/// mode=1 copy
3070/// mode=2 xor
3071/// mode=3 invert
3072/// mode=4 set the suitable mode for cursor echo according to
3073/// the vendor
3074
3079
3080////////////////////////////////////////////////////////////////////////////////
3081/// Set color index for fill areas.
3082
3084{
3085 if (cindex < 0) return;
3086
3088
3089 TAttFill arg(gCws->fAttFill);
3090 arg.SetFillColor(cindex);
3091
3093}
3094
3095////////////////////////////////////////////////////////////////////////////////
3096/// Return current fill color
3097
3099{
3100 // TODO: remove in ROOT7, no longer used in ROOT
3101
3102 return gCws ? gCws->fAttFill.GetFillColor() : TAttFill::GetFillColor();
3103}
3104
3105////////////////////////////////////////////////////////////////////////////////
3106/// Set fill area style.
3107/// fstyle : compound fill area interior style
3108/// fstyle = 1000*interiorstyle + styleindex
3109
3111{
3113
3114 TAttFill arg(gCws->fAttFill);
3115 arg.SetFillStyle(fstyle);
3116
3118}
3119
3120////////////////////////////////////////////////////////////////////////////////
3121/// Return current fill style
3122
3124{
3125 // TODO: remove in ROOT7, no longer used in ROOT
3126
3127 return gCws ? gCws->fAttFill.GetFillStyle() : TAttFill::GetFillStyle();
3128}
3129
3130////////////////////////////////////////////////////////////////////////////////
3131/// Set fill attributes for specified window
3132
3134{
3135 auto ctxt = (XWindow_t *) wctxt;
3136 if (!ctxt)
3137 return;
3138
3139 Int_t cindex = att.GetFillColor();
3140 if (!gStyle->GetFillColor() && cindex > 1)
3141 cindex = 0;
3142 if (cindex >= 0)
3143 SetColor(ctxt, ctxt->fGClist[kGCfill], Int_t(cindex));
3144 ctxt->fAttFill.SetFillColor(cindex);
3145
3146 Int_t style = att.GetFillStyle() / 1000;
3147 Int_t fasi = att.GetFillStyle() % 1000;
3148
3149 switch (style) {
3150 case 1: // solid
3151 ctxt->fillHollow = 0;
3153 break;
3154
3155 case 2: // pattern
3156 ctxt->fillHollow = 1;
3157 break;
3158
3159 case 3: // hatch
3160 ctxt->fillHollow = 0;
3162
3163 if (fasi != ctxt->fillFasi) {
3164 if (ctxt->fillPattern) {
3165 gdk_pixmap_unref(ctxt->fillPattern);
3166 ctxt->fillPattern = nullptr;
3167 }
3168 int stn = (fasi >= 1 && fasi <=25) ? fasi : 2;
3169 char pattern[32];
3170 for (int i = 0; i < 32; ++i)
3171 pattern[i] = ~gStipples[stn][i];
3173 (const char *)&pattern, 16, 16);
3174 gdk_gc_set_stipple(ctxt->fGClist[kGCfill], ctxt->fillPattern);
3175 ctxt->fillFasi = fasi;
3176 }
3177 break;
3178
3179 default:
3180 ctxt->fillHollow = 1;
3181 }
3182
3183 ctxt->fAttFill.SetFillStyle(att.GetFillStyle());
3184}
3185
3186////////////////////////////////////////////////////////////////////////////////
3187/// Set input on or off.
3188
3190{
3192}
3193
3194////////////////////////////////////////////////////////////////////////////////
3195/// Set color index for lines.
3196
3198{
3199 if (cindex < 0) return;
3200
3202
3203 TAttLine arg(gCws->fAttLine);
3204 arg.SetLineColor(cindex);
3205
3207}
3208
3209////////////////////////////////////////////////////////////////////////////////
3210/// Set line type.
3211/// n : length of dash list
3212/// dash(n) : dash segment lengths
3213///
3214/// if n <= 0 use solid lines
3215/// if n > 0 use dashed lines described by DASH(N)
3216/// e.g. N=4,DASH=(6,3,1,3) gives a dashed-dotted line with dash length 6
3217/// and a gap of 7 between dashes
3218
3219void TGWin32::SetLineType(int /* n */ , int * /* dash */)
3220{
3221 Warning("SetLineType", "DEPRECATED, use SetAttLine() instead");
3222}
3223
3224////////////////////////////////////////////////////////////////////////////////
3225/// Set line style.
3226
3228{
3230
3231 TAttLine arg(gCws->fAttLine);
3232 arg.SetLineStyle(lstyle);
3233
3235}
3236
3237////////////////////////////////////////////////////////////////////////////////
3238/// Return current line style
3239
3241{
3242 // TODO: remove in ROOT7, no longer used in ROOT
3243
3244 return gCws ? gCws->fAttLine.GetLineStyle() : TAttLine::GetLineStyle();
3245}
3246
3247////////////////////////////////////////////////////////////////////////////////
3248/// Set line width.
3249/// width : line width in pixels
3250
3252{
3254
3255 TAttLine arg(gCws->fAttLine);
3256 arg.SetLineWidth(width);
3257
3259}
3260
3261////////////////////////////////////////////////////////////////////////////////
3262/// Return current line width
3263
3265{
3266 // TODO: remove in ROOT7, no longer used in ROOT
3267
3268 return gCws ? gCws->fAttLine.GetLineWidth() : TAttLine::GetLineWidth();
3269}
3270
3271////////////////////////////////////////////////////////////////////////////////
3272/// Set line attributes for specified window.
3273
3275{
3276 auto ctxt = (XWindow_t *) wctxt;
3277 if (!ctxt)
3278 return;
3279
3280 SetColor(ctxt, ctxt->fGClist[kGCline], att.GetLineColor());
3281 SetColor(ctxt, ctxt->fGClist[kGCdash], att.GetLineColor());
3282
3283 if (ctxt->fAttLine.GetLineStyle() != att.GetLineStyle()) { //set style index only if different
3284 if (att.GetLineStyle() <= 1)
3285 ctxt->dashList.clear();
3286 else if (att.GetLineStyle() == 2)
3287 ctxt->dashList = { 3, 3 };
3288 else if (att.GetLineStyle() == 3)
3289 ctxt->dashList = { 1, 2 };
3290 else if (att.GetLineStyle() == 4) {
3291 ctxt->dashList = { 3, 4, 1, 4} ;
3292 } else {
3293 TString st = (TString)gStyle->GetLineStyleString(att.GetLineStyle());
3294 auto tokens = st.Tokenize(" ");
3295 Int_t nt = tokens->GetEntries();
3296 ctxt->dashList.resize(nt);
3297 for (Int_t j = 0; j < nt; ++j) {
3298 Int_t it;
3299 sscanf(tokens->At(j)->GetName(), "%d", &it);
3300 ctxt->dashList[j] = (Int_t) (it/4);
3301 }
3302 delete tokens;
3303 }
3304 ctxt->dashLength = 0;
3305 for (auto elem : ctxt->dashList)
3306 ctxt->dashLength += elem;
3307 ctxt->dashOffset = 0;
3308 ctxt->lineStyle = ctxt->dashList.size() == 0 ? GDK_LINE_SOLID : GDK_LINE_ON_OFF_DASH;
3309 }
3310
3311 ctxt->lineWidth = att.GetLineWidth();
3312 if (ctxt->lineWidth == 1 && ctxt->lineStyle == GDK_LINE_SOLID)
3313 ctxt->lineWidth = 0;
3314
3315 if (ctxt->lineStyle == GDK_LINE_SOLID) {
3316 gdk_gc_set_line_attributes(ctxt->fGClist[kGCline], ctxt->lineWidth,
3317 ctxt->lineStyle,
3320 } else {
3321 gdk_gc_set_line_attributes(ctxt->fGClist[kGCdash], ctxt->lineWidth,
3322 ctxt->lineStyle,
3325 }
3326
3327 ctxt->fAttLine = att;
3328}
3329
3330
3331////////////////////////////////////////////////////////////////////////////////
3332/// Set color index for markers.
3333
3335{
3336 if (cindex < 0) return;
3337
3339
3340 TAttMarker arg(gCws->fAttMarker);
3342
3344}
3345
3346////////////////////////////////////////////////////////////////////////////////
3347/// Set marker size index.
3348/// msize : marker scale factor
3349
3351{
3352 if ((msize == TAttMarker::GetMarkerSize()) || (msize < 0))
3353 return;
3354
3356
3357 TAttMarker arg(gCws->fAttMarker);
3358 arg.SetMarkerSize(msize);
3359
3361}
3362
3363////////////////////////////////////////////////////////////////////////////////
3364/// Set marker style.
3365
3367{
3369 return;
3370
3372
3373 TAttMarker arg(gCws->fAttMarker);
3375
3377}
3378
3379////////////////////////////////////////////////////////////////////////////////
3380/// Set marker attributes for speicfied window
3381
3383{
3384 auto ctxt = (XWindow_t *) wctxt;
3385 if (!ctxt)
3386 return;
3387
3388 SetColor(ctxt, ctxt->fGClist[kGCmark], att.GetMarkerColor());
3389
3390 Bool_t changed = (att.GetMarkerSize() != ctxt->fAttMarker.GetMarkerSize()) ||
3391 (att.GetMarkerStyle() != ctxt->fAttMarker.GetMarkerStyle());
3392
3393 ctxt->fAttMarker = att;
3394
3395 if (!changed)
3396 return;
3397
3398 auto markerstyle = TAttMarker::GetMarkerStyleBase(att.GetMarkerStyle());
3399 ctxt->markerLineWidth = TAttMarker::GetMarkerLineWidth(att.GetMarkerStyle());
3400
3401 // The fast pixel markers need to be treated separately
3402 if (markerstyle == 1 || markerstyle == 6 || markerstyle == 7) {
3404 } else {
3405 gdk_gc_set_line_attributes(ctxt->fGClist[kGCmark], ctxt->markerLineWidth,
3406 (GdkLineStyle) gMarkerLineStyle,
3409 }
3410
3411 Float_t markerSizeReduced = att.GetMarkerSize() - TMath::Floor(ctxt->markerLineWidth/2.)/4.;
3412 Int_t im = Int_t(4 * markerSizeReduced + 0.5);
3413
3414 auto& shape = ctxt->markerShape;
3415 ctxt->markerSize = 0;
3416 ctxt->markerType = 0;
3417
3418 if (markerstyle == 2) {
3419 // + shaped marker
3420 shape.resize(4);
3421 shape[0].x = -im;
3422 shape[0].y = 0;
3423 shape[1].x = im;
3424 shape[1].y = 0;
3425 shape[2].x = 0;
3426 shape[2].y = -im;
3427 shape[3].x = 0;
3428 shape[3].y = im;
3429 ctxt->markerType = 4;
3430 } else if (markerstyle == 3 || markerstyle == 31) {
3431 // * shaped marker
3432 shape.resize(8);
3433 shape[0].x = -im;
3434 shape[0].y = 0;
3435 shape[1].x = im;
3436 shape[1].y = 0;
3437 shape[2].x = 0;
3438 shape[2].y = -im;
3439 shape[3].x = 0;
3440 shape[3].y = im;
3441 im = Int_t(0.707 * Float_t(im) + 0.5);
3442 shape[4].x = -im;
3443 shape[4].y = -im;
3444 shape[5].x = im;
3445 shape[5].y = im;
3446 shape[6].x = -im;
3447 shape[6].y = im;
3448 shape[7].x = im;
3449 shape[7].y = -im;
3450 ctxt->markerType = 4;
3451 } else if (markerstyle == 4 || markerstyle == 24) {
3452 // O shaped marker
3453 shape.resize(0);
3454 ctxt->markerType = 0;
3455 ctxt->markerSize = im * 2;
3456 } else if (markerstyle == 5) {
3457 // X shaped marker
3458 im = Int_t(0.707 * Float_t(im) + 0.5);
3459 shape.resize(4);
3460 shape[0].x = -im;
3461 shape[0].y = -im;
3462 shape[1].x = im;
3463 shape[1].y = im;
3464 shape[2].x = -im;
3465 shape[2].y = im;
3466 shape[3].x = im;
3467 shape[3].y = -im;
3468 ctxt->markerType = 4;
3469 } else if (markerstyle == 6) {
3470 // + shaped marker (with 1 pixel)
3471 shape.resize(4);
3472 shape[0].x = -1;
3473 shape[0].y = 0;
3474 shape[1].x = 1;
3475 shape[1].y = 0;
3476 shape[2].x = 0;
3477 shape[2].y = -1;
3478 shape[3].x = 0;
3479 shape[3].y = 1;
3480 ctxt->markerType = 4;
3481 } else if (markerstyle == 7) {
3482 // . shaped marker (with 9 pixel)
3483 shape.resize(6);
3484 shape[0].x = -1;
3485 shape[0].y = 1;
3486 shape[1].x = 1;
3487 shape[1].y = 1;
3488 shape[2].x = -1;
3489 shape[2].y = 0;
3490 shape[3].x = 1;
3491 shape[3].y = 0;
3492 shape[4].x = -1;
3493 shape[4].y = -1;
3494 shape[5].x = 1;
3495 shape[5].y = -1;
3496 ctxt->markerType = 4;
3497 } else if (markerstyle == 8 || markerstyle == 20) {
3498 // O shaped marker (filled)
3499 shape.resize(0);
3500 ctxt->markerType = 0;
3501 ctxt->markerSize = im * 2;
3502 } else if (markerstyle == 21) {
3503 // full square
3504 shape.resize(5);
3505 shape[0].x = -im;
3506 shape[0].y = -im;
3507 shape[1].x = im;
3508 shape[1].y = -im;
3509 shape[2].x = im;
3510 shape[2].y = im;
3511 shape[3].x = -im;
3512 shape[3].y = im;
3513 shape[4].x = -im;
3514 shape[4].y = -im;
3515 ctxt->markerType = 3;
3516 } else if (markerstyle == 22) {
3517 // full triangle up
3518 shape.resize(4);
3519 shape[0].x = -im;
3520 shape[0].y = im;
3521 shape[1].x = im;
3522 shape[1].y = im;
3523 shape[2].x = 0;
3524 shape[2].y = -im;
3525 shape[3].x = -im;
3526 shape[3].y = im;
3527 ctxt->markerType = 3;
3528 } else if (markerstyle == 23) {
3529 // full triangle down
3530 shape.resize(4);
3531 shape[0].x = 0;
3532 shape[0].y = im;
3533 shape[1].x = im;
3534 shape[1].y = -im;
3535 shape[2].x = -im;
3536 shape[2].y = -im;
3537 shape[3].x = 0;
3538 shape[3].y = im;
3539 ctxt->markerType = 3;
3540 } else if (markerstyle == 25) {
3541 // open square
3542 shape.resize(5);
3543 shape[0].x = -im;
3544 shape[0].y = -im;
3545 shape[1].x = im;
3546 shape[1].y = -im;
3547 shape[2].x = im;
3548 shape[2].y = im;
3549 shape[3].x = -im;
3550 shape[3].y = im;
3551 shape[4].x = -im;
3552 shape[4].y = -im;
3553 ctxt->markerType = 2;
3554 } else if (markerstyle == 26) {
3555 // open triangle up
3556 shape.resize(4);
3557 shape[0].x = -im;
3558 shape[0].y = im;
3559 shape[1].x = im;
3560 shape[1].y = im;
3561 shape[2].x = 0;
3562 shape[2].y = -im;
3563 shape[3].x = -im;
3564 shape[3].y = im;
3565 ctxt->markerType = 2;
3566 } else if (markerstyle == 27) {
3567 // open losange
3568 Int_t imx = Int_t(2.66 * markerSizeReduced + 0.5);
3569 shape.resize(5);
3570 shape[0].x = -imx;
3571 shape[0].y = 0;
3572 shape[1].x = 0;
3573 shape[1].y = -im;
3574 shape[2].x = imx;
3575 shape[2].y = 0;
3576 shape[3].x = 0;
3577 shape[3].y = im;
3578 shape[4].x = -imx;
3579 shape[4].y = 0;
3580 ctxt->markerType = 2;
3581 } else if (markerstyle == 28) {
3582 // open cross
3583 Int_t imx = Int_t(1.33 * markerSizeReduced + 0.5);
3584 shape.resize(13);
3585 shape[0].x = -im;
3586 shape[0].y = -imx;
3587 shape[1].x = -imx;
3588 shape[1].y = -imx;
3589 shape[2].x = -imx;
3590 shape[2].y = -im;
3591 shape[3].x = imx;
3592 shape[3].y = -im;
3593 shape[4].x = imx;
3594 shape[4].y = -imx;
3595 shape[5].x = im;
3596 shape[5].y = -imx;
3597 shape[6].x = im;
3598 shape[6].y = imx;
3599 shape[7].x = imx;
3600 shape[7].y = imx;
3601 shape[8].x = imx;
3602 shape[8].y = im;
3603 shape[9].x = -imx;
3604 shape[9].y = im;
3605 shape[10].x = -imx;
3606 shape[10].y = imx;
3607 shape[11].x = -im;
3608 shape[11].y = imx;
3609 shape[12].x = -im;
3610 shape[12].y = -imx;
3611 ctxt->markerType = 2;
3612 } else if (markerstyle == 29) {
3613 // full star pentagone
3614 Int_t im1 = Int_t(0.66 * markerSizeReduced + 0.5);
3615 Int_t im2 = Int_t(2.00 * markerSizeReduced + 0.5);
3616 Int_t im3 = Int_t(2.66 * markerSizeReduced + 0.5);
3617 Int_t im4 = Int_t(1.33 * markerSizeReduced + 0.5);
3618 shape.resize(11);
3619 shape[0].x = -im;
3620 shape[0].y = im4;
3621 shape[1].x = -im2;
3622 shape[1].y = -im1;
3623 shape[2].x = -im3;
3624 shape[2].y = -im;
3625 shape[3].x = 0;
3626 shape[3].y = -im2;
3627 shape[4].x = im3;
3628 shape[4].y = -im;
3629 shape[5].x = im2;
3630 shape[5].y = -im1;
3631 shape[6].x = im;
3632 shape[6].y = im4;
3633 shape[7].x = im4;
3634 shape[7].y = im4;
3635 shape[8].x = 0;
3636 shape[8].y = im;
3637 shape[9].x = -im4;
3638 shape[9].y = im4;
3639 shape[10].x = -im;
3640 shape[10].y = im4;
3641 ctxt->markerType = 3;
3642 } else if (markerstyle == 30) {
3643 // open star pentagone
3644 Int_t im1 = Int_t(0.66 * markerSizeReduced + 0.5);
3645 Int_t im2 = Int_t(2.00 * markerSizeReduced + 0.5);
3646 Int_t im3 = Int_t(2.66 * markerSizeReduced + 0.5);
3647 Int_t im4 = Int_t(1.33 * markerSizeReduced + 0.5);
3648 shape.resize(11);
3649 shape[0].x = -im;
3650 shape[0].y = im4;
3651 shape[1].x = -im2;
3652 shape[1].y = -im1;
3653 shape[2].x = -im3;
3654 shape[2].y = -im;
3655 shape[3].x = 0;
3656 shape[3].y = -im2;
3657 shape[4].x = im3;
3658 shape[4].y = -im;
3659 shape[5].x = im2;
3660 shape[5].y = -im1;
3661 shape[6].x = im;
3662 shape[6].y = im4;
3663 shape[7].x = im4;
3664 shape[7].y = im4;
3665 shape[8].x = 0;
3666 shape[8].y = im;
3667 shape[9].x = -im4;
3668 shape[9].y = im4;
3669 shape[10].x = -im;
3670 shape[10].y = im4;
3671 ctxt->markerType = 2;
3672 } else if (markerstyle == 32) {
3673 // open triangle down
3674 shape.resize(4);
3675 shape[0].x = 0; shape[0].y = im;
3676 shape[1].x = im; shape[1].y = -im;
3677 shape[2].x = -im; shape[2].y = -im;
3678 shape[3].x = 0; shape[3].y = im;
3679 ctxt->markerType = 2;
3680 } else if (markerstyle == 33) {
3681 // full losange
3682 Int_t imx = Int_t(2.66*markerSizeReduced + 0.5);
3683 shape.resize(5);
3684 shape[0].x =-imx; shape[0].y = 0;
3685 shape[1].x = 0; shape[1].y = -im;
3686 shape[2].x = imx; shape[2].y = 0;
3687 shape[3].x = 0; shape[3].y = im;
3688 shape[4].x =-imx; shape[4].y = 0;
3689 ctxt->markerType = 3;
3690 } else if (markerstyle == 34) {
3691 // full cross
3692 Int_t imx = Int_t(1.33*markerSizeReduced + 0.5);
3693 shape.resize(13);
3694 shape[0].x = -im; shape[0].y =-imx;
3695 shape[1].x =-imx; shape[1].y =-imx;
3696 shape[2].x =-imx; shape[2].y = -im;
3697 shape[3].x = imx; shape[3].y = -im;
3698 shape[4].x = imx; shape[4].y =-imx;
3699 shape[5].x = im; shape[5].y =-imx;
3700 shape[6].x = im; shape[6].y = imx;
3701 shape[7].x = imx; shape[7].y = imx;
3702 shape[8].x = imx; shape[8].y = im;
3703 shape[9].x =-imx; shape[9].y = im;
3704 shape[10].x=-imx; shape[10].y= imx;
3705 shape[11].x= -im; shape[11].y= imx;
3706 shape[12].x= -im; shape[12].y=-imx;
3707 ctxt->markerType = 3;
3708 } else if (markerstyle == 35) {
3709 // square with diagonal cross
3710 shape.resize(8);
3711 shape[0].x = -im; shape[0].y = -im;
3712 shape[1].x = im; shape[1].y = -im;
3713 shape[2].x = im; shape[2].y = im;
3714 shape[3].x = -im; shape[3].y = im;
3715 shape[4].x = -im; shape[4].y = -im;
3716 shape[5].x = im; shape[5].y = im;
3717 shape[6].x = -im; shape[6].y = im;
3718 shape[7].x = im; shape[7].y = -im;
3719 ctxt->markerType = 2;
3720 } else if (markerstyle == 36) {
3721 // diamond with cross
3722 shape.resize(8);
3723 shape[0].x =-im; shape[0].y = 0;
3724 shape[1].x = 0; shape[1].y = -im;
3725 shape[2].x = im; shape[2].y = 0;
3726 shape[3].x = 0; shape[3].y = im;
3727 shape[4].x =-im; shape[4].y = 0;
3728 shape[5].x = im; shape[5].y = 0;
3729 shape[6].x = 0; shape[6].y = im;
3730 shape[7].x = 0; shape[7].y =-im;
3731 ctxt->markerType = 2;
3732 } else if (markerstyle == 37) {
3733 // open three triangles
3734 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3735 shape.resize(10);
3736 shape[0].x = 0; shape[0].y = 0;
3737 shape[1].x =-im2; shape[1].y = im;
3738 shape[2].x = -im; shape[2].y = 0;
3739 shape[3].x = 0; shape[3].y = 0;
3740 shape[4].x =-im2; shape[4].y = -im;
3741 shape[5].x = im2; shape[5].y = -im;
3742 shape[6].x = 0; shape[6].y = 0;
3743 shape[7].x = im; shape[7].y = 0;
3744 shape[8].x = im2; shape[8].y = im;
3745 shape[9].x = 0; shape[9].y = 0;
3746 ctxt->markerType = 2;
3747 } else if (markerstyle == 38) {
3748 // + shaped marker with octagon
3749 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3750 shape.resize(15);
3751 shape[0].x = -im; shape[0].y = 0;
3752 shape[1].x = -im; shape[1].y =-im2;
3753 shape[2].x =-im2; shape[2].y =-im;
3754 shape[3].x = im2; shape[3].y = -im;
3755 shape[4].x = im; shape[4].y =-im2;
3756 shape[5].x = im; shape[5].y = im2;
3757 shape[6].x = im2; shape[6].y = im;
3758 shape[7].x =-im2; shape[7].y = im;
3759 shape[8].x = -im; shape[8].y = im2;
3760 shape[9].x = -im; shape[9].y = 0;
3761 shape[10].x = im; shape[10].y = 0;
3762 shape[11].x = 0; shape[11].y = 0;
3763 shape[12].x = 0; shape[12].y = -im;
3764 shape[13].x = 0; shape[13].y = im;
3765 shape[14].x = 0; shape[14].y = 0;
3766 ctxt->markerType = 2;
3767 } else if (markerstyle == 39) {
3768 // filled three triangles
3769 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3770 shape.resize(9);
3771 shape[0].x = 0; shape[0].y = 0;
3772 shape[1].x =-im2; shape[1].y = im;
3773 shape[2].x = -im; shape[2].y = 0;
3774 shape[3].x = 0; shape[3].y = 0;
3775 shape[4].x =-im2; shape[4].y = -im;
3776 shape[5].x = im2; shape[5].y = -im;
3777 shape[6].x = 0; shape[6].y = 0;
3778 shape[7].x = im; shape[7].y = 0;
3779 shape[8].x = im2; shape[8].y = im;
3780 ctxt->markerType = 3;
3781 } else if (markerstyle == 40) {
3782 // four open triangles X
3783 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3784 shape.resize(13);
3785 shape[0].x = 0; shape[0].y = 0;
3786 shape[1].x = im2; shape[1].y = im;
3787 shape[2].x = im; shape[2].y = im2;
3788 shape[3].x = 0; shape[3].y = 0;
3789 shape[4].x = im; shape[4].y = -im2;
3790 shape[5].x = im2; shape[5].y = -im;
3791 shape[6].x = 0; shape[6].y = 0;
3792 shape[7].x = -im2; shape[7].y = -im;
3793 shape[8].x = -im; shape[8].y = -im2;
3794 shape[9].x = 0; shape[9].y = 0;
3795 shape[10].x = -im; shape[10].y = im2;
3796 shape[11].x = -im2; shape[11].y = im;
3797 shape[12].x = 0; shape[12].y = 0;
3798 ctxt->markerType = 2;
3799 } else if (markerstyle == 41) {
3800 // four filled triangles X
3801 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3802 shape.resize(13);
3803 shape[0].x = 0; shape[0].y = 0;
3804 shape[1].x = im2; shape[1].y = im;
3805 shape[2].x = im; shape[2].y = im2;
3806 shape[3].x = 0; shape[3].y = 0;
3807 shape[4].x = im; shape[4].y = -im2;
3808 shape[5].x = im2; shape[5].y = -im;
3809 shape[6].x = 0; shape[6].y = 0;
3810 shape[7].x = -im2; shape[7].y = -im;
3811 shape[8].x = -im; shape[8].y = -im2;
3812 shape[9].x = 0; shape[9].y = 0;
3813 shape[10].x = -im; shape[10].y = im2;
3814 shape[11].x = -im2; shape[11].y = im;
3815 shape[12].x = 0; shape[12].y = 0;
3816 ctxt->markerType = 3;
3817 } else if (markerstyle == 42) {
3818 // open double diamonds
3820 shape.resize(9);
3821 shape[0].x= 0; shape[0].y= im;
3822 shape[1].x= -imx; shape[1].y= imx;
3823 shape[2].x = -im; shape[2].y = 0;
3824 shape[3].x = -imx; shape[3].y = -imx;
3825 shape[4].x = 0; shape[4].y = -im;
3826 shape[5].x = imx; shape[5].y = -imx;
3827 shape[6].x = im; shape[6].y = 0;
3828 shape[7].x= imx; shape[7].y= imx;
3829 shape[8].x= 0; shape[8].y= im;
3830 ctxt->markerType = 2;
3831 } else if (markerstyle == 43) {
3832 // filled double diamonds
3834 shape.resize(9);
3835 shape[0].x = 0; shape[0].y = im;
3836 shape[1].x = -imx; shape[1].y = imx;
3837 shape[2].x = -im; shape[2].y = 0;
3838 shape[3].x = -imx; shape[3].y = -imx;
3839 shape[4].x = 0; shape[4].y = -im;
3840 shape[5].x = imx; shape[5].y = -imx;
3841 shape[6].x = im; shape[6].y = 0;
3842 shape[7].x = imx; shape[7].y = imx;
3843 shape[8].x = 0; shape[8].y = im;
3844 ctxt->markerType = 3;
3845 } else if (markerstyle == 44) {
3846 // open four triangles plus
3847 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3848 shape.resize(11);
3849 shape[0].x = 0; shape[0].y = 0;
3850 shape[1].x = im2; shape[1].y = im;
3851 shape[2].x = -im2; shape[2].y = im;
3852 shape[3].x = im2; shape[3].y = -im;
3853 shape[4].x = -im2; shape[4].y = -im;
3854 shape[5].x = 0; shape[5].y = 0;
3855 shape[6].x = im; shape[6].y = im2;
3856 shape[7].x = im; shape[7].y = -im2;
3857 shape[8].x = -im; shape[8].y = im2;
3858 shape[9].x = -im; shape[9].y = -im2;
3859 shape[10].x = 0; shape[10].y = 0;
3860 ctxt->markerType = 2;
3861 } else if (markerstyle == 45) {
3862 // filled four triangles plus
3863 Int_t im0 = Int_t(0.4*markerSizeReduced + 0.5);
3864 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3865 shape.resize(13);
3866 shape[0].x = im0; shape[0].y = im0;
3867 shape[1].x = im2; shape[1].y = im;
3868 shape[2].x = -im2; shape[2].y = im;
3869 shape[3].x = -im0; shape[3].y = im0;
3870 shape[4].x = -im; shape[4].y = im2;
3871 shape[5].x = -im; shape[5].y = -im2;
3872 shape[6].x = -im0; shape[6].y = -im0;
3873 shape[7].x = -im2; shape[7].y = -im;
3874 shape[8].x = im2; shape[8].y = -im;
3875 shape[9].x = im0; shape[9].y = -im0;
3876 shape[10].x = im; shape[10].y = -im2;
3877 shape[11].x = im; shape[11].y = im2;
3878 shape[12].x = im0; shape[12].y = im0;
3879 ctxt->markerType = 3;
3880 } else if (markerstyle == 46) {
3881 // open four triangles X
3882 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3883 shape.resize(13);
3884 shape[0].x = 0; shape[0].y = im2;
3885 shape[1].x = -im2; shape[1].y = im;
3886 shape[2].x = -im; shape[2].y = im2;
3887 shape[3].x = -im2; shape[3].y = 0;
3888 shape[4].x = -im; shape[4].y = -im2;
3889 shape[5].x = -im2; shape[5].y = -im;
3890 shape[6].x = 0; shape[6].y = -im2;
3891 shape[7].x = im2; shape[7].y = -im;
3892 shape[8].x = im; shape[8].y = -im2;
3893 shape[9].x = im2; shape[9].y = 0;
3894 shape[10].x = im; shape[10].y = im2;
3895 shape[11].x = im2; shape[11].y = im;
3896 shape[12].x = 0; shape[12].y = im2;
3897 ctxt->markerType = 2;
3898 } else if (markerstyle == 47) {
3899 // filled four triangles X
3900 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3901 shape.resize(13);
3902 shape[0].x = 0; shape[0].y = im2;
3903 shape[1].x = -im2; shape[1].y = im;
3904 shape[2].x = -im; shape[2].y = im2;
3905 shape[3].x = -im2; shape[3].y = 0;
3906 shape[4].x = -im; shape[4].y = -im2;
3907 shape[5].x = -im2; shape[5].y = -im;
3908 shape[6].x = 0; shape[6].y = -im2;
3909 shape[7].x = im2; shape[7].y = -im;
3910 shape[8].x = im; shape[8].y = -im2;
3911 shape[9].x = im2; shape[9].y = 0;
3912 shape[10].x = im; shape[10].y = im2;
3913 shape[11].x = im2; shape[11].y = im;
3914 shape[12].x = 0; shape[12].y = im2;
3915 ctxt->markerType = 3;
3916 } else if (markerstyle == 48) {
3917 // four filled squares X
3918 Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5);
3919 shape.resize(17);
3920 shape[0].x = 0; shape[0].y = im2*1.005;
3921 shape[1].x = -im2; shape[1].y = im;
3922 shape[2].x = -im; shape[2].y = im2;
3923 shape[3].x = -im2; shape[3].y = 0;
3924 shape[4].x = -im; shape[4].y = -im2;
3925 shape[5].x = -im2; shape[5].y = -im;
3926 shape[6].x = 0; shape[6].y = -im2;
3927 shape[7].x = im2; shape[7].y = -im;
3928 shape[8].x = im; shape[8].y = -im2;
3929 shape[9].x = im2; shape[9].y = 0;
3930 shape[10].x = im; shape[10].y = im2;
3931 shape[11].x = im2; shape[11].y = im;
3932 shape[12].x = 0; shape[12].y = im2*0.995;
3933 shape[13].x = im2*0.995; shape[13].y = 0;
3934 shape[14].x = 0; shape[14].y = -im2*0.995;
3935 shape[15].x = -im2*0.995; shape[15].y = 0;
3936 shape[16].x = 0; shape[16].y = im2*0.995;
3937 ctxt->markerType = 3;
3938 } else if (markerstyle == 49) {
3939 // four filled squares plus
3940 Int_t imx = Int_t(1.33*markerSizeReduced + 0.5);
3941 shape.resize(17);
3942 shape[0].x =-imx; shape[0].y =-imx*1.005;
3943 shape[1].x =-imx; shape[1].y = -im;
3944 shape[2].x = imx; shape[2].y = -im;
3945 shape[3].x = imx; shape[3].y =-imx;
3946 shape[4].x = im; shape[4].y =-imx;
3947 shape[5].x = im; shape[5].y = imx;
3948 shape[6].x = imx; shape[6].y = imx;
3949 shape[7].x = imx; shape[7].y = im;
3950 shape[8].x =-imx; shape[8].y = im;
3951 shape[9].x =-imx; shape[9].y = imx;
3952 shape[10].x = -im; shape[10].y = imx;
3953 shape[11].x = -im; shape[11].y =-imx;
3954 shape[12].x =-imx; shape[12].y =-imx*0.995;
3955 shape[13].x =-imx; shape[13].y = imx;
3956 shape[14].x = imx; shape[14].y = imx;
3957 shape[15].x = imx; shape[15].y =-imx;
3958 shape[16].x =-imx; shape[16].y =-imx*1.005;
3959 ctxt->markerType = 3;
3960 } else {
3961 // single dot
3962 shape.resize(0);
3963 ctxt->markerType = 0;
3964 ctxt->markerSize = 0;
3965 }
3966}
3967
3968////////////////////////////////////////////////////////////////////////////////
3969/// Set text attributes for speicfied window
3970
3972{
3973 auto ctxt = (XWindow_t *) wctxt;
3974 if (!ctxt)
3975 return;
3976
3977 Int_t txalh = att.GetTextAlign() / 10;
3978 Int_t txalv = att.GetTextAlign() % 10;
3979
3980 ctxt->textAlign = kAlignNone;
3981
3982 switch (txalh) {
3983 case 0 :
3984 case 1 :
3985 switch (txalv) { //left
3986 case 1 :
3987 ctxt->textAlign = kBLeft; //bottom
3988 break;
3989 case 2 :
3990 ctxt->textAlign = kMLeft; //middle
3991 break;
3992 case 3 :
3993 ctxt->textAlign = kTLeft; //top
3994 break;
3995 }
3996 break;
3997 case 2 :
3998 switch (txalv) { //center
3999 case 1 :
4000 ctxt->textAlign = kBCenter; //bottom
4001 break;
4002 case 2 :
4003 ctxt->textAlign = kMCenter; //middle
4004 break;
4005 case 3 :
4006 ctxt->textAlign = kTCenter; //top
4007 break;
4008 }
4009 break;
4010 case 3 :
4011 switch (txalv) { //right
4012 case 1 :
4013 ctxt->textAlign = kBRight; //bottom
4014 break;
4015 case 2 :
4016 ctxt->textAlign = kMRight; //center
4017 break;
4018 case 3 :
4019 ctxt->textAlign = kTRight; //top
4020 break;
4021 }
4022 break;
4023 }
4024
4025 SetColor(ctxt, ctxt->fGClist[kGCtext], att.GetTextColor());
4026
4027 GdkGCValues values;
4028 gdk_gc_get_values(ctxt->fGClist[kGCtext], &values);
4029 gdk_gc_set_foreground(ctxt->fGClist[kGCinvt], &values.background);
4030 gdk_gc_set_background(ctxt->fGClist[kGCinvt], &values.foreground);
4031 gdk_gc_set_background(ctxt->fGClist[kGCtext], (GdkColor *) & GetColor(0).color);
4032
4033 TTF::SetTextFont(att.GetTextFont());
4034 TTF::SetTextSize(att.GetTextSize());
4035
4036 ctxt->fAttText = att;
4037}
4038
4039
4040////////////////////////////////////////////////////////////////////////////////
4041/// Set opacity of a current window. This image manipulation routine works
4042/// by adding to a percent amount of neutral to each pixels RGB.
4043/// Since it requires quite some additional color map entries is it
4044/// only supported on displays with more than > 8 color planes (> 256
4045/// colors)
4046
4051
4052////////////////////////////////////////////////////////////////////////////////
4053/// Set color intensities for given color index.
4054/// cindex : color index
4055/// r,g,b : red, green, blue intensities between 0.0 and 1.0
4056
4057void TGWin32::SetRGB(int cindex, float r, float g, float b)
4058{
4059 GdkColor xcol;
4060
4061 if (fColormap && cindex >= 0) {
4062 xcol.red = (unsigned short) (r * kBIGGEST_RGB_VALUE);
4063 xcol.green = (unsigned short) (g * kBIGGEST_RGB_VALUE);
4064 xcol.blue = (unsigned short) (b * kBIGGEST_RGB_VALUE);
4065 xcol.pixel = RGB(xcol.red, xcol.green, xcol.blue);
4066
4067 XColor_t &col = GetColor(cindex);
4068 if (col.fDefined) {
4069 // if color is already defined with same rgb just return
4070 if (col.color.red == xcol.red && col.color.green == xcol.green &&
4071 col.color.blue == xcol.blue)
4072 return;
4073 col.fDefined = kFALSE;
4075 (GdkColor *)&col, 1);
4076 }
4077
4079 if (ret != 0) {
4080 col.fDefined = kTRUE;
4081 col.color.pixel = xcol.pixel;
4082 col.color.red = xcol.red;
4083 col.color.green = xcol.green;
4084 col.color.blue = xcol.blue;
4085 }
4086 }
4087}
4088
4089////////////////////////////////////////////////////////////////////////////////
4090/// Set text alignment.
4091/// txalh : horizontal text alignment
4092/// txalv : vertical text alignment
4093
4095{
4097
4098 TAttText arg(gCws->fAttText);
4099 arg.SetTextAlign(talign);
4100
4102}
4103
4104////////////////////////////////////////////////////////////////////////////////
4105/// Set color index for text.
4106
4108{
4109 if (cindex < 0) return;
4110
4112
4113 TAttText arg(gCws->fAttText);
4114 arg.SetTextColor(cindex);
4115
4117}
4118
4119////////////////////////////////////////////////////////////////////////////////
4120
4121void TGWin32::Sync(int /* mode */)
4122{
4123}
4124
4125////////////////////////////////////////////////////////////////////////////////
4126/// Update display.
4127/// mode : (1) update
4128/// (0) sync
4129///
4130/// Synchronise client and server once (not permanent).
4131/// Copy the pixmap gCws->drawing on the window gCws->window
4132/// if the double buffer is on.
4133
4138
4139////////////////////////////////////////////////////////////////////////////////
4140/// Update current window
4141/// mode : (1) update
4142/// (0) sync
4143///
4144/// Synchronise client and server once (not permanent).
4145/// Copy the pixmap ctxt->drawing on the window ctxt->window
4146/// if the double buffer is on.
4147
4149{
4150 auto ctxt = (XWindow_t *) wctxt;
4151
4152 if (ctxt && ctxt->double_buffer) {
4153 gdk_window_copy_area(ctxt->window, ctxt->fGClist[kGCpxmp], 0, 0,
4154 ctxt->drawing, 0, 0, ctxt->width, ctxt->height);
4155 }
4156 Update(mode);
4157}
4158
4159////////////////////////////////////////////////////////////////////////////////
4160/// Set opacity of a specified window. This image manipulation routine works
4161/// by adding to a percent amount of neutral to each pixels RGB.
4162/// Since it requires quite some additional color map entries is it
4163/// only supported on displays with more than > 8 color planes (> 256
4164/// colors)
4165
4167{
4169
4170 if ((depth <= 8) || (percent <= 0)) return;
4171 if (percent > 100) percent = 100;
4172
4173 auto ctxt = (XWindow_t *) wctxt;
4174
4175 // get pixmap from server as image
4176 GdkImage *image = gdk_image_get((GdkDrawable*)ctxt->drawing, 0, 0,
4177 ctxt->width, ctxt->height);
4178
4179 if (!image) return;
4180
4181 std::vector<ULong_t> orgcolors;
4182
4183 // collect different image colors
4184 for (UInt_t y = 0; y < ctxt->height; y++) {
4185 for (UInt_t x = 0; x < ctxt->width; x++) {
4187 if (std::find(orgcolors.begin(), orgcolors.end(), pixel) == orgcolors.end())
4188 orgcolors.emplace_back(pixel);
4189 }
4190 }
4191 if (orgcolors.empty()) {
4193 return;
4194 }
4195
4196 if (!ctxt->new_colors.empty()) {
4197 gdk_colors_free((GdkColormap *)fColormap, ctxt->new_colors.data(), ctxt->new_colors.size(), 0);
4198 ctxt->new_colors.clear();
4199 }
4200
4201 std::vector<GdkColor> xcol(orgcolors.size());
4202
4203 for (std::size_t i = 0; i < orgcolors.size(); i++) {
4204 xcol[i].pixel = orgcolors[i];
4205 xcol[i].red = xcol[i].green = xcol[i].blue = 0;
4206 }
4207
4211
4212 // create new colors mixing: "100-percent" of old color and "percent" of new background color
4213 XColor_t &bkgr = GetColor(ctxt->fAttFill.GetFillColor());
4214
4215 for (std::size_t i = 0; i < orgcolors.size(); i++) {
4216 xcol[i].red = (UShort_t) TMath::Min((Int_t) xcol[i].red * (100 - percent) / 100 + bkgr.color.red * percent / 100, kBIGGEST_RGB_VALUE);
4217 xcol[i].green = (UShort_t) TMath::Min((Int_t) xcol[i].green * (100 - percent) / 100 + bkgr.color.green * percent / 100, kBIGGEST_RGB_VALUE);
4218 xcol[i].blue = (UShort_t) TMath::Min((Int_t) xcol[i].blue * (100 - percent) / 100 + bkgr.color.blue * percent / 100, kBIGGEST_RGB_VALUE);
4219
4221
4222 if (!ret) {
4223 Warning("SetOpacityW",
4224 "failed to allocate color %hd, %hd, %hd", xcol[i].red,
4225 xcol[i].green, xcol[i].blue);
4226 // assumes that in case of failure xcol[i].pixel is not changed
4227 }
4228 }
4229
4230 ctxt->new_colors.resize(orgcolors.size());
4231
4232 for (std::size_t i = 0; i < orgcolors.size(); i++)
4233 ctxt->new_colors[i] = xcol[i].pixel;
4234
4235 // put opaque colors in image
4236 for (UInt_t y = 0; y < ctxt->height; y++) {
4237 for (UInt_t x = 0; x < ctxt->width; x++) {
4239 auto iter = std::find(orgcolors.begin(), orgcolors.end(), pixel);
4240 if (iter != orgcolors.end()) {
4241 auto idx = iter - orgcolors.begin();
4242 PutPixel((Drawable_t)image, x, y, ctxt->new_colors[idx]);
4243 }
4244 }
4245 }
4246
4247 // put image back in pixmap on server
4248 gdk_draw_image(ctxt->drawing, ctxt->fGClist[kGCpxmp], (GdkImage *)image,
4249 0, 0, 0, 0, ctxt->width, ctxt->height);
4250 GdiFlush();
4251
4252 // clean up
4254}
4255
4256////////////////////////////////////////////////////////////////////////////////
4257/// Copy the pixmap wid at the position xpos, ypos in the specified window.
4258
4260{
4261 if (fWindows.count(wid) == 0)
4262 return;
4263
4264 auto ctxt = (XWindow_t *) wctxt;
4265
4266 gTws = fWindows[wid].get();
4267 gdk_window_copy_area(ctxt->drawing, gTws->fGClist[kGCpxmp], xpos, ypos, gTws->drawing,
4268 0, 0, gTws->width, gTws->height);
4269 GdiFlush();
4270}
4271
4272
4273////////////////////////////////////////////////////////////////////////////////
4274/// Set pointer position.
4275/// ix : New X coordinate of pointer
4276/// iy : New Y coordinate of pointer
4277/// Coordinates are relative to the origin of the window id
4278/// or to the origin of the current window if id == 0.
4279
4280void TGWin32::Warp(int ix, int iy, Window_t id)
4281{
4282 if (!id) return;
4283
4284 POINT cpt, tmp;
4285 HWND dw;
4286 if (!id)
4287 dw = (HWND) GDK_DRAWABLE_XID((GdkWindow *)gCws->window);
4288 else
4290 GetCursorPos(&cpt);
4291 tmp.x = ix > 0 ? ix : cpt.x;
4292 tmp.y = iy > 0 ? iy : cpt.y;
4294 SetCursorPos(tmp.x, tmp.y);
4295}
4296
4297////////////////////////////////////////////////////////////////////////////////
4298/// Write the pixmap wid in the bitmap file pxname.
4299/// wid : Pixmap address
4300/// w,h : Width and height of the pixmap.
4301/// lenname : pixmap name length
4302/// pxname : pixmap name
4303
4304void TGWin32::WritePixmap(int wid, unsigned int w, unsigned int h,
4305 char *pxname)
4306{
4307 int wval, hval;
4308 wval = w;
4309 hval = h;
4310
4311 if (fWindows.count(wid) == 0) return;
4312 gTws = fWindows[wid].get();
4313// XWriteBitmapFile(fDisplay,pxname,(Pixmap)gTws->drawing,wval,hval,-1,-1);
4314}
4315
4316
4317//
4318// Functions for GIFencode()
4319//
4320
4321static FILE *gGifFile; // output unit used WriteGIF and PutByte
4322static GdkImage *gGifImage = 0; // image used in WriteGIF and GetPixel
4323
4324extern "C" {
4327 Byte_t * outputCmap);
4328 long GIFencode(int Width, int Height, Int_t Ncol, Byte_t R[],
4329 Byte_t G[], Byte_t B[], Byte_t ScLine[],
4330 void (*get_scline) (int, int, Byte_t *),
4331 void (*pb) (Byte_t));
4332 int GIFdecode(Byte_t * GIFarr, Byte_t * PIXarr, int *Width, int *Height,
4333 int *Ncols, Byte_t * R, Byte_t * G, Byte_t * B);
4334 int GIFinfo(Byte_t * GIFarr, int *Width, int *Height, int *Ncols);
4335}
4336
4337
4338////////////////////////////////////////////////////////////////////////////////
4339/// Get pixels in line y and put in array scline.
4340
4341static void GetPixel(int y, int width, Byte_t * scline)
4342{
4343 for (int i = 0; i < width; i++) {
4345 }
4346}
4347
4348////////////////////////////////////////////////////////////////////////////////
4349/// Put byte b in output stream.
4350
4351static void PutByte(Byte_t b)
4352{
4353 if (ferror(gGifFile) == 0) fputc(b, gGifFile);
4354}
4355
4356////////////////////////////////////////////////////////////////////////////////
4357/// Returns in R G B the ncol colors of the palette used by the image.
4358/// The image pixels are changed to index values in these R G B arrays.
4359/// This produces a colormap with only the used colors (so even on displays
4360/// with more than 8 planes we will be able to create GIF's when the image
4361/// contains no more than 256 different colors). If it does contain more
4362/// colors we will have to use GIFquantize to reduce the number of colors.
4363/// The R G B arrays must be deleted by the caller.
4364
4366 Int_t * &G, Int_t * &B)
4367{
4368 std::vector<ULong_t> orgcolors;
4369
4370 // collect different image colors
4371 for (UInt_t x = 0; x < (int) gCws->width; x++) {
4372 for (UInt_t y = 0; y < (int) gCws->height; y++) {
4374 if (std::find(orgcolors.begin(), orgcolors.end(), pixel) == orgcolors.end())
4375 orgcolors.emplace_back(pixel);
4376 }
4377 }
4378
4379 // get RGB values belonging to pixels
4380 std::vector<GdkColor> xcol(orgcolors.size());
4381
4382 for (std::size_t i = 0; i < orgcolors.size(); i++) {
4383 xcol[i].pixel = orgcolors[i];
4384 xcol[i].red = GetRValue(xcol[i].pixel);
4385 xcol[i].green = GetGValue(xcol[i].pixel);
4386 xcol[i].blue = GetBValue(xcol[i].pixel);
4387 }
4388
4392
4393 // create RGB arrays and store RGB's for each color and set number of colors
4394 // (space must be delete by caller)
4395 R = new Int_t[orgcolors.size()];
4396 G = new Int_t[orgcolors.size()];
4397 B = new Int_t[orgcolors.size()];
4398
4399 for (std::size_t i = 0; i < orgcolors.size(); i++) {
4400 R[i] = xcol[i].red;
4401 G[i] = xcol[i].green;
4402 B[i] = xcol[i].blue;
4403 }
4404 ncol = (Int_t) orgcolors.size();
4405
4406 // update image with indices (pixels) into the new RGB colormap
4407 for (UInt_t x = 0; x < gCws->width; x++) {
4408 for (UInt_t y = 0; y < gCws->height; y++) {
4410 auto iter = std::find(orgcolors.begin(), orgcolors.end(), pixel);
4411 if (iter != orgcolors.end()) {
4412 auto idx = iter - orgcolors.begin();
4413 PutPixel((Drawable_t)image, x, y, idx);
4414 }
4415 }
4416 }
4417}
4418
4419////////////////////////////////////////////////////////////////////////////////
4420/// Writes the current window into GIF file.
4421
4423{
4424 Byte_t scline[2000], r[256], b[256], g[256];
4425 Int_t *R, *G, *B;
4426 Int_t ncol, maxcol, i;
4427
4428 if (gGifImage) {
4430 }
4431
4432 gGifImage = gdk_image_get((GdkDrawable*)gCws->drawing, 0, 0,
4433 gCws->width, gCws->height);
4434
4436
4437 if (ncol > 256) {
4438 //GIFquantize(...);
4439 Error("WriteGIF",
4440 "can not create GIF of image containing more than 256 colors");
4441 delete[]R;
4442 delete[]G;
4443 delete[]B;
4444 return 0;
4445 }
4446
4447 maxcol = 0;
4448 for (i = 0; i < ncol; i++) {
4449 if (maxcol < R[i]) maxcol = R[i];
4450 if (maxcol < G[i]) maxcol = G[i];
4451 if (maxcol < B[i]) maxcol = B[i];
4452 r[i] = 0;
4453 g[i] = 0;
4454 b[i] = 0;
4455 }
4456 if (maxcol != 0) {
4457 for (i = 0; i < ncol; i++) {
4458 r[i] = R[i] * 255 / maxcol;
4459 g[i] = G[i] * 255 / maxcol;
4460 b[i] = B[i] * 255 / maxcol;
4461 }
4462 }
4463
4464 gGifFile = fopen(name, "wb");
4465
4466 if (gGifFile) {
4467 GIFencode(gCws->width, gCws->height,
4468 ncol, r, g, b, scline, ::GetPixel, PutByte);
4470 i = 1;
4471 } else {
4472 Error("WriteGIF","cannot write file: %s",name);
4473 i = 0;
4474 }
4475 delete[]R;
4476 delete[]G;
4477 delete[]B;
4478
4479 return i;
4480}
4481
4482////////////////////////////////////////////////////////////////////////////////
4483/// Draw image.
4484
4488{
4489 const int MAX_SEGMENT = 20;
4490 int i, n, x, y, xcur, x1, x2, y1, y2;
4491 unsigned char *jimg, *jbase, icol;
4492 int nlines[256];
4494 GdkDrawable *id;
4495 GdkGC *lineGC;
4496
4497 if (wid) {
4498 id = (GdkDrawable*) wid;
4500 } else {
4501 id = gCws->drawing;
4502 lineGC = gCws->fGClist[kGCline];
4503 }
4504
4505 for (i = 0; i < 256; i++) nlines[i] = 0;
4506
4507 x1 = x0 + xmin;
4508 y1 = y0 + ny - ymax - 1;
4509 x2 = x0 + xmax;
4510 y2 = y0 + ny - ymin - 1;
4511 jbase = image + (ymin - 1) * nx + xmin;
4512
4513 for (y = y2; y >= y1; y--) {
4514 xcur = x1;
4515 jbase += nx;
4516 for (jimg = jbase, icol = *jimg++, x = x1 + 1; x <= x2; jimg++, x++) {
4517 if (icol != *jimg) {
4518 if (icol != itran) {
4519 n = nlines[icol]++;
4520 lines[icol][n].x1 = xcur;
4521 lines[icol][n].y1 = y;
4522 lines[icol][n].x2 = x - 1;
4523 lines[icol][n].y2 = y;
4524 if (nlines[icol] == MAX_SEGMENT) {
4525 SetColor(wid ? nullptr : gCws, lineGC, (int) icol + offset);
4527 (GdkSegment *) &lines[icol][0], MAX_SEGMENT);
4528 nlines[icol] = 0;
4529 }
4530 }
4531 icol = *jimg;
4532 xcur = x;
4533 }
4534 }
4535 if (icol != itran) {
4536 n = nlines[icol]++;
4537 lines[icol][n].x1 = xcur;
4538 lines[icol][n].y1 = y;
4539 lines[icol][n].x2 = x - 1;
4540 lines[icol][n].y2 = y;
4541 if (nlines[icol] == MAX_SEGMENT) {
4542 SetColor(wid ? nullptr : gCws, lineGC, (int) icol + offset);
4544 (GdkSegment *)&lines[icol][0], MAX_SEGMENT);
4545 nlines[icol] = 0;
4546 }
4547 }
4548 }
4549
4550 for (i = 0; i < 256; i++) {
4551 if (nlines[i] != 0) {
4552 SetColor(wid ? nullptr : gCws, lineGC, i + offset);
4554 (GdkSegment *)&lines[icol][0], nlines[i]);
4555 }
4556 }
4557
4558 if (wid)
4560
4561}
4562
4563////////////////////////////////////////////////////////////////////////////////
4564/// If id is NULL - loads the specified gif file at position [x0,y0] in the
4565/// current window. Otherwise creates pixmap from gif file
4566
4567Pixmap_t TGWin32::ReadGIF(int x0, int y0, const char *file, Window_t id)
4568{
4569 FILE *fd;
4571 unsigned char *GIFarr, *PIXarr, R[256], G[256], B[256], *j1, *j2, icol;
4572 int i, j, k, width, height, ncolor, irep, offset;
4573 float rr, gg, bb;
4574 Pixmap_t pic = 0;
4575
4576 fd = fopen(file, "r+b");
4577 if (!fd) {
4578 Error("ReadGIF", "unable to open GIF file");
4579 return pic;
4580 }
4581
4582 fseek(fd, 0L, 2);
4583 filesize = Seek_t(ftell(fd));
4584 fseek(fd, 0L, 0);
4585
4586 if (!(GIFarr = (unsigned char *) calloc(filesize + 256, 1))) {
4587 fclose(fd);
4588 Error("ReadGIF", "unable to allocate array for gif");
4589 return pic;
4590 }
4591
4592 if (fread(GIFarr, filesize, 1, fd) != 1) {
4593 fclose(fd);
4594 Error("ReadGIF", "GIF file read failed");
4595 free(GIFarr);
4596 return pic;
4597 }
4598 fclose(fd);
4599
4601 if (irep != 0) {
4602 return pic;
4603 }
4604
4605 if (!(PIXarr = (unsigned char *) calloc((width * height), 1))) {
4606 Error("ReadGIF", "unable to allocate array for image");
4607 return pic;
4608 }
4609
4610 irep = GIFdecode(GIFarr, PIXarr, &width, &height, &ncolor, R, G, B);
4611 if (irep != 0) {
4612 return pic;
4613 }
4614 // S E T P A L E T T E
4615
4616 offset = 8;
4617
4618 for (i = 0; i < ncolor; i++) {
4619 rr = R[i] / 255.;
4620 gg = G[i] / 255.;
4621 bb = B[i] / 255.;
4622 j = i + offset;
4623 SetRGB(j, rr, gg, bb);
4624 }
4625
4626 // O U T P U T I M A G E
4627
4628 for (i = 1; i <= height / 2; i++) {
4629 j1 = PIXarr + (i - 1) * width;
4630 j2 = PIXarr + (height - i) * width;
4631 for (k = 0; k < width; k++) {
4632 icol = *j1;
4633 *j1++ = *j2;
4634 *j2++ = icol;
4635 }
4636 }
4637
4638 if (id) pic = CreatePixmap(id, width, height);
4639 PutImage(offset, -1, x0, y0, width, height, 0, 0, width-1, height-1, PIXarr, pic);
4640
4641 if (pic) return pic;
4642 else if (gCws->drawing) return (Pixmap_t)gCws->drawing;
4643 else return 0;
4644}
4645
4646//////////////////////////// GWin32Gui //////////////////////////////////////////
4647////////////////////////////////////////////////////////////////////////////////
4648/// Map window on screen.
4649
4651{
4652 if (!id) return;
4653
4656 (GetParent(id) == GetDefaultRootWindow())) {
4657 HWND window = (HWND)GDK_DRAWABLE_XID((GdkWindow *)id);
4658 ::SetForegroundWindow(window);
4659 }
4660}
4661
4662////////////////////////////////////////////////////////////////////////////////
4663///
4664
4666{
4667 if (!id) return;
4668
4671}
4672
4673////////////////////////////////////////////////////////////////////////////////
4674/// Map window on screen and put on top of all windows.
4675
4677{
4678 if (!id) return;
4679
4681 HWND window = (HWND)GDK_DRAWABLE_XID((GdkWindow *)id);
4684 ::BringWindowToTop(window);
4686 ::SetForegroundWindow(window);
4687 }
4688
4689 if (gConsoleWindow && (hwnd == (HWND)gConsoleWindow)) {
4690 RECT r1, r2, r3;
4694 if (!::IntersectRect(&r3, &r2, &r1)) {
4696 }
4697 }
4698}
4699
4700////////////////////////////////////////////////////////////////////////////////
4701/// Unmap window from screen.
4702
4704{
4705 if (!id) return;
4706
4707 gdk_window_hide((GdkWindow *) id);
4708}
4709
4710////////////////////////////////////////////////////////////////////////////////
4711/// Destroy window.
4712
4714{
4715 if (!id) return;
4716
4717 // we need to unmap the window before to destroy it, in order to properly
4718 // receive kUnmapNotify needed by gClient->WaitForUnmap()...
4719 gdk_window_hide((GdkWindow *) id);
4721}
4722
4723////////////////////////////////////////////////////////////////////////////////
4724/// Destroy all internal subwindows
4725
4727{
4728 if (!id) return;
4729
4731}
4732
4733////////////////////////////////////////////////////////////////////////////////
4734/// Put window on top of window stack.
4735
4737{
4738 if (!id) return;
4739
4740 HWND window = (HWND)GDK_DRAWABLE_XID((GdkWindow *)id);
4742 ::SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0,
4744 }
4745 else {
4746 ::BringWindowToTop(window);
4748 ::SetForegroundWindow(window);
4749 }
4750}
4751
4752////////////////////////////////////////////////////////////////////////////////
4753/// Lower window so it lays below all its siblings.
4754
4756{
4757 if (!id) return;
4758
4759 HWND window = (HWND)GDK_DRAWABLE_XID((GdkWindow *)id);
4760 ::SetWindowPos(window, HWND_BOTTOM, 0, 0, 0, 0,
4762}
4763
4764////////////////////////////////////////////////////////////////////////////////
4765/// Move a window.
4766
4768{
4769 if (!id) return;
4770
4771 // prevent hiding the titlebar
4772 if (x == 0 && y == 0) {
4773 x = 1; y = 1;
4774 }
4775 gdk_window_move((GdkDrawable *) id, x, y);
4776}
4777
4778////////////////////////////////////////////////////////////////////////////////
4779/// Move and resize a window.
4780
4782 UInt_t h)
4783{
4784 if (!id) return;
4785
4786 // prevent hiding the titlebar
4787 if (x == 0 && y == 0) {
4788 x = 1; y = 1;
4789 }
4790 gdk_window_move_resize((GdkWindow *) id, x, y, w, h);
4791}
4792
4793////////////////////////////////////////////////////////////////////////////////
4794/// Resize the window.
4795
4797{
4798 if (!id) return;
4799
4800 // protect against potential negative values
4801 if (w >= (UInt_t)INT_MAX || h >= (UInt_t)INT_MAX)
4802 return;
4803 gdk_window_resize((GdkWindow *) id, w, h);
4804}
4805
4806////////////////////////////////////////////////////////////////////////////////
4807/// Iconify the window.
4808
4810{
4811 if (!id) return;
4812
4815}
4816
4817////////////////////////////////////////////////////////////////////////////////
4818/// Reparent window, make pid the new parent and position the window at
4819/// position (x,y) in new parent.
4820
4822{
4823 if (!id) return;
4824
4825 gdk_window_reparent((GdkWindow *)id, (GdkWindow *)pid, x, y);
4826}
4827
4828////////////////////////////////////////////////////////////////////////////////
4829/// Set the window background color.
4830
4832{
4833 if (!id) return;
4834
4835 GdkColor back;
4836 back.pixel = color;
4837 back.red = GetRValue(color);
4838 back.green = GetGValue(color);
4839 back.blue = GetBValue(color);
4840
4841 gdk_window_set_background((GdkWindow *) id, &back);
4842}
4843
4844////////////////////////////////////////////////////////////////////////////////
4845/// Set pixmap as window background.
4846
4848{
4849 if (!id) return;
4850
4852}
4853
4854////////////////////////////////////////////////////////////////////////////////
4855/// Return handle to newly created gdk window.
4856
4858 UInt_t w, UInt_t h, UInt_t border,
4861 UInt_t wtype)
4862{
4865 GdkColor background_color;
4866 ULong_t xmask = 0;
4867
4868 if (attr) {
4870 xattr.window_type = GDK_WINDOW_CHILD;
4871 if (wtype & kMainFrame) {
4872 xattr.window_type = GDK_WINDOW_TOPLEVEL;
4873 }
4874 if (wtype & kTransientFrame) {
4875 xattr.window_type = GDK_WINDOW_DIALOG;
4876 }
4877 if (wtype & kTempFrame) {
4878 xattr.window_type = GDK_WINDOW_TEMP;
4879 }
4880 newWin = gdk_window_new((GdkWindow *) parent, &xattr, xmask);
4881 } else {
4882 xattr.width = w;
4883 xattr.height = h;
4884 xattr.wclass = GDK_INPUT_OUTPUT;
4885 xattr.event_mask = 0L; //GDK_ALL_EVENTS_MASK;
4888// GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK;
4889 if (x >= 0) {
4890 xattr.x = x;
4891 } else {
4892 xattr.x = -1.0 * x;
4893 }
4894 if (y >= 0) {
4895 xattr.y = y;
4896 } else {
4897 xattr.y = -1.0 * y;
4898 }
4899 xattr.colormap = gdk_colormap_get_system();
4900 xattr.cursor = NULL;
4901 xattr.override_redirect = TRUE;
4902 if ((xattr.y > 0) && (xattr.x > 0)) {
4905 } else {
4907 }
4908 if (visual != NULL) {
4909 xattr.visual = (GdkVisual *) visual;
4911 } else {
4912 xattr.visual = gdk_visual_get_system();
4914 }
4915 xattr.window_type = GDK_WINDOW_CHILD;
4916 if (wtype & kMainFrame) {
4917 xattr.window_type = GDK_WINDOW_TOPLEVEL;
4918 }
4919 if (wtype & kTransientFrame) {
4920 xattr.window_type = GDK_WINDOW_DIALOG;
4921 }
4922 if (wtype & kTempFrame) {
4923 xattr.window_type = GDK_WINDOW_TEMP;
4924 }
4925 newWin = gdk_window_new((GdkWindow *) parent, &xattr, xmask);
4927 }
4928 if (border > 0) {
4931 }
4932 if (attr) {
4933 if ((attr->fMask & kWABackPixmap)) {
4934 if (attr->fBackgroundPixmap == kNone) {
4936 } else if (attr->fBackgroundPixmap == kParentRelative) {
4938 } else {
4940 (GdkPixmap *) attr->
4941 fBackgroundPixmap, 0);
4942 }
4943 }
4944 if ((attr->fMask & kWABackPixel)) {
4945 background_color.pixel = attr->fBackgroundPixel;
4946 background_color.red = GetRValue(attr->fBackgroundPixel);
4947 background_color.green = GetGValue(attr->fBackgroundPixel);
4948 background_color.blue = GetBValue(attr->fBackgroundPixel);
4950 }
4951 }
4952 if (!fUseSysPointers) {
4955 }
4956 return (Window_t) newWin;
4957}
4958
4959////////////////////////////////////////////////////////////////////////////////
4960/// Map event mask to or from gdk.
4961
4963{
4964 if (tox) {
4965 Long_t lxemask = 0L;
4966 if ((emask & kKeyPressMask)) {
4968 }
4969 if ((emask & kKeyReleaseMask)) {
4971 }
4972 if ((emask & kButtonPressMask)) {
4974 }
4975 if ((emask & kButtonReleaseMask)) {
4977 }
4978 if ((emask & kPointerMotionMask)) {
4980 }
4981 if ((emask & kButtonMotionMask)) {
4983 }
4984 if ((emask & kExposureMask)) {
4986 }
4987 if ((emask & kStructureNotifyMask)) {
4989 }
4990 if ((emask & kEnterWindowMask)) {
4992 }
4993 if ((emask & kLeaveWindowMask)) {
4995 }
4996 if ((emask & kFocusChangeMask)) {
4998 }
4999 xemask = (UInt_t) lxemask;
5000 } else {
5001 emask = 0;
5002 if ((xemask & GDK_KEY_PRESS_MASK)) {
5004 }
5005 if ((xemask & GDK_KEY_RELEASE_MASK)) {
5007 }
5008 if ((xemask & GDK_BUTTON_PRESS_MASK)) {
5010 }
5013 }
5016 }
5019 }
5020 if ((xemask & GDK_EXPOSURE_MASK)) {
5022 }
5023 if ((xemask & GDK_STRUCTURE_MASK)) {
5025 }
5026 if ((xemask & GDK_ENTER_NOTIFY_MASK)) {
5028 }
5029 if ((xemask & GDK_LEAVE_NOTIFY_MASK)) {
5031 }
5032 if ((xemask & GDK_FOCUS_CHANGE_MASK)) {
5034 }
5035 }
5036}
5037
5038////////////////////////////////////////////////////////////////////////////////
5039/// Map a SetWindowAttributes_t to a GdkWindowAttr structure.
5040
5042 ULong_t & xmask,
5044{
5045 Mask_t mask = attr->fMask;
5046 xmask = 0;
5047
5048 if ((mask & kWAOverrideRedirect)) {
5050 xattr.override_redirect = attr->fOverrideRedirect;
5051 }
5052 if ((mask & kWAEventMask)) {
5053 UInt_t xmsk, msk = (UInt_t) attr->fEventMask;
5055 xattr.event_mask = xmsk;
5056 }
5057 if ((mask & kWAColormap)) {
5059 xattr.colormap = (GdkColormap *) attr->fColormap;
5060 }
5061 if ((mask & kWACursor)) {
5063 if (attr->fCursor != kNone) {
5064 xattr.cursor = (GdkCursor *) attr->fCursor;
5065 }
5066 }
5067 xattr.wclass = GDK_INPUT_OUTPUT;
5068}
5069
5070////////////////////////////////////////////////////////////////////////////////
5071/// Map a GCValues_t to a XCGValues structure if tox is true. Map
5072/// the other way in case tox is false.
5073
5076{
5077 if (tox) {
5078 // map GCValues_t to XGCValues
5079 Mask_t mask = gval.fMask;
5080 xmask = 0;
5081
5082 if ((mask & kGCFunction)) {
5084 switch (gval.fFunction) {
5085 case kGXclear:
5086 xgval.function = GDK_CLEAR;
5087 break;
5088 case kGXand:
5089 xgval.function = GDK_AND;
5090 break;
5091 case kGXandReverse:
5092 xgval.function = GDK_AND_REVERSE;
5093 break;
5094 case kGXcopy:
5095 xgval.function = GDK_COPY;
5096 break;
5097 case kGXandInverted:
5098 xgval.function = GDK_AND_INVERT;
5099 break;
5100 case kGXnoop:
5101 xgval.function = GDK_NOOP;
5102 break;
5103 case kGXxor:
5104 xgval.function = GDK_XOR;
5105 break;
5106 case kGXor:
5107 xgval.function = GDK_OR;
5108 break;
5109 case kGXequiv:
5110 xgval.function = GDK_EQUIV;
5111 break;
5112 case kGXinvert:
5113 xgval.function = GDK_INVERT;
5114 break;
5115 case kGXorReverse:
5116 xgval.function = GDK_OR_REVERSE;
5117 break;
5118 case kGXcopyInverted:
5119 xgval.function = GDK_COPY_INVERT;
5120 break;
5121 case kGXorInverted:
5122 xgval.function = GDK_OR_INVERT;
5123 break;
5124 case kGXnand:
5125 xgval.function = GDK_NAND;
5126 break;
5127 case kGXset:
5128 xgval.function = GDK_SET;
5129 break;
5130 }
5131 }
5132 if (mask & kGCSubwindowMode) {
5134 if (gval.fSubwindowMode == kIncludeInferiors) {
5135 xgval.subwindow_mode = GDK_INCLUDE_INFERIORS;
5136 } else {
5137 xgval.subwindow_mode = GDK_CLIP_BY_CHILDREN;
5138 }
5139 }
5140 if (mask & kGCForeground) {
5142 xgval.foreground.pixel = gval.fForeground;
5143 xgval.foreground.red = GetRValue(gval.fForeground);
5144 xgval.foreground.green = GetGValue(gval.fForeground);
5145 xgval.foreground.blue = GetBValue(gval.fForeground);
5146 }
5147 if (mask & kGCBackground) {
5149 xgval.background.pixel = gval.fBackground;
5150 xgval.background.red = GetRValue(gval.fBackground);
5151 xgval.background.green = GetGValue(gval.fBackground);
5152 xgval.background.blue = GetBValue(gval.fBackground);
5153 }
5154 if (mask & kGCLineWidth) {
5156 xgval.line_width = gval.fLineWidth;
5157 }
5158 if (mask & kGCLineStyle) {
5160 xgval.line_style = (GdkLineStyle) gval.fLineStyle; // ident mapping
5161 }
5162 if (mask & kGCCapStyle) {
5164 xgval.cap_style = (GdkCapStyle) gval.fCapStyle; // ident mapping
5165 }
5166 if (mask & kGCJoinStyle) {
5168 xgval.join_style = (GdkJoinStyle) gval.fJoinStyle; // ident mapping
5169 }
5170 if ((mask & kGCFillStyle)) {
5171 xmask |= GDK_GC_FILL;
5172 xgval.fill = (GdkFill) gval.fFillStyle; // ident mapping
5173 }
5174 if ((mask & kGCTile)) {
5175 xmask |= GDK_GC_TILE;
5176 xgval.tile = (GdkPixmap *) gval.fTile;
5177 }
5178 if ((mask & kGCStipple)) {
5180 xgval.stipple = (GdkPixmap *) gval.fStipple;
5181 }
5182 if ((mask & kGCTileStipXOrigin)) {
5184 xgval.ts_x_origin = gval.fTsXOrigin;
5185 }
5186 if ((mask & kGCTileStipYOrigin)) {
5188 xgval.ts_y_origin = gval.fTsYOrigin;
5189 }
5190 if ((mask & kGCFont)) {
5191 xmask |= GDK_GC_FONT;
5192 xgval.font = (GdkFont *) gval.fFont;
5193 }
5194 if ((mask & kGCGraphicsExposures)) {
5196 xgval.graphics_exposures = gval.fGraphicsExposures;
5197 }
5198 if ((mask & kGCClipXOrigin)) {
5200 xgval.clip_x_origin = gval.fClipXOrigin;
5201 }
5202 if ((mask & kGCClipYOrigin)) {
5204 xgval.clip_y_origin = gval.fClipYOrigin;
5205 }
5206 if ((mask & kGCClipMask)) {
5208 xgval.clip_mask = (GdkPixmap *) gval.fClipMask;
5209 }
5210 } else {
5211 // map XValues to GCValues_t
5212 Mask_t mask = 0;
5213
5214 if ((xmask & GDK_GC_FUNCTION)) {
5215 mask |= kGCFunction;
5216 gval.fFunction = (EGraphicsFunction) xgval.function; // ident mapping
5217 switch (xgval.function) {
5218 case GDK_CLEAR:
5219 gval.fFunction = kGXclear;
5220 break;
5221 case GDK_AND:
5222 gval.fFunction = kGXand;
5223 break;
5224 case GDK_AND_REVERSE:
5225 gval.fFunction = kGXandReverse;
5226 break;
5227 case GDK_COPY:
5228 gval.fFunction = kGXcopy;
5229 break;
5230 case GDK_AND_INVERT:
5231 gval.fFunction = kGXandInverted;
5232 break;
5233 case GDK_NOOP:
5234 gval.fFunction = kGXnoop;
5235 break;
5236 case GDK_XOR:
5237 gval.fFunction = kGXxor;
5238 break;
5239 case GDK_OR:
5240 gval.fFunction = kGXor;
5241 break;
5242 case GDK_EQUIV:
5243 gval.fFunction = kGXequiv;
5244 break;
5245 case GDK_INVERT:
5246 gval.fFunction = kGXinvert;
5247 break;
5248 case GDK_OR_REVERSE:
5249 gval.fFunction = kGXorReverse;
5250 break;
5251 case GDK_COPY_INVERT:
5252 gval.fFunction = kGXcopyInverted;
5253 break;
5254 case GDK_OR_INVERT:
5255 gval.fFunction = kGXorInverted;
5256 break;
5257 case GDK_NAND:
5258 gval.fFunction = kGXnand;
5259 break;
5260 case GDK_SET:
5261 gval.fFunction = kGXset;
5262 break;
5263 }
5264 }
5265 if (xmask & GDK_GC_SUBWINDOW) {
5267 if (xgval.subwindow_mode == GDK_INCLUDE_INFERIORS)
5268 gval.fSubwindowMode = kIncludeInferiors;
5269 else
5270 gval.fSubwindowMode = kClipByChildren;
5271 }
5272 if ((xmask & GDK_GC_FOREGROUND)) {
5274 gval.fForeground = xgval.foreground.pixel;
5275 }
5276 if ((xmask & GDK_GC_BACKGROUND)) {
5278 gval.fBackground = xgval.background.pixel;
5279 }
5280 if ((xmask & GDK_GC_LINE_WIDTH)) {
5281 mask |= kGCLineWidth;
5282 gval.fLineWidth = xgval.line_width;
5283 }
5284 if ((xmask & GDK_GC_LINE_STYLE)) {
5285 mask |= kGCLineStyle;
5286 gval.fLineStyle = xgval.line_style; // ident mapping
5287 }
5288 if ((xmask & GDK_GC_CAP_STYLE)) {
5289 mask |= kGCCapStyle;
5290 gval.fCapStyle = xgval.cap_style; // ident mapping
5291 }
5292 if ((xmask & GDK_GC_JOIN_STYLE)) {
5293 mask |= kGCJoinStyle;
5294 gval.fJoinStyle = xgval.join_style; // ident mapping
5295 }
5296 if ((xmask & GDK_GC_FILL)) {
5297 mask |= kGCFillStyle;
5298 gval.fFillStyle = xgval.fill; // ident mapping
5299 }
5300 if ((xmask & GDK_GC_TILE)) {
5301 mask |= kGCTile;
5302 gval.fTile = (Pixmap_t) xgval.tile;
5303 }
5304 if ((xmask & GDK_GC_STIPPLE)) {
5305 mask |= kGCStipple;
5306 gval.fStipple = (Pixmap_t) xgval.stipple;
5307 }
5308 if ((xmask & GDK_GC_TS_X_ORIGIN)) {
5310 gval.fTsXOrigin = xgval.ts_x_origin;
5311 }
5312 if ((xmask & GDK_GC_TS_Y_ORIGIN)) {
5314 gval.fTsYOrigin = xgval.ts_y_origin;
5315 }
5316 if ((xmask & GDK_GC_FONT)) {
5317 mask |= kGCFont;
5318 gval.fFont = (FontH_t) xgval.font;
5319 }
5320 if ((xmask & GDK_GC_EXPOSURES)) {
5322 gval.fGraphicsExposures = (Bool_t) xgval.graphics_exposures;
5323 }
5324 if ((xmask & GDK_GC_CLIP_X_ORIGIN)) {
5326 gval.fClipXOrigin = xgval.clip_x_origin;
5327 }
5328 if ((xmask & GDK_GC_CLIP_Y_ORIGIN)) {
5330 gval.fClipYOrigin = xgval.clip_y_origin;
5331 }
5332 if ((xmask & GDK_GC_CLIP_MASK)) {
5333 mask |= kGCClipMask;
5334 gval.fClipMask = (Pixmap_t) xgval.clip_mask;
5335 }
5336 gval.fMask = mask;
5337 }
5338}
5339
5340////////////////////////////////////////////////////////////////////////////////
5341/// Get window attributes and return filled in attributes structure.
5342
5344{
5345 if (!id) return;
5346
5350
5352 &attr.fWidth, &attr.fHeight, &attr.fDepth);
5353 attr.fX = ((rcWind.right - rcWind.left) - rcClient.right) / 2;
5354 attr.fY = ((rcWind.bottom - rcWind.top) - rcClient.bottom) - attr.fX;
5355
5356 attr.fRoot = (Window_t) GDK_ROOT_PARENT();
5358 attr.fBorderWidth = 0;
5359 attr.fVisual = gdk_window_get_visual((GdkWindow *) id);
5360 attr.fClass = kInputOutput;
5361 attr.fBackingStore = kNotUseful;
5362 attr.fSaveUnder = kFALSE;
5363 attr.fMapInstalled = kTRUE;
5364 attr.fOverrideRedirect = kFALSE; // boolean value for override-redirect
5365
5366 if (!gdk_window_is_visible((GdkWindow *) id)) {
5367 attr.fMapState = kIsUnmapped;
5368 } else if (!gdk_window_is_viewable((GdkWindow *) id)) {
5369 attr.fMapState = kIsUnviewable;
5370 } else {
5371 attr.fMapState = kIsViewable;
5372 }
5373
5375 UInt_t evmask;
5377
5378 attr.fYourEventMask = evmask;
5379}
5380
5381////////////////////////////////////////////////////////////////////////////////
5382///
5383
5385{
5386 return 0;
5387}
5388
5389////////////////////////////////////////////////////////////////////////////////
5390/// Get maximum number of planes.
5391
5393{
5395}
5396
5397////////////////////////////////////////////////////////////////////////////////
5398/// Return atom handle for atom_name. If it does not exist
5399/// create it if only_if_exist is false. Atoms are used to communicate
5400/// between different programs (i.e. window manager) via the X server.
5401
5403{
5405
5406 if (a == None) return kNone;
5407 return (Atom_t) a;
5408}
5409
5410////////////////////////////////////////////////////////////////////////////////
5411/// Return handle to the default root window created when calling
5412/// XOpenDisplay().
5413
5418
5419////////////////////////////////////////////////////////////////////////////////
5420/// Return the parent of the window.
5421
5423{
5424 if (!id) return (Window_t)0;
5425
5427}
5428
5429////////////////////////////////////////////////////////////////////////////////
5430/// Load font and query font. If font is not found 0 is returned,
5431/// otherwise an opaque pointer to the FontStruct_t.
5432/// Free the loaded font using DeleteFont().
5433
5435{
5436 char family[100], weight[32], slant[32], fontname[256];
5438
5439 numfields = sscanf(font_name, "%s -%d%n", family, &pixel, &n1);
5440 if (numfields == 2) {
5441 sprintf(weight,"medium");
5442 if (strstr(font_name, "bold"))
5443 sprintf(weight,"bold");
5444 sprintf(slant,"r");
5445 if (strstr(font_name, "italic"))
5446 sprintf(slant,"i");
5447 sprintf(fontname, "-*-%s-%s-%s-*-*-%d-*-*-*-*-*-iso8859-1",
5448 family, weight, slant, pixel);
5449 }
5450 else
5451 sprintf(fontname, "%s", font_name);
5453}
5454
5455////////////////////////////////////////////////////////////////////////////////
5456/// Return handle to font described by font structure.
5457
5459{
5460 if (fs) {
5461 return (FontH_t)gdk_font_ref((GdkFont *) fs);
5462 }
5463 return 0;
5464}
5465
5466////////////////////////////////////////////////////////////////////////////////
5467/// Explicitely delete font structure obtained with LoadQueryFont().
5468
5473
5474////////////////////////////////////////////////////////////////////////////////
5475/// Create a graphics context using the values set in gval (but only for
5476/// those entries that are in the mask).
5477
5479{
5480 if (!id) return (GContext_t)0;
5481
5483 ULong_t xmask = 0;
5484
5486
5487 xgval.subwindow_mode = GDK_CLIP_BY_CHILDREN; // GDK_INCLUDE_INFERIORS;
5488
5491 return (GContext_t) gc;
5492}
5493
5494////////////////////////////////////////////////////////////////////////////////
5495/// Change entries in an existing graphics context, gc, by values from gval.
5496
5498{
5500 ULong_t xmask = 0;
5501 Mask_t mask = 0;
5502
5503 if (gval) {
5504 mask = gval->fMask;
5506 }
5507 if (mask & kGCForeground) {
5508 gdk_gc_set_foreground((GdkGC *) gc, &xgval.foreground);
5509 }
5510 if (mask & kGCBackground) {
5511 gdk_gc_set_background((GdkGC *) gc, &xgval.background);
5512 }
5513 if (mask & kGCFont) {
5514 gdk_gc_set_font((GdkGC *) gc, xgval.font);
5515 }
5516 if (mask & kGCFunction) {
5517 gdk_gc_set_function((GdkGC *) gc, xgval.function);
5518 }
5519 if (mask & kGCFillStyle) {
5520 gdk_gc_set_fill((GdkGC *) gc, xgval.fill);
5521 }
5522 if (mask & kGCTile) {
5523 gdk_gc_set_tile((GdkGC *) gc, xgval.tile);
5524 }
5525 if (mask & kGCStipple) {
5526 gdk_gc_set_stipple((GdkGC *) gc, xgval.stipple);
5527 }
5529 gdk_gc_set_ts_origin((GdkGC *) gc, xgval.ts_x_origin,
5530 xgval.ts_y_origin);
5531 }
5532 if ((mask & kGCClipXOrigin) || (mask & kGCClipYOrigin)) {
5533 gdk_gc_set_clip_origin((GdkGC *) gc, xgval.clip_x_origin,
5534 xgval.clip_y_origin);
5535 }
5536 if (mask & kGCClipMask) {
5537 gdk_gc_set_clip_mask((GdkGC *) gc, xgval.clip_mask);
5538 }
5539 if (mask & kGCGraphicsExposures) {
5540 gdk_gc_set_exposures((GdkGC *) gc, xgval.graphics_exposures);
5541 }
5542 if (mask & kGCLineWidth) {
5544 }
5545 if (mask & kGCLineStyle) {
5547 }
5548 if (mask & kGCCapStyle) {
5550 }
5551 if (mask & kGCJoinStyle) {
5553 }
5554 if (mask & kGCSubwindowMode) {
5555 gdk_gc_set_subwindow((GdkGC *) gc, xgval.subwindow_mode);
5556 }
5557}
5558
5559////////////////////////////////////////////////////////////////////////////////
5560/// Copies graphics context from org to dest. Only the values specified
5561/// in mask are copied. Both org and dest must exist.
5562
5564{
5567 ULong_t xmask;
5568
5569 if (!mask) {
5570 // in this case copy all fields
5571 mask = (Mask_t) - 1;
5572 }
5573
5574 gval.fMask = mask; // only set fMask used to convert to xmask
5576
5577 gdk_gc_copy((GdkGC *) dest, (GdkGC *) org);
5578}
5579
5580////////////////////////////////////////////////////////////////////////////////
5581/// Explicitely delete a graphics context.
5582
5587
5588////////////////////////////////////////////////////////////////////////////////
5589/// Create cursor handle (just return cursor from cursor pool fCursors).
5590
5595
5596////////////////////////////////////////////////////////////////////////////////
5597/// Creates a pixmap of the width and height you specified
5598/// and returns a pixmap ID that identifies it.
5599
5607
5608////////////////////////////////////////////////////////////////////////////////
5609/// Create a pixmap from bitmap data. Ones will get foreground color and
5610/// zeroes background color.
5611
5615 Int_t depth)
5616{
5617 GdkColor fore, back;
5618 fore.pixel = forecolor;
5619 fore.red = GetRValue(forecolor);
5620 fore.green = GetGValue(forecolor);
5621 fore.blue = GetBValue(forecolor);
5622
5623 back.pixel = backcolor;
5624 back.red = GetRValue(backcolor);
5625 back.green = GetGValue(backcolor);
5626 back.blue = GetBValue(backcolor);
5627
5628 GdkWindow *wid = (GdkWindow *)id;
5629 if (!id) wid = GDK_ROOT_PARENT();
5630
5632 height, depth, &fore, &back);
5633}
5634
5635////////////////////////////////////////////////////////////////////////////////
5636/// Create a bitmap (i.e. pixmap with depth 1) from the bitmap data.
5637
5640{
5641 GdkWindow *wid = (GdkWindow *)id;
5642 if (!id) wid = GDK_ROOT_PARENT();
5643
5645 (char *)bitmap, width, height);
5646 return ret;
5647}
5648
5649////////////////////////////////////////////////////////////////////////////////
5650/// Explicitely delete pixmap resource.
5651
5653{
5654 gdk_pixmap_unref((GdkPixmap *) pmap);
5655}
5656
5657////////////////////////////////////////////////////////////////////////////////
5658/// Create a picture pixmap from data on file. The picture attributes
5659/// are used for input and output. Returns kTRUE in case of success,
5660/// kFALSE otherwise. If mask does not exist it is set to kNone.
5661
5663 Pixmap_t & pict,
5666{
5668 if (strstr(filename, ".xpm") || strstr(filename, ".XPM")) {
5669 GdkWindow *wid = (GdkWindow *)id;
5670 if (!id) wid = GDK_ROOT_PARENT();
5671
5673 filename);
5675 } else if (strstr(filename, ".gif") || strstr(filename, ".GIF")) {
5676 pict = ReadGIF(0, 0, filename, id);
5677 pict_mask = kNone;
5678 }
5679
5680 gdk_drawable_get_size((GdkPixmap *) pict, (int *) &attr.fWidth,
5681 (int *) &attr.fHeight);
5682 if (pict) {
5683 return kTRUE;
5684 }
5685 if (pict_mask) {
5686 pict_mask = kNone;
5687 }
5688 return kFALSE;
5689}
5690
5691////////////////////////////////////////////////////////////////////////////////
5692/// Create a pixture pixmap from data. The picture attributes
5693/// are used for input and output. Returns kTRUE in case of success,
5694/// kFALSE otherwise. If mask does not exist it is set to kNone.
5695
5697 Pixmap_t & pict,
5700{
5702 GdkWindow *wid = (GdkWindow *)id;
5703 if (!id) wid = GDK_ROOT_PARENT();
5704
5706 data);
5708
5709 if (pict) {
5710 return kTRUE;
5711 }
5712 if (pict_mask) {
5713 pict_mask = kNone;
5714 }
5715 return kFALSE;
5716}
5717
5718////////////////////////////////////////////////////////////////////////////////
5719/// Read picture data from file and store in ret_data. Returns kTRUE in
5720/// case of success, kFALSE otherwise.
5721
5723{
5724 Bool_t ret = kFALSE;
5726 ret_data = 0;
5727
5728 if (pxm==NULL) return kFALSE;
5729
5730 HBITMAP hbm = (HBITMAP)GDK_DRAWABLE_XID(pxm);
5731 BITMAP bitmap;
5732
5733 ret = ::GetObject(hbm, sizeof(HBITMAP), (LPVOID)&bitmap);
5734 ret_data = (char ***)&bitmap.bmBits;
5736 return ret;
5737}
5738
5739////////////////////////////////////////////////////////////////////////////////
5740/// Delete picture data created by the function ReadPictureDataFromFile.
5741
5743{
5744 free(data);
5745}
5746
5747////////////////////////////////////////////////////////////////////////////////
5748/// Specify a dash pattertn. Offset defines the phase of the pattern.
5749/// Each element in the dash_list array specifies the length (in pixels)
5750/// of a segment of the pattern. N defines the length of the list.
5751
5753 Int_t n)
5754{
5755 int i;
5756 gint8 dashes[32];
5757 for (i = 0; i < n; i++) {
5758 dashes[i] = (gint8) dash_list[i];
5759 }
5760 for (i = n; i < 32; i++) {
5761 dashes[i] = (gint8) 0;
5762 }
5763
5765}
5766
5767////////////////////////////////////////////////////////////////////////////////
5768/// Map a ColorStruct_t to a XColor structure.
5769
5771{
5772 xcolor.pixel = color->fPixel;
5773 xcolor.red = color->fRed;
5774 xcolor.green = color->fGreen;
5775 xcolor.blue = color->fBlue;
5776}
5777
5778////////////////////////////////////////////////////////////////////////////////
5779/// Parse string cname containing color name, like "green" or "#00FF00".
5780/// It returns a filled in ColorStruct_t. Returns kFALSE in case parsing
5781/// failed, kTRUE in case of success. On success, the ColorStruct_t
5782/// fRed, fGreen and fBlue fields are all filled in and the mask is set
5783/// for all three colors, but fPixel is not set.
5784
5786 ColorStruct_t & color)
5787{
5788 GdkColor xc;
5789
5790 if (gdk_color_parse((char *)cname, &xc)) {
5791 color.fPixel = xc.pixel = RGB(xc.red, xc.green, xc.blue);
5792 color.fRed = xc.red;
5793 color.fGreen = xc.green;
5794 color.fBlue = xc.blue;
5795 return kTRUE;
5796 }
5797 return kFALSE;
5798}
5799
5800////////////////////////////////////////////////////////////////////////////////
5801/// Find and allocate a color cell according to the color values specified
5802/// in the ColorStruct_t. If no cell could be allocated it returns kFALSE,
5803/// otherwise kTRUE.
5804
5806{
5807 int status;
5808 GdkColor xc;
5809
5810 xc.red = color.fRed;
5811 xc.green = color.fGreen;
5812 xc.blue = color.fBlue;
5813
5815 color.fPixel = xc.pixel;
5816
5817 return kTRUE; // status != 0 ? kTRUE : kFALSE;
5818}
5819
5820////////////////////////////////////////////////////////////////////////////////
5821/// Fill in the primary color components for a specific pixel value.
5822/// On input fPixel should be set on return the fRed, fGreen and
5823/// fBlue components will be set.
5824
5826{
5827 GdkColor xc;
5828 xc.pixel = color.fPixel;
5829
5833
5834 color.fPixel = xc.pixel;
5835 color.fRed = xc.red;
5836 color.fGreen = xc.green;
5837 color.fBlue = xc.blue;
5838}
5839
5840////////////////////////////////////////////////////////////////////////////////
5841/// Free color cell with specified pixel value.
5842
5844{
5845 // FIXME: to be implemented.
5846}
5847
5848////////////////////////////////////////////////////////////////////////////////
5849/// Check if there is for window "id" an event of type "type". If there
5850/// is fill in the event structure and return true. If no such event
5851/// return false.
5852
5854{
5855 if (!id) return kFALSE;
5856
5857 Event_t tev;
5858 GdkEvent xev;
5859
5860 tev.fType = type;
5861 tev.fWindow = (Window_t) id;
5862 tev.fTime = 0;
5863 tev.fX = tev.fY = 0;
5864 tev.fXRoot = tev.fYRoot = 0;
5865 tev.fCode = 0;
5866 tev.fState = 0;
5867 tev.fWidth = tev.fHeight = 0;
5868 tev.fCount = 0;
5869 tev.fSendEvent = kFALSE;
5870 tev.fHandle = 0;
5871 tev.fFormat = 0;
5872 tev.fUser[0] = tev.fUser[1] = tev.fUser[2] = tev.fUser[3] = tev.fUser[4] = 0L;
5873
5874 TGWin32MainThread::LockMSG();
5875 MapEvent(tev, xev, kTRUE);
5877
5878 if (r) MapEvent(ev, xev, kFALSE);
5879 TGWin32MainThread::UnlockMSG();
5880
5881 return r ? kTRUE : kFALSE;
5882}
5883
5884////////////////////////////////////////////////////////////////////////////////
5885/// Send event ev to window id.
5886
5888{
5889 if (!ev || !id) return;
5890
5891 TGWin32MainThread::LockMSG();
5892 GdkEvent xev;
5893 MapEvent(*ev, xev, kTRUE);
5895 TGWin32MainThread::UnlockMSG();
5896}
5897
5898////////////////////////////////////////////////////////////////////////////////
5899/// Returns number of pending events.
5900
5902{
5903 Int_t ret = 0;
5904
5905 TGWin32MainThread::LockMSG();
5907 if (list != nullptr)
5908 ret = g_list_length(list);
5909 TGWin32MainThread::UnlockMSG();
5910
5911 return ret;
5912}
5913
5914////////////////////////////////////////////////////////////////////////////////
5915/// Copies first pending event from event queue to Event_t structure
5916/// and removes event from queue. Not all of the event fields are valid
5917/// for each event type, except fType and fWindow.
5918
5920{
5921 TGWin32MainThread::LockMSG();
5923
5924 // fill in Event_t
5925 event.fType = kOtherEvent; // bb add
5926 if (xev == NULL) {
5927 TGWin32MainThread::UnlockMSG();
5928 return;
5929 }
5930 MapEvent(event, *xev, kFALSE);
5932 TGWin32MainThread::UnlockMSG();
5933}
5934
5935////////////////////////////////////////////////////////////////////////////////
5936/// Map modifier key state to or from X.
5937
5939{
5940 if (tox) {
5941 xstate = state;
5942 if (state & kAnyModifier) {
5944 }
5945 } else {
5946 state = xstate;
5947 }
5948}
5949
5950static void _set_event_time(GdkEvent &event, UInt_t time)
5951{
5952 // set gdk event time
5953
5954 switch (event.type) {
5955 case GDK_MOTION_NOTIFY:
5956 event.motion.time = time;
5957 case GDK_BUTTON_PRESS:
5958 case GDK_2BUTTON_PRESS:
5959 case GDK_3BUTTON_PRESS:
5960 case GDK_BUTTON_RELEASE:
5961 case GDK_SCROLL:
5962 event.button.time = time;
5963 case GDK_KEY_PRESS:
5964 case GDK_KEY_RELEASE:
5965 event.key.time = time;
5966 case GDK_ENTER_NOTIFY:
5967 case GDK_LEAVE_NOTIFY:
5968 event.crossing.time = time;
5970 event.property.time = time;
5974 event.selection.time = time;
5975 case GDK_PROXIMITY_IN:
5976 case GDK_PROXIMITY_OUT:
5977 event.proximity.time = time;
5978 case GDK_DRAG_ENTER:
5979 case GDK_DRAG_LEAVE:
5980 case GDK_DRAG_MOTION:
5981 case GDK_DRAG_STATUS:
5982 case GDK_DROP_START:
5983 case GDK_DROP_FINISHED:
5984 event.dnd.time = time;
5985 default: /* use current time */
5986 break;
5987 }
5988}
5989
5990////////////////////////////////////////////////////////////////////////////////
5991/// Map Event_t structure to gdk_event structure. If tox is false
5992/// map the other way.
5993
5995{
5996 if (tox) {
5997 // map from Event_t to gdk_event
5998 xev.type = GDK_NOTHING;
5999 if (ev.fType == kGKeyPress)
6000 xev.type = GDK_KEY_PRESS;
6001 if (ev.fType == kKeyRelease)
6002 xev.type = GDK_KEY_RELEASE;
6003 if (ev.fType == kButtonPress)
6004 xev.type = GDK_BUTTON_PRESS;
6005 if (ev.fType == kButtonRelease)
6006 xev.type = GDK_BUTTON_RELEASE;
6007 if (ev.fType == kMotionNotify)
6008 xev.type = GDK_MOTION_NOTIFY;
6009 if (ev.fType == kEnterNotify)
6010 xev.type = GDK_ENTER_NOTIFY;
6011 if (ev.fType == kLeaveNotify)
6012 xev.type = GDK_LEAVE_NOTIFY;
6013 if (ev.fType == kExpose)
6014 xev.type = GDK_EXPOSE;
6015 if (ev.fType == kConfigureNotify)
6016 xev.type = GDK_CONFIGURE;
6017 if (ev.fType == kMapNotify)
6018 xev.type = GDK_MAP;
6019 if (ev.fType == kUnmapNotify)
6020 xev.type = GDK_UNMAP;
6021 if (ev.fType == kDestroyNotify)
6022 xev.type = GDK_DESTROY;
6023 if (ev.fType == kClientMessage)
6024 xev.type = GDK_CLIENT_EVENT;
6025 if (ev.fType == kSelectionClear)
6026 xev.type = GDK_SELECTION_CLEAR;
6027 if (ev.fType == kSelectionRequest)
6029 if (ev.fType == kSelectionNotify)
6031
6032 xev.any.type = xev.type;
6033 xev.any.send_event = ev.fSendEvent;
6034 if (ev.fType == kDestroyNotify) {
6035 xev.any.window = (GdkWindow *) ev.fWindow;
6036 }
6037 if (ev.fType == kFocusIn) {
6038 xev.type = GDK_FOCUS_CHANGE;
6039 xev.focus_change.type = xev.type;
6040 xev.focus_change.window = (GdkWindow *) ev.fWindow;
6041 xev.focus_change.in = TRUE;
6042 }
6043 if (ev.fType == kFocusOut) {
6044 xev.type = GDK_FOCUS_CHANGE;
6045 xev.focus_change.type = xev.type;
6046 xev.focus_change.window = (GdkWindow *) ev.fWindow;
6047 xev.focus_change.in = FALSE;
6048 }
6049 if (ev.fType == kGKeyPress || ev.fType == kKeyRelease) {
6050 xev.key.window = (GdkWindow *) ev.fWindow;
6051 xev.key.type = xev.type;
6052 MapModifierState(ev.fState, xev.key.state, kTRUE); // key mask
6053 xev.key.keyval = ev.fCode; // key code
6054 }
6055 if (ev.fType == kButtonPress || ev.fType == kButtonRelease) {
6056 xev.button.window = (GdkWindow *) ev.fWindow;
6057 xev.button.type = xev.type;
6058 xev.button.x = ev.fX;
6059 xev.button.y = ev.fY;
6060 xev.button.x_root = ev.fXRoot;
6061 xev.button.y_root = ev.fYRoot;
6062 MapModifierState(ev.fState, xev.button.state, kTRUE); // button mask
6063 xev.button.button = ev.fCode; // button code
6064 }
6065 if (ev.fType == kSelectionNotify) {
6066 xev.selection.window = (GdkWindow *) ev.fUser[0];
6067 xev.selection.requestor = (ULongptr_t) ev.fUser[0];
6068 xev.selection.selection = (GdkAtom) ev.fUser[1];
6069 xev.selection.target = (GdkAtom) ev.fUser[2];
6070 xev.selection.property = (GdkAtom) ev.fUser[3];
6071 xev.selection.type = xev.type;
6072 }
6073 if (ev.fType == kClientMessage) {
6074 if ((ev.fFormat == 32) && (ev.fHandle == gWM_DELETE_WINDOW)) {
6075 xev.type = GDK_DELETE;
6076 xev.any.type = xev.type;
6077 xev.any.window = (GdkWindow *) ev.fWindow;
6078 } else {
6079 xev.client.window = (GdkWindow *) ev.fWindow;
6080 xev.client.type = xev.type;
6081 xev.client.message_type = (GdkAtom) ev.fHandle;
6082 xev.client.data_format = ev.fFormat;
6083 xev.client.data.l[0] = ev.fUser[0];
6084 if (sizeof(ev.fUser[0]) > 4) {
6085 SplitLong(ev.fUser[1], xev.client.data.l[1], xev.client.data.l[3]);
6086 SplitLong(ev.fUser[2], xev.client.data.l[2], xev.client.data.l[4]);
6087 } else {
6088 xev.client.data.l[1] = ev.fUser[1];
6089 xev.client.data.l[2] = ev.fUser[2];
6090 xev.client.data.l[3] = ev.fUser[3];
6091 xev.client.data.l[4] = ev.fUser[4];
6092 }
6093 }
6094 }
6095 if (ev.fType == kMotionNotify) {
6096 xev.motion.window = (GdkWindow *) ev.fWindow;
6097 xev.motion.type = xev.type;
6098 xev.motion.x = ev.fX;
6099 xev.motion.y = ev.fY;
6100 xev.motion.x_root = ev.fXRoot;
6101 xev.motion.y_root = ev.fYRoot;
6102 }
6103 if ((ev.fType == kEnterNotify) || (ev.fType == kLeaveNotify)) {
6104 xev.crossing.window = (GdkWindow *) ev.fWindow;
6105 xev.crossing.type = xev.type;
6106 xev.crossing.x = ev.fX;
6107 xev.crossing.y = ev.fY;
6108 xev.crossing.x_root = ev.fXRoot;
6109 xev.crossing.y_root = ev.fYRoot;
6110 xev.crossing.mode = (GdkCrossingMode) ev.fCode; // NotifyNormal, NotifyGrab, NotifyUngrab
6111 MapModifierState(ev.fState, xev.crossing.state, kTRUE); // key or button mask
6112 }
6113 if (ev.fType == kExpose) {
6114 xev.expose.window = (GdkWindow *) ev.fWindow;
6115 xev.expose.type = xev.type;
6116 xev.expose.area.x = ev.fX;
6117 xev.expose.area.y = ev.fY;
6118 xev.expose.area.width = ev.fWidth; // width and
6119 xev.expose.area.height = ev.fHeight; // height of exposed area
6120 xev.expose.count = ev.fCount; // number of expose events still to come
6121 }
6122 if (ev.fType == kConfigureNotify) {
6123 xev.configure.window = (GdkWindow *) ev.fWindow;
6124 xev.configure.type = xev.type;
6125 xev.configure.x = ev.fX;
6126 xev.configure.y = ev.fY;
6127 xev.configure.width = ev.fWidth;
6128 xev.configure.height = ev.fHeight;
6129 }
6130 if (ev.fType == kSelectionClear) {
6131 xev.selection.window = (GdkWindow *) ev.fWindow;
6132 xev.selection.type = xev.type;
6133 xev.selection.selection = ev.fUser[0];
6134 }
6135 if (ev.fType == kSelectionRequest) {
6136 xev.selection.window = (GdkWindow *) ev.fUser[0];
6137 xev.selection.type = xev.type;
6138 xev.selection.selection = ev.fUser[1];
6139 xev.selection.target = ev.fUser[2];
6140 xev.selection.property = ev.fUser[3];
6141 }
6142 if ((ev.fType == kMapNotify) || (ev.fType == kUnmapNotify)) {
6143 xev.any.window = (GdkWindow *) ev.fWindow;
6144 }
6145 if (xev.type != GDK_CLIENT_EVENT)
6146 _set_event_time(xev, ev.fTime);
6147 } else {
6148 // map from gdk_event to Event_t
6149 ev.fType = kOtherEvent;
6150 if (xev.type == GDK_KEY_PRESS)
6151 ev.fType = kGKeyPress;
6152 if (xev.type == GDK_KEY_RELEASE)
6153 ev.fType = kKeyRelease;
6154 if (xev.type == GDK_BUTTON_PRESS)
6155 ev.fType = kButtonPress;
6156 if (xev.type == GDK_BUTTON_RELEASE)
6157 ev.fType = kButtonRelease;
6158 if (xev.type == GDK_MOTION_NOTIFY)
6159 ev.fType = kMotionNotify;
6160 if (xev.type == GDK_ENTER_NOTIFY)
6161 ev.fType = kEnterNotify;
6162 if (xev.type == GDK_LEAVE_NOTIFY)
6163 ev.fType = kLeaveNotify;
6164 if (xev.type == GDK_EXPOSE)
6165 ev.fType = kExpose;
6166 if (xev.type == GDK_CONFIGURE)
6167 ev.fType = kConfigureNotify;
6168 if (xev.type == GDK_MAP)
6169 ev.fType = kMapNotify;
6170 if (xev.type == GDK_UNMAP)
6171 ev.fType = kUnmapNotify;
6172 if (xev.type == GDK_DESTROY)
6173 ev.fType = kDestroyNotify;
6174 if (xev.type == GDK_SELECTION_CLEAR)
6175 ev.fType = kSelectionClear;
6176 if (xev.type == GDK_SELECTION_REQUEST)
6177 ev.fType = kSelectionRequest;
6178 if (xev.type == GDK_SELECTION_NOTIFY)
6179 ev.fType = kSelectionNotify;
6180
6181 ev.fSendEvent = kFALSE; //xev.any.send_event ? kTRUE : kFALSE;
6182 ev.fTime = gdk_event_get_time((GdkEvent *)&xev);
6183 ev.fWindow = (Window_t) xev.any.window;
6184
6185 if ((xev.type == GDK_MAP) || (xev.type == GDK_UNMAP)) {
6186 ev.fWindow = (Window_t) xev.any.window;
6187 }
6188 if (xev.type == GDK_DELETE) {
6189 ev.fWindow = (Window_t) xev.any.window;
6190 ev.fType = kClientMessage;
6191 ev.fFormat = 32;
6192 ev.fHandle = gWM_DELETE_WINDOW;
6193 ev.fUser[0] = (Longptr_t) gWM_DELETE_WINDOW;
6194 if (sizeof(ev.fUser[0]) > 4) {
6195 AsmLong(xev.client.data.l[1], xev.client.data.l[3], ev.fUser[1]);
6196 AsmLong(xev.client.data.l[2], xev.client.data.l[4], ev.fUser[2]);
6197 } else {
6198 ev.fUser[1] = 0; // xev.client.data.l[1];
6199 ev.fUser[2] = 0; // xev.client.data.l[2];
6200 ev.fUser[3] = 0; // xev.client.data.l[3];
6201 ev.fUser[4] = 0; // xev.client.data.l[4];
6202 }
6203 }
6204 if (xev.type == GDK_DESTROY) {
6205 ev.fType = kDestroyNotify;
6206 ev.fHandle = (Window_t) xev.any.window; // window to be destroyed
6207 ev.fWindow = (Window_t) xev.any.window;
6208 }
6209 if (xev.type == GDK_FOCUS_CHANGE) {
6210 ev.fWindow = (Window_t) xev.focus_change.window;
6211 ev.fCode = kNotifyNormal;
6212 ev.fState = 0;
6213 if (xev.focus_change.in == TRUE) {
6214 ev.fType = kFocusIn;
6215 } else {
6216 ev.fType = kFocusOut;
6217 }
6218 }
6219 if (ev.fType == kGKeyPress || ev.fType == kKeyRelease) {
6220 ev.fWindow = (Window_t) xev.key.window;
6221 MapModifierState(ev.fState, xev.key.state, kFALSE); // key mask
6222 ev.fCode = xev.key.keyval; // key code
6223 ev.fUser[1] = xev.key.length;
6224 if (xev.key.length > 0) ev.fUser[2] = xev.key.string[0];
6225 if (xev.key.length > 1) ev.fUser[3] = xev.key.string[1];
6226 if (xev.key.length > 2) ev.fUser[4] = xev.key.string[2];
6227 HWND tmpwin = (HWND) GetWindow((HWND) GDK_DRAWABLE_XID((GdkWindow *)xev.key.window), GW_CHILD);
6228 if (tmpwin) {
6229 ev.fUser[0] = (ULongptr_t) gdk_xid_table_lookup((HANDLE)tmpwin);
6230 } else {
6231 ev.fUser[0] = (ULongptr_t) xev.key.window;
6232 }
6233 }
6234 if (ev.fType == kButtonPress || ev.fType == kButtonRelease) {
6235 ev.fWindow = (Window_t) xev.button.window;
6236 ev.fX = xev.button.x;
6237 ev.fY = xev.button.y;
6238 ev.fXRoot = xev.button.x_root;
6239 ev.fYRoot = xev.button.y_root;
6240 MapModifierState(ev.fState, xev.button.state, kFALSE); // button mask
6241 ev.fCode = xev.button.button; // button code
6242 POINT tpoint;
6243 tpoint.x = xev.button.x;
6244 tpoint.y = xev.button.y;
6246 if (tmpwin) {
6247 ev.fUser[0] = (ULongptr_t) gdk_xid_table_lookup((HANDLE)tmpwin);
6248 } else {
6249 ev.fUser[0] = (ULongptr_t) 0;
6250 }
6251 }
6252 if (ev.fType == kMotionNotify) {
6253 ev.fWindow = (Window_t) xev.motion.window;
6254 ev.fX = xev.motion.x;
6255 ev.fY = xev.motion.y;
6256 ev.fXRoot = xev.motion.x_root;
6257 ev.fYRoot = xev.motion.y_root;
6258 MapModifierState(ev.fState, xev.motion.state, kFALSE); // key or button mask
6259
6260 POINT tpoint;
6261 tpoint.x = xev.button.x;
6262 tpoint.y = xev.button.y;
6264 if (tmpwin) {
6265 ev.fUser[0] = (ULongptr_t)gdk_xid_table_lookup((HANDLE)tmpwin);
6266 } else {
6267 ev.fUser[0] = (ULongptr_t) xev.motion.window;
6268 }
6269 }
6270 if (ev.fType == kEnterNotify || ev.fType == kLeaveNotify) {
6271 ev.fWindow = (Window_t) xev.crossing.window;
6272 ev.fX = xev.crossing.x;
6273 ev.fY = xev.crossing.y;
6274 ev.fXRoot = xev.crossing.x_root;
6275 ev.fYRoot = xev.crossing.y_root;
6276 ev.fCode = xev.crossing.mode; // NotifyNormal, NotifyGrab, NotifyUngrab
6277 MapModifierState(ev.fState, xev.crossing.state, kFALSE); // key or button mask
6278 }
6279 if (ev.fType == kExpose) {
6280 ev.fWindow = (Window_t) xev.expose.window;
6281 ev.fX = xev.expose.area.x;
6282 ev.fY = xev.expose.area.y;
6283 ev.fWidth = xev.expose.area.width; // width and
6284 ev.fHeight = xev.expose.area.height; // height of exposed area
6285 ev.fCount = xev.expose.count; // number of expose events still to come
6286 }
6287 if (ev.fType == kConfigureNotify) {
6288 ev.fWindow = (Window_t) xev.configure.window;
6289 ev.fX = xev.configure.x;
6290 ev.fY = xev.configure.y;
6291 ev.fWidth = xev.configure.width;
6292 ev.fHeight = xev.configure.height;
6293 }
6294 if (xev.type == GDK_CLIENT_EVENT) {
6295 ev.fWindow = (Window_t) xev.client.window;
6296 ev.fType = kClientMessage;
6297 ev.fHandle = xev.client.message_type;
6298 ev.fFormat = xev.client.data_format;
6299 ev.fUser[0] = xev.client.data.l[0];
6300 if (sizeof(ev.fUser[0]) > 4) {
6301 AsmLong(xev.client.data.l[1], xev.client.data.l[3], ev.fUser[1]);
6302 AsmLong(xev.client.data.l[2], xev.client.data.l[4], ev.fUser[2]);
6303 } else {
6304 ev.fUser[1] = xev.client.data.l[1];
6305 ev.fUser[2] = xev.client.data.l[2];
6306 ev.fUser[3] = xev.client.data.l[3];
6307 ev.fUser[4] = xev.client.data.l[4];
6308 }
6309 }
6310 if (ev.fType == kSelectionClear) {
6311 ev.fWindow = (Window_t) xev.selection.window;
6312 ev.fUser[0] = xev.selection.selection;
6313 }
6314 if (ev.fType == kSelectionRequest) {
6315 ev.fWindow = (Window_t) xev.selection.window;
6316 ev.fUser[0] = (ULongptr_t) xev.selection.window;
6317 ev.fUser[1] = xev.selection.selection;
6318 ev.fUser[2] = xev.selection.target;
6319 ev.fUser[3] = xev.selection.property;
6320 }
6321 if (ev.fType == kSelectionNotify) {
6322 ev.fWindow = (Window_t) xev.selection.window;
6323 ev.fUser[0] = (ULongptr_t) xev.selection.window;
6324 ev.fUser[1] = xev.selection.selection;
6325 ev.fUser[2] = xev.selection.target;
6326 ev.fUser[3] = xev.selection.property;
6327 }
6328 if (xev.type == GDK_SCROLL) {
6329 ev.fType = kButtonRelease;
6330 if (xev.scroll.direction == GDK_SCROLL_UP) {
6331 ev.fCode = kButton4;
6332 } else if (xev.scroll.direction == GDK_SCROLL_DOWN) {
6333 ev.fCode = kButton5;
6334 }
6335 ev.fWindow = (Window_t) xev.scroll.window;
6336 ev.fX = xev.scroll.x;
6337 ev.fY = xev.scroll.y;
6338 ev.fXRoot = xev.scroll.x_root;
6339 ev.fYRoot = xev.scroll.y_root;
6340 POINT tpoint;
6341 tpoint.x = xev.scroll.x;
6342 tpoint.y = xev.scroll.y;
6344 if (tmpwin) {
6345 ev.fUser[0] = (ULongptr_t)gdk_xid_table_lookup((HANDLE)tmpwin);
6346 } else {
6347 ev.fUser[0] = (ULongptr_t) 0;
6348 }
6349 }
6350 }
6351}
6352
6353////////////////////////////////////////////////////////////////////////////////
6354///
6355
6357{
6358 gSystem->Beep();
6359}
6360
6361////////////////////////////////////////////////////////////////////////////////
6362/// Copy a drawable (i.e. pixmap) to another drawable (pixmap, window).
6363/// The graphics context gc will be used and the source will be copied
6364/// from src_x,src_y,src_x+width,src_y+height to dest_x,dest_y.
6365
6375
6376////////////////////////////////////////////////////////////////////////////////
6377/// Change window attributes.
6378
6380{
6381 if (!id) return;
6382
6383 GdkColor color;
6385 Mask_t evmask;
6386
6387 if (attr && (attr->fMask & kWAEventMask)) {
6388 evmask = (Mask_t) attr->fEventMask;
6391 }
6392 if (attr && (attr->fMask & kWABackPixel)) {
6393 color.pixel = attr->fBackgroundPixel;
6394 color.red = GetRValue(attr->fBackgroundPixel);
6395 color.green = GetGValue(attr->fBackgroundPixel);
6396 color.blue = GetBValue(attr->fBackgroundPixel);
6397 gdk_window_set_background((GdkWindow *) id, &color);
6398 }
6399// if (attr && (attr->fMask & kWAOverrideRedirect))
6400// gdk_window_set_override_redirect ((GdkWindow *) id, attr->fOverrideRedirect);
6401 if (attr && (attr->fMask & kWABackPixmap)) {
6403 (GdkPixmap *) attr->fBackgroundPixmap, 0);
6404 }
6405 if (attr && (attr->fMask & kWACursor)) {
6406 gdk_window_set_cursor((GdkWindow *) id, (GdkCursor *) attr->fCursor);
6407 }
6408 if (attr && (attr->fMask & kWAColormap)) {
6409 gdk_window_set_colormap((GdkWindow *) id,(GdkColormap *) attr->fColormap);
6410 }
6411 if (attr && (attr->fMask & kWABorderWidth)) {
6412 if (attr->fBorderWidth > 0) {
6415 }
6416 }
6417}
6418
6419////////////////////////////////////////////////////////////////////////////////
6420/// This function alters the property for the specified window and
6421/// causes the X server to generate a PropertyNotify event on that
6422/// window.
6423
6425 UChar_t * data, Int_t len)
6426{
6427 if (!id) return;
6428
6431}
6432
6433////////////////////////////////////////////////////////////////////////////////
6434/// Draw a line.
6435
6437 Int_t x2, Int_t y2)
6438{
6439 if (!id) return;
6440
6441 gdk_draw_line((GdkDrawable *) id, (GdkGC *) gc, x1, y1, x2, y2);
6442}
6443
6444////////////////////////////////////////////////////////////////////////////////
6445/// Clear a window area to the bakcground color.
6446
6448{
6449 if (!id) return;
6450
6451 gdk_window_clear_area((GdkWindow *) id, x, y, w, h);
6452}
6453
6454////////////////////////////////////////////////////////////////////////////////
6455/// Tell WM to send message when window is closed via WM.
6456
6458{
6459 if (!id) return;
6460
6461 Atom prop;
6462 prop = (Atom_t) gdk_atom_intern("WM_DELETE_WINDOW", FALSE);
6463
6466 (unsigned char *) &gWM_DELETE_WINDOW, 1);
6467}
6468
6469////////////////////////////////////////////////////////////////////////////////
6470/// Turn key auto repeat on or off.
6471
6473{
6474 if (on) {
6476 } else {
6478 }
6479}
6480
6481////////////////////////////////////////////////////////////////////////////////
6482/// Establish passive grab on a certain key. That is, when a certain key
6483/// keycode is hit while certain modifier's (Shift, Control, Meta, Alt)
6484/// are active then the keyboard will be grabed for window id.
6485/// When grab is false, ungrab the keyboard for this key and modifier.
6486
6488{
6489 UInt_t xmod;
6490
6492
6493 if (grab) {
6495 } else {
6497 }
6498}
6499
6500////////////////////////////////////////////////////////////////////////////////
6501/// Establish passive grab on a certain mouse button. That is, when a
6502/// certain mouse button is hit while certain modifier's (Shift, Control,
6503/// Meta, Alt) are active then the mouse will be grabed for window id.
6504/// When grab is false, ungrab the mouse button for this button and modifier.
6505
6508 Bool_t grab)
6509{
6511 UInt_t xmod;
6512
6513 if (!id) return;
6514
6516
6517 if (grab) {
6521 } else {
6523 }
6524}
6525
6526////////////////////////////////////////////////////////////////////////////////
6527/// Establish an active pointer grab. While an active pointer grab is in
6528/// effect, further pointer events are only reported to the grabbing
6529/// client window.
6530
6547
6548////////////////////////////////////////////////////////////////////////////////
6549/// Set window name.
6550
6552{
6553 if (!id) return;
6554
6556}
6557
6558////////////////////////////////////////////////////////////////////////////////
6559/// Set window icon name.
6560
6562{
6563 if (!id) return;
6564
6566}
6567
6568////////////////////////////////////////////////////////////////////////////////
6569/// Set pixmap the WM can use when the window is iconized.
6570
6572{
6573 if (!id) return;
6574
6576}
6577
6578#define safestrlen(s) ((s) ? strlen(s) : 0)
6579
6580////////////////////////////////////////////////////////////////////////////////
6581/// Set the windows class and resource name.
6582
6583void TGWin32::SetClassHints(Window_t id, char *className, char *resourceName)
6584{
6585 if (!id) return;
6586
6587 char *class_string;
6588 char *s;
6589 size_t len_nm, len_cl;
6590 GdkAtom prop;
6591
6592 prop = gdk_atom_intern("WM_CLASS", kFALSE);
6593
6595 len_cl = safestrlen(className);
6596
6597 if ((class_string = s =
6598 (char *) malloc((unsigned) (len_nm + len_cl + 2)))) {
6599 if (len_nm) {
6600 strcpy(s, resourceName);
6601 s += len_nm + 1;
6602 } else
6603 *s++ = '\0';
6604 if (len_cl) {
6605 strcpy(s, className);
6606 } else {
6607 *s = '\0';
6608 }
6609
6613 (unsigned char *) class_string,
6614 (Int_t)(len_nm + len_cl + 2));
6616 }
6617}
6618
6619////////////////////////////////////////////////////////////////////////////////
6620/// Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
6621
6630
6631////////////////////////////////////////////////////////////////////////////////
6632///
6633
6635{
6636 if (!id) return;
6637
6638 // prevent hiding the titlebar
6639 if (x == 0 && y == 0) {
6640 x = 1; y = 1;
6641 }
6642 gdk_window_move((GdkDrawable *) id, x, y);
6643}
6644
6645////////////////////////////////////////////////////////////////////////////////
6646///
6647
6649{
6650 if (!id) return;
6651
6652 gdk_window_resize((GdkWindow *) id, w, h);
6653}
6654
6655////////////////////////////////////////////////////////////////////////////////
6656/// Give the window manager minimum and maximum size hints. Also
6657/// specify via winc and hinc the resize increments.
6658
6662{
6663 if (!id) return;
6664
6666 GdkWindowHints flags;
6667
6670 hints.min_width = (Int_t) wmin;
6671 hints.max_width = (Int_t) wmax;
6672 hints.min_height = (Int_t) hmin;
6673 hints.max_height = (Int_t) hmax;
6674 hints.width_inc = (Int_t) winc;
6675 hints.height_inc = (Int_t) hinc;
6676
6678 (GdkWindowHints) flags);
6679}
6680
6681////////////////////////////////////////////////////////////////////////////////
6682/// Set the initial state of the window. Either kNormalState or kIconicState.
6683
6685{
6686 if (!id) return;
6687
6688#if 0
6691
6692 if (state == kNormalState)
6694 if (state == kIconicState)
6696
6697 hints.flags = StateHint;
6698 hints.initial_state = xstate;
6699
6700 XSetWMHints((GdkWindow *) id, &hints);
6701#endif
6702}
6703
6704////////////////////////////////////////////////////////////////////////////////
6705/// Tell window manager that window is a transient window of gdk_parent_root.
6706
6708{
6709 if (!id) return;
6710
6712}
6713
6714////////////////////////////////////////////////////////////////////////////////
6715/// Draw a string using a specific graphics context in position (x,y).
6716
6718 const char *s, Int_t len)
6719{
6720 if (!id) return;
6721
6722 GdkGCValues values;
6723 gdk_gc_get_values((GdkGC *) gc, &values);
6724 gdk_win32_draw_text((GdkDrawable *) id, (GdkFont *) values.font,
6725 (GdkGC *) gc, x, y, (const gchar *)s, len);
6726}
6727
6728////////////////////////////////////////////////////////////////////////////////
6729/// Return length of string in pixels. Size depends on font.
6730
6732{
6733 return gdk_text_width((GdkFont *)font, s, len);
6734}
6735
6736////////////////////////////////////////////////////////////////////////////////
6737/// Return some font properties.
6738
6741{
6742 GdkFont *f = (GdkFont *) font;
6743 max_ascent = f->ascent;
6744 max_descent = f->descent;
6745}
6746
6747////////////////////////////////////////////////////////////////////////////////
6748/// Get current values from graphics context gc. Which values of the
6749/// context to get is encoded in the GCValues::fMask member.
6750
6760
6761////////////////////////////////////////////////////////////////////////////////
6762/// Retrieve associated font structure once we have the font handle.
6763/// Free returned FontStruct_t using FreeFontStruct().
6764
6769
6770////////////////////////////////////////////////////////////////////////////////
6771/// Free font structure returned by GetFontStruct().
6772
6777
6778////////////////////////////////////////////////////////////////////////////////
6779/// Clear window.
6780
6782{
6783 if (!id) return;
6784
6786}
6787
6788////////////////////////////////////////////////////////////////////////////////
6789/// Convert a keysym to the appropriate keycode. For example keysym is
6790/// a letter and keycode is the matching keyboard key (which is dependend
6791/// on the current keyboard mapping).
6792
6799
6800////////////////////////////////////////////////////////////////////////////////
6801/// Draw a filled rectangle. Filling is done according to the gc.
6802
6804 UInt_t w, UInt_t h)
6805{
6806 if (!id) return;
6807
6809}
6810
6811////////////////////////////////////////////////////////////////////////////////
6812/// Draw a rectangle outline.
6813
6815 UInt_t w, UInt_t h)
6816{
6817 if (!id) return;
6818
6820}
6821
6822////////////////////////////////////////////////////////////////////////////////
6823/// Draws multiple line segments. Each line is specified by a pair of points.
6824
6826 Int_t nseg)
6827{
6828 if (!id) return;
6829
6831}
6832
6833////////////////////////////////////////////////////////////////////////////////
6834/// Defines which input events the window is interested in. By default
6835/// events are propageted up the window stack. This mask can also be
6836/// set at window creation time via the SetWindowAttributes_t::fEventMask
6837/// attribute.
6838
6840{
6841 if (!id) return;
6842
6846}
6847
6848////////////////////////////////////////////////////////////////////////////////
6849/// Returns the window id of the window having the input focus.
6850
6856
6857////////////////////////////////////////////////////////////////////////////////
6858/// Set keyboard input focus to window id.
6859
6861{
6862 if (!id) return;
6863
6865 ::SetFocus(hwnd);
6866}
6867
6868////////////////////////////////////////////////////////////////////////////////
6869/// Returns the window id of the current owner of the primary selection.
6870/// That is the window in which, for example some text is selected.
6871
6876
6877////////////////////////////////////////////////////////////////////////////////
6878/// Makes the window id the current owner of the primary selection.
6879/// That is the window in which, for example some text is selected.
6880
6882{
6883 if (!id) return;
6884
6886}
6887
6888////////////////////////////////////////////////////////////////////////////////
6889/// XConvertSelection() causes a SelectionRequest event to be sent to the
6890/// current primary selection owner. This event specifies the selection
6891/// property (primary selection), the format into which to convert that
6892/// data before storing it (target = XA_STRING), the property in which
6893/// the owner will place the information (sel_property), the window that
6894/// wants the information (id), and the time of the conversion request
6895/// (when).
6896/// The selection owner responds by sending a SelectionNotify event, which
6897/// confirms the selected atom and type.
6898
6900{
6901 if (!id) return;
6902
6904 gdk_atom_intern("GDK_TARGET_STRING", 0), when);
6905}
6906
6907////////////////////////////////////////////////////////////////////////////////
6908/// Convert the keycode from the event structure to a key symbol (according
6909/// to the modifiers specified in the event structure and the current
6910/// keyboard mapping). In buf a null terminated ASCII string is returned
6911/// representing the string that is currently mapped to the key code.
6912
6913void TGWin32::LookupString(Event_t * event, char *buf, Int_t buflen,
6914 UInt_t & keysym)
6915{
6916 _lookup_string(event, buf, buflen);
6917 UInt_t ks, xks = (UInt_t) event->fCode;
6919 keysym = (Int_t) ks;
6920}
6921
6922////////////////////////////////////////////////////////////////////////////////
6923/// Map to and from X key symbols. Keysym are the values returned by
6924/// XLookUpString.
6925
6927{
6928 if (tox) {
6930 if (keysym < 127) {
6931 xkeysym = keysym;
6932 } else if (keysym >= kKey_F1 && keysym <= kKey_F35) {
6933 xkeysym = GDK_F1 + (keysym - (UInt_t) kKey_F1); // function keys
6934 } else {
6935 for (int i = 0; gKeyMap[i].fKeySym; i++) { // any other keys
6936 if (keysym == (UInt_t) gKeyMap[i].fKeySym) {
6937 xkeysym = (UInt_t) gKeyMap[i].fXKeySym;
6938 break;
6939 }
6940 }
6941 }
6942 } else {
6944 // commentary in X11/keysymdef says that X codes match ASCII
6945 if (xkeysym < 127) {
6946 keysym = xkeysym;
6947 } else if (xkeysym >= GDK_F1 && xkeysym <= GDK_F35) {
6948 keysym = kKey_F1 + (xkeysym - GDK_F1); // function keys
6949 } else if (xkeysym >= GDK_KP_0 && xkeysym <= GDK_KP_9) {
6950 keysym = kKey_0 + (xkeysym - GDK_KP_0); // numeric keypad keys
6951 } else {
6952 for (int i = 0; gKeyMap[i].fXKeySym; i++) { // any other keys
6953 if (xkeysym == gKeyMap[i].fXKeySym) {
6954 keysym = (UInt_t) gKeyMap[i].fKeySym;
6955 break;
6956 }
6957 }
6958 }
6959 }
6960}
6961
6962////////////////////////////////////////////////////////////////////////////////
6963/// Get contents of paste buffer atom into string. If del is true delete
6964/// the paste buffer afterwards.
6965
6967 Int_t & nchar, Bool_t del)
6968{
6969 if (!id) return;
6970
6971 char *data;
6972 int nread, actual_format;
6973
6975 (unsigned char **) &data,
6976 (GdkAtom *) & atom, &actual_format);
6977
6978 if ((nread == 0) || (data == NULL)) {
6979 nchar = 0;
6980 return;
6981 }
6982
6983 text.Insert(0, (const char *) data);
6984 nchar = 1; //strlen(data);
6985 g_free(data);
6986
6987 // if (del)
6989 gdk_atom_intern("GDK_SELECTION", FALSE));
6990}
6991
6992////////////////////////////////////////////////////////////////////////////////
6993/// TranslateCoordinates translates coordinates from the frame of
6994/// reference of one window to another. If the point is contained
6995/// in a mapped child of the destination, the id of that child is
6996/// returned as well.
6997
7001 Window_t &child)
7002{
7003 if (!src || !dest) return;
7004
7005 HWND sw, dw, ch = NULL;
7006 POINT point;
7009 point.x = src_x;
7010 point.y = src_y;
7011 ::MapWindowPoints(sw, // handle of window to be mapped from
7012 dw, // handle to window to be mapped to
7013 &point, // pointer to array with points to map
7014 1); // number of structures in array
7017
7018 if (child == src) {
7019 child = (Window_t) 0;
7020 }
7021 dest_x = point.x;
7022 dest_y = point.y;
7023}
7024
7025////////////////////////////////////////////////////////////////////////////////
7026/// Return geometry of window (should be called GetGeometry but signature
7027/// already used).
7028
7030 UInt_t & w, UInt_t & h)
7031{
7032 if (!id) return;
7033
7034 Int_t ddum;
7036 x = y = 0;
7037 gdk_drawable_get_size((GdkDrawable *)id, (int*)&w, (int*)&h);
7038 }
7039 else {
7040 gdk_window_get_geometry((GdkDrawable *) id, &x, &y, (int*)&w,
7041 (int*)&h, &ddum);
7042 }
7043}
7044
7045////////////////////////////////////////////////////////////////////////////////
7046/// FillPolygon fills the region closed by the specified path.
7047/// The path is closed automatically if the last point in the list does
7048/// not coincide with the first point. All point coordinates are
7049/// treated as relative to the origin. For every pair of points
7050/// inside the polygon, the line segment connecting them does not
7051/// intersect the path.
7052
7054 Int_t npnt)
7055{
7056 if (!id) return;
7057
7059}
7060
7061////////////////////////////////////////////////////////////////////////////////
7062/// Returns the root window the pointer is logically on and the pointer
7063/// coordinates relative to the root window's origin.
7064/// The pointer coordinates returned to win_x and win_y are relative to
7065/// the origin of the specified window. In this case, QueryPointer returns
7066/// the child that contains the pointer, if any, or else kNone to
7067/// childw. QueryPointer returns the current logical state of the
7068/// keyboard buttons and the modifier keys in mask.
7069
7073 UInt_t &mask)
7074{
7075 if (!id) return;
7076
7077 POINT currPt;
7078 HWND chw, window;
7079 UInt_t umask = 0;
7080 BYTE kbd[256];
7081
7082 window = (HWND)GDK_DRAWABLE_XID((GdkWindow *)id);
7087 root_x = currPt.x;
7088 root_y = currPt.y;
7089
7090 ::ScreenToClient(window, &currPt);
7091 win_x = currPt.x;
7092 win_y = currPt.y;
7093
7095
7096 if (kbd[VK_SHIFT] & 0x80) {
7098 }
7099 if (kbd[VK_CAPITAL] & 0x80) {
7101 }
7102 if (kbd[VK_CONTROL] & 0x80) {
7104 }
7105 if (kbd[VK_MENU] & 0x80) {
7107 }
7108 if (kbd[VK_LBUTTON] & 0x80) {
7110 }
7111 if (kbd[VK_MBUTTON] & 0x80) {
7113 }
7114 if (kbd[VK_RBUTTON] & 0x80) {
7116 }
7117
7119}
7120
7121////////////////////////////////////////////////////////////////////////////////
7122/// Set foreground color in graphics context (shortcut for ChangeGC with
7123/// only foreground mask set).
7124
7126{
7127 GdkColor fore;
7128 fore.pixel = foreground;
7129 fore.red = GetRValue(foreground);
7130 fore.green = GetGValue(foreground);
7131 fore.blue = GetBValue(foreground);
7133}
7134
7135////////////////////////////////////////////////////////////////////////////////
7136/// Set clipping rectangles in graphics context. X, Y specify the origin
7137/// of the rectangles. Recs specifies an array of rectangles that define
7138/// the clipping mask and n is the number of rectangles.
7139
7142{
7143 Int_t i;
7145
7146 for (i = 0; i < n; i++) {
7147 grects[i].x = x+recs[i].fX;
7148 grects[i].y = y+recs[i].fY;
7149 grects[i].width = recs[i].fWidth;
7150 grects[i].height = recs[i].fHeight;
7151 }
7152
7153 for (i = 0; i < n; i++) {
7155 }
7156 delete [] grects;
7157}
7158
7159////////////////////////////////////////////////////////////////////////////////
7160/// Flush (mode = 0, default) or synchronize (mode = 1) X output buffer.
7161/// Flush flushes output buffer. Sync flushes buffer and waits till all
7162/// requests have been processed by X server.
7163
7165{
7166 GdiFlush();
7167}
7168
7169////////////////////////////////////////////////////////////////////////////////
7170/// Create a new empty region.
7171
7176
7177////////////////////////////////////////////////////////////////////////////////
7178/// Destroy region.
7179
7184
7185////////////////////////////////////////////////////////////////////////////////
7186/// Union of rectangle with a region.
7187
7189{
7191 r.x = rect->fX;
7192 r.y = rect->fY;
7193 r.width = rect->fWidth;
7194 r.height = rect->fHeight;
7196}
7197
7198////////////////////////////////////////////////////////////////////////////////
7199/// Create region for the polygon defined by the points array.
7200/// If winding is true use WindingRule else EvenOddRule as fill rule.
7201
7207
7208////////////////////////////////////////////////////////////////////////////////
7209/// Compute the union of rega and regb and return result region.
7210/// The output region may be the same result region.
7211
7216
7217////////////////////////////////////////////////////////////////////////////////
7218/// Compute the intersection of rega and regb and return result region.
7219/// The output region may be the same as the result region.
7220
7226
7227////////////////////////////////////////////////////////////////////////////////
7228/// Subtract rega from regb.
7229
7234
7235////////////////////////////////////////////////////////////////////////////////
7236/// Calculate the difference between the union and intersection of
7237/// two regions.
7238
7243
7244////////////////////////////////////////////////////////////////////////////////
7245/// Return true if the region is empty.
7246
7251
7252////////////////////////////////////////////////////////////////////////////////
7253/// Returns true if the point x,y is in the region.
7254
7259
7260////////////////////////////////////////////////////////////////////////////////
7261/// Returns true if two regions are equal.
7262
7267
7268////////////////////////////////////////////////////////////////////////////////
7269/// Return smallest enclosing rectangle.
7270
7272{
7275 rect->fX = r.x;
7276 rect->fY = r.y;
7277 rect->fWidth = r.width;
7278 rect->fHeight = r.height;
7279}
7280
7281////////////////////////////////////////////////////////////////////////////////
7282/// Return list of font names matching "fontname".
7283
7284char **TGWin32::ListFonts(const char *fontname, Int_t /*max*/, Int_t &count)
7285{
7286 char foundry[32], family[100], weight[32], slant[32], font_name[256];
7287 char **fontlist;
7288 Int_t n1, fontcount = 0;
7289
7290 sscanf(fontname, "-%30[^-]-%100[^-]-%30[^-]-%30[^-]-%n",
7291 foundry, family, weight, slant, &n1);
7292 // replace "medium" by "normal"
7293 if(!stricmp(weight,"medium")) {
7294 sprintf(weight,"normal");
7295 }
7296 // since all sizes are allowed with TTF, just forget it...
7297 sprintf(font_name, "-%s-%s-%s-%s-*", foundry, family, weight, slant);
7298 fontlist = gdk_font_list_new(font_name, &fontcount);
7299 count = fontcount;
7300
7301 if (fontcount > 0) return fontlist;
7302 return 0;
7303}
7304
7305////////////////////////////////////////////////////////////////////////////////
7306///
7307
7312
7313////////////////////////////////////////////////////////////////////////////////
7314///
7315
7321
7322////////////////////////////////////////////////////////////////////////////////
7323///
7324
7326{
7327 width = ((GdkImage*)id)->width;
7328 height = ((GdkImage*)id)->height;
7329}
7330
7331////////////////////////////////////////////////////////////////////////////////
7332///
7333
7335{
7336 if (!id) return;
7337
7338 GdkImage *image = (GdkImage *)id;
7339 if (image->depth == 1) {
7340 if (pixel & 1) {
7341 ((UChar_t *) image->mem)[y * image->bpl + (x >> 3)] |= (1 << (7 - (x & 0x7)));
7342 } else {
7343 ((UChar_t *) image->mem)[y * image->bpl + (x >> 3)] &= ~(1 << (7 - (x & 0x7)));
7344 }
7345 } else {
7346 UChar_t *pixelp = (UChar_t *) image->mem + y * image->bpl + x * image->bpp;
7347 // Windows is always LSB, no need to check image->byte_order.
7348 switch (image->bpp) {
7349 case 4:
7350 pixelp[3] = 0;
7351 case 3:
7352 pixelp[2] = ((pixel >> 16) & 0xFF);
7353 case 2:
7354 pixelp[1] = ((pixel >> 8) & 0xFF);
7355 case 1:
7356 pixelp[0] = (pixel & 0xFF);
7357 }
7358 }
7359}
7360
7361////////////////////////////////////////////////////////////////////////////////
7362///
7363
7366{
7367 if (!id) return;
7368
7370 x, y, dx, dy, w, h);
7371 ::GdiFlush();
7372}
7373
7374////////////////////////////////////////////////////////////////////////////////
7375///
7376
7381
7382////////////////////////////////////////////////////////////////////////////////
7383/// Gets DIB bits
7384/// x, y, width, height - position of bitmap
7385/// returns a pointer on bitmap bits array
7386/// in format:
7387/// b1, g1, r1, 0, b2, g2, r2, 0 ... bn, gn, rn, 0 ...
7388///
7389/// Pixels are numbered from left to right and from top to bottom.
7390/// By default all pixels from the whole drawable are returned.
7391
7394{
7395 HDC hdc, memdc;
7398 BITMAP bm;
7399 HBITMAP ximage = 0;
7400 VOID *bmbits = 0;
7401 unsigned char *ret = 0;
7402
7405 oldbitmap1 = ::SelectObject(hdc, GDK_DRAWABLE_XID(wid));
7406 ::GetObject(GDK_DRAWABLE_XID(wid), sizeof(BITMAP), &bm);
7407 } else {
7409 }
7411
7412 bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
7413 bmi.bmiHeader.biWidth = width;
7414 bmi.bmiHeader.biHeight = -1 * (int)(height);
7415 bmi.bmiHeader.biPlanes = 1;
7416 bmi.bmiHeader.biBitCount = 32;
7417 bmi.bmiHeader.biCompression = BI_RGB;
7418 bmi.bmiHeader.biSizeImage = 0;
7419 bmi.bmiHeader.biXPelsPerMeter = bmi.bmiHeader.biYPelsPerMeter = 0;
7420 bmi.bmiHeader.biClrUsed = 0;
7421 bmi.bmiHeader.biClrImportant = 0;
7422
7424
7425 if (ximage && bmbits) {
7426 oldbitmap2 = ::SelectObject(memdc, ximage);
7427 ::BitBlt(memdc, x, y, width, height, hdc, 0, 0, SRCCOPY);
7428 ::SelectObject(memdc, oldbitmap2);
7429 }
7432 ::SelectObject(hdc, oldbitmap1);
7433 ::DeleteDC(hdc);
7434 } else {
7436 }
7437 if (ximage && bmbits) {
7438 ULong_t sz = width*height*4;
7439 ret = new unsigned char[sz];
7440 memcpy(ret, bmbits, sz);
7442 }
7443 return ret;
7444}
7445
7446////////////////////////////////////////////////////////////////////////////////
7447/// create an image from RGB data. RGB data is in format :
7448/// b1, g1, r1, 0, b2, g2, r2, 0 ... bn, gn, rn, 0 ..
7449///
7450/// Pixels are numbered from left to right and from top to bottom.
7451/// Note that data must be 32-bit aligned
7452
7454{
7456 bmp_info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
7457 bmp_info.bmiHeader.biWidth = width;
7458 bmp_info.bmiHeader.biHeight = -1 * (int)(height);
7459 bmp_info.bmiHeader.biPlanes = 1;
7460 bmp_info.bmiHeader.biBitCount = 32;
7461 bmp_info.bmiHeader.biCompression = BI_RGB;
7462 bmp_info.bmiHeader.biSizeImage = 0;
7463 bmp_info.bmiHeader.biClrUsed = 0;
7464 bmp_info.bmiHeader.biXPelsPerMeter = 0L;
7465 bmp_info.bmiHeader.biYPelsPerMeter = 0L;
7466 bmp_info.bmiHeader.biClrImportant = 0;
7467 bmp_info.bmiColors[0].rgbRed = 0;
7468 bmp_info.bmiColors[0].rgbGreen = 0;
7469 bmp_info.bmiColors[0].rgbBlue = 0;
7470 bmp_info.bmiColors[0].rgbReserved = 0;
7471
7472 HDC hdc = ::GetDC(NULL);
7473 HBITMAP hbitmap = ::CreateDIBitmap(hdc, &bmp_info.bmiHeader, CBM_INIT,
7474 (void *)bits, &bmp_info, DIB_RGB_COLORS);
7476
7477 SIZE size;
7478 // For an obscure reason, we have to set the size of the
7479 // bitmap this way before to call gdk_pixmap_foreign_new
7480 // otherwise, it fails...
7482
7484}
7485
7486////////////////////////////////////////////////////////////////////////////////
7487///register pixmap created by TGWin32GLManager
7488
7490{
7491 HBITMAP hBmp = reinterpret_cast<HBITMAP>(pix);
7492 SIZE sz = SIZE();
7493
7495 GdkPixmap *newPix = gdk_pixmap_foreign_new(reinterpret_cast<ULongptr_t>(hBmp));
7496
7498
7499 gCws = fWindows[wid].get();
7500 gCws->ispixmap = 1;
7501 gCws->window = newPix;
7502 gCws->drawing = gCws->window;
7503 gCws->double_buffer = 0;
7504 gCws->clip = 0;
7505 gCws->width = w;
7506 gCws->height = h;
7507
7508 return wid;
7509}
7510
7511////////////////////////////////////////////////////////////////////////////////
7512/// Register a window created by Qt as a ROOT window (like InitWindow()).
7513
7515{
7517
7518 gCws = fWindows[wid].get();
7519
7520 gCws->shared = true;
7521 gCws->ispixmap = 0;
7522
7523 gCws->window = gdk_window_foreign_new(qwid);
7524
7525 gCws->drawing = gCws->window;
7526 gCws->double_buffer = 0;
7527 gCws->clip = 0;
7528 gCws->width = w;
7529 gCws->height = h;
7530
7531 return wid;
7532}
7533
7534////////////////////////////////////////////////////////////////////////////////
7535/// Remove a window created by Qt.
7536
7542
7543////////////////////////////////////////////////////////////////////////////////
7544/// Returns window context for specified win id
7545
7547{
7548 if (fWindows.count(wid) == 0)
7549 return (WinContext_t) nullptr;
7550 return (WinContext_t) fWindows[wid].get();
7551}
7552
7553////////////////////////////////////////////////////////////////////////////////
7554/// The Nonrectangular Window Shape Extension adds nonrectangular
7555/// windows to the System.
7556/// This allows for making shaped (partially transparent) windows
7557
7562
7563////////////////////////////////////////////////////////////////////////////////
7564/// Returns the width of the screen in millimeters.
7565
7567{
7568 return (UInt_t)gdk_screen_width_mm();
7569}
7570
7571//------------------------------ Drag and Drop ---------------------------------
7572
7573////////////////////////////////////////////////////////////////////////////////
7574/// Deletes the specified property on the specified window.
7575
7585
7586////////////////////////////////////////////////////////////////////////////////
7587/// Returns the actual type of the property, the actual format of the property,
7588/// and a pointer to the data actually returned.
7589
7593 unsigned char **prop_list)
7594{
7595 HGLOBAL hdata;
7596 UChar_t *ptr, *data;
7597 UInt_t i, n, length;
7598
7600 if (hWnd == NULL)
7601 return 0;
7602
7603 Atom_t dndproxy = InternAtom("XdndProxy", kFALSE);
7604 Atom_t dndtypelist = InternAtom("XdndTypeList", kFALSE);
7605
7606 if (prop == dndproxy)
7607 return 0;
7608 if (prop == dndtypelist) {
7609 *act_type = XA_ATOM;
7610 *prop_list = (unsigned char *)GetProp(hWnd, (LPCTSTR)MAKELONGLONG(prop,0));
7611 for (n = 0; prop_list[n]; n++);
7612 *nitems = n;
7613 return n;
7614 }
7615 else {
7617 return 0;
7618 }
7620 ptr = (UChar_t *)GlobalLock(hdata);
7622 data = (UChar_t *)malloc(length + 1);
7623 for (i = 0; i < length; i++) {
7624 data[i] = ptr[i];
7625 }
7626 GlobalUnlock(hdata);
7628 *prop_list = data;
7629 *bytes = *nitems = length;
7630 return length;
7631 }
7632 return 0;
7633}
7634
7635////////////////////////////////////////////////////////////////////////////////
7636/// Changes the active cursor of the specified window.
7637
7647
7648////////////////////////////////////////////////////////////////////////////////
7649/// Get Clipboard data.
7650
7653{
7654 HGLOBAL hdata;
7655
7657 RegisterWindowMessage("gdk-selection-notify");
7660 return;
7661 }
7664 if (hdata == 0)
7665 return;
7666 /* Send ourselves an ersatz selection notify message so that we actually
7667 * fetch the data.
7668 */
7670}
7671
7672////////////////////////////////////////////////////////////////////////////////
7673/// Assigns owner of Clipboard.
7674
7676{
7678 RegisterWindowMessage("gdk-selection-request");
7683 if (owner) {
7685 }
7686 return kTRUE;
7687}
7688
7689////////////////////////////////////////////////////////////////////////////////
7690/// Put data into Clipboard.
7691
7694{
7695 HGLOBAL hdata;
7696 Int_t i;
7697 UChar_t *ptr;
7698
7699 if (data == 0 || len == 0)
7700 return;
7702 return;
7703 }
7705 ptr = (UChar_t *)GlobalLock(hdata);
7706 for (i = 0; i < len; i++) {
7707 *ptr++ = *data++;
7708 }
7709 GlobalUnlock(hdata);
7712}
7713
7714////////////////////////////////////////////////////////////////////////////////
7715/// Add the list of drag and drop types to the Window win.
7716
7723
7724////////////////////////////////////////////////////////////////////////////////
7725/// Recursively search in the children of Window for a Window which is at
7726/// location x, y and is DND aware, with a maximum depth of maxd.
7727/// Possibility to exclude dragwin and input.
7728
7730 int x, int y, int maxd)
7731{
7732 POINT point;
7733 POINT cpt;
7734 RECT rect;
7735 HWND hwnd, hwndc;
7736 HWND hwndt;
7738 Atom_t version = 0;
7739 Atom_t dndaware = InternAtom("XdndAware", kFALSE);
7740
7741 cpt.x = x;
7742 cpt.y = y;
7744 cpt, CWP_ALL);
7745 while (hwnd) {
7747 if (PtInRect(&rect, cpt)) {
7750 if (win && win != dragwin && win != input)
7751 return win;
7752 }
7753 Bool_t done = kFALSE;
7754 hwndt = hwnd;
7755 while (!done) {
7756 point = cpt;
7757 ::MapWindowPoints(NULL, hwndt, &point, 1);
7758 hwndc = ChildWindowFromPoint (hwndt, point);
7761 if (win && win != dragwin && win != input)
7762 return win;
7763 }
7764 if (hwndc == NULL)
7765 done = TRUE;
7766 else if (hwndc == hwndt)
7767 done = TRUE;
7768 else
7769 hwndt = hwndc;
7772 if (win && win != dragwin && win != input)
7773 return win;
7774 }
7775 }
7776 }
7778 }
7779 return kNone;
7780}
7781
7782////////////////////////////////////////////////////////////////////////////////
7783/// Checks if Window win is DND aware, and knows any of the DND formats
7784/// passed in argument.
7785
7787{
7788 if (!win) return kFALSE;
7789
7790 Atom_t version = 0;
7791 Atom_t dndaware = InternAtom("XdndAware", kFALSE);
7792 HWND window = (HWND)GDK_DRAWABLE_XID((GdkWindow *)win);
7793 while (window) {
7795 if (version) return kTRUE;
7796 window = ::GetParent(window);
7797 }
7798 return kFALSE;
7799}
7800
7801////////////////////////////////////////////////////////////////////////////////
7802/// Add XdndAware property and the list of drag and drop types to the
7803/// Window win.
7804
7806{
7807 int n;
7808 if (!id) return;
7809
7811 GWL_EXSTYLE);
7814 Atom_t dndaware = InternAtom("XdndAware", kFALSE);
7817 (HANDLE)XDND_PROTOCOL_VERSION);
7818
7819 if (typelist == 0)
7820 return;
7821 for (n = 0; typelist[n]; n++);
7822 Atom_t dndtypelist = InternAtom("XdndTypeList", kFALSE);
7825 (HANDLE)typelist);
7826
7827}
7828
7829////////////////////////////////////////////////////////////////////////////////
7830/// Set user thread id. This is used when an extra thread is created
7831/// to process events.
7832
7834{
7835 if (id == 0) {
7837 }
7838 else {
7840 }
7841}
7842
7843////////////////////////////////////////////////////////////////////////////////
7844/// Set window draw mode
7845
7847{
7848 // set TVirtualX member to support old interface
7849 fDrawMode = mode;
7850
7851 auto ctxt = (XWindow_t *) wctxt;
7852 if (!ctxt)
7853 return;
7854
7855 GdkFunction func = GDK_COPY;
7856 if (mode == kXor)
7857 func = GDK_XOR;
7858 else if (mode == kInvert)
7859 func = GDK_INVERT;
7860
7861 for (int i = 0; i < kMAXGC; i++) {
7862 if (ctxt->fGClist[i])
7863 gdk_gc_set_function(ctxt->fGClist[i], func);
7864 }
7865
7866 ctxt->drawMode = mode;
7867}
7868
7869////////////////////////////////////////////////////////////////////////////////
7870/// Returns window draw mode
7871
7873{
7874 auto ctxt = (XWindow_t *) wctxt;
7875 return ctxt ? ctxt->drawMode : kCopy;
7876}
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:170
#define CALLBACK
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void chupy
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t stamp
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg InternAtom
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t GetWindowSize
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t regb
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t cindex
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t pict_mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest_x
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t cursor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t hmin
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void cmap
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t atom
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t act_type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t pict
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t del
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t hmax
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pixel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmin
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize wid
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void clipboard
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t act_format
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height qwid
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t mgn
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t rect
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t recs
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h prop
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t fontnumber
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t child
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char cname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void curid
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t markerstyle
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void chupx
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text CreatePixmap
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char pxname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void foreground
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char PutPixel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char bitmap
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t nitems
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char forecolor
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h req_type
Option_t Option_t textsize
Option_t Option_t TPoint TPoint angle
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void funcs
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src_y
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t win
Option_t Option_t TPoint xy
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void xpos
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest_y
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t winc
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t modifier
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t org
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char backcolor
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void SetInputFocus
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t npnt
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void SetCursor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t nchar
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char fontname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src_x
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t Atom_t typelist
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void main_id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t grab
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void ypos
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void when
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t bytes
Option_t Option_t TPoint TPoint percent
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t evmask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize fs
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t gval
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t rega
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void reg
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmax
Option_t Option_t TPoint TPoint DrawText
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t property
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pxm
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t hinc
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t confine
Option_t Option_t style
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void gc
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t button
Option_t Option_t TPoint TPoint const char text
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char atom_name
Option_t Option_t TPoint TPoint const char y1
const int kGCpxmp
Definition TGWin32.cxx: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:4321
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:4341
static void _set_event_time(GdkEvent &event, UInt_t time)
Definition TGWin32.cxx:5950
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:4322
static void PutByte(Byte_t b)
Put byte b in output stream.
Definition TGWin32.cxx:4351
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:6578
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:367
R__EXTERN TVirtualX *(* gPtr2VirtualX)()
Definition TVirtualX.h:368
R__EXTERN Atom_t gWM_DELETE_WINDOW
Definition TVirtualX.h:38
R__EXTERN TWin32SplashThread * gSplash
R__EXTERN ULongptr_t gConsoleWindow
segment * segs
Definition X3DBuffer.c:23
#define free
Definition civetweb.c:1578
#define calloc
Definition civetweb.c:1576
#define malloc
Definition civetweb.c:1575
const_iterator begin() const
const_iterator end() const
char ** Argv() const
Fill Area Attributes class.
Definition TAttFill.h:21
virtual Color_t GetFillColor() const
Return the fill area color.
Definition TAttFill.h:32
virtual Style_t GetFillStyle() const
Return the fill area style.
Definition TAttFill.h:33
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:40
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition TAttFill.h:42
Line Attributes class.
Definition TAttLine.h:21
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition TAttLine.h:46
virtual Width_t GetLineWidth() const
Return the line width.
Definition TAttLine.h:38
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition TAttLine.h:47
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition TAttLine.h:44
virtual Style_t GetLineStyle() const
Return the line style.
Definition TAttLine.h:37
Marker Attributes class.
Definition TAttMarker.h:21
virtual Style_t GetMarkerStyle() const
Return the marker style.
Definition TAttMarker.h:34
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition TAttMarker.h:41
virtual Size_t GetMarkerSize() const
Return the marker size.
Definition TAttMarker.h:35
static Width_t GetMarkerLineWidth(Style_t style)
Internal helper function that returns the line width of the given marker style (0 = filled marker)
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Definition TAttMarker.h:43
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition TAttMarker.h:48
static Style_t GetMarkerStyleBase(Style_t style)
Internal helper function that returns the corresponding marker style with line width 1 for the given ...
Text Attributes class.
Definition TAttText.h:21
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition TAttText.h:46
Float_t fTextAngle
Text angle.
Definition TAttText.h:24
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
Definition TAttText.h:48
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Definition TAttText.h:50
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition TAttText.h:51
Float_t fTextSize
Text size.
Definition TAttText.h:25
The color creation and management class.
Definition TColor.h:22
Float_t GetRed() const
Definition TColor.h:61
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition TColor.cxx:1926
Float_t GetBlue() const
Definition TColor.h:63
Float_t GetGreen() const
Definition TColor.h:62
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition TEnv.cxx:503
Bool_t Next(ULong64_t &hash, Long64_t &key, Long64_t &value)
Get next entry from TExMap. Returns kFALSE at end of map.
Definition TExMap.cxx:410
This class stores a (key,value) pair using an external hash.
Definition TExMap.h:33
void Add(ULong64_t hash, Long64_t key, Long64_t value)
Add an (key,value) pair to the table. The key should be unique.
Definition TExMap.cxx:87
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
Definition TExMap.cxx:173
Proxy classes provide thread-safe interface to global objects.
static ULong_t fgPingMessageId
ping message ID
static void GlobalUnlock()
unlock any proxy (client thread)
static UInt_t fMaxResponseTime
max period for waiting response from server thread
static void GlobalLock()
lock any proxy (client thread)
static ULong_t fgUserThreadId
user (e.g. python) thread ID
static ULong_t fgPostMessageId
post message ID
static ULong_t fgMainThreadId
main thread ID
static TVirtualX * fgRealObject
static TVirtualX * ProxyObject()
static TVirtualX * RealObject()
void DrawFillAreaW(WinContext_t wctxt, Int_t n, TPoint *xy) override
Fill area described by polygon in a specified window.
Definition TGWin32.cxx:1716
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:5591
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:6659
void SetDoubleBuffer(Int_t wid, Int_t mode) override
Set the double buffer on/off on window wid.
Definition TGWin32.cxx:3001
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:1277
Int_t GetDoubleBuffer(Int_t wid) override
Query the double buffer value for the window wid.
Definition TGWin32.cxx:1957
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:6825
void MapModifierState(UInt_t &state, UInt_t &xstate, Bool_t tox=kTRUE)
Map modifier key state to or from X.
Definition TGWin32.cxx:5938
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:1332
void SetFillColor(Color_t cindex) override
Set color index for fill areas.
Definition TGWin32.cxx:3083
void DestroyRegion(Region_t reg) override
Destroy region.
Definition TGWin32.cxx:7180
void GetRGB(Int_t index, Float_t &r, Float_t &g, Float_t &b) override
Get rgb values for color "index".
Definition TGWin32.cxx:2027
void SetColor(XWindow_t *ctxt, GdkGC *gc, Int_t ci)
Set the foreground color in GdkGC.
Definition TGWin32.cxx:2927
void DeleteGC(GContext_t gc) override
Explicitely delete a graphics context.
Definition TGWin32.cxx:5583
void ClearWindow() override
Clear current window.
Definition TGWin32.cxx:1530
void MapSetWindowAttributes(SetWindowAttributes_t *attr, ULong_t &xmask, GdkWindowAttr &xattr)
Map a SetWindowAttributes_t to a GdkWindowAttr structure.
Definition TGWin32.cxx:5041
Window_t GetInputFocus() override
Returns the window id of the window having the input focus.
Definition TGWin32.cxx:6851
virtual void GetTextExtent(UInt_t &w, UInt_t &h, char *mess) override
Return the size of a character string.
Definition TGWin32.cxx:2047
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:4057
void SetFillStyle(Style_t style) override
Set fill area style.
Definition TGWin32.cxx:3110
void SetDoubleBufferON() override
Turn double buffer mode on.
Definition TGWin32.cxx:3047
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:7558
void SetOpacity(Int_t percent) override
Set opacity of a current window.
Definition TGWin32.cxx:4047
char ** ListFonts(const char *fontname, Int_t max, Int_t &count) override
Return list of font names matching "fontname".
Definition TGWin32.cxx:7284
void GetFontProperties(FontStruct_t font, Int_t &max_ascent, Int_t &max_descent) override
Return some font properties.
Definition TGWin32.cxx:6739
FontStruct_t LoadQueryFont(const char *font_name) override
Load font and query font.
Definition TGWin32.cxx:5434
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:7692
void SetDrawMode(EDrawMode mode) override
Set the drawing mode.
Definition TGWin32.cxx:3075
void CloseWindow() override
Delete current window.
Definition TGWin32.cxx:1567
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:6998
void RaiseWindow(Window_t id) override
Put window on top of window stack.
Definition TGWin32.cxx:4736
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:5785
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:6793
Int_t InitWindow(ULongptr_t window) override
Open window and return window number.
Definition TGWin32.cxx:2171
void SetTextFont(Font_t fontnumber) override
Set specified font.
Definition TGWin32.cxx:1489
void SetAttLine(WinContext_t wctxt, const TAttLine &att) override
Set line attributes for specified window.
Definition TGWin32.cxx:3274
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:1740
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:1978
void GetPlanes(Int_t &nplanes) override
Get maximum number of planes.
Definition TGWin32.cxx:2019
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:2685
void ChangeWindowAttributes(Window_t id, SetWindowAttributes_t *attr) override
Change window attributes.
Definition TGWin32.cxx:6379
void SetIconPixmap(Window_t id, Pixmap_t pic) override
Set pixmap the WM can use when the window is iconized.
Definition TGWin32.cxx:6571
void UnionRectWithRegion(Rectangle_t *rect, Region_t src, Region_t dest) override
Union of rectangle with a region.
Definition TGWin32.cxx:7188
Int_t RequestLocator(Int_t mode, Int_t ctyp, Int_t &x, Int_t &y) override
Request Locator position.
Definition TGWin32.cxx:2294
void SetClassHints(Window_t id, char *className, char *resourceName) override
Set the windows class and resource name.
Definition TGWin32.cxx:6583
WinContext_t GetWindowContext(Int_t wid) override
Returns window context for specified win id.
Definition TGWin32.cxx:7546
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:6447
void DeleteProperty(Window_t, Atom_t &) override
Deletes the specified property on the specified window.
Definition TGWin32.cxx:7576
Window_t GetParent(Window_t id) const override
Return the parent of the window.
Definition TGWin32.cxx:5422
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:1750
void GetImageSize(Drawable_t id, UInt_t &width, UInt_t &height) override
Returns the width and height of the image id.
Definition TGWin32.cxx:7325
void Update(Int_t mode=0) override
Flush (mode = 0, default) or synchronize (mode = 1) X output buffer.
Definition TGWin32.cxx:7164
TGWin32()
Default constructor.
Definition TGWin32.cxx:773
void SetCharacterUp(Float_t chupx, Float_t chupy) override
Set character up vector.
Definition TGWin32.cxx:2842
void SetOpacityW(WinContext_t wctxt, Int_t percent) override
Set opacity of a specified window.
Definition TGWin32.cxx:4166
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:2915
void SendEvent(Window_t id, Event_t *ev) override
Send event ev to window id.
Definition TGWin32.cxx:5887
Int_t RequestString(Int_t x, Int_t y, char *text) override
Request a string.
Definition TGWin32.cxx:2449
Int_t AddWindowHandle()
Add new window handle Only for private usage.
Definition TGWin32.cxx:2088
void SetUserThreadId(ULong_t id)
Set user thread id.
Definition TGWin32.cxx:7833
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:1359
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:5853
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:6506
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:1675
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:5478
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:4365
Bool_t ReadPictureDataFromFile(const char *filename, char ***ret_data) override
Read picture data from file and store in ret_data.
Definition TGWin32.cxx:5722
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:1639
void UpdateWindowW(WinContext_t wctxt, Int_t mode) override
Update current window mode : (1) update (0) sync.
Definition TGWin32.cxx:4148
void MapSubwindows(Window_t id) override
Maps all subwindows for the specified window "id" in top-to-bottom stacking order.
Definition TGWin32.cxx:4665
void Bell(Int_t percent) override
Sets the sound bell. Percent is loudness from -100% to 100%.
Definition TGWin32.cxx:6356
void SetCursor(Int_t wid, ECursor cursor) override
Set the cursor.
Definition TGWin32.cxx:2969
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:7786
void LowerWindow(Window_t id) override
Lower window so it lays below all its siblings.
Definition TGWin32.cxx:4755
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:4821
void UnmapWindow(Window_t id) override
Unmap window from screen.
Definition TGWin32.cxx:4703
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:6707
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:6634
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:1288
void DestroySubwindows(Window_t id) override
Destroy all internal subwindows.
Definition TGWin32.cxx:4726
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:7392
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:6731
void Sync(Int_t mode) override
Set synchronisation on or off.
Definition TGWin32.cxx:4121
void Warp(Int_t ix, Int_t iy, Window_t id=0) override
Set pointer position.
Definition TGWin32.cxx:4280
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:4304
void MapEventMask(UInt_t &emask, UInt_t &xemask, Bool_t tox=kTRUE)
Map event mask to or from gdk.
Definition TGWin32.cxx:4962
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:6751
void SetMarkerSize(Float_t markersize) override
Set marker size index.
Definition TGWin32.cxx:3350
Window_t GetWindowID(Int_t wid) override
Return the X11 window identifier.
Definition TGWin32.cxx:2058
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:7729
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:7239
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:5994
void IconifyWindow(Window_t id) override
Iconify the window.
Definition TGWin32.cxx:4809
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:5638
void FreeFontStruct(FontStruct_t fs) override
Free font structure returned by GetFontStruct().
Definition TGWin32.cxx:6773
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:4259
Bool_t EqualRegion(Region_t rega, Region_t regb) override
Returns true if two regions are equal.
Definition TGWin32.cxx:7263
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:6803
FontStruct_t GetFontStruct(FontH_t fh) override
Retrieve associated font structure once we have the font handle.
Definition TGWin32.cxx:6765
void GetCharacterUp(Float_t &chupx, Float_t &chupy) override
Return character up vector.
Definition TGWin32.cxx:1908
void DrawString(Drawable_t id, GContext_t gc, Int_t x, Int_t y, const char *s, Int_t len) override
Draw a string using a specific graphics context in position (x,y).
Definition TGWin32.cxx:6717
void SetAttText(WinContext_t wctxt, const TAttText &att) override
Set text attributes for speicfied window.
Definition TGWin32.cxx:3971
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:7255
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:7053
void SetWMState(Window_t id, EInitialState state) override
Set the initial state of the window. Either kNormalState or kIconicState.
Definition TGWin32.cxx:6684
void DrawPolyLineW(WinContext_t wctxt, Int_t n, TPoint *xy) override
Draw a line through all points in specified window.
Definition TGWin32.cxx:1779
void DeleteFont(FontStruct_t fs) override
Explicitely delete font structure obtained with LoadQueryFont().
Definition TGWin32.cxx:5469
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:6531
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:1382
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:6899
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:7202
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:5074
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:7140
void SetTextColor(Color_t cindex) override
Set color index for text.
Definition TGWin32.cxx:4107
void SetWindowName(Window_t id, char *name) override
Set window name.
Definition TGWin32.cxx:6551
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:4857
void ChangeActivePointerGrab(Window_t, UInt_t, Cursor_t) override
Changes the active cursor of the specified window.
Definition TGWin32.cxx:7638
void MoveWindow(Int_t wid, Int_t x, Int_t y) override
Move the window wid.
Definition TGWin32.cxx:2070
void WMDeleteNotify(Window_t id) override
Tell WM to send message when window is closed via WM.
Definition TGWin32.cxx:6457
Style_t GetLineStyle() const override
Return current line style.
Definition TGWin32.cxx:3240
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:7125
void DestroyWindow(Window_t id) override
Destroy window.
Definition TGWin32.cxx:4713
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:7590
Int_t EventsPending() override
Returns number of pending events.
Definition TGWin32.cxx:5901
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:6881
void SetLineStyle(Style_t linestyle) override
Set line style.
Definition TGWin32.cxx:3227
void FreeColor(Colormap_t cmap, ULong_t pixel) override
Free color cell with specified pixel value.
Definition TGWin32.cxx:5843
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:6622
void QueryColor(Colormap_t cmap, ColorStruct_t &color) override
Fill in the primary color components for a specific pixel value.
Definition TGWin32.cxx:5825
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:7221
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:6913
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:4781
void SetAttFill(WinContext_t wctxt, const TAttFill &att) override
Set fill attributes for specified window.
Definition TGWin32.cxx:3133
Bool_t EmptyRegion(Region_t reg) override
Return true if the region is empty.
Definition TGWin32.cxx:7247
void MapColorStruct(ColorStruct_t *color, GdkColor &xcolor)
Map a ColorStruct_t to a XColor structure.
Definition TGWin32.cxx:5770
Int_t ResizePixmap(Int_t wid, UInt_t w, UInt_t h) override
Resize a pixmap.
Definition TGWin32.cxx:2724
void SetWMSize(Window_t id, UInt_t w, UInt_t h) override
Tells window manager the desired size of window "id".
Definition TGWin32.cxx:6648
static void Lock()
Definition TGWin32.cxx:882
void ClosePixmap() override
Delete current pixmap.
Definition TGWin32.cxx:1559
Handle_t fXEvent
Current native (GDK) event.
Definition TGWin32.h:118
void RemovePixmap(GdkDrawable *pix)
Remove the pixmap pix.
Definition TGWin32.cxx:2263
void SelectWindow(Int_t wid) override
Select window to which subsequent output is directed.
Definition TGWin32.cxx:2816
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:3219
void SetTextAlign(Short_t talign=11) override
Set text alignment.
Definition TGWin32.cxx:4094
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:6424
Region_t CreateRegion() override
Create a new empty region.
Definition TGWin32.cxx:7172
const char * DisplayName(const char *dpyName=0) override
Return hostname on which the display is opened.
Definition TGWin32.cxx:2011
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:4485
void SetTextSize(Float_t textsize) override
Set current text size.
Definition TGWin32.cxx:1517
void DrawPolyMarker(Int_t n, TPoint *xy) override
Draw n markers with the current attributes at position x, y.
Definition TGWin32.cxx:1833
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:5384
void DrawBox(Int_t x1, Int_t y1, Int_t x2, Int_t y2, EBoxMode mode) override
Draw a box.
Definition TGWin32.cxx:1629
GdkGC * GetGC(Int_t which) const
Return desired Graphics Context ("which" maps directly on gGCList[]).
Definition TGWin32.cxx:1940
void ChangeGC(GContext_t gc, GCValues_t *gval) override
Change entries in an existing graphics context, gc, by values from gval.
Definition TGWin32.cxx:5497
void SetMarkerColor(Color_t cindex) override
Set color index for markers.
Definition TGWin32.cxx:3334
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:6487
void SubtractRegion(Region_t rega, Region_t regb, Region_t result) override
Subtract rega from regb.
Definition TGWin32.cxx:7230
XColor_t & GetColor(Int_t cid)
Return reference to internal color structure associated to color index cid.
Definition TGWin32.cxx:1918
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:1821
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:6814
void SetDashes(GContext_t gc, Int_t offset, const char *dash_list, Int_t n) override
Specify a dash pattertn.
Definition TGWin32.cxx:5752
void DeletePixmap(Pixmap_t pmap) override
Explicitely delete pixmap resource.
Definition TGWin32.cxx:5652
void FreeFontNames(char **fontlist) override
Frees the specified the array of strings "fontlist".
Definition TGWin32.cxx:7308
void MapWindow(Window_t id) override
Map window on screen.
Definition TGWin32.cxx:4650
Int_t WriteGIF(char *name) override
Writes the current window into GIF file.
Definition TGWin32.cxx:4422
void DeleteImage(Drawable_t img) override
Deallocates the memory associated with the image img.
Definition TGWin32.cxx:7377
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:7334
void ConvertSelection(Window_t, Atom_t &, Atom_t &, Atom_t &, Time_t &) override
Get Clipboard data.
Definition TGWin32.cxx:7651
void SetIconName(Window_t id, char *name) override
Set window icon name.
Definition TGWin32.cxx:6561
Bool_t SetSelectionOwner(Window_t, Atom_t &) override
Assigns owner of Clipboard.
Definition TGWin32.cxx:7675
Window_t GetPrimarySelectionOwner() override
Returns the window id of the current owner of the primary selection.
Definition TGWin32.cxx:6872
Width_t GetLineWidth() const override
Return current line width.
Definition TGWin32.cxx:3264
void SetMarkerStyle(Style_t markerstyle) override
Set marker style.
Definition TGWin32.cxx:3366
void DeletePictureData(void *data) override
Delete picture data created by the function ReadPictureDataFromFile.
Definition TGWin32.cxx:5742
void DrawFillArea(Int_t n, TPoint *xy) override
Fill area described by polygon.
Definition TGWin32.cxx:1706
void GetWindowAttributes(Window_t id, WindowAttributes_t &attr) override
Get window attributes and return filled in attributes structure.
Definition TGWin32.cxx:5343
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:7029
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:7717
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:5696
Int_t OpenPixmap(UInt_t w, UInt_t h) override
Open a new pixmap.
Definition TGWin32.cxx:2133
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:4567
Pixmap_t CreatePixmapFromData(unsigned char *bits, UInt_t width, UInt_t height) override
create an image from RGB data.
Definition TGWin32.cxx:7453
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:5919
void MapKeySym(UInt_t &keysym, UInt_t &xkeysym, Bool_t tox=kTRUE)
Map to and from X key symbols.
Definition TGWin32.cxx:6926
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:3382
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:2871
void SetLineWidth(Width_t width) override
Set line width.
Definition TGWin32.cxx:3251
void SetInputFocus(Window_t id) override
Set keyboard input focus to window id.
Definition TGWin32.cxx:6860
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:1619
Window_t GetCurrentWindow() const override
Return current window pointer. Protected method used by TGWin32TTF.
Definition TGWin32.cxx:1931
void MapRaised(Window_t id) override
Map window on screen and put on top of all windows.
Definition TGWin32.cxx:4676
Style_t GetFillStyle() const override
Return current fill style.
Definition TGWin32.cxx:3123
void ClearWindowW(WinContext_t wctxt) override
Clear specified window.
Definition TGWin32.cxx:1538
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:6366
void SelectInput(Window_t id, UInt_t evmask) override
Defines which input events the window is interested in.
Definition TGWin32.cxx:6839
Atom_t InternAtom(const char *atom_name, Bool_t only_if_exist) override
Return atom handle for atom_name.
Definition TGWin32.cxx:5402
void ResizeWindow(Int_t wid) override
Resize the current window if necessary.
Definition TGWin32.cxx:2770
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:7805
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:7212
void SetWindowBackgroundPixmap(Window_t id, Pixmap_t pxm) override
Set pixmap as window background.
Definition TGWin32.cxx:4847
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:2888
Color_t GetFillColor() const override
Return current fill color.
Definition TGWin32.cxx:3098
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:6966
void SetKeyAutoRepeat(Bool_t on=kTRUE) override
Turn key auto repeat on or off.
Definition TGWin32.cxx:6472
void DrawPolyLine(Int_t n, TPoint *xy) override
Draw a line through all points.
Definition TGWin32.cxx:1769
void CopyGC(GContext_t org, GContext_t dest, Mask_t mask) override
Copies graphics context from org to dest.
Definition TGWin32.cxx:5563
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:3197
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:2249
void SetDrawModeW(WinContext_t wctxt, EDrawMode mode) override
Set window draw mode.
Definition TGWin32.cxx:7846
void UpdateWindow(Int_t mode) override
Update display.
Definition TGWin32.cxx:4134
void GetRegionBox(Region_t reg, Rectangle_t *) override
Return smallest enclosing rectangle.
Definition TGWin32.cxx:7271
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:7514
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:5662
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:1843
Bool_t fUseSysPointers
True when using system mouse pointers.
Definition TGWin32.h:107
void SetDoubleBufferOFF() override
Turn double buffer mode off.
Definition TGWin32.cxx:3037
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:7566
Int_t AddPixmap(ULongptr_t pix, UInt_t w, UInt_t h) override
register pixmap created by TGWin32GLManager
Definition TGWin32.cxx:7489
Window_t GetDefaultRootWindow() const override
Return handle to the default root window created when calling XOpenDisplay().
Definition TGWin32.cxx:5414
Int_t GetDepth() const override
Get maximum number of planes.
Definition TGWin32.cxx:5392
void SetWindowBackground(Window_t id, ULong_t color) override
Set the window background color.
Definition TGWin32.cxx:4831
FontH_t GetFontHandle(FontStruct_t fs) override
Return handle to font described by font structure.
Definition TGWin32.cxx:5458
EDrawMode GetDrawModeW(WinContext_t wctxt) override
Returns window draw mode.
Definition TGWin32.cxx:7872
void SetInput(Int_t inp)
Set input on or off.
Definition TGWin32.cxx:3189
void RemoveWindow(ULongptr_t qwid) override
Remove a window created by Qt.
Definition TGWin32.cxx:7537
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:7316
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:5600
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:173
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:149
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:1081
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1095
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition TObject.cxx:1123
SCoord_t fY
Definition TPoint.h:36
SCoord_t fX
Definition TPoint.h:35
Basic string class.
Definition TString.h:138
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:641
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
Definition TStyle.cxx:1167
void Beep(Int_t freq=-1, Int_t duration=-1, Bool_t setDefault=kFALSE)
Beep for duration milliseconds with a tone of frequency freq.
Definition TSystem.cxx:322
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
Definition TSystem.cxx:469
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition TSystem.cxx:944
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition TSystem.cxx:414
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
Definition TSystem.cxx:479
TTF helper class containing glyphs description.
Definition TTF.h:65
static Bool_t IsInitialized()
Definition TTF.cxx:614
static void PrepareString(const char *string)
Put the characters in "string" in the "glyphs" array.
Definition TTF.cxx:271
static void Init()
Initialise the TrueType fonts interface.
Definition TTF.cxx:64
static void LayoutGlyphs()
Compute the glyphs positions, fgAscent and fgWidth (needed for alignment).
Definition TTF.cxx:202
static void SetSmoothing(Bool_t state)
Set smoothing (anti-aliasing) flag.
Definition TTF.cxx:370
static void SetRotationMatrix(Float_t angle)
Set the rotation matrix used to rotate the font outlines.
Definition TTF.cxx:347
static void SetTextFont(Font_t fontnumber)
Set specified font.
Definition TTF.cxx:495
static Int_t GetAscent()
Definition TTF.cxx:628
static void GetTextExtent(UInt_t &w, UInt_t &h, char *text)
Get width (w) and height (h) when text is horizontal.
Definition TTF.cxx:153
static TTGlyph * GetGlyphs()
Definition TTF.cxx:663
static Int_t GetNumGlyphs()
Definition TTF.cxx:635
static Int_t GetWidth()
Definition TTF.cxx:621
static const FT_BBox & GetBox()
Definition TTF.cxx:656
static Bool_t GetSmoothing()
Definition TTF.cxx:607
static void SetTextSize(Float_t textsize)
Set current text size.
Definition TTF.cxx:566
static FT_Matrix * GetRotMatrix()
Definition TTF.cxx:642
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51
Semi-Abstract base class defining a generic interface to the underlying, low level,...
Definition TVirtualX.h:46
EDrawMode fDrawMode
Definition TVirtualX.h:55
Class providing an interface to the Windows NT Operating System.
TPaveText * pt
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
#define G(x, y, z)
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
Definition TMath.h:643
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Definition TMathBase.h:249
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
Definition TMath.h:691
Double_t Sqrt(Double_t x)
Returns the square root of x.
Definition TMath.h:673
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Definition TMathBase.h:197
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:122
ULong_t fPixel
color pixel value (index in color table)
Definition GuiTypes.h:312
UShort_t fRed
red component (0..65535)
Definition GuiTypes.h:313
UShort_t fGreen
green component (0..65535)
Definition GuiTypes.h:314
UShort_t fBlue
blue component (0..65535)
Definition GuiTypes.h:315
Event structure.
Definition GuiTypes.h:175
UInt_t fCode
key or button code
Definition GuiTypes.h:181
Graphics context structure.
Definition GuiTypes.h:225
Point structure (maps to the X11 XPoint structure)
Definition GuiTypes.h:357
Rectangle structure (maps to the X11 XRectangle structure)
Definition GuiTypes.h:362
Used for drawing line segments (maps to the X11 XSegments structure)
Definition GuiTypes.h:352
Attributes that can be used when creating or changing a window.
Definition GuiTypes.h:94
Window attributes that can be inquired.
Definition GuiTypes.h:115
Description of a X11 color.
Definition TGWin32.h:60
Bool_t fDefined
true if pixel value is defined
Definition TGWin32.h:62
GdkColor color
Definition TGWin32.h:61
Description of a X11 window.
Definition TGWin32.cxx: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