105b261ecSmrg/* 205b261ecSmrg * 305b261ecSmrg * Copyright © 2000 Keith Packard 405b261ecSmrg * 505b261ecSmrg * Permission to use, copy, modify, distribute, and sell this software and its 605b261ecSmrg * documentation for any purpose is hereby granted without fee, provided that 705b261ecSmrg * the above copyright notice appear in all copies and that both that 805b261ecSmrg * copyright notice and this permission notice appear in supporting 905b261ecSmrg * documentation, and that the name of Keith Packard not be used in 1005b261ecSmrg * advertising or publicity pertaining to distribution of the software without 1105b261ecSmrg * specific, written prior permission. Keith Packard makes no 1205b261ecSmrg * representations about the suitability of this software for any purpose. It 1305b261ecSmrg * is provided "as is" without express or implied warranty. 1405b261ecSmrg * 1505b261ecSmrg * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 1605b261ecSmrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 1705b261ecSmrg * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR 1805b261ecSmrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 1905b261ecSmrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 2005b261ecSmrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 2105b261ecSmrg * PERFORMANCE OF THIS SOFTWARE. 2205b261ecSmrg */ 2305b261ecSmrg 2405b261ecSmrg#ifndef _SHADOW_H_ 2505b261ecSmrg#define _SHADOW_H_ 2605b261ecSmrg 2705b261ecSmrg#include "scrnintstr.h" 2805b261ecSmrg 2905b261ecSmrg#include "picturestr.h" 3005b261ecSmrg 3105b261ecSmrg#include "damage.h" 3205b261ecSmrg#include "damagestr.h" 3335c4bbdfSmrgtypedef struct _shadowBuf *shadowBufPtr; 3405b261ecSmrg 3535c4bbdfSmrgtypedef void (*ShadowUpdateProc) (ScreenPtr pScreen, shadowBufPtr pBuf); 3605b261ecSmrg 3705b261ecSmrg#define SHADOW_WINDOW_RELOCATE 1 3805b261ecSmrg#define SHADOW_WINDOW_READ 2 3905b261ecSmrg#define SHADOW_WINDOW_WRITE 4 4005b261ecSmrg 4135c4bbdfSmrgtypedef void *(*ShadowWindowProc) (ScreenPtr pScreen, 4235c4bbdfSmrg CARD32 row, 4335c4bbdfSmrg CARD32 offset, 4435c4bbdfSmrg int mode, CARD32 *size, void *closure); 4505b261ecSmrg 4605b261ecSmrgtypedef struct _shadowBuf { 4735c4bbdfSmrg DamagePtr pDamage; 4835c4bbdfSmrg ShadowUpdateProc update; 4935c4bbdfSmrg ShadowWindowProc window; 5035c4bbdfSmrg PixmapPtr pPixmap; 5135c4bbdfSmrg void *closure; 5235c4bbdfSmrg int randr; 5305b261ecSmrg 5405b261ecSmrg /* screen wrappers */ 5535c4bbdfSmrg GetImageProcPtr GetImage; 5635c4bbdfSmrg CloseScreenProcPtr CloseScreen; 571b5d61b8Smrg ScreenBlockHandlerProcPtr BlockHandler; 5805b261ecSmrg} shadowBufRec; 5905b261ecSmrg 6005b261ecSmrg/* Match defines from randr extension */ 6105b261ecSmrg#define SHADOW_ROTATE_0 1 6205b261ecSmrg#define SHADOW_ROTATE_90 2 6305b261ecSmrg#define SHADOW_ROTATE_180 4 6405b261ecSmrg#define SHADOW_ROTATE_270 8 6505b261ecSmrg#define SHADOW_ROTATE_ALL (SHADOW_ROTATE_0|SHADOW_ROTATE_90|\ 6605b261ecSmrg SHADOW_ROTATE_180|SHADOW_ROTATE_270) 6705b261ecSmrg#define SHADOW_REFLECT_X 16 6805b261ecSmrg#define SHADOW_REFLECT_Y 32 6905b261ecSmrg#define SHADOW_REFLECT_ALL (SHADOW_REFLECT_X|SHADOW_REFLECT_Y) 7005b261ecSmrg 716747b715Smrgextern _X_EXPORT Bool 7235c4bbdfSmrg shadowSetup(ScreenPtr pScreen); 7305b261ecSmrg 746747b715Smrgextern _X_EXPORT Bool 7535c4bbdfSmrg 7635c4bbdfSmrgshadowAdd(ScreenPtr pScreen, 7735c4bbdfSmrg PixmapPtr pPixmap, 7835c4bbdfSmrg ShadowUpdateProc update, 7935c4bbdfSmrg ShadowWindowProc window, int randr, void *closure); 8005b261ecSmrg 816747b715Smrgextern _X_EXPORT void 8235c4bbdfSmrg shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap); 8305b261ecSmrg 8435c4bbdfSmrgextern _X_EXPORT void 8535c4bbdfSmrg shadowUpdateAfb4(ScreenPtr pScreen, shadowBufPtr pBuf); 8635c4bbdfSmrg 8735c4bbdfSmrgextern _X_EXPORT void 8835c4bbdfSmrg shadowUpdateAfb8(ScreenPtr pScreen, shadowBufPtr pBuf); 8935c4bbdfSmrg 9001260a01Sjandbergextern _X_EXPORT void 9101260a01Sjandberg shadowUpdateAfb4x8(ScreenPtr pScreen, shadowBufPtr pBuf); 9201260a01Sjandberg 9335c4bbdfSmrgextern _X_EXPORT void 9435c4bbdfSmrg shadowUpdateIplan2p4(ScreenPtr pScreen, shadowBufPtr pBuf); 9535c4bbdfSmrg 9635c4bbdfSmrgextern _X_EXPORT void 9735c4bbdfSmrg shadowUpdateIplan2p8(ScreenPtr pScreen, shadowBufPtr pBuf); 9805b261ecSmrg 996747b715Smrgextern _X_EXPORT void 10035c4bbdfSmrg shadowUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf); 10105b261ecSmrg 1026747b715Smrgextern _X_EXPORT void 10335c4bbdfSmrg shadowUpdatePlanar4(ScreenPtr pScreen, shadowBufPtr pBuf); 10405b261ecSmrg 1056747b715Smrgextern _X_EXPORT void 10635c4bbdfSmrg shadowUpdatePlanar4x8(ScreenPtr pScreen, shadowBufPtr pBuf); 10705b261ecSmrg 1086747b715Smrgextern _X_EXPORT void 10935c4bbdfSmrg shadowUpdateRotatePacked(ScreenPtr pScreen, shadowBufPtr pBuf); 11005b261ecSmrg 1116747b715Smrgextern _X_EXPORT void 11235c4bbdfSmrg shadowUpdateRotate8_90(ScreenPtr pScreen, shadowBufPtr pBuf); 11305b261ecSmrg 1146747b715Smrgextern _X_EXPORT void 11535c4bbdfSmrg shadowUpdateRotate16_90(ScreenPtr pScreen, shadowBufPtr pBuf); 11605b261ecSmrg 1176747b715Smrgextern _X_EXPORT void 11835c4bbdfSmrg shadowUpdateRotate16_90YX(ScreenPtr pScreen, shadowBufPtr pBuf); 11905b261ecSmrg 1206747b715Smrgextern _X_EXPORT void 12135c4bbdfSmrg shadowUpdateRotate32_90(ScreenPtr pScreen, shadowBufPtr pBuf); 12205b261ecSmrg 1236747b715Smrgextern _X_EXPORT void 12435c4bbdfSmrg shadowUpdateRotate8_180(ScreenPtr pScreen, shadowBufPtr pBuf); 12505b261ecSmrg 1266747b715Smrgextern _X_EXPORT void 12735c4bbdfSmrg shadowUpdateRotate16_180(ScreenPtr pScreen, shadowBufPtr pBuf); 12805b261ecSmrg 1296747b715Smrgextern _X_EXPORT void 13035c4bbdfSmrg shadowUpdateRotate32_180(ScreenPtr pScreen, shadowBufPtr pBuf); 13105b261ecSmrg 1326747b715Smrgextern _X_EXPORT void 13335c4bbdfSmrg shadowUpdateRotate8_270(ScreenPtr pScreen, shadowBufPtr pBuf); 13405b261ecSmrg 1356747b715Smrgextern _X_EXPORT void 13635c4bbdfSmrg shadowUpdateRotate16_270(ScreenPtr pScreen, shadowBufPtr pBuf); 13705b261ecSmrg 1386747b715Smrgextern _X_EXPORT void 13935c4bbdfSmrg shadowUpdateRotate16_270YX(ScreenPtr pScreen, shadowBufPtr pBuf); 14005b261ecSmrg 1416747b715Smrgextern _X_EXPORT void 14235c4bbdfSmrg shadowUpdateRotate32_270(ScreenPtr pScreen, shadowBufPtr pBuf); 14305b261ecSmrg 1446747b715Smrgextern _X_EXPORT void 14535c4bbdfSmrg shadowUpdateRotate8(ScreenPtr pScreen, shadowBufPtr pBuf); 14605b261ecSmrg 1476747b715Smrgextern _X_EXPORT void 14835c4bbdfSmrg shadowUpdateRotate16(ScreenPtr pScreen, shadowBufPtr pBuf); 14905b261ecSmrg 1506747b715Smrgextern _X_EXPORT void 15135c4bbdfSmrg shadowUpdateRotate32(ScreenPtr pScreen, shadowBufPtr pBuf); 15205b261ecSmrg 1531b5d61b8Smrgextern _X_EXPORT void 1541b5d61b8Smrg shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf); 15505b261ecSmrg 1561b5d61b8Smrgtypedef void (*shadowUpdateProc) (ScreenPtr, shadowBufPtr); 15705b261ecSmrg 15835c4bbdfSmrg#endif /* _SHADOW_H_ */ 159