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 / brcGetSp.c < prev    next >
C/C++ Source or Header  |  1991-09-20  |  2KB  |  75 lines

  1. /*
  2.  * $Id: brcGetSp.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. #include "X.h"
  32. #include "Xmd.h"
  33.  
  34. #include "region.h"
  35. #include "gc.h"
  36. #include "windowstr.h"
  37. #include "pixmapstr.h"
  38. #include "scrnintstr.h"
  39. #include "servermd.h"
  40.  
  41. #include "ibmTrace.h"
  42.  
  43. extern void ppcGetSpans() ;
  44.  
  45. void
  46. ibm8514GetSpans( pDrawable, wMax, ppt, pwidth, nspans, pdstStart )
  47.     DrawablePtr        pDrawable ;
  48.     int            wMax ;
  49.     register DDXPointPtr ppt ;
  50.     int            *pwidth ;
  51.     int            nspans ;
  52.     unsigned long int *pdstStart ;
  53. {
  54.     register unsigned long int *pdst ;    /* where to put the bits */
  55.     register unsigned int width ;
  56.  
  57.     if ( pDrawable->type != DRAWABLE_WINDOW )
  58.     {
  59.     ppcGetSpans( pDrawable, wMax, ppt, pwidth, nspans, pdstStart ) ;
  60.     return ;
  61.     }
  62.  
  63. /*******************************************************************/
  64.     /* read back the slices */
  65.     for ( pdst = pdstStart ; nspans-- ; ppt++, pwidth++ ) {
  66.     width = *pwidth ;
  67.     ibm8514ReadColorImage( ppt->x, ppt->y, width, 1, pdst,
  68.                    ( width + 3 ) & ~3 ) ;
  69.     pdst += ( width + 3 ) >> 2 ; /* width is in 32 bit words */
  70.     }
  71. /*******************************************************************/
  72.  
  73.     return ;
  74. }
  75.