VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.5.3/mispritest.h@ 71717

Last change on this file since 71717 was 17471, checked in by vboxsync, 16 years ago

export to OSE

  • Property svn:eol-style set to native
File size: 3.9 KB
Line 
1/*
2 * mispritest.h
3 *
4 * mi sprite structures
5 */
6
7
8/*
9
10Copyright 1989, 1998 The Open Group
11
12Permission to use, copy, modify, distribute, and sell this software and its
13documentation for any purpose is hereby granted without fee, provided that
14the above copyright notice appear in all copies and that both that
15copyright notice and this permission notice appear in supporting
16documentation.
17
18The above copyright notice and this permission notice shall be included in
19all copies or substantial portions of the Software.
20
21THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
25AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
26CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
28Except as contained in this notice, the name of The Open Group shall not be
29used in advertising or otherwise to promote the sale, use or other dealings
30in this Software without prior written authorization from The Open Group.
31*/
32
33#ifdef HAVE_DIX_CONFIG_H
34#include <dix-config.h>
35#endif
36
37#ifndef _MISPRITEST_H_
38#define _MISPRITEST_H_
39
40# include "misprite.h"
41#ifdef RENDER
42# include "picturestr.h"
43#endif
44# include "damage.h"
45
46/*
47 * per screen information
48 */
49
50typedef struct {
51 /* screen procedures */
52 CloseScreenProcPtr CloseScreen;
53 GetImageProcPtr GetImage;
54 GetSpansProcPtr GetSpans;
55 SourceValidateProcPtr SourceValidate;
56
57 /* window procedures */
58 CopyWindowProcPtr CopyWindow;
59
60 /* colormap procedures */
61 InstallColormapProcPtr InstallColormap;
62 StoreColorsProcPtr StoreColors;
63
64 /* os layer procedures */
65 ScreenBlockHandlerProcPtr BlockHandler;
66
67 CursorPtr pCursor;
68 int x; /* cursor hotspot */
69 int y;
70 BoxRec saved; /* saved area from the screen */
71 Bool isUp; /* cursor in frame buffer */
72 Bool shouldBeUp; /* cursor should be displayed */
73 WindowPtr pCacheWin; /* window the cursor last seen in */
74 Bool isInCacheWin;
75 Bool checkPixels; /* check colormap collision */
76 xColorItem colors[2];
77 ColormapPtr pInstalledMap;
78 ColormapPtr pColormap;
79 VisualPtr pVisual;
80 miSpriteCursorFuncPtr funcs;
81 DamagePtr pDamage; /* damage tracking structure */
82} miSpriteScreenRec, *miSpriteScreenPtr;
83
84#define SOURCE_COLOR 0
85#define MASK_COLOR 1
86
87#define miSpriteIsUpTRUE(pScreen, pScreenPriv) if (!pScreenPriv->isUp) { \
88 pScreenPriv->isUp = TRUE; \
89 DamageRegister (&(*pScreen->GetScreenPixmap) (pScreen)->drawable, pScreenPriv->pDamage); \
90}
91
92#define miSpriteIsUpFALSE(pScreen, pScreenPriv) if (pScreenPriv->isUp) { \
93 DamageUnregister (&(*pScreen->GetScreenPixmap) (pScreen)->drawable, pScreenPriv->pDamage); \
94 pScreenPriv->isUp = FALSE; \
95}
96
97/*
98 * Overlap BoxPtr and Box elements
99 */
100#define BOX_OVERLAP(pCbox,X1,Y1,X2,Y2) \
101 (((pCbox)->x1 <= (X2)) && ((X1) <= (pCbox)->x2) && \
102 ((pCbox)->y1 <= (Y2)) && ((Y1) <= (pCbox)->y2))
103
104/*
105 * Overlap BoxPtr, origins, and rectangle
106 */
107#define ORG_OVERLAP(pCbox,xorg,yorg,x,y,w,h) \
108 BOX_OVERLAP((pCbox),(x)+(xorg),(y)+(yorg),(x)+(xorg)+(w),(y)+(yorg)+(h))
109
110/*
111 * Overlap BoxPtr, origins and RectPtr
112 */
113#define ORGRECT_OVERLAP(pCbox,xorg,yorg,pRect) \
114 ORG_OVERLAP((pCbox),(xorg),(yorg),(pRect)->x,(pRect)->y, \
115 (int)((pRect)->width), (int)((pRect)->height))
116/*
117 * Overlap BoxPtr and horizontal span
118 */
119#define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y))
120
121#define LINE_SORT(x1,y1,x2,y2) \
122{ int _t; \
123 if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \
124 if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } }
125
126#define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \
127 BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2))
128
129#endif /* _MISPRITEST_H_ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette