38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/*
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * mispritest.h
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync *
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * mi sprite structures
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/*
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncCopyright 1989, 1998 The Open Group
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncPermission to use, copy, modify, distribute, and sell this software and its
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncdocumentation for any purpose is hereby granted without fee, provided that
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncthe above copyright notice appear in all copies and that both that
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsynccopyright notice and this permission notice appear in supporting
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncdocumentation.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncThe above copyright notice and this permission notice shall be included in
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncall copies or substantial portions of the Software.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncExcept as contained in this notice, the name of The Open Group shall not be
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncused in advertising or otherwise to promote the sale, use or other dealings
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncin this Software without prior written authorization from The Open Group.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync*/
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#ifdef HAVE_DIX_CONFIG_H
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#include <dix-config.h>
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#endif
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#ifndef _MISPRITEST_H_
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#define _MISPRITEST_H_
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync# include "misprite.h"
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#ifdef RENDER
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync# include "picturestr.h"
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#endif
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync# include "damage.h"
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsynctypedef struct {
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync CursorPtr pCursor;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync int x; /* cursor hotspot */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync int y;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync BoxRec saved; /* saved area from the screen */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync Bool isUp; /* cursor in frame buffer */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync Bool shouldBeUp; /* cursor should be displayed */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync WindowPtr pCacheWin; /* window the cursor last seen in */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync Bool isInCacheWin;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync Bool checkPixels; /* check colormap collision */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync ScreenPtr pScreen;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync} miCursorInfoRec, *miCursorInfoPtr;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/*
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * per screen information
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsynctypedef struct {
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync /* screen procedures */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync CloseScreenProcPtr CloseScreen;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync GetImageProcPtr GetImage;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync GetSpansProcPtr GetSpans;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync SourceValidateProcPtr SourceValidate;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync /* window procedures */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync CopyWindowProcPtr CopyWindow;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync /* colormap procedures */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync InstallColormapProcPtr InstallColormap;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync StoreColorsProcPtr StoreColors;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync /* os layer procedures */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync ScreenBlockHandlerProcPtr BlockHandler;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync /* device cursor procedures */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync DeviceCursorInitializeProcPtr DeviceCursorInitialize;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync DeviceCursorCleanupProcPtr DeviceCursorCleanup;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync xColorItem colors[2];
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync ColormapPtr pInstalledMap;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync ColormapPtr pColormap;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync VisualPtr pVisual;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync miSpriteCursorFuncPtr funcs;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync DamagePtr pDamage; /* damage tracking structure */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync} miSpriteScreenRec, *miSpriteScreenPtr;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#define SOURCE_COLOR 0
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#define MASK_COLOR 1
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/*
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Overlap BoxPtr and Box elements
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#define BOX_OVERLAP(pCbox,X1,Y1,X2,Y2) \
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync (((pCbox)->x1 <= (X2)) && ((X1) <= (pCbox)->x2) && \
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync ((pCbox)->y1 <= (Y2)) && ((Y1) <= (pCbox)->y2))
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/*
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Overlap BoxPtr, origins, and rectangle
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#define ORG_OVERLAP(pCbox,xorg,yorg,x,y,w,h) \
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync BOX_OVERLAP((pCbox),(x)+(xorg),(y)+(yorg),(x)+(xorg)+(w),(y)+(yorg)+(h))
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/*
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Overlap BoxPtr, origins and RectPtr
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#define ORGRECT_OVERLAP(pCbox,xorg,yorg,pRect) \
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync ORG_OVERLAP((pCbox),(xorg),(yorg),(pRect)->x,(pRect)->y, \
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync (int)((pRect)->width), (int)((pRect)->height))
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync/*
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Overlap BoxPtr and horizontal span
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y))
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#define LINE_SORT(x1,y1,x2,y2) \
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync{ int _t; \
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } }
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2))
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#endif /* _MISPRITEST_H_ */
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync