dbestruct.h revision 65fea56f17cd614bc8908264df980a62e1931468
77b1a2d8b5dbe2c0b5200794914239fee3c8ee5dvboxsync/******************************************************************************
77b1a2d8b5dbe2c0b5200794914239fee3c8ee5dvboxsync * Copyright (c) 1994, 1995 Hewlett-Packard Company
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * Permission is hereby granted, free of charge, to any person obtaining
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * a copy of this software and associated documentation files (the
e64031e20c39650a7bc902a3e1aba613b9415deevboxsync * "Software"), to deal in the Software without restriction, including
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * without limitation the rights to use, copy, modify, merge, publish,
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * distribute, sublicense, and/or sell copies of the Software, and to
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * permit persons to whom the Software is furnished to do so, subject to
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * the following conditions:
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * The above copyright notice and this permission notice shall be included
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * in all copies or substantial portions of the Software.
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43747b1f0bc8302a238fb35e55857a5e9aa1933dvboxsync * Except as contained in this notice, the name of the Hewlett-Packard
43747b1f0bc8302a238fb35e55857a5e9aa1933dvboxsync * Company shall not be used in advertising or otherwise to promote the
43747b1f0bc8302a238fb35e55857a5e9aa1933dvboxsync * sale, use or other dealings in this Software without prior written
16a9adc14900ca18e6909679a579f6833425e030vboxsync * authorization from the Hewlett-Packard Company.
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * Header file for DIX-related DBE
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync *****************************************************************************/
cc15c3fa4bb2d3fb91e4d0cd15a73133963f86b0vboxsync/* INCLUDES */
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsynctypedef struct {
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync VisualID visual; /* one visual ID that supports double-buffering */
f5e53763b0a581b0299e98028c6c52192eb06785vboxsynctypedef struct {
efff36b306e370346025647a158689021df2e1d1vboxsync XdbeVisualInfo *visinfo; /* list of visuals & depths for scrn */
efff36b306e370346025647a158689021df2e1d1vboxsync/* DEFINES */
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync#define DBE_SCREEN_PRIV(pScreen) ((DbeScreenPrivPtr) \
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync dixLookupPrivate(&(pScreen)->devPrivates, dbeScreenPrivKey))
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync#define DBE_SCREEN_PRIV_FROM_WINDOW_PRIV(pDbeWindowPriv) \
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync DBE_SCREEN_PRIV((pDbeWindowPriv)->pWindow->drawable.pScreen)
9496f2d398b49813176939d7a339ae513d5175efvboxsync dixLookupPrivate(&(pWin)->devPrivates, dbeWindowPrivKey))
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync/* Initial size of the buffer ID array in the window priv. */
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync/* Reallocation increment for the buffer ID array. */
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync/* Marker for free elements in the buffer ID array. */
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync/* TYPEDEFS */
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync/* Record used to pass swap information between DIX and DDX swapping
c0a370e600bb60153a269fb32b5f709347c35768vboxsync * procedures.
c0a370e600bb60153a269fb32b5f709347c35768vboxsynctypedef struct _DbeSwapInfoRec {
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync unsigned char swapAction;
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync ******************************************************************************
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync ** Per-window data
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync ******************************************************************************
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsynctypedef struct _DbeWindowPrivRec {
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync /* A pointer to the window with which the DBE window private (buffer) is
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync * associated.
7766bf675357fd940d8c49e69a5d72dc6eaa6be4vboxsync /* Last known swap action for this buffer. Legal values for this field
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync * are XdbeUndefined, XdbeBackground, XdbeUntouched, and XdbeCopied.
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync unsigned char swapAction;
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync /* Last known buffer size.
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync /* Coordinates used for static gravity when the window is positioned.
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync short x, y;
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync /* Number of XIDs associated with this buffer.
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync /* Capacity of the current buffer ID array, IDs. */
9496f2d398b49813176939d7a339ae513d5175efvboxsync /* Pointer to the array of buffer IDs. This initially points to initIDs.
cab115cfa31c584def7069312a1e23c3fc88533bvboxsync * When the static limit of the initIDs array is reached, the array is
cab115cfa31c584def7069312a1e23c3fc88533bvboxsync * reallocated and this pointer is set to the new array instead of initIDs.
9496f2d398b49813176939d7a339ae513d5175efvboxsync /* Initial array of buffer IDs. We are defining the XID array within the
21029597fc4b76d0db0c9542daee201447281781vboxsync * window priv to optimize for data locality. In most cases, only one
21029597fc4b76d0db0c9542daee201447281781vboxsync * buffer will be associated with a window. Having the array declared
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync * here can prevent us from accessing the data in another memory page,
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync * possibly resulting in a page swap and loss of performance. Initially we
9496f2d398b49813176939d7a339ae513d5175efvboxsync * will use this array to store buffer IDs. For situations where we have
9496f2d398b49813176939d7a339ae513d5175efvboxsync * more IDs than can fit in this static array, we will allocate a larger
9496f2d398b49813176939d7a339ae513d5175efvboxsync * array to use, possibly suffering a performance loss.
16a9adc14900ca18e6909679a579f6833425e030vboxsync /* Pointer to a drawable that contains the contents of the back buffer.
9c149a2789022f5011e88fb62f02a1cc8068e88fvboxsync /* Pointer to a drawable that contains the contents of the front buffer.
c0a370e600bb60153a269fb32b5f709347c35768vboxsync * This pointer is only used for the XdbeUntouched swap action. For that
c0a370e600bb60153a269fb32b5f709347c35768vboxsync * swap action, we need to copy the front buffer (window) contents into
c0a370e600bb60153a269fb32b5f709347c35768vboxsync * this drawable, copy the contents of current back buffer drawable (the
c0a370e600bb60153a269fb32b5f709347c35768vboxsync * back buffer) into the window, swap the front and back drawable pointers,
c0a370e600bb60153a269fb32b5f709347c35768vboxsync * and then swap the drawable/resource associations in the resource
ad27e1d5e48ca41245120c331cc88b50464813cevboxsync * database.
9496f2d398b49813176939d7a339ae513d5175efvboxsync /* Device-specific private information.
16a9adc14900ca18e6909679a579f6833425e030vboxsync ******************************************************************************
16a9adc14900ca18e6909679a579f6833425e030vboxsync ** Per-screen data
16a9adc14900ca18e6909679a579f6833425e030vboxsync ******************************************************************************
16a9adc14900ca18e6909679a579f6833425e030vboxsynctypedef struct _DbeScreenPrivRec {
16a9adc14900ca18e6909679a579f6833425e030vboxsync /* Wrapped functions
16a9adc14900ca18e6909679a579f6833425e030vboxsync * It is the responsibilty of the DDX layer to wrap PositionWindow().
16a9adc14900ca18e6909679a579f6833425e030vboxsync * DbeExtensionInit wraps DestroyWindow().
63c12491acc2b8b95c8ac454f1c48b98eec8f7d8vboxsync /* Per-screen DIX routines */
63c12491acc2b8b95c8ac454f1c48b98eec8f7d8vboxsync Bool (*SetupBackgroundPainter) (WindowPtr /*pWin */ ,
63c12491acc2b8b95c8ac454f1c48b98eec8f7d8vboxsync /* Per-screen DDX routines */
b5ad839a3757b305d4e98d7264da2b53c9cd27f0vboxsync int /*swapAction */
681fd85cc7cd49e9cf66a917d6ae9ff36eb7d9e9vboxsync int * /*pNumWindows */ ,
681fd85cc7cd49e9cf66a917d6ae9ff36eb7d9e9vboxsync void (*WinPrivDelete) (DbeWindowPrivPtr /*pDbeWindowPriv */ ,
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync#endif /* DBE_STRUCT_H */