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