pax_global_header00006660000000000000000000000064121512777360014525gustar00rootroot0000000000000052 comment=0cb446962381f750e05d97bfb974ca1e32481d5d libXfixes-5.0.1/000075500000000000000000000000001215127773600134635ustar00rootroot00000000000000libXfixes-5.0.1/.gitignore000064400000000000000000000017521215127773600154600ustar00rootroot00000000000000# # X.Org module default exclusion patterns # The next section if for module specific patterns # # Do not edit the following section # GNU Build System (Autotools) aclocal.m4 autom4te.cache/ autoscan.log ChangeLog compile config.guess config.h config.h.in config.log config-ml.in config.py config.status config.status.lineno config.sub configure configure.scan depcomp .deps/ INSTALL install-sh .libs/ libtool libtool.m4 ltmain.sh lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 Makefile Makefile.in mdate-sh missing mkinstalldirs *.pc py-compile stamp-h? symlink-tree texinfo.tex ylwrap # Do not edit the following section # Edit Compile Debug Document Distribute *~ *.[0-9] *.[0-9]x *.bak *.bin core *.dll *.exe *-ISO*.bdf *-JIS*.bdf *-KOI8*.bdf *.kld *.ko *.ko.cmd *.lai *.l[oa] *.[oa] *.obj *.patch *.so *.pcf.gz *.pdb *.tar.bz2 *.tar.gz # # Add & Override patterns for libXfixes # # Edit the following section as needed # For example, !report.pc overrides *.pc. See 'man gitignore' # libXfixes-5.0.1/AUTHORS000064400000000000000000000000371215127773600145330ustar00rootroot00000000000000Keith Packard, HP and XFree86. libXfixes-5.0.1/COPYING000064400000000000000000000042701215127773600145210ustar00rootroot00000000000000 Copyright © 2001,2003 Keith Packard Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Keith Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Keith Packard makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 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. libXfixes-5.0.1/Makefile.am000064400000000000000000000025731215127773600155260ustar00rootroot00000000000000# # Copyright © 2003 Keith Packard, Noah Levitt # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of Keith Packard not be used in # advertising or publicity pertaining to distribution of the software without # specific, written prior permission. Keith Packard makes no # representations about the suitability of this software for any purpose. It # is provided "as is" without express or implied warranty. # # KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO # EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR # CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, # DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. SUBDIRS = src man pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = xfixes.pc MAINTAINERCLEANFILES = ChangeLog INSTALL .PHONY: ChangeLog INSTALL INSTALL: $(INSTALL_CMD) ChangeLog: $(CHANGELOG_CMD) dist-hook: ChangeLog INSTALL libXfixes-5.0.1/README000064400000000000000000000015401215127773600143430ustar00rootroot00000000000000 Xfixes XFIXES Extension Version 2.0.1 2002-10-4 This package contains header files and documentation for the XFIXES extension. Library and server implementations are separate. Keith Packard keithp@keithp.com All questions regarding this software should be directed at the Xorg mailing list: http://lists.freedesktop.org/mailman/listinfo/xorg Please submit bug reports to the Xorg bugzilla: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg The master development code repository can be found at: git://anongit.freedesktop.org/git/xorg/lib/libXfixes http://cgit.freedesktop.org/xorg/lib/libXfixes For patch submission instructions, see: http://www.x.org/wiki/Development/Documentation/SubmittingPatches For more information on the git code manager, see: http://wiki.x.org/wiki/GitPage libXfixes-5.0.1/autogen.sh000075500000000000000000000003211215127773600154600ustar00rootroot00000000000000#! /bin/sh srcdir=`dirname $0` test -z "$srcdir" && srcdir=. ORIGDIR=`pwd` cd $srcdir autoreconf -v --install || exit 1 cd $ORIGDIR || exit $? if test -z "$NOCONFIGURE"; then $srcdir/configure "$@" fi libXfixes-5.0.1/configure.ac000064400000000000000000000053271215127773600157600ustar00rootroot00000000000000# # Copyright © 2003 Keith Packard, Noah Levitt # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of Keith Packard not be used in # advertising or publicity pertaining to distribution of the software without # specific, written prior permission. Keith Packard makes no # representations about the suitability of this software for any purpose. It # is provided "as is" without express or implied warranty. # # KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO # EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR # CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, # DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. # # Initialize Autoconf AC_PREREQ([2.60]) # # Version should match the current XFixes version. XFixesQueryVersion # returns the version from xfixeswire.h, NOT the version we set here. But we # try to keep these the same. Note that the library has an extra # digit in the version number to track changes which don't affect the # protocol, so Xfixes version l.n.m corresponds to protocol version l.n, # that 'revision' number appears in Xfixes.h and has to be manually # synchronized. # AC_INIT(libXfixes, [5.0.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXfixes]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) # Initialize Automake AM_INIT_AUTOMAKE([foreign dist-bzip2]) # Initialize libtool AC_PROG_LIBTOOL # Require xorg-macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS m4_ifndef([XORG_MACROS_VERSION], [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])]) XORG_MACROS_VERSION(1.8) XORG_DEFAULT_OPTIONS # Check fixesext configuration, strip extra digits from package version to # find the required protocol version FIXESEXT_VERSION=[`echo $VERSION | sed 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`] AC_SUBST(FIXESEXT_VERSION) # Obtain compiler/linker options for depedencies PKG_CHECK_MODULES(FIXESEXT, xproto [fixesproto >= $FIXESEXT_VERSION] xextproto x11) # Check for _XEatDataWords function that may be patched into older Xlib releases SAVE_LIBS="$LIBS" LIBS="$FIXESEXT_LIBS" AC_CHECK_FUNCS([_XEatDataWords]) LIBS="$SAVE_LIBS" AC_CONFIG_FILES([Makefile src/Makefile man/Makefile xfixes.pc]) AC_OUTPUT libXfixes-5.0.1/include/000075500000000000000000000000001215127773600151065ustar00rootroot00000000000000libXfixes-5.0.1/include/X11/000075500000000000000000000000001215127773600154575ustar00rootroot00000000000000libXfixes-5.0.1/include/X11/extensions/000075500000000000000000000000001215127773600176565ustar00rootroot00000000000000libXfixes-5.0.1/include/X11/extensions/Xfixes.h000064400000000000000000000166441215127773600213100ustar00rootroot00000000000000/* * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Red Hat, Inc. * * 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 (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS 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. */ /* * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Keith Packard not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Keith Packard makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ #ifndef _XFIXES_H_ #define _XFIXES_H_ #include #include #include /* * This revision number also appears in configure.ac, they have * to be manually synchronized */ #define XFIXES_REVISION 1 #define XFIXES_VERSION ((XFIXES_MAJOR * 10000) + (XFIXES_MINOR * 100) + (XFIXES_REVISION)) typedef struct { int type; /* event base */ unsigned long serial; Bool send_event; Display *display; Window window; int subtype; Window owner; Atom selection; Time timestamp; Time selection_timestamp; } XFixesSelectionNotifyEvent; typedef struct { int type; /* event base */ unsigned long serial; Bool send_event; Display *display; Window window; int subtype; unsigned long cursor_serial; Time timestamp; Atom cursor_name; } XFixesCursorNotifyEvent; typedef struct { short x, y; unsigned short width, height; unsigned short xhot, yhot; unsigned long cursor_serial; unsigned long *pixels; #if XFIXES_MAJOR >= 2 Atom atom; /* Version >= 2 only */ const char *name; /* Version >= 2 only */ #endif } XFixesCursorImage; #if XFIXES_MAJOR >= 2 /* Version 2 types */ typedef XID XserverRegion; typedef struct { short x, y; unsigned short width, height; unsigned short xhot, yhot; unsigned long cursor_serial; unsigned long *pixels; Atom atom; const char *name; } XFixesCursorImageAndName; #endif _XFUNCPROTOBEGIN Bool XFixesQueryExtension (Display *dpy, int *event_base_return, int *error_base_return); Status XFixesQueryVersion (Display *dpy, int *major_version_return, int *minor_version_return); int XFixesVersion (void); void XFixesChangeSaveSet (Display *dpy, Window win, int mode, int target, int map); void XFixesSelectSelectionInput (Display *dpy, Window win, Atom selection, unsigned long eventMask); void XFixesSelectCursorInput (Display *dpy, Window win, unsigned long eventMask); XFixesCursorImage * XFixesGetCursorImage (Display *dpy); #if XFIXES_MAJOR >= 2 /* Version 2 functions */ XserverRegion XFixesCreateRegion (Display *dpy, XRectangle *rectangles, int nrectangles); XserverRegion XFixesCreateRegionFromBitmap (Display *dpy, Pixmap bitmap); XserverRegion XFixesCreateRegionFromWindow (Display *dpy, Window window, int kind); XserverRegion XFixesCreateRegionFromGC (Display *dpy, GC gc); XserverRegion XFixesCreateRegionFromPicture (Display *dpy, XID picture); void XFixesDestroyRegion (Display *dpy, XserverRegion region); void XFixesSetRegion (Display *dpy, XserverRegion region, XRectangle *rectangles, int nrectangles); void XFixesCopyRegion (Display *dpy, XserverRegion dst, XserverRegion src); void XFixesUnionRegion (Display *dpy, XserverRegion dst, XserverRegion src1, XserverRegion src2); void XFixesIntersectRegion (Display *dpy, XserverRegion dst, XserverRegion src1, XserverRegion src2); void XFixesSubtractRegion (Display *dpy, XserverRegion dst, XserverRegion src1, XserverRegion src2); void XFixesInvertRegion (Display *dpy, XserverRegion dst, XRectangle *rect, XserverRegion src); void XFixesTranslateRegion (Display *dpy, XserverRegion region, int dx, int dy); void XFixesRegionExtents (Display *dpy, XserverRegion dst, XserverRegion src); XRectangle * XFixesFetchRegion (Display *dpy, XserverRegion region, int *nrectanglesRet); XRectangle * XFixesFetchRegionAndBounds (Display *dpy, XserverRegion region, int *nrectanglesRet, XRectangle *bounds); void XFixesSetGCClipRegion (Display *dpy, GC gc, int clip_x_origin, int clip_y_origin, XserverRegion region); void XFixesSetWindowShapeRegion (Display *dpy, Window win, int shape_kind, int x_off, int y_off, XserverRegion region); void XFixesSetPictureClipRegion (Display *dpy, XID picture, int clip_x_origin, int clip_y_origin, XserverRegion region); void XFixesSetCursorName (Display *dpy, Cursor cursor, const char *name); const char * XFixesGetCursorName (Display *dpy, Cursor cursor, Atom *atom); void XFixesChangeCursor (Display *dpy, Cursor source, Cursor destination); void XFixesChangeCursorByName (Display *dpy, Cursor source, const char *name); #endif /* XFIXES_MAJOR >= 2 */ #if XFIXES_MAJOR >= 3 void XFixesExpandRegion (Display *dpy, XserverRegion dst, XserverRegion src, unsigned left, unsigned right, unsigned top, unsigned bottom); #endif /* XFIXES_MAJOR >= 3 */ #if XFIXES_MAJOR >= 4 /* Version 4.0 externs */ void XFixesHideCursor (Display *dpy, Window win); void XFixesShowCursor (Display *dpy, Window win); #endif /* XFIXES_MAJOR >= 4 */ #if XFIXES_MAJOR >= 5 typedef XID PointerBarrier; PointerBarrier XFixesCreatePointerBarrier(Display *dpy, Window w, int x1, int y1, int x2, int y2, int directions, int num_devices, int *devices); void XFixesDestroyPointerBarrier(Display *dpy, PointerBarrier b); #endif /* XFIXES_MAJOR >= 5 */ _XFUNCPROTOEND #endif /* _XFIXES_H_ */ libXfixes-5.0.1/man/000075500000000000000000000000001215127773600142365ustar00rootroot00000000000000libXfixes-5.0.1/man/Makefile.am000064400000000000000000000027501215127773600162760ustar00rootroot00000000000000# # Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice (including the next # paragraph) shall be included in all copies or substantial portions of the # Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS 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. # libmandir = $(LIB_MAN_DIR) libman_PRE = Xfixes.man libman_DATA = $(libman_PRE:man=@LIB_MAN_SUFFIX@) EXTRA_DIST = $(libman_PRE) CLEANFILES = $(libman_DATA) # String replacements for man pages now come from xorg-macros.m4 via configure SUFFIXES = .$(LIB_MAN_SUFFIX) .man .man.$(LIB_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ libXfixes-5.0.1/man/Xfixes.man000064400000000000000000000054671215127773600162150ustar00rootroot00000000000000.\" .\" .\" Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. .\" .\" Permission to use, copy, modify, distribute, and sell this software and its .\" documentation for any purpose is hereby granted without fee, provided that .\" the above copyright notice appear in all copies and that both that .\" copyright notice and this permission notice appear in supporting .\" documentation, and that the name of Keith Packard not be used in .\" advertising or publicity pertaining to distribution of the software without .\" specific, written prior permission. Keith Packard makes no .\" representations about the suitability of this software for any purpose. It .\" is provided "as is" without express or implied warranty. .\" .\" KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, .\" INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO .\" EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR .\" CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, .\" DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER .\" TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR .\" PERFORMANCE OF THIS SOFTWARE. .\" .de TQ .br .ns .TP \\$1 .. .TH XFIXES __libmansuffix__ __xorgversion__ .SH NAME XFixes \- Augmented versions of core protocol requests .SH SYNTAX \&#include .nf .sp Bool XFixesQueryExtension \^(\^Display *\fIdpy\fP, int *\fIevent_base_return\fP, int *\fIerror_base_return\fP\^); .sp Status XFixesQueryVersion \^(\^Display *\fIdpy\fP, int *\fImajor_version_return\fP, int *\fIminor_version_return\fP\^); .sp void XFixesChangeSaveSet \^(\^Display *dpy, Window \fIwindow\fP, int \fImode\fP, int \fItarget\fP, int \fImap\fP); .fi .SH ARGUMENTS .IP \fIdisplay\fP 1i Specifies the connection to the X server. .IP \fIwindow\fP 1i Specifies which window. .IP \fImode\fP 1i Specifies the save set operation (SetModeInsert/SetModeDelete). .IP \fItarget\fP 1i Specifies the target when executing the save set (SaveSetNearest/SaveSetRoot). In SaveSetNearest mode, the save set member window will be reparented to the nearest window not owned by the save set client. In SaveSetRoot mode, the save set member window will be reparented to the root window. .IP \fImap\fP 1i Specifies the map mode (SaveSetMap/SaveSetUnmap) which selects whether the save setmember window will be mapped or unmapped during save set processing. .SH DESCRIPTION .B Xfixes is a simple library designed to interface the X Fixes Extension. This extension provides application with work arounds for various limitations in the core protocol. .SH RESTRICTIONS .B Xfixes will remain upward compatible after the 1.0 release. .SH AUTHORS Keith Packard, member of the XFree86 Project, Inc. and HP, Owen Taylor, member of the Gnome Foundation and Redhat, Inc. libXfixes-5.0.1/src/000075500000000000000000000000001215127773600142525ustar00rootroot00000000000000libXfixes-5.0.1/src/Cursor.c000064400000000000000000000240741215127773600157020ustar00rootroot00000000000000/* * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Red Hat, Inc. * * 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 (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS 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. */ /* * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Keith Packard not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Keith Packard makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ #ifdef HAVE_CONFIG_H #include #endif #include "Xfixesint.h" #include void XFixesSelectCursorInput (Display *dpy, Window win, unsigned long eventMask) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesSelectCursorInputReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesSelectCursorInput, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesSelectCursorInput; req->window = win; req->eventMask = eventMask; UnlockDisplay (dpy); SyncHandle (); } XFixesCursorImage * XFixesGetCursorImage (Display *dpy) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesGetCursorImageAndNameReq *req; xXFixesGetCursorImageAndNameReply rep; size_t npixels; size_t nbytes_name; size_t nbytes, nread, rlength; XFixesCursorImage *image; char *name; XFixesCheckExtension (dpy, info, NULL); LockDisplay (dpy); GetReq (XFixesGetCursorImageAndName, req); req->reqType = info->codes->major_opcode; if (info->major_version >= 2) req->xfixesReqType = X_XFixesGetCursorImageAndName; else req->xfixesReqType = X_XFixesGetCursorImage; if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { UnlockDisplay (dpy); SyncHandle (); return NULL; } if (info->major_version < 2) { rep.cursorName = None; rep.nbytes = 0; } npixels = rep.width * rep.height; nbytes_name = rep.nbytes; if ((rep.length < (INT_MAX >> 2)) && npixels < (((INT_MAX >> 3) - sizeof (XFixesCursorImage) - 1) - nbytes_name)) { /* reply data length */ nbytes = (size_t) rep.length << 2; /* bytes of actual data in the reply */ nread = (npixels << 2) + nbytes_name; /* size of data returned to application */ rlength = (sizeof (XFixesCursorImage) + npixels * sizeof (unsigned long) + nbytes_name + 1); image = Xmalloc (rlength); } else image = NULL; if (!image) { _XEatDataWords(dpy, rep.length); UnlockDisplay (dpy); SyncHandle (); return NULL; } image->x = rep.x; image->y = rep.y; image->width = rep.width; image->height = rep.height; image->xhot = rep.xhot; image->yhot = rep.yhot; image->cursor_serial = rep.cursorSerial; image->pixels = (unsigned long *) (image + 1); image->atom = rep.cursorName; name = (char *) (image->pixels + npixels); image->name = name; _XRead32 (dpy, (long *) image->pixels, npixels << 2); _XRead (dpy, name, nbytes_name); name[nbytes_name] = '\0'; /* null-terminate */ /* skip any padding */ if(nbytes > nread) { _XEatData (dpy, (unsigned long) (nbytes - nread)); } UnlockDisplay (dpy); SyncHandle (); return image; } void XFixesSetCursorName (Display *dpy, Cursor cursor, const char *name) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesSetCursorNameReq *req; int nbytes = strlen (name); XFixesSimpleCheckExtension (dpy, info); if (info->major_version < 2) return; LockDisplay (dpy); GetReq (XFixesSetCursorName, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesSetCursorName; req->cursor = cursor; req->nbytes = nbytes; req->length += (nbytes + 3) >> 2; Data (dpy, name, nbytes); UnlockDisplay (dpy); SyncHandle (); } const char * XFixesGetCursorName (Display *dpy, Cursor cursor, Atom *atom) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesGetCursorNameReq *req; xXFixesGetCursorNameReply rep; char *name; XFixesCheckExtension (dpy, info, NULL); if (info->major_version < 2) return NULL; LockDisplay (dpy); GetReq (XFixesGetCursorName, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesGetCursorName; req->cursor = cursor; if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { UnlockDisplay (dpy); SyncHandle (); return NULL; } *atom = rep.atom; if ((name = (char *) Xmalloc(rep.nbytes+1))) { _XReadPad(dpy, name, (long)rep.nbytes); name[rep.nbytes] = '\0'; } else { _XEatDataWords(dpy, rep.length); name = (char *) NULL; } UnlockDisplay(dpy); SyncHandle(); return(name); } void XFixesChangeCursor (Display *dpy, Cursor source, Cursor destination) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesChangeCursorReq *req; XFixesSimpleCheckExtension (dpy, info); if (info->major_version < 2) return; LockDisplay (dpy); GetReq (XFixesChangeCursor, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesChangeCursor; req->source = source; req->destination = destination; UnlockDisplay(dpy); SyncHandle(); } void XFixesChangeCursorByName (Display *dpy, Cursor source, const char *name) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesChangeCursorByNameReq *req; int nbytes = strlen (name); XFixesSimpleCheckExtension (dpy, info); if (info->major_version < 2) return; LockDisplay (dpy); GetReq (XFixesChangeCursorByName, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesChangeCursorByName; req->source = source; req->nbytes = nbytes; req->length += (nbytes + 3) >> 2; Data (dpy, name, nbytes); UnlockDisplay(dpy); SyncHandle(); } void XFixesHideCursor (Display *dpy, Window win) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesHideCursorReq *req; XFixesSimpleCheckExtension (dpy, info); if (info->major_version < 4) return; LockDisplay (dpy); GetReq (XFixesHideCursor, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesHideCursor; req->window = win; UnlockDisplay (dpy); SyncHandle (); } void XFixesShowCursor (Display *dpy, Window win) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesShowCursorReq *req; XFixesSimpleCheckExtension (dpy, info); if (info->major_version < 4) return; LockDisplay (dpy); GetReq (XFixesShowCursor, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesShowCursor; req->window = win; UnlockDisplay (dpy); SyncHandle (); } PointerBarrier XFixesCreatePointerBarrier(Display *dpy, Window w, int x1, int y1, int x2, int y2, int directions, int num_devices, int *devices) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesCreatePointerBarrierReq *req; PointerBarrier barrier; int extra = 0; XFixesCheckExtension (dpy, info, 0); if (info->major_version < 5) return 0; if (num_devices) extra = (((2 * num_devices) + 3) / 4) * 4; LockDisplay (dpy); GetReqExtra (XFixesCreatePointerBarrier, extra, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesCreatePointerBarrier; barrier = req->barrier = XAllocID (dpy); req->window = w; req->x1 = x1; req->y1 = y1; req->x2 = x2; req->y2 = y2; req->directions = directions; if ((req->num_devices = num_devices)) { int i; CARD16 *devs = (CARD16 *)(req + 1); for (i = 0; i < num_devices; i++) devs[i] = (CARD16)(devices[i]); } UnlockDisplay (dpy); SyncHandle(); return barrier; } void XFixesDestroyPointerBarrier(Display *dpy, PointerBarrier b) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesDestroyPointerBarrierReq *req; XFixesSimpleCheckExtension (dpy, info); if (info->major_version < 5) return; LockDisplay (dpy); GetReq (XFixesDestroyPointerBarrier, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesDestroyPointerBarrier; req->barrier = b; UnlockDisplay (dpy); SyncHandle(); } libXfixes-5.0.1/src/Makefile.am000064400000000000000000000007111215127773600163050ustar00rootroot00000000000000lib_LTLIBRARIES = libXfixes.la libXfixes_la_SOURCES = \ Cursor.c \ Region.c \ SaveSet.c \ Selection.c \ Xfixes.c \ Xfixesint.h AM_CFLAGS = $(CWARNFLAGS) @FIXESEXT_CFLAGS@ AM_CPPFLAGS = -I$(top_srcdir)/include/X11/extensions libXfixes_la_LIBADD = @FIXESEXT_LIBS@ libXfixes_la_LDFLAGS = -version-number 3:1:0 -no-undefined libXfixesincludedir = $(includedir)/X11/extensions libXfixesinclude_HEADERS = $(top_srcdir)/include/X11/extensions/Xfixes.h libXfixes-5.0.1/src/Region.c000064400000000000000000000307361215127773600156520ustar00rootroot00000000000000/* * Copyright © 2003 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Keith Packard not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Keith Packard makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ #ifdef HAVE_CONFIG_H #include #endif #include "Xfixesint.h" XserverRegion XFixesCreateRegion (Display *dpy, XRectangle *rectangles, int nrectangles) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesCreateRegionReq *req; long len; XserverRegion region; XFixesCheckExtension (dpy, info, 0); LockDisplay (dpy); GetReq (XFixesCreateRegion, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesCreateRegion; region = req->region = XAllocID (dpy); len = ((long) nrectangles) << 1; SetReqLen (req, len, len); len <<= 2; Data16 (dpy, (short *) rectangles, len); UnlockDisplay (dpy); SyncHandle(); return region; } XserverRegion XFixesCreateRegionFromBitmap (Display *dpy, Pixmap bitmap) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesCreateRegionFromBitmapReq *req; XserverRegion region; XFixesCheckExtension (dpy, info, 0); LockDisplay (dpy); GetReq (XFixesCreateRegionFromBitmap, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesCreateRegionFromBitmap; region = req->region = XAllocID (dpy); req->bitmap = bitmap; UnlockDisplay (dpy); SyncHandle(); return region; } XserverRegion XFixesCreateRegionFromWindow (Display *dpy, Window window, int kind) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesCreateRegionFromWindowReq *req; XserverRegion region; XFixesCheckExtension (dpy, info, 0); LockDisplay (dpy); GetReq (XFixesCreateRegionFromWindow, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesCreateRegionFromWindow; region = req->region = XAllocID (dpy); req->window = window; req->kind = kind; UnlockDisplay (dpy); SyncHandle(); return region; } XserverRegion XFixesCreateRegionFromGC (Display *dpy, GC gc) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesCreateRegionFromGCReq *req; XserverRegion region; XFixesCheckExtension (dpy, info, 0); LockDisplay (dpy); GetReq (XFixesCreateRegionFromGC, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesCreateRegionFromGC; region = req->region = XAllocID (dpy); req->gc = gc->gid; UnlockDisplay (dpy); SyncHandle(); return region; } XserverRegion XFixesCreateRegionFromPicture (Display *dpy, XID picture) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesCreateRegionFromPictureReq *req; XserverRegion region; XFixesCheckExtension (dpy, info, 0); LockDisplay (dpy); GetReq (XFixesCreateRegionFromPicture, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesCreateRegionFromPicture; region = req->region = XAllocID (dpy); req->picture = picture; UnlockDisplay (dpy); SyncHandle(); return region; } void XFixesDestroyRegion (Display *dpy, XserverRegion region) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesDestroyRegionReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesDestroyRegion, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesDestroyRegion; req->region = region; UnlockDisplay (dpy); SyncHandle(); } void XFixesSetRegion (Display *dpy, XserverRegion region, XRectangle *rectangles, int nrectangles) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesSetRegionReq *req; long len; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesSetRegion, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesSetRegion; req->region = region; len = ((long) nrectangles) << 1; SetReqLen (req, len, len); len <<= 2; Data16 (dpy, (short *) rectangles, len); UnlockDisplay (dpy); SyncHandle(); } void XFixesCopyRegion (Display *dpy, XserverRegion dst, XserverRegion src) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesCopyRegionReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesCopyRegion, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesCopyRegion; req->source = src; req->destination = dst; UnlockDisplay (dpy); SyncHandle(); } void XFixesUnionRegion (Display *dpy, XserverRegion dst, XserverRegion src1, XserverRegion src2) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesUnionRegionReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesUnionRegion, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesUnionRegion; req->source1 = src1; req->source2 = src2; req->destination = dst; UnlockDisplay (dpy); SyncHandle(); } void XFixesIntersectRegion (Display *dpy, XserverRegion dst, XserverRegion src1, XserverRegion src2) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesIntersectRegionReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesIntersectRegion, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesIntersectRegion; req->source1 = src1; req->source2 = src2; req->destination = dst; UnlockDisplay (dpy); SyncHandle(); } void XFixesSubtractRegion (Display *dpy, XserverRegion dst, XserverRegion src1, XserverRegion src2) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesSubtractRegionReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesSubtractRegion, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesSubtractRegion; req->source1 = src1; req->source2 = src2; req->destination = dst; UnlockDisplay (dpy); SyncHandle(); } void XFixesInvertRegion (Display *dpy, XserverRegion dst, XRectangle *rect, XserverRegion src) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesInvertRegionReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesInvertRegion, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesInvertRegion; req->x = rect->x; req->y = rect->y; req->width = rect->width; req->height = rect->height; req->source = src; req->destination = dst; UnlockDisplay (dpy); SyncHandle(); } void XFixesTranslateRegion (Display *dpy, XserverRegion region, int dx, int dy) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesTranslateRegionReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesTranslateRegion, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesTranslateRegion; req->region = region; req->dx = dx; req->dy = dy; UnlockDisplay (dpy); SyncHandle(); } void XFixesRegionExtents (Display *dpy, XserverRegion dst, XserverRegion src) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesRegionExtentsReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesRegionExtents, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesRegionExtents; req->source = src; req->destination = dst; UnlockDisplay (dpy); SyncHandle(); } XRectangle * XFixesFetchRegion (Display *dpy, XserverRegion region, int *nrectanglesRet) { XRectangle bounds; return XFixesFetchRegionAndBounds (dpy, region, nrectanglesRet, &bounds); } XRectangle * XFixesFetchRegionAndBounds (Display *dpy, XserverRegion region, int *nrectanglesRet, XRectangle *bounds) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesFetchRegionReq *req; xXFixesFetchRegionReply rep; XRectangle *rects; int nrects; long nbytes; long nread; XFixesCheckExtension (dpy, info, NULL); LockDisplay (dpy); GetReq (XFixesFetchRegion, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesFetchRegion; req->region = region; *nrectanglesRet = 0; if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { UnlockDisplay (dpy); SyncHandle (); return NULL; } bounds->x = rep.x; bounds->y = rep.y; bounds->width = rep.width; bounds->height = rep.height; nbytes = (long) rep.length << 2; nrects = rep.length >> 1; rects = Xmalloc (nrects * sizeof (XRectangle)); if (!rects) { _XEatDataWords(dpy, rep.length); UnlockDisplay (dpy); SyncHandle (); return NULL; } nread = nrects << 3; _XRead16 (dpy, (short *) rects, nread); /* skip any padding */ if(nbytes > nread) { _XEatData (dpy, (unsigned long) (nbytes - nread)); } UnlockDisplay (dpy); SyncHandle(); *nrectanglesRet = nrects; return rects; } void XFixesSetGCClipRegion (Display *dpy, GC gc, int clip_x_origin, int clip_y_origin, XserverRegion region) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesSetGCClipRegionReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesSetGCClipRegion, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesSetGCClipRegion; req->gc = gc->gid; req->region = region; req->xOrigin = clip_x_origin; req->yOrigin = clip_y_origin; UnlockDisplay (dpy); SyncHandle(); } void XFixesSetWindowShapeRegion (Display *dpy, Window win, int shape_kind, int x_off, int y_off, XserverRegion region) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesSetWindowShapeRegionReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesSetWindowShapeRegion, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesSetWindowShapeRegion; req->dest = win; req->destKind = shape_kind; req->xOff = x_off; req->yOff = y_off; req->region = region; UnlockDisplay (dpy); SyncHandle(); } void XFixesSetPictureClipRegion (Display *dpy, XID picture, int clip_x_origin, int clip_y_origin, XserverRegion region) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesSetPictureClipRegionReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesSetPictureClipRegion, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesSetPictureClipRegion; req->picture = picture; req->region = region; req->xOrigin = clip_x_origin; req->yOrigin = clip_y_origin; UnlockDisplay (dpy); SyncHandle(); } void XFixesExpandRegion (Display *dpy, XserverRegion dst, XserverRegion src, unsigned left, unsigned right, unsigned top, unsigned bottom) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesExpandRegionReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesExpandRegion, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesExpandRegion; req->source = src; req->destination = dst; req->left = left; req->right = right; req->top = top; req->bottom = bottom; UnlockDisplay (dpy); SyncHandle(); } libXfixes-5.0.1/src/SaveSet.c000064400000000000000000000033751215127773600160000ustar00rootroot00000000000000/* * * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Keith Packard not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Keith Packard makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ #ifdef HAVE_CONFIG_H #include #endif #include "Xfixesint.h" void XFixesChangeSaveSet (Display *dpy, Window win, int mode, int target, int map) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesChangeSaveSetReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesChangeSaveSet, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesChangeSaveSet; req->mode = mode; req->target = target; req->map = map; req->window = win; UnlockDisplay (dpy); SyncHandle (); } libXfixes-5.0.1/src/Selection.c000064400000000000000000000035071215127773600163500ustar00rootroot00000000000000/* * * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Keith Packard not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Keith Packard makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ #ifdef HAVE_CONFIG_H #include #endif #include "Xfixesint.h" void XFixesSelectSelectionInput (Display *dpy, Window win, Atom selection, unsigned long eventMask) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); xXFixesSelectSelectionInputReq *req; XFixesSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (XFixesSelectSelectionInput, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesSelectSelectionInput; req->window = win; req->selection = selection; req->eventMask = eventMask; UnlockDisplay (dpy); SyncHandle (); } libXfixes-5.0.1/src/Xfixes.c000064400000000000000000000221271215127773600156700ustar00rootroot00000000000000/* * * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Keith Packard not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Keith Packard makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ #ifdef HAVE_CONFIG_H #include #endif #include "Xfixesint.h" XFixesExtInfo XFixesExtensionInfo; char XFixesExtensionName[] = XFIXES_NAME; static int XFixesCloseDisplay (Display *dpy, XExtCodes *codes); static Bool XFixesWireToEvent(Display *dpy, XEvent *event, xEvent *wire); static Status XFixesEventToWire(Display *dpy, XEvent *event, xEvent *wire); /* * XFixesExtAddDisplay - add a display to this extension. (Replaces * XextAddDisplay) */ static XFixesExtDisplayInfo * XFixesExtAddDisplay (XFixesExtInfo *extinfo, Display *dpy, char *ext_name) { XFixesExtDisplayInfo *info; int ev; info = (XFixesExtDisplayInfo *) Xmalloc (sizeof (XFixesExtDisplayInfo)); if (!info) return NULL; info->display = dpy; info->codes = XInitExtension (dpy, ext_name); /* * if the server has the extension, then we can initialize the * appropriate function vectors */ if (info->codes) { xXFixesQueryVersionReply rep; xXFixesQueryVersionReq *req; XESetCloseDisplay (dpy, info->codes->extension, XFixesCloseDisplay); for (ev = info->codes->first_event; ev < info->codes->first_event + XFixesNumberEvents; ev++) { XESetWireToEvent (dpy, ev, XFixesWireToEvent); XESetEventToWire (dpy, ev, XFixesEventToWire); } /* * Get the version info */ LockDisplay (dpy); GetReq (XFixesQueryVersion, req); req->reqType = info->codes->major_opcode; req->xfixesReqType = X_XFixesQueryVersion; req->majorVersion = XFIXES_MAJOR; req->minorVersion = XFIXES_MINOR; if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { UnlockDisplay (dpy); SyncHandle (); Xfree(info); return NULL; } info->major_version = rep.majorVersion; info->minor_version = rep.minorVersion; UnlockDisplay (dpy); SyncHandle (); } else { /* 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(info); return NULL; } XESetCloseDisplay (dpy, codes->extension, XFixesCloseDisplay); } /* * now, chain it onto the list */ _XLockMutex(_Xglobal_lock); info->next = extinfo->head; extinfo->head = info; extinfo->cur = info; extinfo->ndisplays++; _XUnlockMutex(_Xglobal_lock); return info; } /* * XFixesExtRemoveDisplay - remove the indicated display from the * extension object. (Replaces XextRemoveDisplay.) */ static int XFixesExtRemoveDisplay (XFixesExtInfo *extinfo, Display *dpy) { XFixesExtDisplayInfo *info, *prev; /* * locate this display and its back link so that it can be removed */ _XLockMutex(_Xglobal_lock); prev = NULL; for (info = extinfo->head; info; info = info->next) { if (info->display == dpy) break; prev = info; } if (!info) { _XUnlockMutex(_Xglobal_lock); return 0; /* hmm, actually an error */ } /* * remove the display from the list; handles going to zero */ if (prev) prev->next = info->next; else extinfo->head = info->next; extinfo->ndisplays--; if (info == extinfo->cur) extinfo->cur = NULL; /* flush cache */ _XUnlockMutex(_Xglobal_lock); Xfree ((char *) info); return 1; } /* * XFixesExtFindDisplay - look for a display in this extension; keeps a * cache of the most-recently used for efficiency. (Replaces * XextFindDisplay.) */ static XFixesExtDisplayInfo * XFixesExtFindDisplay (XFixesExtInfo *extinfo, Display *dpy) { XFixesExtDisplayInfo *info; /* * see if this was the most recently accessed display */ if ((info = extinfo->cur) && info->display == dpy) return info; /* * look for display in list */ _XLockMutex(_Xglobal_lock); for (info = extinfo->head; info; info = info->next) { if (info->display == dpy) { extinfo->cur = info; /* cache most recently used */ _XUnlockMutex(_Xglobal_lock); return info; } } _XUnlockMutex(_Xglobal_lock); return NULL; } XFixesExtDisplayInfo * XFixesFindDisplay (Display *dpy) { XFixesExtDisplayInfo *info; info = XFixesExtFindDisplay (&XFixesExtensionInfo, dpy); if (!info) info = XFixesExtAddDisplay (&XFixesExtensionInfo, dpy, XFixesExtensionName); return info; } static int XFixesCloseDisplay (Display *dpy, XExtCodes *codes) { return XFixesExtRemoveDisplay (&XFixesExtensionInfo, dpy); } static Bool XFixesWireToEvent(Display *dpy, XEvent *event, xEvent *wire) { XFixesExtDisplayInfo *info = XFixesFindDisplay(dpy); XFixesCheckExtension(dpy, info, False); switch ((wire->u.u.type & 0x7F) - info->codes->first_event) { case XFixesSelectionNotify: { XFixesSelectionNotifyEvent *aevent; xXFixesSelectionNotifyEvent *awire; awire = (xXFixesSelectionNotifyEvent *) wire; aevent = (XFixesSelectionNotifyEvent *) event; aevent->type = awire->type & 0x7F; aevent->subtype = awire->subtype; aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire); aevent->send_event = (awire->type & 0x80) != 0; aevent->display = dpy; aevent->window = awire->window; aevent->owner = awire->owner; aevent->selection = awire->selection; aevent->timestamp = awire->timestamp; aevent->selection_timestamp = awire->selectionTimestamp; return True; } case XFixesCursorNotify: { XFixesCursorNotifyEvent *aevent; xXFixesCursorNotifyEvent *awire; awire = (xXFixesCursorNotifyEvent *) wire; aevent = (XFixesCursorNotifyEvent *) event; aevent->type = awire->type & 0x7F; aevent->subtype = awire->subtype; aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire); aevent->send_event = (awire->type & 0x80) != 0; aevent->display = dpy; aevent->window = awire->window; aevent->cursor_serial = awire->cursorSerial; aevent->timestamp = awire->timestamp; aevent->cursor_name = awire->name; return True; } } return False; } static Status XFixesEventToWire(Display *dpy, XEvent *event, xEvent *wire) { XFixesExtDisplayInfo *info = XFixesFindDisplay(dpy); XFixesCheckExtension(dpy, info, False); switch ((event->type & 0x7F) - info->codes->first_event) { case XFixesSelectionNotify: { XFixesSelectionNotifyEvent *aevent; xXFixesSelectionNotifyEvent *awire; awire = (xXFixesSelectionNotifyEvent *) wire; aevent = (XFixesSelectionNotifyEvent *) event; awire->type = aevent->type | (aevent->send_event ? 0x80 : 0); awire->subtype = aevent->subtype; awire->window = aevent->window; awire->owner = aevent->owner; awire->selection = aevent->selection; awire->timestamp = aevent->timestamp; awire->selectionTimestamp = aevent->selection_timestamp; return True; } case XFixesCursorNotify: { XFixesCursorNotifyEvent *aevent; xXFixesCursorNotifyEvent *awire; awire = (xXFixesCursorNotifyEvent *) wire; aevent = (XFixesCursorNotifyEvent *) event; awire->type = aevent->type | (aevent->send_event ? 0x80 : 0); awire->subtype = aevent->subtype; awire->window = aevent->window; awire->timestamp = aevent->timestamp; awire->cursorSerial = aevent->cursor_serial; awire->name = aevent->cursor_name; } } return False; } Bool XFixesQueryExtension (Display *dpy, int *event_base_return, int *error_base_return) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); if (XFixesHasExtension(info)) { *event_base_return = info->codes->first_event; *error_base_return = info->codes->first_error; return True; } else return False; } Status XFixesQueryVersion (Display *dpy, int *major_version_return, int *minor_version_return) { XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy); XFixesCheckExtension (dpy, info, 0); *major_version_return = info->major_version; *minor_version_return = info->minor_version; return 1; } int XFixesVersion (void) { return XFIXES_VERSION; } libXfixes-5.0.1/src/Xfixesint.h000064400000000000000000000053131215127773600164060ustar00rootroot00000000000000/* * * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Keith Packard not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Keith Packard makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ #ifndef _XFIXESINT_H_ #define _XFIXESINT_H_ #include #include #include #include #include "Xfixes.h" #include typedef struct _XFixesExtDisplayInfo { struct _XFixesExtDisplayInfo *next; /* keep a linked list */ Display *display; /* which display this is */ XExtCodes *codes; /* the extension protocol codes */ int major_version; /* -1 means we don't know */ int minor_version; /* -1 means we don't know */ } XFixesExtDisplayInfo; /* replaces XExtensionInfo */ typedef struct _XFixesExtInfo { XFixesExtDisplayInfo *head; /* start of the list */ XFixesExtDisplayInfo *cur; /* most recently used */ int ndisplays; /* number of displays */ } XFixesExtInfo; extern XFixesExtInfo XFixesExtensionInfo; extern char XFixesExtensionName[]; XFixesExtDisplayInfo * XFixesFindDisplay (Display *dpy); #define XFixesHasExtension(i) ((i) && ((i)->codes)) #define XFixesCheckExtension(dpy,i,val) \ if (!XFixesHasExtension(i)) { return val; } #define XFixesSimpleCheckExtension(dpy,i) \ if (!XFixesHasExtension(i)) { return; } #ifndef HAVE__XEATDATAWORDS #include /* for LONG64 on 64-bit platforms */ #include static inline void _XEatDataWords(Display *dpy, unsigned long n) { # ifndef LONG64 if (n >= (ULONG_MAX >> 2)) _XIOError(dpy); # endif _XEatData (dpy, n << 2); } #endif #endif /* _XFIXESINT_H_ */ libXfixes-5.0.1/xfixes.pc.in000064400000000000000000000004241215127773600157220ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: Xfixes Description: X Fixes Library Version: @PACKAGE_VERSION@ Requires: xproto fixesproto >= @FIXESEXT_VERSION@ Requires.private: x11 Cflags: -I${includedir} Libs: -L${libdir} -lXfixes