diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-11-05 13:32:59 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-11-05 13:32:59 +0000 |
commit | bf781c5ff285301ad70ffc5f4321b8906f71edd8 (patch) | |
tree | 3b770f4bf9a8cd11dd9f14e7f758991a73a52d78 /xserver/include | |
parent | e59d0622d3162f7b5a7420ef87dbebb200348c37 (diff) |
Update to xserver 1.11.2
Diffstat (limited to 'xserver/include')
41 files changed, 781 insertions, 550 deletions
diff --git a/xserver/include/Makefile.am b/xserver/include/Makefile.am index e76de05c3..6f63c764f 100644 --- a/xserver/include/Makefile.am +++ b/xserver/include/Makefile.am @@ -1,9 +1,9 @@ if XORG sdk_HEADERS = \ XIstubs.h \ - bstore.h \ - bstorestr.h \ + Xprintf.h \ callback.h \ + client.h \ closestr.h \ closure.h \ colormap.h \ @@ -67,6 +67,6 @@ AM_CFLAGS = $(DIX_CFLAGS) EXTRA_DIST = \ dix-config-apple-verbatim.h \ - eventconvert.h eventstr.h \ + eventconvert.h eventstr.h inpututils.h \ protocol-versions.h \ xsha1.h diff --git a/xserver/include/Makefile.in b/xserver/include/Makefile.in index 17245a6d6..4cecff5f1 100644 --- a/xserver/include/Makefile.in +++ b/xserver/include/Makefile.in @@ -45,7 +45,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/xwin-config.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/configure.ac + $(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)/m4/xorg-tls.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(install_sh) -d @@ -63,7 +66,7 @@ am__vpath_adj = case $$p in \ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(sdkdir)" "$(DESTDIR)$(sdkdir)" nodist_sdkHEADERS_INSTALL = $(INSTALL_HEADER) -am__sdk_HEADERS_DIST = XIstubs.h bstore.h bstorestr.h callback.h \ +am__sdk_HEADERS_DIST = XIstubs.h Xprintf.h callback.h client.h \ closestr.h closure.h colormap.h colormapst.h hotplug.h \ cursor.h cursorstr.h dix.h dixaccess.h dixevents.h dixfont.h \ dixfontstr.h dixgrabs.h dixstruct.h events.h exevents.h \ @@ -84,8 +87,8 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AGP_FALSE = @AGP_FALSE@ AGP_TRUE = @AGP_TRUE@ -AIGLX_FALSE = @AIGLX_FALSE@ -AIGLX_TRUE = @AIGLX_TRUE@ +AIGLX_DRI_LOADER_FALSE = @AIGLX_DRI_LOADER_FALSE@ +AIGLX_DRI_LOADER_TRUE = @AIGLX_DRI_LOADER_TRUE@ ALLOCA = @ALLOCA@ ALPHA_VIDEO_FALSE = @ALPHA_VIDEO_FALSE@ ALPHA_VIDEO_TRUE = @ALPHA_VIDEO_TRUE@ @@ -98,7 +101,6 @@ APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ -ARM_BACKTRACE_CFLAGS = @ARM_BACKTRACE_CFLAGS@ ARM_VIDEO_FALSE = @ARM_VIDEO_FALSE@ ARM_VIDEO_TRUE = @ARM_VIDEO_TRUE@ AS = @AS@ @@ -111,18 +113,19 @@ BSD_APM_FALSE = @BSD_APM_FALSE@ BSD_APM_TRUE = @BSD_APM_TRUE@ BSD_KQUEUE_APM_FALSE = @BSD_KQUEUE_APM_FALSE@ BSD_KQUEUE_APM_TRUE = @BSD_KQUEUE_APM_TRUE@ -BUILDDOCS_FALSE = @BUILDDOCS_FALSE@ -BUILDDOCS_TRUE = @BUILDDOCS_TRUE@ BUILD_DATE = @BUILD_DATE@ BUILD_KDRIVEFBDEVLIB_FALSE = @BUILD_KDRIVEFBDEVLIB_FALSE@ BUILD_KDRIVEFBDEVLIB_TRUE = @BUILD_KDRIVEFBDEVLIB_TRUE@ BUILD_TIME = @BUILD_TIME@ +BUNDLE_ID_PREFIX = @BUNDLE_ID_PREFIX@ CC = @CC@ CCAS = @CCAS@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHANGELOG_CMD = @CHANGELOG_CMD@ +CLIENTIDS_FALSE = @CLIENTIDS_FALSE@ +CLIENTIDS_TRUE = @CLIENTIDS_TRUE@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ COMPOSITE_FALSE = @COMPOSITE_FALSE@ COMPOSITE_TRUE = @COMPOSITE_TRUE@ @@ -139,12 +142,7 @@ CONFIG_WSCONS_TRUE = @CONFIG_WSCONS_TRUE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CWARNFLAGS = @CWARNFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ -DARWIN_LIBS = @DARWIN_LIBS@ DBE_FALSE = @DBE_FALSE@ DBE_TRUE = @DBE_TRUE@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -179,7 +177,6 @@ DMX_BUILD_USB_FALSE = @DMX_BUILD_USB_FALSE@ DMX_BUILD_USB_TRUE = @DMX_BUILD_USB_TRUE@ DMX_FALSE = @DMX_FALSE@ DMX_TRUE = @DMX_TRUE@ -DOLT_BASH = @DOLT_BASH@ DOXYGEN = @DOXYGEN@ DPMSExtension_FALSE = @DPMSExtension_FALSE@ DPMSExtension_TRUE = @DPMSExtension_TRUE@ @@ -200,7 +197,7 @@ DRI_LIBS = @DRI_LIBS@ DRI_TRUE = @DRI_TRUE@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ @@ -209,11 +206,12 @@ ENABLE_DEVEL_DOCS_FALSE = @ENABLE_DEVEL_DOCS_FALSE@ ENABLE_DEVEL_DOCS_TRUE = @ENABLE_DEVEL_DOCS_TRUE@ ENABLE_DOCS_FALSE = @ENABLE_DOCS_FALSE@ ENABLE_DOCS_TRUE = @ENABLE_DOCS_TRUE@ +ENABLE_UNIT_TESTS_FALSE = @ENABLE_UNIT_TESTS_FALSE@ +ENABLE_UNIT_TESTS_TRUE = @ENABLE_UNIT_TESTS_TRUE@ EXEEXT = @EXEEXT@ -F77 = @F77@ FBDEVHW_FALSE = @FBDEVHW_FALSE@ FBDEVHW_TRUE = @FBDEVHW_TRUE@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ FONT100DPIDIR = @FONT100DPIDIR@ @@ -226,11 +224,10 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ FREEBSD_KLDLOAD_FALSE = @FREEBSD_KLDLOAD_FALSE@ FREEBSD_KLDLOAD_TRUE = @FREEBSD_KLDLOAD_TRUE@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_LIBS = @GLIB_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GLX_FALSE = @GLX_FALSE@ +GLX_TLS = @GLX_TLS@ GLX_TRUE = @GLX_TRUE@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -243,12 +240,16 @@ HAVE_DOXYGEN_FALSE = @HAVE_DOXYGEN_FALSE@ HAVE_DOXYGEN_TRUE = @HAVE_DOXYGEN_TRUE@ HAVE_FOP_FALSE = @HAVE_FOP_FALSE@ HAVE_FOP_TRUE = @HAVE_FOP_TRUE@ +HAVE_LD_WRAP_FALSE = @HAVE_LD_WRAP_FALSE@ +HAVE_LD_WRAP_TRUE = @HAVE_LD_WRAP_TRUE@ HAVE_STYLESHEETS_FALSE = @HAVE_STYLESHEETS_FALSE@ HAVE_STYLESHEETS_TRUE = @HAVE_STYLESHEETS_TRUE@ HAVE_XMLTO_FALSE = @HAVE_XMLTO_FALSE@ HAVE_XMLTO_TEXT_FALSE = @HAVE_XMLTO_TEXT_FALSE@ HAVE_XMLTO_TEXT_TRUE = @HAVE_XMLTO_TEXT_TRUE@ HAVE_XMLTO_TRUE = @HAVE_XMLTO_TRUE@ +HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@ +HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@ HP300_VIDEO_FALSE = @HP300_VIDEO_FALSE@ HP300_VIDEO_TRUE = @HP300_VIDEO_TRUE@ HPPA_VIDEO_FALSE = @HPPA_VIDEO_FALSE@ @@ -294,7 +295,10 @@ KDRIVE_MOUSE_TRUE = @KDRIVE_MOUSE_TRUE@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KDRIVE_TRUE = @KDRIVE_TRUE@ -LAUNCHD_ID_PREFIX = @LAUNCHD_ID_PREFIX@ +KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ +KHRONOS_OPENGL_REGISTRY_LIBS = @KHRONOS_OPENGL_REGISTRY_LIBS@ +KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ LEX = @LEX@ @@ -313,19 +317,19 @@ LINUX_ALPHA_FALSE = @LINUX_ALPHA_FALSE@ LINUX_ALPHA_TRUE = @LINUX_ALPHA_TRUE@ LINUX_IA64_FALSE = @LINUX_IA64_FALSE@ LINUX_IA64_TRUE = @LINUX_IA64_TRUE@ +LIPO = @LIPO@ LNXACPI_FALSE = @LNXACPI_FALSE@ LNXACPI_TRUE = @LNXACPI_TRUE@ LNXAPM_FALSE = @LNXAPM_FALSE@ LNXAPM_TRUE = @LNXAPM_TRUE@ LN_S = @LN_S@ -LTCOMPILE = @LTCOMPILE@ -LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ @@ -335,6 +339,7 @@ NEED_STRLCAT_FALSE = @NEED_STRLCAT_FALSE@ NEED_STRLCAT_TRUE = @NEED_STRLCAT_TRUE@ NEED_VSNPRINTF_FALSE = @NEED_VSNPRINTF_FALSE@ NEED_VSNPRINTF_TRUE = @NEED_VSNPRINTF_TRUE@ +NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJCCLD = @OBJCCLD@ @@ -346,6 +351,8 @@ OBJEXT = @OBJEXT@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OS_LIB = @OS_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -356,7 +363,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ PCIACCESS_LIBS = @PCIACCESS_LIBS@ PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ -PERL = @PERL@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ @@ -398,6 +404,7 @@ SPECIAL_DTRACE_OBJECTS_FALSE = @SPECIAL_DTRACE_OBJECTS_FALSE@ SPECIAL_DTRACE_OBJECTS_TRUE = @SPECIAL_DTRACE_OBJECTS_TRUE@ STANDALONE_XPBPROXY_FALSE = @STANDALONE_XPBPROXY_FALSE@ STANDALONE_XPBPROXY_TRUE = @STANDALONE_XPBPROXY_TRUE@ +STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SYSCONFDIR = @SYSCONFDIR@ @@ -407,8 +414,6 @@ TSLIB_LIBS = @TSLIB_LIBS@ TSLIB_TRUE = @TSLIB_TRUE@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ -UNITTESTS_FALSE = @UNITTESTS_FALSE@ -UNITTESTS_TRUE = @UNITTESTS_TRUE@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VBE_FALSE = @VBE_FALSE@ VBE_TRUE = @VBE_TRUE@ @@ -425,8 +430,6 @@ XAA_FALSE = @XAA_FALSE@ XAA_TRUE = @XAA_TRUE@ XACE_FALSE = @XACE_FALSE@ XACE_TRUE = @XACE_TRUE@ -XCALIBRATE_FALSE = @XCALIBRATE_FALSE@ -XCALIBRATE_TRUE = @XCALIBRATE_TRUE@ XCSECURITY_FALSE = @XCSECURITY_FALSE@ XCSECURITY_TRUE = @XCSECURITY_TRUE@ XDMAUTH_FALSE = @XDMAUTH_FALSE@ @@ -462,6 +465,11 @@ XINERAMA_TRUE = @XINERAMA_TRUE@ XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ +XKB_DFLT_LAYOUT = @XKB_DFLT_LAYOUT@ +XKB_DFLT_MODEL = @XKB_DFLT_MODEL@ +XKB_DFLT_OPTIONS = @XKB_DFLT_OPTIONS@ +XKB_DFLT_RULES = @XKB_DFLT_RULES@ +XKB_DFLT_VARIANT = @XKB_DFLT_VARIANT@ XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ XLIB_CFLAGS = @XLIB_CFLAGS@ XLIB_LIBS = @XLIB_LIBS@ @@ -493,6 +501,7 @@ XORG_TRUE = @XORG_TRUE@ XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ XPBPROXY_LIBS = @XPBPROXY_LIBS@ XQUARTZ_FALSE = @XQUARTZ_FALSE@ +XQUARTZ_LIBS = @XQUARTZ_LIBS@ XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ XQUARTZ_SPARKLE_FALSE = @XQUARTZ_SPARKLE_FALSE@ XQUARTZ_SPARKLE_TRUE = @XQUARTZ_SPARKLE_TRUE@ @@ -511,6 +520,7 @@ XSERVER_DTRACE_FALSE = @XSERVER_DTRACE_FALSE@ XSERVER_DTRACE_TRUE = @XSERVER_DTRACE_TRUE@ XSERVER_LIBS = @XSERVER_LIBS@ XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ +XSLTPROC = @XSLTPROC@ XSL_STYLESHEET = @XSL_STYLESHEET@ XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ @@ -555,13 +565,11 @@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ abi_xinput = @abi_xinput@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__fastdepOBJC_FALSE = @am__fastdepOBJC_FALSE@ am__fastdepOBJC_TRUE = @am__fastdepOBJC_TRUE@ am__include = @am__include@ @@ -613,9 +621,9 @@ sysconfigdir = @sysconfigdir@ target_alias = @target_alias@ @XORG_TRUE@sdk_HEADERS = \ @XORG_TRUE@ XIstubs.h \ -@XORG_TRUE@ bstore.h \ -@XORG_TRUE@ bstorestr.h \ +@XORG_TRUE@ Xprintf.h \ @XORG_TRUE@ callback.h \ +@XORG_TRUE@ client.h \ @XORG_TRUE@ closestr.h \ @XORG_TRUE@ closure.h \ @XORG_TRUE@ colormap.h \ @@ -676,7 +684,7 @@ target_alias = @target_alias@ AM_CFLAGS = $(DIX_CFLAGS) EXTRA_DIST = \ dix-config-apple-verbatim.h \ - eventconvert.h eventstr.h \ + eventconvert.h eventstr.h inpututils.h \ protocol-versions.h \ xsha1.h diff --git a/xserver/include/XIstubs.h b/xserver/include/XIstubs.h index ba2f861cd..6ab82dff9 100644 --- a/xserver/include/XIstubs.h +++ b/xserver/include/XIstubs.h @@ -26,20 +26,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef XI_STUBS_H #define XI_STUBS_H 1 -extern _X_EXPORT void -CloseInputDevice ( - DeviceIntPtr /* d */, - ClientPtr /* client */); - -extern _X_EXPORT void -AddOtherInputDevices (void); - -extern _X_EXPORT void -OpenInputDevice ( - DeviceIntPtr /* dev */, - ClientPtr /* client */, - int * /* status */); - extern _X_EXPORT int SetDeviceMode ( ClientPtr /* client */, diff --git a/xserver/include/Xprintf.h b/xserver/include/Xprintf.h new file mode 100644 index 000000000..5177122c9 --- /dev/null +++ b/xserver/include/Xprintf.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010, 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. + */ + +#ifndef XPRINTF_H +#define XPRINTF_H + +#include <stdio.h> +#include <stdarg.h> +#include <X11/Xfuncproto.h> + +#ifndef _X_RESTRICT_KYWD +# if defined(restrict) /* assume autoconf set it correctly */ || \ + (defined(__STDC__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */ +# define _X_RESTRICT_KYWD restrict +# elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */ +# define _X_RESTRICT_KYWD __restrict__ +# else +# define _X_RESTRICT_KYWD +# endif +#endif + +/* + * These functions provide a portable implementation of the common (but not + * yet universal) asprintf & vasprintf routines to allocate a buffer big + * enough to sprintf the arguments to. The XNF variants terminate the server + * if the allocation fails. + * The buffer allocated is returned in the pointer provided in the first + * argument. The return value is the size of the allocated buffer, or -1 + * on failure. + */ +extern _X_EXPORT int Xasprintf (char **ret, + const char * _X_RESTRICT_KYWD fmt, + ...) _X_ATTRIBUTE_PRINTF(2,3); +extern _X_EXPORT int Xvasprintf (char **ret, + const char * _X_RESTRICT_KYWD fmt, + va_list va) _X_ATTRIBUTE_PRINTF(2,0); +extern _X_EXPORT int XNFasprintf (char **ret, + const char * _X_RESTRICT_KYWD fmt, + ...) _X_ATTRIBUTE_PRINTF(2,3); +extern _X_EXPORT int XNFvasprintf (char **ret, + const char * _X_RESTRICT_KYWD fmt, + va_list va) _X_ATTRIBUTE_PRINTF(2,0); + +#if !defined(HAVE_ASPRINTF) && !defined(HAVE_VASPRINTF) +# define asprintf Xasprintf +# define vasprintf Xvasprintf +#endif + +#endif /* XPRINTF_H */ diff --git a/xserver/include/bstore.h b/xserver/include/bstore.h deleted file mode 100644 index 843d6bb35..000000000 --- a/xserver/include/bstore.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 1987 by the Regents of the University of California - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies. The University of - * California makes no representations about the suitability of this software - * for any purpose. It is provided "as is" without express or implied - * warranty. - */ - -/* - * Moved here from mi to allow wrapping of lower level backing store functions. - * -- 1997.10.27 Marc Aurele La France (tsi@xfree86.org) - */ - -#ifndef _BSTORE_H_ -#define _BSTORE_H_ - -#include "bstorestr.h" - -#endif /* _BSTORE_H_ */ diff --git a/xserver/include/bstorestr.h b/xserver/include/bstorestr.h deleted file mode 100644 index cf7820ba4..000000000 --- a/xserver/include/bstorestr.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 1987 by the Regents of the University of California - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies. The University of - * California makes no representations about the suitability of this software - * for any purpose. It is provided "as is" without express or implied - * warranty. - */ - -/* - * Moved here from mi to allow wrapping of lower level backing store functions. - * -- 1997.10.27 Marc Aurele La France (tsi@xfree86.org) - */ - -#ifndef _BSTORESTR_H_ -#define _BSTORESTR_H_ - -#include "gc.h" -#include "pixmap.h" -#include "region.h" -#include "window.h" - -typedef void (* BackingStoreSaveAreasProcPtr)( - PixmapPtr /*pBackingPixmap*/, - RegionPtr /*pObscured*/, - int /*x*/, - int /*y*/, - WindowPtr /*pWin*/); - -typedef void (* BackingStoreRestoreAreasProcPtr)( - PixmapPtr /*pBackingPixmap*/, - RegionPtr /*pExposed*/, - int /*x*/, - int /*y*/, - WindowPtr /*pWin*/); - -typedef void (* BackingStoreSetClipmaskRgnProcPtr)( - GCPtr /*pBackingGC*/, - RegionPtr /*pbackingCompositeClip*/); - -typedef PixmapPtr (* BackingStoreGetImagePixmapProcPtr)(void); - -typedef PixmapPtr (* BackingStoreGetSpansPixmapProcPtr)(void); - -typedef struct _BSFuncs { - BackingStoreSaveAreasProcPtr SaveAreas; - BackingStoreRestoreAreasProcPtr RestoreAreas; - BackingStoreSetClipmaskRgnProcPtr SetClipmaskRgn; - BackingStoreGetImagePixmapProcPtr GetImagePixmap; - BackingStoreGetSpansPixmapProcPtr GetSpansPixmap; -} BSFuncRec, *BSFuncPtr; - -#endif /* _BSTORESTR_H_ */ diff --git a/xserver/include/callback.h b/xserver/include/callback.h index 632ed4f32..9a1da73e8 100644 --- a/xserver/include/callback.h +++ b/xserver/include/callback.h @@ -75,10 +75,17 @@ extern _X_EXPORT Bool DeleteCallback( CallbackProcPtr /*callback*/, pointer /*data*/); -extern _X_EXPORT void CallCallbacks( +extern _X_EXPORT void _CallCallbacks( CallbackListPtr * /*pcbl*/, pointer /*call_data*/); +static inline void +CallCallbacks(CallbackListPtr *pcbl, pointer call_data) +{ + if (!pcbl || !*pcbl) return; + _CallCallbacks(pcbl, call_data); +} + extern _X_EXPORT void DeleteCallbackList( CallbackListPtr * /*pcbl*/); diff --git a/xserver/include/client.h b/xserver/include/client.h new file mode 100644 index 000000000..aaafc7da6 --- /dev/null +++ b/xserver/include/client.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). All + * rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * 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. + */ + +/* Author: Rami Ylimäki <rami.ylimaki@vincit.fi> */ + +#ifndef CLIENT_H +#define CLIENT_H + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif /* HAVE_DIX_CONFIG_H */ +#include <X11/Xfuncproto.h> +#include <sys/types.h> + +/* Client IDs. Use GetClientPid, GetClientCmdName and GetClientCmdArgs + * instead of accessing the fields directly. */ +typedef struct { + pid_t pid; /* process ID, -1 if not available */ + const char *cmdname; /* process name, NULL if not available */ + const char *cmdargs; /* process arguments, NULL if not available */ +} ClientIdRec, *ClientIdPtr; + +struct _Client; + +/* Initialize and clean up. */ +void ReserveClientIds(struct _Client *client); +void ReleaseClientIds(struct _Client *client); + +/* Determine client IDs for caching. Exported on purpose for + * extensions such as SELinux. */ +extern _X_EXPORT pid_t DetermineClientPid(struct _Client *client); +extern _X_EXPORT void DetermineClientCmd(pid_t, const char **cmdname, const char **cmdargs); + +/* Query cached client IDs. Exported on purpose for drivers. */ +extern _X_EXPORT pid_t GetClientPid(struct _Client *client); +extern _X_EXPORT const char *GetClientCmdName(struct _Client *client); +extern _X_EXPORT const char *GetClientCmdArgs(struct _Client *client); + +#endif /* CLIENT_H */ diff --git a/xserver/include/closestr.h b/xserver/include/closestr.h index 7ca2613e7..ab18ef9e5 100644 --- a/xserver/include/closestr.h +++ b/xserver/include/closestr.h @@ -97,16 +97,6 @@ typedef struct _LFclosure { /* PolyText */ -typedef - int (* PolyTextPtr)( - DrawablePtr /* pDraw */, - GCPtr /* pGC */, - int /* x */, - int /* y */, - int /* count */, - void * /* chars or shorts */ - ); - typedef struct _PTclosure { ClientPtr client; DrawablePtr pDraw; @@ -117,24 +107,12 @@ typedef struct _PTclosure { int xorg; int yorg; CARD8 reqType; - PolyTextPtr polyText; - int itemSize; XID did; int err; } PTclosureRec; /* ImageText */ -typedef - void (* ImageTextPtr)( - DrawablePtr /* pDraw */, - GCPtr /* pGC */, - int /* x */, - int /* y */, - int /* count */, - void * /* chars or shorts */ - ); - typedef struct _ITclosure { ClientPtr client; DrawablePtr pDraw; @@ -144,8 +122,6 @@ typedef struct _ITclosure { int xorg; int yorg; CARD8 reqType; - ImageTextPtr imageText; - int itemSize; XID did; } ITclosureRec; #endif /* CLOSESTR_H */ diff --git a/xserver/include/colormapst.h b/xserver/include/colormapst.h index f1fc8ebef..b597e2c60 100644 --- a/xserver/include/colormapst.h +++ b/xserver/include/colormapst.h @@ -103,12 +103,12 @@ typedef struct _ColormapRec { VisualPtr pVisual; short class; /* PseudoColor or DirectColor */ -#if defined(_XSERVER64) +#if defined(_LP64) short pad0; XID pad1; #endif XID mid; /* client's name for colormap */ -#if defined(_XSERVER64) && (X_BYTE_ORDER == X_LITTLE_ENDIAN) +#if defined(_LP64) && (X_BYTE_ORDER == X_LITTLE_ENDIAN) XID pad2; #endif ScreenPtr pScreen; /* screen map is associated with */ @@ -126,9 +126,7 @@ typedef struct _ColormapRec Entry *red; Entry *green; Entry *blue; - pointer devPriv; - PrivateRec *devPrivates; /* dynamic devPrivates added after devPriv - already existed - must keep devPriv */ + PrivateRec *devPrivates; } ColormapRec; #endif /* COLORMAP_H */ diff --git a/xserver/include/dix-config.h.in b/xserver/include/dix-config.h.in index 766116725..c30b620db 100644 --- a/xserver/include/dix-config.h.in +++ b/xserver/include/dix-config.h.in @@ -30,9 +30,6 @@ /* Support Damage extension */ #undef DAMAGE -/* Build for darwin with Quartz support */ -#undef DARWIN_WITH_QUARTZ - /* Use OsVendorVErrorF */ #undef DDXOSVERRORF @@ -127,8 +124,8 @@ /* Support application updating through sparkle. */ #undef XQUARTZ_SPARKLE -/* Prefix to use for launchd identifiers */ -#undef LAUNCHD_ID_PREFIX +/* Prefix to use for bundle identifiers */ +#undef BUNDLE_ID_PREFIX /* Build a standalone xpbproxy */ #undef STANDALONE_XPBPROXY @@ -136,6 +133,9 @@ /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM +/* Define to 1 if you have the libdispatch (GCD) available */ +#undef HAVE_LIBDISPATCH + /* Define to 1 if you have the `link' function. */ #undef HAVE_LINK @@ -243,6 +243,9 @@ /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF +/* Define to 1 if you have the `vasprintf' function. */ +#undef HAVE_VASPRINTF + /* Support IPv6 for TCP connections */ #undef IPv6 @@ -276,6 +279,9 @@ /* Support X resource extension */ #undef RES +/* Support client ID tracking in X resource extension */ +#undef CLIENTIDS + /* Support MIT-SCREEN-SAVER extension */ #undef SCREENSAVER @@ -444,6 +450,9 @@ /* Define to 1 if you have the `ffs' function. */ #undef HAVE_FFS +/* The compiler supported TLS storage class, prefering initial-exec if tls_model is supported */ +#undef TLS + /* Correctly set _XSERVER64 for OSX fat binaries */ #ifdef __APPLE__ #include "dix-config-apple-verbatim.h" diff --git a/xserver/include/dix.h b/xserver/include/dix.h index dce6ec991..c11e5b08c 100644 --- a/xserver/include/dix.h +++ b/xserver/include/dix.h @@ -372,6 +372,13 @@ extern void AllowSome( extern void ReleaseActiveGrabs( ClientPtr client); +extern GrabPtr CheckPassiveGrabsOnWindow( + WindowPtr /* pWin */, + DeviceIntPtr /* device */, + InternalEvent * /* event */, + BOOL /* checkCore */, + BOOL /* activate */); + extern _X_EXPORT int DeliverEventsToWindow( DeviceIntPtr /* pWin */, WindowPtr /* pWin */, @@ -380,6 +387,11 @@ extern _X_EXPORT int DeliverEventsToWindow( Mask /* filter */, GrabPtr /* grab */); +extern _X_EXPORT void DeliverRawEvent( + RawDeviceEvent* /* ev */, + DeviceIntPtr /* dev */ +); + extern int DeliverDeviceEvents( WindowPtr /* pWin */, InternalEvent* /* event */, @@ -401,14 +413,14 @@ extern _X_EXPORT void WindowHasNewCursor( extern Bool CheckDeviceGrabs( DeviceIntPtr /* device */, DeviceEvent* /* event */, - int /* checkFirst */); + WindowPtr /* ancestor */); extern void DeliverFocusedEvent( DeviceIntPtr /* keybd */, InternalEvent* /* event */, WindowPtr /* window */); -extern void DeliverGrabbedEvent( +extern int DeliverGrabbedEvent( InternalEvent* /* event */, DeviceIntPtr /* thisDev */, Bool /* deactivateGrab */); @@ -563,40 +575,10 @@ extern _X_EXPORT Bool IsPointerDevice( DeviceIntPtr dev); extern _X_EXPORT Bool IsKeyboardDevice(DeviceIntPtr dev); extern Bool IsPointerEvent(InternalEvent *event); extern _X_EXPORT Bool IsMaster(DeviceIntPtr dev); +extern _X_EXPORT Bool IsFloating(DeviceIntPtr dev); extern _X_HIDDEN void CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master); extern _X_HIDDEN int CorePointerProc(DeviceIntPtr dev, int what); extern _X_HIDDEN int CoreKeyboardProc(DeviceIntPtr dev, int what); - -/* - * These are deprecated compatibility functions and will be removed soon! - * Please use the noted replacements instead. - */ -/* replaced by dixLookupWindow */ -extern _X_EXPORT WindowPtr SecurityLookupWindow( - XID id, - ClientPtr client, - Mask access_mode); -/* replaced by dixLookupWindow */ -extern _X_EXPORT WindowPtr LookupWindow( - XID id, - ClientPtr client); - -/* replaced by dixLookupDrawable */ -extern _X_EXPORT pointer SecurityLookupDrawable( - XID id, - ClientPtr client, - Mask access_mode); - -/* replaced by dixLookupDrawable */ -extern _X_EXPORT pointer LookupDrawable( - XID id, - ClientPtr client); - -/* replaced by dixLookupClient */ -extern _X_EXPORT ClientPtr LookupClient( - XID id, - ClientPtr client); - #endif /* DIX_H */ diff --git a/xserver/include/dixgrabs.h b/xserver/include/dixgrabs.h index 3b2a46d72..229c8bb53 100644 --- a/xserver/include/dixgrabs.h +++ b/xserver/include/dixgrabs.h @@ -28,6 +28,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. struct _GrabParameters; +extern void PrintDeviceGrabInfo(DeviceIntPtr dev); +extern void UngrabAllDevices(Bool kill_client); + extern GrabPtr CreateGrab( int /* client */, DeviceIntPtr /* device */, diff --git a/xserver/include/dixstruct.h b/xserver/include/dixstruct.h index efa2577f8..443e8b0ae 100644 --- a/xserver/include/dixstruct.h +++ b/xserver/include/dixstruct.h @@ -24,6 +24,7 @@ SOFTWARE. #ifndef DIXSTRUCT_H #define DIXSTRUCT_H +#include "client.h" #include "dix.h" #include "resource.h" #include "cursor.h" @@ -121,6 +122,7 @@ typedef struct _Client { long smart_check_tick; DeviceIntPtr clientPtr; + ClientIdPtr clientIds; } ClientRec; /* @@ -136,7 +138,7 @@ extern _X_EXPORT void SmartScheduleStopTimer(void); #define SMART_MAX_PRIORITY (20) #define SMART_MIN_PRIORITY (-20) -extern _X_EXPORT Bool SmartScheduleInit(void); +extern _X_EXPORT void SmartScheduleInit(void); /* This prototype is used pervasively in Xext, dix */ diff --git a/xserver/include/do-not-use-config.h.in b/xserver/include/do-not-use-config.h.in index 08c842605..fb24b8d0e 100644 --- a/xserver/include/do-not-use-config.h.in +++ b/xserver/include/do-not-use-config.h.in @@ -21,6 +21,12 @@ /* Builder string */ #undef BUILDERSTRING +/* Prefix to use for bundle identifiers */ +#undef BUNDLE_ID_PREFIX + +/* Support client ID tracking */ +#undef CLIENTIDS + /* Default font path */ #undef COMPILEDDEFAULTFONTPATH @@ -229,6 +235,9 @@ /* Define to 1 if you have the <libaudit.h> header file. */ #undef HAVE_LIBAUDIT_H +/* Define to 1 if you have the libdispatch (GCD) available */ +#undef HAVE_LIBDISPATCH + /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM @@ -378,6 +387,9 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the `vasprintf' function. */ +#undef HAVE_VASPRINTF + /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF @@ -408,12 +420,13 @@ /* Enable KDrive mouse driver */ #undef KDRIVE_MOUSE -/* Prefix to use for launchd identifiers */ -#undef LAUNCHD_ID_PREFIX - /* Support os-specific local connections */ #undef LOCALCONN +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + /* Support MIT-SHM extension */ #undef MITSHM @@ -548,12 +561,13 @@ /* Support TCP socket connections */ #undef TCPCONN +/* The compiler supported TLS storage class, prefering initial-exec if + tls_model is supported */ +#undef TLS + /* Have tslib support */ #undef TSLIB -/* Enable unit tests */ -#undef UNITTESTS - /* Support UNIX socket connections */ #undef UNIXCONN @@ -614,9 +628,6 @@ /* Build X-ACE extension */ #undef XACE -/* Build XCalibrate extension */ -#undef XCALIBRATE - /* Support XCMisc extension */ #undef XCMISC diff --git a/xserver/include/eventconvert.h b/xserver/include/eventconvert.h index b1196a00e..b000abc4b 100644 --- a/xserver/include/eventconvert.h +++ b/xserver/include/eventconvert.h @@ -30,7 +30,7 @@ #define FP1616(integral, frac) ((integral) * (1 << 16) + (frac) * (1 << 16)) -_X_EXPORT int EventToCore(InternalEvent *event, xEvent *core); +_X_EXPORT int EventToCore(InternalEvent *event, xEvent **core, int *count); _X_EXPORT int EventToXI(InternalEvent *ev, xEvent **xi, int *count); _X_EXPORT int EventToXI2(InternalEvent *ev, xEvent **xi); _X_INTERNAL int GetCoreType(InternalEvent* ev); diff --git a/xserver/include/eventstr.h b/xserver/include/eventstr.h index 377cceba2..049688ca0 100644 --- a/xserver/include/eventstr.h +++ b/xserver/include/eventstr.h @@ -68,10 +68,6 @@ enum EventType { ET_Internal = 0xFF /* First byte */ }; -#define CHECKEVENT(ev) if (ev && ((InternalEvent*)(ev))->any.header != 0xFF) \ - FatalError("Wrong event type %d.\n", \ - ((InternalEvent*)(ev))->any.header); - /** * Used for ALL input device events internal in the server until * copied into the matching protocol event. @@ -177,7 +173,7 @@ struct _DGAEvent Time time; /**< Time in ms */ int subtype; /**< KeyPress, KeyRelease, ButtonPress, ButtonRelease, MotionNotify */ - int detail; /**< Relative x coordinate */ + int detail; /**< Button number or key code */ int dx; /**< Relative x coordinate */ int dy; /**< Relative y coordinate */ int screen; /**< Screen number this event applies to */ diff --git a/xserver/include/exevents.h b/xserver/include/exevents.h index 39e1c70fe..2b226986b 100644 --- a/xserver/include/exevents.h +++ b/xserver/include/exevents.h @@ -48,7 +48,8 @@ extern _X_EXPORT void InitValuatorAxisStruct( int /* maxval */, int /* resolution */, int /* min_res */, - int /* max_res */); + int /* max_res */, + int /* mode */); /* Input device properties */ extern _X_EXPORT void XIDeleteAllDeviceProperties( @@ -68,7 +69,7 @@ extern _X_EXPORT int XIChangeDeviceProperty( int /* format*/, int /* mode*/, unsigned long /* len*/, - pointer /* value*/, + const pointer /* value*/, Bool /* sendevent*/ ); @@ -146,10 +147,6 @@ typedef struct _GrabParameters { } GrabParameters; -extern void -RegisterOtherDevice ( - DeviceIntPtr /* device */); - extern int UpdateDeviceState ( DeviceIntPtr /* device */, @@ -310,6 +307,6 @@ XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client, unsigned int len, unsigned char* mask); extern int -XICheckInvalidMaskBits(unsigned char *mask, int len); +XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len); #endif /* EXEVENTS_H */ diff --git a/xserver/include/gc.h b/xserver/include/gc.h index 63eecbd66..2079cfae0 100644 --- a/xserver/include/gc.h +++ b/xserver/include/gc.h @@ -122,10 +122,6 @@ extern _X_EXPORT int FreeGC( pointer /*pGC*/, XID /*gid*/); -extern _X_EXPORT GCPtr CreateScratchGC( - ScreenPtr /*pScreen*/, - unsigned /*depth*/); - extern _X_EXPORT void FreeGCperDepth( int /*screenNum*/); diff --git a/xserver/include/gcstruct.h b/xserver/include/gcstruct.h index 3f70eada4..4fea02cb4 100644 --- a/xserver/include/gcstruct.h +++ b/xserver/include/gcstruct.h @@ -95,7 +95,6 @@ typedef struct _GCFuncs { void (* CopyClip)( GCPtr /*pgcDst*/, GCPtr /*pgcSrc*/); - DevUnion devPrivate; } GCFuncs; /* @@ -264,8 +263,6 @@ typedef struct _GCOps { int /*h*/, int /*x*/, int /*y*/); - - DevUnion devPrivate; } GCOps; /* there is padding in the bit fields because the Sun compiler doesn't @@ -306,7 +303,6 @@ typedef struct _GC { DDXPointRec patOrg; /* origin for (tile, stipple) */ struct _Font *font; DDXPointRec clipOrg; - DDXPointRec lastWinOrg; /* position of window last validated */ pointer clientClip; unsigned long stateChanges; /* masked with GC_<kind> */ unsigned long serialNumber; diff --git a/xserver/include/input.h b/xserver/include/input.h index ffb1c33fa..5377a0c13 100644 --- a/xserver/include/input.h +++ b/xserver/include/input.h @@ -62,10 +62,11 @@ SOFTWARE. #define DEVICE_OFF 2 #define DEVICE_CLOSE 3 -#define POINTER_RELATIVE (1 << 1) -#define POINTER_ABSOLUTE (1 << 2) -#define POINTER_ACCELERATE (1 << 3) -#define POINTER_SCREEN (1 << 4) /* Data in screen coordinates */ +#define POINTER_RELATIVE (1 << 1) +#define POINTER_ABSOLUTE (1 << 2) +#define POINTER_ACCELERATE (1 << 3) +#define POINTER_SCREEN (1 << 4) /* Data in screen coordinates */ +#define POINTER_NORAW (1 << 5) /* Don't generate RawEvents */ /*int constants for pointer acceleration schemes*/ #define PtrAccelNoOp 0 @@ -102,22 +103,15 @@ typedef unsigned long Leds; typedef struct _OtherClients *OtherClientsPtr; typedef struct _InputClients *InputClientsPtr; typedef struct _DeviceIntRec *DeviceIntPtr; +typedef struct _ValuatorClassRec *ValuatorClassPtr; typedef struct _ClassesRec *ClassesPtr; +typedef struct _SpriteRec *SpritePtr; typedef union _GrabMask GrabMask; -typedef struct _EventList { - xEvent* event; - int evlen; /* length of allocated memory for event in bytes. This is not - the actual length of the event. The event's actual length is - 32 for standard events or 32 + - ((xGenericEvent*)event)->length * 4 for GenericEvents. - For events in the EQ, the length is - ((InternalEvent*)event)->u.any.length */ -} EventList, *EventListPtr; +typedef struct _ValuatorMask ValuatorMask; /* The DIX stores incoming input events in this list */ -extern EventListPtr InputEventList; -extern int InputEventListLen; +extern InternalEvent* InputEventList; typedef int (*DeviceProc)( DeviceIntPtr /*device*/, @@ -140,15 +134,18 @@ typedef void (*DeviceUnwrapProc)( /* pointer acceleration handling */ typedef void (*PointerAccelSchemeProc)( - DeviceIntPtr /*pDev*/, - int /*first_valuator*/, - int /*num_valuators*/, - int* /*valuators*/, - int /*evtime*/); + DeviceIntPtr /*device*/, + ValuatorMask* /*valuators*/, + CARD32 /*evtime*/); typedef void (*DeviceCallbackProc)( DeviceIntPtr /*pDev*/); +struct _ValuatorAccelerationRec; +typedef Bool (*PointerAccelSchemeInitProc)( + DeviceIntPtr /*dev*/, + struct _ValuatorAccelerationRec* /*protoScheme*/); + typedef struct _DeviceRec { pointer devicePrivate; ProcessInputProc processInputProc; /* current */ @@ -274,12 +271,6 @@ extern _X_EXPORT int RemoveDevice( extern _X_EXPORT int NumMotionEvents(void); -extern void RegisterPointerDevice( - DeviceIntPtr /*device*/); - -extern void RegisterKeyboardDevice( - DeviceIntPtr /*device*/); - extern _X_EXPORT int dixLookupDevice( DeviceIntPtr * /* dev */, int /* id */, @@ -300,6 +291,10 @@ extern _X_EXPORT Bool InitButtonClassDeviceStruct( Atom* /* labels */, CARD8* /*map*/); +extern _X_INTERNAL ValuatorClassPtr AllocValuatorClass( + ValuatorClassPtr src, + int numAxes); + extern _X_EXPORT Bool InitValuatorClassDeviceStruct( DeviceIntPtr /*device*/, int /*numAxes*/, @@ -311,9 +306,6 @@ extern _X_EXPORT Bool InitPointerAccelerationScheme( DeviceIntPtr /*dev*/, int /*scheme*/); -extern _X_EXPORT Bool InitAbsoluteClassDeviceStruct( - DeviceIntPtr /*device*/); - extern _X_EXPORT Bool InitFocusClassDeviceStruct( DeviceIntPtr /*device*/); @@ -431,52 +423,57 @@ extern _X_EXPORT void CloseInput(void); extern _X_EXPORT int GetMaximumEventsNum(void); -extern _X_EXPORT int GetEventList(EventListPtr* list); -extern _X_EXPORT EventListPtr InitEventList(int num_events); -extern _X_EXPORT void FreeEventList(EventListPtr list, int num_events); +extern _X_EXPORT InternalEvent *InitEventList(int num_events); +extern _X_EXPORT void FreeEventList(InternalEvent *list, int num_events); -extern void CreateClassesChangedEvent(EventListPtr event, +extern void CreateClassesChangedEvent(InternalEvent *event, DeviceIntPtr master, DeviceIntPtr slave, int type); -extern EventListPtr UpdateFromMaster( - EventListPtr events, +extern InternalEvent * UpdateFromMaster( + InternalEvent *events, DeviceIntPtr pDev, int type, int *num_events); extern _X_EXPORT int GetPointerEvents( - EventListPtr events, + InternalEvent *events, DeviceIntPtr pDev, int type, int buttons, int flags, - int first_valuator, - int num_valuators, - int *valuators); + const ValuatorMask *mask); + +extern _X_EXPORT void QueuePointerEvents( + DeviceIntPtr pDev, + int type, + int buttons, + int flags, + const ValuatorMask *mask); extern _X_EXPORT int GetKeyboardEvents( - EventListPtr events, + InternalEvent *events, DeviceIntPtr pDev, int type, - int key_code); + int key_code, + const ValuatorMask *mask); -extern int GetKeyboardValuatorEvents( - EventListPtr events, +extern _X_EXPORT void QueueKeyboardEvents( DeviceIntPtr pDev, int type, int key_code, - int first_valuator, - int num_valuator, - int *valuators); + const ValuatorMask *mask); extern int GetProximityEvents( - EventListPtr events, + InternalEvent *events, + DeviceIntPtr pDev, + int type, + const ValuatorMask *mask); + +extern void QueueProximityEvents( DeviceIntPtr pDev, int type, - int first_valuator, - int num_valuators, - int *valuators); + const ValuatorMask *mask); extern void PostSyntheticMotion( DeviceIntPtr pDev, @@ -499,6 +496,8 @@ extern _X_EXPORT int GetMotionHistory( ScreenPtr pScreen, BOOL core); +extern void ReleaseButtonsAndKeys(DeviceIntPtr dev); + extern int AttachDevice(ClientPtr client, DeviceIntPtr slave, DeviceIntPtr master); @@ -535,13 +534,28 @@ extern _X_EXPORT InputAttributes *DuplicateInputAttributes(InputAttributes *attr extern _X_EXPORT void FreeInputAttributes(InputAttributes *attrs); /* misc event helpers */ +extern Mask GetEventMask(DeviceIntPtr dev, xEvent* ev, InputClientsPtr clients); extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event); extern Mask GetWindowXI2Mask(DeviceIntPtr dev, WindowPtr win, xEvent* ev); -void FixUpEventFromWindow(DeviceIntPtr pDev, +void FixUpEventFromWindow(SpritePtr pSprite, xEvent *xE, WindowPtr pWin, Window child, Bool calcChild); +extern WindowPtr XYToWindow(SpritePtr pSprite, int x, int y); +extern int EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event, + WindowPtr win); +/** + * Masks specifying the type of event to deliver for an InternalEvent; used + * by EventIsDeliverable. + * @defgroup EventIsDeliverable return flags + * @{ + */ +#define EVENT_XI1_MASK (1 << 0) /**< XI1.x event */ +#define EVENT_CORE_MASK (1 << 1) /**< Core event */ +#define EVENT_DONT_PROPAGATE_MASK (1 << 2) /**< DontPropagate mask set */ +#define EVENT_XI2_MASK (1 << 3) /**< XI2 mask set on window */ +/* @} */ /* Implemented by the DDX. */ extern _X_EXPORT int NewInputDeviceRequest( @@ -556,8 +570,29 @@ extern _X_EXPORT void DDXRingBell( int pitch, int duration); +#define VALUATOR_MODE_ALL_AXES -1 +extern _X_HIDDEN int valuator_get_mode(DeviceIntPtr dev, int axis); +extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, int axis, int mode); + /* Set to TRUE by default - os/utils.c sets it to FALSE on user request, xfixes/cursor.c uses it to determine if the cursor is enabled */ extern Bool EnableCursor; +extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators); +extern _X_EXPORT void valuator_mask_free(ValuatorMask **mask); +extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask, + int first_valuator, int num_valuators, + const int* valuators); +extern _X_EXPORT void valuator_mask_set(ValuatorMask *mask, + int valuator, + int data); +extern _X_EXPORT void valuator_mask_zero(ValuatorMask *mask); +extern _X_EXPORT int valuator_mask_size(const ValuatorMask *mask); +extern _X_EXPORT int valuator_mask_isset(const ValuatorMask *mask, int bit); +extern _X_EXPORT void valuator_mask_unset(ValuatorMask *mask, int bit); +extern _X_EXPORT int valuator_mask_num_valuators(const ValuatorMask *mask); +extern _X_EXPORT void valuator_mask_copy(ValuatorMask *dest, + const ValuatorMask *src); +extern _X_EXPORT int valuator_mask_get(const ValuatorMask *mask, int valnum); + #endif /* INPUT_H */ diff --git a/xserver/include/inputstr.h b/xserver/include/inputstr.h index df6721093..00f72c260 100644 --- a/xserver/include/inputstr.h +++ b/xserver/include/inputstr.h @@ -60,6 +60,7 @@ SOFTWARE. #define BitIsOn(ptr, bit) (!!(((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))) #define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7))) #define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7))) +extern _X_EXPORT int CountBits(const uint8_t *mask, int len); #define SameClient(obj,client) \ (CLIENT_BITS((obj)->resource) == (client)->clientAsMask) @@ -202,6 +203,47 @@ typedef struct _GrabRec { unsigned char xi2mask[EMASKSIZE][XI2MASKSIZE]; } GrabRec; +/** + * Sprite information for a device. + */ +typedef struct _SpriteRec { + CursorPtr current; + BoxRec hotLimits; /* logical constraints of hot spot */ + Bool confined; /* confined to screen */ + RegionPtr hotShape; /* additional logical shape constraint */ + BoxRec physLimits; /* physical constraints of hot spot */ + WindowPtr win; /* window of logical position */ + HotSpot hot; /* logical pointer position */ + HotSpot hotPhys; /* physical pointer position */ +#ifdef PANORAMIX + ScreenPtr screen; /* all others are in Screen 0 coordinates */ + RegionRec Reg1; /* Region 1 for confining motion */ + RegionRec Reg2; /* Region 2 for confining virtual motion */ + WindowPtr windows[MAXSCREENS]; + WindowPtr confineWin; /* confine window */ +#endif + /* The window trace information is used at dix/events.c to avoid having + * to compute all the windows between the root and the current pointer + * window each time a button or key goes down. The grabs on each of those + * windows must be checked. + * spriteTraces should only be used at dix/events.c! */ + WindowPtr *spriteTrace; + int spriteTraceSize; + int spriteTraceGood; + + /* Due to delays between event generation and event processing, it is + * possible that the pointer has crossed screen boundaries between the + * time in which it begins generating events and the time when + * those events are processed. + * + * pEnqueueScreen: screen the pointer was on when the event was generated + * pDequeueScreen: screen the pointer was on when the event is processed + */ + ScreenPtr pEnqueueScreen; + ScreenPtr pDequeueScreen; + +} SpriteRec; + typedef struct _KeyClassRec { int sourceid; CARD8 down[DOWN_LENGTH]; @@ -217,12 +259,14 @@ typedef struct _AxisInfo { int min_value; int max_value; Atom label; + CARD8 mode; } AxisInfo, *AxisInfoPtr; typedef struct _ValuatorAccelerationRec { int number; PointerAccelSchemeProc AccelSchemeProc; void *accelData; /* at disposal of AccelScheme */ + PointerAccelSchemeInitProc AccelInitProc; DeviceCallbackProc AccelCleanupProc; } ValuatorAccelerationRec, *ValuatorAccelerationPtr; @@ -238,9 +282,8 @@ typedef struct _ValuatorClassRec { AxisInfoPtr axes; unsigned short numAxes; double *axisVal; /* always absolute, but device-coord system */ - CARD8 mode; ValuatorAccelerationRec accelScheme; -} ValuatorClassRec, *ValuatorClassPtr; +} ValuatorClassRec; typedef struct _ButtonClassRec { int sourceid; @@ -271,30 +314,9 @@ typedef struct _FocusClassRec { typedef struct _ProximityClassRec { int sourceid; - char pad; + char in_proximity; } ProximityClassRec, *ProximityClassPtr; -typedef struct _AbsoluteClassRec { - int sourceid; - /* Calibration. */ - int min_x; - int max_x; - int min_y; - int max_y; - int flip_x; - int flip_y; - int rotation; - int button_threshold; - - /* Area. */ - int offset_x; - int offset_y; - int width; - int height; - int screen; - XID following; -} AbsoluteClassRec, *AbsoluteClassPtr; - typedef struct _KbdFeedbackClassRec *KbdFeedbackPtr; typedef struct _PtrFeedbackClassRec *PtrFeedbackPtr; typedef struct _IntegerFeedbackClassRec *IntegerFeedbackPtr; @@ -349,7 +371,6 @@ typedef struct _ClassesRec { ButtonClassPtr button; FocusClassPtr focus; ProximityClassPtr proximity; - AbsoluteClassPtr absolute; KbdFeedbackPtr kbdfeed; PtrFeedbackPtr ptrfeed; IntegerFeedbackPtr intfeed; @@ -359,47 +380,6 @@ typedef struct _ClassesRec { } ClassesRec; -/** - * Sprite information for a device. - */ -typedef struct { - CursorPtr current; - BoxRec hotLimits; /* logical constraints of hot spot */ - Bool confined; /* confined to screen */ - RegionPtr hotShape; /* additional logical shape constraint */ - BoxRec physLimits; /* physical constraints of hot spot */ - WindowPtr win; /* window of logical position */ - HotSpot hot; /* logical pointer position */ - HotSpot hotPhys; /* physical pointer position */ -#ifdef PANORAMIX - ScreenPtr screen; /* all others are in Screen 0 coordinates */ - RegionRec Reg1; /* Region 1 for confining motion */ - RegionRec Reg2; /* Region 2 for confining virtual motion */ - WindowPtr windows[MAXSCREENS]; - WindowPtr confineWin; /* confine window */ -#endif - /* The window trace information is used at dix/events.c to avoid having - * to compute all the windows between the root and the current pointer - * window each time a button or key goes down. The grabs on each of those - * windows must be checked. - * spriteTraces should only be used at dix/events.c! */ - WindowPtr *spriteTrace; - int spriteTraceSize; - int spriteTraceGood; - - /* Due to delays between event generation and event processing, it is - * possible that the pointer has crossed screen boundaries between the - * time in which it begins generating events and the time when - * those events are processed. - * - * pEnqueueScreen: screen the pointer was on when the event was generated - * pDequeueScreen: screen the pointer was on when the event is processed - */ - ScreenPtr pEnqueueScreen; - ScreenPtr pDequeueScreen; - -} SpriteRec, *SpritePtr; - /* Device properties */ typedef struct _XIPropertyValue { @@ -492,6 +472,7 @@ typedef struct _SpriteInfoRec { #define MASTER_POINTER 1 #define MASTER_KEYBOARD 2 #define SLAVE 3 +#define MASTER_ATTACHED 4 /* special type for GetMaster */ typedef struct _DeviceIntRec { DeviceRec public; @@ -514,7 +495,6 @@ typedef struct _DeviceIntRec { ButtonClassPtr button; FocusClassPtr focus; ProximityClassPtr proximity; - AbsoluteClassPtr absolute; KbdFeedbackPtr kbdfeed; PtrFeedbackPtr ptrfeed; IntegerFeedbackPtr intfeed; @@ -528,10 +508,8 @@ typedef struct _DeviceIntRec { PrivateRec *devPrivates; DeviceUnwrapProc unwrapProc; SpriteInfoPtr spriteInfo; - union { - DeviceIntPtr master; /* master device */ - DeviceIntPtr lastSlave; /* last slave device used */ - } u; + DeviceIntPtr master; /* master device */ + DeviceIntPtr lastSlave; /* last slave device used */ /* last valuator values recorded, not posted to client; * for slave devices, valuators is in device coordinates @@ -611,4 +589,14 @@ typedef struct _EventSyncInfo { extern EventSyncInfoRec syncEvents; +/** + * Given a sprite, returns the window at the bottom of the trace (i.e. the + * furthest window from the root). + */ +static inline WindowPtr DeepestSpriteWin(SpritePtr sprite) +{ + assert(sprite->spriteTraceGood > 0); + return sprite->spriteTrace[sprite->spriteTraceGood - 1]; +} + #endif /* INPUTSTRUCT_H */ diff --git a/xserver/include/inpututils.h b/xserver/include/inpututils.h new file mode 100644 index 000000000..92a754327 --- /dev/null +++ b/xserver/include/inpututils.h @@ -0,0 +1,42 @@ +/* + * Copyright © 2010 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. + * + */ + +#ifdef HAVE_DIX_CONFIG_H +#include "dix-config.h" +#endif + +#ifndef INPUTUTILS_H +#define INPUTUTILS_H + +#include "input.h" + +struct _ValuatorMask { + int8_t last_bit; /* highest bit set in mask */ + uint8_t mask[(MAX_VALUATORS + 7)/8]; + int valuators[MAX_VALUATORS]; /* valuator data */ +}; + +extern void verify_internal_event(const InternalEvent *ev); + +#endif diff --git a/xserver/include/list.h b/xserver/include/list.h index 4ce20a866..5933b973d 100644 --- a/xserver/include/list.h +++ b/xserver/include/list.h @@ -26,11 +26,102 @@ #ifndef _LIST_H_ #define _LIST_H_ -/* classic doubly-link circular list */ +/** + * @file Classic doubly-link circular list implementation. + * + * Example: + * We need to keep a list of struct foo in the parent struct bar, i.e. what + * we want is something like this. + * + * struct bar { + * ... + * struct foo *foos; -----> struct foo {}, struct foo {}, struct foo{} + * ... + * } + * + * We need one list head in bar and a list element in all foos (both are of + * data type 'struct list'). + * + * struct bar { + * ... + * struct list foos; + * ... + * } + * + * struct foo { + * ... + * struct list entry; + * ... + * } + * + * Now we initialize the list head: + * + * struct bar bar; + * ... + * list_init(&bar.foos); + * + * Then we create the first element and add it to this list: + * + * struct foo *foo = malloc(...); + * .... + * list_add(&foo->entry, &bar.foos); + * + * Repeat the above for each element you want to add to the list. Deleting + * works with the element itself. + * list_del(&foo->entry); + * free(foo); + * + * Note: calling list_del(&bar.foos) will set bar.foos to an empty + * list again. + * + * Looping through the list requires a 'struct foo' as iterator and the + * name of the field the subnodes use. + * + * struct foo *iterator; + * list_for_each_entry(iterator, &bar.foos, entry) { + * if (iterator->something == ...) + * ... + * } + * + * Note: You must not call list_del() on the iterator if you continue the + * loop. You need to run the safe for-each loop instead: + * + * struct foo *iterator, *next; + * list_for_each_entry_safe(iterator, next, &bar.foos, entry) { + * if (...) + * list_del(&iterator->entry); + * } + * + */ + +/** + * The linkage struct for list nodes. This struct must be part of your + * to-be-linked struct. + * + * Example: + * struct foo { + * int a; + * void *b; + * struct list *mylist; + * } + * + * Position and name of the struct list field is irrelevant. + * There are no requirements that elements of a list are of the same type. + * There are no requirements for a list head, any struct list can be a list + * head. + */ struct list { struct list *next, *prev; }; +/** + * Initialize the list as an empty list. + * + * Example: + * list_init(&foo->mylist); + * + * @param The list to initialized. + */ static void list_init(struct list *list) { @@ -48,6 +139,20 @@ __list_add(struct list *entry, prev->next = entry; } +/** + * Insert a new element after the given list head. + * The list changes from: + * head → some element → ... + * to + * head → new element → older element → ... + * + * Example: + * struct foo *newfoo = malloc(...); + * list_add(&newfoo->mylist, &foo->mylist); + * + * @param entry The new element to prepend to the list. + * @param head The existing list. + */ static inline void list_add(struct list *entry, struct list *head) { @@ -61,6 +166,20 @@ __list_del(struct list *prev, struct list *next) prev->next = next; } +/** + * Remove the element from the list it is in. Using this function will reset + * the pointers to/from this element so it is removed from the list. It does + * NOT free the element itself or manipulate it otherwise. + * + * Using list_del on a pure list head (like in the example at the top of + * this file) will NOT remove the first element from + * the list but rather reset the list as empty list. + * + * Example: + * list_del(&newfoo->mylist); + * + * @param entry The element to remove. + */ static inline void list_del(struct list *entry) { @@ -68,32 +187,91 @@ list_del(struct list *entry) list_init(entry); } +/** + * Check if the list is empty. + * + * Example: + * list_is_empty(&foo->mylist); + * + * @return True if the list contains one or more elements or False otherwise. + */ static inline Bool list_is_empty(struct list *head) { return head->next == head; } +/** + * Returns a pointer to the container of this list element. + * + * Example: + * struct foo* f; + * f = container_of(&foo->mylist, struct foo, mylist); + * assert(f == foo); + * + * @param ptr Pointer to the struct list. + * @param type Data type of the list element. + * @param member Member name of the struct list field in the list element. + * @return A pointer to the data struct containing the list head. + */ #ifndef container_of #define container_of(ptr, type, member) \ (type *)((char *)(ptr) - (char *) &((type *)0)->member) #endif +/** + * Alias of container_of + */ #define list_entry(ptr, type, member) \ container_of(ptr, type, member) +/** + * Retrieve the first list entry for the given list pointer. + * + * Example: + * struct foo *first; + * first = list_first_entry(&foo->mylist, struct foo, mylist); + * + * @param ptr The list head + * @param type Data type of the list element to retrieve + * @param member Member name of the struct list field in the list element. + * @return A pointer to the first list element. + */ #define list_first_entry(ptr, type, member) \ list_entry((ptr)->next, type, member) #define __container_of(ptr, sample, member) \ (void *)((char *)(ptr) \ - ((char *)&(sample)->member - (char *)(sample))) - +/** + * Loop through the list given by head and set pos to struct in the list. + * + * Example: + * struct foo *iterator; + * list_for_each_entry(iterator, &foo->mylist, mylist) { + * [modify iterator] + * } + * + * This macro is not safe for node deletion. Use list_for_each_entry_safe + * instead. + * + * @param pos Iterator variable of the type of the list elements. + * @param head List head + * @param member Member name of the struct list in the list elements. + * + */ #define list_for_each_entry(pos, head, member) \ for (pos = __container_of((head)->next, pos, member); \ &pos->member != (head); \ pos = __container_of(pos->member.next, pos, member)) +/** + * Loop through the list, keeping a backup pointer to the element. This + * macro allows for the deletion of a list element while looping through the + * list. + * + * See list_for_each_entry for more details. + */ #define list_for_each_entry_safe(pos, tmp, head, member) \ for (pos = __container_of((head)->next, pos, member), \ tmp = __container_of(pos->member.next, pos, member); \ diff --git a/xserver/include/misc.h b/xserver/include/misc.h index 62d813e0c..bdcc8cc1e 100644 --- a/xserver/include/misc.h +++ b/xserver/include/misc.h @@ -79,6 +79,7 @@ OF THIS SOFTWARE. #include <X11/Xdefs.h> #include <stddef.h> +#include <stdint.h> #ifndef MAXSCREENS #define MAXSCREENS 16 @@ -91,9 +92,7 @@ OF THIS SOFTWARE. #define EXTENSION_EVENT_BASE 64 #define EXTENSION_BASE 128 -typedef unsigned long PIXEL; -typedef unsigned long ATOM; - +typedef uint32_t ATOM; #ifndef TRUE #define TRUE 1 @@ -180,6 +179,17 @@ typedef struct _xReq *xReqPtr; #endif +#ifndef PATH_MAX +#include <sys/param.h> +#ifndef PATH_MAX +#ifdef MAXPATHLEN +#define PATH_MAX MAXPATHLEN +#else +#define PATH_MAX 1024 +#endif +#endif +#endif + /** * Calculate the number of bytes needed to hold bits. * @param bits The minimum number of bits needed. @@ -213,6 +223,24 @@ pad_to_int32(const int bytes) { extern char** xstrtokenize(const char *str, const char* separators); +/** + * Compare the two version numbers comprising of major.minor. + * + * @return A value less than 0 if a is less than b, 0 if a is equal to b, + * or a value greater than 0 + */ +static inline int +version_compare(uint16_t a_major, uint16_t a_minor, + uint16_t b_major, uint16_t b_minor) +{ + int a, b; + + a = a_major << 16 | a_minor; + b = b_major << 16 | b_minor; + + return (a - b); +} + /* some macros to help swap requests, replies, and events */ #define LengthRestB(stuff) \ diff --git a/xserver/include/opaque.h b/xserver/include/opaque.h index b3c7c70d6..5c707172c 100644 --- a/xserver/include/opaque.h +++ b/xserver/include/opaque.h @@ -55,9 +55,7 @@ extern _X_EXPORT int defaultBackingStore; extern _X_EXPORT Bool disableBackingStore; extern _X_EXPORT Bool enableBackingStore; extern _X_EXPORT Bool PartialNetwork; -#ifndef NOLOGOHACK -extern _X_EXPORT int logoScreenSaver; -#endif +extern _X_EXPORT Bool RunFromSigStopParent; #ifdef RLIMIT_DATA extern _X_EXPORT int limitDataSpace; #endif @@ -71,6 +69,7 @@ extern _X_EXPORT Bool defeatAccessControl; extern _X_EXPORT long maxBigRequestSize; extern _X_EXPORT Bool party_like_its_1989; extern _X_EXPORT Bool whiteRoot; +extern _X_EXPORT Bool bgNoneRoot; extern _X_EXPORT Bool CoreDump; diff --git a/xserver/include/os.h b/xserver/include/os.h index 8c59a4bf6..9327dc4cf 100644 --- a/xserver/include/os.h +++ b/xserver/include/os.h @@ -51,6 +51,7 @@ SOFTWARE. #include "misc.h" #include <stdarg.h> +#include <string.h> #define SCREEN_SAVER_ON 0 #define SCREEN_SAVER_OFF 1 @@ -263,10 +264,14 @@ extern _X_EXPORT char *Xstrdup(const char *s); */ extern _X_EXPORT char *XNFstrdup(const char *s); -extern _X_EXPORT char *Xprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2); -extern _X_EXPORT char *Xvprintf(const char *fmt, va_list va); -extern _X_EXPORT char *XNFprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2); -extern _X_EXPORT char *XNFvprintf(const char *fmt, va_list va); +/* Include new X*asprintf API */ +#include "Xprintf.h" + +/* Older api deprecated in favor of the asprintf versions */ +extern _X_EXPORT char *Xprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2) _X_DEPRECATED; +extern _X_EXPORT char *Xvprintf(const char *fmt, va_list va)_X_ATTRIBUTE_PRINTF(1,0) _X_DEPRECATED; +extern _X_EXPORT char *XNFprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2) _X_DEPRECATED; +extern _X_EXPORT char *XNFvprintf(const char *fmt, va_list va)_X_ATTRIBUTE_PRINTF(1,0) _X_DEPRECATED; typedef void (*OsSigHandlerPtr)(int /* sig */); typedef int (*OsSigWrapperPtr)(int /* sig */); @@ -445,29 +450,6 @@ extern _X_EXPORT int ddxProcessArgument(int /*argc*/, char * /*argv*/ [], int /* extern _X_EXPORT void ddxUseMsg(void); -/* int ReqLen(xReq *req, ClientPtr client) - * Given a pointer to a *complete* request, return its length in bytes. - * Note that if the request is a big request (as defined in the Big - * Requests extension), the macro lies by returning 4 less than the - * length that it actually occupies in the request buffer. This is so you - * can blindly compare the length with the various sz_<request> constants - * in Xproto.h without having to know/care about big requests. - */ -#define ReqLen(_pxReq, _client) \ - ((_pxReq->length ? \ - (_client->swapped ? lswaps(_pxReq->length) : _pxReq->length) \ - : ((_client->swapped ? \ - lswapl(((CARD32*)_pxReq)[1]) : ((CARD32*)_pxReq)[1])-1) \ - ) << 2) - -/* otherReqTypePtr CastxReq(xReq *req, otherReqTypePtr) - * Cast the given request to one of type otherReqTypePtr to access - * fields beyond the length field. - */ -#define CastxReq(_pxReq, otherReqTypePtr) \ - (_pxReq->length ? (otherReqTypePtr)_pxReq \ - : (otherReqTypePtr)(((CARD32*)_pxReq)+1)) - /* stuff for ReplyCallback */ extern _X_EXPORT CallbackListPtr ReplyCallback; typedef struct { @@ -481,8 +463,15 @@ typedef struct { /* stuff for FlushCallback */ extern _X_EXPORT CallbackListPtr FlushCallback; -extern _X_EXPORT void AbortDDX(void); -extern _X_EXPORT void ddxGiveUp(void); +enum ExitCode { + EXIT_NO_ERROR = 0, + EXIT_ERR_ABORT = 1, + EXIT_ERR_CONFIGURE = 2, + EXIT_ERR_DRIVERS = 3, +}; + +extern _X_EXPORT void AbortDDX(enum ExitCode error); +extern _X_EXPORT void ddxGiveUp(enum ExitCode error); extern _X_EXPORT int TimeSinceLastInputEvent(void); /* strcasecmp.c */ @@ -530,19 +519,19 @@ typedef enum { } MessageType; extern _X_EXPORT const char *LogInit(const char *fname, const char *backup); -extern _X_EXPORT void LogClose(void); +extern _X_EXPORT void LogClose(enum ExitCode error); extern _X_EXPORT Bool LogSetParameter(LogParameter param, int value); -extern _X_EXPORT void LogVWrite(int verb, const char *f, va_list args); +extern _X_EXPORT void LogVWrite(int verb, const char *f, va_list args) _X_ATTRIBUTE_PRINTF(2,0); extern _X_EXPORT void LogWrite(int verb, const char *f, ...) _X_ATTRIBUTE_PRINTF(2,3); extern _X_EXPORT void LogVMessageVerb(MessageType type, int verb, const char *format, - va_list args); + va_list args) _X_ATTRIBUTE_PRINTF(3,0); extern _X_EXPORT void LogMessageVerb(MessageType type, int verb, const char *format, ...) _X_ATTRIBUTE_PRINTF(3,4); extern _X_EXPORT void LogMessage(MessageType type, const char *format, ...) _X_ATTRIBUTE_PRINTF(2,3); extern _X_EXPORT void FreeAuditTimer(void); extern _X_EXPORT void AuditF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2); -extern _X_EXPORT void VAuditF(const char *f, va_list args); +extern _X_EXPORT void VAuditF(const char *f, va_list args) _X_ATTRIBUTE_PRINTF(1,0); extern _X_EXPORT void FatalError(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2) _X_NORETURN; #ifdef DEBUG @@ -551,9 +540,9 @@ extern _X_EXPORT void FatalError(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2) _X #define DebugF(...) /* */ #endif -extern _X_EXPORT void VErrorF(const char *f, va_list args); +extern _X_EXPORT void VErrorF(const char *f, va_list args) _X_ATTRIBUTE_PRINTF(1,0); extern _X_EXPORT void ErrorF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2); -extern _X_EXPORT void Error(char *str); +extern _X_EXPORT void Error(const char *str); extern _X_EXPORT void LogPrintMarkers(void); extern _X_EXPORT void xorg_backtrace(void); diff --git a/xserver/include/pixmap.h b/xserver/include/pixmap.h index 5cf42d1fb..014a11183 100644 --- a/xserver/include/pixmap.h +++ b/xserver/include/pixmap.h @@ -55,16 +55,14 @@ SOFTWARE. #define DRAWABLE_WINDOW 0 #define DRAWABLE_PIXMAP 1 #define UNDRAWABLE_WINDOW 2 -#define DRAWABLE_BUFFER 3 /* corresponding type masks for dixLookupDrawable() */ #define M_DRAWABLE_WINDOW (1<<0) #define M_DRAWABLE_PIXMAP (1<<1) #define M_UNDRAWABLE_WINDOW (1<<2) -#define M_DRAWABLE_BUFFER (1<<3) #define M_ANY (-1) #define M_WINDOW (M_DRAWABLE_WINDOW|M_UNDRAWABLE_WINDOW) -#define M_DRAWABLE (M_DRAWABLE_WINDOW|M_DRAWABLE_PIXMAP|M_DRAWABLE_BUFFER) +#define M_DRAWABLE (M_DRAWABLE_WINDOW|M_DRAWABLE_PIXMAP) #define M_UNDRAWABLE (M_UNDRAWABLE_WINDOW) /* flags to PaintWindow() */ @@ -88,7 +86,7 @@ typedef union _PixUnion { ((as) == (bs) && (SamePixUnion (a, b, as))) #define OnScreenDrawable(type) \ - ((type == DRAWABLE_WINDOW) || (type == DRAWABLE_BUFFER)) + (type == DRAWABLE_WINDOW) #define WindowDrawable(type) \ ((type == DRAWABLE_WINDOW) || (type == UNDRAWABLE_WINDOW)) diff --git a/xserver/include/privates.h b/xserver/include/privates.h index d3c0e1325..2b0040cba 100644 --- a/xserver/include/privates.h +++ b/xserver/include/privates.h @@ -51,6 +51,7 @@ typedef enum { PRIVATE_GLYPH, PRIVATE_GLYPHSET, PRIVATE_PICTURE, + PRIVATE_SYNC_FENCE, /* last private type */ PRIVATE_LAST, @@ -65,6 +66,10 @@ typedef struct _DevPrivateKeyRec { struct _DevPrivateKeyRec *next; } DevPrivateKeyRec, *DevPrivateKey; +typedef struct _DevScreenPrivateKeyRec { + DevPrivateKeyRec screenKey; +} DevScreenPrivateKeyRec, *DevScreenPrivateKey; + /* * Let drivers know how to initialize private keys */ @@ -100,17 +105,6 @@ dixPrivateKeyRegistered(DevPrivateKey key) } /* - * Allocate a new private key. - * - * This manages the storage of the key object itself, freeing it when the - * privates system is restarted at server reset time. All other keys - * are expected to be statically allocated as the privates must be - * reset after all objects have been freed - */ -extern _X_EXPORT DevPrivateKey -dixCreatePrivateKey(DevPrivateType type, unsigned size); - -/* * Get the address of the private storage. * * For keys with pre-defined storage, this gets the base of that storage @@ -180,6 +174,42 @@ dixLookupPrivateAddr(PrivatePtr *privates, const DevPrivateKey key) return (pointer *)dixGetPrivateAddr(privates, key); } +extern _X_EXPORT Bool +dixRegisterScreenPrivateKey(DevScreenPrivateKey key, ScreenPtr pScreen, DevPrivateType type, unsigned size); + +extern _X_EXPORT DevPrivateKey +_dixGetScreenPrivateKey(const DevScreenPrivateKey key, ScreenPtr pScreen); + +static inline void * +dixGetScreenPrivateAddr(PrivatePtr *privates, const DevScreenPrivateKey key, ScreenPtr pScreen) +{ + return dixGetPrivateAddr(privates, _dixGetScreenPrivateKey(key, pScreen)); +} + +static inline void * +dixGetScreenPrivate(PrivatePtr *privates, const DevScreenPrivateKey key, ScreenPtr pScreen) +{ + return dixGetPrivate(privates, _dixGetScreenPrivateKey(key, pScreen)); +} + +static inline void +dixSetScreenPrivate(PrivatePtr *privates, const DevScreenPrivateKey key, ScreenPtr pScreen, pointer val) +{ + dixSetPrivate(privates, _dixGetScreenPrivateKey(key, pScreen), val); +} + +static inline pointer +dixLookupScreenPrivate(PrivatePtr *privates, const DevScreenPrivateKey key, ScreenPtr pScreen) +{ + return dixLookupPrivate(privates, _dixGetScreenPrivateKey(key, pScreen)); +} + +static inline pointer * +dixLookupScreenPrivateAddr(PrivatePtr *privates, const DevScreenPrivateKey key, ScreenPtr pScreen) +{ + return dixLookupPrivateAddr(privates, _dixGetScreenPrivateKey(key, pScreen)); +} + /* * Allocates private data separately from main object. * diff --git a/xserver/include/propertyst.h b/xserver/include/propertyst.h index fd1148eb7..1edd11d5d 100644 --- a/xserver/include/propertyst.h +++ b/xserver/include/propertyst.h @@ -58,8 +58,8 @@ typedef struct _Property { struct _Property *next; ATOM propertyName; ATOM type; /* ignored by server */ - short format; /* format of data for swapping - 8,16,32 */ - long size; /* size of data in (format/8) bytes */ + uint32_t format; /* format of data for swapping - 8,16,32 */ + uint32_t size; /* size of data in (format/8) bytes */ pointer data; /* private to client */ PrivateRec *devPrivates; } PropertyRec; diff --git a/xserver/include/protocol-versions.h b/xserver/include/protocol-versions.h index ce2879741..7b7a9f53c 100644 --- a/xserver/include/protocol-versions.h +++ b/xserver/include/protocol-versions.h @@ -97,17 +97,13 @@ /* Sync */ #define SERVER_SYNC_MAJOR_VERSION 3 -#define SERVER_SYNC_MINOR_VERSION 0 +#define SERVER_SYNC_MINOR_VERSION 1 /* Windows WM */ #define SERVER_WINDOWSWM_MAJOR_VERSION 1 #define SERVER_WINDOWSWM_MINOR_VERSION 0 #define SERVER_WINDOWSWM_PATCH_VERSION 0 -/* Xcalibrate */ -#define SERVER_XCALIBRATE_MAJOR_VERSION 0 -#define SERVER_XCALIBRATE_MINOR_VERSION 1 - /* DGA */ #define SERVER_XDGA_MAJOR_VERSION 2 #define SERVER_XDGA_MINOR_VERSION 0 @@ -126,7 +122,7 @@ #define SERVER_XF86VIDMODE_MINOR_VERSION 2 /* Fixes */ -#define SERVER_XFIXES_MAJOR_VERSION 4 +#define SERVER_XFIXES_MAJOR_VERSION 5 #define SERVER_XFIXES_MINOR_VERSION 0 /* X Input */ diff --git a/xserver/include/ptrveloc.h b/xserver/include/ptrveloc.h index 6f999a88f..6ca309c8c 100644 --- a/xserver/include/ptrveloc.h +++ b/xserver/include/ptrveloc.h @@ -1,6 +1,6 @@ /* * - * Copyright © 2006-2009 Simon Thum simon dot thum at gmx dot de + * Copyright © 2006-2011 Simon Thum simon dot thum at gmx dot de * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -25,7 +25,7 @@ #ifndef POINTERVELOCITY_H #define POINTERVELOCITY_H -#include <input.h> /* DeviceIntPtr */ +#include <input.h> /* constants for acceleration profiles */ @@ -62,9 +62,6 @@ typedef struct _MotionTracker { int dir; /* initial direction bitfield */ } MotionTracker, *MotionTrackerPtr; -/* number of properties for predictable acceleration */ -#define NPROPS_PREDICTABLE_ACCEL 4 - /** * Contains all data needed to implement mouse ballistics */ @@ -91,16 +88,25 @@ typedef struct _DeviceVelocityRec { struct { /* to be able to query this information */ int profile_number; } statistics; - long prop_handlers[NPROPS_PREDICTABLE_ACCEL]; } DeviceVelocityRec, *DeviceVelocityPtr; +/** + * contains the run-time data for the predictable scheme, that is, a + * DeviceVelocityPtr and the property handlers. + */ +typedef struct _PredictableAccelSchemeRec { + DeviceVelocityPtr vel; + long* prop_handlers; + int num_prop_handlers; +} PredictableAccelSchemeRec, *PredictableAccelSchemePtr; + extern _X_EXPORT void InitVelocityData(DeviceVelocityPtr vel); extern _X_EXPORT void InitTrackers(DeviceVelocityPtr vel, int ntracker); -extern _X_EXPORT short +extern _X_EXPORT BOOL ProcessVelocityData2D(DeviceVelocityPtr vel, int dx, int dy, int time); extern _X_EXPORT float @@ -110,12 +116,6 @@ BasicComputeAcceleration(DeviceIntPtr dev, DeviceVelocityPtr vel, extern _X_EXPORT void FreeVelocityData(DeviceVelocityPtr vel); -extern _X_INTERNAL BOOL -InitializePredictableAccelerationProperties(DeviceIntPtr dev); - -extern _X_INTERNAL BOOL -DeletePredictableAccelerationProperties(DeviceIntPtr dev); - extern _X_EXPORT int SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num); @@ -129,12 +129,16 @@ SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr vel, extern _X_INTERNAL void AccelerationDefaultCleanup(DeviceIntPtr dev); +extern _X_INTERNAL Bool +InitPredictableAccelerationScheme(DeviceIntPtr dev, + struct _ValuatorAccelerationRec* protoScheme); + extern _X_INTERNAL void -acceleratePointerPredictable(DeviceIntPtr dev, int first_valuator, - int num_valuators, int *valuators, int evtime); +acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask* val, + CARD32 evtime); extern _X_INTERNAL void -acceleratePointerLightweight(DeviceIntPtr dev, int first_valuator, - int num_valuators, int *valuators, int ignored); +acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask* val, + CARD32 evtime); #endif /* POINTERVELOCITY_H */ diff --git a/xserver/include/regionstr.h b/xserver/include/regionstr.h index 627941b36..3dfef5c83 100644 --- a/xserver/include/regionstr.h +++ b/xserver/include/regionstr.h @@ -132,6 +132,11 @@ static inline void RegionInit(RegionPtr _pReg, BoxPtr _rect, int _size) } } +static inline Bool RegionInitBoxes(RegionPtr pReg, BoxPtr boxes, int nBoxes) +{ + return pixman_region_init_rects (pReg, boxes, nBoxes); +} + static inline void RegionUninit(RegionPtr _pReg) { if ((_pReg)->data && (_pReg)->data->size) { @@ -318,16 +323,6 @@ extern _X_EXPORT Bool RegionIsValid( extern _X_EXPORT void RegionPrint( RegionPtr /*pReg*/); -extern _X_EXPORT int RegionClipSpans( - RegionPtr /*prgnDst*/, - DDXPointPtr /*ppt*/, - int * /*pwidth*/, - int /*nspans*/, - DDXPointPtr /*pptNew*/, - int * /*pwidthNew*/, - int /*fSorted*/ -); - #define INCLUDE_LEGACY_REGION_DEFINES #ifdef INCLUDE_LEGACY_REGION_DEFINES diff --git a/xserver/include/resource.h b/xserver/include/resource.h index 0c5a59dbc..772b7b877 100644 --- a/xserver/include/resource.h +++ b/xserver/include/resource.h @@ -56,7 +56,7 @@ SOFTWARE. /* classes for Resource routines */ -typedef unsigned long RESTYPE; +typedef uint32_t RESTYPE; #define RC_VANILLA ((RESTYPE)0) #define RC_CACHED ((RESTYPE)1<<31) @@ -121,6 +121,8 @@ typedef unsigned long RESTYPE; #define BAD_RESOURCE 0xe0000000 +#define rClient(obj) (clients[CLIENT_ID((obj)->resource)]) + /* Resource state callback */ extern _X_EXPORT CallbackListPtr ResourceStateCallback; @@ -249,34 +251,5 @@ extern _X_EXPORT unsigned int GetXIDList( extern _X_EXPORT RESTYPE lastResourceType; extern _X_EXPORT RESTYPE TypeMask; -/* - * These are deprecated compatibility functions and will be removed soon! - * Please use the noted replacements instead. - */ - -/* replaced by dixLookupResourceByType */ -extern _X_EXPORT pointer SecurityLookupIDByType( - ClientPtr client, - XID id, - RESTYPE rtype, - Mask access_mode) _X_DEPRECATED; - -/* replaced by dixLookupResourceByClass */ -extern _X_EXPORT pointer SecurityLookupIDByClass( - ClientPtr client, - XID id, - RESTYPE classes, - Mask access_mode) _X_DEPRECATED; - -/* replaced by dixLookupResourceByType */ -extern _X_EXPORT pointer LookupIDByType( - XID id, - RESTYPE rtype) _X_DEPRECATED; - -/* replaced by dixLookupResourceByClass */ -extern _X_EXPORT pointer LookupIDByClass( - XID id, - RESTYPE classes) _X_DEPRECATED; - #endif /* RESOURCE_H */ diff --git a/xserver/include/scrnintstr.h b/xserver/include/scrnintstr.h index e36b15f5e..a9357e8a5 100644 --- a/xserver/include/scrnintstr.h +++ b/xserver/include/scrnintstr.h @@ -50,7 +50,6 @@ SOFTWARE. #include "screenint.h" #include "regionstr.h" -#include "bstore.h" #include "colormap.h" #include "cursor.h" #include "validate.h" @@ -136,7 +135,8 @@ typedef void (* SourceValidateProcPtr)( int /*x*/, int /*y*/, int /*width*/, - int /*height*/); + int /*height*/, + unsigned int /*subWindowMode*/); typedef Bool (* CreateWindowProcPtr)( WindowPtr /*pWindow*/); @@ -213,48 +213,6 @@ typedef PixmapPtr (* CreatePixmapProcPtr)( typedef Bool (* DestroyPixmapProcPtr)( PixmapPtr /*pPixmap*/); -typedef void (* SaveDoomedAreasProcPtr)( - WindowPtr /*pWindow*/, - RegionPtr /*prgnSave*/, - int /*xorg*/, - int /*yorg*/); - -typedef RegionPtr (* RestoreAreasProcPtr)( - WindowPtr /*pWindow*/, - RegionPtr /*prgnRestore*/); - -typedef void (* ExposeCopyProcPtr)( - WindowPtr /*pSrc*/, - DrawablePtr /*pDst*/, - GCPtr /*pGC*/, - RegionPtr /*prgnExposed*/, - int /*srcx*/, - int /*srcy*/, - int /*dstx*/, - int /*dsty*/, - unsigned long /*plane*/); - -typedef RegionPtr (* TranslateBackingStoreProcPtr)( - WindowPtr /*pWindow*/, - int /*windx*/, - int /*windy*/, - RegionPtr /*oldClip*/, - int /*oldx*/, - int /*oldy*/); - -typedef RegionPtr (* ClearBackingStoreProcPtr)( - WindowPtr /*pWindow*/, - int /*x*/, - int /*y*/, - int /*w*/, - int /*h*/, - Bool /*generateExposures*/); - -typedef void (* DrawGuaranteeProcPtr)( - WindowPtr /*pWindow*/, - GCPtr /*pGC*/, - int /*guarantee*/); - typedef Bool (* RealizeFontProcPtr)( ScreenPtr /*pScreen*/, FontPtr /*pFont*/); @@ -388,14 +346,6 @@ typedef Bool (* MarkOverlappedWindowsProcPtr)( WindowPtr /*firstChild*/, WindowPtr * /*pLayerWin*/); -typedef Bool (* ChangeSaveUnderProcPtr)( - WindowPtr /*pLayerWin*/, - WindowPtr /*firstChild*/); - -typedef void (* PostChangeSaveUnderProcPtr)( - WindowPtr /*pLayerWin*/, - WindowPtr /*firstChild*/); - typedef int (* ConfigNotifyProcPtr)( WindowPtr /*pWin*/, int /*x*/, @@ -453,6 +403,9 @@ typedef void (* DeviceCursorCleanupProcPtr)( DeviceIntPtr /* pDev */, ScreenPtr /* pScreen */); +typedef void (*ConstrainCursorHarderProcPtr)( + DeviceIntPtr, ScreenPtr, int, int *, int *); + typedef struct _Screen { int myNum; /* index of this instance in Screens[] */ ATOM id; @@ -511,20 +464,6 @@ typedef struct _Screen { CreatePixmapProcPtr CreatePixmap; DestroyPixmapProcPtr DestroyPixmap; - /* Backing store procedures */ - - SaveDoomedAreasProcPtr SaveDoomedAreas; - RestoreAreasProcPtr RestoreAreas; - ExposeCopyProcPtr ExposeCopy; - TranslateBackingStoreProcPtr TranslateBackingStore; - ClearBackingStoreProcPtr ClearBackingStore; - DrawGuaranteeProcPtr DrawGuarantee; - /* - * A read/write copy of the lower level backing store vector is needed now - * that the functions can be wrapped. - */ - BSFuncRec BackingStoreFuncs; - /* Font procedures */ RealizeFontProcPtr RealizeFont; @@ -533,6 +472,7 @@ typedef struct _Screen { /* Cursor Procedures */ ConstrainCursorProcPtr ConstrainCursor; + ConstrainCursorHarderProcPtr ConstrainCursorHarder; CursorLimitsProcPtr CursorLimits; DisplayCursorProcPtr DisplayCursor; RealizeCursorProcPtr RealizeCursor; @@ -584,8 +524,6 @@ typedef struct _Screen { MarkWindowProcPtr MarkWindow; MarkOverlappedWindowsProcPtr MarkOverlappedWindows; - ChangeSaveUnderProcPtr ChangeSaveUnder; - PostChangeSaveUnderProcPtr PostChangeSaveUnder; ConfigNotifyProcPtr ConfigNotify; MoveWindowProcPtr MoveWindow; ResizeWindowProcPtr ResizeWindow; @@ -601,6 +539,12 @@ typedef struct _Screen { /* Device cursor procedures */ DeviceCursorInitializeProcPtr DeviceCursorInitialize; DeviceCursorCleanupProcPtr DeviceCursorCleanup; + + /* set it in driver side if X server can copy the framebuffer content. + * Meant to be used together with '-background none' option, avoiding + * malicious users to steal framebuffer's content if that would be the + * default */ + Bool canDoBGNoneRoot; } ScreenRec; static inline RegionPtr BitmapToRegion(ScreenPtr _pScreen, PixmapPtr pPix) { diff --git a/xserver/include/site.h b/xserver/include/site.h index b13421231..9c2836f21 100644 --- a/xserver/include/site.h +++ b/xserver/include/site.h @@ -112,9 +112,6 @@ SOFTWARE. #define DEFAULT_SCREEN_SAVER_INTERVAL (10 * (60 * 1000)) #define DEFAULT_SCREEN_SAVER_BLANKING PreferBlanking #define DEFAULT_SCREEN_SAVER_EXPOSURES AllowExposures -#ifndef NOLOGOHACK -#define DEFAULT_LOGO_SCREEN_SAVER 1 -#endif #ifndef DEFAULT_ACCESS_CONTROL #define DEFAULT_ACCESS_CONTROL TRUE #endif diff --git a/xserver/include/window.h b/xserver/include/window.h index 6fb2f8c18..e13598b88 100644 --- a/xserver/include/window.h +++ b/xserver/include/window.h @@ -266,4 +266,7 @@ extern _X_EXPORT void DisableMapUnmapEvents( extern _X_EXPORT void EnableMapUnmapEvents( WindowPtr /* pWin */ ); +extern _X_EXPORT void SetRootClip(ScreenPtr pScreen, Bool enable); +extern _X_EXPORT void PrintWindowTree(void); + #endif /* WINDOW_H */ diff --git a/xserver/include/windowstr.h b/xserver/include/windowstr.h index 29b95fc37..222de31dc 100644 --- a/xserver/include/windowstr.h +++ b/xserver/include/windowstr.h @@ -79,8 +79,8 @@ typedef struct _DevCursorNode { } DevCursNodeRec, *DevCursNodePtr, *DevCursorList; typedef struct _WindowOpt { - VisualID visual; /* default: same as parent */ CursorPtr cursor; /* default: window.cursorNone */ + VisualID visual; /* default: same as parent */ Colormap colormap; /* default: same as parent */ Mask dontPropagateMask; /* default: window.dontPropagate */ Mask otherEventMasks; /* default: 0 */ @@ -167,6 +167,10 @@ typedef struct _Window { #ifdef ROOTLESS unsigned rootlessUnhittable:1; /* doesn't hit-test */ #endif +#ifdef COMPOSITE + unsigned damagedDescendants:1; /* some descendants are damaged */ + unsigned inhibitBGPaint:1; /* paint the background? */ +#endif } WindowRec; /* diff --git a/xserver/include/xkbsrv.h b/xserver/include/xkbsrv.h index 9f1507e8e..c6f86f544 100644 --- a/xserver/include/xkbsrv.h +++ b/xserver/include/xkbsrv.h @@ -447,6 +447,11 @@ extern _X_EXPORT void XkbFreeKeyboard( Bool /* freeDesc */ ); +extern _X_EXPORT void XkbFreeComponentNames( + XkbComponentNamesPtr /* names */, + Bool /* freeNames */ +); + extern _X_EXPORT void XkbSetActionKeyMods( XkbDescPtr /* xkb */, XkbAction * /* act */, @@ -846,10 +851,6 @@ extern _X_EXPORT XkbGeometryPtr XkbLookupNamedGeometry( Bool * /* shouldFree */ ); -extern _X_EXPORT char * _XkbDupString( - const char * /* str */ -); - extern _X_EXPORT void XkbConvertCase( KeySym /* sym */, KeySym * /* lower */, diff --git a/xserver/include/xorg-server.h.in b/xserver/include/xorg-server.h.in index 06c7969ff..189449ac4 100644 --- a/xserver/include/xorg-server.h.in +++ b/xserver/include/xorg-server.h.in @@ -157,9 +157,6 @@ /* Name of X server */ #undef __XSERVERNAME__ -/* Define to 1 if unsigned long is 64 bits. */ -#undef _XSERVER64 - /* Building vgahw module */ #undef WITH_VGAHW @@ -190,4 +187,8 @@ /* Use X server privilege separation */ #undef X_PRIVSEP +#ifdef _LP64 +#define _XSERVER64 1 +#endif + #endif /* _XORG_SERVER_H_ */ diff --git a/xserver/include/xserver-properties.h b/xserver/include/xserver-properties.h index c6259aee1..2b1feabb6 100644 --- a/xserver/include/xserver-properties.h +++ b/xserver/include/xserver-properties.h @@ -35,6 +35,11 @@ /* BOOL. If present, device is a virtual XTEST device */ #define XI_PROP_XTEST_DEVICE "XTEST Device" +/* CARD32, 2 values, vendor, product. + * This property is set by the driver and may not be available for some + * drivers. Read-Only */ +#define XI_PROP_PRODUCT_ID "Device Product ID" + /* Coordinate transformation matrix for absolute input devices * FLOAT, 9 values in row-major order, coordinates in 0..1 range: * [c0 c1 c2] [x] @@ -42,6 +47,9 @@ * [c6 c7 c8] [1] */ #define XI_PROP_TRANSFORM "Coordinate Transformation Matrix" +/* STRING. Device node path of device */ +#define XI_PROP_DEVICE_NODE "Device Node" + /* Pointer acceleration properties */ /* INTEGER of any format */ #define ACCEL_PROP_PROFILE_NUMBER "Device Accel Profile" |