home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / evbl0627.zip / everblue_20010627.zip / x11 / Xlib_RecolorCursor.c < prev    next >
C/C++ Source or Header  |  2000-06-15  |  2KB  |  65 lines

  1. #include "Xlib.h"
  2. #include "Xlib_private.h"
  3. #include "GetReq.h"
  4.  
  5. /*
  6.  
  7. Copyright 1986, 1998  The Open Group
  8.  
  9. All Rights Reserved.
  10.  
  11. The above copyright notice and this permission notice shall be included in
  12. all copies or substantial portions of the Software.
  13.  
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  17. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  18. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  19. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  20.  
  21. Except as contained in this notice, the name of The Open Group shall not be
  22. used in advertising or otherwise to promote the sale, use or other dealings
  23. in this Software without prior written authorization from The Open Group.
  24.  
  25. */
  26.  
  27. /* 
  28.  * Arguments
  29.  * 
  30.  *  display            Specifies the connection to the X server. 
  31.  *  cursor             Specifies the cursor. 
  32.  *  foreground_color   Specifies the RGB values for the foreground of the source. 
  33.  *  background_color   Specifies the RGB values for the background of the source. 
  34.  * 
  35.  * 
  36.  * Description
  37.  * 
  38.  * The XRecolorCursor() function changes the color of the specified cursor, and if the cursor is being displayed on a screen, the
  39.  * change is visible immediately. The pixel members of the XColor structures are ignored; only the RGB values are used. 
  40.  * 
  41.  * XRecolorCursor() can generate a BadCursor error. 
  42.  * 
  43.  */
  44.  
  45.  
  46. int XRecolorCursor(register Display *dpy, Cursor cursor, XColor *foreground, XColor *background)
  47. {       
  48.     register xRecolorCursorReq *req;
  49.  
  50.     DBUG_ENTER("XRecolorCursor");
  51.     LockDisplay(dpy);
  52.     GetReq(RecolorCursor, req);
  53.     req->cursor = cursor;
  54.     req->foreRed = foreground->red;
  55.     req->foreGreen = foreground->green;
  56.     req->foreBlue = foreground->blue;
  57.     req->backRed = background->red;
  58.     req->backGreen = background->green;
  59.     req->backBlue = background->blue;
  60.     UnlockDisplay(dpy);
  61.     SyncHandle();
  62.     DBUG_RETURN(1);
  63. }
  64.  
  65.