aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/Xext
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/lib/Xext')
-rw-r--r--nx-X11/lib/Xext/Imakefile48
-rw-r--r--nx-X11/lib/Xext/XShape.c490
-rw-r--r--nx-X11/lib/Xext/XShm.c437
-rw-r--r--nx-X11/lib/Xext/extutil.c273
-rw-r--r--nx-X11/lib/Xext/globals.c90
5 files changed, 0 insertions, 1338 deletions
diff --git a/nx-X11/lib/Xext/Imakefile b/nx-X11/lib/Xext/Imakefile
deleted file mode 100644
index e96e23510..000000000
--- a/nx-X11/lib/Xext/Imakefile
+++ /dev/null
@@ -1,48 +0,0 @@
-XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:45:50 cpqbld Exp $
-XCOMM $XFree86: xc/lib/Xext/Imakefile,v 1.12 2002/10/16 00:37:27 dawes Exp $
-
- NULL =
-
-#define DoNormalLib NormalLibXext
-#define DoSharedLib SharedLibXext
-#define DoExtraLib SharedLibXext
-#define DoDebugLib DebugLibXext
-#define DoProfileLib ProfileLibXext
-#define LibName NX_Xext
-#define SoRev SOXEXTREV
-#define LibHeaders NO
-
-#include <Threads.tmpl>
-
-#ifdef SharedXextReqs
-REQUIREDLIBS = SharedXextReqs
-#endif
-
-#if HasShm
- SHMSRCS = XShm.c
- SHMOBJS = XShm.o
-#endif
-
-#if Malloc0ReturnsNull
-ALLOC_DEFINES = Malloc0ReturnsNullDefines
-#endif
-
- DEFINES = $(ALLOC_DEFINES)
- INCLUDES = -I$(XLIBSRC)
- SRCS = globals.c \
- extutil.c \
- XShape.c \
- $(SHMSRCS) \
- $(NULL)
-
- OBJS = globals.o \
- extutil.o \
- XShape.o \
- $(SHMOBJS) \
- $(NULL)
-
- LINTLIBS = $(LINTXLIB)
-
-#include <Library.tmpl>
-
-DependTarget()
diff --git a/nx-X11/lib/Xext/XShape.c b/nx-X11/lib/Xext/XShape.c
deleted file mode 100644
index 79b4b78f6..000000000
--- a/nx-X11/lib/Xext/XShape.c
+++ /dev/null
@@ -1,490 +0,0 @@
-/*
- * $Xorg: XShape.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.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-/* $XFree86: xc/lib/Xext/XShape.c,v 1.3 2002/10/16 00:37:27 dawes Exp $ */
-#define NEED_EVENTS
-#define NEED_REPLIES
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <nx-X11/Xlibint.h>
-#include <nx-X11/Xutil.h>
-#include <nx-X11/Xregion.h>
-#include <nx-X11/extensions/Xext.h>
-#include <nx-X11/extensions/extutil.h>
-#include <nx-X11/extensions/shapestr.h>
-
-static XExtensionInfo _shape_info_data;
-static XExtensionInfo *shape_info = &_shape_info_data;
-static /* const */ char *shape_extension_name = SHAPENAME;
-
-#define ShapeCheckExtension(dpy,i,val) \
- XextCheckExtension (dpy, i, shape_extension_name, val)
-#define ShapeSimpleCheckExtension(dpy,i) \
- XextSimpleCheckExtension (dpy, i, shape_extension_name)
-
-
-/*****************************************************************************
- * *
- * private utility routines *
- * *
- *****************************************************************************/
-
-static int close_display(Display *dpy, XExtCodes *codes);
-static Bool wire_to_event (Display *dpy, XEvent *re, xEvent *event);
-static Status event_to_wire (Display *dpy, XEvent *re, xEvent *event);
-static /* const */ XExtensionHooks shape_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 */
- NULL, /* error_string */
-};
-
-static XEXT_GENERATE_FIND_DISPLAY (find_display, shape_info,
- shape_extension_name,
- &shape_extension_hooks,
- ShapeNumberEvents, NULL)
-
-static XEXT_GENERATE_CLOSE_DISPLAY (close_display, shape_info)
-
-
-static Bool
-wire_to_event (Display *dpy, XEvent *re, xEvent *event)
-{
- XExtDisplayInfo *info = find_display (dpy);
- XShapeEvent *se;
- xShapeNotifyEvent *sevent;
-
- ShapeCheckExtension (dpy, info, False);
-
- switch ((event->u.u.type & 0x7f) - info->codes->first_event) {
- case ShapeNotify:
- se = (XShapeEvent *) re;
- sevent = (xShapeNotifyEvent *) event;
- se->type = sevent->type & 0x7f;
- se->serial = _XSetLastRequestRead(dpy,(xGenericReply *) event);
- se->send_event = (sevent->type & 0x80) != 0;
- se->display = dpy;
- se->window = sevent->window;
- se->kind = sevent->kind;
- se->x = cvtINT16toInt (sevent->x);
- se->y = cvtINT16toInt (sevent->y);
- se->width = sevent->width;
- se->height = sevent->height;
- se->time = sevent->time;
- se->shaped = True;
- if (sevent->shaped == xFalse)
- se->shaped = False;
- return True;
- }
- return False;
-}
-
-static Status
-event_to_wire (Display *dpy, XEvent *re, xEvent *event)
-{
- XExtDisplayInfo *info = find_display (dpy);
- XShapeEvent *se;
- xShapeNotifyEvent *sevent;
-
- ShapeCheckExtension (dpy, info, 0);
-
- switch ((re->type & 0x7f) - info->codes->first_event) {
- case ShapeNotify:
- se = (XShapeEvent *) re;
- sevent = (xShapeNotifyEvent *) event;
- sevent->type = se->type | (se->send_event ? 0x80 : 0);
- sevent->sequenceNumber = se->serial & 0xffff;
- sevent->window = se->window;
- sevent->kind = se->kind;
- sevent->x = se->x;
- sevent->y = se->y;
- sevent->width = se->width;
- sevent->height = se->height;
- sevent->time = se->time;
- return 1;
- }
- return 0;
-}
-
-
-/****************************************************************************
- * *
- * Shape public interfaces *
- * *
- ****************************************************************************/
-
-Bool XShapeQueryExtension (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 XShapeQueryVersion(
- Display *dpy,
- int *major_versionp,
- int *minor_versionp)
-{
- XExtDisplayInfo *info = find_display (dpy);
- xShapeQueryVersionReply rep;
- register xShapeQueryVersionReq *req;
-
- ShapeCheckExtension (dpy, info, 0);
-
- LockDisplay (dpy);
- GetReq (ShapeQueryVersion, req);
- req->reqType = info->codes->major_opcode;
- req->shapeReqType = X_ShapeQueryVersion;
- if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
- UnlockDisplay (dpy);
- SyncHandle ();
- return 0;
- }
- *major_versionp = rep.majorVersion;
- *minor_versionp = rep.minorVersion;
- UnlockDisplay (dpy);
- SyncHandle ();
- return 1;
-}
-
-void XShapeCombineRegion(
- register Display *dpy,
- Window dest,
- int destKind, int xOff, int yOff,
- register REGION *r,
- int op)
-{
- XExtDisplayInfo *info = find_display (dpy);
- register xShapeRectanglesReq *req;
- register long nbytes;
- register int i;
- register XRectangle *xr, *pr;
- register BOX *pb;
-
- ShapeSimpleCheckExtension (dpy, info);
-
- LockDisplay(dpy);
- GetReq(ShapeRectangles, req);
- xr = (XRectangle *)
- _XAllocScratch(dpy, (unsigned long)(r->numRects * sizeof (XRectangle)));
- for (pr = xr, pb = r->rects, i = r->numRects; --i >= 0; pr++, pb++) {
- pr->x = pb->x1;
- pr->y = pb->y1;
- pr->width = pb->x2 - pb->x1;
- pr->height = pb->y2 - pb->y1;
- }
- req->reqType = info->codes->major_opcode;
- req->shapeReqType = X_ShapeRectangles;
- req->op = op;
- req->ordering = YXBanded;
- req->destKind = destKind;
- req->dest = dest;
- req->xOff = xOff;
- req->yOff = yOff;
-
- /* SIZEOF(xRectangle) will be a multiple of 4 */
- req->length += r->numRects * (SIZEOF(xRectangle) / 4);
-
- nbytes = r->numRects * sizeof(xRectangle);
-
- Data16 (dpy, (short *) xr, nbytes);
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-
-void XShapeCombineRectangles (
- register Display *dpy,
- XID dest,
- int destKind, int xOff, int yOff,
- XRectangle *rects,
- int n_rects,
- int op, int ordering)
-{
- XExtDisplayInfo *info = find_display (dpy);
- register xShapeRectanglesReq *req;
- register long nbytes;
-
- ShapeSimpleCheckExtension (dpy, info);
-
- LockDisplay(dpy);
- GetReq(ShapeRectangles, req);
- req->reqType = info->codes->major_opcode;
- req->shapeReqType = X_ShapeRectangles;
- req->op = op;
- req->ordering = ordering;
- req->destKind = destKind;
- req->dest = dest;
- req->xOff = xOff;
- req->yOff = yOff;
-
- /* SIZEOF(xRectangle) will be a multiple of 4 */
- req->length += n_rects * (SIZEOF(xRectangle) / 4);
-
- nbytes = n_rects * sizeof(xRectangle);
-
- Data16 (dpy, (short *) rects, nbytes);
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-
-void XShapeCombineMask (
- register Display *dpy,
- XID dest,
- int destKind,
- int xOff, int yOff,
- Pixmap src,
- int op)
-{
- XExtDisplayInfo *info = find_display (dpy);
- register xShapeMaskReq *req;
-
- ShapeSimpleCheckExtension (dpy, info);
-
- LockDisplay(dpy);
- GetReq(ShapeMask, req);
- req->reqType = info->codes->major_opcode;
- req->shapeReqType = X_ShapeMask;
- req->op = op;
- req->destKind = destKind;
- req->dest = dest;
- req->xOff = xOff;
- req->yOff = yOff;
- req->src = src;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-void XShapeCombineShape (
- register Display *dpy,
- XID dest,
- int destKind,
- int xOff, int yOff,
- XID src,
- int srcKind,
- int op)
-{
- XExtDisplayInfo *info = find_display (dpy);
- register xShapeCombineReq *req;
-
- ShapeSimpleCheckExtension (dpy, info);
-
- LockDisplay(dpy);
- GetReq(ShapeCombine, req);
- req->reqType = info->codes->major_opcode;
- req->shapeReqType = X_ShapeCombine;
- req->op = op;
- req->destKind = destKind;
- req->srcKind = srcKind;
- req->dest = dest;
- req->xOff = xOff;
- req->yOff = yOff;
- req->src = src;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-void XShapeOffsetShape (
- register Display *dpy,
- XID dest,
- int destKind,
- int xOff, int yOff)
-{
- XExtDisplayInfo *info = find_display (dpy);
- register xShapeOffsetReq *req;
-
- ShapeSimpleCheckExtension (dpy, info);
-
- LockDisplay(dpy);
- GetReq(ShapeOffset, req);
- req->reqType = info->codes->major_opcode;
- req->shapeReqType = X_ShapeOffset;
- req->destKind = destKind;
- req->dest = dest;
- req->xOff = xOff;
- req->yOff = yOff;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-Status XShapeQueryExtents (
- register Display *dpy,
- Window window,
- int *bShaped, int *xbs, int *ybs, unsigned int *wbs, unsigned int *hbs, /* RETURN */
- int *cShaped, int *xcs, int *ycs, unsigned int *wcs, unsigned int *hcs /* RETURN */)
-{
- XExtDisplayInfo *info = find_display (dpy);
- xShapeQueryExtentsReply rep;
- register xShapeQueryExtentsReq *req;
-
- ShapeCheckExtension (dpy, info, 0);
-
- LockDisplay (dpy);
- GetReq (ShapeQueryExtents, req);
- req->reqType = info->codes->major_opcode;
- req->shapeReqType = X_ShapeQueryExtents;
- req->window = window;
- if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
- UnlockDisplay (dpy);
- SyncHandle ();
- return 0;
- }
- *bShaped = rep.boundingShaped;
- *cShaped = rep.clipShaped;
- *xbs = cvtINT16toInt (rep.xBoundingShape);
- *ybs = cvtINT16toInt (rep.yBoundingShape);
- *wbs = rep.widthBoundingShape;
- *hbs = rep.heightBoundingShape;
- *xcs = cvtINT16toInt (rep.xClipShape);
- *ycs = cvtINT16toInt (rep.yClipShape);
- *wcs = rep.widthClipShape;
- *hcs = rep.heightClipShape;
- UnlockDisplay (dpy);
- SyncHandle ();
- return 1;
-}
-
-
-void XShapeSelectInput (
- register Display *dpy,
- Window window,
- unsigned long mask)
-{
- XExtDisplayInfo *info = find_display (dpy);
- register xShapeSelectInputReq *req;
-
- ShapeSimpleCheckExtension (dpy, info);
-
- LockDisplay (dpy);
- GetReq (ShapeSelectInput, req);
- req->reqType = info->codes->major_opcode;
- req->shapeReqType = X_ShapeSelectInput;
- req->window = window;
- if (mask & ShapeNotifyMask)
- req->enable = xTrue;
- else
- req->enable = xFalse;
- UnlockDisplay (dpy);
- SyncHandle ();
-}
-
-unsigned long XShapeInputSelected (register Display *dpy, Window window)
-{
- XExtDisplayInfo *info = find_display (dpy);
- register xShapeInputSelectedReq *req;
- xShapeInputSelectedReply rep;
-
- ShapeCheckExtension (dpy, info, False);
-
- LockDisplay (dpy);
- GetReq (ShapeInputSelected, req);
- req->reqType = info->codes->major_opcode;
- req->shapeReqType = X_ShapeInputSelected;
- req->window = window;
- if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
- UnlockDisplay (dpy);
- SyncHandle ();
- return False;
- }
- UnlockDisplay (dpy);
- SyncHandle ();
- return rep.enabled ? ShapeNotifyMask : 0L;
-}
-
-
-XRectangle *XShapeGetRectangles (
- register Display *dpy,
- Window window,
- int kind,
- int *count, /* RETURN */
- int *ordering /* RETURN */)
-{
- XExtDisplayInfo *info = find_display (dpy);
- register xShapeGetRectanglesReq *req;
- xShapeGetRectanglesReply rep;
- XRectangle *rects;
- xRectangle *xrects;
- int i;
-
- ShapeCheckExtension (dpy, info, (XRectangle *)NULL);
-
- LockDisplay (dpy);
- GetReq (ShapeGetRectangles, req);
- req->reqType = info->codes->major_opcode;
- req->shapeReqType = X_ShapeGetRectangles;
- req->window = window;
- req->kind = kind;
- if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
- UnlockDisplay (dpy);
- SyncHandle ();
- return (XRectangle *)NULL;
- }
- *count = rep.nrects;
- *ordering = rep.ordering;
- rects = 0;
- if (*count) {
- xrects = (xRectangle *) Xmalloc (*count * sizeof (xRectangle));
- rects = (XRectangle *) Xmalloc (*count * sizeof (XRectangle));
- if (!xrects || !rects) {
- if (xrects)
- Xfree (xrects);
- if (rects)
- Xfree (rects);
- _XEatData (dpy, *count * sizeof (xRectangle));
- rects = 0;
- *count = 0;
- } else {
- _XRead (dpy, (char *) xrects, *count * sizeof (xRectangle));
- for (i = 0; i < *count; i++) {
- rects[i].x = (short) cvtINT16toInt (xrects[i].x);
- rects[i].y = (short) cvtINT16toInt (xrects[i].y);
- rects[i].width = xrects[i].width;
- rects[i].height = xrects[i].height;
- }
- Xfree (xrects);
- }
- }
- UnlockDisplay (dpy);
- SyncHandle ();
- return rects;
-}
diff --git a/nx-X11/lib/Xext/XShm.c b/nx-X11/lib/Xext/XShm.c
deleted file mode 100644
index ec3720732..000000000
--- a/nx-X11/lib/Xext/XShm.c
+++ /dev/null
@@ -1,437 +0,0 @@
-/* $XdotOrg: xc/lib/Xext/XShm.c,v 1.5 2005/07/30 21:07:25 alanc Exp $ */
-/*
- * $Xorg: XShm.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.
- *
- * Author: Bob Scheifler and Keith Packard, MIT X Consortium
- */
-/* $XFree86: xc/lib/Xext/XShm.c,v 1.6 2002/10/16 02:19:22 dawes Exp $ */
-
-/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
-
-#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/ImUtil.h>
-#include <nx-X11/extensions/XShm.h>
-#include <nx-X11/extensions/shmstr.h>
-#include <nx-X11/extensions/Xext.h>
-#include <nx-X11/extensions/extutil.h>
-
-static XExtensionInfo _shm_info_data;
-static XExtensionInfo *shm_info = &_shm_info_data;
-static /* const */ char *shm_extension_name = SHMNAME;
-
-#define ShmCheckExtension(dpy,i,val) \
- XextCheckExtension (dpy, i, shm_extension_name, val)
-
-/*****************************************************************************
- * *
- * private utility routines *
- * *
- *****************************************************************************/
-
-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 *re, xEvent *event);
-static Status event_to_wire (Display *dpy, XEvent *re, xEvent *event);
-static /* const */ XExtensionHooks shm_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 *shm_error_list[] = {
- "BadShmSeg", /* BadShmSeg */
-};
-
-static XEXT_GENERATE_FIND_DISPLAY (find_display, shm_info, shm_extension_name,
- &shm_extension_hooks, ShmNumberEvents, NULL)
-
-static XEXT_GENERATE_CLOSE_DISPLAY (close_display, shm_info)
-
-static XEXT_GENERATE_ERROR_STRING (error_string, shm_extension_name,
- ShmNumberErrors, shm_error_list)
-
-
-static Bool
-wire_to_event (Display *dpy, XEvent *re, xEvent *event)
-{
- XExtDisplayInfo *info = find_display (dpy);
- XShmCompletionEvent *se;
- xShmCompletionEvent *sevent;
-
- ShmCheckExtension (dpy, info, False);
-
- switch ((event->u.u.type & 0x7f) - info->codes->first_event) {
- case ShmCompletion:
- se = (XShmCompletionEvent *) re;
- sevent = (xShmCompletionEvent *) event;
- se->type = sevent->type & 0x7f;
- se->serial = _XSetLastRequestRead(dpy,(xGenericReply *) event);
- se->send_event = (sevent->type & 0x80) != 0;
- se->display = dpy;
- se->drawable = sevent->drawable;
- se->major_code = sevent->majorEvent;
- se->minor_code = sevent->minorEvent;
- se->shmseg = sevent->shmseg;
- se->offset = sevent->offset;
- return True;
- }
- return False;
-}
-
-static Status
-event_to_wire (Display *dpy, XEvent *re, xEvent *event)
-{
- XExtDisplayInfo *info = find_display (dpy);
- XShmCompletionEvent *se;
- xShmCompletionEvent *sevent;
-
- ShmCheckExtension (dpy, info, 0);
-
- switch ((re->type & 0x7f) - info->codes->first_event) {
- case ShmCompletion:
- se = (XShmCompletionEvent *) re;
- sevent = (xShmCompletionEvent *) event;
- sevent->type = se->type | (se->send_event ? 0x80 : 0);
- sevent->sequenceNumber = se->serial & 0xffff;
- sevent->drawable = se->drawable;
- sevent->majorEvent = se->major_code;
- sevent->minorEvent = se->minor_code;
- sevent->shmseg = se->shmseg;
- sevent->offset = se->offset;
- return True;
- }
- return False;
-}
-
-/*****************************************************************************
- * *
- * public Shared Memory Extension routines *
- * *
- *****************************************************************************/
-
-Bool XShmQueryExtension (Display *dpy /* int *event_basep, *error_basep */)
-{
- XExtDisplayInfo *info = find_display (dpy);
-
- if (XextHasExtension(info)) {
-/* *event_basep = info->codes->first_event;
- *error_basep = info->codes->error_event; */
- return True;
- } else {
- return False;
- }
-}
-
-
-int XShmGetEventBase(Display *dpy)
-{
- XExtDisplayInfo *info = find_display (dpy);
-
- if (XextHasExtension(info)) {
- return info->codes->first_event;
- } else {
- return -1;
- }
-}
-
-
-Bool XShmQueryVersion(
- Display *dpy,
- int *majorVersion,
- int *minorVersion,
- Bool *sharedPixmaps)
-{
- XExtDisplayInfo *info = find_display (dpy);
- xShmQueryVersionReply rep;
- register xShmQueryVersionReq *req;
-
- ShmCheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(ShmQueryVersion, req);
- req->reqType = info->codes->major_opcode;
- req->shmReqType = X_ShmQueryVersion;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- *majorVersion = rep.majorVersion;
- *minorVersion = rep.minorVersion;
- *sharedPixmaps = rep.sharedPixmaps ? True : False;
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-
-int XShmPixmapFormat(Display *dpy)
-{
- XExtDisplayInfo *info = find_display (dpy);
- xShmQueryVersionReply rep;
- register xShmQueryVersionReq *req;
-
- ShmCheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(ShmQueryVersion, req);
- req->reqType = info->codes->major_opcode;
- req->shmReqType = X_ShmQueryVersion;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return 0;
- }
- UnlockDisplay(dpy);
- SyncHandle();
- if (rep.sharedPixmaps &&
- (rep.majorVersion > 1 || rep.minorVersion > 0))
- return rep.pixmapFormat;
- return 0;
-}
-
-
-Status XShmAttach(Display *dpy, XShmSegmentInfo *shminfo)
-{
- XExtDisplayInfo *info = find_display (dpy);
- register xShmAttachReq *req;
-
- ShmCheckExtension (dpy, info, 0);
-
- shminfo->shmseg = XAllocID(dpy);
- LockDisplay(dpy);
- GetReq(ShmAttach, req);
- req->reqType = info->codes->major_opcode;
- req->shmReqType = X_ShmAttach;
- req->shmseg = shminfo->shmseg;
- req->shmid = shminfo->shmid;
- req->readOnly = shminfo->readOnly ? xTrue : xFalse;
- UnlockDisplay(dpy);
- SyncHandle();
- return 1;
-}
-
-
-Status XShmDetach(Display *dpy, XShmSegmentInfo *shminfo)
-{
- XExtDisplayInfo *info = find_display (dpy);
- register xShmDetachReq *req;
-
- ShmCheckExtension (dpy, info, 0);
-
- LockDisplay(dpy);
- GetReq(ShmDetach, req);
- req->reqType = info->codes->major_opcode;
- req->shmReqType = X_ShmDetach;
- req->shmseg = shminfo->shmseg;
- UnlockDisplay(dpy);
- SyncHandle();
- return 1;
-}
-
-static int _XShmDestroyImage (XImage *ximage)
-{
- Xfree((char *)ximage);
- return 1;
-}
-
-#define ROUNDUP(nbytes, pad) ((((nbytes) + ((pad) - 1)) / (pad)) * (pad))
-
-XImage *XShmCreateImage (
- register Display *dpy,
- register Visual *visual,
- unsigned int depth,
- int format,
- char *data,
- XShmSegmentInfo *shminfo,
- unsigned int width,
- unsigned int height)
-{
- register XImage *image;
-
- image = (XImage *)Xcalloc(1, (unsigned)sizeof(XImage));
- if (!image)
- return image;
- image->data = data;
- image->obdata = (char *)shminfo;
- image->width = width;
- image->height = height;
- image->depth = depth;
- image->format = format;
- image->byte_order = dpy->byte_order;
- image->bitmap_unit = dpy->bitmap_unit;
- image->bitmap_bit_order = dpy->bitmap_bit_order;
- image->bitmap_pad = _XGetScanlinePad(dpy, depth);
- image->xoffset = 0;
- if (visual) {
- image->red_mask = visual->red_mask;
- image->green_mask = visual->green_mask;
- image->blue_mask = visual->blue_mask;
- } else {
- image->red_mask = image->green_mask = image->blue_mask = 0;
- }
- if (format == ZPixmap)
- image->bits_per_pixel = _XGetBitsPerPixel(dpy, (int)depth);
- else
- image->bits_per_pixel = 1;
- image->bytes_per_line = ROUNDUP((image->bits_per_pixel * width),
- image->bitmap_pad) >> 3;
- _XInitImageFuncPtrs(image);
- image->f.destroy_image = _XShmDestroyImage;
- return image;
-}
-
-Status XShmPutImage (
- register Display *dpy,
- Drawable d,
- GC gc,
- register XImage *image,
- int src_x, int src_y, int dst_x, int dst_y,
- unsigned int src_width, unsigned int src_height,
- Bool send_event)
-{
- XExtDisplayInfo *info = find_display (dpy);
- XShmSegmentInfo *shminfo = (XShmSegmentInfo *)image->obdata;
- register xShmPutImageReq *req;
-
- ShmCheckExtension (dpy, info, 0);
- if (!shminfo) return 0;
-
- LockDisplay(dpy);
- FlushGC(dpy, gc);
- GetReq(ShmPutImage, req);
- req->reqType = info->codes->major_opcode;
- req->shmReqType = X_ShmPutImage;
- req->drawable = d;
- req->gc = gc->gid;
- req->srcX = src_x;
- req->srcY = src_y;
- req->srcWidth = src_width;
- req->srcHeight = src_height;
- req->dstX = dst_x;
- req->dstY = dst_y;
- req->totalWidth = image->width;
- req->totalHeight = image->height;
- req->depth = image->depth;
- req->format = image->format;
- req->sendEvent = send_event;
- req->shmseg = shminfo->shmseg;
- req->offset = image->data - shminfo->shmaddr;
- UnlockDisplay(dpy);
- SyncHandle();
- return 1;
-}
-
-
-Status XShmGetImage(
- register Display *dpy,
- Drawable d,
- XImage *image,
- int x, int y,
- unsigned long plane_mask)
-{
- XExtDisplayInfo *info = find_display (dpy);
- XShmSegmentInfo *shminfo = (XShmSegmentInfo *)image->obdata;
- register xShmGetImageReq *req;
- xShmGetImageReply rep;
- register Visual *visual;
-
- ShmCheckExtension (dpy, info, 0);
- if (!shminfo) return 0;
-
- LockDisplay(dpy);
- GetReq(ShmGetImage, req);
- req->reqType = info->codes->major_opcode;
- req->shmReqType = X_ShmGetImage;
- req->drawable = d;
- req->x = x;
- req->y = y;
- req->width = image->width;
- req->height = image->height;
- req->planeMask = plane_mask;
- req->format = image->format;
- req->shmseg = shminfo->shmseg;
- req->offset = image->data - shminfo->shmaddr;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return 0;
- }
- visual = _XVIDtoVisual(dpy, rep.visual);
- if (visual) {
- image->red_mask = visual->red_mask;
- image->green_mask = visual->green_mask;
- image->blue_mask = visual->blue_mask;
- } else {
- image->red_mask = image->green_mask = image->blue_mask = 0;
- }
- UnlockDisplay(dpy);
- SyncHandle();
- return 1;
-}
-
-Pixmap XShmCreatePixmap (
- register Display *dpy,
- Drawable d,
- char *data,
- XShmSegmentInfo *shminfo,
- unsigned int width, unsigned int height, unsigned int depth)
-{
- XExtDisplayInfo *info = find_display (dpy);
- Pixmap pid;
- register xShmCreatePixmapReq *req;
-
- ShmCheckExtension (dpy, info, 0);
-
- LockDisplay(dpy);
- GetReq(ShmCreatePixmap, req);
- req->reqType = info->codes->major_opcode;
- req->shmReqType = X_ShmCreatePixmap;
- req->drawable = d;
- req->width = width;
- req->height = height;
- req->depth = depth;
- req->shmseg = shminfo->shmseg;
- req->offset = data - shminfo->shmaddr;
- pid = req->pid = XAllocID(dpy);
- UnlockDisplay(dpy);
- SyncHandle();
- return pid;
-}
diff --git a/nx-X11/lib/Xext/extutil.c b/nx-X11/lib/Xext/extutil.c
deleted file mode 100644
index bd79dbdb2..000000000
--- a/nx-X11/lib/Xext/extutil.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * $Xorg: extutil.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.
- *
- * Author: Jim Fulton, MIT X Consortium
- *
- *
- * Xlib Extension-Writing Utilities
- *
- * This package contains utilities for writing the client API for various
- * protocol extensions. THESE INTERFACES ARE NOT PART OF THE X STANDARD AND
- * ARE SUBJECT TO CHANGE!
- *
- * Routines include:
- *
- * XextCreateExtension called once per extension
- * XextDestroyExtension if no longer using extension
- * XextAddDisplay add another display
- * XextRemoveDisplay remove a display
- * XextFindDisplay is a display open
- *
- * In addition, the following Xlib-style interfaces are provided:
- *
- * XSetExtensionErrorHandler establish an extension error handler
- * XMissingExtension raise an error about missing ext
- */
-/* $XFree86: xc/lib/Xext/extutil.c,v 1.5 2002/10/16 00:37:27 dawes Exp $ */
-
-#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>
-
-
-/*
- * XextCreateExtension - return an extension descriptor containing context
- * information for this extension. This object is passed to all Xext
- * routines.
- */
-XExtensionInfo *XextCreateExtension (void)
-{
- register XExtensionInfo *info =
- (XExtensionInfo *) Xmalloc (sizeof (XExtensionInfo));
-
- if (info) {
- info->head = NULL;
- info->cur = NULL;
- info->ndisplays = 0;
- }
- return info;
-}
-
-
-/*
- * XextDestroyExtension - free memory the given extension descriptor
- */
-void XextDestroyExtension (XExtensionInfo *info)
-{
- info->head = NULL; /* to catch refs after this */
- info->cur = NULL;
- info->ndisplays = 0;
- XFree ((char *) info);
-}
-
-
-
-/*
- * XextAddDisplay - add a display to this extension
- */
-XExtDisplayInfo *XextAddDisplay (
- XExtensionInfo *extinfo,
- Display *dpy,
- char *ext_name,
- XExtensionHooks *hooks,
- int nevents,
- XPointer data)
-{
- XExtDisplayInfo *dpyinfo;
-
- dpyinfo = (XExtDisplayInfo *) Xmalloc (sizeof (XExtDisplayInfo));
- if (!dpyinfo) return NULL;
- dpyinfo->display = dpy;
- dpyinfo->data = data;
- dpyinfo->codes = XInitExtension (dpy, ext_name);
-
- /*
- * if the server has the extension, then we can initialize the
- * appropriate function vectors
- */
- if (dpyinfo->codes) {
- int i, j;
-
- for (i = 0, j = dpyinfo->codes->first_event; i < nevents; i++, j++) {
- XESetWireToEvent (dpy, j, hooks->wire_to_event);
- XESetEventToWire (dpy, j, hooks->event_to_wire);
- }
- if (hooks->create_gc)
- XESetCreateGC (dpy, dpyinfo->codes->extension, hooks->create_gc);
- if (hooks->copy_gc)
- XESetCopyGC (dpy, dpyinfo->codes->extension, hooks->copy_gc);
- if (hooks->flush_gc)
- XESetFlushGC (dpy, dpyinfo->codes->extension, hooks->flush_gc);
- if (hooks->free_gc)
- XESetFreeGC (dpy, dpyinfo->codes->extension, hooks->free_gc);
- if (hooks->create_font)
- XESetCreateFont (dpy, dpyinfo->codes->extension, hooks->create_font);
- if (hooks->free_font)
- XESetFreeFont (dpy, dpyinfo->codes->extension, hooks->free_font);
- if (hooks->close_display)
- XESetCloseDisplay (dpy, dpyinfo->codes->extension,
- hooks->close_display);
- if (hooks->error)
- XESetError (dpy, dpyinfo->codes->extension, hooks->error);
- if (hooks->error_string)
- XESetErrorString (dpy, dpyinfo->codes->extension,
- hooks->error_string);
- } else if (hooks->close_display) {
- /* The server doesn't have this extension.
- * Use a private Xlib-internal extension to hang the close_display
- * hook on so that the "cache" (extinfo->cur) is properly cleaned.
- * (XBUG 7955)
- */
- XExtCodes *codes = XAddExtension(dpy);
- if (!codes) {
- XFree(dpyinfo);
- return NULL;
- }
- XESetCloseDisplay (dpy, codes->extension, hooks->close_display);
- }
-
- /*
- * now, chain it onto the list
- */
- _XLockMutex(_Xglobal_lock);
- dpyinfo->next = extinfo->head;
- extinfo->head = dpyinfo;
- extinfo->cur = dpyinfo;
- extinfo->ndisplays++;
- _XUnlockMutex(_Xglobal_lock);
- return dpyinfo;
-}
-
-
-/*
- * XextRemoveDisplay - remove the indicated display from the extension object
- */
-int XextRemoveDisplay (XExtensionInfo *extinfo, Display *dpy)
-{
- XExtDisplayInfo *dpyinfo, *prev;
-
- /*
- * locate this display and its back link so that it can be removed
- */
- _XLockMutex(_Xglobal_lock);
- prev = NULL;
- for (dpyinfo = extinfo->head; dpyinfo; dpyinfo = dpyinfo->next) {
- if (dpyinfo->display == dpy) break;
- prev = dpyinfo;
- }
- if (!dpyinfo) {
- _XUnlockMutex(_Xglobal_lock);
- return 0; /* hmm, actually an error */
- }
-
- /*
- * remove the display from the list; handles going to zero
- */
- if (prev)
- prev->next = dpyinfo->next;
- else
- extinfo->head = dpyinfo->next;
-
- extinfo->ndisplays--;
- if (dpyinfo == extinfo->cur) extinfo->cur = NULL; /* flush cache */
- _XUnlockMutex(_Xglobal_lock);
-
- Xfree ((char *) dpyinfo);
- return 1;
-}
-
-
-/*
- * XextFindDisplay - look for a display in this extension; keeps a cache
- * of the most-recently used for efficiency.
- */
-XExtDisplayInfo *XextFindDisplay (XExtensionInfo *extinfo, Display *dpy)
-{
- register XExtDisplayInfo *dpyinfo;
-
- /*
- * see if this was the most recently accessed display
- */
- if ((dpyinfo = extinfo->cur)&& dpyinfo->display == dpy) return dpyinfo;
-
-
- /*
- * look for display in list
- */
- _XLockMutex(_Xglobal_lock);
- for (dpyinfo = extinfo->head; dpyinfo; dpyinfo = dpyinfo->next) {
- if (dpyinfo->display == dpy) {
- extinfo->cur = dpyinfo; /* cache most recently used */
- _XUnlockMutex(_Xglobal_lock);
- return dpyinfo;
- }
- }
- _XUnlockMutex(_Xglobal_lock);
-
- return NULL;
-}
-
-
-
-static int _default_exterror (Display *dpy, char *ext_name, char *reason)
-{
- fprintf (stderr, "Xlib: extension \"%s\" %s on display \"%s\".\n",
- ext_name, reason, DisplayString(dpy));
- return 0;
-}
-
-
-/*
- * XSetExtensionErrorHandler - sets the handler that gets called when a
- * requested extension is referenced. This should eventually move into Xlib.
- */
-
-extern int (*_XExtensionErrorFunction)();
-
-int (*XSetExtensionErrorHandler(int (*handler)(Display*, char *, char * )))()
-{
- int (*oldhandler)() = _XExtensionErrorFunction;
-
- _XExtensionErrorFunction = (handler ? handler :
- _default_exterror);
- return oldhandler;
-}
-
-
-/*
- * XMissingExtension - call the extension error handler
- */
-int XMissingExtension (Display *dpy, _Xconst char *ext_name)
-{
- int (*func)() = (_XExtensionErrorFunction ?
- _XExtensionErrorFunction : _default_exterror);
-
- if (!ext_name) ext_name = X_EXTENSION_UNKNOWN;
- return (*func) (dpy, ext_name, X_EXTENSION_MISSING);
-}
diff --git a/nx-X11/lib/Xext/globals.c b/nx-X11/lib/Xext/globals.c
deleted file mode 100644
index 53a18690d..000000000
--- a/nx-X11/lib/Xext/globals.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* $Xorg: globals.c,v 1.4 2001/02/09 02:03:50 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/globals.c,v 3.4 2001/07/29 05:01:12 tsi Exp $ */
-
-/*
- * This file should contain only those objects which must be predefined.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <nx-X11/Xlib.h>
-#include <nx-X11/extensions/Xext.h>
-#include <stddef.h> /* for definition of NULL */
-
-/*
- * If possible, it is useful to have the global data default to a null value.
- * Some shared library implementations are *much* happier if there isn't any
- * global initialized data.
- */
-#ifdef NULL_NOT_ZERO /* then need to initialize */
-#define SetZero(t,var,z) t var = z
-#else
-#define SetZero(t,var,z) t var
-#endif
-
-#ifdef ATTSHAREDLIB /* then need extra variables */
-/*
- * If we need to define extra variables for each global
- */
-#if !defined(UNIXCPP) || defined(ANSICPP)
-#define ZEROINIT(t,var,val) SetZero(t,var,val); \
- SetZero (long, _libX_##var##Flag, 0); \
- SetZero (void *, _libX_##var##Ptr, NULL)
-#else /* else pcc concatenation */
-#define ZEROINIT(t,var,val) SetZero(t,var,val); \
- SetZero (long, _libX_/**/var/**/Flag, 0); \
- SetZero (void *, _libX_/**/var/**/Ptr, NULL)
-#endif /* concat ANSI C vs. pcc */
-
-#else /* else not ATTSHAREDLIB */
-/*
- * no extra crud
- */
-#define ZEROINIT(t,var,val) SetZero (t, var, val)
-
-#endif /* ATTSHAREDLIB */
-
-
-/*
- * Error handlers; used to be in XlibInt.c
- */
-typedef int (*funcptr)();
-ZEROINIT (funcptr, _XExtensionErrorFunction, NULL);
-
-/*
- * NOTE: any additional external definition NEED
- * to be inserted BELOW this point!!!
- */
-
-/*
- * NOTE: any additional external definition NEED
- * to be inserted ABOVE this point!!!
- */
-