65fea56f17cd614bc8908264df980a62e1931468vboxsync/***********************************************************
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncCopyright 1987, 1989, 1998 The Open Group
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncPermission to use, copy, modify, distribute, and sell this software and its
65fea56f17cd614bc8908264df980a62e1931468vboxsyncdocumentation for any purpose is hereby granted without fee, provided that
65fea56f17cd614bc8908264df980a62e1931468vboxsyncthe above copyright notice appear in all copies and that both that
65fea56f17cd614bc8908264df980a62e1931468vboxsynccopyright notice and this permission notice appear in supporting
65fea56f17cd614bc8908264df980a62e1931468vboxsyncdocumentation.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncThe above copyright notice and this permission notice shall be included in
65fea56f17cd614bc8908264df980a62e1931468vboxsyncall copies or substantial portions of the Software.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65fea56f17cd614bc8908264df980a62e1931468vboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
65fea56f17cd614bc8908264df980a62e1931468vboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
65fea56f17cd614bc8908264df980a62e1931468vboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
65fea56f17cd614bc8908264df980a62e1931468vboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncExcept as contained in this notice, the name of The Open Group shall not be
65fea56f17cd614bc8908264df980a62e1931468vboxsyncused in advertising or otherwise to promote the sale, use or other dealings
65fea56f17cd614bc8908264df980a62e1931468vboxsyncin this Software without prior written authorization from The Open Group.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncCopyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync All Rights Reserved
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncPermission to use, copy, modify, and distribute this software and its
65fea56f17cd614bc8908264df980a62e1931468vboxsyncdocumentation for any purpose and without fee is hereby granted,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncprovided that the above copyright notice appear in all copies and that
65fea56f17cd614bc8908264df980a62e1931468vboxsyncboth that copyright notice and this permission notice appear in
65fea56f17cd614bc8908264df980a62e1931468vboxsyncsupporting documentation, and that the name of Digital not be
65fea56f17cd614bc8908264df980a62e1931468vboxsyncused in advertising or publicity pertaining to distribution of the
65fea56f17cd614bc8908264df980a62e1931468vboxsyncsoftware without specific, written prior permission.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
65fea56f17cd614bc8908264df980a62e1931468vboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
65fea56f17cd614bc8908264df980a62e1931468vboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
65fea56f17cd614bc8908264df980a62e1931468vboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
65fea56f17cd614bc8908264df980a62e1931468vboxsyncSOFTWARE.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync******************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef RESOURCE_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RESOURCE_H 1
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "misc.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "dixaccess.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*****************************************************************
65fea56f17cd614bc8908264df980a62e1931468vboxsync * STUFF FOR RESOURCES
65fea56f17cd614bc8908264df980a62e1931468vboxsync *****************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* classes for Resource routines */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef uint32_t RESTYPE;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RC_VANILLA ((RESTYPE)0)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RC_CACHED ((RESTYPE)1<<31)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RC_DRAWABLE ((RESTYPE)1<<30)
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* Use class RC_NEVERRETAIN for resources that should not be retained
65fea56f17cd614bc8908264df980a62e1931468vboxsync * regardless of the close down mode when the client dies. (A client's
65fea56f17cd614bc8908264df980a62e1931468vboxsync * event selections on objects that it doesn't own are good candidates.)
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Extensions can use this too!
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RC_NEVERRETAIN ((RESTYPE)1<<29)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RC_LASTPREDEF RC_NEVERRETAIN
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RC_ANY (~(RESTYPE)0)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* types for Resource routines */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RT_WINDOW ((RESTYPE)1|RC_DRAWABLE)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RT_PIXMAP ((RESTYPE)2|RC_DRAWABLE)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RT_GC ((RESTYPE)3)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#undef RT_FONT
65fea56f17cd614bc8908264df980a62e1931468vboxsync#undef RT_CURSOR
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RT_FONT ((RESTYPE)4)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RT_CURSOR ((RESTYPE)5)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RT_COLORMAP ((RESTYPE)6)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RT_CMAPENTRY ((RESTYPE)7)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RT_OTHERCLIENT ((RESTYPE)8|RC_NEVERRETAIN)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RT_PASSIVEGRAB ((RESTYPE)9|RC_NEVERRETAIN)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RT_LASTPREDEF ((RESTYPE)9)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RT_NONE ((RESTYPE)0)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* bits and fields within a resource id */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RESOURCE_AND_CLIENT_COUNT 29 /* 29 bits for XIDs */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if MAXCLIENTS == 64
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RESOURCE_CLIENT_BITS 6
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if MAXCLIENTS == 128
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RESOURCE_CLIENT_BITS 7
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if MAXCLIENTS == 256
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RESOURCE_CLIENT_BITS 8
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if MAXCLIENTS == 512
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RESOURCE_CLIENT_BITS 9
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* client field offset */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define CLIENTOFFSET (RESOURCE_AND_CLIENT_COUNT - RESOURCE_CLIENT_BITS)
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* resource field */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RESOURCE_ID_MASK ((1 << CLIENTOFFSET) - 1)
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* client field */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define RESOURCE_CLIENT_MASK (((1 << RESOURCE_CLIENT_BITS) - 1) << CLIENTOFFSET)
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* extract the client mask from an XID */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define CLIENT_BITS(id) ((id) & RESOURCE_CLIENT_MASK)
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* extract the client id from an XID */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define CLIENT_ID(id) ((int)(CLIENT_BITS(id) >> CLIENTOFFSET))
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define SERVER_BIT (Mask)0x40000000 /* use illegal bit */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef INVALID
65fea56f17cd614bc8908264df980a62e1931468vboxsync#undef INVALID /* needed on HP/UX */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* Invalid resource id */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define INVALID (0)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BAD_RESOURCE 0xe0000000
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define rClient(obj) (clients[CLIENT_ID((obj)->resource)])
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* Resource state callback */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT CallbackListPtr ResourceStateCallback;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef enum { ResourceStateAdding,
65fea56f17cd614bc8908264df980a62e1931468vboxsync ResourceStateFreeing
65fea56f17cd614bc8908264df980a62e1931468vboxsync} ResourceState;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef struct {
65fea56f17cd614bc8908264df980a62e1931468vboxsync ResourceState state;
65fea56f17cd614bc8908264df980a62e1931468vboxsync XID id;
65fea56f17cd614bc8908264df980a62e1931468vboxsync RESTYPE type;
65fea56f17cd614bc8908264df980a62e1931468vboxsync pointer value;
65fea56f17cd614bc8908264df980a62e1931468vboxsync} ResourceStateInfoRec;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef int (*DeleteType) (pointer /*value */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync XID /*id */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*FindResType) (pointer /*value */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync XID /*id */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync pointer /*cdata */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*FindAllRes) (pointer /*value */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync XID /*id */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync RESTYPE /*type */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync pointer /*cdata */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef Bool (*FindComplexResType) (pointer /*value */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync XID /*id */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync pointer /*cdata */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* Structure for estimating resource memory usage. Memory usage
65fea56f17cd614bc8908264df980a62e1931468vboxsync * consists of space allocated for the resource itself and of
65fea56f17cd614bc8908264df980a62e1931468vboxsync * references to other resources. Currently the most important use for
65fea56f17cd614bc8908264df980a62e1931468vboxsync * this structure is to estimate pixmap usage of different resources
65fea56f17cd614bc8908264df980a62e1931468vboxsync * more accurately. */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef struct {
65fea56f17cd614bc8908264df980a62e1931468vboxsync /* Size of resource itself. Zero if not implemented. */
65fea56f17cd614bc8908264df980a62e1931468vboxsync unsigned long resourceSize;
65fea56f17cd614bc8908264df980a62e1931468vboxsync /* Size attributed to pixmap references from the resource. */
65fea56f17cd614bc8908264df980a62e1931468vboxsync unsigned long pixmapRefSize;
65fea56f17cd614bc8908264df980a62e1931468vboxsync /* Number of references to this resource; typically 1 */
65fea56f17cd614bc8908264df980a62e1931468vboxsync unsigned long refCnt;
65fea56f17cd614bc8908264df980a62e1931468vboxsync} ResourceSizeRec, *ResourceSizePtr;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*SizeType)(pointer /*value*/,
65fea56f17cd614bc8908264df980a62e1931468vboxsync XID /*id*/,
65fea56f17cd614bc8908264df980a62e1931468vboxsync ResourceSizePtr /*size*/);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT RESTYPE CreateNewResourceType(DeleteType /*deleteFunc */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync const char * /*name */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef void (*FindTypeSubResources)(pointer /* value */,
65fea56f17cd614bc8908264df980a62e1931468vboxsync FindAllRes /* func */,
65fea56f17cd614bc8908264df980a62e1931468vboxsync pointer /* cdata */);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT SizeType GetResourceTypeSizeFunc(
65fea56f17cd614bc8908264df980a62e1931468vboxsync RESTYPE /*type*/);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void SetResourceTypeFindSubResFunc(
65fea56f17cd614bc8908264df980a62e1931468vboxsync RESTYPE /*type*/, FindTypeSubResources /*findFunc*/);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void SetResourceTypeSizeFunc(
65fea56f17cd614bc8908264df980a62e1931468vboxsync RESTYPE /*type*/, SizeType /*sizeFunc*/);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void SetResourceTypeErrorValue(
65fea56f17cd614bc8908264df980a62e1931468vboxsync RESTYPE /*type*/, int /*errorValue*/);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT RESTYPE CreateNewResourceClass(void);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT Bool InitClientResources(ClientPtr /*client */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT XID FakeClientID(int /*client */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* Quartz support on Mac OS X uses the CarbonCore
65fea56f17cd614bc8908264df980a62e1931468vboxsync framework whose AddResource function conflicts here. */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef __APPLE__
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define AddResource Darwin_X_AddResource
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT Bool AddResource(XID /*id */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync RESTYPE /*type */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync pointer /*value */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void FreeResource(XID /*id */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync RESTYPE /*skipDeleteFuncType */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void FreeResourceByType(XID /*id */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync RESTYPE /*type */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync Bool /*skipFree */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT Bool ChangeResourceValue(XID /*id */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync RESTYPE /*rtype */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync pointer /*value */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void FindClientResourcesByType(ClientPtr /*client */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync RESTYPE /*type */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync FindResType /*func */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync pointer /*cdata */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void FindAllClientResources(ClientPtr /*client */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync FindAllRes /*func */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync pointer /*cdata */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/** @brief Iterate through all subresources of a resource.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync @note The XID argument provided to the FindAllRes function
65fea56f17cd614bc8908264df980a62e1931468vboxsync may be 0 for subresources that don't have an XID */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void FindSubResources(pointer /*resource*/,
65fea56f17cd614bc8908264df980a62e1931468vboxsync RESTYPE /*type*/,
65fea56f17cd614bc8908264df980a62e1931468vboxsync FindAllRes /*func*/,
65fea56f17cd614bc8908264df980a62e1931468vboxsync pointer /*cdata*/);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void FreeClientNeverRetainResources(ClientPtr /*client */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void FreeClientResources(ClientPtr /*client */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void FreeAllResources(void);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT Bool LegalNewID(XID /*id */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync ClientPtr /*client */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT pointer LookupClientResourceComplex(ClientPtr client,
65fea56f17cd614bc8908264df980a62e1931468vboxsync RESTYPE type,
65fea56f17cd614bc8908264df980a62e1931468vboxsync FindComplexResType func,
65fea56f17cd614bc8908264df980a62e1931468vboxsync pointer cdata);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT int dixLookupResourceByType(pointer *result,
65fea56f17cd614bc8908264df980a62e1931468vboxsync XID id,
65fea56f17cd614bc8908264df980a62e1931468vboxsync RESTYPE rtype,
65fea56f17cd614bc8908264df980a62e1931468vboxsync ClientPtr client,
65fea56f17cd614bc8908264df980a62e1931468vboxsync Mask access_mode);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT int dixLookupResourceByClass(pointer *result,
65fea56f17cd614bc8908264df980a62e1931468vboxsync XID id,
65fea56f17cd614bc8908264df980a62e1931468vboxsync RESTYPE rclass,
65fea56f17cd614bc8908264df980a62e1931468vboxsync ClientPtr client,
65fea56f17cd614bc8908264df980a62e1931468vboxsync Mask access_mode);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT void GetXIDRange(int /*client */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync Bool /*server */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync XID * /*minp */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync XID * /*maxp */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT unsigned int GetXIDList(ClientPtr /*client */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync unsigned int /*count */ ,
65fea56f17cd614bc8908264df980a62e1931468vboxsync XID * /*pids */ );
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT RESTYPE lastResourceType;
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT RESTYPE TypeMask;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/** @brief A hashing function to be used for hashing resource IDs
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync @param id The resource ID to hash
65fea56f17cd614bc8908264df980a62e1931468vboxsync @param numBits The number of bits in the resulting hash. Must be >=0.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync @note This function is really only for handling
65fea56f17cd614bc8908264df980a62e1931468vboxsync INITHASHSIZE..MAXHASHSIZE bit hashes, but will handle any number
65fea56f17cd614bc8908264df980a62e1931468vboxsync of bits by either masking numBits lower bits of the ID or by
65fea56f17cd614bc8908264df980a62e1931468vboxsync providing at most MAXHASHSIZE hashes.
65fea56f17cd614bc8908264df980a62e1931468vboxsync*/
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT int HashResourceID(XID id,
65fea56f17cd614bc8908264df980a62e1931468vboxsync int numBits);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* RESOURCE_H */