--- rxvt-unicode/src/rxvtperl.xs 2021/11/24 18:17:20 1.256 +++ rxvt-unicode/src/rxvtperl.xs 2023/07/25 18:06:07 1.261 @@ -32,7 +32,14 @@ #include #include -#include "unistd.h" +#include + +#include + +// support old includes (https://bugs.freedesktop.org/show_bug.cgi?id=2799, https://lists.x.org/archives/xorg-arch/2005-March/000004.html) +#ifndef ShapeInput +# define ShapeInput 2 +#endif #include "ev_cpp.h" #include "rxvt.h" @@ -374,7 +381,7 @@ #if 0 /* we are not a library anymore, so doing this is just not worth it */ /*THINK/TODO: this has the side effect of, of course, not calling destructors. */ -/* but therse are not guaranteed anyway... */ +/* but these are not guaranteed anyway... */ rxvt_perl_interp::~rxvt_perl_interp () { if (perl) @@ -392,7 +399,7 @@ { if (!perl) { - rxvt_push_locale (""); // perl init destroys current locale + rxvt_push_locale ("C"); // perl init destroys current locale { perl_environ = rxvt_environ; @@ -849,15 +856,16 @@ // TODO: should support all colour constants, create colorinc.h &c const_iv (Color_fg), const_iv (Color_bg), -#if OFF_FOCUS_FADING +# if OFF_FOCUS_FADING const_iv (Color_fade), -#endif +# endif const_iv (Color_pointer_fg), const_iv (Color_pointer_bg), const_iv (Color_border), const_iv (NRS_COLORS), const_iv (TOTAL_COLORS), + const_iv (None), const_iv (CurrentTime), const_iv (ShiftMask), const_iv (LockMask), @@ -938,6 +946,19 @@ const_iv (ColormapNotify), const_iv (ClientMessage), const_iv (MappingNotify), + + // shape extension + const_iv (ShapeSet), + const_iv (ShapeUnion), + const_iv (ShapeIntersect), + const_iv (ShapeSubtract), + const_iv (ShapeInvert), + + const_iv (ShapeBounding), + const_iv (ShapeClip), + const_iv (ShapeInput), + + // XIM # if ENABLE_XIM_ONTHESPOT const_iv (XIMReverse), const_iv (XIMUnderline), @@ -948,7 +969,8 @@ const_iv (XIMVisibleToForward), const_iv (XIMVisibleToBackword), const_iv (XIMVisibleToCenter), -#if XRENDER +# endif +# if XRENDER const_iv (PictStandardARGB32), const_iv (PictStandardRGB24), const_iv (PictStandardA8), @@ -1014,7 +1036,7 @@ const_iv (PictOpHSLSaturation), const_iv (PictOpHSLColor), const_iv (PictOpHSLLuminosity), -#endif +# endif # if 0 const_iv (XIMForwardChar), const_iv (XIMBackwardChar), @@ -1029,7 +1051,6 @@ const_iv (XIMAbsolutePosition), const_iv (XIMDontChange), # endif -# endif /* DEC private modes */ const_iv (PrivMode_132), @@ -1195,6 +1216,41 @@ delete req; +Region +XCreateRegion () + +int +XUnionRectWithRegion (int x, int y, int w, int h, Region src, Region dst) + CODE: + XRectangle rect; + rect.x = x; + rect.y = y; + rect.width = w; + rect.height = h; + RETVAL = XUnionRectWithRegion (&rect, src, dst); + OUTPUT: RETVAL + +int +XIntersectRegion (Region src1, Region src2, Region res) + +int +XUnionRegion (Region src1, Region src2, Region res) + +int +XSubtractRegion (Region src1, Region src2, Region res) + +int +XXorRegion (Region src1, Region src2, Region res) + +int +XOffsetRegion (Region r, int dx, int dy) + +int +XShrinkRegion (Region r, int dx, int dy) + +int +XDestroyRegion (Region r) + MODULE = urxvt PACKAGE = urxvt::term SV * @@ -2142,7 +2198,7 @@ EXTEND (SP, count); while (count--) - PUSHs (newSVuv ((U32)props [count])); + PUSHs (sv_2mortal (newSVuv ((U32)props [count]))); XFree (props); } @@ -2168,9 +2224,9 @@ : 1; EXTEND (SP, 3); - PUSHs (newSVuv ((U32)type)); - PUSHs (newSViv (format)); - PUSHs (newSVpvn ((char *)prop, nitems * elemsize)); + PUSHs (sv_2mortal (newSVuv ((U32)type))); + PUSHs (sv_2mortal (newSViv (format))); + PUSHs (sv_2mortal (newSVpvn ((char *)prop, nitems * elemsize))); XFree (prop); } } @@ -2205,6 +2261,29 @@ XDeleteProperty (rxvt_term *term, Window window, Atom property) C_ARGS: term->dpy, window, property +void +rxvt_term::XShapeQueryVersion () + PPCODE: + int major, minor; + EXTEND (SP, 2); + if (XShapeQueryVersion (THIS->display->dpy, &major, &minor)) + { + PUSHs (sv_2mortal (newSViv (major))); + PUSHs (sv_2mortal (newSViv (minor))); + } + +void +XShapeCombineRegion (rxvt_term *term, Window dest, int destKind, int xOff, int yOff, Region r, int op) + C_ARGS: term->display->dpy, dest, destKind, xOff, yOff, r, op + +void +XShapeCombineMask (rxvt_term *term, XID dest, int destKind, int xOff, int yOff, Pixmap src, int op) + C_ARGS: term->display->dpy, dest, destKind, xOff, yOff, src, op + +void +XShapeCombineShape (rxvt_term *term, XID dest, int destKind, int xOff, int yOff, Pixmap src, int srcKind, int op) + C_ARGS: term->display->dpy, dest, destKind, xOff, yOff, src, srcKind, op + Window rxvt_term::DefaultRootWindow () CODE: @@ -2258,9 +2337,9 @@ if (XTranslateCoordinates (THIS->dpy, src, dst, x, y, &dx, &dy, &child)) { EXTEND (SP, 3); - PUSHs (newSViv (dx)); - PUSHs (newSViv (dy)); - PUSHs (newSVuv (child)); + PUSHs (sv_2mortal (newSViv (dx))); + PUSHs (sv_2mortal (newSViv (dy))); + PUSHs (sv_2mortal (newSVuv (child))); } }