home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xibm.zip / ibm8514 / brcRect.c < prev    next >
C/C++ Source or Header  |  1991-09-25  |  2KB  |  77 lines

  1. /*
  2.  * $Id: brcRect.c,v 1.1 1991/09/20 19:10:24 mtranle Exp $
  3.  *
  4.  * Copyright IBM Corporation 1987,1990
  5.  *
  6.  * All Rights Reserved
  7.  *
  8.  * Permission to use, copy, modify, and distribute this software and its
  9.  * documentation for any purpose and without fee is hereby granted,
  10.  * provided that the above copyright notice appear in all copies and that 
  11.  * both that copyright notice and this permission notice appear in
  12.  * supporting documentation, and that the name of IBM not be
  13.  * used in advertising or publicity pertaining to distribution of the
  14.  * software without specific, written prior permission.
  15.  *
  16.  * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  17.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
  18.  * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  19.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  20.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  21.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  22.  * SOFTWARE.
  23.  *
  24. */
  25. /*
  26.  * PRPQ 5799-PFF (C) COPYRIGHT IBM CORPORATION 1987,1990
  27.  * LICENSED MATERIALS - PROPERTY OF IBM
  28.  * REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
  29.  */
  30. /*
  31.  *  Hardware interface routines for IBM 8514/A adapter for
  32.  *  X.11 server(s) on IBM equipment.
  33.  *
  34.  */
  35.  
  36. #include "x8514.h"
  37. #include "ibmTrace.h"
  38.  
  39. extern int mergexlate[] ;
  40. extern int ibm8514cursorSemaphore ;
  41.  
  42. void
  43. ibm8514DrawRectangle(color, merge, planes, x0, y0, lx, ly)
  44.      unsigned long int color ;
  45.      int merge ;
  46.      unsigned long int planes ;
  47.      short x0, y0, lx, ly ;
  48. {
  49.     int CursorIsSaved ;
  50.  
  51.     TRACE(("ibm8514DrawRectangle(color=%d, merge=x%x, planes=%02x, x=%d, y=%d, lx=%d, ly=%d\n",
  52.        color, merge, planes, x0, y0, lx, ly)) ;
  53.  
  54.     if ( ( lx <= 0 ) || ( ly <= 0 ) )
  55.     return ;
  56.     CursorIsSaved = !ibm8514cursorSemaphore && ibm8514CheckCursor(x0, y0, lx, ly) ;
  57.  
  58.     ibm8514ATRNotBusy ;
  59.     ibm8514CheckQueue(8) ;
  60.     SETFN1(FNCOLOR1, mergexlate[merge]) ;
  61.     SETCOL1(color) ;
  62.     PLNWENBL(planes) ;
  63.     SETY0(y0) ;
  64.     SETX0(x0) ;
  65.     SETLY(ly-1) ;
  66.     SETLX(lx-1) ;
  67.     COMMAND(0x80b3) ;        /* Horizontal Rect operation, DX = DY = 'increasing'*/
  68.  
  69.     ibm8514ClearQueue(2) ;
  70.     PLNWENBL( ibm8514ALLPLANES ) ;
  71.     SETFN1(FNCOLOR1, FNREPLACE) ;
  72.  
  73.     if (CursorIsSaved)
  74.     ibm8514ReplaceCursor() ;
  75.     return ;
  76. }
  77.