VirtualBox

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

Last change on this file since 43272 was 43272, checked in by vboxsync, 12 years ago

Additions/x11: more original X server headers.

  • Property svn:eol-style set to native
File size: 4.0 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 /* backing store procedures */
61 SaveDoomedAreasProcPtr SaveDoomedAreas;
62
63 /* colormap procedures */
64 InstallColormapProcPtr InstallColormap;
65 StoreColorsProcPtr StoreColors;
66
67 /* os layer procedures */
68 ScreenBlockHandlerProcPtr BlockHandler;
69
70 CursorPtr pCursor;
71 int x; /* cursor hotspot */
72 int y;
73 BoxRec saved; /* saved area from the screen */
74 Bool isUp; /* cursor in frame buffer */
75 Bool shouldBeUp; /* cursor should be displayed */
76 WindowPtr pCacheWin; /* window the cursor last seen in */
77 Bool isInCacheWin;
78 Bool checkPixels; /* check colormap collision */
79 xColorItem colors[2];
80 ColormapPtr pInstalledMap;
81 ColormapPtr pColormap;
82 VisualPtr pVisual;
83 miSpriteCursorFuncPtr funcs;
84 DamagePtr pDamage; /* damage tracking structure */
85} miSpriteScreenRec, *miSpriteScreenPtr;
86
87#define SOURCE_COLOR 0
88#define MASK_COLOR 1
89
90#define miSpriteIsUpTRUE(pScreen, pScreenPriv) if (!pScreenPriv->isUp) { \
91 pScreenPriv->isUp = TRUE; \
92 DamageRegister (&(*pScreen->GetScreenPixmap) (pScreen)->drawable, pScreenPriv->pDamage); \
93}
94
95#define miSpriteIsUpFALSE(pScreen, pScreenPriv) if (pScreenPriv->isUp) { \
96 DamageUnregister (&(*pScreen->GetScreenPixmap) (pScreen)->drawable, pScreenPriv->pDamage); \
97 pScreenPriv->isUp = FALSE; \
98}
99
100/*
101 * Overlap BoxPtr and Box elements
102 */
103#define BOX_OVERLAP(pCbox,X1,Y1,X2,Y2) \
104 (((pCbox)->x1 <= (X2)) && ((X1) <= (pCbox)->x2) && \
105 ((pCbox)->y1 <= (Y2)) && ((Y1) <= (pCbox)->y2))
106
107/*
108 * Overlap BoxPtr, origins, and rectangle
109 */
110#define ORG_OVERLAP(pCbox,xorg,yorg,x,y,w,h) \
111 BOX_OVERLAP((pCbox),(x)+(xorg),(y)+(yorg),(x)+(xorg)+(w),(y)+(yorg)+(h))
112
113/*
114 * Overlap BoxPtr, origins and RectPtr
115 */
116#define ORGRECT_OVERLAP(pCbox,xorg,yorg,pRect) \
117 ORG_OVERLAP((pCbox),(xorg),(yorg),(pRect)->x,(pRect)->y, \
118 (int)((pRect)->width), (int)((pRect)->height))
119/*
120 * Overlap BoxPtr and horizontal span
121 */
122#define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y))
123
124#define LINE_SORT(x1,y1,x2,y2) \
125{ int _t; \
126 if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \
127 if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } }
128
129#define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \
130 BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2))
131
132#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