1/**************************************************************************
2
3Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
4Copyright (c) 2002 Apple Computer, Inc.
5All Rights Reserved.
6
7Permission is hereby granted, free of charge, to any person obtaining a
8copy of this software and associated documentation files (the
9"Software"), to deal in the Software without restriction, including
10without limitation the rights to use, copy, modify, merge, publish,
11distribute, sub license, and/or sell copies of the Software, and to
12permit persons to whom the Software is furnished to do so, subject to
13the following conditions:
14
15The above copyright notice and this permission notice (including the
16next paragraph) shall be included in all copies or substantial portions
17of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
23ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
27**************************************************************************/
28
29/*
30 * Authors:
31 *   Jens Owen <jens@precisioninsight.com>
32 *
33 */
34
35#ifndef DRI_STRUCT_H
36#define DRI_STRUCT_H
37
38#include "dri.h"
39#include "x-list.h"
40
41#define DRI_MAX_DRAWABLES 256
42
43#define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) ((DRIDrawablePrivPtr) \
44    dixLookupPrivate(&(pWin)->devPrivates, DRIWindowPrivKey))
45
46#define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) ((DRIDrawablePrivPtr) \
47    dixLookupPrivate(&(pPix)->devPrivates, DRIPixmapPrivKey))
48
49typedef struct _DRIDrawablePrivRec
50{
51    xp_surface_id   sid;
52    int             drawableIndex;
53    DrawablePtr     pDraw;
54    ScreenPtr       pScreen;
55    int             refCount;
56    unsigned int    key[2];
57    x_list          *notifiers;     /* list of (FUN . DATA) */
58} DRIDrawablePrivRec, *DRIDrawablePrivPtr;
59
60#define DRI_SCREEN_PRIV(pScreen) ((DRIScreenPrivPtr) \
61    dixLookupPrivate(&(pScreen)->devPrivates, DRIScreenPrivKey))
62
63#define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \
64    dixLookupPrivate(&screenInfo.screens[screenIndex]->devPrivates, \
65		     DRIScreenPrivKey))
66
67
68typedef struct _DRIScreenPrivRec
69{
70    Bool                directRenderingSupport;
71    int                 nrWindows;
72    DRIWrappedFuncsRec  wrap;
73    DrawablePtr         DRIDrawables[DRI_MAX_DRAWABLES];
74} DRIScreenPrivRec, *DRIScreenPrivPtr;
75
76#endif /* DRI_STRUCT_H */
77