.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "X11::Protocol::Ext::XFIXES 3pm" .TH X11::Protocol::Ext::XFIXES 3pm "2016-12-25" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" X11::Protocol::Ext::XFIXES \- miscellaneous "fixes" extension .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& use X11::Protocol; \& my $X = X11::Protocol\->new; \& $X\->init_extension(\*(AqXFIXES\*(Aq) \& or print "XFIXES extension not available"; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \s-1XFIXES\s0 extension adds some features which are conceived as \*(L"fixing\*(R" omissions in the core X11 protocol, including .IP "\(bu" 4 Events for changes to the selection (the cut and paste between clients). .IP "\(bu" 4 Current cursor image fetching, cursor change events, and cursor naming and hiding. .IP "\(bu" 4 Server-side \*(L"region\*(R" objects representing a set of rectangles. .SH "REQUESTS" .IX Header "REQUESTS" The following are made available with an \f(CW\*(C`init_extension()\*(C'\fR per \&\*(L"\s-1EXTENSIONS\*(R"\s0 in X11::Protocol. .PP .Vb 1 \& my $bool = $X\->init_extension(\*(AqXFIXES\*(Aq); .Ve .SS "\s-1XFIXES\s0 version 1.0" .IX Subsection "XFIXES version 1.0" .ie n .IP """($server_major, $server_minor) = $X\->XFixesQueryVersion ($client_major, $client_minor)""" 4 .el .IP "\f(CW($server_major, $server_minor) = $X\->XFixesQueryVersion ($client_major, $client_minor)\fR" 4 .IX Item "($server_major, $server_minor) = $X->XFixesQueryVersion ($client_major, $client_minor)" Negotiate a protocol version with the server. \f(CW$client_major\fR and \&\f(CW$client_minor\fR is what the client would like, the returned \&\f(CW$server_major\fR and \f(CW$server_minor\fR is what the server will do, which might be less than requested (but not more than). .Sp The current code in this module supports up to 4.0 and automatically negotiates within \f(CW\*(C`init_extension()\*(C'\fR, so direct use of \&\f(CW\*(C`XFixesQueryVersion()\*(C'\fR is not necessary. Asking for higher than the code supports might be a bad idea. .ie n .IP """($atom, $str) = $X\->XFixesChangeSaveSet ($window, $mode, $target, $map)""" 4 .el .IP "\f(CW($atom, $str) = $X\->XFixesChangeSaveSet ($window, $mode, $target, $map)\fR" 4 .IX Item "($atom, $str) = $X->XFixesChangeSaveSet ($window, $mode, $target, $map)" Insert or delete \f(CW$window\fR (an \s-1XID\s0) from the \*(L"save set\*(R" of resources to be retained on the server when the client disconnects. This is an extended version of the core \f(CW\*(C`ChangeSaveSet()\*(C'\fR request. .Sp \&\f(CW$mode\fR is either \*(L"Insert\*(R" or \*(L"Delete\*(R". .Sp \&\f(CW$target\fR is how to reparent \f(CW$window\fR on client close-down, either \&\*(L"Nearest\*(R" or \*(L"Root\*(R". The core \f(CW\*(C`ChangeSaveSet()\*(C'\fR is \*(L"Nearest\*(R" and means go to the next non-client ancestor window. \*(L"Root\*(R" means go to the root window. .Sp \&\f(CW$map\fR is either \*(L"Map\*(R" or \*(L"Unmap\*(R" to apply to \f(CW$window\fR on close-down. The core \f(CW\*(C`ChangeSaveSet()\*(C'\fR is \*(L"Map\*(R". .ie n .IP "$X\->XFixesSelectSelectionInput ($window, $selection, $event_mask)>" 4 .el .IP "\f(CW$X\fR\->XFixesSelectSelectionInput ($window, \f(CW$selection\fR, \f(CW$event_mask\fR)>" 4 .IX Item "$X->XFixesSelectSelectionInput ($window, $selection, $event_mask)>" Select \f(CW\*(C`XFixesSelectionNotify\*(C'\fR events (see \*(L"\s-1EVENTS\*(R"\s0 below) to be sent to \f(CW$window\fR when \f(CW$selection\fR (an atom) changes. .Sp .Vb 3 \& $X\->XFixesSelectSelectionInput ($my_window, \& $X\->atom(\*(AqPRIMARY\*(Aq), \& 0x07); .Ve .Sp \&\f(CW$window\fR is given in the resulting \f(CW\*(C`XFixesSelectionNotify\*(C'\fR. It probably works to make it just a root window. Selections are global to the whole server, so the window doesn't implicitly choose a screen or anything. .Sp \&\f(CW$event_mask\fR has three bits for which event subtypes should be reported. .Sp .Vb 4 \& bitpos bitval \& SetSelectionOwner 0 0x01 \& SelectionWindowDestroy 1 0x02 \& SelectionClientClose 2 0x04 .Ve .Sp There's no pack function for these yet so just give an integer, for instance 0x07 for all three. .Sp See \fIexamples/xfixes\-selection.pl\fR for a sample program listening to selection changes with this request. .ie n .IP "$X\->XFixesSelectCursorInput ($window, $event_mask)>" 4 .el .IP "\f(CW$X\fR\->XFixesSelectCursorInput ($window, \f(CW$event_mask\fR)>" 4 .IX Item "$X->XFixesSelectCursorInput ($window, $event_mask)>" Select \f(CW\*(C`XFixesCursorNotify\*(C'\fR events (see \*(L"\s-1EVENTS\*(R"\s0 below) to be sent to the client. .Sp \&\f(CW$window\fR is given in the resulting \f(CW\*(C`XFixesSelectionNotify\*(C'\fR. It probably works to make it just a root window. The cursor image is global and the events are for any change, not merely within \f(CW$window\fR. .Sp \&\f(CW$event_mask\fR has only a single bit, asking for displayed cursor changes, .Sp .Vb 2 \& bitpos bitval \& DisplayCursor 0 0x01 .Ve .Sp There's no pack function for this yet, just give integer 1 or 0. .ie n .IP "($root_x,$root_y, $width,$height, $xhot,$yhot, $serial, $pixels) = $X\->XFixesGetCursorImage ()>" 4 .el .IP "($root_x,$root_y, \f(CW$width\fR,$height, \f(CW$xhot\fR,$yhot, \f(CW$serial\fR, \f(CW$pixels\fR) = \f(CW$X\fR\->XFixesGetCursorImage ()>" 4 .IX Item "($root_x,$root_y, $width,$height, $xhot,$yhot, $serial, $pixels) = $X->XFixesGetCursorImage ()>" Return the size and pixel contents of the currently displayed mouse pointer cursor. .Sp \&\f(CW$root_x\fR,\f(CW$root_y\fR is the pointer location in root window coordinates (similar to \f(CW\*(C`QueryPointer()\*(C'\fR). .Sp \&\f(CW$width\fR,\f(CW$height\fR is the size of the cursor image. \f(CW$xhot\fR,\f(CW$yhot\fR is the \*(L"hotspot\*(R" position within that, which is the pixel that follows the pointer location. .Sp \&\f(CW$pixels\fR is a byte string of packed \*(L"\s-1ARGB\*(R"\s0 pixel values. Each is 32\-bits in client byte order, with \f(CW$width\fR many in each row and \f(CW$height\fR such rows and no padding in between, so a total \f(CW\*(C`4*$width*$height\*(C'\fR bytes. This can be unpacked with for instance .Sp .Vb 1 \& my @argb = unpack \*(AqL*\*(Aq, $pixels; # each 0xAARRGGBB \& \& # top left pixel is in $argb[0] \& my $alpha = ($argb[0] >> 24) & 0xFF; # each value \& my $red = ($argb[0] >> 16) & 0xFF; # 0 to 255 \& my $green = ($argb[0] >> 8) & 0xFF; \& my $blue = $argb[0] & 0xFF; .Ve .Sp The alpha transparency is pre-multiplied into the \s-1RGB\s0 components, so if the alpha is zero (transparent) then the components are zero too. .Sp The core \f(CW\*(C`CreateCursor()\*(C'\fR bitmask always makes alpha=0 transparent or alpha=255 opaque pixels. The \s-1RENDER\s0 extension (see X11::Protocol::Ext::RENDER) can make partially transparent cursors. .Sp There's no direct way to get the image of a cursor by its \s-1XID \s0(except something dodgy like a \f(CW\*(C`GrabPointer()\*(C'\fR to make it the displayed cursor). Usually cursor XIDs are only ever created by a client itself so no need to read back (and the cursor \s-1XID\s0 can't be read out of an arbitrary window \*(-- though the \s-1XTEST\s0 extension can do some comparing, per X11::Protocol::Ext::XTEST). .Sp For reference, in the X.org server circa version 1.11, the server may start up with no cursor at all, and when that happens an attempt to \&\f(CW\*(C`XFixesGetCursorImage()\*(C'\fR gives a \*(L"Cursor\*(R" error. In practice this probably only happens using a bare Xvfb or similar, since in normal use xdm or the window manager will almost certainly have set a cursor. .Sp See \fIexamples/xfixes\-cursor\-image.pl\fR in the X11\-Protocol\-Other sources for a sample program getting the cursor image with this request. .SS "\s-1XFIXES\s0 version 2.0" .IX Subsection "XFIXES version 2.0" A region object on the server represents a set of rectangles, each x,y,width,height, with positive or negative x,y, and the set possibly made of disconnected sections, etc. (Basically a server-side copy of the Xlib region code, see \fIXCreateRegion\fR\|(3).) .PP Each rectangle might be just 1x1 for a single pixel, so a region can represent any bitmap, but it's geared towards the sort of rectangle arithmetic which arises from overlapping rectangular windows etc. .ie n .IP """$X\->XFixesCreateRegion ($region, $rect...)""" 4 .el .IP "\f(CW$X\->XFixesCreateRegion ($region, $rect...)\fR" 4 .IX Item "$X->XFixesCreateRegion ($region, $rect...)" Create \f(CW$region\fR (a new \s-1XID\s0) as a region and set it to the union of the given rectangles, or empty if none. Each \f(CW$rect\fR is an arrayref \&\f(CW\*(C`[$x,$y,$width,$height]\*(C'\fR. .Sp .Vb 2 \& my $region = $X\->new_rsrc; \& $X\->XFixesCreateRegion ($region, [0,0,10,5], [100,100,1,1]); .Ve .ie n .IP """$X\->XFixesCreateRegionFromBitmap ($region, $bitmap)""" 4 .el .IP "\f(CW$X\->XFixesCreateRegionFromBitmap ($region, $bitmap)\fR" 4 .IX Item "$X->XFixesCreateRegionFromBitmap ($region, $bitmap)" Create a region initialized from the 1 bits of \f(CW$bitmap\fR (a pixmap \s-1XID\s0). .Sp .Vb 2 \& my $region = $X\->new_rsrc; \& $X\->XFixesCreateRegionFromBitmap ($region, $bitmap); .Ve .ie n .IP """$X\->XFixesCreateRegionFromWindow ($region, $window, $kind)""" 4 .el .IP "\f(CW$X\->XFixesCreateRegionFromWindow ($region, $window, $kind)\fR" 4 .IX Item "$X->XFixesCreateRegionFromWindow ($region, $window, $kind)" Create a region initialized from the shape of \f(CW$window\fR (an \s-1XID\s0). \f(CW$kind\fR is either \*(L"Bounding\*(R" or \*(L"Clip\*(R" as per the \s-1SHAPE\s0 extension (see X11::Protocol::Ext::SHAPE). .Sp .Vb 2 \& my $region = $X\->new_rsrc; \& $X\->XFixesCreateRegionFromBitmap ($region, $window, \*(AqClip\*(Aq); .Ve .Sp There's no need to \f(CW\*(C`$X\->init_extension(\*(AqSHAPE\*(Aq)\*(C'\fR before using this request. Any shape is just on the server and results in a \f(CW$region\fR of either a single rectangle or set of rectangles for a shape. .ie n .IP """$X\->XFixesCreateRegionFromGC ($region, $gc)""" 4 .el .IP "\f(CW$X\->XFixesCreateRegionFromGC ($region, $gc)\fR" 4 .IX Item "$X->XFixesCreateRegionFromGC ($region, $gc)" Create a region initialized from the clip mask of \f(CW$gc\fR (an \s-1XID\s0). .Sp .Vb 2 \& my $region = $X\->new_rsrc; \& $X\->XFixesCreateRegionFromGC ($region, $gc); .Ve .Sp The region is relative to the \s-1GC \s0\f(CW\*(C`clip_x_origin\*(C'\fR and \f(CW\*(C`clip_y_origin\*(C'\fR, ie. those offsets are not applied to the X,Y in the region. .ie n .IP """$X\->XFixesCreateRegionFromPicture ($region, $picture)""" 4 .el .IP "\f(CW$X\->XFixesCreateRegionFromPicture ($region, $picture)\fR" 4 .IX Item "$X->XFixesCreateRegionFromPicture ($region, $picture)" Create a region initialized from a \s-1RENDER \s0\f(CW$picture\fR (an \s-1XID\s0). .Sp .Vb 2 \& my $region = $X\->new_rsrc; \& $X\->XFixesCreateRegionFromBitmap ($region, $picture); .Ve .Sp The region is relative to the picture \f(CW\*(C`clip_x_origin\*(C'\fR and \f(CW\*(C`clip_y_origin\*(C'\fR, ie. those offsets are not applied to the X,Y in the region. .Sp Picture objects are from the \s-1RENDER\s0 extension (see X11::Protocol::Ext::RENDER). This request always exists, but is not useful without \s-1RENDER.\s0 .ie n .IP """$X\->XFixesDestroyRegion ($region)""" 4 .el .IP "\f(CW$X\->XFixesDestroyRegion ($region)\fR" 4 .IX Item "$X->XFixesDestroyRegion ($region)" Destroy \f(CW$region\fR. .ie n .IP """$X\->XFixesSetRegion ($region, $rect...)""" 4 .el .IP "\f(CW$X\->XFixesSetRegion ($region, $rect...)\fR" 4 .IX Item "$X->XFixesSetRegion ($region, $rect...)" Set \f(CW$region\fR to the union of the given rectangles, or empty if none. Each \&\f(CW$rect\fR is an arrayref \f(CW\*(C`[$x,$y,$width,$height]\*(C'\fR, as per \&\f(CW\*(C`XFixesCreateRegion()\*(C'\fR above. .Sp .Vb 1 \& $X\->XFixesSetRegion ($region, [0,0,20,10], [100,100,5,5]) .Ve .ie n .IP """$X\->XFixesCopyRegion ($dst, $src)""" 4 .el .IP "\f(CW$X\->XFixesCopyRegion ($dst, $src)\fR" 4 .IX Item "$X->XFixesCopyRegion ($dst, $src)" Copy a region \f(CW$src\fR to region \f(CW$dst\fR. .ie n .IP """$X\->XFixesUnionRegion ($src1, $src2, $dst)""" 4 .el .IP "\f(CW$X\->XFixesUnionRegion ($src1, $src2, $dst)\fR" 4 .IX Item "$X->XFixesUnionRegion ($src1, $src2, $dst)" .PD 0 .ie n .IP """$X\->XFixesIntersectRegion ($src1, $src2, $dst)""" 4 .el .IP "\f(CW$X\->XFixesIntersectRegion ($src1, $src2, $dst)\fR" 4 .IX Item "$X->XFixesIntersectRegion ($src1, $src2, $dst)" .ie n .IP """$X\->XFixesSubtractRegion ($src1, $src2, $dst)""" 4 .el .IP "\f(CW$X\->XFixesSubtractRegion ($src1, $src2, $dst)\fR" 4 .IX Item "$X->XFixesSubtractRegion ($src1, $src2, $dst)" .PD Set region \f(CW$dst\fR to respectively the union or intersection of \f(CW$src1\fR and \&\f(CW$src2\fR, or the subtraction \f(CW$src1\fR \- \f(CW$src2\fR. .Sp \&\f(CW$dst\fR can be one of the source regions if desired, to change in-place. .ie n .IP """$X\->XFixesInvertRegion ($src, $rect, $dst)""" 4 .el .IP "\f(CW$X\->XFixesInvertRegion ($src, $rect, $dst)\fR" 4 .IX Item "$X->XFixesInvertRegion ($src, $rect, $dst)" Set region \f(CW$dst\fR to the inverse of \f(CW$src\fR bounded by rectangle \f(CW$rect\fR, ie. \f(CW$rect\fR subtract \f(CW$src\fR. \f(CW$rect\fR is an arrayref \&\f(CW\*(C`[$x,$y,$width,$height]\*(C'\fR. .Sp .Vb 1 \& $X\-XFixesInvertRegion ($src, [10,10, 200,100], $dst)> .Ve .Sp \&\f(CW$dst\fR can be the same as \f(CW$src\fR to do an \*(L"in-place\*(R" invert. .ie n .IP """$X\->XFixesTranslateRegion ($region, $dx, $dy)""" 4 .el .IP "\f(CW$X\->XFixesTranslateRegion ($region, $dx, $dy)\fR" 4 .IX Item "$X->XFixesTranslateRegion ($region, $dx, $dy)" Move the area covered by \f(CW$region\fR by an offset \f(CW$dx\fR and \f(CW$dy\fR (integers). .ie n .IP """$X\->XFixesRegionExtents ($dst, $src)""" 4 .el .IP "\f(CW$X\->XFixesRegionExtents ($dst, $src)\fR" 4 .IX Item "$X->XFixesRegionExtents ($dst, $src)" Set region \f(CW$dst\fR to the rectangular bounds of region \f(CW$src\fR. If \f(CW$src\fR is empty then \f(CW$dst\fR is set to empty. .ie n .IP """($bounding, @parts) = $X\->XFixesFetchRegion ($region)""" 4 .el .IP "\f(CW($bounding, @parts) = $X\->XFixesFetchRegion ($region)\fR" 4 .IX Item "($bounding, @parts) = $X->XFixesFetchRegion ($region)" Return the rectangles which cover \f(CW$region\fR. Each returned element is an arrayref .Sp .Vb 1 \& [$x,$y,$width,$height] .Ve .Sp The first is a bounding rectangle, and after that the individual rectangles making up the region, in \*(L"YX-banded\*(R" order. .Sp .Vb 5 \& my ($bounding, @rects) = $X\->XFixesFetchRegion ($region); \& print "bounded by ",join(\*(Aq,\*(Aq,@$bounding); \& foreach my $rect (@rects) { \& print " rect part ",join(\*(Aq,\*(Aq,@$rect); \& } .Ve .ie n .IP """$X\->XFixesSetGCClipRegion ($gc, $clip_x_origin, $clip_y_origin, $region)""" 4 .el .IP "\f(CW$X\->XFixesSetGCClipRegion ($gc, $clip_x_origin, $clip_y_origin, $region)\fR" 4 .IX Item "$X->XFixesSetGCClipRegion ($gc, $clip_x_origin, $clip_y_origin, $region)" Set the clip mask of \f(CW$gc\fR (an \s-1XID\s0) to \f(CW$region\fR (an \s-1XID\s0), and set the clip origin to \f(CW$clip_x_origin\fR,\f(CW$clip_x_origin\fR. .Sp This is similar to the core \f(CW\*(C`SetClipRectangles()\*(C'\fR, but the rectangles are from \f(CW$region\fR (and no \*(L"ordering\*(R" parameter). .ie n .IP """$X\->XFixesSetWindowShapeRegion ($window, $kind, $x_offset, $y_offset, $region)""" 4 .el .IP "\f(CW$X\->XFixesSetWindowShapeRegion ($window, $kind, $x_offset, $y_offset, $region)\fR" 4 .IX Item "$X->XFixesSetWindowShapeRegion ($window, $kind, $x_offset, $y_offset, $region)" Set the shape mask of \f(CW$window\fR (an \s-1XID\s0) to \f(CW$region\fR, at offset \&\f(CW$x_offset\fR,\f(CW$y_offset\fR into the window. \f(CW$kind\fR is a ShapeKind, either \&\*(L"Bounding\*(R" or \*(L"Clip\*(R". .Sp This is similar to \f(CW\*(C`ShapeMask()\*(C'\fR (see X11::Protocol::Ext::SHAPE) with operation \*(L"Set\*(R" and a a region instead of a bitmap. .Sp It's not necessary to \f(CW\*(C`$X\->init_extension(\*(AqSHAPE\*(Aq)\*(C'\fR before using this request. If \s-1SHAPE\s0 is not available on the server then presumably this request gives an error reply. .ie n .IP """$X\->XFixesSetPictureClipRegion ($picture, $clip_x_origin, $clip_y_origin, $region)""" 4 .el .IP "\f(CW$X\->XFixesSetPictureClipRegion ($picture, $clip_x_origin, $clip_y_origin, $region)\fR" 4 .IX Item "$X->XFixesSetPictureClipRegion ($picture, $clip_x_origin, $clip_y_origin, $region)" Set the clip mask of \s-1RENDER \s0\f(CW$picture\fR (an \s-1XID\s0) to \f(CW$region\fR, and set the clip origin to \f(CW$clip_x_origin\fR,\f(CW$clip_x_origin\fR. .Sp This is similar to \f(CW\*(C`RenderSetPictureClipRectangles()\*(C'\fR, but the rectangles are from \f(CW$region\fR. .Sp Picture objects are from the \s-1RENDER\s0 extension (see X11::Protocol::Ext::RENDER). The request always exists, but is not useful without \s-1RENDER.\s0 .ie n .IP """$X\->XFixesSetCursorName ($cursor, $str)""" 4 .el .IP "\f(CW$X\->XFixesSetCursorName ($cursor, $str)\fR" 4 .IX Item "$X->XFixesSetCursorName ($cursor, $str)" Set a name for cursor object \f(CW$cursor\fR (an \s-1XID\s0). The name string \f(CW$str\fR is interned as an atom in the server and therefore should consist only of latin\-1 characters. (Perhaps in the future that might be enforced here, or wide chars converted.) .ie n .IP """($atom, $str) = $X\->XFixesGetCursorName ($cursor)""" 4 .el .IP "\f(CW($atom, $str) = $X\->XFixesGetCursorName ($cursor)\fR" 4 .IX Item "($atom, $str) = $X->XFixesGetCursorName ($cursor)" Get the name of mouse pointer cursor \f(CW$cursor\fR (an \s-1XID\s0), as set by \&\f(CW\*(C`XFixesSetCursorName()\*(C'\fR. .Sp The returned \f(CW$atom\fR is the name atom (an integer) and \f(CW$str\fR is the name string (which is the atom's name). If there's no name for \f(CW$cursor\fR then \&\f(CW$atom\fR is string \*(L"None\*(R" (or 0 if no \f(CW\*(C`$X\->{\*(Aqdo_interp\*(Aq}\*(C'\fR) and \f(CW$str\fR is empty "". .ie n .IP """($x,$y, $width,$height, $xhot,$yhot, $serial, $pixels, $atom, $str) = $X\->XFixesGetCursorImageAndName ()""" 4 .el .IP "\f(CW($x,$y, $width,$height, $xhot,$yhot, $serial, $pixels, $atom, $str) = $X\->XFixesGetCursorImageAndName ()\fR" 4 .IX Item "($x,$y, $width,$height, $xhot,$yhot, $serial, $pixels, $atom, $str) = $X->XFixesGetCursorImageAndName ()" Get the image and name of the current mouse pointer cursor. The return is per \f(CW\*(C`XFixesGetCursorImage()\*(C'\fR plus \f(CW\*(C`XFixesGetCursorName()\*(C'\fR described above. .ie n .IP """$X\->XFixesChangeCursor ($src, $dst)""" 4 .el .IP "\f(CW$X\->XFixesChangeCursor ($src, $dst)\fR" 4 .IX Item "$X->XFixesChangeCursor ($src, $dst)" Change the contents of cursor \f(CW$dst\fR (an \s-1XID\s0) to the contents of cursor \f(CW$src\fR (an \s-1XID\s0). .ie n .IP """$X\->XFixesChangeCursorByName ($src, $dst_str)""" 4 .el .IP "\f(CW$X\->XFixesChangeCursorByName ($src, $dst_str)\fR" 4 .IX Item "$X->XFixesChangeCursorByName ($src, $dst_str)" Change the contents of any cursors with name \f(CW$dst_str\fR (a string) to the contents of cursor \f(CW$src\fR. If there's no cursors with name \f(CW$dst_str\fR then do nothing. .SS "\s-1XFIXES\s0 version 3.0" .IX Subsection "XFIXES version 3.0" .ie n .IP """$X\->XFixesExpandRegion ($src, $dst, $left,$right,$top,$bottom)""" 4 .el .IP "\f(CW$X\->XFixesExpandRegion ($src, $dst, $left,$right,$top,$bottom)\fR" 4 .IX Item "$X->XFixesExpandRegion ($src, $dst, $left,$right,$top,$bottom)" Set region \f(CW$dst\fR (an \s-1XID\s0) to the rectangles of region \f(CW$src\fR, with each rectangle expanded by \f(CW$left\fR, \f(CW$right\fR, \f(CW$top\fR, \f(CW$bottom\fR many pixels in those respective directions. .Sp Notice it doesn't matter how \f(CW$src\fR is expressed as rectangles, the effect is as if each individual pixel in \f(CW$src\fR was expanded and the union of the result taken. .SS "\s-1XFIXES\s0 version 4.0" .IX Subsection "XFIXES version 4.0" .ie n .IP """$X\->XFixesHideCursor ($window)""" 4 .el .IP "\f(CW$X\->XFixesHideCursor ($window)\fR" 4 .IX Item "$X->XFixesHideCursor ($window)" .PD 0 .ie n .IP """$X\->XFixesShowCursor ($window)""" 4 .el .IP "\f(CW$X\->XFixesShowCursor ($window)\fR" 4 .IX Item "$X->XFixesShowCursor ($window)" .PD Hide or show the mouse pointer cursor while it's in \f(CW$window\fR (an \s-1XID\s0) or any subwindow of \f(CW$window\fR. .Sp This hiding for each window is a per-client setting. If more than one client requests hiding then the cursor remains hidden until all of them \&\*(L"show\*(R" again. If a client disconnects or is killed then its hides are automatically undone. .SS "\s-1XFIXES\s0 version 5.0" .IX Subsection "XFIXES version 5.0" .ie n .IP """$X\->XFixesCreatePointerBarrier ($barrier, $drawable, $x1,$y1, $x2,$y2, $directions)""" 4 .el .IP "\f(CW$X\->XFixesCreatePointerBarrier ($barrier, $drawable, $x1,$y1, $x2,$y2, $directions)\fR" 4 .IX Item "$X->XFixesCreatePointerBarrier ($barrier, $drawable, $x1,$y1, $x2,$y2, $directions)" .PD 0 .ie n .IP """$X\->XFixesCreatePointerBarrier ($barrier, $drawable, $x1,$y1, $x2,$y2, $directions, $deviceid...)""" 4 .el .IP "\f(CW$X\->XFixesCreatePointerBarrier ($barrier, $drawable, $x1,$y1, $x2,$y2, $directions, $deviceid...)\fR" 4 .IX Item "$X->XFixesCreatePointerBarrier ($barrier, $drawable, $x1,$y1, $x2,$y2, $directions, $deviceid...)" .PD Create \f(CW$barrier\fR (a new \s-1XID\s0) as a barrier object which prevents user mouse pointer movement across a line between points \f(CW\*(C`$x1,$y1\*(C'\fR and \f(CW\*(C`$x2,$y2\*(C'\fR. For example .Sp .Vb 4 \& my $barrier = $X\->new_rsrc; \& $X\->XFixesCreatePointerBarrier ($barrier, $X\->root, \& 100,100, 100,500, \& 0); .Ve .Sp X,Y coordinates are screen coordinates on the screen of \f(CW$drawable\fR. The line must be horizontal or vertical, so either \f(CW\*(C`$x1==$x2\*(C'\fR or \f(CW\*(C`$y1==$y2\*(C'\fR (but not both). A horizontal barrier is across the top edge of the line pixels, a vertical barrier is along the left edge of the line pixels. .Sp \&\f(CW$directions\fR is an integer \s-1OR\s0 of the follow bits for which directions to allow some movement across the line. A value 0 means no movement across is allowed. .Sp .Vb 4 \& PositiveX 1 \& PositiveY 2 \& NegativeX 4 \& NegativeY 8 .Ve .Sp For example on a horizontal line, value 8 would allow the pointer to move through the line in the negative Y direction (up the screen), and movement in the positive Y direction (down the screen) would still be forbidden. .Sp \&\f(CW$directions\fR can let the user move the mouse out of some sort of forbidden region but not go back in. .Sp Optional \f(CW$deviceid\fR arguments are X Input Extension 2.0 devices the barrier should apply to (see X11::Protocol::Ext::XInputExtension). With no arguments the barrier is just for the core protocol mouse pointer. Each argument can be .Sp .Vb 3 \& device ID integer \& "AllDevices" enum string, 0 \& "AllMasterDevices" enum string, 1 .Ve .Sp It's not necessary to \f(CW\*(C`$X\->init_extension(\*(AqXInputExtension\*(Aq)\*(C'\fR before using this request. .Sp The user can move the mouse pointer to go around a barrier line but by putting lines together a region can be constructed keeping the pointer inside or outside, or even making a maze to trick the user! .Sp Touchscreen pad input is not affected by barriers, and \&\f(CW\*(C`$X\->WarpPointer()\*(C'\fR can still move the pointer anywhere. .Sp One intended use is when a Xinerama screen (see X11::Protocol::Ext::XINERAMA) is made from monitors of different pixel sizes so parts of the logical screen extent are off the edge of one of the smaller monitors. Barriers can prevent the user losing the mouse in one of those dead regions. .Sp For reference, some X.org server versions prior to some time around version 1.14 did not accept \f(CW$deviceid\fR arguments in the request and gave a \&\f(CW\*(C`Length\*(C'\fR error on attempting to pass them. Those servers might have given an \f(CW\*(C`Implementation\*(C'\fR error anyway (for barrier feature not yet implemented). .ie n .IP """$X\->XFixesDestroyPointerBarrier ($barrier)""" 4 .el .IP "\f(CW$X\->XFixesDestroyPointerBarrier ($barrier)\fR" 4 .IX Item "$X->XFixesDestroyPointerBarrier ($barrier)" Destroy the given barrier (an \s-1XID\s0). .SH "EVENTS" .IX Header "EVENTS" The following events have the usual fields .PP .Vb 4 \& name "XFixes..." \& synthetic true if from a SendEvent \& code integer opcode \& sequence_number integer .Ve .ie n .IP """XFixesSelectionNotify""" 4 .el .IP "\f(CWXFixesSelectionNotify\fR" 4 .IX Item "XFixesSelectionNotify" This is sent to the client when selected by \f(CW\*(C`XFixesSelectSelectionInput\*(C'\fR above. It reports changes to the selection. The event-specific fields are .Sp .Vb 6 \& subtype enum string \& window XID \& owner XID of owner window, or "None" \& selection atom integer \& time integer, server timestamp \& selection_time integer, server timestamp .Ve .Sp \&\f(CW\*(C`subtype\*(C'\fR is one of .Sp .Vb 3 \& SetSelectionOwner \& SelectionWindowDestroy \& SelectionClientClose .Ve .Sp \&\f(CW\*(C`time\*(C'\fR is when the event was generated, \f(CW\*(C`selection_time\*(C'\fR is when the selection was owned. .ie n .IP """XFixesCursorNotify""" 4 .el .IP "\f(CWXFixesCursorNotify\fR" 4 .IX Item "XFixesCursorNotify" This is sent to the client when selected by \f(CW\*(C`XFixesSelectCursorInput()\*(C'\fR above. It reports when the currently displayed mouse pointer cursor has changed. It has the following event-specific fields, .Sp .Vb 5 \& subtype enum string, currently always "DisplayCursor" \& window XID \& cursor_serial integer \& time integer, server timestamp \& cursor_name atom or "None" (XFIXES 2.0 up) .Ve .Sp \&\f(CW\*(C`subtype\*(C'\fR is \*(L"DisplayCursor\*(R" when the displayed cursor has changed. This is the only subtype currently. .Sp \&\f(CW\*(C`cursor_serial\*(C'\fR is a serial number as per \f(CW\*(C`XFixesGetCursorImage()\*(C'\fR. A client can use this to notice when the displayed cursor is something it has already fetched with \f(CW\*(C`XFixesGetCursorImage()\*(C'\fR. .Sp \&\f(CW\*(C`cursor_name\*(C'\fR is the atom of the name given to the cursor by \&\f(CW\*(C`XFixesSetCursorName\*(C'\fR, or string \*(L"None\*(R" if no name. This field is new in \&\s-1XFIXES 2.0\s0 and is present in the event unpack only if the server does \s-1XFIXES 2.0\s0 or higher. For \f(CW\*(C`$X\->pack_event()\*(C'\fR, \f(CW\*(C`cursor_name\*(C'\fR is optional and the field is set if given. .SH "ERRORS" .IX Header "ERRORS" Error type \*(L"Region\*(R" is a bad \f(CW$region\fR resource \s-1XID\s0 in a request (\s-1XFIXES 2.0\s0 up). .SH "SEE ALSO" .IX Header "SEE ALSO" X11::Protocol, X11::Protocol::Ext::SHAPE, X11::Protocol::Ext::RENDER .PP \&\fI/usr/share/doc/x11proto\-fixes\-dev/fixesproto.txt.gz\fR .SH "HOME PAGE" .IX Header "HOME PAGE" .SH "LICENSE" .IX Header "LICENSE" Copyright 2011, 2012, 2013, 2014 Kevin Ryde .PP X11\-Protocol\-Other is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. .PP X11\-Protocol\-Other is distributed in the hope that it will be useful, but \&\s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE. \s0 See the \s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with X11\-Protocol\-Other. If not, see .