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