home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / include / scrnintstr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-13  |  7.9 KB  |  219 lines

  1. /* $XConsortium: scrnintstr.h,v 5.12 91/05/13 23:44:14 rws Exp $ */
  2. /***********************************************************
  3. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  4. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  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 names of Digital or MIT not be
  13. used in advertising or publicity pertaining to distribution of the
  14. software without specific, written prior permission.  
  15.  
  16. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  17. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  18. DIGITAL 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. #ifndef SCREENINTSTRUCT_H
  26. #define SCREENINTSTRUCT_H
  27.  
  28. #include "screenint.h"
  29. #include "miscstruct.h"
  30. #include "region.h"
  31. #include "pixmap.h"
  32. #include "gc.h"
  33. #include "colormap.h"
  34.  
  35.  
  36. typedef struct _PixmapFormat {
  37.     unsigned char    depth;
  38.     unsigned char    bitsPerPixel;
  39.     unsigned char    scanlinePad;
  40.     } PixmapFormatRec;
  41.     
  42. typedef struct _Visual {
  43.     unsigned long    vid;
  44.     short        class;
  45.     short        bitsPerRGBValue;
  46.     short        ColormapEntries;
  47.     short        nplanes;/* = log2 (ColormapEntries). This does not
  48.                  * imply that the screen has this many planes.
  49.                  * it may have more or fewer */
  50.     unsigned long    redMask, greenMask, blueMask;
  51.     int            offsetRed, offsetGreen, offsetBlue;
  52.   } VisualRec;
  53.  
  54. typedef struct _Depth {
  55.     unsigned char    depth;
  56.     short        numVids;
  57.     unsigned long    *vids;    /* block of visual ids for this depth */
  58.   } DepthRec;
  59.  
  60. typedef struct _Screen {
  61.     int            myNum;    /* index of this instance in Screens[] */
  62.     ATOM        id;
  63.     short        width, height;
  64.     short        mmWidth, mmHeight;
  65.     short        numDepths;
  66.     unsigned char          rootDepth;
  67.     DepthPtr           allowedDepths;
  68.     unsigned long          rootVisual;
  69.     unsigned long    defColormap;
  70.     short        minInstalledCmaps, maxInstalledCmaps;
  71.     char                backingStoreSupport, saveUnderSupport;
  72.     unsigned long    whitePixel, blackPixel;
  73.     unsigned long    rgf;    /* array of flags; she's -- HUNGARIAN */
  74.     GCPtr        GCperDepth[MAXFORMATS+1];
  75.             /* next field is a stipple to use as default in
  76.                a GC.  we don't build default tiles of all depths
  77.                because they are likely to be of a color
  78.                different from the default fg pixel, so
  79.                we don't win anything by building
  80.                a standard one.
  81.             */
  82.     PixmapPtr        PixmapPerDepth[1];
  83.     pointer        devPrivate;
  84.     short           numVisuals;
  85.     VisualPtr        visuals;
  86.     int            WindowPrivateLen;
  87.     unsigned        *WindowPrivateSizes;
  88.     unsigned        totalWindowSize;
  89.     int            GCPrivateLen;
  90.     unsigned        *GCPrivateSizes;
  91.     unsigned        totalGCSize;
  92.  
  93.     /* Random screen procedures */
  94.  
  95.     Bool (* CloseScreen)();        /* index, pScreen */
  96.     void (* QueryBestSize)();        /* class, pwidth, pheight, pScreen */
  97.     Bool (* SaveScreen)();        /* pScreen, on */
  98.     void (* GetImage)();        /* pDrawable, sx, sy, w, h, format, 
  99.                      * planemask, pdestbits */
  100.     void (* GetSpans)();        /* pDrawable, wMax, ppt, pwidth,
  101.                      * nspans, pdstbits */
  102.     void (* PointerNonInterestBox)();    /* pScr, BoxPtr */
  103.  
  104.     void (* SourceValidate)();        /* pDrawable, x, y, w, h */
  105.  
  106.     /* Window Procedures */
  107.  
  108.     Bool (* CreateWindow)();        /* pWin */
  109.     Bool (* DestroyWindow)();        /* pWin */
  110.     Bool (* PositionWindow)();        /* pWin, x, y */
  111.     Bool (* ChangeWindowAttributes)();    /* pWin, mask */
  112.     Bool (* RealizeWindow)();        /* pWin */
  113.     Bool (* UnrealizeWindow)();        /* pWin */
  114.     int  (* ValidateTree)();        /* pParent, pChild, kind */
  115.     void (* PostValidateTree)();    /* pParent, pChild, kind */
  116.     void (* WindowExposures)();       /* pWin: WindowPtr, pRegion: RegionPtr */
  117.     void (* PaintWindowBackground)();    /* pWin, pRgn, which */
  118.     void (* PaintWindowBorder)();    /* pWin, pRgn, which */
  119.     void (* CopyWindow)();        /* pWin, oldPt, pOldRegion */
  120.     void (* ClearToBackground)();    /* pWin, x,y,w,h, sendExpose */
  121.     void (* ClipNotify)();              /* pWin, dx, dy */
  122.  
  123.     /* Pixmap procedures */
  124.  
  125.     PixmapPtr (* CreatePixmap)();     /* pScreen, width, height, depth */
  126.     Bool (* DestroyPixmap)();        /* pPixmap */
  127.  
  128.     /* Backing store procedures */
  129.  
  130.     void (* SaveDoomedAreas)();        /* pWin, pRegion, dx, dy */
  131.     RegionPtr (* RestoreAreas)();    /* pWin, pRegion */
  132.     void (* ExposeCopy)();        /* pSrc, pDst, pGC, pRegion, */
  133.                     /* srcx, srcy, dstx, dsty, plane */
  134.     RegionPtr (* TranslateBackingStore)();/* pWin, dx, dy, pOldClip */
  135.     RegionPtr (* ClearBackingStore)();    /* pWin, x, y, w, h, sendExpose */
  136.     void (* DrawGuarantee)();        /* pWin, pGC, guarantee */
  137.     
  138.     /* Font procedures */
  139.  
  140.     Bool (* RealizeFont)();        /* pScr, pFont */
  141.     Bool (* UnrealizeFont)();        /* pScr, pFont */
  142.  
  143.     /* Cursor Procedures */
  144.     void (* ConstrainCursor)();       /* pScr, BoxPtr */
  145.     void (* CursorLimits)();        /* pScr, pCurs, BoxPtr, BoxPtr */
  146.     Bool (* DisplayCursor)();        /* pScr, pCurs */
  147.     Bool (* RealizeCursor)();        /* pScr, pCurs */
  148.     Bool (* UnrealizeCursor)();        /* pScr, pCurs */
  149.     void (* RecolorCursor)();        /* pScr, pCurs, displayed */
  150.     Bool (* SetCursorPosition)();    /* pScr, x, y */
  151.  
  152.     /* GC procedures */
  153.  
  154.     Bool (* CreateGC)();        /* pGC */
  155.  
  156.     /* Colormap procedures */
  157.  
  158.     Bool (* CreateColormap)();        /* pcmap */
  159.     void (* DestroyColormap)();        /* pcmap */
  160.     void (* InstallColormap)();        /* pcmap */
  161.     void (* UninstallColormap)();    /* pcmap */
  162.     int (* ListInstalledColormaps) ();     /* pScreen, pmaps */
  163.     void (* StoreColors)();        /* pmap, ndef, pdef */
  164.     void (* ResolveColor)();        /* preg, pgreen, pblue */
  165.  
  166.     /* Region procedures */
  167.  
  168.     RegionPtr (* RegionCreate)();     /* rect, size */
  169.     void (* RegionInit)();        /* pRegion, rect, size */
  170.     Bool (* RegionCopy)();        /* dstrgn, srcrgn */
  171.     void (* RegionDestroy)();        /* pRegion */
  172.     void (* RegionUninit)();        /* pRegion */
  173.     Bool (* Intersect)();        /* newReg, reg1, reg2 */
  174.     Bool (* Union)();            /* newReg, reg1, reg2 */
  175.     Bool (* Subtract)();        /* regD, regM, regS */
  176.     Bool (* Inverse)();            /* newReg, reg1, invRect */
  177.     void (* RegionReset)();        /* pRegion, pBox */
  178.     void (* TranslateRegion)();        /* pRegion, x, y */
  179.     int (* RectIn)();            /* pRegion, pRect */
  180.     Bool (* PointInRegion)();        /* pRegion, x, y, pBox */
  181.     Bool (* RegionNotEmpty)();          /* pRegion: RegionPtr */
  182.     void (* RegionEmpty)();            /* pRegion: RegionPtr */
  183.     BoxPtr (* RegionExtents)();     /* pRegion: RegionPtr */
  184.     Bool (* RegionAppend)();        /* pRegion, pRegion */
  185.     Bool (* RegionValidate)();        /* pRegion, pOverlap */
  186.     RegionPtr (* BitmapToRegion)();    /* PixmapPtr */
  187.     RegionPtr (* RectsToRegion)();    /* nrects, pRects, ordering */
  188.     void (* SendGraphicsExpose)();    /* client, rgn, draw, major, minor */
  189.  
  190.     /* os layer procedures */
  191.     void (* BlockHandler)();        /* data: pointer */
  192.     void (* WakeupHandler)();        /* data: pointer */
  193.     pointer blockData;
  194.     pointer wakeupData;
  195.  
  196.     /* anybody can get a piece of this array */
  197.     DevUnion    *devPrivates;
  198. } ScreenRec;
  199.  
  200. typedef struct _ScreenInfo {
  201.     int        imageByteOrder;
  202.     int        bitmapScanlineUnit;
  203.     int        bitmapScanlinePad;
  204.     int        bitmapBitOrder;
  205.     int        numPixmapFormats;
  206.     PixmapFormatRec
  207.         formats[MAXFORMATS];
  208.     int        arraySize;
  209.     int        numScreens;
  210.     ScreenPtr    screens[MAXSCREENS];
  211. } ScreenInfo;
  212.  
  213. extern ScreenInfo screenInfo;
  214.  
  215. extern int AllocateWindowPrivateIndex(), AllocateGCPrivateIndex();
  216. extern Bool AllocateWindowPrivate(), AllocateGCPrivate();
  217.  
  218. #endif /* SCREENINTSTRUCT_H */
  219.