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