home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xibm.zip / ppc / ppcDepth.c < prev    next >
C/C++ Source or Header  |  1989-11-14  |  2KB  |  58 lines

  1. /*
  2.  * Copyright IBM Corporation 1987,1988,1989
  3.  *
  4.  * All Rights Reserved
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software and its
  7.  * documentation for any purpose and without fee is hereby granted,
  8.  * provided that the above copyright notice appear in all copies and that 
  9.  * both that copyright notice and this permission notice appear in
  10.  * supporting documentation, and that the name of IBM not be
  11.  * used in advertising or publicity pertaining to distribution of the
  12.  * software without specific, written prior permission.
  13.  *
  14.  * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  15.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  16.  * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  17.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  18.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  19.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  20.  * SOFTWARE.
  21.  *
  22. */
  23.  
  24. /* $Header: /andrew/X11/R3src/tape/server/ddx/ibm/ppc/RCS/ppcDepth.c,v 9.1 88/10/24 03:59:57 paul Exp $ */
  25. /* $Source: /andrew/X11/R3src/tape/server/ddx/ibm/ppc/RCS/ppcDepth.c,v $ */
  26.  
  27. #ifndef lint
  28. static char *rcsid = "$Header: /andrew/X11/R3src/tape/server/ddx/ibm/ppc/RCS/ppcDepth.c,v 9.1 88/10/24 03:59:57 paul Exp $";
  29. #endif
  30.  
  31. /* Check to see if the alleged depth is acceptable for the Screen  
  32.  *
  33.  * T. Paquin 9/87
  34.  *
  35.  */
  36.  
  37. #include "X.h"
  38. #include "scrnintstr.h"
  39. #include "pixmapstr.h"
  40.  
  41. Bool
  42. ppcDepthOK(pDraw,depth)
  43. register DrawablePtr pDraw;
  44. register int depth;
  45. {
  46. register ScreenPtr pScreen= pDraw->pScreen;
  47. register int i = pScreen->numDepths;
  48.  
  49.     if ( ( pDraw->type == DRAWABLE_PIXMAP ) && ( depth == 1 ) )
  50.     return TRUE ;
  51.  
  52.     while ( i-- )
  53.     if ( depth == pScreen->allowedDepths[i].depth )
  54.         return TRUE ;
  55.  
  56.     return FALSE ;
  57. }
  58.