65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * External interface to generic rootless mode
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright (c) 2001 Greg Parker. All Rights Reserved.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
65fea56f17cd614bc8908264df980a62e1931468vboxsync * copy of this software and associated documentation files (the "Software"),
65fea56f17cd614bc8908264df980a62e1931468vboxsync * to deal in the Software without restriction, including without limitation
65fea56f17cd614bc8908264df980a62e1931468vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * and/or sell copies of the Software, and to permit persons to whom the
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Software is furnished to do so, subject to the following conditions:
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * The above copyright notice and this permission notice shall be included in
65fea56f17cd614bc8908264df980a62e1931468vboxsync * all copies or substantial portions of the Software.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65fea56f17cd614bc8908264df980a62e1931468vboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
65fea56f17cd614bc8908264df980a62e1931468vboxsync * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
65fea56f17cd614bc8908264df980a62e1931468vboxsync * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
65fea56f17cd614bc8908264df980a62e1931468vboxsync * DEALINGS IN THE SOFTWARE.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Except as contained in this notice, the name(s) of the above copyright
65fea56f17cd614bc8908264df980a62e1931468vboxsync * holders shall not be used in advertising or otherwise to promote the sale,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * use or other dealings in this Software without prior written authorization.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef HAVE_DIX_CONFIG_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <dix-config.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef _ROOTLESS_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define _ROOTLESS_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "rootlessConfig.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "mi.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "gcstruct.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync Each top-level rootless window has a one-to-one correspondence to a physical
65fea56f17cd614bc8908264df980a62e1931468vboxsync on-screen window. The physical window is refered to as a "frame".
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void *RootlessFrameID;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * RootlessWindowRec
65fea56f17cd614bc8908264df980a62e1931468vboxsync * This structure stores the per-frame data used by the rootless code.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Each top-level X window has one RootlessWindowRec associated with it.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef struct _RootlessWindowRec {
65fea56f17cd614bc8908264df980a62e1931468vboxsync // Position and size includes the window border
65fea56f17cd614bc8908264df980a62e1931468vboxsync // Position is in per-screen coordinates
65fea56f17cd614bc8908264df980a62e1931468vboxsync int x, y;
65fea56f17cd614bc8908264df980a62e1931468vboxsync unsigned int width, height;
65fea56f17cd614bc8908264df980a62e1931468vboxsync unsigned int borderWidth;
65fea56f17cd614bc8908264df980a62e1931468vboxsync int level;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessFrameID wid; // implementation specific frame id
65fea56f17cd614bc8908264df980a62e1931468vboxsync WindowPtr win; // underlying X window
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync // Valid only when drawing (ie. is_drawing is set)
65fea56f17cd614bc8908264df980a62e1931468vboxsync char *pixelData;
65fea56f17cd614bc8908264df980a62e1931468vboxsync int bytesPerRow;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync PixmapPtr pixmap;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync unsigned int is_drawing:1; // Currently drawing?
65fea56f17cd614bc8908264df980a62e1931468vboxsync unsigned int is_reorder_pending:1;
65fea56f17cd614bc8908264df980a62e1931468vboxsync unsigned int is_offscreen:1;
65fea56f17cd614bc8908264df980a62e1931468vboxsync unsigned int is_obscured:1;
65fea56f17cd614bc8908264df980a62e1931468vboxsync} RootlessWindowRec, *RootlessWindowPtr;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* Offset for screen-local to global coordinate transforms */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern int rootlessGlobalOffsetX;
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern int rootlessGlobalOffsetY;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* The minimum number of bytes or pixels for which to use the
65fea56f17cd614bc8908264df980a62e1931468vboxsync implementation's accelerated functions. */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern unsigned int rootless_CopyBytes_threshold;
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern unsigned int rootless_CopyWindow_threshold;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* Gravity for window contents during resizing */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncenum rl_gravity_enum {
65fea56f17cd614bc8908264df980a62e1931468vboxsync RL_GRAVITY_NONE = 0, /* no gravity, fill everything */
65fea56f17cd614bc8908264df980a62e1931468vboxsync RL_GRAVITY_NORTH_WEST = 1, /* anchor to top-left corner */
65fea56f17cd614bc8908264df980a62e1931468vboxsync RL_GRAVITY_NORTH_EAST = 2, /* anchor to top-right corner */
65fea56f17cd614bc8908264df980a62e1931468vboxsync RL_GRAVITY_SOUTH_EAST = 3, /* anchor to bottom-right corner */
65fea56f17cd614bc8908264df980a62e1931468vboxsync RL_GRAVITY_SOUTH_WEST = 4, /* anchor to bottom-left corner */
65fea56f17cd614bc8908264df980a62e1931468vboxsync};
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*------------------------------------------
65fea56f17cd614bc8908264df980a62e1931468vboxsync Rootless Implementation Functions
65fea56f17cd614bc8908264df980a62e1931468vboxsync ------------------------------------------*/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Create a new frame.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * The frame is created unmapped.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * pFrame RootlessWindowPtr for this frame should be completely
65fea56f17cd614bc8908264df980a62e1931468vboxsync * initialized before calling except for pFrame->wid, which
65fea56f17cd614bc8908264df980a62e1931468vboxsync * is set by this function.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * pScreen Screen on which to place the new frame
65fea56f17cd614bc8908264df980a62e1931468vboxsync * newX, newY Position of the frame.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * pNewShape Shape for the frame (in frame-local coordinates). NULL for
65fea56f17cd614bc8908264df980a62e1931468vboxsync * unshaped frames.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef Bool (*RootlessCreateFrameProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessWindowPtr pFrame, ScreenPtr pScreen, int newX, int newY,
65fea56f17cd614bc8908264df980a62e1931468vboxsync RegionPtr pNewShape);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Destroy a frame.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Drawing is stopped and all updates are flushed before this is called.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * wid Frame id
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*RootlessDestroyFrameProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessFrameID wid);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Move a frame on screen.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Drawing is stopped and all updates are flushed before this is called.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * wid Frame id
65fea56f17cd614bc8908264df980a62e1931468vboxsync * pScreen Screen to move the new frame to
65fea56f17cd614bc8908264df980a62e1931468vboxsync * newX, newY New position of the frame
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*RootlessMoveFrameProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Resize and move a frame.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Drawing is stopped and all updates are flushed before this is called.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * wid Frame id
65fea56f17cd614bc8908264df980a62e1931468vboxsync * pScreen Screen to move the new frame to
65fea56f17cd614bc8908264df980a62e1931468vboxsync * newX, newY New position of the frame
65fea56f17cd614bc8908264df980a62e1931468vboxsync * newW, newH New size of the frame
65fea56f17cd614bc8908264df980a62e1931468vboxsync * gravity Gravity for window contents (rl_gravity_enum). This is always
65fea56f17cd614bc8908264df980a62e1931468vboxsync * RL_GRAVITY_NONE unless ROOTLESS_RESIZE_GRAVITY is set.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*RootlessResizeFrameProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessFrameID wid, ScreenPtr pScreen,
65fea56f17cd614bc8908264df980a62e1931468vboxsync int newX, int newY, unsigned int newW, unsigned int newH,
65fea56f17cd614bc8908264df980a62e1931468vboxsync unsigned int gravity);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Change frame ordering (AKA stacking, layering).
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Drawing is stopped before this is called. Unmapped frames are mapped by
65fea56f17cd614bc8908264df980a62e1931468vboxsync * setting their ordering.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * wid Frame id
65fea56f17cd614bc8908264df980a62e1931468vboxsync * nextWid Frame id of frame that is now above this one or NULL if this
65fea56f17cd614bc8908264df980a62e1931468vboxsync * frame is at the top.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*RootlessRestackFrameProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessFrameID wid, RootlessFrameID nextWid);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Change frame's shape.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Drawing is stopped before this is called.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * wid Frame id
65fea56f17cd614bc8908264df980a62e1931468vboxsync * pNewShape New shape for the frame (in frame-local coordinates)
65fea56f17cd614bc8908264df980a62e1931468vboxsync * or NULL if now unshaped.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*RootlessReshapeFrameProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessFrameID wid, RegionPtr pNewShape);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Unmap a frame.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * wid Frame id
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*RootlessUnmapFrameProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessFrameID wid);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Start drawing to a frame.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Prepare a frame for direct access to its backing buffer.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * wid Frame id
65fea56f17cd614bc8908264df980a62e1931468vboxsync * pixelData Address of the backing buffer (returned)
65fea56f17cd614bc8908264df980a62e1931468vboxsync * bytesPerRow Width in bytes of the backing buffer (returned)
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*RootlessStartDrawingProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessFrameID wid, char **pixelData, int *bytesPerRow);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Stop drawing to a frame.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * No drawing to the frame's backing buffer will occur until drawing
65fea56f17cd614bc8908264df980a62e1931468vboxsync * is started again.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * wid Frame id
65fea56f17cd614bc8908264df980a62e1931468vboxsync * flush Flush drawing updates for this frame to the screen.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*RootlessStopDrawingProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessFrameID wid, Bool flush);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Flush drawing updates to the screen.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Drawing is stopped before this is called.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * wid Frame id
65fea56f17cd614bc8908264df980a62e1931468vboxsync * pDamage Region containing all the changed pixels in frame-lcoal
65fea56f17cd614bc8908264df980a62e1931468vboxsync * coordinates. This is clipped to the window's clip.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*RootlessUpdateRegionProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessFrameID wid, RegionPtr pDamage);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Mark damaged rectangles as requiring redisplay to screen.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * wid Frame id
65fea56f17cd614bc8908264df980a62e1931468vboxsync * nrects Number of damaged rectangles
65fea56f17cd614bc8908264df980a62e1931468vboxsync * rects Array of damaged rectangles in frame-local coordinates
65fea56f17cd614bc8908264df980a62e1931468vboxsync * shift_x, Vector to shift rectangles by
65fea56f17cd614bc8908264df980a62e1931468vboxsync * shift_y
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*RootlessDamageRectsProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessFrameID wid, int nrects, const BoxRec * rects,
65fea56f17cd614bc8908264df980a62e1931468vboxsync int shift_x, int shift_y);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Switch the window associated with a frame. (Optional)
65fea56f17cd614bc8908264df980a62e1931468vboxsync * When a framed window is reparented, the frame is resized and set to
65fea56f17cd614bc8908264df980a62e1931468vboxsync * use the new top-level parent. If defined this function will be called
65fea56f17cd614bc8908264df980a62e1931468vboxsync * afterwards for implementation specific bookkeeping.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * pFrame Frame whose window has switched
65fea56f17cd614bc8908264df980a62e1931468vboxsync * oldWin Previous window wrapped by this frame
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*RootlessSwitchWindowProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessWindowPtr pFrame, WindowPtr oldWin);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Check if window should be reordered. (Optional)
65fea56f17cd614bc8908264df980a62e1931468vboxsync * The underlying window system may animate windows being ordered in.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * We want them to be mapped but remain ordered out until the animation
65fea56f17cd614bc8908264df980a62e1931468vboxsync * completes. If defined this function will be called to check if a
65fea56f17cd614bc8908264df980a62e1931468vboxsync * framed window should be reordered now. If this function returns
65fea56f17cd614bc8908264df980a62e1931468vboxsync * FALSE, the window will still be mapped from the X11 perspective, but
65fea56f17cd614bc8908264df980a62e1931468vboxsync * the RestackFrame function will not be called for its frame.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * pFrame Frame to reorder
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef Bool (*RootlessDoReorderWindowProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessWindowPtr pFrame);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copy bytes. (Optional)
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Source and destinate may overlap and the right thing should happen.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * width Bytes to copy per row
65fea56f17cd614bc8908264df980a62e1931468vboxsync * height Number of rows
65fea56f17cd614bc8908264df980a62e1931468vboxsync * src Source data
65fea56f17cd614bc8908264df980a62e1931468vboxsync * srcRowBytes Width of source in bytes
65fea56f17cd614bc8908264df980a62e1931468vboxsync * dst Destination data
65fea56f17cd614bc8908264df980a62e1931468vboxsync * dstRowBytes Width of destination in bytes
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*RootlessCopyBytesProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (unsigned int width, unsigned int height,
65fea56f17cd614bc8908264df980a62e1931468vboxsync const void *src, unsigned int srcRowBytes,
65fea56f17cd614bc8908264df980a62e1931468vboxsync void *dst, unsigned int dstRowBytes);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copy area in frame to another part of frame. (Optional)
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * wid Frame id
65fea56f17cd614bc8908264df980a62e1931468vboxsync * dstNrects Number of rectangles to copy
65fea56f17cd614bc8908264df980a62e1931468vboxsync * dstRects Array of rectangles to copy
65fea56f17cd614bc8908264df980a62e1931468vboxsync * dx, dy Number of pixels away to copy area
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*RootlessCopyWindowProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessFrameID wid, int dstNrects, const BoxRec * dstRects, int dx, int dy);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*RootlessHideWindowProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessFrameID wid);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*RootlessUpdateColormapProc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync (RootlessFrameID wid, ScreenPtr pScreen);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Rootless implementation function list
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef struct _RootlessFrameProcs {
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessCreateFrameProc CreateFrame;
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessDestroyFrameProc DestroyFrame;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessMoveFrameProc MoveFrame;
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessResizeFrameProc ResizeFrame;
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessRestackFrameProc RestackFrame;
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessReshapeFrameProc ReshapeFrame;
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessUnmapFrameProc UnmapFrame;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessStartDrawingProc StartDrawing;
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessStopDrawingProc StopDrawing;
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessUpdateRegionProc UpdateRegion;
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessDamageRectsProc DamageRects;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /* Optional frame functions */
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessSwitchWindowProc SwitchWindow;
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessDoReorderWindowProc DoReorderWindow;
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessHideWindowProc HideWindow;
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessUpdateColormapProc UpdateColormap;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /* Optional acceleration functions */
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessCopyBytesProc CopyBytes;
65fea56f17cd614bc8908264df980a62e1931468vboxsync RootlessCopyWindowProc CopyWindow;
65fea56f17cd614bc8908264df980a62e1931468vboxsync} RootlessFrameProcsRec, *RootlessFrameProcsPtr;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Initialize rootless mode on the given screen.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncBool RootlessInit(ScreenPtr pScreen, RootlessFrameProcsPtr procs);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Return the frame ID for the physical window displaying the given window.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * create If true and the window has no frame, attempt to create one
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncRootlessFrameID RootlessFrameForWindow(WindowPtr pWin, Bool create);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Return the top-level parent of a window.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * The root is the top-level parent of itself, even though the root is
65fea56f17cd614bc8908264df980a62e1931468vboxsync * not otherwise considered to be a top-level window.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncWindowPtr TopLevelParent(WindowPtr pWindow);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Prepare a window for direct access to its backing buffer.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncvoid RootlessStartDrawing(WindowPtr pWindow);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Finish drawing to a window's backing buffer.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * flush If true, damaged areas are flushed to the screen.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncvoid RootlessStopDrawing(WindowPtr pWindow, Bool flush);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Alocate a new screen pixmap.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * miCreateScreenResources does not do this properly with a null
65fea56f17cd614bc8908264df980a62e1931468vboxsync * framebuffer pointer.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncvoid RootlessUpdateScreenPixmap(ScreenPtr pScreen);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Reposition all windows on a screen to their correct positions.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncvoid RootlessRepositionWindows(ScreenPtr pScreen);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Bring all windows to the front of the native stack
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncvoid RootlessOrderAllWindows(Bool include_unhitable);
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* _ROOTLESS_H */