.\" 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 "GUITest 3pm" .TH GUITest 3pm "2014-04-11" "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::GUITest \- Provides GUI testing/interaction routines. .SH "VERSION" .IX Header "VERSION" 0.28 .PP Updates are made available at the following sites: .PP .Vb 2 \& http://sourceforge.net/projects/x11guitest \& http://www.cpan.org .Ve .PP Please consult 'docs/Changes' for the list of changes between module revisions. .SH "DESCRIPTION" .IX Header "DESCRIPTION" This Perl package is intended to facilitate the testing of \s-1GUI\s0 applications by means of user emulation. It can be used to test/interact with \s-1GUI\s0 applications; which have been built upon the X library or toolkits (i.e., \s-1GTK+,\s0 Xt, Qt, Motif, etc.) that \*(L"wrap\*(R" the X library's functionality. .PP A basic recorder (x11guirecord) is also available, and can be found in the source code repository. .SH "DEPENDENCIES" .IX Header "DEPENDENCIES" An X server with the XTest extensions enabled. This seems to be the norm. If it is not enabled, it usually can be by modifying the X server configuration (i.e., XF86Config). .PP The standard \s-1DISPLAY\s0 environment variable is utilized to determine the host, display, and screen to work with. By default it is usually set to \*(L":0.0\*(R" for the localhost. However, by altering this variable one can interact with applications under a remote host's X server. To change this from a terminal window, one can utilize the following basic syntax: export DISPLAY=:. Please note that under most circumstances, xhost will need to be executed properly on the remote host as well. .PP There is a known incompatibility between the XTest and Xinerama extensions, which causes the \fIXTestFakeMotionEvent()\fR function to misbehave. When the Xinerama (X server) extension is turned on, this (Perl) extension has been modified to allow one to invoke an alternative function. See Makefile.PL for details. .SH "INSTALLATION" .IX Header "INSTALLATION" .Vb 4 \& perl Makefile.PL \& make \& make test \& make install \& \& # If the build has errors, you may need to install the following dependencies: \& # libxt\-dev, libxtst\-dev \& \& # If you\*(Aqd like to install the recorder, use these steps: \& cd recorder \& ./autogen.sh \& ./configure \& make \& make install \& x11guirecord \-\-help .Ve .SH "SYNOPSIS" .IX Header "SYNOPSIS" For additional examples, please look under the 'eg/' sub-directory from the installation folder. .PP .Vb 5 \& use X11::GUITest qw/ \& StartApp \& WaitWindowViewable \& SendKeys \& /; \& \& # Start gedit application \& StartApp(\*(Aqgedit\*(Aq); \& \& # Wait for application window to come up and become viewable. \& my ($GEditWinId) = WaitWindowViewable(\*(Aqgedit\*(Aq); \& if (!$GEditWinId) { \& die("Couldn\*(Aqt find gedit window in time!"); \& } \& \& # Send text to it \& SendKeys("Hello, how are you?\en"); \& \& # Close Application (Alt\-f, q). \& SendKeys(\*(Aq%(f)q\*(Aq); \& \& # Handle gedit\*(Aqs Question window if it comes up when closing. Wait \& # at most 5 seconds for it. \& if (WaitWindowViewable(\*(AqQuestion\*(Aq, undef, 5)) { \& # DoN\*(Aqt Save (Alt\-n) \& SendKeys(\*(Aq%(n)\*(Aq); \& } .Ve .SH "FUNCTIONS" .IX Header "FUNCTIONS" Parameters enclosed within [] are optional. .PP If there are multiple optional parameters available for a function and you would like to specify the last one, for example, you can utilize undef for those parameters you don't specify. .PP \&\s-1REGEX\s0 in the documentation below denotes an item that is treated as a regular expression. For example, the regex \*(L"^OK$\*(R" would look for an exact match for the word \s-1OK.\s0 .IP "FindWindowLike \s-1TITLEREGEX\s0 [, \s-1WINDOWIDSTARTUNDER\s0]" 8 .IX Item "FindWindowLike TITLEREGEX [, WINDOWIDSTARTUNDER]" Finds the window Ids of the windows matching the specified title regex. Optionally one can specify the window to start under; which would allow one to constrain the search to child windows of that window. .Sp An array of window Ids is returned for the matches found. An empty array is returned if no matches were found. .Sp .Vb 3 \& my @WindowIds = FindWindowLike(\*(Aqgedit\*(Aq); \& # Only worry about first window found \& my ($WindowId) = FindWindowLike(\*(Aqgedit\*(Aq); .Ve .IP "WaitWindowLike \s-1TITLEREGEX\s0 [, \s-1WINDOWIDSTARTUNDER\s0] [, \s-1MAXWAITINSECONDS\s0]" 8 .IX Item "WaitWindowLike TITLEREGEX [, WINDOWIDSTARTUNDER] [, MAXWAITINSECONDS]" Waits for a window to come up that matches the specified title regex. Optionally one can specify the window to start under; which would allow one to constrain the search to child windows of that window. .Sp One can optionally specify an alternative wait amount in seconds. A window will keep being looked for that matches the specified title regex until this amount of time has been reached. The default amount is defined in the \s-1DEF_WAIT\s0 constant available through the :CONST export tag. .Sp If a window is going to be manipulated by input, WaitWindowViewable is the more robust solution to utilize. .Sp An array of window Ids is returned for the matches found. An empty array is returned if no matches were found. .Sp .Vb 3 \& my @WindowIds = WaitWindowLike(\*(Aqgedit\*(Aq); \& # Only worry about first window found \& my ($WindowId) = WaitWindowLike(\*(Aqgedit\*(Aq); \& \& WaitWindowLike(\*(Aqgedit\*(Aq) or die("gedit window not found!"); .Ve .IP "WaitWindowViewable \s-1TITLEREGEX\s0 [, \s-1WINDOWIDSTARTUNDER\s0] [, \s-1MAXWAITINSECONDS\s0]" 8 .IX Item "WaitWindowViewable TITLEREGEX [, WINDOWIDSTARTUNDER] [, MAXWAITINSECONDS]" Similar to WaitWindow, but only recognizes windows that are viewable. When \s-1GUI\s0 applications are started, their window isn't necessarily viewable yet, let alone available for input, so this function is very useful. .Sp Likewise, this function will only return an array of the matching window Ids for those windows that are viewable. An empty array is returned if no matches were found. .IP "WaitWindowClose \s-1WINDOWID\s0 [, \s-1MAXWAITINSECONDS\s0]" 8 .IX Item "WaitWindowClose WINDOWID [, MAXWAITINSECONDS]" Waits for the specified window to close. .Sp One can optionally specify an alternative wait amount in seconds. The window will keep being checked to see if it has closed until this amount of time has been reached. The default amount is defined in the \s-1DEF_WAIT\s0 constant available through the :CONST export tag. .Sp zero is returned if window is not gone, non-zero if it is gone. .IP "WaitSeconds \s-1SECONDS\s0" 8 .IX Item "WaitSeconds SECONDS" Pauses execution for the specified amount of seconds. .Sp .Vb 2 \& WaitSeconds(0.5); # Wait 1/2 second \& WaitSeconds(3); # Wait 3 seconds .Ve .IP "ClickWindow \s-1WINDOWID\s0 [, X Offset] [, Y Offset] [, Button]" 8 .IX Item "ClickWindow WINDOWID [, X Offset] [, Y Offset] [, Button]" Clicks on the specified window with the mouse. .Sp Optionally one can specify the X offset and Y offset. By default, the top left corner of the window is clicked on, with these two parameters one can specify a different position to be clicked on. .Sp One can also specify an alternative button. The default button is M_LEFT, but M_MIDDLE and M_RIGHT may be specified too. Also, you could use the logical Id for the button: M_BTN1, M_BTN2, M_BTN3, M_BTN4, M_BTN5. These are all available through the :CONST export tag. .Sp zero is returned on failure, non-zero for success .IP "GetWindowsFromPid" 8 .IX Item "GetWindowsFromPid" Returns a list of window ids discovered for the specified process id (pid). .Sp undef is returned on error. .IP "GetWindowFromPoint X, Y [, \s-1SCREEN\s0]" 8 .IX Item "GetWindowFromPoint X, Y [, SCREEN]" Returns the window that is at the specified point. If no screen is given, it is taken from the value given when opening the X display. .Sp zero is returned if there are no matches (i.e., off screen). .IP "IsChild \s-1PARENTWINDOWID, WINDOWID\s0" 8 .IX Item "IsChild PARENTWINDOWID, WINDOWID" Determines if the specified window is a child of the specified parent. .Sp zero is returned for false, non-zero for true. .IP "QuoteStringForSendKeys \s-1STRING\s0" 8 .IX Item "QuoteStringForSendKeys STRING" Quotes {} characters in the specified string that would be interpreted as having special meaning if sent to SendKeys directly. This function would be useful if you had a text file in which you wanted to use each line of the file as input to the SendKeys function, but didn't want any special interpretation of the characters in the file. .Sp Returns the quoted string, undef is returned on error. .Sp .Vb 3 \& # Quote ~, %, etc. as {~}, {%}, etc for literal use in SendKeys. \& SendKeys( QuoteStringForSendKeys(\*(AqHello: ~%^(){}+#\*(Aq) ); \& SendKeys( QSfSK(\*(Aq#+#\*(Aq) ); .Ve .Sp The international AltGr key \- modifier character (&) is not escaped by this function. Escape this character manually (\*(L"{&}\*(R"), if used/needed. .IP "StartApp \s-1COMMANDLINE\s0" 8 .IX Item "StartApp COMMANDLINE" Uses the shell to execute a program. This function returns as soon as the program is called. Useful for starting \s-1GUI\s0 /applications and then going on to work with them. .Sp zero is returned on failure, non-zero for success .Sp .Vb 1 \& StartApp(\*(Aqgedit\*(Aq); .Ve .IP "RunApp \s-1COMMANDLINE\s0" 8 .IX Item "RunApp COMMANDLINE" Uses the shell to execute a program until its completion. .Sp Return value will be application specific, however \-1 is returned to indicate a failure in starting the program. .Sp .Vb 1 \& RunApp(\*(Aq/work/myapp\*(Aq); .Ve .IP "ClickMouseButton \s-1BUTTON\s0" 8 .IX Item "ClickMouseButton BUTTON" Clicks the specified mouse button. Available mouse buttons are: M_LEFT, M_MIDDLE, M_RIGHT, M_DOWN, M_UP. Also, you could use the logical Id for the button: M_BTN1, M_BTN2, M_BTN3, M_BTN4, M_BTN5. These are all available through the :CONST export tag. .Sp zero is returned on failure, non-zero for success. .IP "DefaultScreen" 8 .IX Item "DefaultScreen" Returns the screen number specified in the X display value used to open the display. .Sp Leverages the Xlib macro of the same name. .IP "ScreenCount" 8 .IX Item "ScreenCount" Returns the number of screens in the X display specified when opening it. .Sp Leverages the Xlib macro of the same name. .IP "SetEventSendDelay \s-1DELAYINMILLISECONDS\s0" 8 .IX Item "SetEventSendDelay DELAYINMILLISECONDS" Sets the milliseconds of delay between events being sent to the X display. It is usually not a good idea to set this to 0. .Sp Please note that this delay will also affect SendKeys. .Sp Returns the old delay amount in milliseconds. .IP "GetEventSendDelay" 8 .IX Item "GetEventSendDelay" Returns the current event sending delay amount in milliseconds. .IP "SetKeySendDelay \s-1DELAYINMILLISECONDS\s0" 8 .IX Item "SetKeySendDelay DELAYINMILLISECONDS" Sets the milliseconds of delay between keystrokes. .Sp Returns the old delay amount in milliseconds. .IP "GetKeySendDelay" 8 .IX Item "GetKeySendDelay" Returns the current keystroke sending delay amount in milliseconds. .IP "GetWindowName \s-1WINDOWID\s0" 8 .IX Item "GetWindowName WINDOWID" Returns the window name for the specified window Id. undef is returned if name could not be obtained. .Sp .Vb 2 \& # Return the name of the window that has the input focus. \& my $WinName = GetWindowName(GetInputFocus()); .Ve .IP "GetWindowPid \s-1WINDOWID\s0" 8 .IX Item "GetWindowPid WINDOWID" Returns the process id (pid) associated with the specified window. 0 is returned if the pid is not available. .Sp .Vb 2 \& # Return the pid of the window that has the input focus. \& my $pid = GetWindowPid(GetInputFocus()); .Ve .IP "SetWindowName \s-1WINDOWID, NAME\s0" 8 .IX Item "SetWindowName WINDOWID, NAME" Sets the window name for the specified window Id. .Sp zero is returned on failure, non-zero for success. .IP "GetRootWindow [\s-1SCREEN\s0]" 8 .IX Item "GetRootWindow [SCREEN]" Returns the Id of the root window of the screen. This is the top/root level window that all other windows are under. If no screen is given, it is taken from the value given when opening the X display. .IP "GetChildWindows \s-1WINDOWID\s0" 8 .IX Item "GetChildWindows WINDOWID" Returns an array of the child windows for the specified window Id. If it detects that the window hierarchy is in transition, it will wait half a second and try again. .IP "MoveMouseAbs X, Y [, \s-1SCREEN\s0]" 8 .IX Item "MoveMouseAbs X, Y [, SCREEN]" Moves the mouse cursor to the specified absolute position in the optionally given screen. If no screen is given, it is taken from the value given when opening the X display. .Sp Zero is returned on failure, non-zero for success. .IP "GetMousePos" 8 .IX Item "GetMousePos" Returns an array containing the position and the screen (number) of the mouse cursor. .Sp .Vb 1 \& my ($x, $y, $scr_num) = GetMousePos(); .Ve .IP "PressMouseButton \s-1BUTTON\s0" 8 .IX Item "PressMouseButton BUTTON" Presses the specified mouse button. Available mouse buttons are: M_LEFT, M_MIDDLE, M_RIGHT, M_DOWN, M_UP. Also, you could use the logical Id for the button: M_BTN1, M_BTN2, M_BTN3, M_BTN4, M_BTN5. These are all available through the :CONST export tag. .Sp zero is returned on failure, non-zero for success. .IP "ReleaseMouseButton \s-1BUTTON\s0" 8 .IX Item "ReleaseMouseButton BUTTON" Releases the specified mouse button. Available mouse buttons are: M_LEFT, M_MIDDLE, M_RIGHT, M_DOWN, M_UP. Also, you could use the logical Id for the button: M_BTN1, M_BTN2, M_BTN3, M_BTN4, M_BTN5. These are all available through the :CONST export tag. .Sp zero is returned on failure, non-zero for success. .IP "SendKeys \s-1KEYS\s0" 8 .IX Item "SendKeys KEYS" Sends keystrokes to the window that has the input focus. .Sp The keystrokes to send are those specified in \s-1KEYS\s0 parameter. Some characters have special meaning, they are: .Sp .Vb 6 \& Modifier Keys: \& ^ CTRL \& % ALT \& + SHIFT \& # META \& & ALTGR \& \& Other Keys: \& ~ ENTER \& \en ENTER \& \et TAB \& ( and ) MODIFIER GROUPING \& { and } QUOTE / ESCAPE CHARACTERS .Ve .Sp Simply, one can send a text string like so: .Sp .Vb 1 \& SendKeys(\*(AqHello, how are you today?\*(Aq); .Ve .Sp Parenthesis allow a modifier to work on one or more characters. For example: .Sp .Vb 5 \& SendKeys(\*(Aq%(f)q\*(Aq); # Alt\-f, then press q \& SendKeys(\*(Aq%(fa)^(m)\*(Aq); # Alt\-f, Alt\-a, Ctrl\-m \& SendKeys(\*(Aq+(abc)\*(Aq); # Uppercase ABC using shift modifier \& SendKeys(\*(Aq^(+(l))\*(Aq); # Ctrl\-Shift\-l \& SendKeys(\*(Aq+\*(Aq); # Press shift .Ve .Sp Braces are used to quote special characters, for utilizing aliased key names, or for special functionality. Multiple characters can be specified in a brace by space delimiting the entries. Characters can be repeated using a number that is space delimited after the preceding key. .Sp Quote Special Characters .Sp .Vb 3 \& SendKeys(\*(Aq{{}\*(Aq); # { \& SendKeys(\*(Aq{+}\*(Aq); # + \& SendKeys(\*(Aq{#}\*(Aq); # # \& \& You can also use QuoteStringForSendKeys (QSfSK) to perform quoting. .Ve .Sp Aliased Key Names .Sp .Vb 4 \& SendKeys(\*(Aq{BAC}\*(Aq); # Backspace \& SendKeys(\*(Aq{F1 F2 F3}\*(Aq); # F1, F2, F3 \& SendKeys(\*(Aq{TAB 3}\*(Aq); # Press TAB 3 times \& SendKeys(\*(Aq{SPC 3 a b c}\*(Aq); # Space 3 times, a, b, c .Ve .Sp Special Functionality .Sp .Vb 2 \& # Pause execution for 500 milliseconds \& SendKeys(\*(Aq{PAUSE 500}\*(Aq); .Ve .Sp Combinations .Sp .Vb 2 \& SendKeys(\*(Aqabc+(abc){TAB PAUSE 500}\*(Aq); # a, b, c, A, B, C, Tab, Pause 500 \& SendKeys(\*(Aq+({a b c})\*(Aq); # A, B, C .Ve .Sp The following abbreviated key names are currently recognized within a brace set. If you don't see the desired key, you can still use the unabbreviated name for the key. If you are unsure of this name, utilize the xev (X event view) tool, press the key you want and look at the tools output for the name of that key. Names that are in the list below can be utilized regardless of case. Ones that aren't in this list are going to be case sensitive and also not abbreviated. For example, using 'xev' you will find that the name of the backspace key is BackSpace, so you could use {BackSpace} in place of {bac} if you really wanted to. .Sp .Vb 10 \& Name Action \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& BAC BackSpace \& BS BackSpace \& BKS BackSpace \& BRE Break \& CAN Cancel \& CAP Caps_Lock \& DEL Delete \& DOWN Down \& END End \& ENT Return \& ESC Escape \& F1 F1 \& ... ... \& F12 F12 \& HEL Help \& HOM Home \& INS Insert \& LAL Alt_L \& LMA Meta_L \& LCT Control_L \& LEF Left \& LSH Shift_L \& LSK Super_L \& MNU Menu \& NUM Num_Lock \& PGD Page_Down \& PGU Page_Up \& PRT Print \& RAL Alt_R \& RMA Meta_R \& RCT Control_R \& RIG Right \& RSH Shift_R \& RSK Super_R \& SCR Scroll_Lock \& SPA Space \& SPC Space \& TAB Tab \& UP Up .Ve .Sp zero is returned on failure, non-zero for success. For configurations (Xvfb) that don't support Alt_Left, Meta_Left is automatically used in its place. .IP "PressKey \s-1KEY\s0" 8 .IX Item "PressKey KEY" Presses the specified key. .Sp One can utilize the abbreviated key names from the table listed above as outlined in the following example: .Sp .Vb 5 \& # Alt\-n \& PressKey(\*(AqLAL\*(Aq); # Left Alt \& PressKey(\*(Aqn\*(Aq); \& ReleaseKey(\*(Aqn\*(Aq); \& ReleaseKey(\*(AqLAL\*(Aq); \& \& # Uppercase a \& PressKey(\*(AqLSH\*(Aq); # Left Shift \& PressKey(\*(Aqa\*(Aq); \& ReleaseKey(\*(Aqa\*(Aq); \& ReleaseKey(\*(AqLSH\*(Aq); .Ve .Sp The ReleaseKey calls in the above example are there to set both key states back. .Sp zero is returned on failure, non-zero for success. .IP "ReleaseKey \s-1KEY\s0" 8 .IX Item "ReleaseKey KEY" Releases the specified key. Normally follows a PressKey call. .Sp One can utilize the abbreviated key names from the table listed above. .Sp .Vb 1 \& ReleaseKey(\*(Aqn\*(Aq); .Ve .Sp zero is returned on failure, non-zero for success. .IP "PressReleaseKey \s-1KEY\s0" 8 .IX Item "PressReleaseKey KEY" Presses and releases the specified key. .Sp One can utilize the abbreviated key names from the table listed above. .Sp .Vb 1 \& PressReleaseKey(\*(Aqn\*(Aq); .Ve .Sp This function is affected by the key send delay. .Sp zero is returned on failure, non-zero for success. .IP "IsKeyPressed \s-1KEY\s0" 8 .IX Item "IsKeyPressed KEY" Determines if the specified key is currently being pressed. .Sp You can specify such things as 'bac' or the unabbreviated form 'BackSpace' as covered in the SendKeys information. Brace forms such as '{bac}' are unsupported. A '{' is taken literally and letters are case sensitive. .Sp .Vb 3 \& if (IsKeyPressed(\*(Aqesc\*(Aq)) { # Is Escape pressed? \& if (IsKeyPressed(\*(Aqa\*(Aq)) { # Is a pressed? \& if (IsKeyPressed(\*(AqA\*(Aq)) { # Is A pressed? .Ve .Sp Returns non-zero for true, zero for false. .IP "IsMouseButtonPressed \s-1BUTTON\s0" 8 .IX Item "IsMouseButtonPressed BUTTON" Determines if the specified mouse button is currently being pressed. .Sp Available mouse buttons are: M_LEFT, M_MIDDLE, M_RIGHT. Also, you could use the logical Id for the button: M_BTN1, M_BTN2, M_BTN3, M_BTN4, M_BTN5. These are all available through the :CONST export tag. .Sp .Vb 1 \& if (IsMouseButtonPressed(M_LEFT)) { # Is left button pressed? .Ve .Sp Returns non-zero for true, zero for false. .IP "IsWindow \s-1WINDOWID\s0" 8 .IX Item "IsWindow WINDOWID" zero is returned if the specified window Id is not for something that can be recognized as a window. non-zero is returned if it looks like a window. .IP "IsWindowViewable \s-1WINDOWID\s0" 8 .IX Item "IsWindowViewable WINDOWID" zero is returned if the specified window Id is for a window that isn't viewable. non-zero is returned if the window is viewable. .IP "IsWindowCursor \s-1WINDOWID CURSOR\s0" 8 .IX Item "IsWindowCursor WINDOWID CURSOR" Determines if the specified window has the specified cursor. .Sp zero is returned for false, non-zero for true. .Sp The following cursors are available through the :CONST export tag. .Sp .Vb 10 \& Name \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& XC_NUM_GLYPHS \& XC_X_CURSOR \& XC_ARROW \& XC_BASED_ARROW_DOWN \& XC_BASED_ARROW_UP \& XC_BOAT \& XC_BOGOSITY \& XC_BOTTOM_LEFT_CORNER \& XC_BOTTOM_RIGHT_CORNER \& XC_BOTTOM_SIDE \& XC_BOTTOM_TEE \& XC_BOX_SPIRAL \& XC_CENTER_PTR \& XC_CIRCLE \& XC_CLOCK \& XC_COFFEE_MUG \& XC_CROSS \& XC_CROSS_REVERSE \& XC_CROSSHAIR \& XC_DIAMOND_CROSS \& XC_DOT \& XC_DOTBOX \& XC_DOUBLE_ARROW \& XC_DRAFT_LARGE \& XC_DRAFT_SMALL \& XC_DRAPED_BOX \& XC_EXCHANGE \& XC_FLEUR \& XC_GOBBLER \& XC_GUMBY \& XC_HAND1 \& XC_HAND2 \& XC_HEART \& XC_ICON \& XC_IRON_CROSS \& XC_LEFT_PTR \& XC_LEFT_SIDE \& XC_LEFT_TEE \& XC_LEFTBUTTON \& XC_LL_ANGLE \& XC_LR_ANGLE \& XC_MAN \& XC_MIDDLEBUTTON \& XC_MOUSE \& XC_PENCIL \& XC_PIRATE \& XC_PLUS \& XC_QUESTION_ARROW \& XC_RIGHT_PTR \& XC_RIGHT_SIDE \& XC_RIGHT_TEE \& XC_RIGHTBUTTON \& XC_RTL_LOGO \& XC_SAILBOAT \& XC_SB_DOWN_ARROW \& XC_SB_H_DOUBLE_ARROW \& XC_SB_LEFT_ARROW \& XC_SB_RIGHT_ARROW \& XC_SB_UP_ARROW \& XC_SB_V_DOUBLE_ARROW \& XC_SHUTTLE \& XC_SIZING \& XC_SPIDER \& XC_SPRAYCAN \& XC_STAR \& XC_TARGET \& XC_TCROSS \& XC_TOP_LEFT_ARROW \& XC_TOP_LEFT_CORNER \& XC_TOP_RIGHT_CORNER \& XC_TOP_SIDE \& XC_TOP_TEE \& XC_TREK \& XC_UL_ANGLE \& XC_UMBRELLA \& XC_UR_ANGLE \& XC_WATCH \& XC_XTERM .Ve .IP "MoveWindow \s-1WINDOWID, X, Y\s0" 8 .IX Item "MoveWindow WINDOWID, X, Y" Moves the window to the specified location. .Sp zero is returned on failure, non-zero for success. .IP "ResizeWindow \s-1WINDOWID, WIDTH, HEIGHT\s0" 8 .IX Item "ResizeWindow WINDOWID, WIDTH, HEIGHT" Resizes the window to the specified size. .Sp zero is returned on failure, non-zero for success. .IP "IconifyWindow \s-1WINDOWID\s0" 8 .IX Item "IconifyWindow WINDOWID" Minimizes (Iconifies) the specified window. .Sp zero is returned on failure, non-zero for success. .IP "UnIconifyWindow \s-1WINDOWID\s0" 8 .IX Item "UnIconifyWindow WINDOWID" Unminimizes (UnIconifies) the specified window. .Sp zero is returned on failure, non-zero for success. .IP "RaiseWindow \s-1WINDOWID\s0" 8 .IX Item "RaiseWindow WINDOWID" Raises the specified window to the top of the stack, so that no other windows cover it. .Sp zero is returned on failure, non-zero for success. .IP "LowerWindow \s-1WINDOWID\s0" 8 .IX Item "LowerWindow WINDOWID" Lowers the specified window to the bottom of the stack, so other existing windows will cover it. .Sp zero is returned on failure, non-zero for success. .IP "GetInputFocus" 8 .IX Item "GetInputFocus" Returns the window that currently has the input focus. .IP "SetInputFocus \s-1WINDOWID\s0" 8 .IX Item "SetInputFocus WINDOWID" Sets the specified window to be the one that has the input focus. .Sp zero is returned on failure, non-zero for success. .IP "GetWindowPos \s-1WINDOWID\s0" 8 .IX Item "GetWindowPos WINDOWID" Returns an array containing the position information for the specified window. It also returns size information (including border width) and the number of the screen where the window resides. .Sp .Vb 2 \& my ($x, $y, $width, $height, $borderWidth, $screen) = \& GetWindowPos(GetRootWindow()); .Ve .IP "GetParentWindow \s-1WINDOWID\s0" 8 .IX Item "GetParentWindow WINDOWID" Returns the parent of the specified window. .Sp zero is returned if parent couldn't be determined (i.e., root window). .IP "GetScreenDepth [\s-1SCREEN\s0]" 8 .IX Item "GetScreenDepth [SCREEN]" Returns the color depth for the screen. If no screen is specified, it is taken from the value given when opening the X display. If the screen (number) is invalid, \-1 will be returned. .Sp Value is represented as bits, i.e. 16. .Sp .Vb 1 \& my $depth = GetScreenDepth(); .Ve .IP "GetScreenRes [\s-1SCREEN\s0]" 8 .IX Item "GetScreenRes [SCREEN]" Returns the screen resolution. If no screen is specified, it is taken from the value given when opening the X display. If the screen (number) is invalid, the returned list will be empty. .Sp .Vb 1 \& my ($x, $y) = GetScreenRes(); .Ve .SH "OTHER DOCUMENTATION" .IX Header "OTHER DOCUMENTATION" Not installed. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright(c) 2003\-2014 Dennis K. Paulsen, All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License. .SH "AUTHOR" .IX Header "AUTHOR" Dennis K. Paulsen (Iowa \s-1USA\s0) .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" Paulo E. Castro .SH "CREDITS" .IX Header "CREDITS" Thanks to everyone; including those specifically mentioned below for patches, suggestions, etc.: .PP .Vb 5 \& David Dick \& Alexey Tourbin \& Richard Clamp \& Gustav Larsson \& Nelson D. Caro .Ve