extnsionst.h revision a2760a4d593af57a19ec32cdfd1723b68495df8c
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync/* $Xorg: extnsionst.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync/***********************************************************
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncCopyright 1987, 1998 The Open Group
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncPermission to use, copy, modify, distribute, and sell this software and its
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncdocumentation for any purpose is hereby granted without fee, provided that
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncthe above copyright notice appear in all copies and that both that
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsynccopyright notice and this permission notice appear in supporting
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncdocumentation.
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncThe above copyright notice and this permission notice shall be included in
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncall copies or substantial portions of the Software.
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncExcept as contained in this notice, the name of The Open Group shall not be
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncused in advertising or otherwise to promote the sale, use or other dealings
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncin this Software without prior written authorization from The Open Group.
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync All Rights Reserved
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncPermission to use, copy, modify, and distribute this software and its
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncdocumentation for any purpose and without fee is hereby granted,
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncprovided that the above copyright notice appear in all copies and that
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncboth that copyright notice and this permission notice appear in
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncsupporting documentation, and that the name of Digital not be
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncused in advertising or publicity pertaining to distribution of the
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncsoftware without specific, written prior permission.
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncSOFTWARE.
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync******************************************************************/
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync/* $XFree86: xc/programs/Xserver/include/extnsionst.h,v 3.8 2003/04/27 21:31:04 herrb Exp $ */
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync#ifndef EXTENSIONSTRUCT_H
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync#define EXTENSIONSTRUCT_H
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync#include "misc.h"
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync#include "screenint.h"
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync#include "extension.h"
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync#include "gc.h"
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsynctypedef struct _ExtensionEntry {
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync int index;
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync void (* CloseDown)( /* called at server shutdown */
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync struct _ExtensionEntry * /* extension */);
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync char *name; /* extension name */
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync int base; /* base request number */
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync int eventBase;
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync int eventLast;
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync int errorBase;
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync int errorLast;
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync int num_aliases;
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync char **aliases;
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync pointer extPrivate;
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync unsigned short (* MinorOpcode)( /* called for errors */
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync ClientPtr /* client */);
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync#ifdef XCSECURITY
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync Bool secure; /* extension visible to untrusted clients? */
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync#endif
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync} ExtensionEntry;
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync/*
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync * The arguments may be different for extension event swapping functions.
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync * Deal with this by casting when initializing the event's EventSwapVector[]
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync * entries.
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync */
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsynctypedef void (*EventSwapPtr) (xEvent *, xEvent *);
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncextern EventSwapPtr EventSwapVector[128];
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsyncextern void NotImplemented ( /* FIXME: this may move to another file... */
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync xEvent *,
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync xEvent *);
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsynctypedef void (* ExtensionLookupProc)(
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync#ifdef EXTENSION_PROC_ARGS
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync EXTENSION_PROC_ARGS
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync#else
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync /* args no longer indeterminate */
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync char *name,
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync GCPtr pGC
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync#endif
cabde247f900dcf6e58d009bbdd15099c028c6fcvboxsync);
typedef struct _ProcEntry {
char *name;
ExtensionLookupProc proc;
} ProcEntryRec, *ProcEntryPtr;
typedef struct _ScreenProcEntry {
int num;
ProcEntryPtr procList;
} ScreenProcEntry;
#define SetGCVector(pGC, VectorElement, NewRoutineAddress, Atom) \
pGC->VectorElement = NewRoutineAddress;
#define GetGCValue(pGC, GCElement) (pGC->GCElement)
extern ExtensionEntry *AddExtension(
char* /*name*/,
int /*NumEvents*/,
int /*NumErrors*/,
int (* /*MainProc*/)(ClientPtr /*client*/),
int (* /*SwappedMainProc*/)(ClientPtr /*client*/),
void (* /*CloseDownProc*/)(ExtensionEntry * /*extension*/),
unsigned short (* /*MinorOpcodeProc*/)(ClientPtr /*client*/)
);
extern Bool AddExtensionAlias(
char* /*alias*/,
ExtensionEntry * /*extension*/);
extern ExtensionEntry *CheckExtension(const char *extname);
extern ExtensionLookupProc LookupProc(
char* /*name*/,
GCPtr /*pGC*/);
extern Bool RegisterProc(
char* /*name*/,
GCPtr /*pGC*/,
ExtensionLookupProc /*proc*/);
extern Bool RegisterScreenProc(
char* /*name*/,
ScreenPtr /*pScreen*/,
ExtensionLookupProc /*proc*/);
extern void DeclareExtensionSecurity(
char * /*extname*/,
Bool /*secure*/);
#endif /* EXTENSIONSTRUCT_H */