compint.h revision 6747b715
105b261ecSmrg/*
26747b715Smrg * Copyright © 2006 Sun Microsystems, Inc.  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    Bool			damaged;
15605b261ecSmrg    int				numAlternateVisuals;
15705b261ecSmrg    VisualID			*alternateVisuals;
15805b261ecSmrg
15905b261ecSmrg    WindowPtr                   pOverlayWin;
1604642e01fSmrg    Window			overlayWid;
16105b261ecSmrg    CompOverlayClientPtr        pOverlayClients;
16205b261ecSmrg
16305b261ecSmrg} CompScreenRec, *CompScreenPtr;
16405b261ecSmrg
1656747b715Smrgextern DevPrivateKeyRec CompScreenPrivateKeyRec;
1666747b715Smrg#define CompScreenPrivateKey (&CompScreenPrivateKeyRec)
1676747b715Smrg
1686747b715Smrgextern DevPrivateKeyRec CompWindowPrivateKeyRec;
1696747b715Smrg#define CompWindowPrivateKey (&CompWindowPrivateKeyRec)
1706747b715Smrg
1716747b715Smrgextern DevPrivateKeyRec CompSubwindowsPrivateKeyRec;
1726747b715Smrg#define CompSubwindowsPrivateKey (&CompSubwindowsPrivateKeyRec)
17305b261ecSmrg
1744642e01fSmrg#define GetCompScreen(s) ((CompScreenPtr) \
1754642e01fSmrg    dixLookupPrivate(&(s)->devPrivates, CompScreenPrivateKey))
1764642e01fSmrg#define GetCompWindow(w) ((CompWindowPtr) \
1774642e01fSmrg    dixLookupPrivate(&(w)->devPrivates, CompWindowPrivateKey))
1784642e01fSmrg#define GetCompSubwindows(w) ((CompSubwindowsPtr) \
1794642e01fSmrg    dixLookupPrivate(&(w)->devPrivates, CompSubwindowsPrivateKey))
18005b261ecSmrg
18105b261ecSmrgextern RESTYPE		CompositeClientWindowType;
18205b261ecSmrgextern RESTYPE		CompositeClientSubwindowsType;
1834642e01fSmrgextern RESTYPE		CompositeClientOverlayType;
18405b261ecSmrg
18505b261ecSmrg/*
18605b261ecSmrg * compalloc.c
18705b261ecSmrg */
18805b261ecSmrg
18905b261ecSmrgBool
19005b261ecSmrgcompRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
19105b261ecSmrg
19205b261ecSmrgvoid
19305b261ecSmrgcompFreeClientWindow (WindowPtr pWin, XID id);
19405b261ecSmrg
19505b261ecSmrgint
19605b261ecSmrgcompUnredirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
19705b261ecSmrg
19805b261ecSmrgint
19905b261ecSmrgcompRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update);
20005b261ecSmrg
20105b261ecSmrgvoid
20205b261ecSmrgcompFreeClientSubwindows (WindowPtr pWin, XID id);
20305b261ecSmrg
20405b261ecSmrgint
20505b261ecSmrgcompUnredirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update);
20605b261ecSmrg
20705b261ecSmrgint
20805b261ecSmrgcompRedirectOneSubwindow (WindowPtr pParent, WindowPtr pWin);
20905b261ecSmrg
21005b261ecSmrgint
21105b261ecSmrgcompUnredirectOneSubwindow (WindowPtr pParent, WindowPtr pWin);
21205b261ecSmrg
21305b261ecSmrgBool
21405b261ecSmrgcompAllocPixmap (WindowPtr pWin);
21505b261ecSmrg
21605b261ecSmrgvoid
21705b261ecSmrgcompFreePixmap (WindowPtr pWin);
21805b261ecSmrg
21905b261ecSmrgBool
22005b261ecSmrgcompReallocPixmap (WindowPtr pWin, int x, int y,
22105b261ecSmrg		   unsigned int w, unsigned int h, int bw);
22205b261ecSmrg
22305b261ecSmrg/*
22405b261ecSmrg * compext.c
22505b261ecSmrg */
22605b261ecSmrg
22705b261ecSmrgvoid
22805b261ecSmrgCompositeExtensionInit (void);
22905b261ecSmrg
23005b261ecSmrg/*
23105b261ecSmrg * compinit.c
23205b261ecSmrg */
23305b261ecSmrg
23405b261ecSmrgBool
23505b261ecSmrgcompScreenInit (ScreenPtr pScreen);
23605b261ecSmrg
2374642e01fSmrg/*
2384642e01fSmrg * compoverlay.c
2394642e01fSmrg */
2404642e01fSmrg
2414642e01fSmrgvoid
2424642e01fSmrgcompFreeOverlayClient (CompOverlayClientPtr pOcToDel);
2434642e01fSmrg
2444642e01fSmrgCompOverlayClientPtr
2454642e01fSmrgcompFindOverlayClient (ScreenPtr pScreen, ClientPtr pClient);
2464642e01fSmrg
2474642e01fSmrgCompOverlayClientPtr
2484642e01fSmrgcompCreateOverlayClient (ScreenPtr pScreen, ClientPtr pClient);
2494642e01fSmrg
2504642e01fSmrgBool
2514642e01fSmrgcompCreateOverlayWindow (ScreenPtr pScreen);
2524642e01fSmrg
2534642e01fSmrgvoid
2544642e01fSmrgcompDestroyOverlayWindow (ScreenPtr pScreen);
2554642e01fSmrg
25605b261ecSmrg/*
25705b261ecSmrg * compwindow.c
25805b261ecSmrg */
25905b261ecSmrg
26005b261ecSmrg#ifdef COMPOSITE_DEBUG
26105b261ecSmrgvoid
26205b261ecSmrgcompCheckTree (ScreenPtr pScreen);
26305b261ecSmrg#else
26405b261ecSmrg#define compCheckTree(s)
26505b261ecSmrg#endif
26605b261ecSmrg
26705b261ecSmrgPictFormatPtr
26805b261ecSmrgcompWindowFormat (WindowPtr pWin);
26905b261ecSmrg
27005b261ecSmrgvoid
27105b261ecSmrgcompSetPixmap (WindowPtr pWin, PixmapPtr pPixmap);
27205b261ecSmrg
27305b261ecSmrgBool
27405b261ecSmrgcompCheckRedirect (WindowPtr pWin);
27505b261ecSmrg
27605b261ecSmrgBool
27705b261ecSmrgcompPositionWindow (WindowPtr pWin, int x, int y);
27805b261ecSmrg
27905b261ecSmrgBool
28005b261ecSmrgcompRealizeWindow (WindowPtr pWin);
28105b261ecSmrg
28205b261ecSmrgBool
28305b261ecSmrgcompUnrealizeWindow (WindowPtr pWin);
28405b261ecSmrg
28505b261ecSmrgvoid
28605b261ecSmrgcompClipNotify (WindowPtr pWin, int dx, int dy);
28705b261ecSmrg
28805b261ecSmrgvoid
28905b261ecSmrgcompMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind);
29005b261ecSmrg
29105b261ecSmrgvoid
29205b261ecSmrgcompResizeWindow (WindowPtr pWin, int x, int y,
29305b261ecSmrg		  unsigned int w, unsigned int h, WindowPtr pSib);
29405b261ecSmrg
29505b261ecSmrgvoid
29605b261ecSmrgcompChangeBorderWidth (WindowPtr pWin, unsigned int border_width);
29705b261ecSmrg
29805b261ecSmrgvoid
29905b261ecSmrgcompReparentWindow (WindowPtr pWin, WindowPtr pPriorParent);
30005b261ecSmrg
30105b261ecSmrgBool
30205b261ecSmrgcompCreateWindow (WindowPtr pWin);
30305b261ecSmrg
30405b261ecSmrgBool
30505b261ecSmrgcompDestroyWindow (WindowPtr pWin);
30605b261ecSmrg
30705b261ecSmrgvoid
30805b261ecSmrgcompSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion);
30905b261ecSmrg
31005b261ecSmrgRegionPtr
31105b261ecSmrgcompGetRedirectBorderClip (WindowPtr pWin);
31205b261ecSmrg
31305b261ecSmrgvoid
31405b261ecSmrgcompCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
31505b261ecSmrg
31605b261ecSmrgvoid
31705b261ecSmrgcompWindowUpdate (WindowPtr pWin);
31805b261ecSmrg
31905b261ecSmrgWindowPtr
32005b261ecSmrgCompositeRealChildHead (WindowPtr pWin);
32105b261ecSmrg
32205b261ecSmrgint
32305b261ecSmrgDeleteWindowNoInputDevices(pointer value, XID wid);
32405b261ecSmrg
3256747b715Smrgint
3266747b715SmrgcompConfigNotify(WindowPtr pWin, int x, int y, int w, int h,
3276747b715Smrg		 int bw, WindowPtr pSib);
3286747b715Smrg
32905b261ecSmrg#endif /* _COMPINT_H_ */
330