compint.h revision 9ace9065
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> 7405b261ecSmrg#include <assert.h> 7505b261ecSmrg 7605b261ecSmrg/* 7705b261ecSmrg * enable this for debugging 7805b261ecSmrg 7905b261ecSmrg #define COMPOSITE_DEBUG 8005b261ecSmrg */ 8105b261ecSmrg 8205b261ecSmrgtypedef struct _CompClientWindow { 8305b261ecSmrg struct _CompClientWindow *next; 8405b261ecSmrg XID id; 8505b261ecSmrg int update; 8605b261ecSmrg} CompClientWindowRec, *CompClientWindowPtr; 8705b261ecSmrg 8805b261ecSmrgtypedef struct _CompWindow { 8905b261ecSmrg RegionRec borderClip; 9005b261ecSmrg DamagePtr damage; /* for automatic update mode */ 9105b261ecSmrg Bool damageRegistered; 9205b261ecSmrg Bool damaged; 9305b261ecSmrg int update; 9405b261ecSmrg CompClientWindowPtr clients; 9505b261ecSmrg int oldx; 9605b261ecSmrg int oldy; 9705b261ecSmrg PixmapPtr pOldPixmap; 9805b261ecSmrg int borderClipX, borderClipY; 9905b261ecSmrg} CompWindowRec, *CompWindowPtr; 10005b261ecSmrg 10105b261ecSmrg#define COMP_ORIGIN_INVALID 0x80000000 10205b261ecSmrg 10305b261ecSmrgtypedef struct _CompSubwindows { 10405b261ecSmrg int update; 10505b261ecSmrg CompClientWindowPtr clients; 10605b261ecSmrg} CompSubwindowsRec, *CompSubwindowsPtr; 10705b261ecSmrg 10805b261ecSmrg#ifndef COMP_INCLUDE_RGB24_VISUAL 10905b261ecSmrg#define COMP_INCLUDE_RGB24_VISUAL 0 11005b261ecSmrg#endif 11105b261ecSmrg 11205b261ecSmrgtypedef struct _CompOverlayClientRec *CompOverlayClientPtr; 11305b261ecSmrg 11405b261ecSmrgtypedef struct _CompOverlayClientRec { 11505b261ecSmrg CompOverlayClientPtr pNext; 11605b261ecSmrg ClientPtr pClient; 11705b261ecSmrg ScreenPtr pScreen; 11805b261ecSmrg XID resource; 11905b261ecSmrg} CompOverlayClientRec; 12005b261ecSmrg 12105b261ecSmrgtypedef struct _CompScreen { 12205b261ecSmrg PositionWindowProcPtr PositionWindow; 12305b261ecSmrg CopyWindowProcPtr CopyWindow; 12405b261ecSmrg CreateWindowProcPtr CreateWindow; 12505b261ecSmrg DestroyWindowProcPtr DestroyWindow; 12605b261ecSmrg RealizeWindowProcPtr RealizeWindow; 12705b261ecSmrg UnrealizeWindowProcPtr UnrealizeWindow; 12805b261ecSmrg ClipNotifyProcPtr ClipNotify; 12905b261ecSmrg /* 13005b261ecSmrg * Called from ConfigureWindow, these 13105b261ecSmrg * three track changes to the offscreen storage 13205b261ecSmrg * geometry 13305b261ecSmrg */ 1346747b715Smrg ConfigNotifyProcPtr ConfigNotify; 13505b261ecSmrg MoveWindowProcPtr MoveWindow; 13605b261ecSmrg ResizeWindowProcPtr ResizeWindow; 13705b261ecSmrg ChangeBorderWidthProcPtr ChangeBorderWidth; 13805b261ecSmrg /* 13905b261ecSmrg * Reparenting has an effect on Subwindows redirect 14005b261ecSmrg */ 14105b261ecSmrg ReparentWindowProcPtr ReparentWindow; 14205b261ecSmrg 14305b261ecSmrg /* 14405b261ecSmrg * Colormaps for new visuals better not get installed 14505b261ecSmrg */ 14605b261ecSmrg InstallColormapProcPtr InstallColormap; 14705b261ecSmrg 1484642e01fSmrg /* 1494642e01fSmrg * Fake backing store via automatic redirection 1504642e01fSmrg */ 1514642e01fSmrg ChangeWindowAttributesProcPtr ChangeWindowAttributes; 1524642e01fSmrg 15305b261ecSmrg ScreenBlockHandlerProcPtr BlockHandler; 15405b261ecSmrg CloseScreenProcPtr CloseScreen; 15505b261ecSmrg int numAlternateVisuals; 15605b261ecSmrg VisualID *alternateVisuals; 15705b261ecSmrg 15805b261ecSmrg WindowPtr pOverlayWin; 1594642e01fSmrg Window overlayWid; 16005b261ecSmrg CompOverlayClientPtr pOverlayClients; 16105b261ecSmrg 1629ace9065Smrg GetImageProcPtr GetImage; 1639ace9065Smrg SourceValidateProcPtr SourceValidate; 16405b261ecSmrg} CompScreenRec, *CompScreenPtr; 16505b261ecSmrg 1666747b715Smrgextern DevPrivateKeyRec CompScreenPrivateKeyRec; 1676747b715Smrg#define CompScreenPrivateKey (&CompScreenPrivateKeyRec) 1686747b715Smrg 1696747b715Smrgextern DevPrivateKeyRec CompWindowPrivateKeyRec; 1706747b715Smrg#define CompWindowPrivateKey (&CompWindowPrivateKeyRec) 1716747b715Smrg 1726747b715Smrgextern DevPrivateKeyRec CompSubwindowsPrivateKeyRec; 1736747b715Smrg#define CompSubwindowsPrivateKey (&CompSubwindowsPrivateKeyRec) 17405b261ecSmrg 1754642e01fSmrg#define GetCompScreen(s) ((CompScreenPtr) \ 1764642e01fSmrg dixLookupPrivate(&(s)->devPrivates, CompScreenPrivateKey)) 1774642e01fSmrg#define GetCompWindow(w) ((CompWindowPtr) \ 1784642e01fSmrg dixLookupPrivate(&(w)->devPrivates, CompWindowPrivateKey)) 1794642e01fSmrg#define GetCompSubwindows(w) ((CompSubwindowsPtr) \ 1804642e01fSmrg dixLookupPrivate(&(w)->devPrivates, CompSubwindowsPrivateKey)) 18105b261ecSmrg 18205b261ecSmrgextern RESTYPE CompositeClientWindowType; 18305b261ecSmrgextern RESTYPE CompositeClientSubwindowsType; 1844642e01fSmrgextern RESTYPE CompositeClientOverlayType; 18505b261ecSmrg 18605b261ecSmrg/* 18705b261ecSmrg * compalloc.c 18805b261ecSmrg */ 18905b261ecSmrg 19005b261ecSmrgBool 19105b261ecSmrgcompRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update); 19205b261ecSmrg 19305b261ecSmrgvoid 19405b261ecSmrgcompFreeClientWindow (WindowPtr pWin, XID id); 19505b261ecSmrg 19605b261ecSmrgint 19705b261ecSmrgcompUnredirectWindow (ClientPtr pClient, WindowPtr pWin, int update); 19805b261ecSmrg 19905b261ecSmrgint 20005b261ecSmrgcompRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update); 20105b261ecSmrg 20205b261ecSmrgvoid 20305b261ecSmrgcompFreeClientSubwindows (WindowPtr pWin, XID id); 20405b261ecSmrg 20505b261ecSmrgint 20605b261ecSmrgcompUnredirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update); 20705b261ecSmrg 20805b261ecSmrgint 20905b261ecSmrgcompRedirectOneSubwindow (WindowPtr pParent, WindowPtr pWin); 21005b261ecSmrg 21105b261ecSmrgint 21205b261ecSmrgcompUnredirectOneSubwindow (WindowPtr pParent, WindowPtr pWin); 21305b261ecSmrg 21405b261ecSmrgBool 21505b261ecSmrgcompAllocPixmap (WindowPtr pWin); 21605b261ecSmrg 21705b261ecSmrgvoid 21805b261ecSmrgcompFreePixmap (WindowPtr pWin); 21905b261ecSmrg 22005b261ecSmrgBool 22105b261ecSmrgcompReallocPixmap (WindowPtr pWin, int x, int y, 22205b261ecSmrg unsigned int w, unsigned int h, int bw); 22305b261ecSmrg 22405b261ecSmrg/* 22505b261ecSmrg * compext.c 22605b261ecSmrg */ 22705b261ecSmrg 22805b261ecSmrgvoid 22905b261ecSmrgCompositeExtensionInit (void); 23005b261ecSmrg 23105b261ecSmrg/* 23205b261ecSmrg * compinit.c 23305b261ecSmrg */ 23405b261ecSmrg 23505b261ecSmrgBool 23605b261ecSmrgcompScreenInit (ScreenPtr pScreen); 23705b261ecSmrg 2384642e01fSmrg/* 2394642e01fSmrg * compoverlay.c 2404642e01fSmrg */ 2414642e01fSmrg 2424642e01fSmrgvoid 2434642e01fSmrgcompFreeOverlayClient (CompOverlayClientPtr pOcToDel); 2444642e01fSmrg 2454642e01fSmrgCompOverlayClientPtr 2464642e01fSmrgcompFindOverlayClient (ScreenPtr pScreen, ClientPtr pClient); 2474642e01fSmrg 2484642e01fSmrgCompOverlayClientPtr 2494642e01fSmrgcompCreateOverlayClient (ScreenPtr pScreen, ClientPtr pClient); 2504642e01fSmrg 2514642e01fSmrgBool 2524642e01fSmrgcompCreateOverlayWindow (ScreenPtr pScreen); 2534642e01fSmrg 2544642e01fSmrgvoid 2554642e01fSmrgcompDestroyOverlayWindow (ScreenPtr pScreen); 2564642e01fSmrg 25705b261ecSmrg/* 25805b261ecSmrg * compwindow.c 25905b261ecSmrg */ 26005b261ecSmrg 26105b261ecSmrg#ifdef COMPOSITE_DEBUG 26205b261ecSmrgvoid 26305b261ecSmrgcompCheckTree (ScreenPtr pScreen); 26405b261ecSmrg#else 26505b261ecSmrg#define compCheckTree(s) 26605b261ecSmrg#endif 26705b261ecSmrg 26805b261ecSmrgPictFormatPtr 26905b261ecSmrgcompWindowFormat (WindowPtr pWin); 27005b261ecSmrg 27105b261ecSmrgvoid 27205b261ecSmrgcompSetPixmap (WindowPtr pWin, PixmapPtr pPixmap); 27305b261ecSmrg 27405b261ecSmrgBool 27505b261ecSmrgcompCheckRedirect (WindowPtr pWin); 27605b261ecSmrg 27705b261ecSmrgBool 27805b261ecSmrgcompPositionWindow (WindowPtr pWin, int x, int y); 27905b261ecSmrg 28005b261ecSmrgBool 28105b261ecSmrgcompRealizeWindow (WindowPtr pWin); 28205b261ecSmrg 28305b261ecSmrgBool 28405b261ecSmrgcompUnrealizeWindow (WindowPtr pWin); 28505b261ecSmrg 28605b261ecSmrgvoid 28705b261ecSmrgcompClipNotify (WindowPtr pWin, int dx, int dy); 28805b261ecSmrg 28905b261ecSmrgvoid 29005b261ecSmrgcompMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind); 29105b261ecSmrg 29205b261ecSmrgvoid 29305b261ecSmrgcompResizeWindow (WindowPtr pWin, int x, int y, 29405b261ecSmrg unsigned int w, unsigned int h, WindowPtr pSib); 29505b261ecSmrg 29605b261ecSmrgvoid 29705b261ecSmrgcompChangeBorderWidth (WindowPtr pWin, unsigned int border_width); 29805b261ecSmrg 29905b261ecSmrgvoid 30005b261ecSmrgcompReparentWindow (WindowPtr pWin, WindowPtr pPriorParent); 30105b261ecSmrg 30205b261ecSmrgBool 30305b261ecSmrgcompCreateWindow (WindowPtr pWin); 30405b261ecSmrg 30505b261ecSmrgBool 30605b261ecSmrgcompDestroyWindow (WindowPtr pWin); 30705b261ecSmrg 30805b261ecSmrgvoid 30905b261ecSmrgcompSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion); 31005b261ecSmrg 31105b261ecSmrgRegionPtr 31205b261ecSmrgcompGetRedirectBorderClip (WindowPtr pWin); 31305b261ecSmrg 31405b261ecSmrgvoid 31505b261ecSmrgcompCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); 31605b261ecSmrg 31705b261ecSmrgvoid 3189ace9065SmrgcompPaintChildrenToWindow (WindowPtr pWin); 31905b261ecSmrg 32005b261ecSmrgWindowPtr 32105b261ecSmrgCompositeRealChildHead (WindowPtr pWin); 32205b261ecSmrg 32305b261ecSmrgint 32405b261ecSmrgDeleteWindowNoInputDevices(pointer value, XID wid); 32505b261ecSmrg 3266747b715Smrgint 3276747b715SmrgcompConfigNotify(WindowPtr pWin, int x, int y, int w, int h, 3286747b715Smrg int bw, WindowPtr pSib); 3296747b715Smrg 3309ace9065Smrgvoid PanoramiXCompositeInit (void); 3319ace9065Smrgvoid PanoramiXCompositeReset (void); 3329ace9065Smrg 33305b261ecSmrg#endif /* _COMPINT_H_ */ 334