/*
* Common internal rootless definitions and code
*/
/*
* Copyright (c) 2001 Greg Parker. All Rights Reserved.
* Copyright (c) 2002-2004 Torrey T. Lyons. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdint.h>
#ifndef _ROOTLESSCOMMON_H
#define _ROOTLESSCOMMON_H
#include "misc.h"
#include "rootless.h"
#include "fb.h"
#include "scrnintstr.h"
#include "picturestr.h"
// Debug output, or not.
#ifdef ROOTLESSDEBUG
#else
#define RL_DEBUG_MSG(a, ...)
#endif
// Global variables
// RootlessGCRec: private per-gc data
typedef struct {
// RootlessScreenRec: per-screen private data
typedef struct _RootlessScreenRec {
// Rootless implementation functions
// Wrapped screen functions
void *pixmap_data;
unsigned int pixmap_data_size;
void *redisplay_timer;
// "Definition of the Porting Layer for the X11 Sample Server" says
// unwrap and rewrap of screen functions is unnecessary, but
// screen->CreateGC changes after a call to cfbCreateGC.
// Accessors for screen and window privates
// Call a rootless implementation function.
// Many rootless implementation functions are allowed to be NULL.
}
// BoxRec manipulators
// Copied from shadowfb
}
}
}
// HUGE_ROOT and NORMAL_ROOT
// We don't want to clip windows to the edge of the screen.
// HUGE_ROOT temporarily makes the root window really big.
// This is needed as a wrapper around any function that calls
// SetWinSize or SetBorderSize which clip a window against its
// parents, including the root.
extern RegionRec rootlessHugeRoot;
do { \
while (w->parent) \
w = w->parent; \
w->winSize = rootlessHugeRoot; \
} while (0)
do { \
while (w->parent) \
w = w->parent; \
} while (0)
// Returns TRUE if this window is a top-level window (i.e. child of the root)
// The root is not a top-level window.
// Returns TRUE if this window is a root window
/*
* SetPixmapBaseToScreen
* Move the given pixmap's base address to where pixel (0, 0)
* would be if the pixmap's actual data started at (x, y).
* Can't access the bits before the first word of the drawable's data in
* rootless mode, so make sure our base address is always 32-bit aligned.
*/
_diff; \
} \
}
// Returns TRUE if this window is visible inside a frame
// (e.g. it is visible and has a top-level or root parent)
// Routines that cause regions to get redrawn.
// DamageRegion and DamageRect are in global coordinates.
// DamageBox is in window-local coordinates.
/* Return the colormap currently installed on the given screen. */
/* Convert colormap to ARGB. */
// Move a window to its proper location on the screen.
// Move the window to it's correct place in the physical stacking order.
void RootlessHideAllWindows(void);
void RootlessShowAllWindows(void);
#endif /* _ROOTLESSCOMMON_H */