52#include <X11/cursorfont.h>
53#include <X11/keysym.h>
162 EnterWindowMask | LeaveWindowMask |
163 PointerMotionMask | KeyPressMask |
166 EnterWindowMask | LeaveWindowMask;
1720x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1730x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1740x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
361 for (
Int_t i = 0; i < ncolors; i++) {
371 color[i].flags = DoRed | DoGreen | DoBlue;
394 if (!ctxt->fIsPixmap && !ctxt->fDoubleBuffer) {
395 XSetWindowBackground((Display*)
fDisplay, ctxt->fDrawing,
GetColor(0).fPixel);
396 XClearWindow((Display*)
fDisplay, ctxt->fDrawing);
400 XFillRectangle((Display*)
fDisplay, ctxt->fDrawing, ctxt->fGClist[
kGCpxmp],
401 0, 0, ctxt->fWidth, ctxt->fHeight);
437 for (
int i = 0; i <
kMAXGC; ++i)
448 if (iter->second.get() ==
gCws) {
455 Fatal(
"CloseWindow",
"Not found gCws in list of windows");
459 if (iter->second && iter->second->fOpen) {
460 gCws = iter->second.get();
528 int i, j, icol, ix, iy,
w,
h, current_icol;
535 for (i = 0; i < nx; i++) {
537 for (j = 0; j < ny; j++) {
539 if (icol != current_icol) {
572 if (ctxt->fillHollow)
573 XDrawLines((Display*)
fDisplay, ctxt->fDrawing, ctxt->fGClist[
kGCfill], xyp,
n, CoordModeOrigin);
576 XFillPolygon((Display*)
fDisplay, ctxt->fDrawing, ctxt->fGClist[
kGCfill],
577 xyp,
n, Nonconvex, CoordModeOrigin);
602 if (ctxt->lineStyle == LineSolid)
605 XSetDashes((Display*)
fDisplay, ctxt->fGClist[
kGCdash], ctxt->dashOffset, ctxt->dashList.data(), ctxt->dashList.size());
632 const Int_t kMaxPoints = 1000001;
634 if (
n > kMaxPoints) {
636 int iend = kMaxPoints - 1;
640 iend += kMaxPoints - 1;
647 if (ctxt->lineStyle == LineSolid)
648 XDrawLines((Display*)
fDisplay, ctxt->fDrawing, ctxt->fGClist[
kGCline], xyp,
n, CoordModeOrigin);
650 XSetDashes((Display*)
fDisplay, ctxt->fGClist[
kGCdash], ctxt->dashOffset, ctxt->dashList.data(), ctxt->dashList.size());
651 XDrawLines((Display*)
fDisplay, ctxt->fDrawing, ctxt->fGClist[
kGCdash], xyp,
n, CoordModeOrigin);
654 for (
int i = 1; i <
n; i++) {
655 int dx = xyp[i].x - xyp[i-1].x;
656 int dy = xyp[i].y - xyp[i-1].y;
657 if (dx < 0) dx = - dx;
658 if (dy < 0) dy = - dy;
659 ctxt->dashOffset += dx > dy ? dx : dy;
661 ctxt->dashOffset %= ctxt->dashLength;
666 XDrawPoint((Display*)
fDisplay, ctxt->fDrawing,
667 ctxt->lineStyle == LineSolid ? ctxt->fGClist[
kGCline] : ctxt->fGClist[
kGCdash], px, py);
692 const Int_t kMaxSegments = 500000;
693 if (
n > kMaxSegments) {
695 Int_t iend = kMaxSegments;
702 if (ctxt->lineStyle == LineSolid)
703 XDrawSegments((Display*)
fDisplay, ctxt->fDrawing, ctxt->fGClist[
kGCline], (XSegment *)
xy,
n);
705 XSetDashes((Display*)
fDisplay, ctxt->fGClist[
kGCdash], ctxt->dashOffset, ctxt->dashList.data(), ctxt->dashList.size());
706 XDrawSegments((Display*)
fDisplay, ctxt->fDrawing, ctxt->fGClist[
kGCdash], (XSegment *)
xy,
n);
735 const int kNMAX = 1000000;
737 for (
int it = 0; it <= nt; it++) {
745 int r = ctxt->markerSize / 2;
746 auto &shape = ctxt->markerShape;
748 for (
int m = 0;
m <
n;
m++) {
749 for (
auto &pnt : shape) {
753 switch(ctxt->markerType) {
760 xyp[
m].x -
r, xyp[
m].y -
r, ctxt->markerSize, ctxt->markerSize, 0, 360*64);
765 xyp[
m].x -
r, xyp[
m].y -
r, ctxt->markerSize, ctxt->markerSize, 0, 360*64);
770 (
XPoint *) shape.data(), shape.size(), CoordModeOrigin);
774 XFillPolygon((Display*)
fDisplay, ctxt->fDrawing, ctxt->fGClist[
kGCmark],
775 (
XPoint *) shape.data(), shape.size(), Nonconvex, CoordModeOrigin);
779 XDrawSegments((Display*)
fDisplay, ctxt->fDrawing, ctxt->fGClist[
kGCmark],
780 (XSegment *) shape.data(), shape.size()/2);
784 for (std::size_t t = 0; t < shape.size(); t += 3) {
785 XFillPolygon((Display*)
fDisplay, ctxt->fDrawing, ctxt->fGClist[
kGCmark],
786 (
XPoint *) shape.data() + t, 3, Nonconvex, CoordModeOrigin);
790 for (
auto &pnt : shape) {
849 if (!
text || !ctxt->textFont || ctxt->fAttText.GetTextSize() < 0)
852 XRotSetMagnification(
mgn);
857 XRotDrawAlignedString((Display*)
fDisplay, ctxt->textFont,
angle,
858 ctxt->fDrawing, ctxt->fGClist[
kGCtext],
x,
y, (
char*)
text, ctxt->textAlign);
862 XRotDrawAlignedImageString((Display*)
fDisplay, ctxt->textFont,
angle,
863 ctxt->fDrawing, ctxt->fGClist[
kGCtext],
x,
y, (
char*)
text, ctxt->textAlign);
881 if (((vis->c_class != TrueColor && vis->c_class != DirectColor) ||
887 {
nullptr, 0 , 0 , 24 , TrueColor , 0 , 0 , 0 , 0 , 0 },
888 {
nullptr, 0 , 0 , 32 , TrueColor , 0 , 0 , 0 , 0 , 0 },
889 {
nullptr, 0 , 0 , 16 , TrueColor , 0 , 0 , 0 , 0 , 0 },
890 {
nullptr, 0 , 0 , 15 , TrueColor , 0 , 0 , 0 , 0 , 0 },
892 {
nullptr, 0 , 0 , 24 , DirectColor, 0 , 0 , 0 , 0 , 0 },
893 {
nullptr, 0 , 0 , 32 , DirectColor, 0 , 0 , 0 , 0 , 0 },
894 {
nullptr, 0 , 0 , 16 , DirectColor, 0 , 0 , 0 , 0 , 0 },
895 {
nullptr, 0 , 0 , 15 , DirectColor, 0 , 0 , 0 , 0 , 0 },
896 {
nullptr, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 },
901 for (
Int_t i = 0; templates[i].depth != 0; i++) {
902 Int_t mask = VisualScreenMask|VisualDepthMask|VisualClassMask;
926 Printf(
"Selected visual 0x%lx: depth %d, class %d, colormap: %s",
946 Int_t (*oldErrorHandler)(Display *, XErrorEvent *) =
963 attr.colormap = XCreateColormap((Display*)
fDisplay, root, vlist[i].visual, AllocNone);
966 static XColor black_xcol = { 0, 0x0000, 0x0000, 0x0000, DoRed|DoGreen|DoBlue, 0 };
967 static XColor white_xcol = { 0, 0xFFFF, 0xFFFF, 0xFFFF, DoRed|DoGreen|DoBlue, 0 };
968 XAllocColor((Display*)
fDisplay,
attr.colormap, &black_xcol);
969 XAllocColor((Display*)
fDisplay,
attr.colormap, &white_xcol);
970 attr.border_pixel = black_xcol.pixel;
971 attr.override_redirect = True;
973 w = XCreateWindow((Display*)
fDisplay, root, -20, -20, 10, 10, 0, vlist[i].depth,
974 CopyFromParent, vlist[i].visual,
975 CWColormap|CWBorderPixel|CWOverrideRedirect, &
attr);
976 if (
w != None && XGetGeometry((Display*)
fDisplay,
w, &wjunk, &junk, &junk,
989 XSetErrorHandler(oldErrorHandler);
1029 if (which >=
kMAXGC || which < 0) {
1030 Error(
"GetGC",
"trying to get illegal GC (which = %d)", which);
1034 Error(
"GetGC",
"No current window selected");
1047 return (
Window_t) (ctxt ? ctxt->fDrawing : 0);
1058 Error(
"GetGC",
"No window context specified");
1062 if (which >=
kMAXGC || which < 0) {
1063 Error(
"GetGC",
"trying to get illegal GC (which = %d)", which);
1066 return &ctxt->fGClist[which];
1076 return ctxt->fAttText;
1112 unsigned int border, depth;
1119 0, 0, &
x, &
y, &junkwin);
1138 return XDisplayName(dpyName);
1171 }
else if (
index == 1) {
1191 if (!mess || !*mess)
1262 Pixmap pixmp1, pixmp2;
1282 strlcpy(vendor, XServerVendor((Display*)
fDisplay),132);
1288 if (strstr(vendor,
"Hewlett"))
1289 echov.function = GXxor;
1291 echov.function = GXinvert;
1294 GCForeground | GCBackground | GCFunction,
1298 static int isdisp = 0;
1301 gFont[i].id =
nullptr;
1304 fontlist = XListFonts((Display*)
fDisplay,
"*courier*", 1, &fontcount);
1305 if (fontlist && fontcount != 0) {
1310 XFreeFontNames(fontlist);
1313 fontlist = XListFonts((Display*)
fDisplay,
"fixed", 1, &fontcount);
1314 if (fontlist && fontcount != 0) {
1319 XFreeFontNames(fontlist);
1321 Warning(
"OpenDisplay",
"no default font loaded");
1358 if (
fVisual->c_class == TrueColor) {
1362 if ((
fVisual->blue_mask >> i) == 1) {
1370 if ((
fVisual->green_mask >> i) == 1) {
1378 if ((
fVisual->red_mask >> i) == 1) {
1399 if (!pair.second->fOpen) {
1400 pair.second->fOpen = 1;
1403 if (pair.first > maxid)
1407 if (
fWindows.size() == (size_t) maxid) {
1411 for (
int id = 1;
id < maxid;
id++) {
1418 fWindows.emplace(maxid, std::make_unique<XWindow_t>());
1427 if (XGetGCValues((Display*)
fDisplay, ctxt->fGClist[
kGCtext], GCForeground|GCBackground, &values)) {
1428 XSetForeground((Display*)
fDisplay, ctxt->fGClist[
kGCinvt], values.background);
1429 XSetBackground((Display*)
fDisplay, ctxt->fGClist[
kGCinvt], values.foreground);
1431 Error(
"AddWindowHandle",
"cannot get GC values");
1437 XSetGraphicsExposures((Display*)
fDisplay, ctxt->fGClist[
kGCpxmp], False);
1452 unsigned int wval, hval;
1454 unsigned int ww, hh, border, depth;
1463 XGetGeometry((Display*)
fDisplay,
gCws->
fWindow, &root, &xx, &yy, &ww, &hh, &border, &depth);
1465 for (
int i = 0; i <
kMAXGC; i++)
1495 unsigned int wval, hval, border, depth;
1500 XGetGeometry((Display*)
fDisplay, wind, &root, &xval, &yval, &wval, &hval, &border, &depth);
1511 attr_mask |= CWBackPixel;
1513 attr_mask |= CWBorderPixel;
1514 attributes.event_mask = NoEventMask;
1515 attr_mask |= CWEventMask;
1516 attributes.backing_store = Always;
1517 attr_mask |= CWBackingStore;
1518 attributes.bit_gravity = NorthWestGravity;
1519 attr_mask |= CWBitGravity;
1522 attr_mask |= CWColormap;
1526 xval, yval, wval, hval, 0,
fDepth,
1528 attr_mask, &attributes);
1591 Window root_return, child_return;
1592 int win_x_return, win_y_return;
1593 int root_x_return, root_y_return;
1594 unsigned int mask_return;
1597 &child_return, &root_x_return, &root_y_return, &win_x_return,
1598 &win_y_return, &mask_return);
1635 static int xloc = 0;
1636 static int yloc = 0;
1637 static int xlocp = 0;
1638 static int ylocp = 0;
1660 while (button_press == 0) {
1676 (yloc-ylocp)*(yloc-ylocp)));
1678 xlocp-radius, ylocp-radius,
1679 2*radius, 2*radius, 0, 23040);
1684 xlocp, ylocp, xloc, yloc);
1697 while (XEventsQueued( (Display*)
fDisplay, QueuedAlready) > 1) {
1716 (yloc-ylocp)*(yloc-ylocp)));
1718 xlocp-radius, ylocp-radius,
1719 2*radius, 2*radius, 0, 23040);
1724 xlocp, ylocp, xloc, yloc);
1737 xloc =
event.xbutton.x;
1738 yloc =
event.xbutton.y;
1740 switch (
event.type) {
1746 if (
event.type == EnterNotify)
break;
1754 button_press =
event.xbutton.button ;
1755 xlocp =
event.xbutton.x;
1756 ylocp =
event.xbutton.y;
1761 case ButtonRelease :
1763 button_press = 10+
event.xbutton.button ;
1764 xlocp =
event.xbutton.x;
1765 ylocp =
event.xbutton.y;
1771 button_press =
event.xkey.keycode;
1772 xlocp =
event.xbutton.x;
1773 ylocp =
event.xbutton.y;
1779 button_press = -
event.xkey.keycode;
1780 xlocp =
event.xbutton.x;
1781 ylocp =
event.xbutton.y;
1790 if (button_press == 0)
1795 x =
event.xbutton.x;
1796 y =
event.xbutton.y;
1798 return button_press;
1820 int len_text = strlen(
text);
1826 XKeyboardState kbstate;
1827 cursor = XCreateFontCursor((Display*)
fDisplay, XC_question_arrow);
1828 XGetKeyboardControl((Display*)
fDisplay, &kbstate);
1829 percent = kbstate.bell_percent;
1833 for (nt = len_text; nt > 0 &&
text[nt-1] ==
' '; nt--) { }
1835 XGetInputFocus((Display*)
fDisplay, &focuswindow, &focusrevert);
1847 x + dx,
y,
pt < len_text ? &
text[
pt] :
" ", 1);
1849 switch (
event.type) {
1855 XSetInputFocus((Display*)
fDisplay, focuswindow, focusrevert, CurrentTime);
1858 nbytes = XLookupString(&
event.xkey, keybuf,
sizeof(keybuf),
1871 if (isascii(keybuf[0]) && isprint(keybuf[0])) {
1875 for (i = nt - 1; i >
pt; i--)
1877 if (
pt < len_text) {
1882 switch (keybuf[0]) {
1889 for (i =
pt; i < nt; i++)
1908 for (i =
pt; i < nt; i++)
1926 for (i =
pt; i < nt; i++)
1952 XSetInputFocus((Display*)
fDisplay, focuswindow, focusrevert, CurrentTime);
1985 for (
int i = 0; i <
kMAXGC; i++)
2006 unsigned int wval, hval;
2008 unsigned int ww, hh, border, depth;
2027 XGetGeometry((Display*)
fDisplay,
gTws->
fWindow, &root, &xx, &yy, &ww, &hh, &border, &depth);
2029 for (i = 0; i <
kMAXGC; i++)
2051 unsigned int wval=0, hval=0, border=0, depth=0;
2058 &xval, &yval, &wval, &hval, &border, &depth);
2059 if (wval >= 65500) wval = 1;
2060 if (hval >= 65500) hval = 1;
2072 for (
int i = 0; i <
kMAXGC; i++)
2103 for (
int i = 0; i <
kMAXGC; i++)
2106 for (
int i = 0; i <
kMAXGC; i++)
2140 for (
int i = 0; i <
kMAXGC; i++)
2165 for (
int i = 0; i <
kMAXGC; i++)
2184 }
else if (!
fColormap && (ci < 0 || ci > 1)) {
2190 XGetGCValues((Display*)
fDisplay,
gc, GCBackground, &values);
2197 XGetGCValues((Display*)
fDisplay,
gc, GCForeground | GCBackground, &values);
2198 if (values.foreground == values.background)
2225 gTws = pair.second.get();
2276 for (
int i = 0; i <
kMAXGC; i++)
2359 attr_mask = CWEventMask;
2362 attributes.event_mask = NoEventMask;
2363 attr_mask = CWEventMask;
2396 Warning(
"SetLineType",
"DEPRECATED, use SetAttLine() instead");
2515 xcol.flags = DoRed | DoGreen | DoBlue;
2519 if (col.
fRed == xcol.red && col.
fGreen == xcol.green &&
2520 col.
fBlue == xcol.blue)
2529 col.
fRed = xcol.red;
2531 col.
fBlue = xcol.blue;
2583 for (
int i = 0; i <
kMAXFONT; i++) {
2598 if (fontlist && fontcount != 0) {
2608 XFreeFontNames(fontlist);
2653 XSynchronize((Display*)
fDisplay,1);
2657 XSynchronize((Display*)
fDisplay,0);
2691 if (ctxt->fDoubleBuffer) {
2692 XCopyArea((Display*)
fDisplay, ctxt->fDrawing, ctxt->fWindow,
2693 ctxt->fGClist[
kGCpxmp], 0, 0, ctxt->fWidth, ctxt->fHeight, 0, 0);
2717 XImage *image = XGetImage((Display*)
fDisplay, ctxt->fDrawing, 0, 0, ctxt->fWidth,
2718 ctxt->fHeight, AllPlanes, ZPixmap);
2722 std::vector<ULong_t> orgcolors;
2723 for (
UInt_t y = 0;
y < ctxt->fHeight;
y++) {
2724 for (
UInt_t x = 0;
x < ctxt->fWidth;
x++) {
2726 if (std::find(orgcolors.begin(), orgcolors.end(),
pixel) == orgcolors.end())
2727 orgcolors.emplace_back(
pixel);
2730 if (orgcolors.empty()) {
2731 XDestroyImage(image);
2736 if (!ctxt->fNewColors.empty()) {
2738 XFreeColors((Display*)
fDisplay,
fColormap, ctxt->fNewColors.data(), ctxt->fNewColors.size(), 0);
2739 ctxt->fNewColors.clear();
2742 std::vector<RXColor> xcol(orgcolors.size());
2744 for (std::size_t i = 0; i < orgcolors.size(); i++) {
2745 xcol[i].pixel = orgcolors[i];
2746 xcol[i].red = xcol[i].green = xcol[i].blue = 0;
2747 xcol[i].flags = DoRed | DoGreen | DoBlue;
2754 for (std::size_t i = 0; i < orgcolors.size(); i++) {
2759 Warning(
"SetOpacityW",
"failed to allocate color %hd, %hd, %hd",
2760 xcol[i].red, xcol[i].green, xcol[i].blue);
2764 ctxt->fNewColors.resize(orgcolors.size());
2766 for (std::size_t i = 0; i < orgcolors.size(); i++)
2767 ctxt->fNewColors[i] = xcol[i].pixel;
2770 for (
UInt_t y = 0;
y < ctxt->fHeight;
y++) {
2771 for (
UInt_t x = 0;
x < ctxt->fWidth;
x++) {
2773 auto iter = std::find(orgcolors.begin(), orgcolors.end(),
pixel);
2774 if (iter != orgcolors.end()) {
2775 auto idx = iter - orgcolors.begin();
2776 XPutPixel(image,
x,
y, ctxt->fNewColors[idx]);
2782 XPutImage((Display*)
fDisplay, ctxt->fDrawing, ctxt->fGClist[
kGCpxmp], image, 0, 0, 0, 0,
2783 ctxt->fWidth, ctxt->fHeight);
2786 XDestroyImage(image);
2819 XWarpPointer((Display*)
fDisplay, None, (
Window)
id, 0, 0, 0, 0, ix, iy);
2832 unsigned int wval, hval;
2857 buf[
x] = (
unsigned char) idx;
2885 XImage *image = XGetImage((Display*)
fDisplay, ctxt->fDrawing, 0, 0,
2886 ctxt->fWidth, ctxt->fHeight,
2887 AllPlanes, ZPixmap);
2890 Error(
"WriteGIFW",
"Cannot create image for writing GIF. Try in batch mode.");
2904 for (
UInt_t x = 0;
x < ctxt->fWidth;
x++) {
2905 for (
UInt_t y = 0;
y < ctxt->fHeight;
y++) {
2914 if (ncolors > 256) {
2915 Error(
"WriteGIFW",
"Cannot create GIF of image containing more than 256 colors. Try in batch mode.");
2916 XDestroyImage(image);
2921 std::vector<RXColor> xcol(ncolors);
2923 for (std::size_t i = 0; i < ncolors; i++) {
2925 xcol[i].red = xcol[i].green = xcol[i].blue = 0;
2926 xcol[i].flags = DoRed | DoGreen | DoBlue;
2932 for (std::size_t i = 0; i < ncolors; i++) {
2940 std::vector<unsigned char>
r(ncolors),
b(ncolors),
g(ncolors);
2942 for (std::size_t i = 0; i < ncolors; i++) {
2943 r[i] = (
unsigned char) (xcol[i].red * 255 / maxcol);
2944 g[i] = (
unsigned char) (xcol[i].green * 255 / maxcol);
2945 b[i] = (
unsigned char) (xcol[i].blue * 255 / maxcol);
2950 if (gif.OpenFile(
name)) {
2951 auto len = gif.GIFencode(ctxt->fWidth, ctxt->fHeight, ncolors,
r.data(),
g.data(),
b.data());
2956 Error(
"WriteGIFW",
"cannot write file: %s",
name);
2960 XDestroyImage(image);
2972 const int maxSegment = 20;
2974 unsigned char *jimg, *jbase, icol;
2976 XSegment lines[256][maxSegment];
2988 for (i = 0; i < 256; i++) nlines[i] = 0;
2992 jbase = image + (
ymin-1)*nx +
xmin;
2995 xcur =
x1; jbase += nx;
2996 for (jimg = jbase, icol = *jimg++,
x =
x1+1;
x <=
x2; jimg++,
x++) {
2997 if (icol != *jimg) {
2998 if (icol != itran) {
3000 lines[icol][
n].x1 = xcur; lines[icol][
n].y1 =
y;
3001 lines[icol][
n].x2 =
x-1; lines[icol][
n].y2 =
y;
3002 if (nlines[icol] == maxSegment) {
3004 XDrawSegments((Display*)
fDisplay,
id,lineGC,&lines[icol][0],
3009 icol = *jimg; xcur =
x;
3012 if (icol != itran) {
3014 lines[icol][
n].x1 = xcur; lines[icol][
n].y1 =
y;
3015 lines[icol][
n].x2 =
x-1; lines[icol][
n].y2 =
y;
3016 if (nlines[icol] == maxSegment) {
3018 XDrawSegments((Display*)
fDisplay,
id,lineGC,&lines[icol][0],
3025 for (i = 0; i < 256; i++) {
3026 if (nlines[i] != 0) {
3028 XDrawSegments((Display*)
fDisplay,
id,lineGC,&lines[i][0],nlines[i]);
3033 XFreeGC((Display*)
fDisplay, lineGC);
3043 unsigned char *gifArr, *pixArr, red[256], green[256], blue[256], *j1, *j2, icol;
3048 FILE *fd = fopen(file,
"r");
3050 Error(
"ReadGIF",
"unable to open GIF file");
3055 long ft = ftell(fd);
3057 Error(
"ReadGIF",
"unable to open GIF file");
3065 if (!(gifArr = (
unsigned char *) calloc(filesize+256,1))) {
3066 Error(
"ReadGIF",
"unable to allocate array for gif");
3071 if (fread(gifArr, filesize, 1, fd) != 1) {
3072 Error(
"ReadGIF",
"GIF file read failed");
3079 irep = TGifDecode::GIFinfo(gifArr, &
width, &
height, &ncolor);
3085 if (!(pixArr = (
unsigned char *) calloc((
width*
height),1))) {
3086 Error(
"ReadGIF",
"unable to allocate array for image");
3093 irep = gif.GIFdecode(gifArr, pixArr, &
width, &
height, &ncolor, red, green, blue);
3104 for (i = 0; i < ncolor; i++) {
3114 for (i = 1; i <=
height/2; i++) {
3115 j1 = pixArr + (i-1)*
width;
3117 for (k = 0; k <
width; k++) {
3118 icol = *j1; *j1++ = *j2; *j2++ = icol;
3123 PutImage(
offset,-1,x0,y0,
width,
height,0,0,
width-1,
height-1,pixArr,pic);
3202 Int_t major_opcode, first_event, first_error;
3205 return XQueryExtension((Display*)
fDisplay, ext, &major_opcode, &first_event, &first_error);
3233 ctxt->fAttFill.SetFillColor(
cindex);
3237 Int_t stn = (fasi >= 1 && fasi <=25) ? fasi : 2;
3238 ctxt->fAttFill.SetFillStyle(
style * 1000 + fasi);
3242 ctxt->fillHollow = 0;
3247 ctxt->fillHollow = 1;
3251 ctxt->fillHollow = 0;
3252 XSetFillStyle((Display*)
fDisplay, ctxt->fGClist[
kGCfill], FillStippled);
3254 if (stn != ctxt->fillFasi) {
3255 if (ctxt->fillPattern != 0)
3256 XFreePixmap((Display*)
fDisplay, ctxt->fillPattern);
3261 XSetStipple((Display*)
fDisplay, ctxt->fGClist[
kGCfill], ctxt->fillPattern);
3262 ctxt->fillFasi = stn;
3267 ctxt->fillHollow = 1;
3280 if (ctxt->fAttLine.GetLineStyle() != att.
GetLineStyle()) {
3282 ctxt->dashList.clear();
3284 ctxt->dashList = { 3, 3 };
3286 ctxt->dashList = { 1, 2 };
3287 else if (att.GetLineStyle() == 4) {
3288 ctxt->dashList = { 3, 4, 1, 4} ;
3293 ctxt->dashList.resize(nt);
3294 for (
Int_t j = 0; j < nt; ++j) {
3296 sscanf(tokens->At(j)->GetName(),
"%d", &it);
3297 ctxt->dashList[j] = (
Int_t) (it/4);
3301 ctxt->dashLength = 0;
3302 for (
auto elem : ctxt->dashList)
3303 ctxt->dashLength += elem;
3304 ctxt->dashOffset = 0;
3305 ctxt->lineStyle = ctxt->dashList.size() == 0 ? LineSolid : LineOnOffDash;
3308 ctxt->lineWidth = att.GetLineWidth();
3309 if (ctxt->lineStyle == LineSolid) {
3310 if (ctxt->lineWidth == 1)
3311 ctxt->lineWidth = 0;
3313 if (ctxt->lineWidth == 0)
3314 ctxt->lineWidth = 1;
3317 if (ctxt->lineWidth >= 0) {
3318 XSetLineAttributes((Display*)fDisplay, ctxt->fGClist[
kGCline], ctxt->lineWidth,
3320 if (ctxt->lineStyle == LineOnOffDash)
3321 XSetLineAttributes((Display*)fDisplay, ctxt->fGClist[
kGCdash], ctxt->lineWidth,
3325 if (att.GetLineColor() >= 0) {
3326 SetColor(ctxt, &ctxt->fGClist[
kGCline], (
Int_t) att.GetLineColor());
3327 SetColor(ctxt, &ctxt->fGClist[
kGCdash], (
Int_t) att.GetLineColor());
3330 ctxt->fAttLine = att;
3347 ctxt->fAttMarker = att;
3357 XSetLineAttributes((Display*)
fDisplay, ctxt->fGClist[
kGCmark], ctxt->markerLineWidth, LineSolid, CapButt, JoinMiter);
3359 XSetLineAttributes((Display*)
fDisplay, ctxt->fGClist[
kGCmark], ctxt->markerLineWidth,
3383 ctxt->textAlign =
kBLeft;
3386 ctxt->textAlign =
kMLeft;
3389 ctxt->textAlign =
kTLeft;
3424 if (XGetGCValues((Display*)
fDisplay, ctxt->fGClist[
kGCtext], GCForeground | GCBackground, &values)) {
3425 XSetForeground( (Display*)
fDisplay, ctxt->fGClist[
kGCinvt], values.background );
3426 XSetBackground( (Display*)
fDisplay, ctxt->fGClist[
kGCinvt], values.foreground );
3428 Error(
"SetAttText",
"cannot get GC values");
3435 ctxt->textFont =
gFont[i].id;
3436 XSetFont((Display*)
fDisplay, ctxt->fGClist[
kGCtext], ctxt->textFont->fid);
3437 XSetFont((Display*)
fDisplay, ctxt->fGClist[
kGCinvt], ctxt->textFont->fid);
3441 ctxt->fAttText = att;
3455 auto gxmode = GXcopy;
3460 for (
int i = 0; i <
kMAXGC; i++)
3461 XSetFunction((Display*)
fDisplay, ctxt->fGClist[i], gxmode);
3463 ctxt->drawMode =
mode;
3472 return ctxt ? ctxt->drawMode :
kCopy;
Handle_t WinContext_t
Window drawing context.
Handle_t Pixmap_t
Pixmap handle.
Handle_t Window_t
Window handle.
Handle_t Drawable_t
Drawable handle.
const unsigned char gStipples[26][32]
short Style_t
Style number (short)
unsigned short UShort_t
Unsigned Short integer 2 bytes (unsigned short)
int Int_t
Signed integer 4 bytes (int)
short Color_t
Color number (short)
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char)
constexpr ULong_t kBitsPerByte
int Seek_t
File pointer (int).
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
short Width_t
Line width (short)
float Float_t
Float 4 bytes (float)
short Font_t
Font number (short)
short Short_t
Signed Short integer 2 bytes (short)
long long Long64_t
Portable signed long integer 8 bytes.
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 mask
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 cmap
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 wid
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 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 index
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 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 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 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 x1
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 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 WindowAttributes_t attr
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 y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char fontname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void ypos
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 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 text
Option_t Option_t TPoint TPoint const char y1
static int gMarkerJoinStyle
static int gMarkerLineStyle
static ULong_t gKeybdMask
static Cursor gNullCursor
const char null_cursor_bits[]
const Int_t kBIGGEST_RGB_VALUE
static ULong_t gMouseMask
static Int_t gCurrentFontNumber
static int gMarkerCapStyle
static struct @55 gFont[kMAXFONT]
static XFontStruct * gTextFont
static Int_t DummyX11ErrorHandler(Display *, XErrorEvent *)
Dummy error handler for X11. Used by FindUsableVisual().
Int_t gDebug
Global variable setting the debug level. Set to 0 to disable, increase it in steps of 1 to increase t...
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
R__EXTERN TStyle * gStyle
Fill Area Attributes class.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual Size_t GetMarkerSize() const
Return the marker size.
EMarkerShape GetMarkerShape(Int_t &sz, std::vector< TPoint > &points, Float_t scale=1., UInt_t flags=0) const
Return marker shape.
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.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual Short_t GetTextAlign() const
Return the text alignment.
Float_t fTextAngle
Text angle.
virtual Color_t GetTextColor() const
Return the text color.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
The color creation and management class.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Bool_t Next(ULong64_t &hash, Long64_t &key, Long64_t &value)
Get next entry from TExMap. Returns kFALSE at end of map.
This class stores a (key,value) pair using an external hash.
void Add(ULong64_t hash, Long64_t key, Long64_t value)
Add an (key,value) pair to the table. The key should be unique.
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
This class is the basic interface to the X11 (Xlib) graphics system.
void DrawFillArea(Int_t n, TPoint *xy) override
Fill area described by polygon.
void * fDisplay
Pointer to display.
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.
const TAttText & GetTextAttW(WinContext_t wctxt) const
Return text attributes for specified window context.
void SetLineColor(Color_t cindex) override
Set color index for lines.
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.
Colormap fColormap
Default colormap, 0 if b/w.
std::unordered_map< Int_t, std::unique_ptr< XWindow_t > > fWindows
Window_t GetWindowID(Int_t wid) override
Return the X11 window identifier.
Int_t WriteGIF(char *name) override
Writes the current window into GIF file.
void SetFillColor(Color_t cindex) override
Set color index for fill areas.
void ResizeWindow(Int_t wid) override
Resize the current window if necessary.
void SetTextAlign(Short_t talign=11) override
Set text alignment.
void RescaleWindow(Int_t wid, UInt_t w, UInt_t h) override
Rescale the window wid.
void SetCursor(Int_t win, ECursor cursor) override
Set the cursor.
Int_t fScreenNumber
Screen number.
void Sync(Int_t mode) override
Set synchronisation on or off.
Pixmap_t CreatePixmapFromData(unsigned char *bits, UInt_t width, UInt_t height) override
create pixmap from RGB data.
WinContext_t GetWindowContext(Int_t wid) override
Returns window context for specified window id Window context is valid until window not closed or des...
unsigned char * GetColorBits(Drawable_t wid, Int_t x=0, Int_t y=0, UInt_t w=0, UInt_t h=0) override
Returns an array of pixels created from a part of drawable (defined by x, y, w, h) in format: b1,...
Int_t WriteGIFW(WinContext_t wctxt, const char *name) override
Writes the specified window into GIF file.
ULong_t fWhitePixel
Value of white pixel in colormap.
Cursor fCursors[kNumCursors]
List of cursors.
Bool_t AllocColor(Colormap cmap, RXColor *color)
Allocate color in colormap.
void DrawText(Int_t x, Int_t y, Float_t angle, Float_t mgn, const char *text, ETextMode mode) override
Draw a text string using current font.
Bool_t GetTextExtentA(Font_t font, Double_t size, UInt_t &w, UInt_t &h, const char *mess) override
Return the size of a character string for specified font and size On plain X11 font and size is ignor...
void QueryColors(Colormap cmap, RXColor *colors, Int_t ncolors)
Returns the current RGB value for the pixel in the XColor structure.
Int_t fBlueShift
Bits to left shift blue.
void SetMarkerColor(Color_t cindex) override
Set color index for markers.
void DrawFillAreaW(WinContext_t wctxt, Int_t n, TPoint *xy) override
Fill area described by polygon on specified window.
void SetAttText(WinContext_t wctxt, const TAttText &att) override
Set text attributes for specified window.
void Warp(Int_t ix, Int_t iy, Window_t id=0) override
Set pointer position.
void * GetGC(Int_t which) const
Return desired Graphics Context ("which" maps directly on gGCList[]).
void SetOpacityW(WinContext_t wctxt, Int_t percent) override
Set opacity of a specified window.
void SetClipOFF(Int_t wid) override
Turn off the clipping for the window wid.
Int_t ResizePixmap(Int_t wid, UInt_t w, UInt_t h) override
Resize a pixmap.
void SetDoubleBufferOFF() override
Turn double buffer mode off.
void DrawTextW(WinContext_t wctxt, Int_t x, Int_t y, Float_t angle, Float_t mgn, const char *text, ETextMode mode) override
Draw a text string using current font on specified window.
void SetTextColor(Color_t cindex) override
Set color index for text.
void UpdateWindow(Int_t mode) override
Update display.
Bool_t fHasXft
True when XftFonts are used.
Int_t SupportsExtension(const char *ext) const override
Returns 1 if window system server supports extension given by the argument, returns 0 in case extensi...
Int_t InitWindow(ULong_t window) override
Open window and return window number.
Style_t GetLineStyle() const override
Return current line style.
~TGX11() override
Destructor.
void MoveWindow(Int_t wid, Int_t x, Int_t y) override
Move the window wid.
Int_t SetTextFont(char *fontname, ETextSetMode mode) override
Set text font to specified name.
void SetFillStyle(Style_t style) override
Set fill area style.
void CopyPixmapW(WinContext_t wctxt, Int_t wid, Int_t xpos, Int_t ypos) override
Copy the pixmap wid at the position xpos, ypos in the specified window.
Float_t fTextMagnitude
Text Magnitude.
void SetCharacterUp(Float_t chupx, Float_t chupy) override
Set character up vector.
Drawable fRootWin
Root window used as parent of all windows.
void WritePixmap(Int_t wid, UInt_t w, UInt_t h, char *pxname) override
Write the pixmap wid in the bitmap file pxname.
void DrawPolyLineW(WinContext_t wctxt, Int_t n, TPoint *xy) override
Draw a line through all points on specified window.
void SetInput(Int_t inp)
Set input on or off.
void GetPlanes(Int_t &nplanes) override
Get maximum number of planes.
void ClearWindow() override
Clear current window.
void * fXEvent
Current native (X11) event.
Int_t fGreenShift
Bits to left shift green.
void DrawBox(Int_t x1, Int_t y1, Int_t x2, Int_t y2, EBoxMode mode) override
Draw a box.
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.
void SetOpacity(Int_t percent) override
Set opacity of a selected window.
Style_t GetFillStyle() const override
Return current fill style.
void DrawPolyMarkerW(WinContext_t wctxt, Int_t n, TPoint *xy) override
Draw n markers with the current attributes at position x, y on specified window.
Int_t OpenPixmap(UInt_t w, UInt_t h) override
Open a new pixmap.
XColor_t & GetColor(Int_t cid)
Return reference to internal color structure associated to color index cid.
void * GetGCW(WinContext_t wctxt, Int_t which) const
Return X11 Graphics Context for specified window context.
void SetAttMarker(WinContext_t wctxt, const TAttMarker &att) override
Set marker attributes for specified window.
Int_t fBlueDiv
Blue value divider.
void DrawPolyMarker(Int_t n, TPoint *xy) override
Draw n markers with the current attributes at position x, y.
void UpdateWindowW(WinContext_t wctxt, Int_t mode) override
Update display for specified window.
void CloseWindow() override
Delete current window.
void SetMarkerSize(Float_t markersize) override
Set marker size index.
void SetAttLine(WinContext_t wctxt, const TAttLine &att) override
Set line attributes for specified window.
Drawable fVisRootWin
Root window with fVisual to be used to create GC's and XImages.
void SetDoubleBufferON() override
Turn double buffer mode on.
void SetColor(XWindow_t *ctxt, void *gc, Int_t ci)
Set the foreground color in GC.
TExMap * fColors
Hash list of colors.
void DrawLinesSegments(Int_t n, TPoint *xy) override
Draws N segments between provided points.
void SetAttFill(WinContext_t wctxt, const TAttFill &att) override
Set fill attributes for specified window.
void SetDrawModeW(WinContext_t wctxt, EDrawMode mode) override
Set window draw mode.
Int_t fRedDiv
Red value divider, -1 if no TrueColor visual.
Int_t fDepth
Number of color planes.
Color_t GetFillColor() const override
Return current fill color.
Bool_t Init(void *display) override
Initialize X11 system. Returns kFALSE in case of failure.
void SetLineType(Int_t n, Int_t *dash) override
Set line type.
Window_t GetWindow(WinContext_t wctxt) const
Return X11 window for specified window context.
ULong_t fBlackPixel
Value of black pixel in colormap.
void SetTextSize(Float_t textsize) override
Set current text size.
Float_t fCharacterUpX
Character Up vector along X.
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.
void SetLineStyle(Style_t linestyle) override
Set line style.
Int_t fGreenDiv
Green value divider.
EDrawMode GetDrawModeW(WinContext_t wctxt) override
Returns window draw mode.
void QueryPointer(Int_t &ix, Int_t &iy) override
Query pointer position.
ULong_t GetPixel(Color_t cindex) override
Return pixel value associated to specified ROOT color number.
TGX11()
Default constructor.
void GetTextExtent(UInt_t &w, UInt_t &h, char *mess) override
Return the size of a character string.
void ClosePixmap() override
Delete current pixmap.
Int_t fRedShift
Bits to left shift red, -1 if no TrueColor visual.
Int_t RequestLocator(Int_t mode, Int_t ctyp, Int_t &x, Int_t &y) override
Request Locator position.
Int_t OpenDisplay(void *display)
Open the display. Return -1 if the opening fails, 0 when ok.
void DrawPolyLine(Int_t n, TPoint *xy) override
Draw a line through all points.
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.
Int_t AddPixmap(ULong_t pixid, UInt_t w, UInt_t h) override
Register pixmap created by gVirtualGL.
void SetRGB(Int_t cindex, Float_t r, Float_t g, Float_t b) override
Set color intensities for given color index.
void FindUsableVisual(RXVisualInfo *vlist, Int_t nitems)
Check if visual is usable, if so set fVisual, fDepth, fColormap, fBlackPixel and fWhitePixel.
void DrawLineW(WinContext_t wctxt, Int_t x1, Int_t y1, Int_t x2, Int_t y2) override
Draw a line on specified window.
void GetCharacterUp(Float_t &chupx, Float_t &chupy) override
Return character up vector.
void SetDoubleBuffer(Int_t wid, Int_t mode) override
Set the double buffer on/off on window wid.
void DrawLinesSegmentsW(WinContext_t wctxt, Int_t n, TPoint *xy) override
Draws N segments between provided points on specified windows.
void SetMarkerStyle(Style_t markerstyle) override
Set marker style.
void GetRGB(Int_t index, Float_t &r, Float_t &g, Float_t &b) override
Get rgb values for color "index".
void ClearWindowW(WinContext_t wctxt) override
Clear specified window.
RVisual * fVisual
Pointer to visual used by all windows.
Width_t GetLineWidth() const override
Return current line width.
void DrawLine(Int_t x1, Int_t y1, Int_t x2, Int_t y2) override
Draw a line.
Window_t GetCurrentWindow() const override
Return current window pointer.
void RemoveWindow(ULong_t qwid) override
Remove a window created by Qt (like CloseWindow()).
Int_t RequestString(Int_t x, Int_t y, char *text) override
Request a string.
void SetLineWidth(Width_t width) override
Set line width.
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.
Int_t GetDoubleBuffer(Int_t wid) override
Query the double buffer value for the window wid.
void FindBestVisual()
Find best visual, i.e.
void SetDrawMode(EDrawMode mode) override
Set the drawing mode.
const char * DisplayName(const char *dpyName=nullptr) override
Return hostname on which the display is opened.
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.
Int_t AddWindow(ULong_t qwid, UInt_t w, UInt_t h) override
Register a window created by Qt as a ROOT window (like InitWindow()).
Int_t AddWindowHandle()
Add new window handle Only for private usage.
Float_t fCharacterUpY
Character Up vector along Y.
Bool_t fHasTTFonts
True when TrueType fonts are used.
void SelectWindow(Int_t wid) override
Select window to which subsequent output is directed.
Int_t GetEntries() const override
Return the number of objects in array (i.e.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
Semi-Abstract base class defining a generic interface to the underlying, low level,...
Helper class to extract pixel information from XImage for store in the GIF.
TX11GifEncode(XImage *image)
void get_scline(int y, int width, unsigned char *buf) override
std::vector< ULong_t > orgcolors
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Description of a X11 color.
Bool_t fDefined
true if pixel value is defined
UShort_t fRed
red value in range [0,kBIGGEST_RGB_VALUE]
UShort_t fGreen
green value
ULong_t fPixel
color pixel value
Description of a X11 window.
Int_t fOpen
1 if the window is open, 0 if not
TAttText fAttText
current text attributes
Int_t fClip
1 if the clipping is on
Drawable fWindow
X11 window.
Int_t textAlign
selected text align
Int_t lineWidth
current line width
Int_t dashOffset
current dash offset
Int_t fillFasi
fasi parameter for fill pattern
Drawable fDrawing
drawing area, equal to window or buffer
Int_t markerLineWidth
line width used for marker
Int_t fDoubleBuffer
1 if the double buffer is on, 0 if not
std::vector< char > dashList
X11 array for dashes.
XFontStruct * textFont
selected text font
UInt_t fHeight
height of the window
Int_t fIsPixmap
1 if pixmap, 0 if not
Int_t fillHollow
Flag if fill style is hollow.
UInt_t fWidth
width of the window
TVirtualX::EDrawMode drawMode
current draw mode
UInt_t fHclip
height of the clipping rectangle
Int_t dashLength
total length of dashes
Bool_t fShared
notify when window is shared
Drawable fBuffer
pixmap used for double buffer
TAttMarker::EMarkerShape markerType
5 differen kinds of marker
GdkGC * fGClist[kMAXGC]
array of GC objects for concrete window
Int_t markerSize
size of simple markers
GdkLineStyle lineStyle
current line style
TAttLine fAttLine
current line attributes
std::vector< ULong_t > fNewColors
extra image colors created for transparency (after processing)
TAttMarker fAttMarker
current marker attribute
GdkPixmap * fillPattern
current fill pattern
Int_t fXclip
x coordinate of the clipping rectangle
TAttFill fAttFill
current fill attributes
UInt_t fWclip
width of the clipping rectangle
std::vector< TPoint > markerShape
marker shape points
Int_t fYclip
y coordinate of the clipping rectangle