home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / ddx / mi / mispritest.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-26  |  2.8 KB  |  104 lines

  1. /*
  2.  * mispritest.h
  3.  *
  4.  * mi sprite structures
  5.  */
  6.  
  7. /* $XConsortium: mispritest.h,v 5.11 91/04/26 21:46:09 keith Exp $ */
  8.  
  9. /*
  10. Copyright 1989 by the Massachusetts Institute of Technology
  11.  
  12. Permission to use, copy, modify, and distribute this software and its
  13. documentation for any purpose and without fee is hereby granted,
  14. provided that the above copyright notice appear in all copies and that
  15. both that copyright notice and this permission notice appear in
  16. supporting documentation, and that the name of M.I.T. not be used in
  17. advertising or publicity pertaining to distribution of the software
  18. without specific, written prior permission.  M.I.T. makes no
  19. representations about the suitability of this software for any
  20. purpose.  It is provided "as is" without express or implied warranty.
  21. */
  22.  
  23. # include   "misprite.h"
  24.  
  25. /*
  26.  * per screen information
  27.  */
  28.  
  29. typedef struct {
  30.     Bool        (*CloseScreen)();
  31.     void        (*GetImage)();
  32.     void        (*GetSpans)();
  33.     void        (*SourceValidate)();
  34.     Bool        (*CreateGC)();
  35.     void        (*BlockHandler)();
  36.     void        (*InstallColormap)();
  37.     void        (*StoreColors)();
  38.  
  39.     void        (* PaintWindowBackground)();
  40.     void        (* PaintWindowBorder)();
  41.     void        (* CopyWindow)();
  42.     void        (* ClearToBackground)();
  43.  
  44.     void        (* SaveDoomedAreas)();
  45.     RegionPtr        (* RestoreAreas)();
  46.  
  47.     CursorPtr        pCursor;
  48.     int            x;
  49.     int            y;
  50.     BoxRec        saved;
  51.     Bool        isUp;
  52.     Bool        shouldBeUp;
  53.     WindowPtr        pCacheWin;
  54.     Bool        isInCacheWin;
  55.     Bool        checkPixels;
  56.     xColorItem        colors[2];
  57.     ColormapPtr        pInstalledMap;
  58.     ColormapPtr        pColormap;
  59.     VisualPtr        pVisual;
  60.     miSpriteCursorFuncPtr    funcs;
  61. } miSpriteScreenRec, *miSpriteScreenPtr;
  62.  
  63. #define SOURCE_COLOR    0
  64. #define MASK_COLOR    1
  65.  
  66. typedef struct {
  67.     GCFuncs        *wrapFuncs;
  68.     GCOps        *wrapOps;
  69. } miSpriteGCRec, *miSpriteGCPtr;
  70.  
  71. extern void QueryGlyphExtents();
  72.  
  73. /*
  74.  * Overlap BoxPtr and Box elements
  75.  */
  76. #define BOX_OVERLAP(pCbox,X1,Y1,X2,Y2) \
  77.      (((pCbox)->x1 <= (X2)) && ((X1) <= (pCbox)->x2) && \
  78.      ((pCbox)->y1 <= (Y2)) && ((Y1) <= (pCbox)->y2))
  79.  
  80. /*
  81.  * Overlap BoxPtr, origins, and rectangle
  82.  */
  83. #define ORG_OVERLAP(pCbox,xorg,yorg,x,y,w,h) \
  84.     BOX_OVERLAP((pCbox),(x)+(xorg),(y)+(yorg),(x)+(xorg)+(w),(y)+(yorg)+(h))
  85.  
  86. /*
  87.  * Overlap BoxPtr, origins and RectPtr
  88.  */
  89. #define ORGRECT_OVERLAP(pCbox,xorg,yorg,pRect) \
  90.     ORG_OVERLAP((pCbox),(xorg),(yorg),(pRect)->x,(pRect)->y, \
  91.         (int)((pRect)->width), (int)((pRect)->height))
  92. /*
  93.  * Overlap BoxPtr and horizontal span
  94.  */
  95. #define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y))
  96.  
  97. #define LINE_SORT(x1,y1,x2,y2) \
  98. { int _t; \
  99.   if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \
  100.   if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } }
  101.  
  102. #define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \
  103.     BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2))
  104.