<ahref="libcvautomation-xtest_8h.html">Go to the documentation of this file.</a><divclass="fragment"><preclass="fragment"><aname="l00001"></a>00001 <spanclass="comment">/*</span>
<aname="l00021"></a>00021 <spanclass="preprocessor">#include <<aclass="code"href="libcvautomation_8h.html"title="The top-level include for all projects involving libcvautomation.">libcvautomation/libcvautomation.h</a>></span>
<aname="l00022"></a>00022
<aname="l00023"></a>00023 <spanclass="preprocessor">#define IS_CMD( x, y ) strncmp( x, y, strlen( y ) ) == 0</span>
<aname="l00026"></a>00026 <spanclass="comment">/* Make sure that the XTest extension is supported.</span>
<aname="l00027"></a>00027 <spanclass="comment"> * If it's not, return 0 (false) */</span>
<aname="l00028"></a>00028 Bool <aclass="code"href="libcvautomation-xtest_8h.html#af5b751f28a87f6ca4c1b3969c2ddb7f4"title="Check if the XTest extension is supported.">xte_XTestSupported</a> ( Display *displayLocation );
<aname="l00030"></a>00030 <spanclass="comment">/* Get the current location of the mouse */</span>
<aname="l00031"></a>00031 <aclass="code"href="structcvaPoint.html"title="Very simple structure to standardize how points are used in libcvautomation.">cvaPoint</a><aclass="code"href="libcvautomation-xtest_8h.html#aaa6da04691328c02b3fc3442eaa9bb44"title="Grab the current location of the mouse.">xte_mouseLocation</a> ( Display *displayLocation );
<aname="l00033"></a>00033 <spanclass="comment">/* Click the mouse where it is currently at */</span>
<aname="l00034"></a>00034 <spanclass="keywordtype">void</span><aclass="code"href="libcvautomation-xtest_8h.html#a8a95419cacd3a0efbd4bb6274567e284"title="Click the mouse in its current location.">xte_clickMouse</a> ( Display *displayLocation, <spanclass="keywordtype">int</span> mouseButton );
<aname="l00035"></a>00035
<aname="l00036"></a>00036 <spanclass="comment">/* Click the mouse on an absolute screen location */</span>
<aname="l00037"></a>00037 <spanclass="keywordtype">void</span><aclass="code"href="libcvautomation-xtest_8h.html#a808386f36914966032aa2e15fd5ef60b"title="Click the mouse button at an absolute location.">xte_clickMouseXY</a> ( Display *displayLocation, <spanclass="keywordtype">int</span> xLocation, <spanclass="keywordtype">int</span> yLocation, <spanclass="keywordtype">int</span> mouseButton );
<aname="l00038"></a>00038
<aname="l00039"></a>00039 <spanclass="comment">/* Click the mouse on a screen location relative to where it currently is */</span>
<aname="l00040"></a>00040 <spanclass="keywordtype">void</span><aclass="code"href="libcvautomation-xtest_8h.html#a54df9f6d2278b6c840299f1f8ff94576"title="Click the mouse button at a relative location.">xte_clickMouseRXY</a> ( Display *displayLocation, <spanclass="keywordtype">int</span> xIncrement, <spanclass="keywordtype">int</span> yIncrement, <spanclass="keywordtype">int</span> mouseButton );
<aname="l00041"></a>00041
<aname="l00042"></a>00042 <spanclass="comment">/* Click the mouse at the top-left corner of an image on the specified display */</span>
<aname="l00043"></a>00043 <aclass="code"href="structcvaPoint.html"title="Very simple structure to standardize how points are used in libcvautomation.">cvaPoint</a><aclass="code"href="libcvautomation-xtest_8h.html#afa808d82bff7531af99d20b5397f4810"title="Click the mouse based on location of an image.">xte_clickMouseImage</a> ( Display *displayLocation, IplImage *subImage, <spanclass="keywordtype">int</span> mouseButton, <spanclass="keywordtype">int</span> searchMethod, <spanclass="keywordtype">int</span> tolerance );
<aname="l00044"></a>00044
<aname="l00045"></a>00045 <spanclass="comment">/* Click the mouse at the top-left corner of an image on the specified display</span>
<aname="l00046"></a>00046 <spanclass="comment"> * where the subImage is a file location */</span>
<aname="l00047"></a>00047 <aclass="code"href="structcvaPoint.html"title="Very simple structure to standardize how points are used in libcvautomation.">cvaPoint</a><aclass="code"href="libcvautomation-xtest_8h.html#aa8e0c08cbca4f2863c4feda535c34bf5"title="Click the mouse based on the location of an image from file.">xte_clickMouseImage_location</a> ( Display *displayLocation, <spanclass="keyword">const</span><spanclass="keywordtype">char</span> *fileName, <spanclass="keywordtype">int</span> mouseButton, <spanclass="keywordtype">int</span> searchMethod, <spanclass="keywordtype">int</span> tolerance );
<aname="l00048"></a>00048
<aname="l00049"></a>00049 <spanclass="comment">/* Click the mouse at the center of an image on the specified display */</span>
<aname="l00050"></a>00050 <aclass="code"href="structcvaPoint.html"title="Very simple structure to standardize how points are used in libcvautomation.">cvaPoint</a><aclass="code"href="libcvautomation-xtest_8h.html#aa167cd70fe8284dbccbbd42cd4878b3e"title="Click the mouse based on center location of an image.">xte_clickMouseImage_center</a> ( Display *displayLocation, IplImage *subImage, <spanclass="keywordtype">int</span> mouseButton, <spanclass="keywordtype">int</span> searchMethod, <spanclass="keywordtype">int</span> tolerance );
<aname="l00051"></a>00051
<aname="l00052"></a>00052 <spanclass="comment">/* Click the mouse at the center of an image on the specified display</span>
<aname="l00053"></a>00053 <spanclass="comment"> * where the subImage is a file location */</span>
<aname="l00054"></a>00054 <aclass="code"href="structcvaPoint.html"title="Very simple structure to standardize how points are used in libcvautomation.">cvaPoint</a><aclass="code"href="libcvautomation-xtest_8h.html#a40ca9d0d71b8f7cc513c27a9b0171995"title="Click the mouse based on the center location of an image from file.">xte_clickMouseImage_location_center</a> ( Display *displayLocation, <spanclass="keyword">const</span><spanclass="keywordtype">char</span> *fileName, <spanclass="keywordtype">int</span> mouseButton, <spanclass="keywordtype">int</span> searchMethod, <spanclass="keywordtype">int</span> tolerance );
<aname="l00055"></a>00055
<aname="l00056"></a>00056 <spanclass="comment">/* Move the mouse to a location and leave it there */</span>
<aname="l00057"></a>00057 <spanclass="keywordtype">void</span><aclass="code"href="libcvautomation-xtest_8h.html#a16e54e500caa43ab825a2039be9aabf9"title="Move the mouse to a location, but do not click it.">xte_hoverMouseXY</a> ( Display *displayLocation, <spanclass="keywordtype">int</span> xLocation, <spanclass="keywordtype">int</span> yLocation );
<aname="l00058"></a>00058
<aname="l00059"></a>00059 <spanclass="comment">/* Move the mouse to a location relative to where it currently is and leave it there */</span>
<aname="l00060"></a>00060 <spanclass="keywordtype">void</span><aclass="code"href="libcvautomation-xtest_8h.html#ab86c2de782d401599652f2856f311aad"title="Move the mouse to a relative location, but do not click it.">xte_hoverMouseRXY</a> ( Display *displayLocation, <spanclass="keywordtype">int</span> xIncrement, <spanclass="keywordtype">int</span> yIncrement );
<aname="l00061"></a>00061
<aname="l00062"></a>00062 <spanclass="comment">/* Move the mouse to a location at the top-left corner of an image on the specified display</span>
<aname="l00063"></a>00063 <spanclass="comment"> * but don't click the mouse */</span>
<aname="l00064"></a>00064 <aclass="code"href="structcvaPoint.html"title="Very simple structure to standardize how points are used in libcvautomation.">cvaPoint</a><aclass="code"href="libcvautomation-xtest_8h.html#a657631e704e31818b42587ef50724930"title="Move the mouse based on location of an image.">xte_hoverMouseImage</a> ( Display *displayLocation, IplImage *subImage, <spanclass="keywordtype">int</span> searchMethod, <spanclass="keywordtype">int</span> tolerance );
<aname="l00065"></a>00065
<aname="l00066"></a>00066 <spanclass="comment">/* Move the mouse to a location at the top-left corner of an image from file on the specified display</span>
<aname="l00067"></a>00067 <spanclass="comment"> * but don't click the mouse */</span>
<aname="l00068"></a>00068 <aclass="code"href="structcvaPoint.html"title="Very simple structure to standardize how points are used in libcvautomation.">cvaPoint</a><aclass="code"href="libcvautomation-xtest_8h.html#ad274843eaaed7af192f09310caa9e5b2"title="Move the mouse based on location of an image from file.">xte_hoverMouseImage_location</a> ( Display *displayLocation, <spanclass="keyword">const</span><spanclass="keywordtype">char</span> *filename, <spanclass="keywordtype">int</span> searchMethod, <spanclass="keywordtype">int</span> tolerance );
<aname="l00069"></a>00069
<aname="l00070"></a>00070 <spanclass="comment">/* Move the mouse to a location at the center of an image on the specified display</span>
<aname="l00071"></a>00071 <spanclass="comment"> * but don't click the mouse */</span>
<aname="l00072"></a>00072 <aclass="code"href="structcvaPoint.html"title="Very simple structure to standardize how points are used in libcvautomation.">cvaPoint</a><aclass="code"href="libcvautomation-xtest_8h.html#a72f049ae7ade76344e47d01ba451e8f1"title="Move the mouse based on center location of an image.">xte_hoverMouseImage_center</a> ( Display *displayLocation, IplImage *subImage, <spanclass="keywordtype">int</span> searchMethod, <spanclass="keywordtype">int</span> tolerance );
<aname="l00073"></a>00073
<aname="l00074"></a>00074 <spanclass="comment">/* Move the mouse to a location at the center of an image from file on the specified display</span>
<aname="l00075"></a>00075 <spanclass="comment"> * but don't click the mouse */</span>
<aname="l00076"></a>00076 <aclass="code"href="structcvaPoint.html"title="Very simple structure to standardize how points are used in libcvautomation.">cvaPoint</a><aclass="code"href="libcvautomation-xtest_8h.html#acdcc9eb1e6633458ebb6ec0c7b57ba26"title="Move the mouse based on the center location of an image from file.">xte_hoverMouseImage_location_center</a> ( Display *displayLocation, <spanclass="keyword">const</span><spanclass="keywordtype">char</span> *fileName, <spanclass="keywordtype">int</span> searchMethod, <spanclass="keywordtype">int</span> tolerance );
<aname="l00077"></a>00077
<aname="l00078"></a>00078 <spanclass="comment">/* Push a mouse button down, but don't release it */</span>
<aname="l00079"></a>00079 <spanclass="keywordtype">void</span><aclass="code"href="libcvautomation-xtest_8h.html#acca8cce58009ce177265bea29e8223e8"title="Press a mouse button down, and do not release it.">xte_mouseDown</a> ( Display *displayLocation, <spanclass="keywordtype">int</span> mouseButton );
<aname="l00080"></a>00080
<aname="l00081"></a>00081 <spanclass="comment">/* Let a mouse button up */</span>
<aname="l00084"></a>00084 <spanclass="comment">/* Move the mouse a little bit */</span>
<aname="l00085"></a>00085 <spanclass="keywordtype">void</span><aclass="code"href="libcvautomation-xtest_8h.html#ad4a4b4739bf494478dccb520d6946fbd"title="Jiggle the mouse in place.">xte_mouseJiggle</a> ( Display *displayLocation );
<aname="l00086"></a>00086
<aname="l00087"></a>00087 <spanclass="comment">/* Scroll the mouse up */</span>
<aname="l00088"></a>00088 <spanclass="keywordtype">void</span><aclass="code"href="libcvautomation-xtest_8h.html#a18f5cc7307329ce2e13ceb25b274822b"title="Scroll the mouse up.">xte_mouseScrollUp</a> ( Display *displayLocation );
<aname="l00089"></a>00089
<aname="l00090"></a>00090 <spanclass="comment">/* Scroll the mouse down */</span>
<aname="l00093"></a>00093 <spanclass="comment">/* Press and release a key </span>
<aname="l00094"></a>00094 <spanclass="comment"> * Note that we use a string for *key, since keys like "space" are still valid. */</span>
<aname="l00095"></a>00095 <spanclass="keywordtype">void</span><aclass="code"href="libcvautomation-xtest_8h.html#aa5d0f5167ac455ac88d063450b8aaac6"title="Press and release a keyboard key.">xte_clickKey</a> ( Display *displayLocation, <spanclass="keywordtype">char</span> *key );
<aname="l00096"></a>00096
<aname="l00097"></a>00097 <spanclass="comment">/* Press and release keys in a string */</span>
<aname="l00098"></a>00098 <spanclass="keywordtype">void</span><aclass="code"href="libcvautomation-xtest_8h.html#a1411973d9245ac1d610988a965ceb5a7"title="Input a string of characters to the X Server.">xte_clickKeyStr</a> ( Display *displayLocation, <spanclass="keywordtype">char</span> *<spanclass="keywordtype">string</span> );
<aname="l00099"></a>00099
<aname="l00100"></a>00100 <spanclass="comment">/* Press a key down */</span>
<aname="l00101"></a>00101 <spanclass="keywordtype">void</span><aclass="code"href="libcvautomation-xtest_8h.html#ad1d7153af9ed5cb2ba3b6d2a89c4ec75"title="Press a key down, but do not release it.">xte_keyDown</a> ( Display *displayLocation, <spanclass="keywordtype">char</span> *key );
<aname="l00102"></a>00102
<aname="l00103"></a>00103 <spanclass="comment">/* Release a key */</span>
<aname="l00104"></a>00104 <spanclass="keywordtype">void</span><aclass="code"href="libcvautomation-xtest_8h.html#a6af5c14f862dd91fec682fde44a10e23"title="Release a key.">xte_keyUp</a> ( Display *displayLocation, <spanclass="keywordtype">char</span> *key );
<aname="l00106"></a>00106 <spanclass="comment">/* Wait for an image to show up on screen */</span>
<aname="l00107"></a>00107 <aclass="code"href="structcvaPoint.html"title="Very simple structure to standardize how points are used in libcvautomation.">cvaPoint</a><aclass="code"href="libcvautomation-xtest_8h.html#abfbad79445cce59c95940649210f1b31"title="Wait for an image to show up on screen.">xte_waitForImage</a> ( Display *displayLocation, IplImage *subImage, <spanclass="keywordtype">int</span> searchMethod, <spanclass="keywordtype">int</span> tolerance, <spanclass="keywordtype">int</span> timeout );
<aname="l00109"></a>00109 <spanclass="comment">/* Wait for an image from file to show up on screen */</span>
<aname="l00110"></a>00110 <aclass="code"href="structcvaPoint.html"title="Very simple structure to standardize how points are used in libcvautomation.">cvaPoint</a><aclass="code"href="libcvautomation-xtest_8h.html#a3f474b9f3ae44e2fcf8997a2a806139e"title="Wait for an image from file to show up on screen.">xte_waitForImage_location</a> ( Display *displayLocation, <spanclass="keyword">const</span><spanclass="keywordtype">char</span> *fileName, <spanclass="keywordtype">int</span> searchMethod, <spanclass="keywordtype">int</span> tolerance, <spanclass="keywordtype">int</span> timeout );
<aname="l00112"></a>00112 <spanclass="comment">/* Wait for an image to show up on screen, return the center point */</span>
<aname="l00113"></a>00113 <aclass="code"href="structcvaPoint.html"title="Very simple structure to standardize how points are used in libcvautomation.">cvaPoint</a><aclass="code"href="libcvautomation-xtest_8h.html#a6c246fab2cf1e45eb11f519d805e0fb2"title="Wait for an image to show up on screen, return the center point.">xte_waitForImage_center</a>( Display *displayLocation, IplImage *subImage, <spanclass="keywordtype">int</span> searchMethod, <spanclass="keywordtype">int</span> tolerance, <spanclass="keywordtype">int</span> timeout );
<aname="l00115"></a>00115 <spanclass="comment">/* Wait for an image from file to show up on screen, return the center point */</span>
<aname="l00116"></a>00116 <aclass="code"href="structcvaPoint.html"title="Very simple structure to standardize how points are used in libcvautomation.">cvaPoint</a><aclass="code"href="libcvautomation-xtest_8h.html#ac95300b7c9f5310967e8ffe793c9c8e9"title="Wait for an image from file to show up on screen, return the center point.">xte_waitForImage_location_center</a>( Display *displayLocation, <spanclass="keyword">const</span><spanclass="keywordtype">char</span> *fileName, <spanclass="keywordtype">int</span> searchMethod, <spanclass="keywordtype">int</span> tolerance, <spanclass="keywordtype">int</span> timeout );
<aname="l00117"></a>00117
<aname="l00118"></a>00118 <spanclass="comment">/* Use one of the functions by command name */</span>
<aname="l00119"></a>00119 <aclass="code"href="structcvaPoint.html"title="Very simple structure to standardize how points are used in libcvautomation.">cvaPoint</a><aclass="code"href="libcvautomation-xtest_8h.html#a7ea1430ed90d3166f8d9fbb4e240a28f"title="Execute a command where the command is coming from a string.">xte_commandString</a> ( Display *displayLocation, <spanclass="keywordtype">char</span> *commandString, <spanclass="keywordtype">int</span> mouseButton, <spanclass="keywordtype">int</span> searchMethod, <spanclass="keywordtype">int</span> tolerance, <spanclass="keywordtype">int</span> timeout );