45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Common internal rootless definitions and code
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright (c) 2001 Greg Parker. All Rights Reserved.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright (c) 2002-2004 Torrey T. Lyons. All Rights Reserved.
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Permission is hereby granted, free of charge, to any person obtaining a
45e9809aff7304721fddb95654901b32195c9c7avboxsync * copy of this software and associated documentation files (the "Software"),
45e9809aff7304721fddb95654901b32195c9c7avboxsync * to deal in the Software without restriction, including without limitation
45e9809aff7304721fddb95654901b32195c9c7avboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * and/or sell copies of the Software, and to permit persons to whom the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Software is furnished to do so, subject to the following conditions:
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * The above copyright notice and this permission notice shall be included in
45e9809aff7304721fddb95654901b32195c9c7avboxsync * all copies or substantial portions of the Software.
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45e9809aff7304721fddb95654901b32195c9c7avboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
45e9809aff7304721fddb95654901b32195c9c7avboxsync * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
45e9809aff7304721fddb95654901b32195c9c7avboxsync * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
45e9809aff7304721fddb95654901b32195c9c7avboxsync * DEALINGS IN THE SOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Except as contained in this notice, the name(s) of the above copyright
45e9809aff7304721fddb95654901b32195c9c7avboxsync * holders shall not be used in advertising or otherwise to promote the sale,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * use or other dealings in this Software without prior written authorization.
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifdef HAVE_DIX_CONFIG_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <dix-config.h>
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef _ROOTLESSCOMMON_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define _ROOTLESSCOMMON_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "rootless.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "fb.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifdef RENDER
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "picturestr.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync// Debug output, or not.
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifdef ROOTLESSDEBUG
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define RL_DEBUG_MSG ErrorF
45e9809aff7304721fddb95654901b32195c9c7avboxsync#else
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define RL_DEBUG_MSG(a, ...)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync// Global variables
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int rootlessGCPrivateIndex;
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int rootlessScreenPrivateIndex;
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int rootlessWindowPrivateIndex;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync// RootlessGCRec: private per-gc data
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync GCFuncs *originalFuncs;
45e9809aff7304721fddb95654901b32195c9c7avboxsync GCOps *originalOps;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} RootlessGCRec;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync// RootlessScreenRec: per-screen private data
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _RootlessScreenRec {
45e9809aff7304721fddb95654901b32195c9c7avboxsync // Rootless implementation functions
45e9809aff7304721fddb95654901b32195c9c7avboxsync RootlessFrameProcsPtr imp;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync // Wrapped screen functions
45e9809aff7304721fddb95654901b32195c9c7avboxsync CreateScreenResourcesProcPtr CreateScreenResources;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CloseScreenProcPtr CloseScreen;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync CreateWindowProcPtr CreateWindow;
45e9809aff7304721fddb95654901b32195c9c7avboxsync DestroyWindowProcPtr DestroyWindow;
45e9809aff7304721fddb95654901b32195c9c7avboxsync RealizeWindowProcPtr RealizeWindow;
45e9809aff7304721fddb95654901b32195c9c7avboxsync UnrealizeWindowProcPtr UnrealizeWindow;
45e9809aff7304721fddb95654901b32195c9c7avboxsync MoveWindowProcPtr MoveWindow;
45e9809aff7304721fddb95654901b32195c9c7avboxsync ResizeWindowProcPtr ResizeWindow;
45e9809aff7304721fddb95654901b32195c9c7avboxsync RestackWindowProcPtr RestackWindow;
45e9809aff7304721fddb95654901b32195c9c7avboxsync ReparentWindowProcPtr ReparentWindow;
45e9809aff7304721fddb95654901b32195c9c7avboxsync ChangeBorderWidthProcPtr ChangeBorderWidth;
45e9809aff7304721fddb95654901b32195c9c7avboxsync PositionWindowProcPtr PositionWindow;
45e9809aff7304721fddb95654901b32195c9c7avboxsync ChangeWindowAttributesProcPtr ChangeWindowAttributes;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync CreateGCProcPtr CreateGC;
45e9809aff7304721fddb95654901b32195c9c7avboxsync PaintWindowBackgroundProcPtr PaintWindowBackground;
45e9809aff7304721fddb95654901b32195c9c7avboxsync PaintWindowBorderProcPtr PaintWindowBorder;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CopyWindowProcPtr CopyWindow;
45e9809aff7304721fddb95654901b32195c9c7avboxsync GetImageProcPtr GetImage;
45e9809aff7304721fddb95654901b32195c9c7avboxsync SourceValidateProcPtr SourceValidate;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
45e9809aff7304721fddb95654901b32195c9c7avboxsync ValidateTreeProcPtr ValidateTree;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifdef SHAPE
45e9809aff7304721fddb95654901b32195c9c7avboxsync SetShapeProcPtr SetShape;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifdef RENDER
45e9809aff7304721fddb95654901b32195c9c7avboxsync CompositeProcPtr Composite;
45e9809aff7304721fddb95654901b32195c9c7avboxsync GlyphsProcPtr Glyphs;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync void *pixmap_data;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int pixmap_data_size;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync void *redisplay_timer;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int redisplay_timer_set :1;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int redisplay_queued :1;
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int redisplay_expired :1;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} RootlessScreenRec, *RootlessScreenPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#undef MIN
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define MIN(x,y) ((x) < (y) ? (x) : (y))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#undef MAX
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define MAX(x,y) ((x) > (y) ? (x) : (y))
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync// "Definition of the Porting Layer for the X11 Sample Server" says
45e9809aff7304721fddb95654901b32195c9c7avboxsync// unwrap and rewrap of screen functions is unnecessary, but
45e9809aff7304721fddb95654901b32195c9c7avboxsync// screen->CreateGC changes after a call to cfbCreateGC.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SCREEN_UNWRAP(screen, fn) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync screen->fn = SCREENREC(screen)->fn;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SCREEN_WRAP(screen, fn) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync SCREENREC(screen)->fn = screen->fn; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync screen->fn = Rootless##fn
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync// Accessors for screen and window privates
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SCREENREC(pScreen) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync ((RootlessScreenRec *)(pScreen)->devPrivates[rootlessScreenPrivateIndex].ptr)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define WINREC(pWin) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync ((RootlessWindowRec *)(pWin)->devPrivates[rootlessWindowPrivateIndex].ptr)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync// Call a rootless implementation function.
45e9809aff7304721fddb95654901b32195c9c7avboxsync// Many rootless implementation functions are allowed to be NULL.
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define CallFrameProc(pScreen, proc, params) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync if (SCREENREC(pScreen)->frameProcs.proc) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync RL_DEBUG_MSG("calling frame proc " #proc " "); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync SCREENREC(pScreen)->frameProcs.proc params; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync }
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync// BoxRec manipulators
45e9809aff7304721fddb95654901b32195c9c7avboxsync// Copied from shadowfb
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define TRIM_BOX(box, pGC) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync BoxPtr extents = &pGC->pCompositeClip->extents;\
45e9809aff7304721fddb95654901b32195c9c7avboxsync if(box.x1 < extents->x1) box.x1 = extents->x1; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync if(box.x2 > extents->x2) box.x2 = extents->x2; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync if(box.y1 < extents->y1) box.y1 = extents->y1; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync if(box.y2 > extents->y2) box.y2 = extents->y2; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync}
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define TRANSLATE_BOX(box, pDraw) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync box.x1 += pDraw->x; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync box.x2 += pDraw->x; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync box.y1 += pDraw->y; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync box.y2 += pDraw->y; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync}
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync TRANSLATE_BOX(box, pDraw); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync TRIM_BOX(box, pGC); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync}
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BOX_NOT_EMPTY(box) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0))
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync// HUGE_ROOT and NORMAL_ROOT
45e9809aff7304721fddb95654901b32195c9c7avboxsync// We don't want to clip windows to the edge of the screen.
45e9809aff7304721fddb95654901b32195c9c7avboxsync// HUGE_ROOT temporarily makes the root window really big.
45e9809aff7304721fddb95654901b32195c9c7avboxsync// This is needed as a wrapper around any function that calls
45e9809aff7304721fddb95654901b32195c9c7avboxsync// SetWinSize or SetBorderSize which clip a window against its
45e9809aff7304721fddb95654901b32195c9c7avboxsync// parents, including the root.
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern RegionRec rootlessHugeRoot;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define HUGE_ROOT(pWin) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync do { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync WindowPtr w = pWin; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync while (w->parent) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync w = w->parent; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync saveRoot = w->winSize; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync w->winSize = rootlessHugeRoot; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync } while (0)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define NORMAL_ROOT(pWin) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync do { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync WindowPtr w = pWin; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync while (w->parent) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync w = w->parent; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync w->winSize = saveRoot; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync } while (0)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync// Returns TRUE if this window is a top-level window (i.e. child of the root)
45e9809aff7304721fddb95654901b32195c9c7avboxsync// The root is not a top-level window.
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define IsTopLevel(pWin) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync ((pWin) && (pWin)->parent && !(pWin)->parent->parent)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync// Returns TRUE if this window is a root window
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define IsRoot(pWin) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync ((pWin) == WindowTable[(pWin)->drawable.pScreen->myNum])
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * SetPixmapBaseToScreen
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Move the given pixmap's base address to where pixel (0, 0)
45e9809aff7304721fddb95654901b32195c9c7avboxsync * would be if the pixmap's actual data started at (x, y).
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Can't access the bits before the first word of the drawable's data in
45e9809aff7304721fddb95654901b32195c9c7avboxsync * rootless mode, so make sure our base address is always 32-bit aligned.
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SetPixmapBaseToScreen(pix, _x, _y) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync PixmapPtr _pPix = (PixmapPtr) (pix); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync _pPix->devPrivate.ptr = (char *) (_pPix->devPrivate.ptr) - \
45e9809aff7304721fddb95654901b32195c9c7avboxsync ((int)(_x) * _pPix->drawable.bitsPerPixel/8 + \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (int)(_y) * _pPix->devKind); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync if (_pPix->drawable.bitsPerPixel != FB_UNIT) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned _diff = ((unsigned) _pPix->devPrivate.ptr) & \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (FB_UNIT / CHAR_BIT - 1); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync _pPix->devPrivate.ptr = (char *) (_pPix->devPrivate.ptr) - \
45e9809aff7304721fddb95654901b32195c9c7avboxsync _diff; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync _pPix->drawable.x = _diff / \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (_pPix->drawable.bitsPerPixel / CHAR_BIT); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync } \
45e9809aff7304721fddb95654901b32195c9c7avboxsync}
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync// Returns TRUE if this window is visible inside a frame
45e9809aff7304721fddb95654901b32195c9c7avboxsync// (e.g. it is visible and has a top-level or root parent)
45e9809aff7304721fddb95654901b32195c9c7avboxsyncBool IsFramedWindow(WindowPtr pWin);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync// Routines that cause regions to get redrawn.
45e9809aff7304721fddb95654901b32195c9c7avboxsync// DamageRegion and DamageRect are in global coordinates.
45e9809aff7304721fddb95654901b32195c9c7avboxsync// DamageBox is in window-local coordinates.
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid RootlessDamageRect(WindowPtr pWindow, int x, int y, int w, int h);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid RootlessDamageBox(WindowPtr pWindow, BoxPtr pBox);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid RootlessRedisplay(WindowPtr pWindow);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid RootlessRedisplayScreen(ScreenPtr pScreen);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid RootlessQueueRedisplay(ScreenPtr pScreen);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync// Move a window to its proper location on the screen.
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid RootlessRepositionWindow(WindowPtr pWin);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync// Move the window to it's correct place in the physical stacking order.
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid RootlessReorderWindow(WindowPtr pWin);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* _ROOTLESSCOMMON_H */