.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "X11::CursorFont 3" .TH X11::CursorFont 3 2025-12-14 "perl v5.42.0" "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::CursorFont \- cursor font glyph names and numbers .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 3 \& use X11::CursorFont \*(Aq%CURSOR_GLYPH\*(Aq; \& my $num = $CURSOR_GLYPH{\*(Aqfleur\*(Aq}; # is 52 \& my $name = $X11::CursorFont::CURSOR_NAME[52]; # is "fleur" .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This is the names and numbers of the glyphs in the X11 cursor font which contains various standard mouse pointer cursors. .PP \&\f(CW%CURSOR_GLYPH\fR maps a glyph name to its character number in the font, .PP .Vb 1 \& $CURSOR_GLYPH{\*(Aqfleur\*(Aq} # is 52 .Ve .PP \&\f(CW@CURSOR_NAME\fR conversely is indexed by character number and gives the glyph name, .PP .Vb 1 \& $CURSOR_NAME[52] # is "fleur" .Ve .PP Each glyph has an associated mask at character number glyph+1 which is the shape of the cursor (the displayed vs transparent pixels). So the character numbers are always even and in \f(CW@CURSOR_NAME\fR only the even character positions have names. .PP The cursor images can be viewed with the usual \f(CW\*(C`xfd\*(C'\fR font display program, .PP .Vb 1 \& xfd \-fn cursor .Ve .PP The names are per the Xlib \fI/usr/include/X11/cursorfont.h\fR file, without the \f(CW\*(C`XC_\*(C'\fR prefixes. The full list is .PP .Vb 1 \& Name Number \& \& X_cursor 0 default fat X \& arrow 2 \& based_arrow_down 4 \& based_arrow_up 6 \& boat 8 \& bogosity 10 \& bottom_left_corner 12 \& bottom_right_corner 14 \& bottom_side 16 \& bottom_tee 18 \& box_spiral 20 a square spiral \& center_ptr 22 \& circle 24 \& clock 26 \& coffee_mug 28 \& cross 30 \& cross_reverse 32 \& crosshair 34 "+" shape \& diamond_cross 36 \& dot 38 \& dotbox 40 \& double_arrow 42 \& draft_large 44 \& draft_small 46 \& draped_box 48 \& exchange 50 \& fleur 52 \& gobbler 54 \& gumby 56 \& hand1 58 \& hand2 60 \& heart 62 \& icon 64 \& iron_cross 66 \& left_ptr 68 \& left_side 70 \& left_tee 72 \& leftbutton 74 \& ll_angle 76 \& lr_angle 78 \& man 80 \& middlebutton 82 \& mouse 84 \& pencil 86 \& pirate 88 skull and crossbones \& plus 90 \& question_arrow 92 \& right_ptr 94 \& right_side 96 \& right_tee 98 \& rightbutton 100 \& rtl_logo 102 \& sailboat 104 \& sb_down_arrow 106 \& sb_h_double_arrow 108 \& sb_left_arrow 110 \& sb_right_arrow 112 \& sb_up_arrow 114 \& sb_v_double_arrow 116 \& shuttle 118 \& sizing 120 \& spider 122 \& spraycan 124 \& star 126 \& target 128 \& tcross 130 \& top_left_arrow 132 \& top_left_corner 134 \& top_right_corner 136 \& top_side 138 \& top_tee 140 \& trek 142 \& ul_angle 144 \& umbrella 146 \& ur_angle 148 \& watch 150 a good "busy" indicator \& xterm 152 a vertical insertion bar .Ve .PP \&\f(CW\*(C`X_cursor\*(C'\fR is the usual default when the server first starts or when the root window is set to cursor "None". .SH VARIABLES .IX Header "VARIABLES" .ie n .IP %X11::CursorFont::CURSOR_GLYPH 4 .el .IP \f(CW%X11::CursorFont::CURSOR_GLYPH\fR 4 .IX Item "%X11::CursorFont::CURSOR_GLYPH" A mapping of glyph name to cursor font character number. .ie n .IP @X11::CursorFont::CURSOR_NAME 4 .el .IP \f(CW@X11::CursorFont::CURSOR_NAME\fR 4 .IX Item "@X11::CursorFont::CURSOR_NAME" A table of cursor font character number to glyph name. .SH EXPORTS .IX Header "EXPORTS" Nothing is exported by default, but \f(CW%CURSOR_GLYPH\fR and \f(CW@CURSOR_NAME\fR can be selected in usual \f(CW\*(C`Exporter\*(C'\fR style (see Exporter), .PP .Vb 1 \& use X11::CursorFont \*(Aq%CURSOR_GLYPH\*(Aq, \*(Aq@CURSOR_NAME\*(Aq; .Ve .SH EXAMPLE .IX Header "EXAMPLE" To create a cursor from a desired glyph, .PP .Vb 2 \& my $cursor_name = \*(Aqspraycan\*(Aq; \& my $cursor_glyph = $CURSOR_GLYPH{$cursor_name}; # number \& \& my $cursor_font = $X\->new_rsrc; \& $X\->OpenFont ($cursor_font, "cursor"); # cursor font \& \& my $cursor = $X\->new_rsrc; \& $X\->CreateGlyphCursor \& ($cursor, \& $cursor_font, # font \& $cursor_font, # mask font \& $cursor_glyph, # glyph \& $cursor_glyph + 1, # and its mask \& 0,0,0, # foreground, black \& 0xFFFF,0xFFFF,0xFFFF); # background, white \& \& $X\->CloseFont ($cursor_font); \& \& # then use $cursor with CreateWindow or ChangeWindowAttributes \& # cursor => $cursor .Ve .PP The \f(CW$cursor_font\fR could be kept open if used repeatedly. Opening and closing isn\*(Aqt a round\-trip, so an open when needed may be enough. .PP Any RGB colours can be given in \f(CWCreateGlyphCursor()\fR, but actual appearance on screen will be limited by the hardware. .PP All cursors in the core protocol are two\-colours with pixels fully opaque or fully transparent as per this create. The RENDER extension, when available, can make multi\-colour and partial transparency if desired (see X11::Protocol::Ext::RENDER). .SH "SEE ALSO" .IX Header "SEE ALSO" X11::Protocol, X11::KeySyms .PP \&\fI/usr/include/X11/cursorfont.h\fR and listing in the Xlib manual appendix B (\f(CW\*(C`http://www.x.org/docs/X11/\*(C'\fR or \&\fI/usr/share/doc/libx11\-dev/libX11.txt.gz\fR). .PP Xlib Xmu \f(CWXmuCursorNameToIndex()\fR (\f(CW\*(C`http://www.x.org/docs/Xmu/\*(C'\fR or \&\fI/usr/share/doc/libxmu\-headers/Xmu.txt.gz\fR) .PP \&\fBxfd\fR\|(1) to display the cursor font. .PP \&\fBxsetroot\fR\|(1) to change the root window cursor. .SH "HOME PAGE" .IX Header "HOME PAGE" .SH LICENSE .IX Header "LICENSE" Copyright 2011, 2012, 2013, 2014, 2017 Kevin Ryde .PP X11\-Protocol\-Other is free software; you can redistribute it and/or modify it under the terms of the GNU 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 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .PP You should have received a copy of the GNU General Public License along with X11\-Protocol\-Other. If not, see .