diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-03-01 20:55:27 +0000 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-06-01 11:07:46 +0200 |
commit | 9bc6ff269aa8bf4c41696ebf4a686c93729ba151 (patch) | |
tree | 31359d2d0b38f0cdae2313217c02f059ec55dc4f /nx-X11/lib/Xext | |
parent | c646808bcb0fe95e9794409231a9fa8b51990971 (diff) | |
download | nx-libs-9bc6ff269aa8bf4c41696ebf4a686c93729ba151.tar.gz nx-libs-9bc6ff269aa8bf4c41696ebf4a686c93729ba151.tar.bz2 nx-libs-9bc6ff269aa8bf4c41696ebf4a686c93729ba151.zip |
Drop X11 extensions not shipped with recent X.Org server versions anymore:
include/extensions: Xag.h, Xagsrv.h, Xagstr.h
Xserver/Xext: appgroup.c, appgroup.h
lib/Xext: XAppgroup.c
include/extensions: Xcup.h, Xcupstr.h,
Xserver/Xext: cup.c
lib/Xext: cup.c
include/extensions: Xdbe.h
Xserver/Xext: Xdbe.c
Xserver/Xext: dgaproc.h, xf86dga.c, xf86dga2.c, xf86dgaext.h
include/extensions: Xevie.h, Xeviestr.h
include/extensions: XEVI.h, XEVIstr.h
Xserver/Xext: EVI.c, EVIstruct.h, sampleEVI.c
lib/Xext: XEVI.c
include/extensions: fontcache.h, fontcacheP.h, fontcachstr.h
Xserver/Xext: fontcache.c
include/extensions: lbxbuf.h, lbxbufstr.h, lbxdeltastr.h, lbximage.h, lbxopts.h, lbxstr.h, lbxzlib.h
lib/Xext: XLbx.c
include/extensions: multibuf.h, multibufst.h
lib/Xext: XMultibuf.c
Xserver/Xext: mbuf.c, mbufbf.c, mbufpx.c
include/extensions: xf86vmode.h, xf86vmstr.h
Xserver/Xext: vidmodeproc.h, xf86vmode.c
lib/Xext: MITMisc.c
Xserver/Xext: mitmisc.c
Xserver/Xext: xf86misc.c, xf86miscproc.h
Xserver/XTrap: xf86XTrapModule.c, xtrapddmi.c, xtrapdi.c, xtrapdiswp.c, xtrapditbl.c
include/extensions: xtrapbits.h xtrapddmi.h xtrapdi.h xtrapemacros.h xtraplib.h xtraplibp.h xtrapproto.h
Fixes: ArcticaProject/nx-libs#116
X.org: https://cgit.freedesktop.org/xorg/xserver/commit/?id=cbc20d92de92aad5ca240310a9156ccf97c24a01
Plus: Drop various Imake'ish defines where not needed anymore.
Diffstat (limited to 'nx-X11/lib/Xext')
-rw-r--r-- | nx-X11/lib/Xext/Imakefile | 12 | ||||
-rw-r--r-- | nx-X11/lib/Xext/MITMisc.c | 133 | ||||
-rw-r--r-- | nx-X11/lib/Xext/XAppgroup.c | 391 | ||||
-rw-r--r-- | nx-X11/lib/Xext/XEVI.c | 213 | ||||
-rw-r--r-- | nx-X11/lib/Xext/XLbx.c | 129 | ||||
-rw-r--r-- | nx-X11/lib/Xext/XMultibuf.c | 714 | ||||
-rw-r--r-- | nx-X11/lib/Xext/Xcup.c | 265 | ||||
-rw-r--r-- | nx-X11/lib/Xext/Xdbe.c | 474 | ||||
-rw-r--r-- | nx-X11/lib/Xext/Xext-def.cpp | 41 |
9 files changed, 6 insertions, 2366 deletions
diff --git a/nx-X11/lib/Xext/Imakefile b/nx-X11/lib/Xext/Imakefile index c43361f12..065667123 100644 --- a/nx-X11/lib/Xext/Imakefile +++ b/nx-X11/lib/Xext/Imakefile @@ -31,12 +31,12 @@ ALLOC_DEFINES = Malloc0ReturnsNullDefines DEFINES = $(ALLOC_DEFINES) INCLUDES = -I$(XLIBSRC) - SRCS = globals.c extutil.c XMultibuf.c XShape.c $(SHMSRCS) \ - MITMisc.c XTestExt1.c XSync.c Xdbe.c XLbx.c \ - XSecurity.c XAppgroup.c Xcup.c DPMS.c XEVI.c - OBJS = globals.o extutil.o XMultibuf.o XShape.o $(SHMOBJS) \ - MITMisc.o XTestExt1.o XSync.o Xdbe.o XLbx.o \ - XSecurity.o XAppgroup.o Xcup.o DPMS.o XEVI.o + SRCS = globals.c extutil.c XShape.c $(SHMSRCS) \ + XTestExt1.c XSync.c \ + XSecurity.c DPMS.c + OBJS = globals.o extutil.o XShape.o $(SHMOBJS) \ + XTestExt1.o XSync.o \ + XSecurity.o DPMS.o LINTLIBS = $(LINTXLIB) #include <Library.tmpl> diff --git a/nx-X11/lib/Xext/MITMisc.c b/nx-X11/lib/Xext/MITMisc.c deleted file mode 100644 index 8ba35dce1..000000000 --- a/nx-X11/lib/Xext/MITMisc.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * $Xorg: MITMisc.c,v 1.4 2001/02/09 02:03:49 xorgcvs Exp $ - * -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - */ -/* $XFree86: xc/lib/Xext/MITMisc.c,v 1.3 2002/10/16 00:37:27 dawes Exp $ */ - -/* RANDOM CRUFT! THIS HAS NO OFFICIAL X CONSORTIUM BLESSING */ - -#define NEED_REPLIES -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <nx-X11/Xlibint.h> -#include <nx-X11/extensions/MITMisc.h> -#include <nx-X11/extensions/mitmiscstr.h> -#include <nx-X11/extensions/Xext.h> -#include <nx-X11/extensions/extutil.h> - -static XExtensionInfo _mit_info_data; -static XExtensionInfo *mit_info = &_mit_info_data; -static /* const */ char *mit_extension_name = MITMISCNAME; - -#define MITCheckExtension(dpy,i,val) \ - XextCheckExtension (dpy, i, mit_extension_name, val) - -/***************************************************************************** - * * - * private utility routines * - * * - *****************************************************************************/ - -static int close_display(Display *dpy, XExtCodes *codes); -static /* const */ XExtensionHooks mit_extension_hooks = { - NULL, /* create_gc */ - NULL, /* copy_gc */ - NULL, /* flush_gc */ - NULL, /* free_gc */ - NULL, /* create_font */ - NULL, /* free_font */ - close_display, /* close_display */ - NULL, /* wire_to_event */ - NULL, /* event_to_wire */ - NULL, /* error */ - NULL /* error_string */ -}; - -static XEXT_GENERATE_FIND_DISPLAY (find_display, mit_info, mit_extension_name, - &mit_extension_hooks, MITMiscNumberEvents, - NULL) - -static XEXT_GENERATE_CLOSE_DISPLAY (close_display, mit_info) - - -/***************************************************************************** - * * - * public routines * - * * - *****************************************************************************/ - -Bool XMITMiscQueryExtension (Display *dpy, int *event_basep, int *error_basep) -{ - XExtDisplayInfo *info = find_display (dpy); - - if (XextHasExtension(info)) { - *event_basep = info->codes->first_event; - *error_basep = info->codes->first_error; - return True; - } else { - return False; - } -} - - -Status XMITMiscSetBugMode(Display *dpy, Bool onOff) -{ - XExtDisplayInfo *info = find_display (dpy); - register xMITSetBugModeReq *req; - - MITCheckExtension (dpy, info, 0); - - LockDisplay(dpy); - GetReq(MITSetBugMode, req); - req->reqType = info->codes->major_opcode; - req->mitReqType = X_MITSetBugMode; - req->onOff = onOff; - UnlockDisplay(dpy); - SyncHandle(); - return 1; -} - -Bool XMITMiscGetBugMode(Display *dpy) -{ - XExtDisplayInfo *info = find_display (dpy); - register xMITGetBugModeReq *req; - xMITGetBugModeReply rep; - - MITCheckExtension (dpy, info, 0); - - LockDisplay(dpy); - GetReq(MITGetBugMode, req); - req->reqType = info->codes->major_opcode; - req->mitReqType = X_MITGetBugMode; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - UnlockDisplay(dpy); - SyncHandle(); - return rep.onOff; -} diff --git a/nx-X11/lib/Xext/XAppgroup.c b/nx-X11/lib/Xext/XAppgroup.c deleted file mode 100644 index abbf1c1b9..000000000 --- a/nx-X11/lib/Xext/XAppgroup.c +++ /dev/null @@ -1,391 +0,0 @@ -/* $XFree86: xc/lib/Xext/XAppgroup.c,v 1.11 2002/10/16 02:19:22 dawes Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $Xorg: XAppgroup.c,v 1.5 2001/02/09 02:03:49 xorgcvs Exp $ */ - -#ifdef WIN32 -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <nx-X11/Xwindows.h> -#endif - -#define NEED_EVENTS -#define NEED_REPLIES -#include <nx-X11/Xlibint.h> -#include <nx-X11/extensions/Xagstr.h> -#include <nx-X11/extensions/Xext.h> -#include <nx-X11/extensions/extutil.h> - -#include <stdarg.h> - -struct xagstuff { - int attrib_mask; - Bool app_group_leader; - Bool single_screen; - Window default_root; - VisualID root_visual; - Colormap default_colormap; - unsigned long black_pixel; - unsigned long white_pixel; -}; - -static XExtensionInfo _xag_info_data; -static XExtensionInfo *xag_info = &_xag_info_data; -static char *xag_extension_name = XAGNAME; - -#define XagCheckExtension(dpy,i,val) \ - XextCheckExtension (dpy, i, xag_extension_name, val) - -/***************************************************************************** - * * - * private utility routines * - * * - *****************************************************************************/ - -static int close_display(Display *dpy, XExtCodes *codes); -static /* const */ XExtensionHooks xag_extension_hooks = { - NULL, /* create_gc */ - NULL, /* copy_gc */ - NULL, /* flush_gc */ - NULL, /* free_gc */ - NULL, /* create_font */ - NULL, /* free_font */ - close_display, /* close_display */ - NULL, /* wire_to_event */ - NULL, /* event_to_wire */ - NULL, /* error */ - NULL, /* error_string */ -}; - -static XEXT_GENERATE_FIND_DISPLAY (find_display, xag_info, - xag_extension_name, - &xag_extension_hooks, - 0, NULL) - -static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xag_info) - - -/***************************************************************************** - * * - * public Xag Extension routines * - * * - *****************************************************************************/ - -Bool -XagQueryVersion( - Display *dpy, - int *major_version_return, - int *minor_version_return) -{ - XExtDisplayInfo *info = find_display (dpy); - xXagQueryVersionReply rep; - xXagQueryVersionReq *req; - - XagCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XagQueryVersion, req); - req->reqType = info->codes->major_opcode; - req->xagReqType = X_XagQueryVersion; - req->client_major_version = XAG_MAJOR_VERSION; - req->client_minor_version = XAG_MINOR_VERSION; - if (!_XReply(dpy, (xReply *)&rep, 0, xTrue)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - *major_version_return = rep.server_major_version; - *minor_version_return = rep.server_minor_version; - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -static void -StuffToWire (Display *dpy, struct xagstuff *stuff, xXagCreateReq *req) -{ - unsigned long values[8]; - unsigned long* value = values; - unsigned int nvalues; - - /* the order these are in is important */ - if (stuff->attrib_mask & XagSingleScreenMask) - *value++ = stuff->single_screen; - - if (stuff->attrib_mask & XagDefaultRootMask) - *value++ = stuff->default_root; - - if (stuff->attrib_mask & XagRootVisualMask) - *value++ = stuff->root_visual; - - if (stuff->attrib_mask & XagDefaultColormapMask) - *value++ = stuff->default_colormap; - - if (stuff->attrib_mask & XagBlackPixelMask) - *value++ = stuff->black_pixel; - - if (stuff->attrib_mask & XagWhitePixelMask) - *value++ = stuff->white_pixel; - - if (stuff->attrib_mask & XagAppGroupLeaderMask) - *value++ = stuff->app_group_leader; - - req->length += (nvalues = value - values); - - nvalues <<= 2; - Data32 (dpy, (long*) values, (long) nvalues); -} - -Bool -XagCreateEmbeddedApplicationGroup( - Display* dpy, - VisualID root_visual, - Colormap default_colormap, - unsigned long black_pixel, - unsigned long white_pixel, - XAppGroup* app_group_return) -{ - XExtDisplayInfo *info = find_display (dpy); - xXagCreateReq *req; - struct xagstuff stuff; - - XagCheckExtension (dpy, info, False); - - LockDisplay(dpy); - stuff.app_group_leader = True; - stuff.single_screen = True; - stuff.default_root = RootWindow (dpy, DefaultScreen(dpy)); - stuff.root_visual = root_visual; - stuff.default_colormap = default_colormap; - stuff.attrib_mask = - XagAppGroupLeaderMask | XagSingleScreenMask | XagDefaultRootMask | - XagRootVisualMask | XagDefaultColormapMask; - if (default_colormap != None) { - stuff.black_pixel = black_pixel; - stuff.white_pixel = white_pixel; - stuff.attrib_mask |= XagBlackPixelMask | XagWhitePixelMask; - } - /* might do some validation here */ - GetReq(XagCreate, req); - req->reqType = info->codes->major_opcode; - req->xagReqType = X_XagCreate; - *app_group_return = req->app_group = XAllocID(dpy); - req->attrib_mask = stuff.attrib_mask; - StuffToWire (dpy, &stuff, req); - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -XagCreateNonembeddedApplicationGroup( - Display* dpy, - XAppGroup* app_group_return) -{ - XExtDisplayInfo *info = find_display (dpy); - xXagCreateReq *req; - struct xagstuff stuff; - - XagCheckExtension (dpy, info, False); - - LockDisplay(dpy); - stuff.app_group_leader = False; - stuff.single_screen = False; - stuff.attrib_mask = XagAppGroupLeaderMask | XagSingleScreenMask; - /* might do some validation here */ - GetReq(XagCreate, req); - req->reqType = info->codes->major_opcode; - req->xagReqType = X_XagCreate; - *app_group_return = req->app_group = XAllocID(dpy); - req->attrib_mask = stuff.attrib_mask; - StuffToWire (dpy, &stuff, req); - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool XagDestroyApplicationGroup(Display* dpy, XAppGroup app_group) -{ - XExtDisplayInfo *info = find_display (dpy); - xXagDestroyReq *req; - - XagCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XagDestroy, req); - req->reqType = info->codes->major_opcode; - req->xagReqType = X_XagDestroy; - req->app_group = app_group; - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -XagGetApplicationGroupAttributes(Display* dpy, XAppGroup app_group, ...) -{ - va_list var; - XExtDisplayInfo *info = find_display (dpy); - xXagGetAttrReq *req; - xXagGetAttrReply rep; - int attr; - - XagCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XagGetAttr, req); - req->reqType = info->codes->major_opcode; - req->xagReqType = X_XagGetAttr; - req->app_group = app_group; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - va_start (var, app_group); - for (attr = va_arg(var, int); attr != 0; attr = va_arg(var, int)) { - void* ptr; - - switch (attr) { - case XagNappGroupLeader: - ptr = va_arg(var, void*); - *(Bool*)ptr = rep.app_group_leader; - break; - case XagNsingleScreen: - ptr = va_arg(var, void*); - *(Bool*)ptr = rep.single_screen; - break; - case XagNdefaultRoot: - ptr = va_arg(var, void*); - *(Window*)ptr = rep.default_root; - break; - case XagNrootVisual: - ptr = va_arg(var, void*); - *(VisualID*)ptr = rep.root_visual; - break; - case XagNdefaultColormap: - ptr = va_arg(var, void*); - *(Colormap*)ptr = rep.default_colormap; - break; - case XagNblackPixel: - ptr = va_arg(var, void*); - *(unsigned long*)ptr = rep.black_pixel; - break; - case XagNwhitePixel: - ptr = va_arg(var, void*); - *(unsigned long*)ptr = rep.white_pixel; - break; - } - } - va_end (var); - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -XagQueryApplicationGroup( - Display* dpy, - XID resource, - XAppGroup* app_group_return) -{ - XExtDisplayInfo *info = find_display (dpy); - xXagQueryReq *req; - xXagQueryReply rep; - - XagCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XagQuery, req); - req->reqType = info->codes->major_opcode; - req->xagReqType = X_XagQuery; - req->resource = resource; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - *app_group_return = rep.app_group; - UnlockDisplay(dpy); - SyncHandle(); - return True; - -} - -Bool -XagCreateAssociation(Display* dpy, Window* window_return, void* system_window) -{ -#ifdef WIN32 - long tmp = *(HWND*) system_window; - XExtDisplayInfo *info = find_display (dpy); - xXagCreateAssocReq *req; - - XagCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XagCreateAssoc, req); - req->reqType = info->codes->major_opcode; - req->xagReqType = X_XagCreateAssoc; - *window_return = req->window = XAllocID(dpy); - req->window_type = XagWindowTypeWin32; - req->system_window_len = sizeof(HWND); - Data32 (dpy, (long*) tmp, 1L); - req->length++; - UnlockDisplay(dpy); - SyncHandle(); -#else - /* other platforms go here */ - - /* this whole thing could be arranged better, but since X need - * only short-circuit the protocol and WIN32 is the only other - * platform the XC supports, it will suffice for now. - */ - *window_return = *(Window*)system_window; -#endif - return True; -} - -Bool -XagDestroyAssociation(Display* dpy, Window window) -{ -#ifdef WIN32 - XExtDisplayInfo *info = find_display (dpy); - xXagDestroyAssocReq *req; - - XagCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XagDestroyAssoc, req); - req->reqType = info->codes->major_opcode; - req->xagReqType = X_XagDestroyAssoc; - req->window = window; - UnlockDisplay(dpy); - SyncHandle(); -#endif - return True; -} - diff --git a/nx-X11/lib/Xext/XEVI.c b/nx-X11/lib/Xext/XEVI.c deleted file mode 100644 index e5a811bdf..000000000 --- a/nx-X11/lib/Xext/XEVI.c +++ /dev/null @@ -1,213 +0,0 @@ -/* $Xorg: XEVI.c,v 1.3 2000/08/17 19:45:51 cpqbld Exp $ */ -/************************************************************ -Copyright (c) 1997 by Silicon Graphics Computer Systems, Inc. -Permission to use, copy, modify, and distribute this -software and its documentation for any purpose and without -fee is hereby granted, provided that the above copyright -notice appear in all copies and that both that copyright -notice and this permission notice appear in supporting -documentation, and that the name of Silicon Graphics not be -used in advertising or publicity pertaining to distribution -of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability -of this software for any purpose. It is provided "as is" -without any express or implied warranty. -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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. -********************************************************/ -/* $XFree86$ */ -#define NEED_EVENTS -#define NEED_REPLIES -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <nx-X11/Xlibint.h> -#include <nx-X11/extensions/XEVI.h> -#include <nx-X11/extensions/XEVIstr.h> -#include <nx-X11/extensions/Xext.h> -#include <nx-X11/extensions/extutil.h> -#include <nx-X11/Xutil.h> -static XExtensionInfo *xevi_info;/* needs to move to globals.c */ -static /* const */ char *xevi_extension_name = EVINAME; -#define XeviCheckExtension(dpy,i,val) \ - XextCheckExtension (dpy, i, xevi_extension_name, val) -/***************************************************************************** - * * - * private utility routines * - * * - *****************************************************************************/ -static /* const */ XExtensionHooks xevi_extension_hooks = { - NULL, /* create_gc */ - NULL, /* copy_gc */ - NULL, /* flush_gc */ - NULL, /* free_gc */ - NULL, /* create_font */ - NULL, /* free_font */ - NULL, /* close_display */ - NULL, /* wire_to_event */ - NULL, /* event_to_wire */ - NULL, /* error */ - NULL, /* error_string */ -}; -static XEXT_GENERATE_FIND_DISPLAY (find_display, xevi_info, - xevi_extension_name, - &xevi_extension_hooks, 0, NULL) -Bool XeviQueryExtension (Display *dpy) -{ - XExtDisplayInfo *info = find_display (dpy); - if (XextHasExtension(info)) { - return True; - } else { - return False; - } -} -Bool XeviQueryVersion(Display *dpy, int *majorVersion, int *minorVersion) -{ - XExtDisplayInfo *info = find_display (dpy); - xEVIQueryVersionReply rep; - register xEVIQueryVersionReq *req; - XeviCheckExtension (dpy, info, False); - LockDisplay(dpy); - GetReq(EVIQueryVersion, req); - req->reqType = info->codes->major_opcode; - req->xeviReqType = X_EVIQueryVersion; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - *majorVersion = rep.majorVersion; - *minorVersion = rep.minorVersion; - UnlockDisplay(dpy); - SyncHandle(); - return True; -} -static Bool notInList(VisualID32 *visual, int sz_visual, VisualID newVisualid) -{ - while (sz_visual-- > 0) { - if (*visual == newVisualid) - return False; - visual++; - } - return True; -} -Status XeviGetVisualInfo( - register Display *dpy, - VisualID *visual, - int n_visual, - ExtendedVisualInfo **evi_return, - int *n_info_return) -{ - XExtDisplayInfo *info = find_display (dpy); - register xEVIGetVisualInfoReq *req; - xEVIGetVisualInfoReply rep; - int sz_info, sz_xInfo, sz_conflict, sz_xConflict; - VisualID32 *temp_conflict, *temp_visual, *xConflictPtr; - VisualID *conflict; - xExtendedVisualInfo *temp_xInfo; - XVisualInfo *vinfo; - register ExtendedVisualInfo *infoPtr; - register xExtendedVisualInfo *xInfoPtr; - register int n_data, visualIndex, vinfoIndex; - Bool isValid; - XeviCheckExtension (dpy, info, 0); - *n_info_return = 0; - *evi_return = NULL; - vinfo = XGetVisualInfo(dpy, 0, NULL, &sz_info); - if (!vinfo) { - return BadValue; - } - if (!n_visual || !visual) { /* copy the all visual */ - temp_visual = (VisualID32 *)Xmalloc(sz_VisualID32 * sz_info); - n_visual = 0; - for (vinfoIndex = 0; vinfoIndex < sz_info; vinfoIndex++) - if (notInList(temp_visual, n_visual, vinfo[vinfoIndex].visualid)) - temp_visual[n_visual++] = vinfo[vinfoIndex].visualid; - } - else { /* check if the visual is valid */ - for (visualIndex = 0; visualIndex < n_visual; visualIndex++) { - isValid = False; - for (vinfoIndex = 0; vinfoIndex < sz_info; vinfoIndex++) { - if (visual[visualIndex] == vinfo[vinfoIndex].visualid) { - isValid = True; - break; - } - } - if (!isValid) { - XFree(vinfo); - return BadValue; - } - } - temp_visual = (VisualID32 *)Xmalloc(sz_VisualID32 * n_visual); - for (visualIndex = 0; visualIndex < n_visual; visualIndex++) - temp_visual[visualIndex] = visual[visualIndex]; - } - XFree(vinfo); - LockDisplay(dpy); - GetReq(EVIGetVisualInfo, req); - req->reqType = info->codes->major_opcode; - req->xeviReqType = X_EVIGetVisualInfo; - req->n_visual = n_visual; - SetReqLen(req, n_visual, 1); - Data(dpy, (char *)temp_visual, n_visual * sz_VisualID32); - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - Xfree(temp_visual); - return BadAccess; - } - Xfree(temp_visual); - sz_info = rep.n_info * sizeof(ExtendedVisualInfo); - sz_xInfo = rep.n_info * sz_xExtendedVisualInfo; - sz_conflict = rep.n_conflicts * sizeof(VisualID); - sz_xConflict = rep.n_conflicts * sz_VisualID32; - infoPtr = *evi_return = (ExtendedVisualInfo *)Xmalloc(sz_info + sz_conflict); - xInfoPtr = temp_xInfo = (xExtendedVisualInfo *)Xmalloc(sz_xInfo); - xConflictPtr = temp_conflict = (VisualID32 *)Xmalloc(sz_xConflict); - if (!*evi_return || !temp_xInfo || !temp_conflict) { - _XEatData(dpy, (sz_xInfo + sz_xConflict + 3) & ~3); - UnlockDisplay(dpy); - SyncHandle(); - if (evi_return) - Xfree(evi_return); - if (temp_xInfo) - Xfree(temp_xInfo); - if (temp_conflict) - Xfree(temp_conflict); - return BadAlloc; - } - _XRead(dpy, (char *)temp_xInfo, sz_xInfo); - _XRead(dpy, (char *)temp_conflict, sz_xConflict); - UnlockDisplay(dpy); - SyncHandle(); - n_data = rep.n_info; - conflict = (VisualID *)(infoPtr + n_data); - while (n_data-- > 0) { - infoPtr->core_visual_id = xInfoPtr->core_visual_id; - infoPtr->screen = xInfoPtr->screen; - infoPtr->level = xInfoPtr->level; - infoPtr->transparency_type = xInfoPtr->transparency_type; - infoPtr->transparency_value = xInfoPtr->transparency_value; - infoPtr->min_hw_colormaps = xInfoPtr->min_hw_colormaps; - infoPtr->max_hw_colormaps = xInfoPtr->max_hw_colormaps; - infoPtr->num_colormap_conflicts = xInfoPtr->num_colormap_conflicts; - infoPtr->colormap_conflicts = conflict; - conflict += infoPtr->num_colormap_conflicts; - infoPtr++; - xInfoPtr++; - } - n_data = rep.n_conflicts; - conflict = (VisualID *)(infoPtr); - while (n_data-- > 0) - *conflict++ = *xConflictPtr++; - Xfree(temp_xInfo); - Xfree(temp_conflict); - *n_info_return = rep.n_info; - return Success; -} diff --git a/nx-X11/lib/Xext/XLbx.c b/nx-X11/lib/Xext/XLbx.c deleted file mode 100644 index 450bd5bc5..000000000 --- a/nx-X11/lib/Xext/XLbx.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * $Xorg: XLbx.c,v 1.3 2000/08/17 19:45:51 cpqbld Exp $ - * - * Copyright 1992 Network Computing Devices - * - * 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 NCD. not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. NCD. makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD. - * 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. - * - * Author: Keith Packard, Network Computing Devices - */ -/* $XFree86: xc/lib/Xext/XLbx.c,v 1.4 2002/10/16 00:37:27 dawes Exp $ */ - -#define NEED_EVENTS -#define NEED_REPLIES -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <stdio.h> -#include <nx-X11/Xlibint.h> -#include <nx-X11/extensions/XLbx.h> -#include <nx-X11/extensions/lbxstr.h> -#include <nx-X11/extensions/Xext.h> -#include <nx-X11/extensions/extutil.h> - -static XExtensionInfo _lbx_info_data; -static XExtensionInfo *lbx_info = &_lbx_info_data; -static /* const */ char *lbx_extension_name = LBXNAME; - -#define LbxCheckExtension(dpy,i,val) \ - XextCheckExtension (dpy, i, lbx_extension_name, val) - -static int close_display(Display *dpy, XExtCodes *codes); -static char *error_string(Display *dpy, int code, XExtCodes *codes, - char *buf, int n); -static /* const */ XExtensionHooks lbx_extension_hooks = { - NULL, /* create_gc */ - NULL, /* copy_gc */ - NULL, /* flush_gc */ - NULL, /* free_gc */ - NULL, /* create_font */ - NULL, /* free_font */ - close_display, /* close_display */ - NULL, /* wire_to_event */ - NULL, /* event_to_wire */ - NULL, /* error */ - error_string, /* error_string */ -}; - -static /* const */ char *lbx_error_list[] = { - "BadLbxClient", /* BadLbxClient */ -}; - -static XEXT_GENERATE_FIND_DISPLAY (find_display, lbx_info, lbx_extension_name, - &lbx_extension_hooks, LbxNumberEvents, NULL) - -static XEXT_GENERATE_CLOSE_DISPLAY (close_display, lbx_info) - -static XEXT_GENERATE_ERROR_STRING (error_string, lbx_extension_name, - LbxNumberErrors, lbx_error_list) - - -Bool XLbxQueryExtension ( - Display *dpy, - int *requestp, int *event_basep, int *error_basep) -{ - XExtDisplayInfo *info = find_display (dpy); - - if (XextHasExtension(info)) { - *requestp = info->codes->major_opcode; - *event_basep = info->codes->first_event; - *error_basep = info->codes->first_error; - return True; - } else { - return False; - } -} - - -int XLbxGetEventBase(Display *dpy) -{ - XExtDisplayInfo *info = find_display (dpy); - - if (XextHasExtension(info)) { - return info->codes->first_event; - } else { - return -1; - } -} - - -Bool XLbxQueryVersion(Display *dpy, int *majorVersion, int *minorVersion) -{ - XExtDisplayInfo *info = find_display (dpy); - xLbxQueryVersionReply rep; - register xLbxQueryVersionReq *req; - - LbxCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(LbxQueryVersion, req); - req->reqType = info->codes->major_opcode; - req->lbxReqType = X_LbxQueryVersion; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - *majorVersion = rep.majorVersion; - *minorVersion = rep.minorVersion; - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -/* all other requests will run after Xlib has lost the wire ... */ diff --git a/nx-X11/lib/Xext/XMultibuf.c b/nx-X11/lib/Xext/XMultibuf.c deleted file mode 100644 index 570676def..000000000 --- a/nx-X11/lib/Xext/XMultibuf.c +++ /dev/null @@ -1,714 +0,0 @@ -/* - * $Xorg: XMultibuf.c,v 1.6 2001/02/09 02:03:49 xorgcvs Exp $ - * -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Authors: Jim Fulton, MIT X Consortium - */ -/* $XFree86: xc/lib/Xext/XMultibuf.c,v 1.5 2001/12/14 19:55:00 dawes Exp $ */ - -#define NEED_EVENTS -#define NEED_REPLIES -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <nx-X11/Xlibint.h> -#include <stdio.h> -#include <nx-X11/extensions/Xext.h> -#include <nx-X11/extensions/extutil.h> -#include <nx-X11/extensions/multibufst.h> - -static XExtensionInfo _multibuf_info_data; -static XExtensionInfo *multibuf_info = &_multibuf_info_data; -static /* const */ char *multibuf_extension_name = MULTIBUFFER_PROTOCOL_NAME; - -#define MbufCheckExtension(dpy,i,val) \ - XextCheckExtension (dpy, i, multibuf_extension_name, val) -#define MbufSimpleCheckExtension(dpy,i) \ - XextSimpleCheckExtension (dpy, i, multibuf_extension_name) - - -/***************************************************************************** - * * - * private utility routines * - * * - *****************************************************************************/ - -/* - * find_display - locate the display info block - */ -static int close_display(Display *dpy, XExtCodes *codes); -static char *error_string(Display *dpy, int code, XExtCodes *codes, char *buf, int n); -static Bool wire_to_event(Display *dpy, XEvent *libevent, xEvent *netevent); -static Status event_to_wire(Display *dpy, XEvent *libevent, xEvent *netevent); -static /* const */ XExtensionHooks multibuf_extension_hooks = { - NULL, /* create_gc */ - NULL, /* copy_gc */ - NULL, /* flush_gc */ - NULL, /* free_gc */ - NULL, /* create_font */ - NULL, /* free_font */ - close_display, /* close_display */ - wire_to_event, /* wire_to_event */ - event_to_wire, /* event_to_wire */ - NULL, /* error */ - error_string, /* error_string */ -}; - -static /* const */ char *multibuf_error_list[] = { - "BadBuffer", /* MultibufferBadBuffer */ -}; - -static XEXT_GENERATE_FIND_DISPLAY (find_display, multibuf_info, - multibuf_extension_name, - &multibuf_extension_hooks, - MultibufferNumberEvents, NULL) - -static XEXT_GENERATE_CLOSE_DISPLAY (close_display, multibuf_info) - -static XEXT_GENERATE_ERROR_STRING (error_string, multibuf_extension_name, - MultibufferNumberErrors, - multibuf_error_list) - -/* - * wire_to_event - convert a wire event in network format to a C - * event structure - */ -static Bool wire_to_event (Display *dpy, XEvent *libevent, xEvent *netevent) -{ - XExtDisplayInfo *info = find_display (dpy); - - MbufCheckExtension (dpy, info, False); - - switch ((netevent->u.u.type & 0x7f) - info->codes->first_event) { - case MultibufferClobberNotify: - { - XmbufClobberNotifyEvent *ev; - xMbufClobberNotifyEvent *event; - - ev = (XmbufClobberNotifyEvent *) libevent; - event = (xMbufClobberNotifyEvent *) netevent; - ev->type = event->type & 0x7f; - ev->serial = _XSetLastRequestRead(dpy,(xGenericReply *) netevent); - ev->send_event = ((event->type & 0x80) != 0); - ev->display = dpy; - ev->buffer = event->buffer; - ev->state = event->state; - return True; - } - case MultibufferUpdateNotify: - { - XmbufUpdateNotifyEvent *ev; - xMbufUpdateNotifyEvent *event; - - ev = (XmbufUpdateNotifyEvent *) libevent; - event = (xMbufUpdateNotifyEvent *) netevent; - ev->type = event->type & 0x7f; - ev->serial = _XSetLastRequestRead(dpy,(xGenericReply *) netevent); - ev->send_event = ((event->type & 0x80) != 0); - ev->display = dpy; - ev->buffer = event->buffer; - return True; - } - } - return False; -} - - -/* - * event_to_wire - convert a C event structure to a wire event in - * network format - */ -static Status event_to_wire (Display *dpy, XEvent *libevent, xEvent *netevent) -{ - XExtDisplayInfo *info = find_display (dpy); - - MbufCheckExtension (dpy, info, 0); - - switch ((libevent->type & 0x7f) - info->codes->first_event) { - case MultibufferClobberNotify: - { - XmbufClobberNotifyEvent *ev; - xMbufClobberNotifyEvent *event; - - ev = (XmbufClobberNotifyEvent *) libevent; - event = (xMbufClobberNotifyEvent *) netevent; - event->type = ev->type; - event->sequenceNumber = (ev->serial & 0xffff); - event->buffer = ev->buffer; - event->state = ev->state; - return 1; - } - case MultibufferUpdateNotify: - { - XmbufUpdateNotifyEvent *ev; - xMbufUpdateNotifyEvent *event; - - ev = (XmbufUpdateNotifyEvent *) libevent; - event = (xMbufUpdateNotifyEvent *) netevent; - event->type = ev->type; - event->sequenceNumber = (ev->serial & 0xffff); - event->buffer = ev->buffer; - return 1; - } - } - return 0; -} - - -/* - * read_buffer_info - read Buffer Info descriptors from the net; if unable - * to allocate memory, read junk to make sure that stream is clear. - */ -#define TALLOC(type,count) ((type *) Xmalloc ((unsigned) count * sizeof(type))) - -static XmbufBufferInfo *read_buffer_info (Display *dpy, int nbufs) -{ - xMbufBufferInfo *netbuf = TALLOC (xMbufBufferInfo, nbufs); - XmbufBufferInfo *bufinfo = NULL; - long netbytes = nbufs * SIZEOF(xMbufBufferInfo); - - if (netbuf) { - _XRead (dpy, (char *) netbuf, netbytes); - - bufinfo = TALLOC (XmbufBufferInfo, nbufs); - if (bufinfo) { - register XmbufBufferInfo *c; - register xMbufBufferInfo *net; - register int i; - - for (i = 0, c = bufinfo, net = netbuf; i < nbufs; - i++, c++, net++) { - c->visualid = net->visualID; - c->max_buffers = net->maxBuffers; - c->depth = net->depth; - } - } - Xfree ((char *) netbuf); - } else { /* eat the data */ - while (netbytes > 0) { - char dummy[256]; /* stack size vs loops tradeoff */ - long nbytes = sizeof dummy; - - if (nbytes > netbytes) nbytes = netbytes; - _XRead (dpy, dummy, nbytes); - netbytes -= nbytes; - } - } - - return bufinfo; -} - -#undef TALLOC - - -/***************************************************************************** - * * - * Multibuffering/stereo public interfaces * - * * - *****************************************************************************/ - - -/* - * XmbufQueryExtension - - * Returns True if the multibuffering/stereo extension is available - * on the given display. If the extension exists, the value of the - * first event code (which should be added to the event type constants - * MultibufferClobberNotify and MultibufferUpdateNotify to get the - * actual values) is stored into event_base and the value of the first - * error code (which should be added to the error type constant - * MultibufferBadBuffer to get the actual value) is stored into - * error_base. - */ -Bool XmbufQueryExtension ( - Display *dpy, - int *event_base_return, int *error_base_return) -{ - XExtDisplayInfo *info = find_display (dpy); - - if (XextHasExtension (info)) { - *event_base_return = info->codes->first_event; - *error_base_return = info->codes->first_error; - return True; - } else { - return False; - } -} - - -/* - * XmbufGetVersion - - * Gets the major and minor version numbers of the extension. The return - * value is zero if an error occurs or non-zero if no error happens. - */ -Status XmbufGetVersion ( - Display *dpy, - int *major_version_return, int *minor_version_return) -{ - XExtDisplayInfo *info = find_display (dpy); - xMbufGetBufferVersionReply rep; - register xMbufGetBufferVersionReq *req; - - MbufCheckExtension (dpy, info, 0); - - LockDisplay (dpy); - MbufGetReq (MbufGetBufferVersion, req, info); - if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { - UnlockDisplay (dpy); - SyncHandle (); - return 0; - } - *major_version_return = rep.majorVersion; - *minor_version_return = rep.minorVersion; - UnlockDisplay (dpy); - - SyncHandle (); - return 1; -} - - -/* - * XmbufCreateBuffers - - * Requests that "count" buffers be created with the given update_action - * and update_hint and be associated with the indicated window. The - * number of buffers created is returned (zero if an error occurred) - * and buffers_return is filled in with that many Multibuffer identifiers. - */ -int XmbufCreateBuffers ( - Display *dpy, - Window w, - int count, - int update_action, int update_hint, - Multibuffer *buffers) -{ - XExtDisplayInfo *info = find_display (dpy); - xMbufCreateImageBuffersReply rep; - register xMbufCreateImageBuffersReq *req; - int result; - - MbufCheckExtension (dpy, info, 0); - - LockDisplay (dpy); - - XAllocIDs(dpy, buffers, count); - MbufGetReq (MbufCreateImageBuffers, req, info); - req->window = w; - req->updateAction = update_action; - req->updateHint = update_hint; - req->length += count; - count <<= 2; - PackData32 (dpy, buffers, count); - if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { - UnlockDisplay (dpy); - SyncHandle (); - return 0; - } - result = rep.numberBuffer; - UnlockDisplay (dpy); - - SyncHandle (); - return result; -} - - -/* - * XmbufDestroyBuffers - - * Destroys the buffers associated with the given window. - */ -void XmbufDestroyBuffers (Display *dpy, Window window) -{ - XExtDisplayInfo *info = find_display (dpy); - register xMbufDestroyImageBuffersReq *req; - - MbufSimpleCheckExtension (dpy, info); - - LockDisplay (dpy); - MbufGetReq (MbufDestroyImageBuffers, req, info); - req->window = window; - UnlockDisplay (dpy); - SyncHandle (); -} - - -/* - * XmbufDisplayBuffers - - * Displays the indicated buffers their appropriate windows within - * max_delay milliseconds after min_delay milliseconds have passed. - * No two buffers may be associated with the same window or else a Matc - * error is generated. - */ -void XmbufDisplayBuffers ( - Display *dpy, - int count, - Multibuffer *buffers, - int min_delay, int max_delay) -{ - XExtDisplayInfo *info = find_display (dpy); - register xMbufDisplayImageBuffersReq *req; - - MbufSimpleCheckExtension (dpy, info); - - LockDisplay (dpy); - MbufGetReq (MbufDisplayImageBuffers, req, info); - req->minDelay = min_delay; - req->maxDelay = max_delay; - req->length += count; - count <<= 2; - PackData32 (dpy, buffers, count); - UnlockDisplay (dpy); - SyncHandle(); -} - - -/* - * XmbufGetWindowAttributes - - * Gets the multibuffering attributes that apply to all buffers associated - * with the given window. Returns non-zero on success and zero if an - * error occurs. - */ -Status XmbufGetWindowAttributes ( - Display *dpy, - Window w, - XmbufWindowAttributes *attr) -{ - XExtDisplayInfo *info = find_display (dpy); - register xMbufGetMBufferAttributesReq *req; - xMbufGetMBufferAttributesReply rep; - - MbufCheckExtension (dpy, info, 0); - - LockDisplay (dpy); - MbufGetReq (MbufGetMBufferAttributes, req, info); - req->window = w; - if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { - UnlockDisplay (dpy); - SyncHandle (); - return 0; - } - attr->buffers = (Multibuffer *) NULL; - if ((attr->nbuffers = rep.length)) { - int nbytes = rep.length * sizeof(Multibuffer); - attr->buffers = (Multibuffer *) Xmalloc((unsigned) nbytes); - nbytes = rep.length << 2; - if (! attr->buffers) { - _XEatData(dpy, (unsigned long) nbytes); - UnlockDisplay(dpy); - SyncHandle(); - return (0); - } - _XRead32 (dpy, (long *) attr->buffers, nbytes); - } - attr->displayed_index = rep.displayedBuffer; - attr->update_action = rep.updateAction; - attr->update_hint = rep.updateHint; - attr->window_mode = rep.windowMode; - - UnlockDisplay (dpy); - SyncHandle(); - return 1; -} - - -/* - * XmbufChangeWindowAttributes - - * Sets the multibuffering attributes that apply to all buffers associated - * with the given window. This is currently limited to the update_hint. - */ -void XmbufChangeWindowAttributes ( - Display *dpy, - Window w, - unsigned long valuemask, - XmbufSetWindowAttributes *attr) -{ - XExtDisplayInfo *info = find_display (dpy); - register xMbufSetMBufferAttributesReq *req; - - MbufSimpleCheckExtension (dpy, info); - - LockDisplay (dpy); - MbufGetReq (MbufSetMBufferAttributes, req, info); - req->window = w; - if ((req->valueMask = valuemask)) { /* stolen from lib/X/XWindow.c */ - unsigned long values[1]; /* one per element in if stmts below */ - unsigned long *v = values; - unsigned int nvalues; - - if (valuemask & MultibufferWindowUpdateHint) - *v++ = attr->update_hint; - req->length += (nvalues = v - values); - nvalues <<= 2; /* watch out for macros... */ - Data32 (dpy, (long *) values, (long)nvalues); - } - UnlockDisplay (dpy); - SyncHandle(); -} - - -/* - * XmbufGetBufferAttributes - - * Gets the attributes for the indicated buffer. Returns non-zero on - * success and zero if an error occurs. - */ -Status XmbufGetBufferAttributes ( - Display *dpy, - Multibuffer b, - XmbufBufferAttributes *attr) -{ - XExtDisplayInfo *info = find_display (dpy); - register xMbufGetBufferAttributesReq *req; - xMbufGetBufferAttributesReply rep; - - MbufCheckExtension (dpy, info, 0); - - LockDisplay (dpy); - MbufGetReq (MbufGetBufferAttributes, req, info); - req->buffer = b; - if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { - UnlockDisplay (dpy); - SyncHandle (); - return 0; - } - attr->window = rep.window; - attr->event_mask = rep.eventMask; - attr->buffer_index = rep.bufferIndex; - attr->side = rep.side; - - UnlockDisplay (dpy); - SyncHandle(); - return 1; -} - - -/* - * XmbufChangeBufferAttributes - - * Sets the attributes for the indicated buffer. This is currently - * limited to the event_mask. - */ -void XmbufChangeBufferAttributes ( - Display *dpy, - Multibuffer b, - unsigned long valuemask, - XmbufSetBufferAttributes *attr) -{ - XExtDisplayInfo *info = find_display (dpy); - register xMbufSetBufferAttributesReq *req; - - MbufSimpleCheckExtension (dpy, info); - - LockDisplay (dpy); - MbufGetReq (MbufSetBufferAttributes, req, info); - req->buffer = b; - if ((req->valueMask = valuemask)) { /* stolen from lib/X/XWindow.c */ - unsigned long values[1]; /* one per element in if stmts below */ - unsigned long *v = values; - unsigned int nvalues; - - if (valuemask & MultibufferBufferEventMask) - *v++ = attr->event_mask; - req->length += (nvalues = v - values); - nvalues <<= 2; /* watch out for macros... */ - Data32 (dpy, (long *) values, (long)nvalues); - } - UnlockDisplay (dpy); - SyncHandle(); -} - - - -/* - * XmbufGetScreenInfo - - * Gets the parameters controlling how mono and stereo windows may be - * created on the indicated screen. The numbers of sets of visual and - * depths are returned in nmono_return and nstereo_return. If - * nmono_return is greater than zero, then mono_info_return is set to - * the address of an array of XmbufBufferInfo structures describing the - * various visuals and depths that may be used. Otherwise, - * mono_info_return is set to NULL. Similarly, stereo_info_return is - * set according to nstereo_return. The storage returned in - * mono_info_return and stereo_info_return may be released by XFree. - * If no errors are encounted, non-zero will be returned. - */ -Status XmbufGetScreenInfo ( - Display *dpy, - Drawable d, - int *nmono_return, - XmbufBufferInfo **mono_info_return, - int *nstereo_return, - XmbufBufferInfo **stereo_info_return) -{ - XExtDisplayInfo *info = find_display (dpy); - register xMbufGetBufferInfoReq *req; - xMbufGetBufferInfoReply rep; - int nmono, nstereo; - XmbufBufferInfo *minfo, *sinfo; - - MbufCheckExtension (dpy, info, 0); - - LockDisplay (dpy); - MbufGetReq (MbufGetBufferInfo, req, info); - req->drawable = d; - if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { - UnlockDisplay (dpy); - SyncHandle (); - return 0; - } - nmono = rep.normalInfo; - nstereo = rep.stereoInfo; - minfo = ((nmono > 0) ? read_buffer_info (dpy, nmono) : NULL); - sinfo = ((nstereo > 0) ? read_buffer_info (dpy, nstereo) : NULL); - - /* check for bad reads indicating we need to return an error */ - if ((nmono > 0 && !minfo) || (nstereo > 0 && !sinfo)) { - if (minfo) Xfree ((char *) minfo); - if (sinfo) Xfree ((char *) sinfo); - UnlockDisplay (dpy); - SyncHandle(); - return 0; - } - - *nmono_return = nmono; - *mono_info_return = minfo; - *nstereo_return = nstereo; - *stereo_info_return = sinfo; - - UnlockDisplay (dpy); - SyncHandle(); - return 1; -} - - -/* - * XmbufCreateStereoWindow - - * Creates a stereo window in the same way that XCreateWindow creates - * a mono window (in fact, use the same code, except for the request) - * and returns the left and right buffers that may be - */ -Window XmbufCreateStereoWindow ( - Display *dpy, - Window parent, - int x, int y, - unsigned int width, unsigned int height, unsigned int border_width, - int depth, - unsigned int class, - Visual *visual, - unsigned long valuemask, - XSetWindowAttributes *attr, - Multibuffer *leftp, Multibuffer *rightp) -{ - XExtDisplayInfo *info = find_display (dpy); - Window wid; - register xMbufCreateStereoWindowReq *req; - - MbufCheckExtension (dpy, info, None); - - LockDisplay(dpy); - MbufGetReq(MbufCreateStereoWindow, req, info); - wid = req->wid = XAllocID(dpy); - req->parent = parent; - req->left = *leftp = XAllocID (dpy); - req->right = *rightp = XAllocID (dpy); - req->x = x; - req->y = y; - req->width = width; - req->height = height; - req->borderWidth = border_width; - req->depth = depth; - req->class = class; - if (visual == CopyFromParent) - req->visual = CopyFromParent; - else - req->visual = visual->visualid; - valuemask &= (CWBackPixmap|CWBackPixel|CWBorderPixmap| - CWBorderPixel|CWBitGravity|CWWinGravity| - CWBackingStore|CWBackingPlanes|CWBackingPixel| - CWOverrideRedirect|CWSaveUnder|CWEventMask| - CWDontPropagate|CWColormap|CWCursor); - if ((req->mask = valuemask)) { - unsigned long values[32]; - register unsigned long *value = values; - unsigned int nvalues; - - if (valuemask & CWBackPixmap) - *value++ = attr->background_pixmap; - if (valuemask & CWBackPixel) - *value++ = attr->background_pixel; - if (valuemask & CWBorderPixmap) - *value++ = attr->border_pixmap; - if (valuemask & CWBorderPixel) - *value++ = attr->border_pixel; - if (valuemask & CWBitGravity) - *value++ = attr->bit_gravity; - if (valuemask & CWWinGravity) - *value++ = attr->win_gravity; - if (valuemask & CWBackingStore) - *value++ = attr->backing_store; - if (valuemask & CWBackingPlanes) - *value++ = attr->backing_planes; - if (valuemask & CWBackingPixel) - *value++ = attr->backing_pixel; - if (valuemask & CWOverrideRedirect) - *value++ = attr->override_redirect; - if (valuemask & CWSaveUnder) - *value++ = attr->save_under; - if (valuemask & CWEventMask) - *value++ = attr->event_mask; - if (valuemask & CWDontPropagate) - *value++ = attr->do_not_propagate_mask; - if (valuemask & CWColormap) - *value++ = attr->colormap; - if (valuemask & CWCursor) - *value++ = attr->cursor; - req->length += (nvalues = value - values); - - nvalues <<= 2; /* watch out for macros... */ - Data32 (dpy, (long *) values, (long)nvalues); - } - UnlockDisplay(dpy); - SyncHandle(); - return wid; -} - -void XmbufClearBufferArea ( - Display *dpy, - Multibuffer buffer, - int x, int y, - unsigned int width, unsigned int height, - Bool exposures) -{ - XExtDisplayInfo *info = find_display (dpy); - register xMbufClearImageBufferAreaReq *req; - - MbufSimpleCheckExtension (dpy, info); - - LockDisplay (dpy); - MbufGetReq (MbufClearImageBufferArea, req, info); - req->buffer = buffer; - req->x = x; - req->y = y; - req->width = width; - req->height = height; - req->exposures = exposures; - UnlockDisplay (dpy); - SyncHandle(); -} - diff --git a/nx-X11/lib/Xext/Xcup.c b/nx-X11/lib/Xext/Xcup.c deleted file mode 100644 index 8bf2bb29e..000000000 --- a/nx-X11/lib/Xext/Xcup.c +++ /dev/null @@ -1,265 +0,0 @@ -/* $XFree86: xc/lib/Xext/Xcup.c,v 1.8 2002/10/16 02:19:22 dawes Exp $ */ -/* - -Copyright 1987, 1988, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $Xorg: Xcup.c,v 1.5 2001/02/09 02:03:49 xorgcvs Exp $ */ - -#ifdef WIN32 -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <nx-X11/Xwindows.h> -#endif - -#define NEED_EVENTS -#define NEED_REPLIES -#include <nx-X11/Xlibint.h> -#include <nx-X11/extensions/Xcupstr.h> -#include <nx-X11/extensions/Xext.h> -#include <nx-X11/extensions/extutil.h> - -static XExtensionInfo _xcup_info_data; -static XExtensionInfo *xcup_info = &_xcup_info_data; -static char *xcup_extension_name = XCUPNAME; - -/***************************************************************************** - * * - * private utility routines * - * * - *****************************************************************************/ - -static int close_display(Display *dpy, XExtCodes *codes); -static /* const */ XExtensionHooks xcup_extension_hooks = { - NULL, /* create_gc */ - NULL, /* copy_gc */ - NULL, /* flush_gc */ - NULL, /* free_gc */ - NULL, /* create_font */ - NULL, /* free_font */ - close_display, /* close_display */ - NULL, /* wire_to_event */ - NULL, /* event_to_wire */ - NULL, /* error */ - NULL, /* error_string */ -}; - -static XEXT_GENERATE_FIND_DISPLAY (find_display, xcup_info, - xcup_extension_name, - &xcup_extension_hooks, - 0, NULL) - -static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xcup_info) - - -/***************************************************************************** - * * - * public Xcup Extension routines * - * * - *****************************************************************************/ - -Status -XcupQueryVersion( - Display* dpy, - int* major_version_return, - int* minor_version_return) -{ - XExtDisplayInfo *info = find_display (dpy); - xXcupQueryVersionReply rep; - xXcupQueryVersionReq *req; - - XextCheckExtension (dpy, info, xcup_extension_name, False); - - LockDisplay(dpy); - GetReq(XcupQueryVersion, req); - req->reqType = info->codes->major_opcode; - req->xcupReqType = X_XcupQueryVersion; - req->client_major_version = XCUP_MAJOR_VERSION; - req->client_minor_version = XCUP_MINOR_VERSION; - if (!_XReply(dpy, (xReply *)&rep, 0, xTrue)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - *major_version_return = rep.server_major_version; - *minor_version_return = rep.server_minor_version; - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -/* Win32 reserves 20 colormap entries for its desktop */ -#ifndef TYP_RESERVED_ENTRIES -#define TYP_RESERVED_ENTRIES 20 -#endif - -Status -XcupGetReservedColormapEntries( - Display* dpy, - int screen, - XColor** colors_out, - int* ncolors) -{ - XExtDisplayInfo *info = find_display (dpy); - xXcupGetReservedColormapEntriesReply rep; - xXcupGetReservedColormapEntriesReq *req; - xColorItem rbuf[TYP_RESERVED_ENTRIES]; - - *ncolors = 0; - - XextCheckExtension (dpy, info, xcup_extension_name, False); - - LockDisplay(dpy); - GetReq(XcupGetReservedColormapEntries, req); - req->reqType = info->codes->major_opcode; - req->xcupReqType = X_XcupGetReservedColormapEntries; - req->screen = screen; - if (_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - long nbytes; - xColorItem* rbufp; - int nentries = rep.length / 3; - - nbytes = nentries * SIZEOF (xColorItem); - if (nentries > TYP_RESERVED_ENTRIES) - rbufp = (xColorItem*) Xmalloc (nbytes); - else - rbufp = rbuf; - - if (rbufp == NULL) { - _XEatData (dpy, (unsigned long) nbytes); - UnlockDisplay (dpy); - SyncHandle (); - return False; - } - _XRead (dpy, (char*) rbufp, nbytes); - - *colors_out = (XColor*) Xmalloc (nentries * sizeof (XColor)); - if (*colors_out) { - xColorItem* cs = (xColorItem *) rbufp; - XColor* cd = *colors_out; - int i; - - *ncolors = nentries; - for (i = 0; i < *ncolors; i++, cd++) { - cd->pixel = cs->pixel; - cd->red = cs->red; - cd->green = cs->green; - cd->blue = cs->blue; - cs = (xColorItem*) (((char*) cs) + SIZEOF(xColorItem)); - } - if (rbufp != rbuf) XFree ((char*) rbufp); - UnlockDisplay(dpy); - SyncHandle(); - return True; - } - if (rbufp != rbuf) XFree ((char*) rbufp); - } - UnlockDisplay(dpy); - SyncHandle(); - return False; -} - -Status -XcupStoreColors( - Display* dpy, - Colormap colormap, - XColor* colors_in_out, - int ncolors) -{ - XExtDisplayInfo *info = find_display (dpy); - xXcupStoreColorsReply rep; - xXcupStoreColorsReq *req; - xColorItem rbuf[256]; - xColorItem citem; - int i; - XColor* xcp; - - XextCheckExtension (dpy, info, xcup_extension_name, False); - - LockDisplay(dpy); - GetReq(XcupStoreColors, req); - req->reqType = info->codes->major_opcode; - req->xcupReqType = X_XcupStoreColors; - req->cmap = colormap; - req->length += (ncolors * SIZEOF(xColorItem)) >> 2; - - for (i = 0, xcp = colors_in_out; i < ncolors; i++, xcp++) { - citem.pixel = xcp->pixel; - citem.red = xcp->red; - citem.green = xcp->green; - citem.blue = xcp->blue; - - /* note that xColorItem doesn't contain all 16-bit quantities, so - we can't use Data16 */ - Data(dpy, (char *)&citem, (long) SIZEOF(xColorItem)); - } - - if (_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - long nbytes; - xColorItem* rbufp; - xColorItem* cs; - int nentries = rep.length / 3; - - nbytes = nentries * SIZEOF (xColorItem); - - if (nentries != ncolors) { - _XEatData (dpy, (unsigned long) nbytes); - UnlockDisplay (dpy); - SyncHandle (); - return False; - } - - if (ncolors > 256) - rbufp = (xColorItem*) Xmalloc (nbytes); - else - rbufp = rbuf; - - if (rbufp == NULL) { - _XEatData (dpy, (unsigned long) nbytes); - UnlockDisplay (dpy); - SyncHandle (); - return False; - - } - - _XRead (dpy, (char*) rbufp, nbytes); - - for (i = 0, xcp = colors_in_out, cs = rbufp; i < ncolors; i++, xcp++, cs++) { - xcp->pixel = cs->pixel; - xcp->red = cs->red; - xcp->green = cs->green; - xcp->blue = cs->blue; - xcp->flags = cs->flags; - } - if (rbufp != rbuf) XFree ((char*)rbufp); - - UnlockDisplay(dpy); - SyncHandle(); - return True; - } - UnlockDisplay(dpy); - SyncHandle(); - return False; -} - diff --git a/nx-X11/lib/Xext/Xdbe.c b/nx-X11/lib/Xext/Xdbe.c deleted file mode 100644 index 05df171f6..000000000 --- a/nx-X11/lib/Xext/Xdbe.c +++ /dev/null @@ -1,474 +0,0 @@ -/* $Xorg: Xdbe.c,v 1.4 2000/08/17 19:45:53 cpqbld Exp $ */ -/****************************************************************************** - * - * Copyright (c) 1994, 1995 Hewlett-Packard Company - * - * 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 HEWLETT-PACKARD COMPANY 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 Hewlett-Packard - * Company 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 Hewlett-Packard Company. - * - * Xlib DBE code - * - *****************************************************************************/ -/* $XFree86: xc/lib/Xext/Xdbe.c,v 3.7 2002/10/16 02:19:22 dawes Exp $ */ - -#define NEED_EVENTS -#define NEED_REPLIES -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <stdio.h> -#include <nx-X11/Xlibint.h> -#include <nx-X11/extensions/Xext.h> -#include <nx-X11/extensions/extutil.h> -#define NEED_DBE_PROTOCOL -#include <nx-X11/extensions/Xdbe.h> - -static XExtensionInfo _dbe_info_data; -static XExtensionInfo *dbe_info = &_dbe_info_data; -static char *dbe_extension_name = DBE_PROTOCOL_NAME; - -#define DbeCheckExtension(dpy,i,val) \ - XextCheckExtension (dpy, i, dbe_extension_name, val) -#define DbeSimpleCheckExtension(dpy,i) \ - XextSimpleCheckExtension (dpy, i, dbe_extension_name) - -#if !defined(UNIXCPP) -#define DbeGetReq(name,req,info) GetReq (name, req); \ - req->reqType = info->codes->major_opcode; \ - req->dbeReqType = X_##name; -#else -#define DbeGetReq(name,req,info) GetReq (name, req); \ - req->reqType = info->codes->major_opcode; \ - req->dbeReqType = X_/**/name; -#endif - - -/***************************************************************************** - * * - * private utility routines * - * * - *****************************************************************************/ - -/* - * find_display - locate the display info block - */ -static int close_display(Display *dpy, XExtCodes *codes); -static char *error_string(Display *dpy, int code, XExtCodes *codes, - char *buf, int n); -static XExtensionHooks dbe_extension_hooks = { - NULL, /* create_gc */ - NULL, /* copy_gc */ - NULL, /* flush_gc */ - NULL, /* free_gc */ - NULL, /* create_font */ - NULL, /* free_font */ - close_display, /* close_display */ - NULL, /* wire_to_event */ - NULL, /* event_to_wire */ - NULL, /* error */ - error_string, /* error_string */ -}; - -static char *dbe_error_list[] = { - "BadBuffer", /* DbeBadBuffer */ -}; - -static XEXT_GENERATE_FIND_DISPLAY (find_display, dbe_info, - dbe_extension_name, - &dbe_extension_hooks, - DbeNumberEvents, NULL) - -static XEXT_GENERATE_CLOSE_DISPLAY (close_display, dbe_info) - -static XEXT_GENERATE_ERROR_STRING (error_string, dbe_extension_name, - DbeNumberErrors, - dbe_error_list) - - -/***************************************************************************** - * * - * Double-Buffering public interfaces * - * * - *****************************************************************************/ - -/* - * XdbeQueryExtension - - * Sets major_version_return and minor_verion_return to the major and - * minor DBE protocol version supported by the server. If the DBE - * library is compatible with the version returned by the server, this - * function returns non-zero. If dpy does not support the DBE - * extension, or if there was an error during communication with the - * server, or if the server and library protocol versions are - * incompatible, this functions returns zero. No other Xdbe functions - * may be called before this function. If a client violates this rule, - * the effects of all subsequent Xdbe calls are undefined. - */ -Status XdbeQueryExtension ( - Display *dpy, - int *major_version_return, - int *minor_version_return) -{ - XExtDisplayInfo *info = find_display (dpy); - xDbeGetVersionReply rep; - register xDbeGetVersionReq *req; - - if (!XextHasExtension (info)) - return (Status)0; /* failure */ - - LockDisplay (dpy); - DbeGetReq (DbeGetVersion, req, info); - req->majorVersion = DBE_MAJOR_VERSION; - req->minorVersion = DBE_MINOR_VERSION; - - if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { - UnlockDisplay (dpy); - SyncHandle (); - return (Status)0; /* failure */ - } - *major_version_return = rep.majorVersion; - *minor_version_return = rep.minorVersion; - UnlockDisplay (dpy); - - SyncHandle (); - - if (*major_version_return != DBE_MAJOR_VERSION) - return (Status)0; /* failure */ - else - return (Status)1; /* success */ -} - - -/* - * XdbeAllocateBackBuffer - - * This function returns a drawable ID used to refer to the back buffer - * of the specified window. The swap_action is a hint to indicate the - * swap action that will likely be used in subsequent calls to - * XdbeSwapBuffers. The actual swap action used in calls to - * XdbeSwapBuffers does not have to be the same as the swap_action - * passed to this function, though clients are encouraged to provide - * accurate information whenever possible. - */ - -XdbeBackBuffer XdbeAllocateBackBufferName( - Display *dpy, - Window window, - XdbeSwapAction swap_action) -{ - XExtDisplayInfo *info = find_display (dpy); - register xDbeAllocateBackBufferNameReq *req; - XdbeBackBuffer buffer; - - /* make sure extension is available; if not, return the - * third parameter (0). - */ - DbeCheckExtension (dpy, info, (XdbeBackBuffer)0); - - /* allocate the id */ - buffer = XAllocID (dpy); - - LockDisplay(dpy); - DbeGetReq(DbeAllocateBackBufferName, req, info); - req->window = window; - req->swapAction = (unsigned char)swap_action; - req->buffer = buffer; - - UnlockDisplay (dpy); - SyncHandle (); - return buffer; - -} /* XdbeAllocateBackBufferName() */ - -/* - * XdbeDeallocateBackBufferName - - * This function frees a drawable ID, buffer, that was obtained via - * XdbeAllocateBackBufferName. The buffer must refer to the back buffer - * of the specified window, or a protocol error results. - */ -Status XdbeDeallocateBackBufferName ( - Display *dpy, - XdbeBackBuffer buffer) -{ - XExtDisplayInfo *info = find_display (dpy); - register xDbeDeallocateBackBufferNameReq *req; - - DbeCheckExtension (dpy, info, (Status)0 /* failure */); - - LockDisplay (dpy); - DbeGetReq (DbeDeallocateBackBufferName, req, info); - req->buffer = buffer; - UnlockDisplay (dpy); - SyncHandle (); - - return (Status)1; /* success */ -} - - -/* - * XdbeSwapBuffers - - * This function swaps the front and back buffers for a list of windows. - * The argument num_windows specifies how many windows are to have their - * buffers swapped; it is the number of elements in the swap_info array. - * The argument swap_info specifies the information needed per window - * to do the swap. - */ -Status XdbeSwapBuffers ( - Display *dpy, - XdbeSwapInfo *swap_info, - int num_windows) -{ - XExtDisplayInfo *info = find_display (dpy); - register xDbeSwapBuffersReq *req; - int i; - - DbeCheckExtension (dpy, info, (Status)0 /* failure */); - - LockDisplay (dpy); - DbeGetReq (DbeSwapBuffers, req, info); - req->length += 2*num_windows; - req->n = num_windows; - - /* We need to handle 64-bit machines, where we can not use PackData32 - * directly because info would be lost in translating from 32- to 64-bit. - * Instead we send data via a loop that accounts for the translation. - */ - for (i = 0; i < num_windows; i++) - { - char tmp[4]; - Data32 (dpy, (long *)&swap_info[i].swap_window, 4); - tmp[0] = swap_info[i].swap_action; - Data (dpy, (char *)tmp, 4); - } - - UnlockDisplay (dpy); - SyncHandle (); - - - return (Status)1; /* success */ - -} /* XdbeSwapBuffers() */ - - -/* - * XdbeBeginIdiom - - * This function marks the beginning of an idiom sequence. - */ -Status XdbeBeginIdiom (Display *dpy) -{ - XExtDisplayInfo *info = find_display(dpy); - register xDbeBeginIdiomReq *req; - - DbeCheckExtension (dpy, info, (Status)0 /* failure */); - - LockDisplay (dpy); - DbeGetReq (DbeBeginIdiom, req, info); - UnlockDisplay (dpy); - SyncHandle (); - - return (Status)1; /* success */ -} - - -/* - * XdbeEndIdiom - - * This function marks the end of an idiom sequence. - */ -Status XdbeEndIdiom (Display *dpy) -{ - XExtDisplayInfo *info = find_display(dpy); - register xDbeEndIdiomReq *req; - - DbeCheckExtension (dpy, info, (Status)0 /* failure */); - - LockDisplay (dpy); - DbeGetReq (DbeEndIdiom, req, info); - UnlockDisplay (dpy); - SyncHandle (); - - return (Status)1; /* success */ -} - - -/* - * XdbeGetVisualInfo - - * This function returns information about which visuals support - * double buffering. The argument num_screens specifies how many - * elements there are in the screen_specifiers list. Each drawable - * in screen_specifiers designates a screen for which the supported - * visuals are being requested. If num_screens is zero, information - * for all screens is requested. In this case, upon return from this - * function, num_screens will be set to the number of screens that were - * found. If an error occurs, this function returns NULL, else it returns - * a pointer to a list of XdbeScreenVisualInfo structures of length - * num_screens. The nth element in the returned list corresponds to the - * nth drawable in the screen_specifiers list, unless num_screens was - * passed in with the value zero, in which case the nth element in the - * returned list corresponds to the nth screen of the server, starting - * with screen zero. - */ -XdbeScreenVisualInfo *XdbeGetVisualInfo ( - Display *dpy, - Drawable *screen_specifiers, - int *num_screens) /* SEND and RETURN */ -{ - XExtDisplayInfo *info = find_display(dpy); - register xDbeGetVisualInfoReq *req; - xDbeGetVisualInfoReply rep; - XdbeScreenVisualInfo *scrVisInfo; - int i; - - DbeCheckExtension (dpy, info, (XdbeScreenVisualInfo *)NULL); - - LockDisplay (dpy); - - DbeGetReq(DbeGetVisualInfo, req, info); - req->length = 2 + *num_screens; - req->n = *num_screens; - Data32 (dpy, screen_specifiers, (*num_screens * sizeof (CARD32))); - - if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { - UnlockDisplay (dpy); - SyncHandle (); - return NULL; - } - - /* return the number of screens actually found if we - * requested information about all screens (*num_screens == 0) - */ - if (*num_screens == 0) - *num_screens = rep.m; - - /* allocate list of visual information to be returned */ - if (!(scrVisInfo = - (XdbeScreenVisualInfo *)Xmalloc( - (unsigned)(*num_screens * sizeof(XdbeScreenVisualInfo))))) { - UnlockDisplay (dpy); - SyncHandle (); - return NULL; - } - - for (i = 0; i < *num_screens; i++) - { - int nbytes; - int j; - long c; - - _XRead32 (dpy, &c, sizeof(CARD32)); - scrVisInfo[i].count = c; - - nbytes = scrVisInfo[i].count * sizeof(XdbeVisualInfo); - - /* if we can not allocate the list of visual/depth info - * then free the lists that we already allocate as well - * as the visual info list itself - */ - if (!(scrVisInfo[i].visinfo = (XdbeVisualInfo *)Xmalloc( - (unsigned)nbytes))) { - for (j = 0; j < i; j++) { - Xfree ((char *)scrVisInfo[j].visinfo); - } - Xfree ((char *)scrVisInfo); - UnlockDisplay (dpy); - SyncHandle (); - return NULL; - } - - /* Read the visual info item into the wire structure. Then copy each - * element into the library structure. The element sizes and/or - * padding may be different in the two structures. - */ - for (j = 0; j < scrVisInfo[i].count; j++) { - xDbeVisInfo xvi; - - _XRead (dpy, (char *)&xvi, sizeof(xDbeVisInfo)); - scrVisInfo[i].visinfo[j].visual = xvi.visualID; - scrVisInfo[i].visinfo[j].depth = xvi.depth; - scrVisInfo[i].visinfo[j].perflevel = xvi.perfLevel; - } - - } - - UnlockDisplay (dpy); - SyncHandle (); - return scrVisInfo; - -} /* XdbeGetVisualInfo() */ - - -/* - * XdbeFreeVisualInfo - - * This function frees the list of XdbeScreenVisualInfo returned by the - * function XdbeGetVisualInfo. - */ -void XdbeFreeVisualInfo(XdbeScreenVisualInfo *visual_info) -{ - if (visual_info == NULL) { - return; - } - - if (visual_info->visinfo) { - XFree(visual_info->visinfo); - } - - XFree(visual_info); -} - - -/* - * XdbeGetBackBufferAttributes - - * This function returns the attributes associated with the specified - * buffer. - */ -XdbeBackBufferAttributes *XdbeGetBackBufferAttributes( - Display *dpy, - XdbeBackBuffer buffer) -{ - XExtDisplayInfo *info = find_display(dpy); - register xDbeGetBackBufferAttributesReq *req; - xDbeGetBackBufferAttributesReply rep; - XdbeBackBufferAttributes *attr; - - DbeCheckExtension(dpy, info, (XdbeBackBufferAttributes *)NULL); - - if (!(attr = - (XdbeBackBufferAttributes *)Xmalloc(sizeof(XdbeBackBufferAttributes)))) { - return NULL; - } - - LockDisplay(dpy); - DbeGetReq(DbeGetBackBufferAttributes, req, info); - req->buffer = buffer; - - if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { - UnlockDisplay (dpy); - SyncHandle (); - return NULL; - } - attr->window = rep.attributes; - - UnlockDisplay (dpy); - SyncHandle (); - - return attr; -} - diff --git a/nx-X11/lib/Xext/Xext-def.cpp b/nx-X11/lib/Xext/Xext-def.cpp index fcd9f49a2..6ee37c70f 100644 --- a/nx-X11/lib/Xext/Xext-def.cpp +++ b/nx-X11/lib/Xext/Xext-def.cpp @@ -1,9 +1,6 @@ LIBRARY XEXT VERSION LIBRARY_VERSION EXPORTS - XMITMiscGetBugMode - XMITMiscQueryExtension - XMITMiscSetBugMode XMissingExtension XSetExtensionErrorHandler XShapeCombineMask @@ -76,46 +73,11 @@ EXPORTS XextDestroyExtension XextFindDisplay XextRemoveDisplay - XmbufChangeBufferAttributes - XmbufChangeWindowAttributes - XmbufClearBufferArea - XmbufCreateBuffers - XmbufCreateStereoWindow - XmbufDestroyBuffers - XmbufDisplayBuffers - XmbufGetBufferAttributes - XmbufGetScreenInfo - XmbufGetVersion - XmbufGetWindowAttributes - XmbufQueryExtension - XdbeQueryExtension - XdbeAllocateBackBufferName - XdbeDeallocateBackBufferName - XdbeSwapBuffers - XdbeBeginIdiom - XdbeEndIdiom - XdbeGetVisualInfo - XdbeFreeVisualInfo - XdbeGetBackBufferAttributes XSecurityQueryExtension XSecurityAllocXauth XSecurityFreeXauth XSecurityGenerateAuthorization XSecurityRevokeAuthorization - XagQueryVersion - XagCreateAssociation - XagCreateEmbeddedApplicationGroup - XagCreateNonembeddedApplicationGroup - XagDestroyApplicationGroup - XagDestroyAssociation - XagGetApplicationGroupAttributes - XagQueryApplicationGroup - XLbxQueryExtension - XLbxGetEventBase - XLbxQueryVersion - XcupGetReservedColormapEntries - XcupQueryVersion - XcupStoreColors #if !defined(__CYGWIN__) && !defined(__UNIXOS2__) XPanoramiXQueryVersion XPanoramiXAllocInfo @@ -133,8 +95,5 @@ EXPORTS DPMSDisable DPMSForceLevel DPMSInfo - XeviQueryExtension - XeviQueryVersion - XeviGetVisualInfo /* $Xorg: Xext-def.cpp,v 1.3 2000/08/17 19:45:53 cpqbld Exp $ */ /* $XFree86: xc/lib/Xext/Xext-def.cpp,v 1.8 2001/05/06 10:35:51 alanh Exp $ */ |