diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:48:57 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:48:57 +0000 |
commit | 9508a382f8a9f241dab097d921b6d290c1c3a776 (patch) | |
tree | fa456480bae7040c3f971a70b390f2d091c680b5 /hw/xfree86/dixmods | |
parent | ded6147bfb5d75ff1e67c858040a628b61bc17d1 (diff) |
Initial revision
Diffstat (limited to 'hw/xfree86/dixmods')
26 files changed, 4689 insertions, 0 deletions
diff --git a/hw/xfree86/dixmods/GLcoremodule.c b/hw/xfree86/dixmods/GLcoremodule.c new file mode 100644 index 000000000..9369db1f2 --- /dev/null +++ b/hw/xfree86/dixmods/GLcoremodule.c @@ -0,0 +1,60 @@ +/* $XFree86: xc/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c,v 1.1 2002/02/25 00:45:41 dawes Exp $ */ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) 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 NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin <kevin@precisioninsight.com> + * + */ + +#include "xf86Module.h" + +static MODULESETUPPROTO(GLcoreSetup); + +static XF86ModuleVersionInfo VersRec = +{ + "GLcore", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_EXTENSION, + ABI_EXTENSION_VERSION, + MOD_CLASS_NONE, + {0,0,0,0} +}; + +XF86ModuleData GLcoreModuleData = { &VersRec, GLcoreSetup, NULL }; + +static pointer +GLcoreSetup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + /* Need a non-NULL return value to indicate success */ + return (pointer)1; +} diff --git a/hw/xfree86/dixmods/afbmodule.c b/hw/xfree86/dixmods/afbmodule.c new file mode 100644 index 000000000..19f196ad8 --- /dev/null +++ b/hw/xfree86/dixmods/afbmodule.c @@ -0,0 +1,49 @@ +/* $XFree86: xc/programs/Xserver/afb/afbmodule.c,v 1.1 1999/06/13 13:47:38 dawes Exp $ */ +/* + * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * 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 + * XFREE86 PROJECT 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 XFree86 Project 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 + * XFree86 Project. + */ + +#ifdef XFree86LOADER + +#include "xf86Module.h" +#include "afb.h" + +static XF86ModuleVersionInfo VersRec = +{ + "afb", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_ANSIC, /* Only need the ansic layer */ + ABI_ANSIC_VERSION, + MOD_CLASS_NONE, + {0,0,0,0} /* signature, to be patched into the file by a tool */ +}; + +XF86ModuleData afbModuleData = { &VersRec, NULL, NULL }; + +#endif diff --git a/hw/xfree86/dixmods/bitmapmod.c b/hw/xfree86/dixmods/bitmapmod.c new file mode 100644 index 000000000..27fc23d32 --- /dev/null +++ b/hw/xfree86/dixmods/bitmapmod.c @@ -0,0 +1,72 @@ +/* + * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * 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 + * XFREE86 PROJECT 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 XFree86 Project 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 + * XFree86 Project. + */ +/* $XFree86: xc/lib/font/bitmap/module/bitmapmod.c,v 1.7 1999/01/26 05:53:47 dawes Exp $ */ + +#include "misc.h" + +#include "fontmod.h" +#include "xf86Module.h" + +static MODULESETUPPROTO(bitmapSetup); + + /* + * This is the module data function that is accessed when loading + * libbitmap as a module. + */ + +static XF86ModuleVersionInfo VersRec = +{ + "bitmap", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_FONT, /* Font module */ + ABI_FONT_VERSION, + MOD_CLASS_FONT, + {0,0,0,0} /* signature, to be patched into the file by a tool */ +}; + +XF86ModuleData bitmapModuleData = { &VersRec, bitmapSetup, NULL }; + +extern void BitmapRegisterFontFileFunctions(void); + +FontModule bitmapModule = { + BitmapRegisterFontFileFunctions, + "Bitmap", + NULL +}; + +static pointer +bitmapSetup(pointer mod, pointer opts, int *errmaj, int *errmin) +{ + bitmapModule.module = mod; + LoadFont(&bitmapModule); + + /* Need a non-NULL return */ + return (pointer)1; +} diff --git a/hw/xfree86/dixmods/cfb16module.c b/hw/xfree86/dixmods/cfb16module.c new file mode 100644 index 000000000..c8c79b545 --- /dev/null +++ b/hw/xfree86/dixmods/cfb16module.c @@ -0,0 +1,59 @@ +/* $XFree86: xc/programs/Xserver/cfb16/cfbmodule.c,v 1.8 1999/01/26 05:53:49 dawes Exp $ */ +/* + * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * 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 + * XFREE86 PROJECT 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 XFree86 Project 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 + * XFree86 Project. + */ + +#ifdef XFree86LOADER + +#include "xf86Module.h" +#include "cfb.h" + +static MODULESETUPPROTO(cfb16Setup); + +static XF86ModuleVersionInfo VersRec = +{ + "cfb16", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_ANSIC, /* Only need the ansic layer */ + ABI_ANSIC_VERSION, + MOD_CLASS_NONE, + {0,0,0,0} /* signature, to be patched into the file by a tool */ +}; + +XF86ModuleData cfb16ModuleData = { &VersRec, cfb16Setup, NULL }; + +static pointer +cfb16Setup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + /* This modules requires cfb, so load it */ + return LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL, + errmaj, errmin); +} + +#endif diff --git a/hw/xfree86/dixmods/cfb24module.c b/hw/xfree86/dixmods/cfb24module.c new file mode 100644 index 000000000..cf363f3c7 --- /dev/null +++ b/hw/xfree86/dixmods/cfb24module.c @@ -0,0 +1,59 @@ +/* $XFree86: xc/programs/Xserver/cfb24/cfbmodule.c,v 1.8 1999/01/26 05:53:49 dawes Exp $ */ +/* + * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * 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 + * XFREE86 PROJECT 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 XFree86 Project 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 + * XFree86 Project. + */ + +#ifdef XFree86LOADER + +#include "xf86Module.h" +#include "cfb.h" + +static MODULESETUPPROTO(cfb24Setup); + +static XF86ModuleVersionInfo VersRec = +{ + "cfb24", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_ANSIC, /* Only need the ansic layer */ + ABI_ANSIC_VERSION, + MOD_CLASS_NONE, + {0,0,0,0} /* signature, to be patched into the file by a tool */ +}; + +XF86ModuleData cfb24ModuleData = { &VersRec, cfb24Setup, NULL }; + +static pointer +cfb24Setup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + /* This modules requires cfb, so load it */ + return LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL, + errmaj, errmin); +} + +#endif diff --git a/hw/xfree86/dixmods/cfb32module.c b/hw/xfree86/dixmods/cfb32module.c new file mode 100644 index 000000000..791b64285 --- /dev/null +++ b/hw/xfree86/dixmods/cfb32module.c @@ -0,0 +1,59 @@ +/* $XFree86: xc/programs/Xserver/cfb32/cfbmodule.c,v 1.8 1999/01/26 05:53:49 dawes Exp $ */ +/* + * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * 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 + * XFREE86 PROJECT 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 XFree86 Project 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 + * XFree86 Project. + */ + +#ifdef XFree86LOADER + +#include "xf86Module.h" +#include "cfb.h" + +static MODULESETUPPROTO(cfb32Setup); + +static XF86ModuleVersionInfo VersRec = +{ + "cfb32", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_ANSIC, /* Only need the ansic layer */ + ABI_ANSIC_VERSION, + MOD_CLASS_NONE, + {0,0,0,0} /* signature, to be patched into the file by a tool */ +}; + +XF86ModuleData cfb32ModuleData = { &VersRec, cfb32Setup, NULL }; + +static pointer +cfb32Setup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + /* This modules requires cfb, so load it */ + return LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL, + errmaj, errmin); +} + +#endif diff --git a/hw/xfree86/dixmods/cfbmodule.c b/hw/xfree86/dixmods/cfbmodule.c new file mode 100644 index 000000000..87af699db --- /dev/null +++ b/hw/xfree86/dixmods/cfbmodule.c @@ -0,0 +1,59 @@ +/* $XFree86: xc/programs/Xserver/cfb/cfbmodule.c,v 1.8 1999/01/26 05:53:48 dawes Exp $ */ +/* + * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * 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 + * XFREE86 PROJECT 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 XFree86 Project 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 + * XFree86 Project. + */ + +#ifdef XFree86LOADER + +#include "xf86Module.h" +#include "cfb.h" + +static MODULESETUPPROTO(cfbSetup); + +static XF86ModuleVersionInfo VersRec = +{ + "cfb", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_ANSIC, /* Only need the ansic layer */ + ABI_ANSIC_VERSION, + MOD_CLASS_NONE, + {0,0,0,0} /* signature, to be patched into the file by a tool */ +}; + +XF86ModuleData cfbModuleData = { &VersRec, cfbSetup, NULL }; + +static pointer +cfbSetup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + /* This modules requires mfb, so load it */ + return LoadSubModule(module, "mfb", NULL, NULL, NULL, NULL, + errmaj, errmin); +} + +#endif diff --git a/hw/xfree86/dixmods/dbemodule.c b/hw/xfree86/dixmods/dbemodule.c new file mode 100644 index 000000000..f9dcc8477 --- /dev/null +++ b/hw/xfree86/dixmods/dbemodule.c @@ -0,0 +1,43 @@ +/* $XFree86: xc/programs/Xserver/dbe/dbemodule.c,v 1.7 2000/01/25 18:37:37 dawes Exp $ */ + +#include "xf86Module.h" + +static MODULESETUPPROTO(dbeSetup); + +extern void DbeExtensionInit(INITARGS); + +ExtensionModule dbeExt = { + DbeExtensionInit, + "DOUBLE-BUFFER", + NULL, + NULL, + NULL +}; + +static XF86ModuleVersionInfo VersRec = +{ + "dbe", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_EXTENSION, + ABI_EXTENSION_VERSION, + MOD_CLASS_EXTENSION, + {0,0,0,0} +}; + +/* + * Data for the loader + */ +XF86ModuleData dbeModuleData = { &VersRec, dbeSetup, NULL }; + +static pointer +dbeSetup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + LoadExtension(&dbeExt, FALSE); + + /* Need a non-NULL return value to indicate success */ + return (pointer)1; +} diff --git a/hw/xfree86/dixmods/extmod/dgaproc.h b/hw/xfree86/dixmods/extmod/dgaproc.h new file mode 100644 index 000000000..2b0118f15 --- /dev/null +++ b/hw/xfree86/dixmods/extmod/dgaproc.h @@ -0,0 +1,147 @@ +/* $XFree86: xc/programs/Xserver/Xext/dgaproc.h,v 1.21 2000/06/30 19:06:54 keithp Exp $ */ + +#ifndef __DGAPROC_H +#define __DGAPROC_H + +#include "Xproto.h" +#include "pixmap.h" + +#define DGA_CONCURRENT_ACCESS 0x00000001 +#define DGA_FILL_RECT 0x00000002 +#define DGA_BLIT_RECT 0x00000004 +#define DGA_BLIT_RECT_TRANS 0x00000008 +#define DGA_PIXMAP_AVAILABLE 0x00000010 + +#define DGA_INTERLACED 0x00010000 +#define DGA_DOUBLESCAN 0x00020000 + +#define DGA_FLIP_IMMEDIATE 0x00000001 +#define DGA_FLIP_RETRACE 0x00000002 + +#define DGA_COMPLETED 0x00000000 +#define DGA_PENDING 0x00000001 + +#define DGA_NEED_ROOT 0x00000001 + +typedef struct { + int num; /* A unique identifier for the mode (num > 0) */ + char *name; /* name of mode given in the XF86Config */ + int VSync_num; + int VSync_den; + int flags; /* DGA_CONCURRENT_ACCESS, etc... */ + int imageWidth; /* linear accessible portion (pixels) */ + int imageHeight; + int pixmapWidth; /* Xlib accessible portion (pixels) */ + int pixmapHeight; /* both fields ignored if no concurrent access */ + int bytesPerScanline; + int byteOrder; /* MSBFirst, LSBFirst */ + int depth; + int bitsPerPixel; + unsigned long red_mask; + unsigned long green_mask; + unsigned long blue_mask; + short visualClass; + int viewportWidth; + int viewportHeight; + int xViewportStep; /* viewport position granularity */ + int yViewportStep; + int maxViewportX; /* max viewport origin */ + int maxViewportY; + int viewportFlags; /* types of page flipping possible */ + int offset; + int reserved1; + int reserved2; +} XDGAModeRec, *XDGAModePtr; + + +void XFree86DGAExtensionInit(void); + +/* DDX interface */ + +int +DGASetMode( + int Index, + int num, + XDGAModePtr mode, + PixmapPtr *pPix +); + +void +DGASetInputMode( + int Index, + Bool keyboard, + Bool mouse +); + +void +DGASelectInput( + int Index, + ClientPtr client, + long mask +); + +Bool DGAAvailable(int Index); +Bool DGAActive(int Index); +void DGAShutdown(void); +void DGAInstallCmap(ColormapPtr cmap); +int DGAGetViewportStatus(int Index); +int DGASync(int Index); + +int +DGAFillRect( + int Index, + int x, int y, int w, int h, + unsigned long color +); + +int +DGABlitRect( + int Index, + int srcx, int srcy, + int w, int h, + int dstx, int dsty +); + +int +DGABlitTransRect( + int Index, + int srcx, int srcy, + int w, int h, + int dstx, int dsty, + unsigned long color +); + +int +DGASetViewport( + int Index, + int x, int y, + int mode +); + +int DGAGetModes(int Index); +int DGAGetOldDGAMode(int Index); + +int DGAGetModeInfo(int Index, XDGAModePtr mode, int num); + +Bool DGAVTSwitch(void); +Bool DGAStealMouseEvent(int Index, xEvent *e, int dx, int dy); +Bool DGAStealKeyEvent(int Index, xEvent *e); +Bool DGAIsDgaEvent (xEvent *e); + +Bool DGADeliverEvent (ScreenPtr pScreen, xEvent *e); + +Bool DGAOpenFramebuffer(int Index, char **name, unsigned char **mem, + int *size, int *offset, int *flags); +void DGACloseFramebuffer(int Index); +Bool DGAChangePixmapMode(int Index, int *x, int *y, int mode); +int DGACreateColormap(int Index, ClientPtr client, int id, int mode, + int alloc); + +extern unsigned char DGAReqCode; +extern int DGAErrorBase; +extern int DGAEventBase; +extern int *XDGAEventBase; + + + +#endif /* __DGAPROC_H */ diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c new file mode 100644 index 000000000..d97b88fa4 --- /dev/null +++ b/hw/xfree86/dixmods/extmod/modinit.c @@ -0,0 +1,362 @@ +/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.c,v 1.16 2002/03/06 21:12:33 mvojkovi Exp $ */ + +/* + * + * Copyright (c) 1997 Matthieu Herrb + * + * 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, and that the name of Matthieu Herrb not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Matthieu Herrb makes no + * representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * MATTHIEU HERRB DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL MATTHIEU HERRB 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. + */ + +#ifdef XFree86LOADER +#include "xf86_ansic.h" + +#include "xf86Module.h" +#include "xf86Opt.h" + +#include "Xproto.h" + +static MODULESETUPPROTO(extmodSetup); + +extern Bool noTestExtensions; + +#ifdef SHAPE +extern void ShapeExtensionInit(INITARGS); +#define _SHAPE_SERVER_ /* don't want Xlib structures */ +#include "shapestr.h" +#endif + +#ifdef MULTIBUFFER +extern void MultibufferExtensionInit(INITARGS); +#define _MULTIBUF_SERVER_ /* don't want Xlib structures */ +#include "multibufst.h" +#endif + +#ifdef MITMISC +extern void MITMiscExtensionInit(INITARGS); +#define _MITMISC_SERVER_ +#include "mitmiscstr.h" +#endif + +#ifdef XTEST +extern void XTestExtensionInit(INITARGS); +#define _XTEST_SERVER_ +#include "XTest.h" +#include "xteststr.h" +#endif + +#ifdef BIGREQS +extern void BigReqExtensionInit(INITARGS); +#include "bigreqstr.h" +#endif + +#ifdef XSYNC +extern void SyncExtensionInit(INITARGS); +#define _SYNC_SERVER +#include "sync.h" +#include "syncstr.h" +#endif + +#ifdef SCREENSAVER +extern void ScreenSaverExtensionInit (INITARGS); +#include "saver.h" +#endif + +#ifdef XCMISC +extern void XCMiscExtensionInit(INITARGS); +#include "xcmiscstr.h" +#endif + +#ifdef XF86VIDMODE +extern void XFree86VidModeExtensionInit(INITARGS); +#define _XF86VIDMODE_SERVER_ +#include "xf86vmstr.h" +#endif + +#ifdef XF86MISC +extern void XFree86MiscExtensionInit(INITARGS); +#define _XF86MISC_SERVER_ +#define _XF86MISC_SAVER_COMPAT_ +#include "xf86mscstr.h" +#endif + +#ifdef XFreeXDGA +extern void XFree86DGAExtensionInit(INITARGS); +extern void XFree86DGARegister(INITARGS); +#define _XF86DGA_SERVER_ +#include "xf86dgastr.h" +#endif + +#ifdef DPMSExtension +extern void DPMSExtensionInit(INITARGS); +#include "dpmsstr.h" +#endif + +#ifdef FONTCACHE +extern void FontCacheExtensionInit(INITARGS); +#define _FONTCACHE_SERVER_ +#include "fontcacheP.h" +#include "fontcachstr.h" +#endif + +#ifdef TOGCUP +extern void XcupExtensionInit(INITARGS); +#define _XCUP_SERVER_ +#include "Xcupstr.h" +#endif + +#ifdef EVI +extern void EVIExtensionInit(INITARGS); +#define _XEVI_SERVER_ +#include "XEVIstr.h" +#endif + +#ifdef XV +extern void XvExtensionInit(INITARGS); +extern void XvMCExtensionInit(INITARGS); +extern void XvRegister(INITARGS); +#include "Xv.h" +#include "XvMC.h" +#endif + +#ifdef RES +extern void ResExtensionInit(INITARGS); +#include "XResproto.h" +#endif + +/* + * Array describing extensions to be initialized + */ +ExtensionModule extensionModules[] = { +#ifdef SHAPE + { + ShapeExtensionInit, + SHAPENAME, + NULL, + NULL, + NULL + }, +#endif +#ifdef MULTIBUFFER + { + MultibufferExtensionInit, + MULTIBUFFER_PROTOCOL_NAME, + NULL, + NULL, + NULL + }, +#endif +#ifdef MITMISC + { + MITMiscExtensionInit, + MITMISCNAME, + NULL, + NULL, + NULL + }, +#endif +#ifdef notyet + { + XTestExtensionInit, + XTestExtensionName, + &noTestExtensions, + NULL, + NULL + }, +#endif +#ifdef BIGREQS + { + BigReqExtensionInit, + XBigReqExtensionName, + NULL, + NULL, + NULL + }, +#endif +#ifdef XSYNC + { + SyncExtensionInit, + SYNC_NAME, + NULL, + NULL, + NULL + }, +#endif +#ifdef SCREENSAVER + { + ScreenSaverExtensionInit, + ScreenSaverName, + NULL, + NULL, + NULL + }, +#endif +#ifdef XCMISC + { + XCMiscExtensionInit, + XCMiscExtensionName, + NULL, + NULL, + NULL + }, +#endif +#ifdef XF86VIDMODE + { + XFree86VidModeExtensionInit, + XF86VIDMODENAME, + NULL, + NULL, + NULL + }, +#endif +#ifdef XF86MISC + { + XFree86MiscExtensionInit, + XF86MISCNAME, + NULL, + NULL, + NULL + }, +#endif +#ifdef XFreeXDGA + { + XFree86DGAExtensionInit, + XF86DGANAME, + NULL, + XFree86DGARegister, + NULL + }, +#endif +#ifdef DPMSExtension + { + DPMSExtensionInit, + DPMSExtensionName, + NULL, + NULL + }, +#endif +#ifdef FONTCACHE + { + FontCacheExtensionInit, + FONTCACHENAME, + NULL, + NULL, + NULL + }, +#endif +#ifdef TOGCUP + { + XcupExtensionInit, + XCUPNAME, + NULL, + NULL, + NULL + }, +#endif +#ifdef EVI + { + EVIExtensionInit, + EVINAME, + NULL, + NULL, + NULL + }, +#endif +#ifdef XV + { + XvExtensionInit, + XvName, + NULL, + XvRegister, + NULL + }, + { + XvMCExtensionInit, + XvMCName, + NULL, + NULL, + NULL + }, +#endif +#ifdef RES + { + ResExtensionInit, + XRES_NAME, + NULL, + NULL, + NULL + }, +#endif + { /* DON'T delete this entry ! */ + NULL, + NULL, + NULL, + NULL, + NULL + } +}; + +static XF86ModuleVersionInfo VersRec = +{ + "extmod", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_EXTENSION, + ABI_EXTENSION_VERSION, + MOD_CLASS_EXTENSION, + {0,0,0,0} +}; + +/* + * Data for the loader + */ +XF86ModuleData extmodModuleData = { &VersRec, extmodSetup, NULL }; + +static pointer +extmodSetup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + int i; + + /* XXX the option stuff here is largely a sample/test case */ + + for (i = 0; extensionModules[i].name != NULL; i++) { + if (opts) { + char *s; + s = (char *)xalloc(strlen(extensionModules[i].name) + 5); + if (s) { + pointer o; + strcpy(s, "omit"); + strcat(s, extensionModules[i].name); + o = xf86FindOption(opts, s); + xfree(s); + if (o) { + xf86MarkOptionUsed(o); + continue; + } + } + } + LoadExtension(&extensionModules[i], FALSE); + } + /* Need a non-NULL return */ + return (pointer)1; +} + +#endif /* XFree86LOADER */ diff --git a/hw/xfree86/dixmods/extmod/vidmodeproc.h b/hw/xfree86/dixmods/extmod/vidmodeproc.h new file mode 100644 index 000000000..57a7872f0 --- /dev/null +++ b/hw/xfree86/dixmods/extmod/vidmodeproc.h @@ -0,0 +1,74 @@ +/* $XFree86: xc/programs/Xserver/Xext/vidmodeproc.h,v 1.5 2001/05/06 00:51:19 mvojkovi Exp $ */ + +/* Prototypes for DGA functions that the DDX must provide */ + +#ifndef _VIDMODEPROC_H_ +#define _VIDMODEPROC_H_ + + +typedef enum { + VIDMODE_H_DISPLAY, + VIDMODE_H_SYNCSTART, + VIDMODE_H_SYNCEND, + VIDMODE_H_TOTAL, + VIDMODE_H_SKEW, + VIDMODE_V_DISPLAY, + VIDMODE_V_SYNCSTART, + VIDMODE_V_SYNCEND, + VIDMODE_V_TOTAL, + VIDMODE_FLAGS, + VIDMODE_CLOCK +} VidModeSelectMode; + +typedef enum { + VIDMODE_MON_VENDOR, + VIDMODE_MON_MODEL, + VIDMODE_MON_NHSYNC, + VIDMODE_MON_NVREFRESH, + VIDMODE_MON_HSYNC_LO, + VIDMODE_MON_HSYNC_HI, + VIDMODE_MON_VREFRESH_LO, + VIDMODE_MON_VREFRESH_HI +} VidModeSelectMonitor; + +typedef union { + pointer ptr; + int i; + float f; +} vidMonitorValue; + +void XFree86VidModeExtensionInit(void); + +Bool VidModeAvailable(int scrnIndex); +Bool VidModeGetCurrentModeline(int scrnIndex, pointer *mode, int *dotClock); +Bool VidModeGetFirstModeline(int scrnIndex, pointer *mode, int *dotClock); +Bool VidModeGetNextModeline(int scrnIndex, pointer *mode, int *dotClock); +Bool VidModeDeleteModeline(int scrnIndex, pointer mode); +Bool VidModeZoomViewport(int scrnIndex, int zoom); +Bool VidModeGetViewPort(int scrnIndex, int *x, int *y); +Bool VidModeSetViewPort(int scrnIndex, int x, int y); +Bool VidModeSwitchMode(int scrnIndex, pointer mode); +Bool VidModeLockZoom(int scrnIndex, Bool lock); +Bool VidModeGetMonitor(int scrnIndex, pointer *monitor); +int VidModeGetNumOfClocks(int scrnIndex, Bool *progClock); +Bool VidModeGetClocks(int scrnIndex, int *Clocks); +ModeStatus VidModeCheckModeForMonitor(int scrnIndex, pointer mode); +ModeStatus VidModeCheckModeForDriver(int scrnIndex, pointer mode); +void VidModeSetCrtcForMode(int scrnIndex, pointer mode); +Bool VidModeAddModeline(int scrnIndex, pointer mode); +int VidModeGetDotClock(int scrnIndex, int Clock); +int VidModeGetNumOfModes(int scrnIndex); +Bool VidModeSetGamma(int scrnIndex, float red, float green, float blue); +Bool VidModeGetGamma(int scrnIndex, float *red, float *green, float *blue); +pointer VidModeCreateMode(void); +void VidModeCopyMode(pointer modefrom, pointer modeto); +int VidModeGetModeValue(pointer mode, int valtyp); +void VidModeSetModeValue(pointer mode, int valtyp, int val); +vidMonitorValue VidModeGetMonitorValue(pointer monitor, int valtyp, int indx); +Bool VidModeSetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *); +Bool VidModeGetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *); +int VidModeGetGammaRampSize(int scrnIndex); + +#endif + + diff --git a/hw/xfree86/dixmods/extmod/xf86dga.c b/hw/xfree86/dixmods/extmod/xf86dga.c new file mode 100644 index 000000000..9593c4a40 --- /dev/null +++ b/hw/xfree86/dixmods/extmod/xf86dga.c @@ -0,0 +1,302 @@ +/* $XFree86: xc/programs/Xserver/Xext/xf86dga.c,v 3.21 2000/06/30 19:06:54 keithp Exp $ */ + +/* + +Copyright (c) 1995 Jon Tombs +Copyright (c) 1995, 1996, 1999 XFree86 Inc + +*/ + +#define NEED_REPLIES +#define NEED_EVENTS +#include "X.h" +#include "Xproto.h" +#include "misc.h" +#include "dixstruct.h" +#include "extnsionst.h" +#include "colormapst.h" +#include "cursorstr.h" +#include "scrnintstr.h" +#include "servermd.h" +#define _XF86DGA_SERVER_ +#include "xf86dga.h" +#include "xf86dgastr.h" +#include "swaprep.h" +#include "dgaproc.h" + + +static DISPATCH_PROC(ProcXF86DGADirectVideo); +static DISPATCH_PROC(ProcXF86DGAGetVidPage); +static DISPATCH_PROC(ProcXF86DGAGetVideoLL); +static DISPATCH_PROC(ProcXF86DGAGetViewPortSize); +static DISPATCH_PROC(ProcXF86DGASetVidPage); +static DISPATCH_PROC(ProcXF86DGASetViewPort); +static DISPATCH_PROC(ProcXF86DGAInstallColormap); +static DISPATCH_PROC(ProcXF86DGAQueryDirectVideo); +static DISPATCH_PROC(ProcXF86DGAViewPortChanged); + + +static int +ProcXF86DGAGetVideoLL(ClientPtr client) +{ + REQUEST(xXF86DGAGetVideoLLReq); + xXF86DGAGetVideoLLReply rep; + XDGAModeRec mode; + int num, offset, flags; + char *name; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + if(!DGAAvailable(stuff->screen)) + return (DGAErrorBase + XF86DGANoDirectVideoMode); + + if(!(num = DGAGetOldDGAMode(stuff->screen))) + return (DGAErrorBase + XF86DGANoDirectVideoMode); + + /* get the parameters for the mode that best matches */ + DGAGetModeInfo(stuff->screen, &mode, num); + + if(!DGAOpenFramebuffer(stuff->screen, &name, + (unsigned char**)(&rep.offset), + (int*)(&rep.bank_size), &offset, &flags)) + return BadAlloc; + + rep.offset += mode.offset; + rep.width = mode.bytesPerScanline / (mode.bitsPerPixel >> 3); + rep.ram_size = rep.bank_size >> 10; + + WriteToClient(client, SIZEOF(xXF86DGAGetVideoLLReply), (char *)&rep); + return (client->noClientException); +} + +static int +ProcXF86DGADirectVideo(ClientPtr client) +{ + int num; + PixmapPtr pix; + XDGAModeRec mode; + REQUEST(xXF86DGADirectVideoReq); + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq); + + if (!DGAAvailable(stuff->screen)) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + if (stuff->enable & XF86DGADirectGraphics) { + if(!(num = DGAGetOldDGAMode(stuff->screen))) + return (DGAErrorBase + XF86DGANoDirectVideoMode); + } else + num = 0; + + if(Success != DGASetMode(stuff->screen, num, &mode, &pix)) + return (DGAErrorBase + XF86DGAScreenNotActive); + + DGASetInputMode (stuff->screen, + (stuff->enable & XF86DGADirectKeyb) != 0, + (stuff->enable & XF86DGADirectMouse) != 0); + + return (client->noClientException); +} + +static int +ProcXF86DGAGetViewPortSize(ClientPtr client) +{ + int num; + XDGAModeRec mode; + REQUEST(xXF86DGAGetViewPortSizeReq); + xXF86DGAGetViewPortSizeReply rep; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + if (!DGAAvailable(stuff->screen)) + return (DGAErrorBase + XF86DGANoDirectVideoMode); + + if(!(num = DGAGetOldDGAMode(stuff->screen))) + return (DGAErrorBase + XF86DGANoDirectVideoMode); + + DGAGetModeInfo(stuff->screen, &mode, num); + + rep.width = mode.viewportWidth; + rep.height = mode.viewportHeight; + + WriteToClient(client, SIZEOF(xXF86DGAGetViewPortSizeReply), (char *)&rep); + return (client->noClientException); +} + +static int +ProcXF86DGASetViewPort(ClientPtr client) +{ + REQUEST(xXF86DGASetViewPortReq); + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGASetViewPortReq); + + if (!DGAActive(stuff->screen)) + { + int num; + PixmapPtr pix; + XDGAModeRec mode; + + if(!(num = DGAGetOldDGAMode(stuff->screen))) + return (DGAErrorBase + XF86DGANoDirectVideoMode); + if(Success != DGASetMode(stuff->screen, num, &mode, &pix)) + return (DGAErrorBase + XF86DGAScreenNotActive); + } + + if (DGASetViewport(stuff->screen, stuff->x, stuff->y, DGA_FLIP_RETRACE) + != Success) + return DGAErrorBase + XF86DGADirectNotActivated; + + return (client->noClientException); +} + +static int +ProcXF86DGAGetVidPage(ClientPtr client) +{ + REQUEST(xXF86DGAGetVidPageReq); + xXF86DGAGetVidPageReply rep; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.vpage = 0; /* silently fail */ + + WriteToClient(client, SIZEOF(xXF86DGAGetVidPageReply), (char *)&rep); + return (client->noClientException); +} + + +static int +ProcXF86DGASetVidPage(ClientPtr client) +{ + REQUEST(xXF86DGASetVidPageReq); + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq); + + /* silently fail */ + + return (client->noClientException); +} + + +static int +ProcXF86DGAInstallColormap(ClientPtr client) +{ + ColormapPtr pcmp; + REQUEST(xXF86DGAInstallColormapReq); + + REQUEST_SIZE_MATCH(xXF86DGAInstallColormapReq); + + if (!DGAActive(stuff->screen)) + return (DGAErrorBase + XF86DGADirectNotActivated); + + pcmp = (ColormapPtr )LookupIDByType(stuff->id, RT_COLORMAP); + if (pcmp) { + DGAInstallCmap(pcmp); + return (client->noClientException); + } else { + client->errorValue = stuff->id; + return (BadColor); + } +} + +static int +ProcXF86DGAQueryDirectVideo(ClientPtr client) +{ + REQUEST(xXF86DGAQueryDirectVideoReq); + xXF86DGAQueryDirectVideoReply rep; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGAQueryDirectVideoReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.flags = 0; + + if (DGAAvailable(stuff->screen)) + rep.flags = XF86DGADirectPresent; + + WriteToClient(client, SIZEOF(xXF86DGAQueryDirectVideoReply), (char *)&rep); + return (client->noClientException); +} + +static int +ProcXF86DGAViewPortChanged(ClientPtr client) +{ + REQUEST(xXF86DGAViewPortChangedReq); + xXF86DGAViewPortChangedReply rep; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGAViewPortChangedReq); + + if (!DGAActive(stuff->screen)) + return (DGAErrorBase + XF86DGADirectNotActivated); + + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.result = 1; + + WriteToClient(client, SIZEOF(xXF86DGAViewPortChangedReply), (char *)&rep); + return (client->noClientException); +} + +int +ProcXF86DGADispatch (client) + register ClientPtr client; +{ + REQUEST(xReq); + + switch (stuff->data) + { + case X_XF86DGAGetVideoLL: + return ProcXF86DGAGetVideoLL(client); + case X_XF86DGADirectVideo: + return ProcXF86DGADirectVideo(client); + case X_XF86DGAGetViewPortSize: + return ProcXF86DGAGetViewPortSize(client); + case X_XF86DGASetViewPort: + return ProcXF86DGASetViewPort(client); + case X_XF86DGAGetVidPage: + return ProcXF86DGAGetVidPage(client); + case X_XF86DGASetVidPage: + return ProcXF86DGASetVidPage(client); + case X_XF86DGAInstallColormap: + return ProcXF86DGAInstallColormap(client); + case X_XF86DGAQueryDirectVideo: + return ProcXF86DGAQueryDirectVideo(client); + case X_XF86DGAViewPortChanged: + return ProcXF86DGAViewPortChanged(client); + default: + return BadRequest; + } +} + diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c new file mode 100644 index 000000000..c0d51b809 --- /dev/null +++ b/hw/xfree86/dixmods/extmod/xf86dga2.c @@ -0,0 +1,773 @@ +/* + Copyright (c) 1999 - The XFree86 Project Inc. + + Written by Mark Vojkovich +*/ +/* $XFree86: xc/programs/Xserver/Xext/xf86dga2.c,v 1.17 2001/10/28 03:32:51 tsi Exp $ */ + + +#define NEED_REPLIES +#define NEED_EVENTS +#include "X.h" +#include "Xproto.h" +#include "misc.h" +#include "dixstruct.h" +#include "dixevents.h" +#include "pixmapstr.h" +#include "extnsionst.h" +#include "colormapst.h" +#include "cursorstr.h" +#include "scrnintstr.h" +#include "servermd.h" +#define _XF86DGA_SERVER_ +#include "xf86dga.h" +#include "xf86dgastr.h" +#include "swaprep.h" +#include "dgaproc.h" + +#ifdef EXTMODULE +#include "xf86_ansic.h" +#else +#include <string.h> +#endif + + +static DISPATCH_PROC(ProcXDGADispatch); +static DISPATCH_PROC(SProcXDGADispatch); +static DISPATCH_PROC(ProcXDGAQueryVersion); +static DISPATCH_PROC(ProcXDGAQueryModes); +static DISPATCH_PROC(ProcXDGASetMode); +static DISPATCH_PROC(ProcXDGAOpenFramebuffer); +static DISPATCH_PROC(ProcXDGACloseFramebuffer); +static DISPATCH_PROC(ProcXDGASetViewport); +static DISPATCH_PROC(ProcXDGAInstallColormap); +static DISPATCH_PROC(ProcXDGASelectInput); +static DISPATCH_PROC(ProcXDGAFillRectangle); +static DISPATCH_PROC(ProcXDGACopyArea); +static DISPATCH_PROC(ProcXDGACopyTransparentArea); +static DISPATCH_PROC(ProcXDGAGetViewportStatus); +static DISPATCH_PROC(ProcXDGASync); +static DISPATCH_PROC(ProcXDGASetClientVersion); +static DISPATCH_PROC(ProcXDGAChangePixmapMode); +static DISPATCH_PROC(ProcXDGACreateColormap); + + +extern DISPATCH_PROC(ProcXF86DGADispatch); + + +static void XDGAResetProc(ExtensionEntry *extEntry); + +static void DGAClientStateChange (CallbackListPtr*, pointer, pointer); + +static ClientPtr DGAClients[MAXSCREENS]; + +unsigned char DGAReqCode = 0; +int DGAErrorBase; +int DGAEventBase; + +static int DGAGeneration = 0; +static int DGAClientPrivateIndex; +static int DGACallbackRefCount = 0; + +/* This holds the client's version information */ +typedef struct { + int major; + int minor; +} DGAPrivRec, *DGAPrivPtr; + +#define DGAPRIV(c) ((c)->devPrivates[DGAClientPrivateIndex].ptr) + +void +XFree86DGAExtensionInit(void) +{ + ExtensionEntry* extEntry; + + if ((extEntry = AddExtension(XF86DGANAME, + XF86DGANumberEvents, + XF86DGANumberErrors, + ProcXDGADispatch, + SProcXDGADispatch, + XDGAResetProc, + StandardMinorOpcode))) { + int i; + + for(i = 0; i < MAXSCREENS; i++) + DGAClients[i] = NULL; + + DGAReqCode = (unsigned char)extEntry->base; + DGAErrorBase = extEntry->errorBase; + DGAEventBase = extEntry->eventBase; + for (i = KeyPress; i <= MotionNotify; i++) + SetCriticalEvent (DGAEventBase + i); + } + + /* + * Allocate a client private index to hold the client's version + * information. + */ + if (DGAGeneration != serverGeneration) { + DGAClientPrivateIndex = AllocateClientPrivateIndex(); + /* + * Allocate 0 length, and use the private to hold a pointer to + * our DGAPrivRec. + */ + if (!AllocateClientPrivate(DGAClientPrivateIndex, 0)) { + ErrorF("XFree86DGAExtensionInit: AllocateClientPrivate failed\n"); + return; + } + DGAGeneration = serverGeneration; + } +} + + + +static void +XDGAResetProc (ExtensionEntry *extEntry) +{ + DeleteCallback (&ClientStateCallback, DGAClientStateChange, NULL); + DGACallbackRefCount = 0; +} + + +static int +ProcXDGAQueryVersion(ClientPtr client) +{ + xXDGAQueryVersionReply rep; + + REQUEST_SIZE_MATCH(xXDGAQueryVersionReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.majorVersion = XDGA_MAJOR_VERSION; + rep.minorVersion = XDGA_MINOR_VERSION; + + WriteToClient(client, sizeof(xXDGAQueryVersionReply), (char *)&rep); + return (client->noClientException); +} + + +static int +ProcXDGAOpenFramebuffer(ClientPtr client) +{ + REQUEST(xXDGAOpenFramebufferReq); + xXDGAOpenFramebufferReply rep; + char *deviceName; + int nameSize; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + if (!DGAAvailable(stuff->screen)) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + REQUEST_SIZE_MATCH(xXDGAOpenFramebufferReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + if(!DGAOpenFramebuffer(stuff->screen, &deviceName, + (unsigned char**)(&rep.mem1), + (int*)&rep.size, (int*)&rep.offset, (int*)&rep.extra)) + { + return BadAlloc; + } + + nameSize = deviceName ? (strlen(deviceName) + 1) : 0; + rep.length = (nameSize + 3) >> 2; + + WriteToClient(client, sizeof(xXDGAOpenFramebufferReply), (char *)&rep); + if(rep.length) + WriteToClient(client, nameSize, deviceName); + + return (client->noClientException); +} + + +static int +ProcXDGACloseFramebuffer(ClientPtr client) +{ + REQUEST(xXDGACloseFramebufferReq); + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + if (!DGAAvailable(stuff->screen)) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + REQUEST_SIZE_MATCH(xXDGACloseFramebufferReq); + + DGACloseFramebuffer(stuff->screen); + + return (client->noClientException); +} + +static int +ProcXDGAQueryModes(ClientPtr client) +{ + int i, num, size; + REQUEST(xXDGAQueryModesReq); + xXDGAQueryModesReply rep; + xXDGAModeInfo info; + XDGAModePtr mode; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXDGAQueryModesReq); + rep.type = X_Reply; + rep.length = 0; + rep.number = 0; + rep.sequenceNumber = client->sequence; + + if (!DGAAvailable(stuff->screen)) { + rep.number = 0; + rep.length = 0; + WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep); + return (client->noClientException); + } + + if(!(num = DGAGetModes(stuff->screen))) { + WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep); + return (client->noClientException); + } + + if(!(mode = (XDGAModePtr)xalloc(num * sizeof(XDGAModeRec)))) + return BadAlloc; + + for(i = 0; i < num; i++) + DGAGetModeInfo(stuff->screen, mode + i, i + 1); + + size = num * sz_xXDGAModeInfo; + for(i = 0; i < num; i++) + size += (strlen(mode[i].name) + 4) & ~3L; /* plus NULL */ + + rep.number = num; + rep.length = size >> 2; + + WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep); + + for(i = 0; i < num; i++) { + size = strlen(mode[i].name) + 1; + + info.byte_order = mode[i].byteOrder; + info.depth = mode[i].depth; + info.num = mode[i].num; + info.bpp = mode[i].bitsPerPixel; + info.name_size = (size + 3) & ~3L; + info.vsync_num = mode[i].VSync_num; + info.vsync_den = mode[i].VSync_den; + info.flags = mode[i].flags; + info.image_width = mode[i].imageWidth; + info.image_height = mode[i].imageHeight; + info.pixmap_width = mode[i].pixmapWidth; + info.pixmap_height = mode[i].pixmapHeight; + info.bytes_per_scanline = mode[i].bytesPerScanline; + info.red_mask = mode[i].red_mask; + info.green_mask = mode[i].green_mask; + info.blue_mask = mode[i].blue_mask; + info.visual_class = mode[i].visualClass; + info.viewport_width = mode[i].viewportWidth; + info.viewport_height = mode[i].viewportHeight; + info.viewport_xstep = mode[i].xViewportStep; + info.viewport_ystep = mode[i].yViewportStep; + info.viewport_xmax = mode[i].maxViewportX; + info.viewport_ymax = mode[i].maxViewportY; + info.viewport_flags = mode[i].viewportFlags; + info.reserved1 = mode[i].reserved1; + info.reserved2 = mode[i].reserved2; + + WriteToClient(client, sz_xXDGAModeInfo, (char*)(&info)); + WriteToClient(client, size, mode[i].name); + } + + xfree(mode); + + return (client->noClientException); +} + + +static void +DGAClientStateChange ( + CallbackListPtr* pcbl, + pointer nulldata, + pointer calldata +){ + NewClientInfoRec* pci = (NewClientInfoRec*) calldata; + ClientPtr client = NULL; + int i; + + for(i = 0; i < screenInfo.numScreens; i++) { + if(DGAClients[i] == pci->client) { + client = pci->client; + break; + } + } + + if(client && + ((client->clientState == ClientStateGone) || + (client->clientState == ClientStateRetained))) { + XDGAModeRec mode; + PixmapPtr pPix; + + DGAClients[i] = NULL; + DGASelectInput(i, NULL, 0); + DGASetMode(i, 0, &mode, &pPix); + + if(--DGACallbackRefCount == 0) + DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL); + } +} + +static int +ProcXDGASetMode(ClientPtr client) +{ + REQUEST(xXDGASetModeReq); + xXDGASetModeReply rep; + XDGAModeRec mode; + xXDGAModeInfo info; + PixmapPtr pPix; + int size; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXDGASetModeReq); + rep.type = X_Reply; + rep.length = 0; + rep.offset = 0; + rep.flags = 0; + rep.sequenceNumber = client->sequence; + + if (!DGAAvailable(stuff->screen)) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + if(DGAClients[stuff->screen] && + (DGAClients[stuff->screen] != client)) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + if(!stuff->mode) { + if(DGAClients[stuff->screen]) { + if(--DGACallbackRefCount == 0) + DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL); + } + DGAClients[stuff->screen] = NULL; + DGASelectInput(stuff->screen, NULL, 0); + DGASetMode(stuff->screen, 0, &mode, &pPix); + WriteToClient(client, sz_xXDGASetModeReply, (char*)&rep); + return (client->noClientException); + } + + if(Success != DGASetMode(stuff->screen, stuff->mode, &mode, &pPix)) + return BadValue; + + if(!DGAClients[stuff->screen]) { + if(DGACallbackRefCount++ == 0) + AddCallback (&ClientStateCallback, DGAClientStateChange, NULL); + } + + DGAClients[stuff->screen] = client; + + if(pPix) { + if(AddResource(stuff->pid, RT_PIXMAP, (pointer)(pPix))) { + pPix->drawable.id = (int)stuff->pid; + rep.flags = DGA_PIXMAP_AVAILABLE; + } + } + + size = strlen(mode.name) + 1; + + info.byte_order = mode.byteOrder; + info.depth = mode.depth; + info.num = mode.num; + info.bpp = mode.bitsPerPixel; + info.name_size = (size + 3) & ~3L; + info.vsync_num = mode.VSync_num; + info.vsync_den = mode.VSync_den; + info.flags = mode.flags; + info.image_width = mode.imageWidth; + info.image_height = mode.imageHeight; + info.pixmap_width = mode.pixmapWidth; + info.pixmap_height = mode.pixmapHeight; + info.bytes_per_scanline = mode.bytesPerScanline; + info.red_mask = mode.red_mask; + info.green_mask = mode.green_mask; + info.blue_mask = mode.blue_mask; + info.visual_class = mode.visualClass; + info.viewport_width = mode.viewportWidth; + info.viewport_height = mode.viewportHeight; + info.viewport_xstep = mode.xViewportStep; + info.viewport_ystep = mode.yViewportStep; + info.viewport_xmax = mode.maxViewportX; + info.viewport_ymax = mode.maxViewportY; + info.viewport_flags = mode.viewportFlags; + info.reserved1 = mode.reserved1; + info.reserved2 = mode.reserved2; + + rep.length = (sz_xXDGAModeInfo + info.name_size) >> 2; + + WriteToClient(client, sz_xXDGASetModeReply, (char*)&rep); + WriteToClient(client, sz_xXDGAModeInfo, (char*)(&info)); + WriteToClient(client, size, mode.name); + + return (client->noClientException); +} + +static int +ProcXDGASetViewport(ClientPtr client) +{ + REQUEST(xXDGASetViewportReq); + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + if(DGAClients[stuff->screen] != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGASetViewportReq); + + DGASetViewport(stuff->screen, stuff->x, stuff->y, stuff->flags); + + return (client->noClientException); +} + +static int +ProcXDGAInstallColormap(ClientPtr client) +{ + ColormapPtr cmap; + REQUEST(xXDGAInstallColormapReq); + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + if(DGAClients[stuff->screen] != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGAInstallColormapReq); + + cmap = (ColormapPtr)LookupIDByType(stuff->cmap, RT_COLORMAP); + if (cmap) { + DGAInstallCmap(cmap); + return (client->noClientException); + } else { + client->errorValue = stuff->cmap; + return (BadColor); + } + + return (client->noClientException); +} + + +static int +ProcXDGASelectInput(ClientPtr client) +{ + REQUEST(xXDGASelectInputReq); + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + if(DGAClients[stuff->screen] != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGASelectInputReq); + + if(DGAClients[stuff->screen] == client) + DGASelectInput(stuff->screen, client, stuff->mask); + + return (client->noClientException); +} + + +static int +ProcXDGAFillRectangle(ClientPtr client) +{ + REQUEST(xXDGAFillRectangleReq); + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + if(DGAClients[stuff->screen] != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGAFillRectangleReq); + + if(Success != DGAFillRect(stuff->screen, stuff->x, stuff->y, + stuff->width, stuff->height, stuff->color)) + return BadMatch; + + return (client->noClientException); +} + +static int +ProcXDGACopyArea(ClientPtr client) +{ + REQUEST(xXDGACopyAreaReq); + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + if(DGAClients[stuff->screen] != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGACopyAreaReq); + + if(Success != DGABlitRect(stuff->screen, stuff->srcx, stuff->srcy, + stuff->width, stuff->height, stuff->dstx, stuff->dsty)) + return BadMatch; + + return (client->noClientException); +} + + +static int +ProcXDGACopyTransparentArea(ClientPtr client) +{ + REQUEST(xXDGACopyTransparentAreaReq); + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + if(DGAClients[stuff->screen] != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGACopyTransparentAreaReq); + + if(Success != DGABlitTransRect(stuff->screen, stuff->srcx, stuff->srcy, + stuff->width, stuff->height, stuff->dstx, stuff->dsty, stuff->key)) + return BadMatch; + + return (client->noClientException); +} + + +static int +ProcXDGAGetViewportStatus(ClientPtr client) +{ + REQUEST(xXDGAGetViewportStatusReq); + xXDGAGetViewportStatusReply rep; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + if(DGAClients[stuff->screen] != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGAGetViewportStatusReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + rep.status = DGAGetViewportStatus(stuff->screen); + + WriteToClient(client, sizeof(xXDGAGetViewportStatusReply), (char *)&rep); + return (client->noClientException); +} + +static int +ProcXDGASync(ClientPtr client) +{ + REQUEST(xXDGASyncReq); + xXDGASyncReply rep; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + if(DGAClients[stuff->screen] != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGASyncReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + DGASync(stuff->screen); + + WriteToClient(client, sizeof(xXDGASyncReply), (char *)&rep); + return (client->noClientException); +} + +static int +ProcXDGASetClientVersion(ClientPtr client) +{ + REQUEST(xXDGASetClientVersionReq); + + DGAPrivPtr pPriv; + + REQUEST_SIZE_MATCH(xXDGASetClientVersionReq); + if ((pPriv = DGAPRIV(client)) == NULL) { + pPriv = xalloc(sizeof(DGAPrivRec)); + /* XXX Need to look into freeing this */ + if (!pPriv) + return BadAlloc; + DGAPRIV(client) = pPriv; + } + pPriv->major = stuff->major; + pPriv->minor = stuff->minor; + + return (client->noClientException); +} + +static int +ProcXDGAChangePixmapMode(ClientPtr client) +{ + REQUEST(xXDGAChangePixmapModeReq); + xXDGAChangePixmapModeReply rep; + int x, y; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + if(DGAClients[stuff->screen] != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGAChangePixmapModeReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + x = stuff->x; + y = stuff->y; + + if(!DGAChangePixmapMode(stuff->screen, &x, &y, stuff->flags)) + return BadMatch; + + rep.x = x; + rep.y = y; + WriteToClient(client, sizeof(xXDGAChangePixmapModeReply), (char *)&rep); + + return (client->noClientException); +} + + +static int +ProcXDGACreateColormap(ClientPtr client) +{ + REQUEST(xXDGACreateColormapReq); + int result; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + if(DGAClients[stuff->screen] != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGACreateColormapReq); + + if(!stuff->mode) + return BadValue; + + result = DGACreateColormap(stuff->screen, client, stuff->id, + stuff->mode, stuff->alloc); + if(result != Success) + return result; + + return (client->noClientException); +} + + +static int +SProcXDGADispatch (ClientPtr client) +{ + return DGAErrorBase + XF86DGAClientNotLocal; +} + +#if 0 +#define DGA_REQ_DEBUG +#endif + +#ifdef DGA_REQ_DEBUG +static char *dgaMinor[] = { + "QueryVersion", + "GetVideoLL", + "DirectVideo", + "GetViewPortSize", + "SetViewPort", + "GetVidPage", + "SetVidPage", + "InstallColormap", + "QueryDirectVideo", + "ViewPortChanged", + "10", + "11", + "QueryModes", + "SetMode", + "SetViewport", + "InstallColormap", + "SelectInput", + "FillRectangle", + "CopyArea", + "CopyTransparentArea", + "GetViewportStatus", + "Sync", + "OpenFramebuffer", + "CloseFramebuffer", + "SetClientVersion", + "ChangePixmapMode", + "CreateColormap", +}; +#endif + +static int +ProcXDGADispatch (ClientPtr client) +{ + REQUEST(xReq); + + if (!LocalClient(client)) + return DGAErrorBase + XF86DGAClientNotLocal; + +#ifdef DGA_REQ_DEBUG + if (stuff->data <= X_XDGACreateColormap) + fprintf (stderr, " DGA %s\n", dgaMinor[stuff->data]); +#endif + + /* divert old protocol */ +#if 1 + if( (stuff->data <= X_XF86DGAViewPortChanged) && + (stuff->data >= X_XF86DGAGetVideoLL)) + return ProcXF86DGADispatch(client); +#endif + + switch (stuff->data){ + case X_XDGAQueryVersion: + return ProcXDGAQueryVersion(client); + case X_XDGAQueryModes: + return ProcXDGAQueryModes(client); + case X_XDGASetMode: + return ProcXDGASetMode(client); + case X_XDGAOpenFramebuffer: + return ProcXDGAOpenFramebuffer(client); + case X_XDGACloseFramebuffer: + return ProcXDGACloseFramebuffer(client); + case X_XDGASetViewport: + return ProcXDGASetViewport(client); + case X_XDGAInstallColormap: + return ProcXDGAInstallColormap(client); + case X_XDGASelectInput: + return ProcXDGASelectInput(client); + case X_XDGAFillRectangle: + return ProcXDGAFillRectangle(client); + case X_XDGACopyArea: + return ProcXDGACopyArea(client); + case X_XDGACopyTransparentArea: + return ProcXDGACopyTransparentArea(client); + case X_XDGAGetViewportStatus: + return ProcXDGAGetViewportStatus(client); + case X_XDGASync: + return ProcXDGASync(client); + case X_XDGASetClientVersion: + return ProcXDGASetClientVersion(client); + case X_XDGAChangePixmapMode: + return ProcXDGAChangePixmapMode(client); + case X_XDGACreateColormap: + return ProcXDGACreateColormap(client); + default: + return BadRequest; + } +} + +#ifdef EXTMODULE +void +XFree86DGARegister() +{ + XDGAEventBase = &DGAEventBase; +} +#endif diff --git a/hw/xfree86/dixmods/extmod/xf86misc.c b/hw/xfree86/dixmods/extmod/xf86misc.c new file mode 100644 index 000000000..bc8e94b45 --- /dev/null +++ b/hw/xfree86/dixmods/extmod/xf86misc.c @@ -0,0 +1,767 @@ +/* $XFree86: xc/programs/Xserver/Xext/xf86misc.c,v 3.37 2002/11/20 04:04:58 dawes Exp $ */ + +/* + * Copyright (c) 1995, 1996 The XFree86 Project, Inc + */ + +/* THIS IS NOT AN X CONSORTIUM STANDARD */ + +#define NEED_REPLIES +#define NEED_EVENTS +#include "X.h" +#include "Xproto.h" +#include "misc.h" +#include "dixstruct.h" +#include "extnsionst.h" +#include "scrnintstr.h" +#include "inputstr.h" +#include "servermd.h" +#define _XF86MISC_SERVER_ +#undef _XF86MISC_SAVER_COMPAT_ +#include "xf86mscstr.h" +#include "swaprep.h" +#include "xf86.h" +#include "Xfuncproto.h" +#include "xf86miscproc.h" + +#if 0 +#include <X11/Xtrans.h> +#include "../os/osdep.h" +#include <X11/Xauth.h> +#ifndef USL +#ifndef Lynx +#include <sys/socket.h> +#else +#include <socket.h> +#endif +#endif /* USL */ +#endif + +#ifdef EXTMODULE +#include "xf86_ansic.h" +#endif + +static int miscErrorBase; +static int MiscGeneration = 0; +static int MiscClientPrivateIndex; + +/* This holds the client's version information */ +typedef struct { + int major; + int minor; +} MiscPrivRec, *MiscPrivPtr; + +#define MPRIV(c) ((c)->devPrivates[MiscClientPrivateIndex].ptr) + +static void XF86MiscResetProc( +#if NeedFunctionPrototypes + ExtensionEntry* /* extEntry */ +#endif +); + +static void +ClientVersion(ClientPtr client, int *major, int *minor) +{ + MiscPrivPtr pPriv; + + pPriv = MPRIV(client); + if (!pPriv) { + if (major) *major = 0; + if (minor) *minor = 0; + return; + } + + if (major) *major = pPriv->major; + if (minor) *minor = pPriv->minor; +} + +static DISPATCH_PROC(ProcXF86MiscDispatch); +static DISPATCH_PROC(ProcXF86MiscQueryVersion); +static DISPATCH_PROC(ProcXF86MiscGetKbdSettings); +static DISPATCH_PROC(ProcXF86MiscGetMouseSettings); +static DISPATCH_PROC(ProcXF86MiscSetKbdSettings); +static DISPATCH_PROC(ProcXF86MiscSetMouseSettings); +static DISPATCH_PROC(ProcXF86MiscSetGrabKeysState); +static DISPATCH_PROC(ProcXF86MiscSetClientVersion); +static DISPATCH_PROC(ProcXF86MiscGetFilePaths); +#ifdef _XF86MISC_SAVER_COMPAT_ +static DISPATCH_PROC(ProcXF86MiscGetSaver); +static DISPATCH_PROC(ProcXF86MiscSetSaver); +#endif +static DISPATCH_PROC(SProcXF86MiscDispatch); +static DISPATCH_PROC(SProcXF86MiscQueryVersion); +static DISPATCH_PROC(SProcXF86MiscGetKbdSettings); +static DISPATCH_PROC(SProcXF86MiscGetMouseSettings); +static DISPATCH_PROC(SProcXF86MiscSetKbdSettings); +static DISPATCH_PROC(SProcXF86MiscSetMouseSettings); +static DISPATCH_PROC(SProcXF86MiscSetGrabKeysState); +static DISPATCH_PROC(SProcXF86MiscSetClientVersion); +static DISPATCH_PROC(SProcXF86MiscGetFilePaths); +#ifdef _XF86MISC_SAVER_COMPAT_ +static DISPATCH_PROC(SProcXF86MiscGetSaver); +static DISPATCH_PROC(SProcXF86MiscSetSaver); +#endif + +static unsigned char XF86MiscReqCode = 0; + +#ifdef DEBUG +# define DEBUG_P(x) ErrorF(x"\n"); +#else +# define DEBUG_P(x) /**/ +#endif + +#define MISCERR(x) (miscErrorBase + x) + +void +XFree86MiscExtensionInit(void) +{ + ExtensionEntry* extEntry; + + DEBUG_P("XFree86MiscExtensionInit"); + + if (!xf86GetModInDevEnabled()) + return; + + /* + * Allocate a client private index to hold the client's version + * information. + */ + if (MiscGeneration != serverGeneration) { + MiscClientPrivateIndex = AllocateClientPrivateIndex(); + /* + * Allocate 0 length, and use the private to hold a pointer to our + * MiscPrivRec. + */ + if (!AllocateClientPrivate(MiscClientPrivateIndex, 0)) { + ErrorF("XFree86MiscExtensionInit: " + "AllocateClientPrivate failed\n"); + return; + } + MiscGeneration = serverGeneration; + } + + if ( + (extEntry = AddExtension(XF86MISCNAME, + XF86MiscNumberEvents, + XF86MiscNumberErrors, + ProcXF86MiscDispatch, + SProcXF86MiscDispatch, + XF86MiscResetProc, + StandardMinorOpcode))) { + XF86MiscReqCode = (unsigned char)extEntry->base; + miscErrorBase = extEntry->errorBase; + } +} + +/*ARGSUSED*/ +static void +XF86MiscResetProc (extEntry) + ExtensionEntry* extEntry; +{ +} + +static int +ProcXF86MiscQueryVersion(client) + register ClientPtr client; +{ + xXF86MiscQueryVersionReply rep; + register int n; + + DEBUG_P("XF86MiscQueryVersion"); + + REQUEST_SIZE_MATCH(xXF86MiscQueryVersionReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.majorVersion = XF86MISC_MAJOR_VERSION; + rep.minorVersion = XF86MISC_MINOR_VERSION; + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swaps(&rep.majorVersion, n); + swaps(&rep.minorVersion, n); + } + WriteToClient(client, sizeof(xXF86MiscQueryVersionReply), (char *)&rep); + return (client->noClientException); +} + +#ifdef _XF86MISC_SAVER_COMPAT_ +/* THESE HAVE NOT BEEN CONVERTED TO THE NEW DESIGN */ + +/* + * This will go away, but remains for now for compatibility with older + * clients. + */ +static int +ProcXF86MiscSetSaver(client) + register ClientPtr client; +{ + REQUEST(xXF86MiscSetSaverReq); + ScrnInfoPtr vptr; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + vptr = (ScrnInfoPtr) screenInfo.screens[stuff->screen]->devPrivates[xf86ScreenIndex].ptr; + + REQUEST_SIZE_MATCH(xXF86MiscSetSaverReq); + + if (stuff->suspendTime < 0) + return BadValue; + if (stuff->offTime < 0) + return BadValue; + + return (client->noClientException); +} + +/* + * This will go away, but remains for now for compatibility with older + * clients. + */ +static int +ProcXF86MiscGetSaver(client) + register ClientPtr client; +{ + REQUEST(xXF86MiscGetSaverReq); + xXF86MiscGetSaverReply rep; + register int n; + ScrnInfoPtr vptr; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + vptr = (ScrnInfoPtr) screenInfo.screens[stuff->screen]->devPrivates[xf86ScreenIndex].ptr; + + REQUEST_SIZE_MATCH(xXF86MiscGetSaverReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.suspendTime = 0; + rep.offTime = 0; + + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.suspendTime, n); + swapl(&rep.offTime, n); + } + WriteToClient(client, SIZEOF(xXF86MiscGetSaverReply), (char *)&rep); + return (client->noClientException); +} + +#endif /* _XF86MISC_SAVER_COMPAT_ */ + +static int +ProcXF86MiscGetMouseSettings(client) + register ClientPtr client; +{ + xXF86MiscGetMouseSettingsReply rep; + char *devname; + pointer mouse; + register int n; + + DEBUG_P("XF86MiscGetMouseSettings"); + + REQUEST_SIZE_MATCH(xXF86MiscGetMouseSettingsReq); + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + + if (!MiscExtGetMouseSettings(&mouse, &devname)) + return BadValue; + + rep.mousetype = MiscExtGetMouseValue(mouse, MISC_MSE_PROTO); + rep.baudrate = MiscExtGetMouseValue(mouse, MISC_MSE_BAUDRATE); + rep.samplerate = MiscExtGetMouseValue(mouse, MISC_MSE_SAMPLERATE); + rep.resolution = MiscExtGetMouseValue(mouse, MISC_MSE_RESOLUTION); + rep.buttons = MiscExtGetMouseValue(mouse, MISC_MSE_BUTTONS); + rep.emulate3buttons = MiscExtGetMouseValue(mouse, MISC_MSE_EM3BUTTONS); + rep.emulate3timeout = MiscExtGetMouseValue(mouse, MISC_MSE_EM3TIMEOUT); + rep.chordmiddle = MiscExtGetMouseValue(mouse, MISC_MSE_CHORDMIDDLE); + rep.flags = MiscExtGetMouseValue(mouse, MISC_MSE_FLAGS); + rep.devnamelen = (devname? strlen(devname): 0); + rep.length = (sizeof(xXF86MiscGetMouseSettingsReply) - + sizeof(xGenericReply) + ((rep.devnamelen+3) & ~3)) >> 2; + + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.mousetype, n); + swapl(&rep.baudrate, n); + swapl(&rep.samplerate, n); + swapl(&rep.resolution, n); + swapl(&rep.buttons, n); + swapl(&rep.emulate3buttons, n); + swapl(&rep.emulate3timeout, n); + swapl(&rep.chordmiddle, n); + swapl(&rep.flags, n); + } + WriteToClient(client, SIZEOF(xXF86MiscGetMouseSettingsReply), (char *)&rep); + MiscExtDestroyStruct(mouse, MISC_POINTER); + + if (rep.devnamelen) + WriteToClient(client, rep.devnamelen, devname); + return (client->noClientException); +} + +static int +ProcXF86MiscGetKbdSettings(client) + register ClientPtr client; +{ + xXF86MiscGetKbdSettingsReply rep; + pointer kbd; + register int n; + + DEBUG_P("XF86MiscGetKbdSettings"); + + REQUEST_SIZE_MATCH(xXF86MiscGetKbdSettingsReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + if (!MiscExtGetKbdSettings(&kbd)) + return BadValue; + + rep.kbdtype = MiscExtGetKbdValue(kbd, MISC_KBD_TYPE); + rep.rate = MiscExtGetKbdValue(kbd, MISC_KBD_RATE); + rep.delay = MiscExtGetKbdValue(kbd, MISC_KBD_DELAY); + rep.servnumlock = MiscExtGetKbdValue(kbd, MISC_KBD_SERVNUMLOCK); + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.kbdtype, n); + swapl(&rep.rate, n); + swapl(&rep.delay, n); + } + WriteToClient(client, SIZEOF(xXF86MiscGetKbdSettingsReply), (char *)&rep); + return (client->noClientException); +} + +static int +ProcXF86MiscSetMouseSettings(client) + register ClientPtr client; +{ + MiscExtReturn ret; + pointer mouse; + char *devname = NULL; + int major, minor; + + REQUEST(xXF86MiscSetMouseSettingsReq); + + DEBUG_P("XF86MiscSetMouseSettings"); + + REQUEST_AT_LEAST_SIZE(xXF86MiscSetMouseSettingsReq); + + ClientVersion(client, &major, &minor); + + if (xf86GetVerbosity() > 1) { + ErrorF("SetMouseSettings - type: %d brate: %d srate: %d chdmid: %d\n", + stuff->mousetype, stuff->baudrate, + stuff->samplerate, stuff->chordmiddle); + ErrorF(" em3but: %d em3tim: %d res: %d flags: %d\n", + stuff->emulate3buttons, stuff->emulate3timeout, + stuff->resolution, stuff->flags); + } + + + if ((mouse = MiscExtCreateStruct(MISC_POINTER)) == (pointer) 0) + return BadAlloc; + + MiscExtSetMouseValue(mouse, MISC_MSE_PROTO, stuff->mousetype); + MiscExtSetMouseValue(mouse, MISC_MSE_BAUDRATE, stuff->baudrate); + MiscExtSetMouseValue(mouse, MISC_MSE_SAMPLERATE, stuff->samplerate); + MiscExtSetMouseValue(mouse, MISC_MSE_RESOLUTION, stuff->resolution); + MiscExtSetMouseValue(mouse, MISC_MSE_BUTTONS, stuff->buttons); + MiscExtSetMouseValue(mouse, MISC_MSE_EM3BUTTONS, stuff->emulate3buttons); + MiscExtSetMouseValue(mouse, MISC_MSE_EM3TIMEOUT, stuff->emulate3timeout); + MiscExtSetMouseValue(mouse, MISC_MSE_CHORDMIDDLE, stuff->chordmiddle); + MiscExtSetMouseValue(mouse, MISC_MSE_FLAGS, stuff->flags); + + if ((major > 0 || minor > 5) && stuff->devnamelen) { + int size = sizeof(xXF86MiscSetMouseSettingsReq) + stuff->devnamelen; + size = (size + 3) >> 2; + if (client->req_len < size) + return BadLength; + if (stuff->devnamelen) { + if (!(devname = xalloc(stuff->devnamelen))) + return BadAlloc; + strncpy(devname,(char*)(&stuff[1]),stuff->devnamelen); + if (xf86GetVerbosity() > 1) + ErrorF("SetMouseSettings - device: %s\n",devname); + MiscExtSetMouseDevice(mouse, devname); + } + } + + ret = MiscExtApply(mouse, MISC_POINTER); + + if (devname) + xfree(devname); + + switch ((ret)) { + case MISC_RET_SUCCESS: break; + case MISC_RET_BADVAL: return BadValue; + case MISC_RET_BADMSEPROTO: return MISCERR(XF86MiscBadMouseProtocol); + case MISC_RET_BADBAUDRATE: return MISCERR(XF86MiscBadMouseBaudRate); + case MISC_RET_BADFLAGS: return MISCERR(XF86MiscBadMouseFlags); + case MISC_RET_BADCOMBO: return MISCERR(XF86MiscBadMouseCombo); + case MISC_RET_NOMODULE: return MISCERR(XF86MiscNoModule); + default: + ErrorF("Unexpected return from MiscExtApply(POINTER) = %d\n", ret); + return BadImplementation; + } + + if (xf86GetVerbosity() > 1) + ErrorF("SetMouseSettings - Succeeded\n"); + return (client->noClientException); +} + +static int +ProcXF86MiscSetKbdSettings(client) + register ClientPtr client; +{ + MiscExtReturn ret; + pointer kbd; + REQUEST(xXF86MiscSetKbdSettingsReq); + + DEBUG_P("XF86MiscSetKbdSettings"); + + REQUEST_SIZE_MATCH(xXF86MiscSetKbdSettingsReq); + + if (xf86GetVerbosity() > 1) + ErrorF("SetKbdSettings - type: %d rate: %d delay: %d snumlk: %d\n", + stuff->kbdtype, stuff->rate, + stuff->delay, stuff->servnumlock); + + if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (pointer) 0) + return BadAlloc; + + MiscExtSetKbdValue(kbd, MISC_KBD_TYPE, stuff->kbdtype); + MiscExtSetKbdValue(kbd, MISC_KBD_RATE, stuff->rate); + MiscExtSetKbdValue(kbd, MISC_KBD_DELAY, stuff->delay); + MiscExtSetKbdValue(kbd, MISC_KBD_SERVNUMLOCK, stuff->servnumlock); + + switch ((ret = MiscExtApply(kbd, MISC_KEYBOARD))) { + case MISC_RET_SUCCESS: break; + case MISC_RET_BADVAL: return BadValue; + case MISC_RET_BADKBDTYPE: return MISCERR(XF86MiscBadKbdType); + default: + ErrorF("Unexpected return from MiscExtApply(KEYBOARD) = %d\n", ret); + return BadImplementation; + } + + if (xf86GetVerbosity() > 1) + ErrorF("SetKbdSettings - Succeeded\n"); + return (client->noClientException); +} + +static int +ProcXF86MiscSetGrabKeysState(client) + register ClientPtr client; +{ + int n, status; + xXF86MiscSetGrabKeysStateReply rep; + REQUEST(xXF86MiscSetGrabKeysStateReq); + + DEBUG_P("XF86MiscSetGrabKeysState"); + + REQUEST_SIZE_MATCH(xXF86MiscSetGrabKeysStateReq); + + if ((status = MiscExtSetGrabKeysState(client, stuff->enable)) == 0) { + if (xf86GetVerbosity() > 1) + ErrorF("SetGrabKeysState - %s\n", + stuff->enable ? "enabled" : "disabled"); + } + + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.status = status; + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.status, n); + } + WriteToClient(client, SIZEOF(xXF86MiscSetGrabKeysStateReply), (char *)&rep); + + return (client->noClientException); +} + +static int +ProcXF86MiscSetClientVersion(ClientPtr client) +{ + REQUEST(xXF86MiscSetClientVersionReq); + + MiscPrivPtr pPriv; + + DEBUG_P("XF86MiscSetClientVersion"); + + REQUEST_SIZE_MATCH(xXF86MiscSetClientVersionReq); + + if ((pPriv = MPRIV(client)) == NULL) { + pPriv = xalloc(sizeof(MiscPrivRec)); + if (!pPriv) + return BadAlloc; + MPRIV(client) = pPriv; + } + ErrorF("SetClientVersion: %i %i\n",stuff->major,stuff->minor); + pPriv->major = stuff->major; + pPriv->minor = stuff->minor; + + return (client->noClientException); +} + +static int +ProcXF86MiscGetFilePaths(client) + register ClientPtr client; +{ + xXF86MiscGetFilePathsReply rep; + const char *configfile; + const char *modulepath; + const char *logfile; + register int n; + + DEBUG_P("XF86MiscGetFilePaths"); + + REQUEST_SIZE_MATCH(xXF86MiscGetFilePathsReq); + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + + if (!MiscExtGetFilePaths(&configfile, &modulepath, &logfile)) + return BadValue; + + rep.configlen = (configfile? strlen(configfile): 0); + rep.modulelen = (modulepath? strlen(modulepath): 0); + rep.loglen = (logfile? strlen(logfile): 0); + rep.length = (SIZEOF(xXF86MiscGetFilePathsReply) - SIZEOF(xGenericReply) + + ((rep.configlen + 3) & ~3) + + ((rep.modulelen + 3) & ~3) + + ((rep.loglen + 3) & ~3) ) >> 2; + + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swaps(&rep.configlen, n); + swaps(&rep.modulelen, n); + swaps(&rep.loglen, n); + } + WriteToClient(client, SIZEOF(xXF86MiscGetFilePathsReply), (char *)&rep); + + if (rep.configlen) + WriteToClient(client, rep.configlen, (char *)configfile); + if (rep.modulelen) + WriteToClient(client, rep.modulelen, (char *)modulepath); + if (rep.loglen) + WriteToClient(client, rep.loglen, (char *)logfile); + + return (client->noClientException); +} + +static int +ProcXF86MiscDispatch (client) + register ClientPtr client; +{ + REQUEST(xReq); + switch (stuff->data) + { + case X_XF86MiscQueryVersion: + return ProcXF86MiscQueryVersion(client); +#ifdef _XF86MISC_SAVER_COMPAT_ + case X_XF86MiscGetSaver: + return ProcXF86MiscGetSaver(client); + case X_XF86MiscSetSaver: + return ProcXF86MiscSetSaver(client); +#endif + case X_XF86MiscGetMouseSettings: + return ProcXF86MiscGetMouseSettings(client); + case X_XF86MiscGetKbdSettings: + return ProcXF86MiscGetKbdSettings(client); + case X_XF86MiscSetClientVersion: + return ProcXF86MiscSetClientVersion(client); + case X_XF86MiscGetFilePaths: + return ProcXF86MiscGetFilePaths(client); + default: + if (!xf86GetModInDevEnabled()) + return miscErrorBase + XF86MiscModInDevDisabled; + if (xf86GetModInDevAllowNonLocal() || LocalClient (client)) { + switch (stuff->data) { + case X_XF86MiscSetMouseSettings: + return ProcXF86MiscSetMouseSettings(client); + case X_XF86MiscSetKbdSettings: + return ProcXF86MiscSetKbdSettings(client); + case X_XF86MiscSetGrabKeysState: + return ProcXF86MiscSetGrabKeysState(client); + default: + return BadRequest; + } + } else + return miscErrorBase + XF86MiscModInDevClientNotLocal; + } +} + +static int +SProcXF86MiscQueryVersion(client) + register ClientPtr client; +{ + register int n; + REQUEST(xXF86MiscQueryVersionReq); + swaps(&stuff->length, n); + return ProcXF86MiscQueryVersion(client); +} + +#ifdef _XF86MISC_SAVER_COMPAT_ +static int +SProcXF86MiscGetSaver(client) + ClientPtr client; +{ + register int n; + REQUEST(xXF86MiscGetSaverReq); + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xXF86MiscGetSaverReq); + swaps(&stuff->screen, n); + return ProcXF86MiscGetSaver(client); +} + +static int +SProcXF86MiscSetSaver(client) + ClientPtr client; +{ + register int n; + REQUEST(xXF86MiscSetSaverReq); + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xXF86MiscSetSaverReq); + swaps(&stuff->screen, n); + swapl(&stuff->suspendTime, n); + swapl(&stuff->offTime, n); + return ProcXF86MiscSetSaver(client); +} +#endif /* _XF86MISC_SAVER_COMPAT_ */ + +static int +SProcXF86MiscGetMouseSettings(client) + ClientPtr client; +{ + register int n; + REQUEST(xXF86MiscGetMouseSettingsReq); + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xXF86MiscGetMouseSettingsReq); + return ProcXF86MiscGetMouseSettings(client); +} + +static int +SProcXF86MiscGetKbdSettings(client) + ClientPtr client; +{ + register int n; + REQUEST(xXF86MiscGetKbdSettingsReq); + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xXF86MiscGetKbdSettingsReq); + return ProcXF86MiscGetKbdSettings(client); +} + +static int +SProcXF86MiscSetMouseSettings(client) + ClientPtr client; +{ + register int n; + REQUEST(xXF86MiscSetMouseSettingsReq); + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xXF86MiscSetMouseSettingsReq); + swapl(&stuff->mousetype, n); + swapl(&stuff->baudrate, n); + swapl(&stuff->samplerate, n); + swapl(&stuff->resolution, n); + swapl(&stuff->buttons, n); + swapl(&stuff->emulate3timeout, n); + swapl(&stuff->flags, n); + return ProcXF86MiscSetMouseSettings(client); +} + +static int +SProcXF86MiscSetKbdSettings(client) + ClientPtr client; +{ + register int n; + REQUEST(xXF86MiscSetKbdSettingsReq); + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xXF86MiscSetKbdSettingsReq); + swapl(&stuff->kbdtype, n); + swapl(&stuff->rate, n); + swapl(&stuff->delay, n); + return ProcXF86MiscSetKbdSettings(client); +} + +static int +SProcXF86MiscSetGrabKeysState(client) + ClientPtr client; +{ + register int n; + REQUEST(xXF86MiscSetGrabKeysStateReq); + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xXF86MiscSetGrabKeysStateReq); + swaps(&stuff->enable, n); + return ProcXF86MiscSetGrabKeysState(client); +} + +static int +SProcXF86MiscSetClientVersion(ClientPtr client) +{ + register int n; + REQUEST(xXF86MiscSetClientVersionReq); + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xXF86MiscSetClientVersionReq); + swaps(&stuff->major, n); + swaps(&stuff->minor, n); + return ProcXF86MiscSetClientVersion(client); +} + +static int +SProcXF86MiscGetFilePaths(client) + ClientPtr client; +{ + register int n; + REQUEST(xXF86MiscGetFilePathsReq); + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xXF86MiscGetFilePathsReq); + return ProcXF86MiscGetFilePaths(client); +} + +static int +SProcXF86MiscDispatch (client) + register ClientPtr client; +{ + REQUEST(xReq); + switch (stuff->data) + { + case X_XF86MiscQueryVersion: + return SProcXF86MiscQueryVersion(client); +#ifdef _XF86MISC_SAVER_COMPAT_ + case X_XF86MiscGetSaver: + return SProcXF86MiscGetSaver(client); + case X_XF86MiscSetSaver: + return SProcXF86MiscSetSaver(client); +#endif + case X_XF86MiscGetMouseSettings: + return SProcXF86MiscGetMouseSettings(client); + case X_XF86MiscGetKbdSettings: + return SProcXF86MiscGetKbdSettings(client); + case X_XF86MiscSetClientVersion: + return SProcXF86MiscSetClientVersion(client); + case X_XF86MiscGetFilePaths: + return SProcXF86MiscGetFilePaths(client); + default: + if (!xf86GetModInDevEnabled()) + return miscErrorBase + XF86MiscModInDevDisabled; + if (xf86GetModInDevAllowNonLocal() || LocalClient (client)) { + switch (stuff->data) { + case X_XF86MiscSetMouseSettings: + return SProcXF86MiscSetMouseSettings(client); + case X_XF86MiscSetKbdSettings: + return SProcXF86MiscSetKbdSettings(client); + case X_XF86MiscSetGrabKeysState: + return SProcXF86MiscSetGrabKeysState(client); + default: + return BadRequest; + } + } else + return miscErrorBase + XF86MiscModInDevClientNotLocal; + } +} + diff --git a/hw/xfree86/dixmods/extmod/xf86miscproc.h b/hw/xfree86/dixmods/extmod/xf86miscproc.h new file mode 100644 index 000000000..63db938d1 --- /dev/null +++ b/hw/xfree86/dixmods/extmod/xf86miscproc.h @@ -0,0 +1,64 @@ +/* $XFree86: xc/programs/Xserver/Xext/xf86miscproc.h,v 1.5 2002/11/20 04:04:58 dawes Exp $ */ + +/* Prototypes for Pointer/Keyboard functions that the DDX must provide */ + +#ifndef _XF86MISCPROC_H_ +#define _XF86MISCPROC_H_ + +typedef enum { + MISC_MSE_PROTO, + MISC_MSE_BAUDRATE, + MISC_MSE_SAMPLERATE, + MISC_MSE_RESOLUTION, + MISC_MSE_BUTTONS, + MISC_MSE_EM3BUTTONS, + MISC_MSE_EM3TIMEOUT, + MISC_MSE_CHORDMIDDLE, + MISC_MSE_FLAGS +} MiscExtMseValType; + +typedef enum { + MISC_KBD_TYPE, + MISC_KBD_RATE, + MISC_KBD_DELAY, + MISC_KBD_SERVNUMLOCK +} MiscExtKbdValType; + +typedef enum { + MISC_RET_SUCCESS, + MISC_RET_BADVAL, + MISC_RET_BADMSEPROTO, + MISC_RET_BADBAUDRATE, + MISC_RET_BADFLAGS, + MISC_RET_BADCOMBO, + MISC_RET_BADKBDTYPE, + MISC_RET_NOMODULE +} MiscExtReturn; + +typedef enum { + MISC_POINTER, + MISC_KEYBOARD +} MiscExtStructType; + +#define MISC_MSEFLAG_CLEARDTR 1 +#define MISC_MSEFLAG_CLEARRTS 2 +#define MISC_MSEFLAG_REOPEN 128 + +void XFree86MiscExtensionInit(void); + +Bool MiscExtGetMouseSettings(pointer *mouse, char **devname); +int MiscExtGetMouseValue(pointer mouse, MiscExtMseValType valtype); +Bool MiscExtSetMouseValue(pointer mouse, MiscExtMseValType valtype, int value); +Bool MiscExtGetKbdSettings(pointer *kbd); +int MiscExtGetKbdValue(pointer kbd, MiscExtKbdValType valtype); +Bool MiscExtSetKbdValue(pointer kbd, MiscExtKbdValType valtype, int value); +int MiscExtSetGrabKeysState(ClientPtr client, int enable); +pointer MiscExtCreateStruct(MiscExtStructType mse_or_kbd); +void MiscExtDestroyStruct(pointer structure, MiscExtStructType mse_or_kbd); +MiscExtReturn MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd); +Bool MiscExtSetMouseDevice(pointer mouse, char* device); +Bool MiscExtGetFilePaths(const char **configfile, const char **modulepath, + const char **logfile); + +#endif + diff --git a/hw/xfree86/dixmods/extmod/xvmod.c b/hw/xfree86/dixmods/extmod/xvmod.c new file mode 100644 index 000000000..4a9c461f6 --- /dev/null +++ b/hw/xfree86/dixmods/extmod/xvmod.c @@ -0,0 +1,20 @@ +/* $XFree86: xc/programs/Xserver/Xext/xvmod.c,v 1.2 2001/03/05 04:51:55 mvojkovi Exp $ */ + +#include "X.h" +#include "misc.h" +#include "scrnintstr.h" +#include "gc.h" +#include "Xv.h" +#include "Xvproto.h" +#include "xvdix.h" +#include "xvmodproc.h" + +void +XvRegister() +{ + XvScreenInitProc = XvScreenInit; + XvGetScreenIndexProc = XvGetScreenIndex; + XvGetRTPortProc = XvGetRTPort; + XvMCScreenInitProc = XvMCScreenInit; +} + diff --git a/hw/xfree86/dixmods/extmod/xvmodproc.h b/hw/xfree86/dixmods/extmod/xvmodproc.h new file mode 100644 index 000000000..2dcbd472a --- /dev/null +++ b/hw/xfree86/dixmods/extmod/xvmodproc.h @@ -0,0 +1,10 @@ +/* $XFree86: xc/programs/Xserver/Xext/xvmodproc.h,v 1.3 2001/04/08 16:33:22 dawes Exp $ */ + +#include "xvmcext.h" + +extern int (*XvGetScreenIndexProc)(void); +extern unsigned long (*XvGetRTPortProc)(void); +extern int (*XvScreenInitProc)(ScreenPtr); +extern int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr); + +extern void XvRegister(void); diff --git a/hw/xfree86/dixmods/fbmodule.c b/hw/xfree86/dixmods/fbmodule.c new file mode 100644 index 000000000..2b9c50408 --- /dev/null +++ b/hw/xfree86/dixmods/fbmodule.c @@ -0,0 +1,49 @@ +/* + * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * 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 + * XFREE86 PROJECT 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 XFree86 Project 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 + * XFree86 Project. + */ +/* $XFree86: xc/programs/Xserver/fb/fbmodule.c,v 1.3 2000/02/14 19:20:29 dawes Exp $ */ + +#ifdef XFree86LOADER + +#include "xf86Module.h" +#include "fb.h" + +static XF86ModuleVersionInfo VersRec = +{ + "fb", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_ANSIC, /* Only need the ansic layer */ + ABI_ANSIC_VERSION, + MOD_CLASS_NONE, + {0,0,0,0} /* signature, to be patched into the file by a tool */ +}; + +XF86ModuleData fbModuleData = { &VersRec, NULL, NULL }; + +#endif diff --git a/hw/xfree86/dixmods/ftmodule.c b/hw/xfree86/dixmods/ftmodule.c new file mode 100644 index 000000000..e44c94984 --- /dev/null +++ b/hw/xfree86/dixmods/ftmodule.c @@ -0,0 +1,72 @@ +/* + * Copyright (C) 1998-2002 The XFree86 Project, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * 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 + * XFREE86 PROJECT 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 XFree86 Project 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 + * XFree86 Project. + */ +/* $XFree86: xc/lib/font/FreeType/module/ftmodule.c,v 1.14 2003/02/13 03:01:45 dawes Exp $ */ + +#include "misc.h" + +#include "fontmod.h" +#include "xf86Module.h" + +static MODULESETUPPROTO(freetypeSetup); + + /* + * This is the module data function that is accessed when loading + * libfreetype as a module. + */ + +static XF86ModuleVersionInfo VersRec = +{ + "freetype", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 2, 0, 2, + ABI_CLASS_FONT, /* Font module */ + ABI_FONT_VERSION, + MOD_CLASS_FONT, + {0,0,0,0} /* signature, to be patched into the file by a tool */ +}; + +XF86ModuleData freetypeModuleData = { &VersRec, freetypeSetup, NULL }; + +extern void FreeTypeRegisterFontFileFunctions(void); + +FontModule freetypeModule = { + FreeTypeRegisterFontFileFunctions, + "FreeType", + NULL +}; + +static pointer +freetypeSetup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + freetypeModule.module = module; + LoadFont(&freetypeModule); + + /* Need a non-NULL return */ + return (pointer)1; +} diff --git a/hw/xfree86/dixmods/glxmodule.c b/hw/xfree86/dixmods/glxmodule.c new file mode 100644 index 000000000..513bb7647 --- /dev/null +++ b/hw/xfree86/dixmods/glxmodule.c @@ -0,0 +1,1253 @@ + +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) 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 NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. + +**************************************************************************/ +/* $XFree86: xc/programs/Xserver/GL/glxmodule.c,v 1.11 2001/06/15 21:22:38 dawes Exp $ */ + +/* + * Authors: + * Kevin E. Martin <kevin@precisioninsight.com> + * + */ + +#include "xf86Module.h" +#include "colormap.h" +#include "micmap.h" + +static MODULESETUPPROTO(glxSetup); + +extern void GlxExtensionInit(INITARGS); +extern void GlxWrapInitVisuals(miInitVisualsProcPtr *); +extern void InitGlxWrapInitVisuals(void (*f)(miInitVisualsProcPtr *)); + +static const char *initdeps[] = { "DOUBLE-BUFFER", NULL }; + +ExtensionModule GLXExt = +{ + GlxExtensionInit, + "GLX", + NULL, + NULL, + initdeps +}; + +static const char *glcoreSymbols[] = { + "__glCallLists_size", + "__glColorTableParameterfv_size", + "__glColorTableParameteriv_size", + "__glConvolutionParameterfv_size", + "__glConvolutionParameteriv_size", + "__glDDXExtensionInfo", + "__glDDXScreenInfo", + "__glEvalComputeK", + "__glFloorLog2", + "__glFogfv_size", + "__glFogiv_size", + "__glGetBooleanv_size", + "__glGetColorTableParameterfv_size", + "__glGetColorTableParameteriv_size", + "__glGetConvolutionParameterfv_size", + "__glGetConvolutionParameteriv_size", + "__glGetDoublev_size", + "__glGetFloatv_size", + "__glGetHistogramParameterfv_size", + "__glGetHistogramParameteriv_size", + "__glGetIntegerv_size", + "__glGetLightfv_size", + "__glGetLightiv_size", + "__glGetMapdv_size", + "__glGetMapfv_size", + "__glGetMapiv_size", + "__glGetMaterialfv_size", + "__glGetMaterialiv_size", + "__glGetMinmaxParameterfv_size", + "__glGetMinmaxParameteriv_size", + "__glGetPixelMapfv_size", + "__glGetPixelMapuiv_size", + "__glGetPixelMapusv_size", + "__glGetTexEnvfv_size", + "__glGetTexEnviv_size", + "__glGetTexGendv_size", + "__glGetTexGenfv_size", + "__glGetTexGeniv_size", + "__glGetTexImage_size", + "__glGetTexLevelParameterfv_size", + "__glGetTexLevelParameteriv_size", + "__glGetTexParameterfv_size", + "__glGetTexParameteriv_size", + "__glLightModelfv_size", + "__glLightModeliv_size", + "__glLightfv_size", + "__glLightiv_size", + "__glMaterialfv_size", + "__glMaterialiv_size", + "__glReadPixels_size", + "__glTexEnvfv_size", + "__glTexEnviv_size", + "__glTexGendv_size", + "__glTexGenfv_size", + "__glTexGeniv_size", + "__glTexParameterfv_size", + "__glTexParameteriv_size", + "__glXActiveScreens", + "__glXAssociateContext", + "__glXBadContext", + "__glXBadContextState", + "__glXBadContextTag", + "__glXBadCurrentWindow", + "__glXBadDrawable", + "__glXBadLargeRequest", + "__glXBadPixmap", + "__glXBadRenderRequest", + "__glXBitmapReqSize", + "__glXCacheDrawableSize", + "__glXCallListsReqSize", + "__glXClearErrorOccured", + "__glXClientInfo", + "__glXClientRes", + "__glXClients", + "__glXColorSubTableReqSize", + "__glXColorTableParameterfvReqSize", + "__glXColorTableParameterivReqSize", + "__glXColorTableReqSize", + "__glXContextRes", + "__glXConvolutionFilter1DReqSize", + "__glXConvolutionFilter2DReqSize", + "__glXConvolutionParameterfvReqSize", + "__glXConvolutionParameterivReqSize", + "__glXCopyContext", + "__glXCoreType", + "__glXCreateContext", + "__glXCreateGLXPixmap", + "__glXDeassociateContext", + "__glXDestroyContext", + "__glXDestroyGLXPixmap", + "__glXDispSwap_Accum", + "__glXDispSwap_ActiveTextureARB", + "__glXDispSwap_AlphaFunc", + "__glXDispSwap_AreTexturesResident", + "__glXDispSwap_AreTexturesResidentEXT", + "__glXDispSwap_Begin", + "__glXDispSwap_BindTexture", + "__glXDispSwap_Bitmap", + "__glXDispSwap_BlendColor", + "__glXDispSwap_BlendEquation", + "__glXDispSwap_BlendFunc", + "__glXDispSwap_CallList", + "__glXDispSwap_CallLists", + "__glXDispSwap_Clear", + "__glXDispSwap_ClearAccum", + "__glXDispSwap_ClearColor", + "__glXDispSwap_ClearDepth", + "__glXDispSwap_ClearIndex", + "__glXDispSwap_ClearStencil", + "__glXDispSwap_ClipPlane", + "__glXDispSwap_Color3bv", + "__glXDispSwap_Color3dv", + "__glXDispSwap_Color3fv", + "__glXDispSwap_Color3iv", + "__glXDispSwap_Color3sv", + "__glXDispSwap_Color3ubv", + "__glXDispSwap_Color3uiv", + "__glXDispSwap_Color3usv", + "__glXDispSwap_Color4bv", + "__glXDispSwap_Color4dv", + "__glXDispSwap_Color4fv", + "__glXDispSwap_Color4iv", + "__glXDispSwap_Color4sv", + "__glXDispSwap_Color4ubv", + "__glXDispSwap_Color4uiv", + "__glXDispSwap_Color4usv", + "__glXDispSwap_ColorMask", + "__glXDispSwap_ColorMaterial", + "__glXDispSwap_ColorSubTable", + "__glXDispSwap_ColorTable", + "__glXDispSwap_ColorTableParameterfv", + "__glXDispSwap_ColorTableParameteriv", + "__glXDispSwap_ConvolutionFilter1D", + "__glXDispSwap_ConvolutionFilter2D", + "__glXDispSwap_ConvolutionParameterf", + "__glXDispSwap_ConvolutionParameterfv", + "__glXDispSwap_ConvolutionParameteri", + "__glXDispSwap_ConvolutionParameteriv", + "__glXDispSwap_CopyColorSubTable", + "__glXDispSwap_CopyColorTable", + "__glXDispSwap_CopyConvolutionFilter1D", + "__glXDispSwap_CopyConvolutionFilter2D", + "__glXDispSwap_CopyPixels", + "__glXDispSwap_CopyTexImage1D", + "__glXDispSwap_CopyTexImage2D", + "__glXDispSwap_CopyTexSubImage1D", + "__glXDispSwap_CopyTexSubImage2D", + "__glXDispSwap_CopyTexSubImage3D", + "__glXDispSwap_CullFace", + "__glXDispSwap_DeleteLists", + "__glXDispSwap_DeleteTextures", + "__glXDispSwap_DeleteTexturesEXT", + "__glXDispSwap_DepthFunc", + "__glXDispSwap_DepthMask", + "__glXDispSwap_DepthRange", + "__glXDispSwap_Disable", + "__glXDispSwap_DrawArrays", + "__glXDispSwap_DrawArraysEXT", + "__glXDispSwap_DrawBuffer", + "__glXDispSwap_DrawPixels", + "__glXDispSwap_EdgeFlagv", + "__glXDispSwap_Enable", + "__glXDispSwap_End", + "__glXDispSwap_EndList", + "__glXDispSwap_EvalCoord1dv", + "__glXDispSwap_EvalCoord1fv", + "__glXDispSwap_EvalCoord2dv", + "__glXDispSwap_EvalCoord2fv", + "__glXDispSwap_EvalMesh1", + "__glXDispSwap_EvalMesh2", + "__glXDispSwap_EvalPoint1", + "__glXDispSwap_EvalPoint2", + "__glXDispSwap_FeedbackBuffer", + "__glXDispSwap_Finish", + "__glXDispSwap_Flush", + "__glXDispSwap_Fogf", + "__glXDispSwap_Fogfv", + "__glXDispSwap_Fogi", + "__glXDispSwap_Fogiv", + "__glXDispSwap_FrontFace", + "__glXDispSwap_Frustum", + "__glXDispSwap_GenLists", + "__glXDispSwap_GenTextures", + "__glXDispSwap_GenTexturesEXT", + "__glXDispSwap_GetBooleanv", + "__glXDispSwap_GetClipPlane", + "__glXDispSwap_GetColorTable", + "__glXDispSwap_GetColorTableParameterfv", + "__glXDispSwap_GetColorTableParameteriv", + "__glXDispSwap_GetConvolutionFilter", + "__glXDispSwap_GetConvolutionParameterfv", + "__glXDispSwap_GetConvolutionParameteriv", + "__glXDispSwap_GetDoublev", + "__glXDispSwap_GetError", + "__glXDispSwap_GetFloatv", + "__glXDispSwap_GetHistogram", + "__glXDispSwap_GetHistogramParameterfv", + "__glXDispSwap_GetHistogramParameteriv", + "__glXDispSwap_GetIntegerv", + "__glXDispSwap_GetLightfv", + "__glXDispSwap_GetLightiv", + "__glXDispSwap_GetMapdv", + "__glXDispSwap_GetMapfv", + "__glXDispSwap_GetMapiv", + "__glXDispSwap_GetMaterialfv", + "__glXDispSwap_GetMaterialiv", + "__glXDispSwap_GetMinmax", + "__glXDispSwap_GetMinmaxParameterfv", + "__glXDispSwap_GetMinmaxParameteriv", + "__glXDispSwap_GetPixelMapfv", + "__glXDispSwap_GetPixelMapuiv", + "__glXDispSwap_GetPixelMapusv", + "__glXDispSwap_GetPolygonStipple", + "__glXDispSwap_GetSeparableFilter", + "__glXDispSwap_GetString", + "__glXDispSwap_GetTexEnvfv", + "__glXDispSwap_GetTexEnviv", + "__glXDispSwap_GetTexGendv", + "__glXDispSwap_GetTexGenfv", + "__glXDispSwap_GetTexGeniv", + "__glXDispSwap_GetTexImage", + "__glXDispSwap_GetTexLevelParameterfv", + "__glXDispSwap_GetTexLevelParameteriv", + "__glXDispSwap_GetTexParameterfv", + "__glXDispSwap_GetTexParameteriv", + "__glXDispSwap_Hint", + "__glXDispSwap_Histogram", + "__glXDispSwap_IndexMask", + "__glXDispSwap_Indexdv", + "__glXDispSwap_Indexfv", + "__glXDispSwap_Indexiv", + "__glXDispSwap_Indexsv", + "__glXDispSwap_Indexubv", + "__glXDispSwap_InitNames", + "__glXDispSwap_IsEnabled", + "__glXDispSwap_IsList", + "__glXDispSwap_IsTexture", + "__glXDispSwap_IsTextureEXT", + "__glXDispSwap_LightModelf", + "__glXDispSwap_LightModelfv", + "__glXDispSwap_LightModeli", + "__glXDispSwap_LightModeliv", + "__glXDispSwap_Lightf", + "__glXDispSwap_Lightfv", + "__glXDispSwap_Lighti", + "__glXDispSwap_Lightiv", + "__glXDispSwap_LineStipple", + "__glXDispSwap_LineWidth", + "__glXDispSwap_ListBase", + "__glXDispSwap_LoadIdentity", + "__glXDispSwap_LoadMatrixd", + "__glXDispSwap_LoadMatrixf", + "__glXDispSwap_LoadName", + "__glXDispSwap_LogicOp", + "__glXDispSwap_Map1d", + "__glXDispSwap_Map1f", + "__glXDispSwap_Map2d", + "__glXDispSwap_Map2f", + "__glXDispSwap_MapGrid1d", + "__glXDispSwap_MapGrid1f", + "__glXDispSwap_MapGrid2d", + "__glXDispSwap_MapGrid2f", + "__glXDispSwap_Materialf", + "__glXDispSwap_Materialfv", + "__glXDispSwap_Materiali", + "__glXDispSwap_Materialiv", + "__glXDispSwap_MatrixMode", + "__glXDispSwap_Minmax", + "__glXDispSwap_MultMatrixd", + "__glXDispSwap_MultMatrixf", + "__glXDispSwap_MultiTexCoord1dvARB", + "__glXDispSwap_MultiTexCoord1fvARB", + "__glXDispSwap_MultiTexCoord1ivARB", + "__glXDispSwap_MultiTexCoord1svARB", + "__glXDispSwap_MultiTexCoord2dvARB", + "__glXDispSwap_MultiTexCoord2fvARB", + "__glXDispSwap_MultiTexCoord2ivARB", + "__glXDispSwap_MultiTexCoord2svARB", + "__glXDispSwap_MultiTexCoord3dvARB", + "__glXDispSwap_MultiTexCoord3fvARB", + "__glXDispSwap_MultiTexCoord3ivARB", + "__glXDispSwap_MultiTexCoord3svARB", + "__glXDispSwap_MultiTexCoord4dvARB", + "__glXDispSwap_MultiTexCoord4fvARB", + "__glXDispSwap_MultiTexCoord4ivARB", + "__glXDispSwap_MultiTexCoord4svARB", + "__glXDispSwap_NewList", + "__glXDispSwap_Normal3bv", + "__glXDispSwap_Normal3dv", + "__glXDispSwap_Normal3fv", + "__glXDispSwap_Normal3iv", + "__glXDispSwap_Normal3sv", + "__glXDispSwap_Ortho", + "__glXDispSwap_PassThrough", + "__glXDispSwap_PixelMapfv", + "__glXDispSwap_PixelMapuiv", + "__glXDispSwap_PixelMapusv", + "__glXDispSwap_PixelStoref", + "__glXDispSwap_PixelStorei", + "__glXDispSwap_PixelTransferf", + "__glXDispSwap_PixelTransferi", + "__glXDispSwap_PixelZoom", + "__glXDispSwap_PointSize", + "__glXDispSwap_PolygonMode", + "__glXDispSwap_PolygonOffset", + "__glXDispSwap_PolygonStipple", + "__glXDispSwap_PopAttrib", + "__glXDispSwap_PopMatrix", + "__glXDispSwap_PopName", + "__glXDispSwap_PrioritizeTextures", + "__glXDispSwap_PushAttrib", + "__glXDispSwap_PushMatrix", + "__glXDispSwap_PushName", + "__glXDispSwap_RasterPos2dv", + "__glXDispSwap_RasterPos2fv", + "__glXDispSwap_RasterPos2iv", + "__glXDispSwap_RasterPos2sv", + "__glXDispSwap_RasterPos3dv", + "__glXDispSwap_RasterPos3fv", + "__glXDispSwap_RasterPos3iv", + "__glXDispSwap_RasterPos3sv", + "__glXDispSwap_RasterPos4dv", + "__glXDispSwap_RasterPos4fv", + "__glXDispSwap_RasterPos4iv", + "__glXDispSwap_RasterPos4sv", + "__glXDispSwap_ReadBuffer", + "__glXDispSwap_ReadPixels", + "__glXDispSwap_Rectdv", + "__glXDispSwap_Rectfv", + "__glXDispSwap_Rectiv", + "__glXDispSwap_Rectsv", + "__glXDispSwap_RenderMode", + "__glXDispSwap_ResetHistogram", + "__glXDispSwap_ResetMinmax", + "__glXDispSwap_Rotated", + "__glXDispSwap_Rotatef", + "__glXDispSwap_Scaled", + "__glXDispSwap_Scalef", + "__glXDispSwap_Scissor", + "__glXDispSwap_SelectBuffer", + "__glXDispSwap_SeparableFilter2D", + "__glXDispSwap_ShadeModel", + "__glXDispSwap_StencilFunc", + "__glXDispSwap_StencilMask", + "__glXDispSwap_StencilOp", + "__glXDispSwap_TexCoord1dv", + "__glXDispSwap_TexCoord1fv", + "__glXDispSwap_TexCoord1iv", + "__glXDispSwap_TexCoord1sv", + "__glXDispSwap_TexCoord2dv", + "__glXDispSwap_TexCoord2fv", + "__glXDispSwap_TexCoord2iv", + "__glXDispSwap_TexCoord2sv", + "__glXDispSwap_TexCoord3dv", + "__glXDispSwap_TexCoord3fv", + "__glXDispSwap_TexCoord3iv", + "__glXDispSwap_TexCoord3sv", + "__glXDispSwap_TexCoord4dv", + "__glXDispSwap_TexCoord4fv", + "__glXDispSwap_TexCoord4iv", + "__glXDispSwap_TexCoord4sv", + "__glXDispSwap_TexEnvf", + "__glXDispSwap_TexEnvfv", + "__glXDispSwap_TexEnvi", + "__glXDispSwap_TexEnviv", + "__glXDispSwap_TexGend", + "__glXDispSwap_TexGendv", + "__glXDispSwap_TexGenf", + "__glXDispSwap_TexGenfv", + "__glXDispSwap_TexGeni", + "__glXDispSwap_TexGeniv", + "__glXDispSwap_TexImage1D", + "__glXDispSwap_TexImage2D", + "__glXDispSwap_TexImage3D", + "__glXDispSwap_TexParameterf", + "__glXDispSwap_TexParameterfv", + "__glXDispSwap_TexParameteri", + "__glXDispSwap_TexParameteriv", + "__glXDispSwap_TexSubImage1D", + "__glXDispSwap_TexSubImage2D", + "__glXDispSwap_TexSubImage3D", + "__glXDispSwap_Translated", + "__glXDispSwap_Translatef", + "__glXDispSwap_Vertex2dv", + "__glXDispSwap_Vertex2fv", + "__glXDispSwap_Vertex2iv", + "__glXDispSwap_Vertex2sv", + "__glXDispSwap_Vertex3dv", + "__glXDispSwap_Vertex3fv", + "__glXDispSwap_Vertex3iv", + "__glXDispSwap_Vertex3sv", + "__glXDispSwap_Vertex4dv", + "__glXDispSwap_Vertex4fv", + "__glXDispSwap_Vertex4iv", + "__glXDispSwap_Vertex4sv", + "__glXDispSwap_Viewport", + "__glXDisp_Accum", + "__glXDisp_ActiveTextureARB", + "__glXDisp_AlphaFunc", + "__glXDisp_AreTexturesResident", + "__glXDisp_AreTexturesResidentEXT", + "__glXDisp_Begin", + "__glXDisp_BindTexture", + "__glXDisp_Bitmap", + "__glXDisp_BlendColor", + "__glXDisp_BlendEquation", + "__glXDisp_BlendFunc", + "__glXDisp_CallList", + "__glXDisp_CallLists", + "__glXDisp_Clear", + "__glXDisp_ClearAccum", + "__glXDisp_ClearColor", + "__glXDisp_ClearDepth", + "__glXDisp_ClearIndex", + "__glXDisp_ClearStencil", + "__glXDisp_ClipPlane", + "__glXDisp_Color3bv", + "__glXDisp_Color3dv", + "__glXDisp_Color3fv", + "__glXDisp_Color3iv", + "__glXDisp_Color3sv", + "__glXDisp_Color3ubv", + "__glXDisp_Color3uiv", + "__glXDisp_Color3usv", + "__glXDisp_Color4bv", + "__glXDisp_Color4dv", + "__glXDisp_Color4fv", + "__glXDisp_Color4iv", + "__glXDisp_Color4sv", + "__glXDisp_Color4ubv", + "__glXDisp_Color4uiv", + "__glXDisp_Color4usv", + "__glXDisp_ColorMask", + "__glXDisp_ColorMaterial", + "__glXDisp_ColorSubTable", + "__glXDisp_ColorTable", + "__glXDisp_ColorTableParameterfv", + "__glXDisp_ColorTableParameteriv", + "__glXDisp_ConvolutionFilter1D", + "__glXDisp_ConvolutionFilter2D", + "__glXDisp_ConvolutionParameterf", + "__glXDisp_ConvolutionParameterfv", + "__glXDisp_ConvolutionParameteri", + "__glXDisp_ConvolutionParameteriv", + "__glXDisp_CopyColorSubTable", + "__glXDisp_CopyColorTable", + "__glXDisp_CopyConvolutionFilter1D", + "__glXDisp_CopyConvolutionFilter2D", + "__glXDisp_CopyPixels", + "__glXDisp_CopyTexImage1D", + "__glXDisp_CopyTexImage2D", + "__glXDisp_CopyTexSubImage1D", + "__glXDisp_CopyTexSubImage2D", + "__glXDisp_CopyTexSubImage3D", + "__glXDisp_CullFace", + "__glXDisp_DeleteLists", + "__glXDisp_DeleteTextures", + "__glXDisp_DeleteTexturesEXT", + "__glXDisp_DepthFunc", + "__glXDisp_DepthMask", + "__glXDisp_DepthRange", + "__glXDisp_Disable", + "__glXDisp_DrawArrays", + "__glXDisp_DrawArraysEXT", + "__glXDisp_DrawBuffer", + "__glXDisp_DrawPixels", + "__glXDisp_EdgeFlagv", + "__glXDisp_Enable", + "__glXDisp_End", + "__glXDisp_EndList", + "__glXDisp_EvalCoord1dv", + "__glXDisp_EvalCoord1fv", + "__glXDisp_EvalCoord2dv", + "__glXDisp_EvalCoord2fv", + "__glXDisp_EvalMesh1", + "__glXDisp_EvalMesh2", + "__glXDisp_EvalPoint1", + "__glXDisp_EvalPoint2", + "__glXDisp_FeedbackBuffer", + "__glXDisp_Finish", + "__glXDisp_Flush", + "__glXDisp_Fogf", + "__glXDisp_Fogfv", + "__glXDisp_Fogi", + "__glXDisp_Fogiv", + "__glXDisp_FrontFace", + "__glXDisp_Frustum", + "__glXDisp_GenLists", + "__glXDisp_GenTextures", + "__glXDisp_GenTexturesEXT", + "__glXDisp_GetBooleanv", + "__glXDisp_GetClipPlane", + "__glXDisp_GetColorTable", + "__glXDisp_GetColorTableParameterfv", + "__glXDisp_GetColorTableParameteriv", + "__glXDisp_GetConvolutionFilter", + "__glXDisp_GetConvolutionParameterfv", + "__glXDisp_GetConvolutionParameteriv", + "__glXDisp_GetDoublev", + "__glXDisp_GetError", + "__glXDisp_GetFloatv", + "__glXDisp_GetHistogram", + "__glXDisp_GetHistogramParameterfv", + "__glXDisp_GetHistogramParameteriv", + "__glXDisp_GetIntegerv", + "__glXDisp_GetLightfv", + "__glXDisp_GetLightiv", + "__glXDisp_GetMapdv", + "__glXDisp_GetMapfv", + "__glXDisp_GetMapiv", + "__glXDisp_GetMaterialfv", + "__glXDisp_GetMaterialiv", + "__glXDisp_GetMinmax", + "__glXDisp_GetMinmaxParameterfv", + "__glXDisp_GetMinmaxParameteriv", + "__glXDisp_GetPixelMapfv", + "__glXDisp_GetPixelMapuiv", + "__glXDisp_GetPixelMapusv", + "__glXDisp_GetPolygonStipple", + "__glXDisp_GetSeparableFilter", + "__glXDisp_GetString", + "__glXDisp_GetTexEnvfv", + "__glXDisp_GetTexEnviv", + "__glXDisp_GetTexGendv", + "__glXDisp_GetTexGenfv", + "__glXDisp_GetTexGeniv", + "__glXDisp_GetTexImage", + "__glXDisp_GetTexLevelParameterfv", + "__glXDisp_GetTexLevelParameteriv", + "__glXDisp_GetTexParameterfv", + "__glXDisp_GetTexParameteriv", + "__glXDisp_Hint", + "__glXDisp_Histogram", + "__glXDisp_IndexMask", + "__glXDisp_Indexdv", + "__glXDisp_Indexfv", + "__glXDisp_Indexiv", + "__glXDisp_Indexsv", + "__glXDisp_Indexubv", + "__glXDisp_InitNames", + "__glXDisp_IsEnabled", + "__glXDisp_IsList", + "__glXDisp_IsTexture", + "__glXDisp_IsTextureEXT", + "__glXDisp_LightModelf", + "__glXDisp_LightModelfv", + "__glXDisp_LightModeli", + "__glXDisp_LightModeliv", + "__glXDisp_Lightf", + "__glXDisp_Lightfv", + "__glXDisp_Lighti", + "__glXDisp_Lightiv", + "__glXDisp_LineStipple", + "__glXDisp_LineWidth", + "__glXDisp_ListBase", + "__glXDisp_LoadIdentity", + "__glXDisp_LoadMatrixd", + "__glXDisp_LoadMatrixf", + "__glXDisp_LoadName", + "__glXDisp_LogicOp", + "__glXDisp_Map1d", + "__glXDisp_Map1f", + "__glXDisp_Map2d", + "__glXDisp_Map2f", + "__glXDisp_MapGrid1d", + "__glXDisp_MapGrid1f", + "__glXDisp_MapGrid2d", + "__glXDisp_MapGrid2f", + "__glXDisp_Materialf", + "__glXDisp_Materialfv", + "__glXDisp_Materiali", + "__glXDisp_Materialiv", + "__glXDisp_MatrixMode", + "__glXDisp_Minmax", + "__glXDisp_MultMatrixd", + "__glXDisp_MultMatrixf", + "__glXDisp_MultiTexCoord1dvARB", + "__glXDisp_MultiTexCoord1fvARB", + "__glXDisp_MultiTexCoord1ivARB", + "__glXDisp_MultiTexCoord1svARB", + "__glXDisp_MultiTexCoord2dvARB", + "__glXDisp_MultiTexCoord2fvARB", + "__glXDisp_MultiTexCoord2ivARB", + "__glXDisp_MultiTexCoord2svARB", + "__glXDisp_MultiTexCoord3dvARB", + "__glXDisp_MultiTexCoord3fvARB", + "__glXDisp_MultiTexCoord3ivARB", + "__glXDisp_MultiTexCoord3svARB", + "__glXDisp_MultiTexCoord4dvARB", + "__glXDisp_MultiTexCoord4fvARB", + "__glXDisp_MultiTexCoord4ivARB", + "__glXDisp_MultiTexCoord4svARB", + "__glXDisp_NewList", + "__glXDisp_Normal3bv", + "__glXDisp_Normal3dv", + "__glXDisp_Normal3fv", + "__glXDisp_Normal3iv", + "__glXDisp_Normal3sv", + "__glXDisp_Ortho", + "__glXDisp_PassThrough", + "__glXDisp_PixelMapfv", + "__glXDisp_PixelMapuiv", + "__glXDisp_PixelMapusv", + "__glXDisp_PixelStoref", + "__glXDisp_PixelStorei", + "__glXDisp_PixelTransferf", + "__glXDisp_PixelTransferi", + "__glXDisp_PixelZoom", + "__glXDisp_PointSize", + "__glXDisp_PolygonMode", + "__glXDisp_PolygonOffset", + "__glXDisp_PolygonStipple", + "__glXDisp_PopAttrib", + "__glXDisp_PopMatrix", + "__glXDisp_PopName", + "__glXDisp_PrioritizeTextures", + "__glXDisp_PushAttrib", + "__glXDisp_PushMatrix", + "__glXDisp_PushName", + "__glXDisp_RasterPos2dv", + "__glXDisp_RasterPos2fv", + "__glXDisp_RasterPos2iv", + "__glXDisp_RasterPos2sv", + "__glXDisp_RasterPos3dv", + "__glXDisp_RasterPos3fv", + "__glXDisp_RasterPos3iv", + "__glXDisp_RasterPos3sv", + "__glXDisp_RasterPos4dv", + "__glXDisp_RasterPos4fv", + "__glXDisp_RasterPos4iv", + "__glXDisp_RasterPos4sv", + "__glXDisp_ReadBuffer", + "__glXDisp_ReadPixels", + "__glXDisp_Rectdv", + "__glXDisp_Rectfv", + "__glXDisp_Rectiv", + "__glXDisp_Rectsv", + "__glXDisp_RenderMode", + "__glXDisp_ResetHistogram", + "__glXDisp_ResetMinmax", + "__glXDisp_Rotated", + "__glXDisp_Rotatef", + "__glXDisp_Scaled", + "__glXDisp_Scalef", + "__glXDisp_Scissor", + "__glXDisp_SelectBuffer", + "__glXDisp_SeparableFilter2D", + "__glXDisp_ShadeModel", + "__glXDisp_StencilFunc", + "__glXDisp_StencilMask", + "__glXDisp_StencilOp", + "__glXDisp_TexCoord1dv", + "__glXDisp_TexCoord1fv", + "__glXDisp_TexCoord1iv", + "__glXDisp_TexCoord1sv", + "__glXDisp_TexCoord2dv", + "__glXDisp_TexCoord2fv", + "__glXDisp_TexCoord2iv", + "__glXDisp_TexCoord2sv", + "__glXDisp_TexCoord3dv", + "__glXDisp_TexCoord3fv", + "__glXDisp_TexCoord3iv", + "__glXDisp_TexCoord3sv", + "__glXDisp_TexCoord4dv", + "__glXDisp_TexCoord4fv", + "__glXDisp_TexCoord4iv", + "__glXDisp_TexCoord4sv", + "__glXDisp_TexEnvf", + "__glXDisp_TexEnvfv", + "__glXDisp_TexEnvi", + "__glXDisp_TexEnviv", + "__glXDisp_TexGend", + "__glXDisp_TexGendv", + "__glXDisp_TexGenf", + "__glXDisp_TexGenfv", + "__glXDisp_TexGeni", + "__glXDisp_TexGeniv", + "__glXDisp_TexImage1D", + "__glXDisp_TexImage2D", + "__glXDisp_TexImage3D", + "__glXDisp_TexParameterf", + "__glXDisp_TexParameterfv", + "__glXDisp_TexParameteri", + "__glXDisp_TexParameteriv", + "__glXDisp_TexSubImage1D", + "__glXDisp_TexSubImage2D", + "__glXDisp_TexSubImage3D", + "__glXDisp_Translated", + "__glXDisp_Translatef", + "__glXDisp_Vertex2dv", + "__glXDisp_Vertex2fv", + "__glXDisp_Vertex2iv", + "__glXDisp_Vertex2sv", + "__glXDisp_Vertex3dv", + "__glXDisp_Vertex3fv", + "__glXDisp_Vertex3iv", + "__glXDisp_Vertex3sv", + "__glXDisp_Vertex4dv", + "__glXDisp_Vertex4fv", + "__glXDisp_Vertex4iv", + "__glXDisp_Vertex4sv", + "__glXDisp_Viewport", + "__glXDrawArraysSize", + "__glXDrawPixelsReqSize", + "__glXDrawableRes", + "__glXErrorOccured", + "__glXFBInitDrawable", + "__glXFBMemSwapBuffers", + "__glXFindDrawablePrivate", + "__glXFogfvReqSize", + "__glXFogivReqSize", + "__glXForceCurrent", + "__glXFormatGLModes", + "__glXFree", + "__glXFreeBuffers", + "__glXFreeContext", + "__glXGetDrawablePrivate", + "__glXGetVisualConfigs", + "__glXImageSize", + "__glXImpAtoi", + "__glXImpCalloc", + "__glXImpFatal", + "__glXImpFclose", + "__glXImpFopen", + "__glXImpFprintf", + "__glXImpFree", + "__glXImpGetDrawablePrivate", + "__glXImpGetenv", + "__glXImpMalloc", + "__glXImpRealloc", + "__glXImpSprintf", + "__glXImpWarning", + "__glXInitFB", + "__glXInitMem", + "__glXInitPix", + "__glXIsDirect", + "__glXLastContext", + "__glXLightModelfvReqSize", + "__glXLightModelivReqSize", + "__glXLightfvReqSize", + "__glXLightivReqSize", + "__glXLookupContextByTag", + "__glXMakeCurrent", + "__glXMalloc", + "__glXMap1dReqSize", + "__glXMap1fReqSize", + "__glXMap2dReqSize", + "__glXMap2fReqSize", + "__glXMaterialfvReqSize", + "__glXMaterialivReqSize", + "__glXNoSuchRenderOpcode", + "__glXNoSuchSingleOpcode", + "__glXNop", + "__glXPixInitDrawable", + "__glXPixelMapfvReqSize", + "__glXPixelMapuivReqSize", + "__glXPixelMapusvReqSize", + "__glXPixmapRes", + "__glXPrioritizeTexturesReqSize", + "__glXQueryContextInfoEXT", + "__glXQueryExtensionsString", + "__glXQueryServerString", + "__glXQueryVersion", + "__glXRealloc", + "__glXRender", + "__glXRenderLarge", + "__glXRenderSizeTable", + "__glXRenderSizeTable_EXT", + "__glXRenderTable", + "__glXRenderTable_EXT", + "__glXReply", + "__glXResetLargeCommandStatus", + "__glXResizeBuffers", + "__glXResizeDrawableBuffers", + "__glXScreenInit", + "__glXScreenReset", + "__glXSeparableFilter2DReqSize", + "__glXSingleTable", + "__glXSwapBuffers", + "__glXSwapClientInfo", + "__glXSwapCopyContext", + "__glXSwapCreateContext", + "__glXSwapCreateGLXPixmap", + "__glXSwapDestroyContext", + "__glXSwapDestroyGLXPixmap", + "__glXSwapGetVisualConfigs", + "__glXSwapIsDirect", + "__glXSwapIsDirectReply", + "__glXSwapMakeCurrent", + "__glXSwapMakeCurrentReply", + "__glXSwapQueryContextInfoEXTReply", + "__glXSwapQueryExtensionsString", + "__glXSwapQueryServerString", + "__glXSwapQueryVersion", + "__glXSwapQueryVersionReply", + "__glXSwapRender", + "__glXSwapRenderLarge", + "__glXSwapRenderTable", + "__glXSwapRenderTable_EXT", + "__glXSwapSingleTable", + "__glXSwapSwapBuffers", + "__glXSwapUseXFont", + "__glXSwapVendorPrivTable_EXT", + "__glXSwapVendorPrivate", + "__glXSwapVendorPrivateWithReply", + "__glXSwapWaitGL", + "__glXSwapWaitX", + "__glXTexEnvfvReqSize", + "__glXTexEnvivReqSize", + "__glXTexGendvReqSize", + "__glXTexGenfvReqSize", + "__glXTexGenivReqSize", + "__glXTexImage1DReqSize", + "__glXTexImage2DReqSize", + "__glXTexImage3DReqSize", + "__glXTexParameterfvReqSize", + "__glXTexParameterivReqSize", + "__glXTexSubImage1DReqSize", + "__glXTexSubImage2DReqSize", + "__glXTexSubImage3DReqSize", + "__glXTypeSize", + "__glXUnrefDrawablePrivate", + "__glXUnsupportedPrivateRequest", + "__glXUseXFont", + "__glXVendorPrivTable_EXT", + "__glXVendorPrivate", + "__glXVendorPrivateWithReply", + "__glXWaitGL", + "__glXWaitX", + "__glXcombine_strings", + "glAccum", + "glActiveTextureARB", + "glAlphaFunc", + "glAreTexturesResident", + "glAreTexturesResidentEXT", + "glBegin", + "glBindTexture", + "glBitmap", + "glBlendColor", + "glBlendEquation", + "glBlendFunc", + "glCallList", + "glCallLists", + "glClear", + "glClearAccum", + "glClearColor", + "glClearDepth", + "glClearIndex", + "glClearStencil", + "glClipPlane", + "glColor3bv", + "glColor3dv", + "glColor3fv", + "glColor3iv", + "glColor3sv", + "glColor3ubv", + "glColor3uiv", + "glColor3usv", + "glColor4bv", + "glColor4dv", + "glColor4fv", + "glColor4iv", + "glColor4sv", + "glColor4ubv", + "glColor4uiv", + "glColor4usv", + "glColorMask", + "glColorMaterial", + "glColorPointer", + "glColorSubTable", + "glColorTable", + "glColorTableParameterfv", + "glColorTableParameteriv", + "glConvolutionFilter1D", + "glConvolutionFilter2D", + "glConvolutionParameterf", + "glConvolutionParameterfv", + "glConvolutionParameteri", + "glConvolutionParameteriv", + "glCopyColorSubTable", + "glCopyColorTable", + "glCopyConvolutionFilter1D", + "glCopyConvolutionFilter2D", + "glCopyPixels", + "glCopyTexImage1D", + "glCopyTexImage2D", + "glCopyTexSubImage1D", + "glCopyTexSubImage2D", + "glCopyTexSubImage3D", + "glCullFace", + "glDeleteLists", + "glDeleteTextures", + "glDeleteTexturesEXT", + "glDepthFunc", + "glDepthMask", + "glDepthRange", + "glDisable", + "glDisableClientState", + "glDrawArrays", + "glDrawBuffer", + "glDrawPixels", + "glEdgeFlagPointer", + "glEdgeFlagv", + "glEnable", + "glEnableClientState", + "glEnd", + "glEndList", + "glEvalCoord1dv", + "glEvalCoord1fv", + "glEvalCoord2dv", + "glEvalCoord2fv", + "glEvalMesh1", + "glEvalMesh2", + "glEvalPoint1", + "glEvalPoint2", + "glFeedbackBuffer", + "glFinish", + "glFlush", + "glFogf", + "glFogfv", + "glFogi", + "glFogiv", + "glFrontFace", + "glFrustum", + "glGenLists", + "glGenTextures", + "glGenTexturesEXT", + "glGetBooleanv", + "glGetClipPlane", + "glGetColorTable", + "glGetColorTableParameterfv", + "glGetColorTableParameteriv", + "glGetConvolutionFilter", + "glGetConvolutionParameterfv", + "glGetConvolutionParameteriv", + "glGetDoublev", + "glGetError", + "glGetFloatv", + "glGetHistogram", + "glGetHistogramParameterfv", + "glGetHistogramParameteriv", + "glGetIntegerv", + "glGetLightfv", + "glGetLightiv", + "glGetMapdv", + "glGetMapfv", + "glGetMapiv", + "glGetMaterialfv", + "glGetMaterialiv", + "glGetMinmax", + "glGetMinmaxParameterfv", + "glGetMinmaxParameteriv", + "glGetPixelMapfv", + "glGetPixelMapuiv", + "glGetPixelMapusv", + "glGetPolygonStipple", + "glGetSeparableFilter", + "glGetString", + "glGetTexEnvfv", + "glGetTexEnviv", + "glGetTexGendv", + "glGetTexGenfv", + "glGetTexGeniv", + "glGetTexImage", + "glGetTexLevelParameterfv", + "glGetTexLevelParameteriv", + "glGetTexParameterfv", + "glGetTexParameteriv", + "glHint", + "glHistogram", + "glIndexMask", + "glIndexPointer", + "glIndexdv", + "glIndexfv", + "glIndexiv", + "glIndexsv", + "glIndexubv", + "glInitNames", + "glIsEnabled", + "glIsList", + "glIsTexture", + "glIsTextureEXT", + "glLightModelf", + "glLightModelfv", + "glLightModeli", + "glLightModeliv", + "glLightf", + "glLightfv", + "glLighti", + "glLightiv", + "glLineStipple", + "glLineWidth", + "glListBase", + "glLoadIdentity", + "glLoadMatrixd", + "glLoadMatrixf", + "glLoadName", + "glLogicOp", + "glMap1d", + "glMap1f", + "glMap2d", + "glMap2f", + "glMapGrid1d", + "glMapGrid1f", + "glMapGrid2d", + "glMapGrid2f", + "glMaterialf", + "glMaterialfv", + "glMateriali", + "glMaterialiv", + "glMatrixMode", + "glMinmax", + "glMultMatrixd", + "glMultMatrixf", + "glMultiTexCoord1dvARB", + "glMultiTexCoord1fvARB", + "glMultiTexCoord1ivARB", + "glMultiTexCoord1svARB", + "glMultiTexCoord2dvARB", + "glMultiTexCoord2fvARB", + "glMultiTexCoord2ivARB", + "glMultiTexCoord2svARB", + "glMultiTexCoord3dvARB", + "glMultiTexCoord3fvARB", + "glMultiTexCoord3ivARB", + "glMultiTexCoord3svARB", + "glMultiTexCoord4dvARB", + "glMultiTexCoord4fvARB", + "glMultiTexCoord4ivARB", + "glMultiTexCoord4svARB", + "glNewList", + "glNormal3bv", + "glNormal3dv", + "glNormal3fv", + "glNormal3iv", + "glNormal3sv", + "glNormalPointer", + "glOrtho", + "glPassThrough", + "glPixelMapfv", + "glPixelMapuiv", + "glPixelMapusv", + "glPixelStoref", + "glPixelStorei", + "glPixelTransferf", + "glPixelTransferi", + "glPixelZoom", + "glPointSize", + "glPolygonMode", + "glPolygonOffset", + "glPolygonStipple", + "glPopAttrib", + "glPopMatrix", + "glPopName", + "glPrioritizeTextures", + "glPushAttrib", + "glPushMatrix", + "glPushName", + "glRasterPos2dv", + "glRasterPos2fv", + "glRasterPos2iv", + "glRasterPos2sv", + "glRasterPos3dv", + "glRasterPos3fv", + "glRasterPos3iv", + "glRasterPos3sv", + "glRasterPos4dv", + "glRasterPos4fv", + "glRasterPos4iv", + "glRasterPos4sv", + "glReadBuffer", + "glReadPixels", + "glRectdv", + "glRectfv", + "glRectiv", + "glRectsv", + "glRenderMode", + "glResetHistogram", + "glResetMinmax", + "glRotated", + "glRotatef", + "glScaled", + "glScalef", + "glScissor", + "glSelectBuffer", + "glSeparableFilter2D", + "glShadeModel", + "glStencilFunc", + "glStencilMask", + "glStencilOp", + "glTexCoord1dv", + "glTexCoord1fv", + "glTexCoord1iv", + "glTexCoord1sv", + "glTexCoord2dv", + "glTexCoord2fv", + "glTexCoord2iv", + "glTexCoord2sv", + "glTexCoord3dv", + "glTexCoord3fv", + "glTexCoord3iv", + "glTexCoord3sv", + "glTexCoord4dv", + "glTexCoord4fv", + "glTexCoord4iv", + "glTexCoord4sv", + "glTexCoordPointer", + "glTexEnvf", + "glTexEnvfv", + "glTexEnvi", + "glTexEnviv", + "glTexGend", + "glTexGendv", + "glTexGenf", + "glTexGenfv", + "glTexGeni", + "glTexGeniv", + "glTexImage1D", + "glTexImage2D", + "glTexImage3D", + "glTexParameterf", + "glTexParameterfv", + "glTexParameteri", + "glTexParameteriv", + "glTexSubImage1D", + "glTexSubImage2D", + "glTexSubImage3D", + "glTranslated", + "glTranslatef", + "glVertex2dv", + "glVertex2fv", + "glVertex2iv", + "glVertex2sv", + "glVertex3dv", + "glVertex3fv", + "glVertex3iv", + "glVertex3sv", + "glVertex4dv", + "glVertex4fv", + "glVertex4iv", + "glVertex4sv", + "glVertexPointer", + "glViewport", + "glxSwapQueryExtensionsStringReply", + "glxSwapQueryServerStringReply", + NULL +}; + +static XF86ModuleVersionInfo VersRec = +{ + "glx", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_EXTENSION, + ABI_EXTENSION_VERSION, + MOD_CLASS_NONE, + {0,0,0,0} +}; + +XF86ModuleData glxModuleData = { &VersRec, glxSetup, NULL }; + +static pointer +glxSetup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + static Bool setupDone = FALSE; + pointer GLcore = NULL; +#ifdef GLX_USE_SGI_SI + char GLcoreName[] = "GL"; +#else + char GLcoreName[] = "GLcore"; +#endif + + if (!setupDone) { + setupDone = TRUE; + + GLcore = LoadSubModule(module, GLcoreName, NULL, NULL, NULL, NULL, + errmaj, errmin); + if (!GLcore) { + if (errmaj) *errmaj = LDR_NOSUBENT; + } else { + LoaderReqSymLists(glcoreSymbols, NULL); + LoadExtension(&GLXExt, FALSE); + /* Wrap the init visuals routine in micmap.c */ + GlxWrapInitVisuals(&miInitVisualsProc); + /* Make sure this gets wrapped each time InitVisualWrap is called */ + miHookInitVisuals(NULL, GlxWrapInitVisuals); + } + } else { + if (errmaj) *errmaj = LDR_ONCEONLY; + } + /* Need a non-NULL return value to indicate success */ + return GLcore; +} diff --git a/hw/xfree86/dixmods/laymodule.c b/hw/xfree86/dixmods/laymodule.c new file mode 100644 index 000000000..60b6bcfa0 --- /dev/null +++ b/hw/xfree86/dixmods/laymodule.c @@ -0,0 +1,56 @@ +/* + * $XFree86: xc/programs/Xserver/miext/layer/laymodule.c,v 1.1 2002/11/08 22:19:55 keithp Exp $ + * + * Copyright © 2000 Keith Packard + * + * 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, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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. + */ + +#ifdef XFree86LOADER + +#include "xf86Module.h" +#include "X.h" +#include "scrnintstr.h" +#include "windowstr.h" +#include "font.h" +#include "dixfontstr.h" +#include "fontstruct.h" +#include "mi.h" +#include "regionstr.h" +#include "globals.h" +#include "gcstruct.h" +#include "layer.h" + +static XF86ModuleVersionInfo VersRec = +{ + "layer", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_ANSIC, /* Only need the ansic layer */ + ABI_ANSIC_VERSION, + MOD_CLASS_NONE, + {0,0,0,0} /* signature, to be patched into the file by a tool */ +}; + +XF86ModuleData layerModuleData = { &VersRec, NULL, NULL }; + +#endif diff --git a/hw/xfree86/dixmods/mfbmodule.c b/hw/xfree86/dixmods/mfbmodule.c new file mode 100644 index 000000000..0617226d0 --- /dev/null +++ b/hw/xfree86/dixmods/mfbmodule.c @@ -0,0 +1,48 @@ +/* $XFree86: xc/programs/Xserver/mfb/mfbmodule.c,v 1.7 1999/01/26 05:54:21 dawes Exp $ */ +/* + * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * 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 + * XFREE86 PROJECT 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 XFree86 Project 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 + * XFree86 Project. + */ + +#ifdef XFree86LOADER +#include "xf86Module.h" + + +static XF86ModuleVersionInfo VersRec = +{ + "mfb", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_ANSIC, /* Only need the ansic layer */ + ABI_ANSIC_VERSION, + MOD_CLASS_NONE, + {0,0,0,0} /* signature, to be patched into the file by a tool */ +}; + +XF86ModuleData mfbModuleData = { &VersRec, NULL, NULL }; + +#endif diff --git a/hw/xfree86/dixmods/recordmod.c b/hw/xfree86/dixmods/recordmod.c new file mode 100644 index 000000000..acafc456d --- /dev/null +++ b/hw/xfree86/dixmods/recordmod.c @@ -0,0 +1,42 @@ +/* $XFree86: xc/programs/Xserver/record/recordmod.c,v 1.6 2000/01/25 18:37:50 dawes Exp $ */ + +#include "xf86Module.h" + +extern Bool noTestExtensions; + +static MODULESETUPPROTO(recordSetup); + +extern void RecordExtensionInit(INITARGS); + +ExtensionModule recordExt = { + RecordExtensionInit, + "RECORD", + &noTestExtensions, + NULL, + NULL +}; + +static XF86ModuleVersionInfo VersRec = { + "record", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 13, 0, + ABI_CLASS_EXTENSION, + ABI_EXTENSION_VERSION, + MOD_CLASS_EXTENSION, + {0,0,0,0} +}; + +XF86ModuleData recordModuleData = { &VersRec, recordSetup, NULL }; + +static pointer +recordSetup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + LoadExtension(&recordExt, FALSE); + + /* Need a non-NULL return value to indicate success */ + return (pointer)1; +} + diff --git a/hw/xfree86/dixmods/shmodule.c b/hw/xfree86/dixmods/shmodule.c new file mode 100644 index 000000000..44aef65ce --- /dev/null +++ b/hw/xfree86/dixmods/shmodule.c @@ -0,0 +1,56 @@ +/* + * $XFree86: xc/programs/Xserver/miext/shadow/shmodule.c,v 1.1 2000/09/03 05:07:24 keithp Exp $ + * + * Copyright © 2000 Keith Packard + * + * 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, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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. + */ + +#ifdef XFree86LOADER + +#include "xf86Module.h" +#include "X.h" +#include "scrnintstr.h" +#include "windowstr.h" +#include "font.h" +#include "dixfontstr.h" +#include "fontstruct.h" +#include "mi.h" +#include "regionstr.h" +#include "globals.h" +#include "gcstruct.h" +#include "shadow.h" + +static XF86ModuleVersionInfo VersRec = +{ + "shadow", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_ANSIC, /* Only need the ansic layer */ + ABI_ANSIC_VERSION, + MOD_CLASS_NONE, + {0,0,0,0} /* signature, to be patched into the file by a tool */ +}; + +XF86ModuleData shadowModuleData = { &VersRec, NULL, NULL }; + +#endif diff --git a/hw/xfree86/dixmods/type1mod.c b/hw/xfree86/dixmods/type1mod.c new file mode 100644 index 000000000..9c25f4c0b --- /dev/null +++ b/hw/xfree86/dixmods/type1mod.c @@ -0,0 +1,87 @@ +/* + * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * 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 + * XFREE86 PROJECT 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 XFree86 Project 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 + * XFree86 Project. + */ +/* $XFree86: xc/lib/font/Type1/module/type1mod.c,v 1.10 2002/12/09 17:29:59 dawes Exp $ */ + +#include "misc.h" + +#include "fontmod.h" +#include "xf86Module.h" + +static MODULESETUPPROTO(type1Setup); + + /* + * This is the module data function that is accessed when loading + * libtype1 as a module. + */ + +static XF86ModuleVersionInfo VersRec = +{ + "type1", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 2, + ABI_CLASS_FONT, /* Font module */ + ABI_FONT_VERSION, + MOD_CLASS_FONT, + {0,0,0,0} /* signature, to be patched into the file by a tool */ +}; + +XF86ModuleData type1ModuleData = { &VersRec, type1Setup, NULL }; + +extern void Type1RegisterFontFileFunctions(void); +#ifdef BUILDCID +extern void CIDRegisterFontFileFunctions(void); +#endif + +FontModule type1Module = { + Type1RegisterFontFileFunctions, + "Type1", + NULL +}; + +#ifdef BUILDCID +FontModule CIDModule = { + CIDRegisterFontFileFunctions, + "CID", + NULL +}; +#endif + +static pointer +type1Setup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + type1Module.module = module; + LoadFont(&type1Module); +#ifdef BUILDCID + CIDModule.module = module; + LoadFont(&CIDModule); +#endif + + /* Need a non-NULL return */ + return (pointer)1; +} diff --git a/hw/xfree86/dixmods/xf86XTrapModule.c b/hw/xfree86/dixmods/xf86XTrapModule.c new file mode 100644 index 000000000..07283cdb7 --- /dev/null +++ b/hw/xfree86/dixmods/xf86XTrapModule.c @@ -0,0 +1,47 @@ +/* $XFree86: xc/programs/Xserver/XTrap/xf86XTrapModule.c,v 1.1 2001/11/02 23:29:29 dawes Exp $ */ +/* This is the xf86 module code for the DEC_XTRAP extension. + */ + +#include "xf86Module.h" + +#include <X11/extensions/xtrapdi.h> + +extern void DEC_XTRAPInit(INITARGS); + +#ifdef XFree86LOADER + +static MODULESETUPPROTO(xtrapSetup); + +ExtensionModule xtrapExt = +{ + DEC_XTRAPInit, + XTrapExtName, + NULL, + NULL, + NULL +}; + +static XF86ModuleVersionInfo xtrapVersRec = +{ + "xtrap", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_EXTENSION, /* needs the server extension ABI */ + ABI_EXTENSION_VERSION, + MOD_CLASS_EXTENSION, + {0,0,0,0} +}; + +XF86ModuleData xtrapModuleData = { &xtrapVersRec, xtrapSetup, NULL }; + +static pointer +xtrapSetup(pointer module, pointer opts, int *errmaj, int *errmin) { + LoadExtension(&xtrapExt, FALSE); + /* Need a non-NULL return value to indicate success */ + return (pointer)1; +} + +#endif /* XFree86LOADER */ |