sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-08-28 05:57:34 +00:00
commit 88965415ff
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
26235 changed files with 29195616 additions and 0 deletions

345
lib/libXfixes/src/Cursor.c Normal file
View file

@ -0,0 +1,345 @@
/*
* Copyright (c) 2006, Oracle and/or its affiliates.
* 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 <config.h>
#endif
#include "Xfixesint.h"
#include <limits.h>
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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesSelectCursorInput;
req->window = (CARD32) win;
req->eventMask = (CARD32) 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 = 0, nread = 0;
XFixesCursorImage *image;
char *name;
XFixesCheckExtension (dpy, info, NULL);
LockDisplay (dpy);
GetReq (XFixesGetCursorImageAndName, req);
req->reqType = (CARD8) 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)) {
size_t rlength;
/* 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;
CARD16 nbytes = (CARD16) strlen (name);
XFixesSimpleCheckExtension (dpy, info);
if (info->major_version < 2)
return;
LockDisplay (dpy);
GetReq (XFixesSetCursorName, req);
req->reqType = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesSetCursorName;
req->cursor = (CARD32) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesGetCursorName;
req->cursor = (CARD32) cursor;
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
{
UnlockDisplay (dpy);
SyncHandle ();
return NULL;
}
*atom = rep.atom;
if ((name = Xmalloc(rep.nbytes+1)) != NULL) {
_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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesChangeCursor;
req->source = (CARD32) source;
req->destination = (CARD32) destination;
UnlockDisplay(dpy);
SyncHandle();
}
void
XFixesChangeCursorByName (Display *dpy, Cursor source, const char *name)
{
XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy);
xXFixesChangeCursorByNameReq *req;
CARD16 nbytes = (CARD16) strlen (name);
XFixesSimpleCheckExtension (dpy, info);
if (info->major_version < 2)
return;
LockDisplay (dpy);
GetReq (XFixesChangeCursorByName, req);
req->reqType = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesChangeCursorByName;
req->source = (CARD32) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesHideCursor;
req->window = (CARD32) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesShowCursor;
req->window = (CARD32) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesCreatePointerBarrier;
barrier = XAllocID (dpy);
req->barrier = (CARD32) barrier;
req->window = (CARD32) w;
req->x1 = (INT16) x1;
req->y1 = (INT16) y1;
req->x2 = (INT16) x2;
req->y2 = (INT16) y2;
req->directions = (CARD32) directions;
if ((req->num_devices = (CARD16) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesDestroyPointerBarrier;
req->barrier = (CARD32) b;
UnlockDisplay (dpy);
SyncHandle();
}

View file

@ -0,0 +1,100 @@
/*
* Copyright (c) 2006, Oracle and/or its affiliates.
* Copyright 2021 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 <config.h>
#endif
#include "Xfixesint.h"
#include <limits.h>
void
XFixesSetClientDisconnectMode(Display *dpy, int disconnect_mode)
{
XFixesExtDisplayInfo *info = XFixesFindDisplay(dpy);
xXFixesSetClientDisconnectModeReq *req;
XFixesSimpleCheckExtension(dpy, info);
if (info->major_version < 6)
return;
LockDisplay(dpy);
GetReq(XFixesSetClientDisconnectMode, req);
req->reqType = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesSetClientDisconnectMode;
req->disconnect_mode = (CARD32) disconnect_mode;
UnlockDisplay(dpy);
SyncHandle();
}
int
XFixesGetClientDisconnectMode(Display *dpy)
{
XFixesExtDisplayInfo *info = XFixesFindDisplay(dpy);
xXFixesGetClientDisconnectModeReq *req;
xXFixesGetClientDisconnectModeReply rep;
int disconnect_mode;
XFixesCheckExtension(dpy, info, 0);
if (info->major_version < 6)
return XFixesClientDisconnectFlagDefault;
LockDisplay(dpy);
GetReq(XFixesGetClientDisconnectMode, req);
req->reqType = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesGetClientDisconnectMode;
if (!_XReply(dpy, (xReply *) &rep, 0, xFalse))
{
UnlockDisplay(dpy);
SyncHandle();
return XFixesClientDisconnectFlagDefault;
}
disconnect_mode = (int) rep.disconnect_mode;
UnlockDisplay(dpy);
SyncHandle();
return disconnect_mode;
}

View file

@ -0,0 +1,20 @@
lib_LTLIBRARIES = libXfixes.la
libXfixes_la_SOURCES = \
Cursor.c \
Disconnect.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

View file

@ -0,0 +1,668 @@
# Makefile.in generated by automake 1.12.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = src
DIST_COMMON = $(libXfixesinclude_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(libdir)" \
"$(DESTDIR)$(libXfixesincludedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libXfixes_la_DEPENDENCIES =
am_libXfixes_la_OBJECTS = Cursor.lo Disconnect.lo Region.lo SaveSet.lo \
Selection.lo Xfixes.lo
libXfixes_la_OBJECTS = $(am_libXfixes_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
libXfixes_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libXfixes_la_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libXfixes_la_SOURCES)
DIST_SOURCES = $(libXfixes_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(libXfixesinclude_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
FIXESEXT_CFLAGS = @FIXESEXT_CFLAGS@
FIXESEXT_LIBS = @FIXESEXT_LIBS@
FIXESEXT_VERSION = @FIXESEXT_VERSION@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
VERSION = @VERSION@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
lib_LTLIBRARIES = libXfixes.la
libXfixes_la_SOURCES = \
Cursor.c \
Disconnect.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
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
libXfixes.la: $(libXfixes_la_OBJECTS) $(libXfixes_la_DEPENDENCIES) $(EXTRA_libXfixes_la_DEPENDENCIES)
$(AM_V_CCLD)$(libXfixes_la_LINK) -rpath $(libdir) $(libXfixes_la_OBJECTS) $(libXfixes_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Cursor.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Disconnect.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Region.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SaveSet.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Selection.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xfixes.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-libXfixesincludeHEADERS: $(libXfixesinclude_HEADERS)
@$(NORMAL_INSTALL)
@list='$(libXfixesinclude_HEADERS)'; test -n "$(libXfixesincludedir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(libXfixesincludedir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libXfixesincludedir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libXfixesincludedir)'"; \
$(INSTALL_HEADER) $$files "$(DESTDIR)$(libXfixesincludedir)" || exit $$?; \
done
uninstall-libXfixesincludeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(libXfixesinclude_HEADERS)'; test -n "$(libXfixesincludedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(libXfixesincludedir)'; $(am__uninstall_files_from_dir)
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libXfixesincludedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-libXfixesincludeHEADERS
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-libLTLIBRARIES
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-libLTLIBRARIES \
uninstall-libXfixesincludeHEADERS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool cscopelist ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am \
install-libLTLIBRARIES install-libXfixesincludeHEADERS \
install-man install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-libLTLIBRARIES \
uninstall-libXfixesincludeHEADERS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

458
lib/libXfixes/src/Region.c Normal file
View file

@ -0,0 +1,458 @@
/*
* 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 <config.h>
#endif
#include <limits.h>
#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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesCreateRegion;
region = XAllocID (dpy);
req->region = (CARD32) region;
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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesCreateRegionFromBitmap;
region = XAllocID (dpy);
req->region = (CARD32) region;
req->bitmap = (CARD32) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesCreateRegionFromWindow;
region = XAllocID (dpy);
req->region = (CARD32) region;
req->window = (CARD32) window;
req->kind = (CARD8) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesCreateRegionFromGC;
region = XAllocID (dpy);
req->region = (CARD32) region;
req->gc = (CARD32) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesCreateRegionFromPicture;
region = XAllocID (dpy);
req->region = (CARD32) region;
req->picture = (CARD32) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesDestroyRegion;
req->region = (CARD32) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesSetRegion;
req->region = (CARD32) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesCopyRegion;
req->source = (CARD32) src;
req->destination = (CARD32) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesUnionRegion;
req->source1 = (CARD32) src1;
req->source2 = (CARD32) src2;
req->destination = (CARD32) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesIntersectRegion;
req->source1 = (CARD32) src1;
req->source2 = (CARD32) src2;
req->destination = (CARD32) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesSubtractRegion;
req->source1 = (CARD32) src1;
req->source2 = (CARD32) src2;
req->destination = (CARD32) 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 = (CARD8) 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 = (CARD32) src;
req->destination = (CARD32) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesTranslateRegion;
req->region = (CARD32) region;
req->dx = (INT16) dx;
req->dy = (INT16) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesRegionExtents;
req->source = (CARD32) src;
req->destination = (CARD32) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesFetchRegion;
req->region = (CARD32) 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;
if (rep.length < (INT_MAX >> 2)) {
nbytes = (long) rep.length << 2;
nrects = rep.length >> 1;
rects = Xmalloc ((size_t) nrects * sizeof (XRectangle));
} else {
nbytes = 0;
nrects = 0;
rects = NULL;
}
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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesSetGCClipRegion;
req->gc = (CARD32) gc->gid;
req->region = (CARD32) region;
req->xOrigin = (INT16) clip_x_origin;
req->yOrigin = (INT16) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesSetWindowShapeRegion;
req->dest = (CARD32) win;
req->destKind = (BYTE) shape_kind;
req->xOff = (INT16) x_off;
req->yOff = (INT16) y_off;
req->region = (CARD32) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesSetPictureClipRegion;
req->picture = (CARD32) picture;
req->region = (CARD32) region;
req->xOrigin = (INT16) clip_x_origin;
req->yOrigin = (INT16) 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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesExpandRegion;
req->source = (CARD32) src;
req->destination = (CARD32) dst;
req->left = (CARD16) left;
req->right = (CARD16) right;
req->top = (CARD16) top;
req->bottom = (CARD16) bottom;
UnlockDisplay (dpy);
SyncHandle();
}

View file

@ -0,0 +1,47 @@
/*
*
* 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 <config.h>
#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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesChangeSaveSet;
req->mode = (BYTE) mode;
req->target = (BYTE) target;
req->map = (BYTE) map;
req->window = (CARD32) win;
UnlockDisplay (dpy);
SyncHandle ();
}

View file

@ -0,0 +1,49 @@
/*
*
* 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 <config.h>
#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 = (CARD8) info->codes->major_opcode;
req->xfixesReqType = X_XFixesSelectSelectionInput;
req->window = (CARD32) win;
req->selection = (CARD32) selection;
req->eventMask = (CARD32) eventMask;
UnlockDisplay (dpy);
SyncHandle ();
}

334
lib/libXfixes/src/Xfixes.c Normal file
View file

@ -0,0 +1,334 @@
/*
*
* 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 <config.h>
#endif
#include <X11/Xfuncproto.h>
#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;
info = 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 (int 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 = (CARD8) 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 = (int) rep.majorVersion;
info->minor_version = (int) 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, const 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 (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,
const 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, _X_UNUSED 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 = (CARD8) (aevent->type | (aevent->send_event ? 0x80 : 0));
awire->subtype = (CARD8) aevent->subtype;
awire->window = (CARD32) aevent->window;
awire->owner = (CARD32) aevent->owner;
awire->selection = (CARD32) aevent->selection;
awire->timestamp = (CARD32) aevent->timestamp;
awire->selectionTimestamp = (CARD32) aevent->selection_timestamp;
return True;
}
case XFixesCursorNotify: {
XFixesCursorNotifyEvent *aevent;
xXFixesCursorNotifyEvent *awire;
awire = (xXFixesCursorNotifyEvent *) wire;
aevent = (XFixesCursorNotifyEvent *) event;
awire->type = (CARD8) (aevent->type | (aevent->send_event ? 0x80 : 0));
awire->subtype = (CARD8) aevent->subtype;
awire->window = (CARD32) aevent->window;
awire->timestamp = (CARD32) aevent->timestamp;
awire->cursorSerial = (CARD32) aevent->cursor_serial;
awire->name = (CARD32) 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;
}

View file

@ -0,0 +1,63 @@
/*
*
* 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 <stdio.h>
#include <X11/Xlib.h>
#include <X11/Xlibint.h>
#include <X11/Xutil.h>
#include "Xfixes.h"
#include <X11/extensions/xfixesproto.h>
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) \
do { if (!XFixesHasExtension(i)) { return val; } } while(0)
#define XFixesSimpleCheckExtension(dpy,i) \
do { if (!XFixesHasExtension(i)) { return; } } while(0)
#endif /* _XFIXESINT_H_ */