/***********************************************************
Copyright 1987, 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
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
OPEN GROUP 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 of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
#ifndef RESOURCE_H
#include "misc.h"
#include "dixaccess.h"
/*****************************************************************
* STUFF FOR RESOURCES
*****************************************************************/
/* classes for Resource routines */
/* Use class RC_NEVERRETAIN for resources that should not be retained
* regardless of the close down mode when the client dies. (A client's
* event selections on objects that it doesn't own are good candidates.)
* Extensions can use this too!
*/
/* types for Resource routines */
/* bits and fields within a resource id */
#if MAXCLIENTS == 64
#endif
#if MAXCLIENTS == 128
#endif
#if MAXCLIENTS == 256
#endif
#if MAXCLIENTS == 512
#endif
/* client field offset */
/* resource field */
/* client field */
/* extract the client mask from an XID */
/* extract the client id from an XID */
#ifdef INVALID
#endif
/* Invalid resource id */
#define INVALID (0)
/* Resource state callback */
typedef enum { ResourceStateAdding,
typedef struct {
void *value;
void *cdata);
void *cdata);
void *cdata);
/* Structure for estimating resource memory usage. Memory usage
* consists of space allocated for the resource itself and of
* references to other resources. Currently the most important use for
* this structure is to estimate pixmap usage of different resources
* more accurately. */
typedef struct {
/* Size of resource itself. Zero if not implemented. */
unsigned long resourceSize;
/* Size attributed to pixmap references from the resource. */
unsigned long pixmapRefSize;
/* Number of references to this resource; typically 1 */
unsigned long refCnt;
const char *name);
void *cdata);
RESTYPE /*type*/);
extern _X_EXPORT void SetResourceTypeFindSubResFunc(
extern _X_EXPORT void SetResourceTypeSizeFunc(
extern _X_EXPORT void SetResourceTypeErrorValue(
/* Quartz support on Mac OS X uses the CarbonCore
framework whose AddResource function conflicts here. */
#ifdef __APPLE__
#endif
void *value);
RESTYPE /*skipDeleteFuncType */ );
RESTYPE /*type */ ,
Bool /*skipFree */ );
void *value);
void *cdata);
void *cdata);
/** @brief Iterate through all subresources of a resource.
@note The XID argument provided to the FindAllRes function
may be 0 for subresources that don't have an XID */
void *cdata);
extern _X_EXPORT void FreeAllResources(void);
ClientPtr /*client */ );
void *cdata);
Bool /*server */ ,
XID * /*minp */ ,
XID * /*maxp */ );
unsigned int /*count */ ,
XID * /*pids */ );
/** @brief A hashing function to be used for hashing resource IDs
@param id The resource ID to hash
@param numBits The number of bits in the resulting hash. Must be >=0.
@note This function is really only for handling
INITHASHSIZE..MAXHASHSIZE bit hashes, but will handle any number
of bits by either masking numBits lower bits of the ID or by
providing at most MAXHASHSIZE hashes.
*/
int numBits);
#endif /* RESOURCE_H */