compint.h revision 1b5d61b8
105b261ecSmrg/* 29ace9065Smrg * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. 305b261ecSmrg * 46747b715Smrg * Permission is hereby granted, free of charge, to any person obtaining a 56747b715Smrg * copy of this software and associated documentation files (the "Software"), 66747b715Smrg * to deal in the Software without restriction, including without limitation 76747b715Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 86747b715Smrg * and/or sell copies of the Software, and to permit persons to whom the 96747b715Smrg * Software is furnished to do so, subject to the following conditions: 1005b261ecSmrg * 116747b715Smrg * The above copyright notice and this permission notice (including the next 126747b715Smrg * paragraph) shall be included in all copies or substantial portions of the 136747b715Smrg * Software. 146747b715Smrg * 156747b715Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 166747b715Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 176747b715Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 186747b715Smrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 196747b715Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 206747b715Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 216747b715Smrg * DEALINGS IN THE SOFTWARE. 2205b261ecSmrg * 2305b261ecSmrg * Copyright © 2003 Keith Packard 2405b261ecSmrg * 2505b261ecSmrg * Permission to use, copy, modify, distribute, and sell this software and its 2605b261ecSmrg * documentation for any purpose is hereby granted without fee, provided that 2705b261ecSmrg * the above copyright notice appear in all copies and that both that 2805b261ecSmrg * copyright notice and this permission notice appear in supporting 2905b261ecSmrg * documentation, and that the name of Keith Packard not be used in 3005b261ecSmrg * advertising or publicity pertaining to distribution of the software without 3105b261ecSmrg * specific, written prior permission. Keith Packard makes no 3205b261ecSmrg * representations about the suitability of this software for any purpose. It 3305b261ecSmrg * is provided "as is" without express or implied warranty. 3405b261ecSmrg * 3505b261ecSmrg * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 3605b261ecSmrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 3705b261ecSmrg * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR 3805b261ecSmrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 3905b261ecSmrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 4005b261ecSmrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 4105b261ecSmrg * PERFORMANCE OF THIS SOFTWARE. 4205b261ecSmrg */ 4305b261ecSmrg 4405b261ecSmrg#ifdef HAVE_DIX_CONFIG_H 4505b261ecSmrg#include <dix-config.h> 4605b261ecSmrg#endif 4705b261ecSmrg 4805b261ecSmrg#ifndef _COMPINT_H_ 4905b261ecSmrg#define _COMPINT_H_ 5005b261ecSmrg 5105b261ecSmrg#include "misc.h" 5205b261ecSmrg#include "scrnintstr.h" 5305b261ecSmrg#include "os.h" 5405b261ecSmrg#include "regionstr.h" 5505b261ecSmrg#include "validate.h" 5605b261ecSmrg#include "windowstr.h" 5705b261ecSmrg#include "input.h" 5805b261ecSmrg#include "resource.h" 5905b261ecSmrg#include "colormapst.h" 6005b261ecSmrg#include "cursorstr.h" 6105b261ecSmrg#include "dixstruct.h" 6205b261ecSmrg#include "gcstruct.h" 6305b261ecSmrg#include "servermd.h" 6405b261ecSmrg#include "dixevents.h" 6505b261ecSmrg#include "globals.h" 6605b261ecSmrg#include "picturestr.h" 6705b261ecSmrg#include "extnsionst.h" 684642e01fSmrg#include "privates.h" 6905b261ecSmrg#include "mi.h" 7005b261ecSmrg#include "damage.h" 7105b261ecSmrg#include "damageextint.h" 7205b261ecSmrg#include "xfixes.h" 7305b261ecSmrg#include <X11/extensions/compositeproto.h> 7435c4bbdfSmrg#include "compositeext.h" 7505b261ecSmrg#include <assert.h> 7605b261ecSmrg 7705b261ecSmrg/* 7805b261ecSmrg * enable this for debugging 7935c4bbdfSmrg 8005b261ecSmrg #define COMPOSITE_DEBUG 8105b261ecSmrg */ 8205b261ecSmrg 8305b261ecSmrgtypedef struct _CompClientWindow { 8435c4bbdfSmrg struct _CompClientWindow *next; 8535c4bbdfSmrg XID id; 8635c4bbdfSmrg int update; 8735c4bbdfSmrg} CompClientWindowRec, *CompClientWindowPtr; 8805b261ecSmrg 8905b261ecSmrgtypedef struct _CompWindow { 9035c4bbdfSmrg RegionRec borderClip; 9135c4bbdfSmrg DamagePtr damage; /* for automatic update mode */ 9235c4bbdfSmrg Bool damageRegistered; 9335c4bbdfSmrg Bool damaged; 9435c4bbdfSmrg int update; 9535c4bbdfSmrg CompClientWindowPtr clients; 9635c4bbdfSmrg int oldx; 9735c4bbdfSmrg int oldy; 9835c4bbdfSmrg PixmapPtr pOldPixmap; 9935c4bbdfSmrg int borderClipX, borderClipY; 10005b261ecSmrg} CompWindowRec, *CompWindowPtr; 10105b261ecSmrg 10205b261ecSmrg#define COMP_ORIGIN_INVALID 0x80000000 10305b261ecSmrg 10405b261ecSmrgtypedef struct _CompSubwindows { 10535c4bbdfSmrg int update; 10635c4bbdfSmrg CompClientWindowPtr clients; 10705b261ecSmrg} CompSubwindowsRec, *CompSubwindowsPtr; 10805b261ecSmrg 10905b261ecSmrg#ifndef COMP_INCLUDE_RGB24_VISUAL 11005b261ecSmrg#define COMP_INCLUDE_RGB24_VISUAL 0 11105b261ecSmrg#endif 11205b261ecSmrg 11305b261ecSmrgtypedef struct _CompOverlayClientRec *CompOverlayClientPtr; 11405b261ecSmrg 11505b261ecSmrgtypedef struct _CompOverlayClientRec { 11635c4bbdfSmrg CompOverlayClientPtr pNext; 11735c4bbdfSmrg ClientPtr pClient; 11835c4bbdfSmrg ScreenPtr pScreen; 11935c4bbdfSmrg XID resource; 12005b261ecSmrg} CompOverlayClientRec; 12105b261ecSmrg 12235c4bbdfSmrgtypedef struct _CompImplicitRedirectException { 12335c4bbdfSmrg XID parentVisual; 12435c4bbdfSmrg XID winVisual; 12535c4bbdfSmrg} CompImplicitRedirectException; 12635c4bbdfSmrg 12705b261ecSmrgtypedef struct _CompScreen { 12835c4bbdfSmrg PositionWindowProcPtr PositionWindow; 12935c4bbdfSmrg CopyWindowProcPtr CopyWindow; 13035c4bbdfSmrg CreateWindowProcPtr CreateWindow; 13135c4bbdfSmrg DestroyWindowProcPtr DestroyWindow; 13235c4bbdfSmrg RealizeWindowProcPtr RealizeWindow; 13335c4bbdfSmrg UnrealizeWindowProcPtr UnrealizeWindow; 13435c4bbdfSmrg ClipNotifyProcPtr ClipNotify; 13505b261ecSmrg /* 13605b261ecSmrg * Called from ConfigureWindow, these 13705b261ecSmrg * three track changes to the offscreen storage 13805b261ecSmrg * geometry 13905b261ecSmrg */ 14035c4bbdfSmrg ConfigNotifyProcPtr ConfigNotify; 14135c4bbdfSmrg MoveWindowProcPtr MoveWindow; 14235c4bbdfSmrg ResizeWindowProcPtr ResizeWindow; 14335c4bbdfSmrg ChangeBorderWidthProcPtr ChangeBorderWidth; 14405b261ecSmrg /* 14505b261ecSmrg * Reparenting has an effect on Subwindows redirect 14605b261ecSmrg */ 14735c4bbdfSmrg ReparentWindowProcPtr ReparentWindow; 14835c4bbdfSmrg 14905b261ecSmrg /* 15005b261ecSmrg * Colormaps for new visuals better not get installed 15105b261ecSmrg */ 15235c4bbdfSmrg InstallColormapProcPtr InstallColormap; 15305b261ecSmrg 1544642e01fSmrg /* 1554642e01fSmrg * Fake backing store via automatic redirection 1564642e01fSmrg */ 1574642e01fSmrg ChangeWindowAttributesProcPtr ChangeWindowAttributes; 1584642e01fSmrg 1591b5d61b8Smrg Bool pendingScreenUpdate; 1601b5d61b8Smrg 16135c4bbdfSmrg CloseScreenProcPtr CloseScreen; 16235c4bbdfSmrg int numAlternateVisuals; 16335c4bbdfSmrg VisualID *alternateVisuals; 16435c4bbdfSmrg int numImplicitRedirectExceptions; 16535c4bbdfSmrg CompImplicitRedirectException *implicitRedirectExceptions; 16635c4bbdfSmrg 16735c4bbdfSmrg WindowPtr pOverlayWin; 16835c4bbdfSmrg Window overlayWid; 16935c4bbdfSmrg CompOverlayClientPtr pOverlayClients; 17035c4bbdfSmrg 17135c4bbdfSmrg GetImageProcPtr GetImage; 17235c4bbdfSmrg GetSpansProcPtr GetSpans; 17335c4bbdfSmrg SourceValidateProcPtr SourceValidate; 17405b261ecSmrg} CompScreenRec, *CompScreenPtr; 17505b261ecSmrg 1766747b715Smrgextern DevPrivateKeyRec CompScreenPrivateKeyRec; 17735c4bbdfSmrg 1786747b715Smrg#define CompScreenPrivateKey (&CompScreenPrivateKeyRec) 1796747b715Smrg 1806747b715Smrgextern DevPrivateKeyRec CompWindowPrivateKeyRec; 18135c4bbdfSmrg 1826747b715Smrg#define CompWindowPrivateKey (&CompWindowPrivateKeyRec) 1836747b715Smrg 1846747b715Smrgextern DevPrivateKeyRec CompSubwindowsPrivateKeyRec; 18535c4bbdfSmrg 1866747b715Smrg#define CompSubwindowsPrivateKey (&CompSubwindowsPrivateKeyRec) 18705b261ecSmrg 1884642e01fSmrg#define GetCompScreen(s) ((CompScreenPtr) \ 1894642e01fSmrg dixLookupPrivate(&(s)->devPrivates, CompScreenPrivateKey)) 1904642e01fSmrg#define GetCompWindow(w) ((CompWindowPtr) \ 1914642e01fSmrg dixLookupPrivate(&(w)->devPrivates, CompWindowPrivateKey)) 1924642e01fSmrg#define GetCompSubwindows(w) ((CompSubwindowsPtr) \ 1934642e01fSmrg dixLookupPrivate(&(w)->devPrivates, CompSubwindowsPrivateKey)) 19405b261ecSmrg 19535c4bbdfSmrgextern RESTYPE CompositeClientSubwindowsType; 19635c4bbdfSmrgextern RESTYPE CompositeClientOverlayType; 19705b261ecSmrg 19805b261ecSmrg/* 19905b261ecSmrg * compalloc.c 20005b261ecSmrg */ 20105b261ecSmrg 20205b261ecSmrgBool 20335c4bbdfSmrg compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update); 20405b261ecSmrg 20505b261ecSmrgvoid 20635c4bbdfSmrg compFreeClientWindow(WindowPtr pWin, XID id); 20705b261ecSmrg 20805b261ecSmrgint 20935c4bbdfSmrg compUnredirectWindow(ClientPtr pClient, WindowPtr pWin, int update); 21005b261ecSmrg 21105b261ecSmrgint 21235c4bbdfSmrg compRedirectSubwindows(ClientPtr pClient, WindowPtr pWin, int update); 21305b261ecSmrg 21405b261ecSmrgvoid 21535c4bbdfSmrg compFreeClientSubwindows(WindowPtr pWin, XID id); 21605b261ecSmrg 21705b261ecSmrgint 21835c4bbdfSmrg compUnredirectSubwindows(ClientPtr pClient, WindowPtr pWin, int update); 21905b261ecSmrg 22005b261ecSmrgint 22135c4bbdfSmrg compRedirectOneSubwindow(WindowPtr pParent, WindowPtr pWin); 22205b261ecSmrg 22305b261ecSmrgint 22435c4bbdfSmrg compUnredirectOneSubwindow(WindowPtr pParent, WindowPtr pWin); 22505b261ecSmrg 22605b261ecSmrgBool 22735c4bbdfSmrg compAllocPixmap(WindowPtr pWin); 22805b261ecSmrg 22905b261ecSmrgvoid 23035c4bbdfSmrg compSetParentPixmap(WindowPtr pWin); 23105b261ecSmrg 23235c4bbdfSmrgvoid 23335c4bbdfSmrg compRestoreWindow(WindowPtr pWin, PixmapPtr pPixmap); 23405b261ecSmrg 23535c4bbdfSmrgBool 23605b261ecSmrg 23735c4bbdfSmrgcompReallocPixmap(WindowPtr pWin, int x, int y, 23835c4bbdfSmrg unsigned int w, unsigned int h, int bw); 23905b261ecSmrg 2401b5d61b8Smrgvoid compMarkAncestors(WindowPtr pWin); 2411b5d61b8Smrg 24205b261ecSmrg/* 24305b261ecSmrg * compinit.c 24405b261ecSmrg */ 24505b261ecSmrg 24605b261ecSmrgBool 24735c4bbdfSmrg compScreenInit(ScreenPtr pScreen); 24805b261ecSmrg 2494642e01fSmrg/* 2504642e01fSmrg * compoverlay.c 2514642e01fSmrg */ 2524642e01fSmrg 2534642e01fSmrgvoid 25435c4bbdfSmrg compFreeOverlayClient(CompOverlayClientPtr pOcToDel); 2554642e01fSmrg 2564642e01fSmrgCompOverlayClientPtr 25735c4bbdfSmrgcompFindOverlayClient(ScreenPtr pScreen, ClientPtr pClient); 25835c4bbdfSmrg 2594642e01fSmrgCompOverlayClientPtr 26035c4bbdfSmrgcompCreateOverlayClient(ScreenPtr pScreen, ClientPtr pClient); 2614642e01fSmrg 2624642e01fSmrgBool 26335c4bbdfSmrg compCreateOverlayWindow(ScreenPtr pScreen); 2644642e01fSmrg 2654642e01fSmrgvoid 26635c4bbdfSmrg compDestroyOverlayWindow(ScreenPtr pScreen); 2674642e01fSmrg 26805b261ecSmrg/* 26905b261ecSmrg * compwindow.c 27005b261ecSmrg */ 27105b261ecSmrg 27205b261ecSmrg#ifdef COMPOSITE_DEBUG 27305b261ecSmrgvoid 27435c4bbdfSmrg compCheckTree(ScreenPtr pScreen); 27505b261ecSmrg#else 27605b261ecSmrg#define compCheckTree(s) 27705b261ecSmrg#endif 27805b261ecSmrg 27905b261ecSmrgvoid 2801b5d61b8Smrg compSetPixmap(WindowPtr pWin, PixmapPtr pPixmap, int bw); 28105b261ecSmrg 28205b261ecSmrgBool 28335c4bbdfSmrg compCheckRedirect(WindowPtr pWin); 28405b261ecSmrg 28505b261ecSmrgBool 28635c4bbdfSmrg compPositionWindow(WindowPtr pWin, int x, int y); 28705b261ecSmrg 28805b261ecSmrgBool 28935c4bbdfSmrg compRealizeWindow(WindowPtr pWin); 29005b261ecSmrg 29105b261ecSmrgBool 29235c4bbdfSmrg compUnrealizeWindow(WindowPtr pWin); 29305b261ecSmrg 29405b261ecSmrgvoid 29535c4bbdfSmrg compClipNotify(WindowPtr pWin, int dx, int dy); 29605b261ecSmrg 29705b261ecSmrgvoid 29835c4bbdfSmrg compMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind); 29905b261ecSmrg 30005b261ecSmrgvoid 30135c4bbdfSmrg 30235c4bbdfSmrgcompResizeWindow(WindowPtr pWin, int x, int y, 30335c4bbdfSmrg unsigned int w, unsigned int h, WindowPtr pSib); 30405b261ecSmrg 30505b261ecSmrgvoid 30635c4bbdfSmrg compChangeBorderWidth(WindowPtr pWin, unsigned int border_width); 30705b261ecSmrg 30805b261ecSmrgvoid 30935c4bbdfSmrg compReparentWindow(WindowPtr pWin, WindowPtr pPriorParent); 31005b261ecSmrg 31105b261ecSmrgBool 31235c4bbdfSmrg compCreateWindow(WindowPtr pWin); 31305b261ecSmrg 31405b261ecSmrgBool 31535c4bbdfSmrg compDestroyWindow(WindowPtr pWin); 31605b261ecSmrg 31705b261ecSmrgvoid 31835c4bbdfSmrg compSetRedirectBorderClip(WindowPtr pWin, RegionPtr pRegion); 31905b261ecSmrg 32005b261ecSmrgRegionPtr 32135c4bbdfSmrg compGetRedirectBorderClip(WindowPtr pWin); 32205b261ecSmrg 32305b261ecSmrgvoid 32435c4bbdfSmrg compCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); 32505b261ecSmrg 32605b261ecSmrgvoid 32735c4bbdfSmrg compPaintChildrenToWindow(WindowPtr pWin); 32805b261ecSmrg 32905b261ecSmrgWindowPtr 33035c4bbdfSmrg CompositeRealChildHead(WindowPtr pWin); 33105b261ecSmrg 33205b261ecSmrgint 33335c4bbdfSmrg DeleteWindowNoInputDevices(void *value, XID wid); 33405b261ecSmrg 3356747b715Smrgint 33635c4bbdfSmrg 3376747b715SmrgcompConfigNotify(WindowPtr pWin, int x, int y, int w, int h, 33835c4bbdfSmrg int bw, WindowPtr pSib); 3396747b715Smrg 34035c4bbdfSmrgvoid PanoramiXCompositeInit(void); 34135c4bbdfSmrgvoid PanoramiXCompositeReset(void); 3429ace9065Smrg 34335c4bbdfSmrg#endif /* _COMPINT_H_ */ 344