Merge branch 'master' into mpx
Conflicts: XTrap/xtrapddmi.c Xext/security.c Xext/xprint.c Xext/xtest.c Xext/xvdisp.c Xi/exevents.c Xi/grabdevb.c Xi/grabdevk.c Xi/opendev.c Xi/ungrdev.c Xi/ungrdevb.c Xi/ungrdevk.c dix/cursor.c dix/devices.c dix/dixutils.c dix/events.c dix/getevents.c dix/main.c dix/window.c hw/xfree86/ramdac/xf86Cursor.c include/dix.h include/input.h include/inputstr.h mi/midispcur.c mi/miinitext.c mi/misprite.c render/animcur.c xfixes/cursor.c xkb/xkbAccessX.c
This commit is contained in:
commit
8da83836b6
|
@ -8,6 +8,11 @@ Makefile.in
|
||||||
*.a
|
*.a
|
||||||
*.o
|
*.o
|
||||||
*~
|
*~
|
||||||
|
.*.swp
|
||||||
|
*.pbxuser
|
||||||
|
*.mode1v3
|
||||||
|
obj*
|
||||||
|
build*
|
||||||
aclocal.m4
|
aclocal.m4
|
||||||
autom4te.cache
|
autom4te.cache
|
||||||
compile
|
compile
|
||||||
|
@ -92,8 +97,6 @@ cfb32/cfbzerarcG.c
|
||||||
cfb32/cfbzerarcX.c
|
cfb32/cfbzerarcX.c
|
||||||
doc/Xserver.1x
|
doc/Xserver.1x
|
||||||
doc/Xserver.man
|
doc/Xserver.man
|
||||||
doc/SecurityPolicy.5
|
|
||||||
doc/SecurityPolicy.man
|
|
||||||
hw/dmx/Xdmx
|
hw/dmx/Xdmx
|
||||||
hw/dmx/Xdmx.1x
|
hw/dmx/Xdmx.1x
|
||||||
hw/dmx/config/dmxtodmx
|
hw/dmx/config/dmxtodmx
|
||||||
|
@ -298,4 +301,3 @@ mfb/mfbteblack.c
|
||||||
mfb/mfbtewhite.c
|
mfb/mfbtewhite.c
|
||||||
mfb/mfbtileC.c
|
mfb/mfbtileC.c
|
||||||
mfb/mfbtileG.c
|
mfb/mfbtileG.c
|
||||||
.*.swp
|
|
||||||
|
|
200
COPYING
200
COPYING
|
@ -1,3 +1,45 @@
|
||||||
|
The following is the 'standard copyright' agreed upon by most contributors,
|
||||||
|
and is currently the canonical license, though a modification is currently
|
||||||
|
under discussion. Copyright holders of new code should use this license
|
||||||
|
statement where possible, and append their name to this list. Please sort
|
||||||
|
by surname for people, and by the full name for other entities (e.g.
|
||||||
|
Juliusz Chroboczek sorts before Intel Corporation sorts before Daniel
|
||||||
|
Stone).
|
||||||
|
|
||||||
|
Copyright © 2000-2001 Juliusz Chroboczek
|
||||||
|
Copyright © 2006-2007 Intel Corporation
|
||||||
|
Copyright © 2006 Nokia Corporation
|
||||||
|
Copyright © 1999 Keith Packard
|
||||||
|
Copyright © 2005-2007 Daniel Stone
|
||||||
|
Copyright © 2006 Luc Verhaegen
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The following licenses are 'legacy': usually MIT/X11 licenses with the name
|
||||||
|
of the copyright holder(s) in the license statement, but also some BSD-like
|
||||||
|
licenses.
|
||||||
|
|
||||||
|
|
||||||
Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.
|
Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
@ -1058,27 +1100,6 @@ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
PERFORMANCE OF THIS SOFTWARE.
|
PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
Copyright © 2003-2005 Keith Packard, Daniel Stone
|
|
||||||
|
|
||||||
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 names of Keith Packard and Daniel Stone not be
|
|
||||||
used in advertising or publicity pertaining to distribution of the software
|
|
||||||
without specific, written prior permission. Keith Packard and Daniel Stone
|
|
||||||
make no representations about the suitability of this software for any
|
|
||||||
purpose. It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
KEITH PACKARD AND DANIEL STONE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|
|
||||||
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
|
|
||||||
IN NO EVENT SHALL KEITH PACKARD OR DANIEL STONE BE LIABLE FOR ANY SPECIAL,
|
|
||||||
INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
||||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
|
||||||
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
||||||
PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
Copyright © 1999 Keith Packard
|
Copyright © 1999 Keith Packard
|
||||||
Copyright © 2000 Compaq Computer Corporation
|
Copyright © 2000 Compaq Computer Corporation
|
||||||
Copyright © 2002 MontaVista Software Inc.
|
Copyright © 2002 MontaVista Software Inc.
|
||||||
|
@ -2357,54 +2378,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
Copyright (c) 1999 by Keith Packard
|
|
||||||
Copyright © 2006 Intel Corporation
|
|
||||||
Copyright 2006 Luc Verhaegen.
|
|
||||||
|
|
||||||
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 (c) 2000-2001 by Juliusz Chroboczek
|
|
||||||
Copyright (c) 1999 by Keith Packard
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
|
|
||||||
Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
|
Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
|
||||||
Copyright 1992 by David Dawes <dawes@XFree86.org>
|
Copyright 1992 by David Dawes <dawes@XFree86.org>
|
||||||
Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
|
Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
|
||||||
|
@ -2622,92 +2595,3 @@ FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||||
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
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.
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
Copyright © 2006 Daniel Stone
|
|
||||||
|
|
||||||
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 © 2006-2007 Daniel Stone
|
|
||||||
|
|
||||||
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 © 2007 Daniel Stone
|
|
||||||
|
|
||||||
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 © 1999 Keith Packard
|
|
||||||
Copyright © 2006 Nokia Corporation
|
|
||||||
|
|
||||||
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 the authors not be used in
|
|
||||||
advertising or publicity pertaining to distribution of the software without
|
|
||||||
specific, written prior permission. The authors make no
|
|
||||||
representations about the suitability of this software for any purpose. It
|
|
||||||
is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
||||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
|
||||||
EVENT SHALL THE AUTHORS 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.
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
if XDARWIN
|
if XQUARTZ
|
||||||
DARWIN_SUBDIRS = apple
|
XQUARTZ_SUBDIRS = apple
|
||||||
endif
|
endif
|
||||||
SUBDIRS = glx mesa $(DARWIN_SUBDIRS)
|
|
||||||
|
SUBDIRS = glx mesa $(XQUARTZ_SUBDIRS)
|
||||||
|
DIST_SUBDIRS = glx mesa apple
|
||||||
|
|
||||||
WINDOWS_EXTRAS = \
|
WINDOWS_EXTRAS = \
|
||||||
windows/ChangeLog \
|
windows/ChangeLog \
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
AM_CFLAGS = -I$(top_srcdir) \
|
AM_CFLAGS = $(DIX_CFLAGS)
|
||||||
-I$(top_srcdir)/hw/darwin/quartz \
|
AM_CPPFLAGS = \
|
||||||
|
-I$(top_srcdir) \
|
||||||
-I$(top_srcdir)/GL/glx \
|
-I$(top_srcdir)/GL/glx \
|
||||||
-I$(top_srcdir)/hw/darwin/quartz/cr \
|
-I$(top_srcdir)/GL/include \
|
||||||
-I$(top_srcdir)/GL/include
|
-I$(top_srcdir)/GL/mesa/glapi \
|
||||||
|
-I$(top_srcdir)/hw/xquartz \
|
||||||
|
-I$(top_srcdir)/hw/xquartz/xpr \
|
||||||
|
-I$(top_srcdir)/miext/damage
|
||||||
|
|
||||||
if HAVE_AGL_FRAMEWORK
|
if HAVE_AGL_FRAMEWORK
|
||||||
noinst_LIBRARIES = libAGLcore.a
|
noinst_LIBRARIES = libAGLcore.a
|
||||||
|
@ -13,3 +17,8 @@ libAGLcore_a_SOURCES = aglGlx.c \
|
||||||
$(top_srcdir)/hw/darwin/quartz/xpr/x-hash.h \
|
$(top_srcdir)/hw/darwin/quartz/xpr/x-hash.h \
|
||||||
$(top_srcdir)/hw/dmx/glxProxy/compsize.c
|
$(top_srcdir)/hw/dmx/glxProxy/compsize.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
#noinst_LIBRARIES = libCGLcore.a
|
||||||
|
#libCGLcore_a_SOURCES = \
|
||||||
|
# indirect.c \
|
||||||
|
# $(top_srcdir)/hw/dmx/glxProxy/compsize.c
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "glxserver.h"
|
#include "glxserver.h"
|
||||||
#include <windowstr.h>
|
#include <windowstr.h>
|
||||||
#include <propertyst.h>
|
#include <propertyst.h>
|
||||||
|
#include "privates.h"
|
||||||
#include <os.h>
|
#include <os.h>
|
||||||
#include "g_disptab.h"
|
#include "g_disptab.h"
|
||||||
#include "unpack.h"
|
#include "unpack.h"
|
||||||
|
@ -53,7 +54,7 @@ RESTYPE __glXSwapBarrierRes;
|
||||||
*/
|
*/
|
||||||
xGLXSingleReply __glXReply;
|
xGLXSingleReply __glXReply;
|
||||||
|
|
||||||
static int glxClientPrivateIndex;
|
static DevPrivateKey glxClientPrivateKey = &glxClientPrivateKey;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Client that called into GLX dispatch.
|
** Client that called into GLX dispatch.
|
||||||
|
@ -204,7 +205,7 @@ int __glXError(int error)
|
||||||
__GLXclientState *
|
__GLXclientState *
|
||||||
glxGetClient(ClientPtr pClient)
|
glxGetClient(ClientPtr pClient)
|
||||||
{
|
{
|
||||||
return (__GLXclientState *) pClient->devPrivates[glxClientPrivateIndex].ptr;
|
return dixLookupPrivate(&pClient->devPrivates, glxClientPrivateKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -274,9 +275,7 @@ void GlxExtensionInit(void)
|
||||||
__glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
|
__glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
|
||||||
__glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone);
|
__glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone);
|
||||||
|
|
||||||
glxClientPrivateIndex = AllocateClientPrivateIndex ();
|
if (!dixRequestPrivate(glxClientPrivateKey, sizeof (__GLXclientState)))
|
||||||
if (!AllocateClientPrivate (glxClientPrivateIndex,
|
|
||||||
sizeof (__GLXclientState)))
|
|
||||||
return;
|
return;
|
||||||
if (!AddCallback (&ClientStateCallback, glxClientCallback, 0))
|
if (!AddCallback (&ClientStateCallback, glxClientCallback, 0))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -42,12 +42,13 @@
|
||||||
#include <os.h>
|
#include <os.h>
|
||||||
#include <colormapst.h>
|
#include <colormapst.h>
|
||||||
|
|
||||||
|
#include "privates.h"
|
||||||
#include "glxserver.h"
|
#include "glxserver.h"
|
||||||
#include "glxutil.h"
|
#include "glxutil.h"
|
||||||
#include "glxext.h"
|
#include "glxext.h"
|
||||||
#include "glcontextmodes.h"
|
#include "glcontextmodes.h"
|
||||||
|
|
||||||
static int glxScreenPrivateIndex;
|
static DevPrivateKey glxScreenPrivateKey = &glxScreenPrivateKey;
|
||||||
|
|
||||||
const char GLServerVersion[] = "1.4";
|
const char GLServerVersion[] = "1.4";
|
||||||
static const char GLServerExtensions[] =
|
static const char GLServerExtensions[] =
|
||||||
|
@ -174,7 +175,7 @@ static char GLXServerExtensions[] =
|
||||||
"GLX_EXT_texture_from_pixmap "
|
"GLX_EXT_texture_from_pixmap "
|
||||||
"GLX_OML_swap_method "
|
"GLX_OML_swap_method "
|
||||||
"GLX_SGI_make_current_read "
|
"GLX_SGI_make_current_read "
|
||||||
#ifndef __DARWIN__
|
#ifndef __APPLE__
|
||||||
"GLX_SGIS_multisample "
|
"GLX_SGIS_multisample "
|
||||||
"GLX_SGIX_hyperpipe "
|
"GLX_SGIX_hyperpipe "
|
||||||
"GLX_SGIX_swap_barrier "
|
"GLX_SGIX_swap_barrier "
|
||||||
|
@ -269,7 +270,7 @@ glxCloseScreen (int index, ScreenPtr pScreen)
|
||||||
__GLXscreen *
|
__GLXscreen *
|
||||||
glxGetScreen(ScreenPtr pScreen)
|
glxGetScreen(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
return (__GLXscreen *) pScreen->devPrivates[glxScreenPrivateIndex].ptr;
|
return dixLookupPrivate(&pScreen->devPrivates, glxScreenPrivateKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GlxSetVisualConfigs(int nconfigs,
|
void GlxSetVisualConfigs(int nconfigs,
|
||||||
|
@ -497,19 +498,9 @@ void GlxSetVisualConfig(int config)
|
||||||
|
|
||||||
void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
|
void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
static int glxGeneration;
|
|
||||||
__GLcontextModes *m;
|
__GLcontextModes *m;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (glxGeneration != serverGeneration)
|
|
||||||
{
|
|
||||||
glxScreenPrivateIndex = AllocateScreenPrivateIndex ();
|
|
||||||
if (glxScreenPrivateIndex == -1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
glxGeneration = serverGeneration;
|
|
||||||
}
|
|
||||||
|
|
||||||
pGlxScreen->pScreen = pScreen;
|
pGlxScreen->pScreen = pScreen;
|
||||||
pGlxScreen->GLextensions = xstrdup(GLServerExtensions);
|
pGlxScreen->GLextensions = xstrdup(GLServerExtensions);
|
||||||
pGlxScreen->GLXvendor = xstrdup(GLXServerVendorName);
|
pGlxScreen->GLXvendor = xstrdup(GLXServerVendorName);
|
||||||
|
@ -548,7 +539,7 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pScreen->devPrivates[glxScreenPrivateIndex].ptr = (pointer) pGlxScreen;
|
dixSetPrivate(&pScreen->devPrivates, glxScreenPrivateKey, pGlxScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __glXScreenDestroy(__GLXscreen *screen)
|
void __glXScreenDestroy(__GLXscreen *screen)
|
||||||
|
|
|
@ -5169,31 +5169,6 @@ void __glXDisp_LoadProgramNV(GLbyte * pc)
|
||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void __glXDisp_ProgramParameter4dvNV(GLbyte * pc)
|
|
||||||
{
|
|
||||||
#ifdef __GLX_ALIGN64
|
|
||||||
if ((unsigned long)(pc) & 7) {
|
|
||||||
(void) memmove(pc-4, pc, 40);
|
|
||||||
pc -= 4;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CALL_ProgramParameter4dvNV( GET_DISPATCH(), (
|
|
||||||
*(GLenum *)(pc + 0),
|
|
||||||
*(GLuint *)(pc + 4),
|
|
||||||
(const GLdouble *)(pc + 8)
|
|
||||||
) );
|
|
||||||
}
|
|
||||||
|
|
||||||
void __glXDisp_ProgramParameter4fvNV(GLbyte * pc)
|
|
||||||
{
|
|
||||||
CALL_ProgramParameter4fvNV( GET_DISPATCH(), (
|
|
||||||
*(GLenum *)(pc + 0),
|
|
||||||
*(GLuint *)(pc + 4),
|
|
||||||
(const GLfloat *)(pc + 8)
|
|
||||||
) );
|
|
||||||
}
|
|
||||||
|
|
||||||
void __glXDisp_ProgramParameters4dvNV(GLbyte * pc)
|
void __glXDisp_ProgramParameters4dvNV(GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLuint num = *(GLuint *)(pc + 8);
|
const GLuint num = *(GLuint *)(pc + 8);
|
||||||
|
|
|
@ -149,8 +149,6 @@ extern HIDDEN int __glXDisp_GetProgramNamedParameterfvNV(struct __GLXclientState
|
||||||
extern HIDDEN int __glXDispSwap_GetProgramNamedParameterfvNV(struct __GLXclientStateRec *, GLbyte *);
|
extern HIDDEN int __glXDispSwap_GetProgramNamedParameterfvNV(struct __GLXclientStateRec *, GLbyte *);
|
||||||
extern HIDDEN void __glXDisp_PointParameterfEXT(GLbyte * pc);
|
extern HIDDEN void __glXDisp_PointParameterfEXT(GLbyte * pc);
|
||||||
extern HIDDEN void __glXDispSwap_PointParameterfEXT(GLbyte * pc);
|
extern HIDDEN void __glXDispSwap_PointParameterfEXT(GLbyte * pc);
|
||||||
extern HIDDEN void __glXDisp_ProgramParameter4dvNV(GLbyte * pc);
|
|
||||||
extern HIDDEN void __glXDispSwap_ProgramParameter4dvNV(GLbyte * pc);
|
|
||||||
extern HIDDEN void __glXDisp_TexCoord2sv(GLbyte * pc);
|
extern HIDDEN void __glXDisp_TexCoord2sv(GLbyte * pc);
|
||||||
extern HIDDEN void __glXDispSwap_TexCoord2sv(GLbyte * pc);
|
extern HIDDEN void __glXDispSwap_TexCoord2sv(GLbyte * pc);
|
||||||
extern HIDDEN void __glXDisp_Vertex4dv(GLbyte * pc);
|
extern HIDDEN void __glXDisp_Vertex4dv(GLbyte * pc);
|
||||||
|
@ -425,8 +423,6 @@ extern HIDDEN void __glXDisp_FramebufferTexture1DEXT(GLbyte * pc);
|
||||||
extern HIDDEN void __glXDispSwap_FramebufferTexture1DEXT(GLbyte * pc);
|
extern HIDDEN void __glXDispSwap_FramebufferTexture1DEXT(GLbyte * pc);
|
||||||
extern HIDDEN int __glXDisp_GetDrawableAttributes(struct __GLXclientStateRec *, GLbyte *);
|
extern HIDDEN int __glXDisp_GetDrawableAttributes(struct __GLXclientStateRec *, GLbyte *);
|
||||||
extern HIDDEN int __glXDispSwap_GetDrawableAttributes(struct __GLXclientStateRec *, GLbyte *);
|
extern HIDDEN int __glXDispSwap_GetDrawableAttributes(struct __GLXclientStateRec *, GLbyte *);
|
||||||
extern HIDDEN void __glXDisp_ProgramParameter4fvNV(GLbyte * pc);
|
|
||||||
extern HIDDEN void __glXDispSwap_ProgramParameter4fvNV(GLbyte * pc);
|
|
||||||
extern HIDDEN void __glXDisp_RasterPos2sv(GLbyte * pc);
|
extern HIDDEN void __glXDisp_RasterPos2sv(GLbyte * pc);
|
||||||
extern HIDDEN void __glXDispSwap_RasterPos2sv(GLbyte * pc);
|
extern HIDDEN void __glXDispSwap_RasterPos2sv(GLbyte * pc);
|
||||||
extern HIDDEN void __glXDisp_Color4ubv(GLbyte * pc);
|
extern HIDDEN void __glXDisp_Color4ubv(GLbyte * pc);
|
||||||
|
|
|
@ -5325,31 +5325,6 @@ void __glXDispSwap_LoadProgramNV(GLbyte * pc)
|
||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void __glXDispSwap_ProgramParameter4dvNV(GLbyte * pc)
|
|
||||||
{
|
|
||||||
#ifdef __GLX_ALIGN64
|
|
||||||
if ((unsigned long)(pc) & 7) {
|
|
||||||
(void) memmove(pc-4, pc, 40);
|
|
||||||
pc -= 4;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CALL_ProgramParameter4dvNV( GET_DISPATCH(), (
|
|
||||||
(GLenum )bswap_ENUM ( pc + 0 ),
|
|
||||||
(GLuint )bswap_CARD32 ( pc + 4 ),
|
|
||||||
(const GLdouble *)bswap_64_array( (uint64_t *) (pc + 8), 4 )
|
|
||||||
) );
|
|
||||||
}
|
|
||||||
|
|
||||||
void __glXDispSwap_ProgramParameter4fvNV(GLbyte * pc)
|
|
||||||
{
|
|
||||||
CALL_ProgramParameter4fvNV( GET_DISPATCH(), (
|
|
||||||
(GLenum )bswap_ENUM ( pc + 0 ),
|
|
||||||
(GLuint )bswap_CARD32 ( pc + 4 ),
|
|
||||||
(const GLfloat *)bswap_32_array( (uint32_t *) (pc + 8), 4 )
|
|
||||||
) );
|
|
||||||
}
|
|
||||||
|
|
||||||
void __glXDispSwap_ProgramParameters4dvNV(GLbyte * pc)
|
void __glXDispSwap_ProgramParameters4dvNV(GLbyte * pc)
|
||||||
{
|
{
|
||||||
const GLuint num = (GLuint )bswap_CARD32 ( pc + 8 );
|
const GLuint num = (GLuint )bswap_CARD32 ( pc + 8 );
|
||||||
|
|
|
@ -652,6 +652,10 @@ __glGetBooleanv_size(GLenum e)
|
||||||
case GL_WEIGHT_ARRAY_SIZE_ARB:
|
case GL_WEIGHT_ARRAY_SIZE_ARB:
|
||||||
case GL_WEIGHT_ARRAY_ARB:
|
case GL_WEIGHT_ARRAY_ARB:
|
||||||
case GL_PACK_INVERT_MESA:
|
case GL_PACK_INVERT_MESA:
|
||||||
|
case GL_STENCIL_BACK_FUNC_ATI:
|
||||||
|
case GL_STENCIL_BACK_FAIL_ATI:
|
||||||
|
case GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI:
|
||||||
|
case GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI:
|
||||||
case GL_FRAGMENT_PROGRAM_ARB:
|
case GL_FRAGMENT_PROGRAM_ARB:
|
||||||
case GL_MAX_DRAW_BUFFERS_ARB:
|
case GL_MAX_DRAW_BUFFERS_ARB:
|
||||||
/* case GL_MAX_DRAW_BUFFERS_ATI:*/
|
/* case GL_MAX_DRAW_BUFFERS_ATI:*/
|
||||||
|
|
|
@ -644,7 +644,7 @@ static const void *Render_function_table[400][2] = {
|
||||||
/* [ 301] = 4181 */ {__glXDisp_ExecuteProgramNV, __glXDispSwap_ExecuteProgramNV},
|
/* [ 301] = 4181 */ {__glXDisp_ExecuteProgramNV, __glXDispSwap_ExecuteProgramNV},
|
||||||
/* [ 302] = 4182 */ {__glXDisp_RequestResidentProgramsNV, __glXDispSwap_RequestResidentProgramsNV},
|
/* [ 302] = 4182 */ {__glXDisp_RequestResidentProgramsNV, __glXDispSwap_RequestResidentProgramsNV},
|
||||||
/* [ 303] = 4183 */ {__glXDisp_LoadProgramNV, __glXDispSwap_LoadProgramNV},
|
/* [ 303] = 4183 */ {__glXDisp_LoadProgramNV, __glXDispSwap_LoadProgramNV},
|
||||||
/* [ 304] = 4184 */ {__glXDisp_ProgramParameter4fvNV, __glXDispSwap_ProgramParameter4fvNV},
|
/* [ 304] = 4184 */ {__glXDisp_ProgramEnvParameter4fvARB, __glXDispSwap_ProgramEnvParameter4fvARB},
|
||||||
/* [ 305] = 4185 */ {__glXDisp_ProgramEnvParameter4dvARB, __glXDispSwap_ProgramEnvParameter4dvARB},
|
/* [ 305] = 4185 */ {__glXDisp_ProgramEnvParameter4dvARB, __glXDispSwap_ProgramEnvParameter4dvARB},
|
||||||
/* [ 306] = 4186 */ {__glXDisp_ProgramParameters4fvNV, __glXDispSwap_ProgramParameters4fvNV},
|
/* [ 306] = 4186 */ {__glXDisp_ProgramParameters4fvNV, __glXDispSwap_ProgramParameters4fvNV},
|
||||||
/* [ 307] = 4187 */ {__glXDisp_ProgramParameters4dvNV, __glXDispSwap_ProgramParameters4dvNV},
|
/* [ 307] = 4187 */ {__glXDisp_ProgramParameters4dvNV, __glXDispSwap_ProgramParameters4dvNV},
|
||||||
|
|
|
@ -52,7 +52,7 @@ SOFTWARE.
|
||||||
#define NEED_REPLIES
|
#define NEED_REPLIES
|
||||||
#define NEED_EVENTS
|
#define NEED_EVENTS
|
||||||
#include <X11/X.h> /* From library include environment */
|
#include <X11/X.h> /* From library include environment */
|
||||||
#include "input.h" /* From server include env. (must be before Xlib.h!) */
|
#include "inputstr.h" /* From server include env. (must be before Xlib.h!) */
|
||||||
#ifdef PC
|
#ifdef PC
|
||||||
# include "scrintst.h" /* Screen struct */
|
# include "scrintst.h" /* Screen struct */
|
||||||
# include "extnsist.h"
|
# include "extnsist.h"
|
||||||
|
|
|
@ -58,7 +58,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include <X11/Xos.h>
|
#include <X11/Xos.h>
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#include "input.h" /* Server DevicePtr definitions */
|
#include "inputstr.h" /* Server DevicePtr definitions */
|
||||||
#include "misc.h" /* Server swapping macros */
|
#include "misc.h" /* Server swapping macros */
|
||||||
#include "dixstruct.h" /* Server ClientRec definitions */
|
#include "dixstruct.h" /* Server ClientRec definitions */
|
||||||
#include "resource.h" /* Used with the MakeAtom call */
|
#include "resource.h" /* Used with the MakeAtom call */
|
||||||
|
@ -278,7 +278,7 @@ Bool XETrapRedirectDevices()
|
||||||
/* Do we need to redirect the keyboard device? */
|
/* Do we need to redirect the keyboard device? */
|
||||||
if (XETrapKbdDev == NULL)
|
if (XETrapKbdDev == NULL)
|
||||||
{
|
{
|
||||||
if ((XETrapKbdDev = LookupKeyboardDevice()) == NULL)
|
if ((XETrapKbdDev = (DevicePtr)inputInfo.keyboard) == NULL)
|
||||||
{
|
{
|
||||||
retval = False;
|
retval = False;
|
||||||
}
|
}
|
||||||
|
@ -303,7 +303,7 @@ Bool XETrapRedirectDevices()
|
||||||
#ifndef VECTORED_EVENTS
|
#ifndef VECTORED_EVENTS
|
||||||
if (XETrapPtrDev == NULL)
|
if (XETrapPtrDev == NULL)
|
||||||
{
|
{
|
||||||
if ((XETrapPtrDev = LookupPointerDevice()) == 0L)
|
if ((XETrapPtrDev = (DevicePtr)inputInfo.pointer) == 0L)
|
||||||
{
|
{
|
||||||
retval = False;
|
retval = False;
|
||||||
}
|
}
|
||||||
|
|
13
Xext/EVI.c
13
Xext/EVI.c
|
@ -35,9 +35,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include "EVIstruct.h"
|
#include "EVIstruct.h"
|
||||||
#include "modinit.h"
|
#include "modinit.h"
|
||||||
|
|
||||||
#if 0
|
|
||||||
static unsigned char XEVIReqCode = 0;
|
|
||||||
#endif
|
|
||||||
static EviPrivPtr eviPriv;
|
static EviPrivPtr eviPriv;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -182,19 +179,9 @@ EVIResetProc(ExtensionEntry *extEntry)
|
||||||
void
|
void
|
||||||
EVIExtensionInit(INITARGS)
|
EVIExtensionInit(INITARGS)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
ExtensionEntry *extEntry;
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension(EVINAME, 0, 0,
|
|
||||||
ProcEVIDispatch,
|
|
||||||
SProcEVIDispatch,
|
|
||||||
EVIResetProc, StandardMinorOpcode))) {
|
|
||||||
XEVIReqCode = (unsigned char)extEntry->base;
|
|
||||||
#else
|
|
||||||
if (AddExtension(EVINAME, 0, 0,
|
if (AddExtension(EVINAME, 0, 0,
|
||||||
ProcEVIDispatch, SProcEVIDispatch,
|
ProcEVIDispatch, SProcEVIDispatch,
|
||||||
EVIResetProc, StandardMinorOpcode)) {
|
EVIResetProc, StandardMinorOpcode)) {
|
||||||
#endif
|
|
||||||
eviPriv = eviDDXInit();
|
eviPriv = eviDDXInit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,9 +34,6 @@ MODULE_SRCS = \
|
||||||
sync.c \
|
sync.c \
|
||||||
xcmisc.c
|
xcmisc.c
|
||||||
|
|
||||||
# Extra configuration files ship with some extensions
|
|
||||||
SERVERCONFIG_DATA =
|
|
||||||
|
|
||||||
# Optional sources included if extension enabled by configure.ac rules
|
# Optional sources included if extension enabled by configure.ac rules
|
||||||
|
|
||||||
# MIT Shared Memory extension
|
# MIT Shared Memory extension
|
||||||
|
@ -76,13 +73,17 @@ if XACE
|
||||||
BUILTIN_SRCS += $(XACE_SRCS)
|
BUILTIN_SRCS += $(XACE_SRCS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# SELinux extension: provides SELinux policy support for X objects
|
||||||
|
# requires X-ACE extension
|
||||||
|
XSELINUX_SRCS = xselinux.c xselinux.h
|
||||||
|
if XSELINUX
|
||||||
|
BUILTIN_SRCS += $(XSELINUX_SRCS)
|
||||||
|
endif
|
||||||
|
|
||||||
# Security extension: multi-level security to protect clients from each other
|
# Security extension: multi-level security to protect clients from each other
|
||||||
XCSECURITY_SRCS = security.c securitysrv.h
|
XCSECURITY_SRCS = security.c securitysrv.h
|
||||||
if XCSECURITY
|
if XCSECURITY
|
||||||
BUILTIN_SRCS += $(XCSECURITY_SRCS)
|
BUILTIN_SRCS += $(XCSECURITY_SRCS)
|
||||||
|
|
||||||
SERVERCONFIG_DATA += SecurityPolicy
|
|
||||||
AM_CFLAGS += -DDEFAULTPOLICYFILE=\"$(SERVERCONFIGdir)/SecurityPolicy\"
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
XCALIBRATE_SRCS = xcalibrate.c
|
XCALIBRATE_SRCS = xcalibrate.c
|
||||||
|
@ -160,7 +161,6 @@ libXextmodule_la_SOURCES = $(MODULE_SRCS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
$(SERVERCONFIG_DATA) \
|
|
||||||
$(MITSHM_SRCS) \
|
$(MITSHM_SRCS) \
|
||||||
$(XV_SRCS) \
|
$(XV_SRCS) \
|
||||||
$(RES_SRCS) \
|
$(RES_SRCS) \
|
||||||
|
|
|
@ -1,88 +0,0 @@
|
||||||
version-1
|
|
||||||
|
|
||||||
# $Xorg: SecurityPolicy,v 1.3 2000/08/17 19:47:56 cpqbld Exp $
|
|
||||||
|
|
||||||
# The site policy fields are interpreted by the XC-QUERY-SECURITY-1
|
|
||||||
# authorization protocol. The values are arbitrary and site-specific.
|
|
||||||
# Refer to the Security Extension Specification for the usage of the policies.
|
|
||||||
#sitepolicy A
|
|
||||||
#sitepolicy B
|
|
||||||
#sitepolicy C
|
|
||||||
|
|
||||||
# Property access rules:
|
|
||||||
# property <property> <window> <permissions>
|
|
||||||
# <window> ::= any | root | <propertyselector>
|
|
||||||
# <propertyselector> ::= <property> | <property>=<value>
|
|
||||||
# <permissions> :== [ <operation> | <action> | <space> ]*
|
|
||||||
# <operation> :== r | w | d
|
|
||||||
# r read
|
|
||||||
# w write
|
|
||||||
# d delete
|
|
||||||
# <action> :== a | i | e
|
|
||||||
# a allow
|
|
||||||
# i ignore
|
|
||||||
# e error
|
|
||||||
|
|
||||||
# Allow reading of application resources, but not writing.
|
|
||||||
property RESOURCE_MANAGER root ar iw
|
|
||||||
property SCREEN_RESOURCES root ar iw
|
|
||||||
|
|
||||||
# Ignore attempts to use cut buffers. Giving errors causes apps to crash,
|
|
||||||
# and allowing access may give away too much information.
|
|
||||||
property CUT_BUFFER0 root irw
|
|
||||||
property CUT_BUFFER1 root irw
|
|
||||||
property CUT_BUFFER2 root irw
|
|
||||||
property CUT_BUFFER3 root irw
|
|
||||||
property CUT_BUFFER4 root irw
|
|
||||||
property CUT_BUFFER5 root irw
|
|
||||||
property CUT_BUFFER6 root irw
|
|
||||||
property CUT_BUFFER7 root irw
|
|
||||||
|
|
||||||
# If you are using Motif, you probably want these.
|
|
||||||
property _MOTIF_DEFAULT_BINDINGS root ar iw
|
|
||||||
property _MOTIF_DRAG_WINDOW root ar iw
|
|
||||||
property _MOTIF_DRAG_TARGETS any ar iw
|
|
||||||
property _MOTIF_DRAG_ATOMS any ar iw
|
|
||||||
property _MOTIF_DRAG_ATOM_PAIRS any ar iw
|
|
||||||
|
|
||||||
# If you are running CDE you also need these
|
|
||||||
property _MOTIF_WM_INFO root arw
|
|
||||||
property TT_SESSION root irw
|
|
||||||
property WM_ICON_SIZE root irw
|
|
||||||
property "SDT Pixel Set" any irw
|
|
||||||
|
|
||||||
# The next two rules let xwininfo -tree work when untrusted.
|
|
||||||
property WM_NAME any ar
|
|
||||||
|
|
||||||
# Allow read of WM_CLASS, but only for windows with WM_NAME.
|
|
||||||
# This might be more restrictive than necessary, but demonstrates
|
|
||||||
# the <required property> facility, and is also an attempt to
|
|
||||||
# say "top level windows only."
|
|
||||||
property WM_CLASS WM_NAME ar
|
|
||||||
|
|
||||||
# These next three let xlsclients work untrusted. Think carefully
|
|
||||||
# before including these; giving away the client machine name and command
|
|
||||||
# may be exposing too much.
|
|
||||||
property WM_STATE WM_NAME ar
|
|
||||||
property WM_CLIENT_MACHINE WM_NAME ar
|
|
||||||
property WM_COMMAND WM_NAME ar
|
|
||||||
|
|
||||||
# To let untrusted clients use the standard colormaps created by
|
|
||||||
# xstdcmap, include these lines.
|
|
||||||
property RGB_DEFAULT_MAP root ar
|
|
||||||
property RGB_BEST_MAP root ar
|
|
||||||
property RGB_RED_MAP root ar
|
|
||||||
property RGB_GREEN_MAP root ar
|
|
||||||
property RGB_BLUE_MAP root ar
|
|
||||||
property RGB_GRAY_MAP root ar
|
|
||||||
|
|
||||||
# To let untrusted clients use the color management database created
|
|
||||||
# by xcmsdb, include these lines.
|
|
||||||
property XDCCC_LINEAR_RGB_CORRECTION root ar
|
|
||||||
property XDCCC_LINEAR_RGB_MATRICES root ar
|
|
||||||
property XDCCC_GRAY_SCREENWHITEPOINT root ar
|
|
||||||
property XDCCC_GRAY_CORRECTION root ar
|
|
||||||
|
|
||||||
# To let untrusted clients use the overlay visuals that many vendors
|
|
||||||
# support, include this line.
|
|
||||||
property SERVER_OVERLAY_VISUALS root ar
|
|
|
@ -345,7 +345,7 @@ int AttrValidate(
|
||||||
ColormapPtr pColormap;
|
ColormapPtr pColormap;
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, pAppGrp->default_root, client,
|
rc = dixLookupWindow(&pWin, pAppGrp->default_root, client,
|
||||||
DixUnknownAccess);
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
pScreen = pWin->drawable.pScreen;
|
pScreen = pWin->drawable.pScreen;
|
||||||
|
@ -367,8 +367,10 @@ int AttrValidate(
|
||||||
}
|
}
|
||||||
if (pAppGrp->default_colormap) {
|
if (pAppGrp->default_colormap) {
|
||||||
|
|
||||||
pColormap = (ColormapPtr)LookupIDByType (pAppGrp->default_colormap, RT_COLORMAP);
|
rc = dixLookupResource((pointer *)&pColormap, pAppGrp->default_colormap,
|
||||||
/* XXX check that pColormap is not NULL */
|
RT_COLORMAP, client, DixUseAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
if (pColormap->pScreen != pScreen)
|
if (pColormap->pScreen != pScreen)
|
||||||
return BadColor;
|
return BadColor;
|
||||||
if (pColormap->pVisual->vid != (pAppGrp->root_visual ? pAppGrp->root_visual : pScreen->rootVisual))
|
if (pColormap->pVisual->vid != (pAppGrp->root_visual ? pAppGrp->root_visual : pScreen->rootVisual))
|
||||||
|
@ -470,7 +472,7 @@ int ProcXagQuery(
|
||||||
int n, rc;
|
int n, rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH (xXagQueryReq);
|
REQUEST_SIZE_MATCH (xXagQueryReq);
|
||||||
rc = dixLookupClient(&pClient, stuff->resource, client, DixUnknownAccess);
|
rc = dixLookupClient(&pClient, stuff->resource, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
|
@ -41,10 +41,6 @@ from The Open Group.
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
#include "modinit.h"
|
#include "modinit.h"
|
||||||
|
|
||||||
#if 0
|
|
||||||
static unsigned char XBigReqCode;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void BigReqResetProc(
|
static void BigReqResetProc(
|
||||||
ExtensionEntry * /* extEntry */
|
ExtensionEntry * /* extEntry */
|
||||||
);
|
);
|
||||||
|
@ -54,20 +50,9 @@ static DISPATCH_PROC(ProcBigReqDispatch);
|
||||||
void
|
void
|
||||||
BigReqExtensionInit(INITARGS)
|
BigReqExtensionInit(INITARGS)
|
||||||
{
|
{
|
||||||
#if 0
|
AddExtension(XBigReqExtensionName, 0, 0,
|
||||||
ExtensionEntry *extEntry;
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension(XBigReqExtensionName, 0, 0,
|
|
||||||
ProcBigReqDispatch, ProcBigReqDispatch,
|
|
||||||
BigReqResetProc, StandardMinorOpcode)) != 0)
|
|
||||||
XBigReqCode = (unsigned char)extEntry->base;
|
|
||||||
#else
|
|
||||||
(void) AddExtension(XBigReqExtensionName, 0, 0,
|
|
||||||
ProcBigReqDispatch, ProcBigReqDispatch,
|
ProcBigReqDispatch, ProcBigReqDispatch,
|
||||||
BigReqResetProc, StandardMinorOpcode);
|
BigReqResetProc, StandardMinorOpcode);
|
||||||
#endif
|
|
||||||
|
|
||||||
DeclareExtensionSecurity(XBigReqExtensionName, TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
|
|
29
Xext/cup.c
29
Xext/cup.c
|
@ -51,11 +51,6 @@ static int ProcDispatch(ClientPtr client);
|
||||||
static int SProcDispatch(ClientPtr client);
|
static int SProcDispatch(ClientPtr client);
|
||||||
static void ResetProc(ExtensionEntry* extEntry);
|
static void ResetProc(ExtensionEntry* extEntry);
|
||||||
|
|
||||||
#if 0
|
|
||||||
static unsigned char ReqCode = 0;
|
|
||||||
static int ErrorBase;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(WIN32) || defined(TESTWIN32)
|
#if defined(WIN32) || defined(TESTWIN32)
|
||||||
#define HAVE_SPECIAL_DESKTOP_COLORS
|
#define HAVE_SPECIAL_DESKTOP_COLORS
|
||||||
#endif
|
#endif
|
||||||
|
@ -128,20 +123,6 @@ static xColorItem citems[] = {
|
||||||
void
|
void
|
||||||
XcupExtensionInit (INITARGS)
|
XcupExtensionInit (INITARGS)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
ExtensionEntry* extEntry;
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension (XCUPNAME,
|
|
||||||
0,
|
|
||||||
XcupNumberErrors,
|
|
||||||
ProcDispatch,
|
|
||||||
SProcDispatch,
|
|
||||||
ResetProc,
|
|
||||||
StandardMinorOpcode))) {
|
|
||||||
ReqCode = (unsigned char)extEntry->base;
|
|
||||||
ErrorBase = extEntry->errorBase;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
(void) AddExtension (XCUPNAME,
|
(void) AddExtension (XCUPNAME,
|
||||||
0,
|
0,
|
||||||
XcupNumberErrors,
|
XcupNumberErrors,
|
||||||
|
@ -149,7 +130,6 @@ XcupExtensionInit (INITARGS)
|
||||||
SProcDispatch,
|
SProcDispatch,
|
||||||
ResetProc,
|
ResetProc,
|
||||||
StandardMinorOpcode);
|
StandardMinorOpcode);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* PC servers initialize the desktop colors (citems) here! */
|
/* PC servers initialize the desktop colors (citems) here! */
|
||||||
}
|
}
|
||||||
|
@ -224,12 +204,13 @@ int ProcStoreColors(
|
||||||
{
|
{
|
||||||
REQUEST (xXcupStoreColorsReq);
|
REQUEST (xXcupStoreColorsReq);
|
||||||
ColormapPtr pcmp;
|
ColormapPtr pcmp;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE (xXcupStoreColorsReq);
|
REQUEST_AT_LEAST_SIZE (xXcupStoreColorsReq);
|
||||||
pcmp = (ColormapPtr) SecurityLookupIDByType (client, stuff->cmap,
|
rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP,
|
||||||
RT_COLORMAP, DixWriteAccess);
|
client, DixAddAccess);
|
||||||
|
|
||||||
if (pcmp) {
|
if (rc == Success) {
|
||||||
int ncolors, n;
|
int ncolors, n;
|
||||||
xXcupStoreColorsReply rep;
|
xXcupStoreColorsReply rep;
|
||||||
xColorItem* cptr;
|
xColorItem* cptr;
|
||||||
|
@ -273,7 +254,7 @@ int ProcStoreColors(
|
||||||
return client->noClientException;
|
return client->noClientException;
|
||||||
} else {
|
} else {
|
||||||
client->errorValue = stuff->cmap;
|
client->errorValue = stuff->cmap;
|
||||||
return BadColor;
|
return (rc == BadValue) ? BadColor : rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
18
Xext/dpms.c
18
Xext/dpms.c
|
@ -50,9 +50,6 @@ Equipment Corporation.
|
||||||
#include "dpmsproc.h"
|
#include "dpmsproc.h"
|
||||||
#include "modinit.h"
|
#include "modinit.h"
|
||||||
|
|
||||||
#if 0
|
|
||||||
static unsigned char DPMSCode;
|
|
||||||
#endif
|
|
||||||
static DISPATCH_PROC(ProcDPMSDispatch);
|
static DISPATCH_PROC(ProcDPMSDispatch);
|
||||||
static DISPATCH_PROC(SProcDPMSDispatch);
|
static DISPATCH_PROC(SProcDPMSDispatch);
|
||||||
static DISPATCH_PROC(ProcDPMSGetVersion);
|
static DISPATCH_PROC(ProcDPMSGetVersion);
|
||||||
|
@ -76,18 +73,9 @@ static void DPMSResetProc(ExtensionEntry* extEntry);
|
||||||
void
|
void
|
||||||
DPMSExtensionInit(INITARGS)
|
DPMSExtensionInit(INITARGS)
|
||||||
{
|
{
|
||||||
#if 0
|
AddExtension(DPMSExtensionName, 0, 0,
|
||||||
ExtensionEntry *extEntry;
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension(DPMSExtensionName, 0, 0,
|
|
||||||
ProcDPMSDispatch, SProcDPMSDispatch,
|
|
||||||
DPMSResetProc, StandardMinorOpcode)))
|
|
||||||
DPMSCode = (unsigned char)extEntry->base;
|
|
||||||
#else
|
|
||||||
(void) AddExtension(DPMSExtensionName, 0, 0,
|
|
||||||
ProcDPMSDispatch, SProcDPMSDispatch,
|
ProcDPMSDispatch, SProcDPMSDispatch,
|
||||||
DPMSResetProc, StandardMinorOpcode);
|
DPMSResetProc, StandardMinorOpcode);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
|
@ -218,7 +206,7 @@ ProcDPMSDisable(client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSDisableReq);
|
REQUEST_SIZE_MATCH(xDPMSDisableReq);
|
||||||
|
|
||||||
DPMSSet(DPMSModeOn);
|
DPMSSet(client, DPMSModeOn);
|
||||||
|
|
||||||
DPMSEnabled = FALSE;
|
DPMSEnabled = FALSE;
|
||||||
|
|
||||||
|
@ -253,7 +241,7 @@ ProcDPMSForceLevel(client)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPMSSet(stuff->level);
|
DPMSSet(client, stuff->level);
|
||||||
|
|
||||||
return(client->noClientException);
|
return(client->noClientException);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,9 @@
|
||||||
#ifndef _DPMSPROC_H_
|
#ifndef _DPMSPROC_H_
|
||||||
#define _DPMSPROC_H_
|
#define _DPMSPROC_H_
|
||||||
|
|
||||||
void DPMSSet(int level);
|
#include "dixstruct.h"
|
||||||
|
|
||||||
|
int DPMSSet(ClientPtr client, int level);
|
||||||
int DPMSGet(int *plevel);
|
int DPMSGet(int *plevel);
|
||||||
Bool DPMSSupported(void);
|
Bool DPMSSupported(void);
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,6 @@ Equipment Corporation.
|
||||||
|
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
|
|
||||||
typedef int Bool;
|
|
||||||
|
|
||||||
#ifdef HAVE_DIX_CONFIG_H
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -46,7 +44,7 @@ int DPMSGet(int *plevel)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DPMSSet(int level)
|
int DPMSSet(ClientPtr client, int level)
|
||||||
{
|
{
|
||||||
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,10 +67,6 @@ static DISPATCH_PROC(SProcFontCacheGetCacheStatistics);
|
||||||
static DISPATCH_PROC(SProcFontCacheQueryVersion);
|
static DISPATCH_PROC(SProcFontCacheQueryVersion);
|
||||||
static DISPATCH_PROC(SProcFontCacheChangeCacheSettings);
|
static DISPATCH_PROC(SProcFontCacheChangeCacheSettings);
|
||||||
|
|
||||||
#if 0
|
|
||||||
static unsigned char FontCacheReqCode = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
FontCacheExtensionInit(INITARGS)
|
FontCacheExtensionInit(INITARGS)
|
||||||
{
|
{
|
||||||
|
@ -84,9 +80,6 @@ FontCacheExtensionInit(INITARGS)
|
||||||
SProcFontCacheDispatch,
|
SProcFontCacheDispatch,
|
||||||
FontCacheResetProc,
|
FontCacheResetProc,
|
||||||
StandardMinorOpcode))) {
|
StandardMinorOpcode))) {
|
||||||
#if 0
|
|
||||||
FontCacheReqCode = (unsigned char)extEntry->base;
|
|
||||||
#endif
|
|
||||||
miscErrorBase = extEntry->errorBase;
|
miscErrorBase = extEntry->errorBase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
18
Xext/geext.c
18
Xext/geext.c
|
@ -38,7 +38,7 @@ from the author.
|
||||||
|
|
||||||
int GEEventBase;
|
int GEEventBase;
|
||||||
int GEErrorBase;
|
int GEErrorBase;
|
||||||
int GEClientPrivateIndex;
|
DevPrivateKey GEClientPrivateKey = &GEClientPrivateKey;
|
||||||
int GEEventType; /* The opcode for all GenericEvents will have. */
|
int GEEventType; /* The opcode for all GenericEvents will have. */
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,7 +96,6 @@ static int ProcGEQueryVersion(ClientPtr client)
|
||||||
swaps(&rep.minorVersion, n);
|
swaps(&rep.minorVersion, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xGEQueryVersionReply), (char*)&rep);
|
WriteToClient(client, sizeof(xGEQueryVersionReply), (char*)&rep);
|
||||||
return(client->noClientException);
|
return(client->noClientException);
|
||||||
}
|
}
|
||||||
|
@ -166,6 +165,12 @@ static void GEClientCallback(CallbackListPtr *list,
|
||||||
ClientPtr pClient = clientinfo->client;
|
ClientPtr pClient = clientinfo->client;
|
||||||
GEClientInfoPtr pGEClient = GEGetClient(pClient);
|
GEClientInfoPtr pGEClient = GEGetClient(pClient);
|
||||||
|
|
||||||
|
if (pGEClient == NULL)
|
||||||
|
{
|
||||||
|
pGEClient = xcalloc(1, sizeof(GEClientInfoRec));
|
||||||
|
dixSetPrivate(&pClient->devPrivates, GEClientPrivateKey, pGEClient);
|
||||||
|
}
|
||||||
|
|
||||||
pGEClient->major_version = 0;
|
pGEClient->major_version = 0;
|
||||||
pGEClient->minor_version = 0;
|
pGEClient->minor_version = 0;
|
||||||
}
|
}
|
||||||
|
@ -205,13 +210,6 @@ GEExtensionInit(void)
|
||||||
{
|
{
|
||||||
ExtensionEntry *extEntry;
|
ExtensionEntry *extEntry;
|
||||||
|
|
||||||
GEClientPrivateIndex = AllocateClientPrivateIndex();
|
|
||||||
if (!AllocateClientPrivate(GEClientPrivateIndex,
|
|
||||||
sizeof(GenericMaskRec)))
|
|
||||||
{
|
|
||||||
FatalError("GEExtensionInit: Alloc client private failed.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!AddCallback(&ClientStateCallback, GEClientCallback, 0))
|
if(!AddCallback(&ClientStateCallback, GEClientCallback, 0))
|
||||||
{
|
{
|
||||||
FatalError("GEExtensionInit: register client callback failed.\n");
|
FatalError("GEExtensionInit: register client callback failed.\n");
|
||||||
|
@ -228,7 +226,7 @@ GEExtensionInit(void)
|
||||||
|
|
||||||
memset(GEExtensions, 0, sizeof(GEExtensions));
|
memset(GEExtensions, 0, sizeof(GEExtensions));
|
||||||
|
|
||||||
EventSwapVector[X_GenericEvent] = (EventSwapPtr) SGEGenericEvent;
|
EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent;
|
||||||
} else {
|
} else {
|
||||||
FatalError("GEInit: AddExtensions failed.\n");
|
FatalError("GEInit: AddExtensions failed.\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,14 +45,14 @@ from the author.
|
||||||
extern int GEEventType;
|
extern int GEEventType;
|
||||||
extern int GEEventBase;
|
extern int GEEventBase;
|
||||||
extern int GEErrorBase;
|
extern int GEErrorBase;
|
||||||
extern int GEClientPrivateIndex;
|
extern DevPrivateKey GEClientPrivateKey;
|
||||||
|
|
||||||
typedef struct _GEClientInfo {
|
typedef struct _GEClientInfo {
|
||||||
CARD32 major_version;
|
CARD32 major_version;
|
||||||
CARD32 minor_version;
|
CARD32 minor_version;
|
||||||
} GEClientInfoRec, *GEClientInfoPtr;
|
} GEClientInfoRec, *GEClientInfoPtr;
|
||||||
|
|
||||||
#define GEGetClient(pClient) ((GEClientInfoPtr) (pClient)->devPrivates[GEClientPrivateIndex].ptr)
|
#define GEGetClient(pClient) ((GEClientInfoPtr)(dixLookupPrivate(&((pClient)->devPrivates), GEClientPrivateKey)))
|
||||||
|
|
||||||
extern int (*ProcGEVector[/*GENumRequests*/])(ClientPtr);
|
extern int (*ProcGEVector[/*GENumRequests*/])(ClientPtr);
|
||||||
extern int (*SProcGEVector[/*GENumRequests*/])(ClientPtr);
|
extern int (*SProcGEVector[/*GENumRequests*/])(ClientPtr);
|
||||||
|
|
|
@ -59,9 +59,6 @@ in this Software without prior written authorization from The Open Group.
|
||||||
|
|
||||||
#define ValidEventMasks (ExposureMask|MultibufferClobberNotifyMask|MultibufferUpdateNotifyMask)
|
#define ValidEventMasks (ExposureMask|MultibufferClobberNotifyMask|MultibufferUpdateNotifyMask)
|
||||||
|
|
||||||
#if 0
|
|
||||||
static unsigned char MultibufferReqCode;
|
|
||||||
#endif
|
|
||||||
static int MultibufferEventBase;
|
static int MultibufferEventBase;
|
||||||
static int MultibufferErrorBase;
|
static int MultibufferErrorBase;
|
||||||
int MultibufferScreenIndex = -1;
|
int MultibufferScreenIndex = -1;
|
||||||
|
@ -235,7 +232,7 @@ MultibufferExtensionInit()
|
||||||
* create the resource types
|
* create the resource types
|
||||||
*/
|
*/
|
||||||
MultibufferDrawableResType =
|
MultibufferDrawableResType =
|
||||||
CreateNewResourceType(MultibufferDrawableDelete)|RC_CACHED|RC_DRAWABLE;
|
CreateNewResourceType(MultibufferDrawableDelete)|RC_DRAWABLE;
|
||||||
MultibufferResType = CreateNewResourceType(MultibufferDelete);
|
MultibufferResType = CreateNewResourceType(MultibufferDelete);
|
||||||
MultibuffersResType = CreateNewResourceType(MultibuffersDelete);
|
MultibuffersResType = CreateNewResourceType(MultibuffersDelete);
|
||||||
OtherClientResType = CreateNewResourceType(OtherClientDelete);
|
OtherClientResType = CreateNewResourceType(OtherClientDelete);
|
||||||
|
@ -247,9 +244,6 @@ MultibufferExtensionInit()
|
||||||
ProcMultibufferDispatch, SProcMultibufferDispatch,
|
ProcMultibufferDispatch, SProcMultibufferDispatch,
|
||||||
MultibufferResetProc, StandardMinorOpcode)))
|
MultibufferResetProc, StandardMinorOpcode)))
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
MultibufferReqCode = (unsigned char)extEntry->base;
|
|
||||||
#endif
|
|
||||||
MultibufferEventBase = extEntry->eventBase;
|
MultibufferEventBase = extEntry->eventBase;
|
||||||
MultibufferErrorBase = extEntry->errorBase;
|
MultibufferErrorBase = extEntry->errorBase;
|
||||||
EventSwapVector[MultibufferEventBase + MultibufferClobberNotify] = (EventSwapPtr) SClobberNotifyEvent;
|
EventSwapVector[MultibufferEventBase + MultibufferClobberNotify] = (EventSwapPtr) SClobberNotifyEvent;
|
||||||
|
|
|
@ -42,10 +42,6 @@ in this Software without prior written authorization from The Open Group.
|
||||||
#include <X11/extensions/mitmiscstr.h>
|
#include <X11/extensions/mitmiscstr.h>
|
||||||
#include "modinit.h"
|
#include "modinit.h"
|
||||||
|
|
||||||
#if 0
|
|
||||||
static unsigned char MITReqCode;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void MITResetProc(
|
static void MITResetProc(
|
||||||
ExtensionEntry * /* extEntry */
|
ExtensionEntry * /* extEntry */
|
||||||
);
|
);
|
||||||
|
@ -60,18 +56,9 @@ static DISPATCH_PROC(SProcMITSetBugMode);
|
||||||
void
|
void
|
||||||
MITMiscExtensionInit(INITARGS)
|
MITMiscExtensionInit(INITARGS)
|
||||||
{
|
{
|
||||||
#if 0
|
AddExtension(MITMISCNAME, 0, 0,
|
||||||
ExtensionEntry *extEntry;
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension(MITMISCNAME, 0, 0,
|
|
||||||
ProcMITDispatch, SProcMITDispatch,
|
|
||||||
MITResetProc, StandardMinorOpcode)) != 0)
|
|
||||||
MITReqCode = (unsigned char)extEntry->base;
|
|
||||||
#else
|
|
||||||
(void) AddExtension(MITMISCNAME, 0, 0,
|
|
||||||
ProcMITDispatch, SProcMITDispatch,
|
ProcMITDispatch, SProcMITDispatch,
|
||||||
MITResetProc, StandardMinorOpcode);
|
MITResetProc, StandardMinorOpcode);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
|
|
|
@ -65,9 +65,6 @@ extern VisualPtr glxMatchVisual(ScreenPtr pScreen,
|
||||||
ScreenPtr pMatchScreen);
|
ScreenPtr pMatchScreen);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
|
||||||
static unsigned char PanoramiXReqCode = 0;
|
|
||||||
#endif
|
|
||||||
/*
|
/*
|
||||||
* PanoramiX data declarations
|
* PanoramiX data declarations
|
||||||
*/
|
*/
|
||||||
|
@ -110,8 +107,8 @@ static void PanoramiXResetProc(ExtensionEntry*);
|
||||||
|
|
||||||
int (* SavedProcVector[256]) (ClientPtr client) = { NULL, };
|
int (* SavedProcVector[256]) (ClientPtr client) = { NULL, };
|
||||||
|
|
||||||
static int PanoramiXGCIndex = -1;
|
static DevPrivateKey PanoramiXGCKey = &PanoramiXGCKey;
|
||||||
static int PanoramiXScreenIndex = -1;
|
static DevPrivateKey PanoramiXScreenKey = &PanoramiXScreenKey;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
DDXPointRec clipOrg;
|
DDXPointRec clipOrg;
|
||||||
|
@ -140,8 +137,8 @@ static GCFuncs XineramaGCFuncs = {
|
||||||
};
|
};
|
||||||
|
|
||||||
#define Xinerama_GC_FUNC_PROLOGUE(pGC)\
|
#define Xinerama_GC_FUNC_PROLOGUE(pGC)\
|
||||||
PanoramiXGCPtr pGCPriv = \
|
PanoramiXGCPtr pGCPriv = (PanoramiXGCPtr) \
|
||||||
(PanoramiXGCPtr) (pGC)->devPrivates[PanoramiXGCIndex].ptr;\
|
dixLookupPrivate(&(pGC)->devPrivates, PanoramiXGCKey); \
|
||||||
(pGC)->funcs = pGCPriv->wrapFuncs;
|
(pGC)->funcs = pGCPriv->wrapFuncs;
|
||||||
|
|
||||||
#define Xinerama_GC_FUNC_EPILOGUE(pGC)\
|
#define Xinerama_GC_FUNC_EPILOGUE(pGC)\
|
||||||
|
@ -152,8 +149,8 @@ static GCFuncs XineramaGCFuncs = {
|
||||||
static Bool
|
static Bool
|
||||||
XineramaCloseScreen (int i, ScreenPtr pScreen)
|
XineramaCloseScreen (int i, ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
PanoramiXScreenPtr pScreenPriv =
|
PanoramiXScreenPtr pScreenPriv = (PanoramiXScreenPtr)
|
||||||
(PanoramiXScreenPtr) pScreen->devPrivates[PanoramiXScreenIndex].ptr;
|
dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey);
|
||||||
|
|
||||||
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
||||||
pScreen->CreateGC = pScreenPriv->CreateGC;
|
pScreen->CreateGC = pScreenPriv->CreateGC;
|
||||||
|
@ -171,14 +168,14 @@ static Bool
|
||||||
XineramaCreateGC(GCPtr pGC)
|
XineramaCreateGC(GCPtr pGC)
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = pGC->pScreen;
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
PanoramiXScreenPtr pScreenPriv =
|
PanoramiXScreenPtr pScreenPriv = (PanoramiXScreenPtr)
|
||||||
(PanoramiXScreenPtr) pScreen->devPrivates[PanoramiXScreenIndex].ptr;
|
dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey);
|
||||||
Bool ret;
|
Bool ret;
|
||||||
|
|
||||||
pScreen->CreateGC = pScreenPriv->CreateGC;
|
pScreen->CreateGC = pScreenPriv->CreateGC;
|
||||||
if((ret = (*pScreen->CreateGC)(pGC))) {
|
if((ret = (*pScreen->CreateGC)(pGC))) {
|
||||||
PanoramiXGCPtr pGCPriv =
|
PanoramiXGCPtr pGCPriv = (PanoramiXGCPtr)
|
||||||
(PanoramiXGCPtr) pGC->devPrivates[PanoramiXGCIndex].ptr;
|
dixLookupPrivate(&pGC->devPrivates, PanoramiXGCKey);
|
||||||
|
|
||||||
pGCPriv->wrapFuncs = pGC->funcs;
|
pGCPriv->wrapFuncs = pGC->funcs;
|
||||||
pGC->funcs = &XineramaGCFuncs;
|
pGC->funcs = &XineramaGCFuncs;
|
||||||
|
@ -284,8 +281,8 @@ XineramaCopyGC (
|
||||||
unsigned long mask,
|
unsigned long mask,
|
||||||
GCPtr pGCDst
|
GCPtr pGCDst
|
||||||
){
|
){
|
||||||
PanoramiXGCPtr pSrcPriv =
|
PanoramiXGCPtr pSrcPriv = (PanoramiXGCPtr)
|
||||||
(PanoramiXGCPtr) pGCSrc->devPrivates[PanoramiXGCIndex].ptr;
|
dixLookupPrivate(&pGCSrc->devPrivates, PanoramiXGCKey);
|
||||||
Xinerama_GC_FUNC_PROLOGUE (pGCDst);
|
Xinerama_GC_FUNC_PROLOGUE (pGCDst);
|
||||||
|
|
||||||
if(mask & GCTileStipXOrigin)
|
if(mask & GCTileStipXOrigin)
|
||||||
|
@ -471,10 +468,6 @@ void PanoramiXExtensionInit(int argc, char *argv[])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
PanoramiXReqCode = (unsigned char)extEntry->base;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* First make sure all the basic allocations succeed. If not,
|
* First make sure all the basic allocations succeed. If not,
|
||||||
* run in non-PanoramiXeen mode.
|
* run in non-PanoramiXeen mode.
|
||||||
|
@ -484,20 +477,17 @@ void PanoramiXExtensionInit(int argc, char *argv[])
|
||||||
xcalloc(PanoramiXNumScreens, sizeof(PanoramiXData));
|
xcalloc(PanoramiXNumScreens, sizeof(PanoramiXData));
|
||||||
|
|
||||||
BREAK_IF(!panoramiXdataPtr);
|
BREAK_IF(!panoramiXdataPtr);
|
||||||
BREAK_IF((PanoramiXGCIndex = AllocateGCPrivateIndex()) < 0);
|
|
||||||
BREAK_IF((PanoramiXScreenIndex = AllocateScreenPrivateIndex()) < 0);
|
|
||||||
|
|
||||||
for (i = 0; i < PanoramiXNumScreens; i++) {
|
if (!dixRequestPrivate(PanoramiXGCKey, sizeof(PanoramiXGCRec))) {
|
||||||
pScreen = screenInfo.screens[i];
|
|
||||||
if(!AllocateGCPrivate(pScreen, PanoramiXGCIndex,
|
|
||||||
sizeof(PanoramiXGCRec))) {
|
|
||||||
noPanoramiXExtension = TRUE;
|
noPanoramiXExtension = TRUE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < PanoramiXNumScreens; i++) {
|
||||||
|
pScreen = screenInfo.screens[i];
|
||||||
pScreenPriv = xalloc(sizeof(PanoramiXScreenRec));
|
pScreenPriv = xalloc(sizeof(PanoramiXScreenRec));
|
||||||
pScreen->devPrivates[PanoramiXScreenIndex].ptr =
|
dixSetPrivate(&pScreen->devPrivates, PanoramiXScreenKey,
|
||||||
(pointer)pScreenPriv;
|
pScreenPriv);
|
||||||
if(!pScreenPriv) {
|
if(!pScreenPriv) {
|
||||||
noPanoramiXExtension = TRUE;
|
noPanoramiXExtension = TRUE;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -41,10 +41,6 @@ Equipment Corporation.
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "pixmapstr.h"
|
#include "pixmapstr.h"
|
||||||
#if 0
|
|
||||||
#include <sys/workstation.h>
|
|
||||||
#include <X11/Xserver/ws.h>
|
|
||||||
#endif
|
|
||||||
#include "panoramiX.h"
|
#include "panoramiX.h"
|
||||||
#include <X11/extensions/panoramiXproto.h>
|
#include <X11/extensions/panoramiXproto.h>
|
||||||
#include "panoramiXsrv.h"
|
#include "panoramiXsrv.h"
|
||||||
|
@ -70,6 +66,7 @@ SProcPanoramiXGetState(ClientPtr client)
|
||||||
|
|
||||||
swaps (&stuff->length, n);
|
swaps (&stuff->length, n);
|
||||||
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
|
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
|
||||||
|
swapl (&stuff->window, n);
|
||||||
return ProcPanoramiXGetState(client);
|
return ProcPanoramiXGetState(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,6 +78,7 @@ SProcPanoramiXGetScreenCount(ClientPtr client)
|
||||||
|
|
||||||
swaps (&stuff->length, n);
|
swaps (&stuff->length, n);
|
||||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
||||||
|
swapl (&stuff->window, n);
|
||||||
return ProcPanoramiXGetScreenCount(client);
|
return ProcPanoramiXGetScreenCount(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +90,8 @@ SProcPanoramiXGetScreenSize(ClientPtr client)
|
||||||
|
|
||||||
swaps (&stuff->length, n);
|
swaps (&stuff->length, n);
|
||||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
||||||
|
swapl (&stuff->window, n);
|
||||||
|
swapl (&stuff->screen, n);
|
||||||
return ProcPanoramiXGetScreenSize(client);
|
return ProcPanoramiXGetScreenSize(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,16 +54,6 @@ Equipment Corporation.
|
||||||
#define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \
|
#define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \
|
||||||
CWDontPropagate | CWOverrideRedirect | CWCursor )
|
CWDontPropagate | CWOverrideRedirect | CWCursor )
|
||||||
|
|
||||||
#if 0
|
|
||||||
extern void (* EventSwapVector[128]) (fsError *, fsError *);
|
|
||||||
|
|
||||||
extern void Swap32Write();
|
|
||||||
extern void SLHostsExtend();
|
|
||||||
extern void SQColorsExtend();
|
|
||||||
WriteSConnectionInfo();
|
|
||||||
extern void WriteSConnSetupPrefix();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Various of the DIX function interfaces were not designed to allow
|
/* Various of the DIX function interfaces were not designed to allow
|
||||||
* the client->errorValue to be set on BadValue and other errors.
|
* the client->errorValue to be set on BadValue and other errors.
|
||||||
* Rather than changing interfaces and breaking untold code we introduce
|
* Rather than changing interfaces and breaking untold code we introduce
|
||||||
|
@ -1049,8 +1039,7 @@ int PanoramiXCopyArea(ClientPtr client)
|
||||||
|
|
||||||
FOR_NSCREENS_BACKWARD(j) {
|
FOR_NSCREENS_BACKWARD(j) {
|
||||||
stuff->gc = gc->info[j].id;
|
stuff->gc = gc->info[j].id;
|
||||||
VALIDATE_DRAWABLE_AND_GC(dst->info[j].id, pDst, pGC, client);
|
VALIDATE_DRAWABLE_AND_GC(dst->info[j].id, pDst, DixWriteAccess);
|
||||||
|
|
||||||
if(drawables[0]->depth != pDst->depth) {
|
if(drawables[0]->depth != pDst->depth) {
|
||||||
client->errorValue = stuff->dstDrawable;
|
client->errorValue = stuff->dstDrawable;
|
||||||
xfree(data);
|
xfree(data);
|
||||||
|
@ -1086,7 +1075,8 @@ int PanoramiXCopyArea(ClientPtr client)
|
||||||
stuff->dstY = dsty - panoramiXdataPtr[j].y;
|
stuff->dstY = dsty - panoramiXdataPtr[j].y;
|
||||||
}
|
}
|
||||||
|
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client);
|
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, DixWriteAccess);
|
||||||
|
|
||||||
if (stuff->dstDrawable != stuff->srcDrawable) {
|
if (stuff->dstDrawable != stuff->srcDrawable) {
|
||||||
rc = dixLookupDrawable(&pSrc, stuff->srcDrawable, client, 0,
|
rc = dixLookupDrawable(&pSrc, stuff->srcDrawable, client, 0,
|
||||||
DixReadAccess);
|
DixReadAccess);
|
||||||
|
@ -1195,7 +1185,7 @@ int PanoramiXCopyPlane(ClientPtr client)
|
||||||
stuff->dstY = dsty - panoramiXdataPtr[j].y;
|
stuff->dstY = dsty - panoramiXdataPtr[j].y;
|
||||||
}
|
}
|
||||||
|
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client);
|
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, DixWriteAccess);
|
||||||
if (stuff->dstDrawable != stuff->srcDrawable) {
|
if (stuff->dstDrawable != stuff->srcDrawable) {
|
||||||
rc = dixLookupDrawable(&psrcDraw, stuff->srcDrawable, client, 0,
|
rc = dixLookupDrawable(&psrcDraw, stuff->srcDrawable, client, 0,
|
||||||
DixReadAccess);
|
DixReadAccess);
|
||||||
|
|
72
Xext/saver.c
72
Xext/saver.c
|
@ -48,6 +48,7 @@ in this Software without prior written authorization from the X Consortium.
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "cursorstr.h"
|
#include "cursorstr.h"
|
||||||
#include "colormapst.h"
|
#include "colormapst.h"
|
||||||
|
#include "xace.h"
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
#include "panoramiX.h"
|
#include "panoramiX.h"
|
||||||
#include "panoramiXsrv.h"
|
#include "panoramiXsrv.h"
|
||||||
|
@ -61,9 +62,6 @@ in this Software without prior written authorization from the X Consortium.
|
||||||
|
|
||||||
#include "modinit.h"
|
#include "modinit.h"
|
||||||
|
|
||||||
#if 0
|
|
||||||
static unsigned char ScreenSaverReqCode = 0;
|
|
||||||
#endif
|
|
||||||
static int ScreenSaverEventBase = 0;
|
static int ScreenSaverEventBase = 0;
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcScreenSaverQueryInfo);
|
static DISPATCH_PROC(ProcScreenSaverQueryInfo);
|
||||||
|
@ -234,10 +232,12 @@ MakeScreenPrivate (
|
||||||
ScreenPtr /* pScreen */
|
ScreenPtr /* pScreen */
|
||||||
);
|
);
|
||||||
|
|
||||||
static int ScreenPrivateIndex;
|
static DevPrivateKey ScreenPrivateKey = &ScreenPrivateKey;
|
||||||
|
|
||||||
#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr)(s)->devPrivates[ScreenPrivateIndex].ptr)
|
#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr) \
|
||||||
#define SetScreenPrivate(s,v) ((s)->devPrivates[ScreenPrivateIndex].ptr = (pointer) v);
|
dixLookupPrivate(&(s)->devPrivates, ScreenPrivateKey))
|
||||||
|
#define SetScreenPrivate(s,v) \
|
||||||
|
dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v);
|
||||||
#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = (s ? GetScreenPrivate(s) : NULL)
|
#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = (s ? GetScreenPrivate(s) : NULL)
|
||||||
|
|
||||||
#define New(t) ((t *) xalloc (sizeof (t)))
|
#define New(t) ((t *) xalloc (sizeof (t)))
|
||||||
|
@ -260,21 +260,17 @@ ScreenSaverExtensionInit(INITARGS)
|
||||||
AttrType = CreateNewResourceType(ScreenSaverFreeAttr);
|
AttrType = CreateNewResourceType(ScreenSaverFreeAttr);
|
||||||
EventType = CreateNewResourceType(ScreenSaverFreeEvents);
|
EventType = CreateNewResourceType(ScreenSaverFreeEvents);
|
||||||
SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend);
|
SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend);
|
||||||
ScreenPrivateIndex = AllocateScreenPrivateIndex ();
|
|
||||||
|
|
||||||
for (i = 0; i < screenInfo.numScreens; i++)
|
for (i = 0; i < screenInfo.numScreens; i++)
|
||||||
{
|
{
|
||||||
pScreen = screenInfo.screens[i];
|
pScreen = screenInfo.screens[i];
|
||||||
SetScreenPrivate (pScreen, NULL);
|
SetScreenPrivate (pScreen, NULL);
|
||||||
}
|
}
|
||||||
if (AttrType && EventType && SuspendType && ScreenPrivateIndex != -1 &&
|
if (AttrType && EventType && SuspendType &&
|
||||||
(extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
|
(extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
|
||||||
ProcScreenSaverDispatch, SProcScreenSaverDispatch,
|
ProcScreenSaverDispatch, SProcScreenSaverDispatch,
|
||||||
ScreenSaverResetProc, StandardMinorOpcode)))
|
ScreenSaverResetProc, StandardMinorOpcode)))
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
ScreenSaverReqCode = (unsigned char)extEntry->base;
|
|
||||||
#endif
|
|
||||||
ScreenSaverEventBase = extEntry->eventBase;
|
ScreenSaverEventBase = extEntry->eventBase;
|
||||||
EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent;
|
EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent;
|
||||||
}
|
}
|
||||||
|
@ -454,8 +450,8 @@ ScreenSaverFreeAttr (value, id)
|
||||||
pPriv->attr = NULL;
|
pPriv->attr = NULL;
|
||||||
if (pPriv->hasWindow)
|
if (pPriv->hasWindow)
|
||||||
{
|
{
|
||||||
SaveScreens (SCREEN_SAVER_FORCER, ScreenSaverReset);
|
dixSaveScreens (serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
|
||||||
SaveScreens (SCREEN_SAVER_FORCER, ScreenSaverActive);
|
dixSaveScreens (serverClient, SCREEN_SAVER_FORCER, ScreenSaverActive);
|
||||||
}
|
}
|
||||||
CheckScreenPrivate (pScreen);
|
CheckScreenPrivate (pScreen);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -788,7 +784,11 @@ ProcScreenSaverQueryInfo (client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH (xScreenSaverQueryInfoReq);
|
REQUEST_SIZE_MATCH (xScreenSaverQueryInfoReq);
|
||||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||||
DixUnknownAccess);
|
DixGetAttrAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen,
|
||||||
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
@ -857,9 +857,15 @@ ProcScreenSaverSelectInput (client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH (xScreenSaverSelectInputReq);
|
REQUEST_SIZE_MATCH (xScreenSaverSelectInputReq);
|
||||||
rc = dixLookupDrawable (&pDraw, stuff->drawable, client, 0,
|
rc = dixLookupDrawable (&pDraw, stuff->drawable, client, 0,
|
||||||
DixUnknownAccess);
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen,
|
||||||
|
DixSetAttrAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
if (!setEventMask (pDraw->pScreen, client, stuff->eventMask))
|
if (!setEventMask (pDraw->pScreen, client, stuff->eventMask))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
return Success;
|
return Success;
|
||||||
|
@ -893,12 +899,16 @@ ScreenSaverSetAttributes (ClientPtr client)
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq);
|
REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq);
|
||||||
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||||
DixUnknownAccess);
|
DixGetAttrAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
pScreen = pDraw->pScreen;
|
pScreen = pDraw->pScreen;
|
||||||
pParent = WindowTable[pScreen->myNum];
|
pParent = WindowTable[pScreen->myNum];
|
||||||
|
|
||||||
|
ret = XaceHook(XACE_SCREENSAVER_ACCESS, client, pScreen, DixSetAttrAccess);
|
||||||
|
if (ret != Success)
|
||||||
|
return ret;
|
||||||
|
|
||||||
len = stuff->length - (sizeof(xScreenSaverSetAttributesReq) >> 2);
|
len = stuff->length - (sizeof(xScreenSaverSetAttributesReq) >> 2);
|
||||||
if (Ones(stuff->mask) != len)
|
if (Ones(stuff->mask) != len)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
@ -1054,8 +1064,9 @@ ScreenSaverSetAttributes (ClientPtr client)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pPixmap = (PixmapPtr)LookupIDByType(pixID, RT_PIXMAP);
|
ret = dixLookupResource((pointer *)&pPixmap, pixID, RT_PIXMAP,
|
||||||
if (pPixmap != (PixmapPtr) NULL)
|
client, DixReadAccess);
|
||||||
|
if (ret == Success)
|
||||||
{
|
{
|
||||||
if ((pPixmap->drawable.depth != depth) ||
|
if ((pPixmap->drawable.depth != depth) ||
|
||||||
(pPixmap->drawable.pScreen != pScreen))
|
(pPixmap->drawable.pScreen != pScreen))
|
||||||
|
@ -1069,7 +1080,7 @@ ScreenSaverSetAttributes (ClientPtr client)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = BadPixmap;
|
ret = (ret == BadValue) ? BadPixmap : ret;
|
||||||
client->errorValue = pixID;
|
client->errorValue = pixID;
|
||||||
goto PatchUp;
|
goto PatchUp;
|
||||||
}
|
}
|
||||||
|
@ -1091,8 +1102,9 @@ ScreenSaverSetAttributes (ClientPtr client)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pPixmap = (PixmapPtr)LookupIDByType(pixID, RT_PIXMAP);
|
ret = dixLookupResource((pointer *)&pPixmap, pixID, RT_PIXMAP,
|
||||||
if (pPixmap)
|
client, DixReadAccess);
|
||||||
|
if (ret == Success)
|
||||||
{
|
{
|
||||||
if ((pPixmap->drawable.depth != depth) ||
|
if ((pPixmap->drawable.depth != depth) ||
|
||||||
(pPixmap->drawable.pScreen != pScreen))
|
(pPixmap->drawable.pScreen != pScreen))
|
||||||
|
@ -1106,7 +1118,7 @@ ScreenSaverSetAttributes (ClientPtr client)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = BadPixmap;
|
ret = (ret == BadValue) ? BadPixmap : ret;
|
||||||
client->errorValue = pixID;
|
client->errorValue = pixID;
|
||||||
goto PatchUp;
|
goto PatchUp;
|
||||||
}
|
}
|
||||||
|
@ -1184,10 +1196,11 @@ ScreenSaverSetAttributes (ClientPtr client)
|
||||||
break;
|
break;
|
||||||
case CWColormap:
|
case CWColormap:
|
||||||
cmap = (Colormap) *pVlist;
|
cmap = (Colormap) *pVlist;
|
||||||
pCmap = (ColormapPtr)LookupIDByType(cmap, RT_COLORMAP);
|
ret = dixLookupResource((pointer *)&pCmap, cmap, RT_COLORMAP,
|
||||||
if (!pCmap)
|
client, DixUseAccess);
|
||||||
|
if (ret != Success)
|
||||||
{
|
{
|
||||||
ret = BadColor;
|
ret = (ret == BadValue) ? BadColor : ret;
|
||||||
client->errorValue = cmap;
|
client->errorValue = cmap;
|
||||||
goto PatchUp;
|
goto PatchUp;
|
||||||
}
|
}
|
||||||
|
@ -1207,10 +1220,11 @@ ScreenSaverSetAttributes (ClientPtr client)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pCursor = (CursorPtr)LookupIDByType(cursorID, RT_CURSOR);
|
ret = dixLookupResource((pointer *)&pCursor, cursorID,
|
||||||
if (!pCursor)
|
RT_CURSOR, client, DixUseAccess);
|
||||||
|
if (ret != Success)
|
||||||
{
|
{
|
||||||
ret = BadCursor;
|
ret = (ret == BadValue) ? BadCursor : ret;
|
||||||
client->errorValue = cursorID;
|
client->errorValue = cursorID;
|
||||||
goto PatchUp;
|
goto PatchUp;
|
||||||
}
|
}
|
||||||
|
@ -1252,7 +1266,7 @@ ScreenSaverUnsetAttributes (ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH (xScreenSaverUnsetAttributesReq);
|
REQUEST_SIZE_MATCH (xScreenSaverUnsetAttributesReq);
|
||||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||||
DixUnknownAccess);
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
pPriv = GetScreenPrivate (pDraw->pScreen);
|
pPriv = GetScreenPrivate (pDraw->pScreen);
|
||||||
|
|
1422
Xext/security.c
1422
Xext/security.c
File diff suppressed because it is too large
Load Diff
|
@ -77,13 +77,7 @@ typedef struct {
|
||||||
Bool valid; /* did anyone recognize it? if so, set to TRUE */
|
Bool valid; /* did anyone recognize it? if so, set to TRUE */
|
||||||
} SecurityValidateGroupInfoRec;
|
} SecurityValidateGroupInfoRec;
|
||||||
|
|
||||||
extern int XSecurityOptions(int argc, char **argv, int i);
|
|
||||||
|
|
||||||
/* Give this value or higher to the -audit option to get security messages */
|
/* Give this value or higher to the -audit option to get security messages */
|
||||||
#define SECURITY_AUDIT_LEVEL 4
|
#define SECURITY_AUDIT_LEVEL 4
|
||||||
|
|
||||||
#define SECURITY_POLICY_FILE_VERSION "version-1"
|
|
||||||
|
|
||||||
extern char **SecurityGetSitePolicyStrings(int *n);
|
|
||||||
|
|
||||||
#endif /* _SECURITY_SRV_H */
|
#endif /* _SECURITY_SRV_H */
|
||||||
|
|
32
Xext/shape.c
32
Xext/shape.c
|
@ -111,9 +111,6 @@ static DISPATCH_PROC(SProcShapeSelectInput);
|
||||||
#include "panoramiXsrv.h"
|
#include "panoramiXsrv.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
|
||||||
static unsigned char ShapeReqCode = 0;
|
|
||||||
#endif
|
|
||||||
static int ShapeEventBase = 0;
|
static int ShapeEventBase = 0;
|
||||||
static RESTYPE ClientType, EventType; /* resource types for event masks */
|
static RESTYPE ClientType, EventType; /* resource types for event masks */
|
||||||
|
|
||||||
|
@ -154,9 +151,6 @@ ShapeExtensionInit(void)
|
||||||
ProcShapeDispatch, SProcShapeDispatch,
|
ProcShapeDispatch, SProcShapeDispatch,
|
||||||
ShapeResetProc, StandardMinorOpcode)))
|
ShapeResetProc, StandardMinorOpcode)))
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
ShapeReqCode = (unsigned char)extEntry->base;
|
|
||||||
#endif
|
|
||||||
ShapeEventBase = extEntry->eventBase;
|
ShapeEventBase = extEntry->eventBase;
|
||||||
EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
|
EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
|
||||||
}
|
}
|
||||||
|
@ -323,7 +317,7 @@ ProcShapeRectangles (client)
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
|
REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
|
||||||
UpdateCurrentTime();
|
UpdateCurrentTime();
|
||||||
rc = dixLookupWindow(&pWin, stuff->dest, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
switch (stuff->destKind) {
|
switch (stuff->destKind) {
|
||||||
|
@ -423,7 +417,7 @@ ProcShapeMask (client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH (xShapeMaskReq);
|
REQUEST_SIZE_MATCH (xShapeMaskReq);
|
||||||
UpdateCurrentTime();
|
UpdateCurrentTime();
|
||||||
rc = dixLookupWindow(&pWin, stuff->dest, client, DixWriteAccess);
|
rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
switch (stuff->destKind) {
|
switch (stuff->destKind) {
|
||||||
|
@ -444,10 +438,10 @@ ProcShapeMask (client)
|
||||||
if (stuff->src == None)
|
if (stuff->src == None)
|
||||||
srcRgn = 0;
|
srcRgn = 0;
|
||||||
else {
|
else {
|
||||||
pPixmap = (PixmapPtr) SecurityLookupIDByType(client, stuff->src,
|
rc = dixLookupResource((pointer *)&pPixmap, stuff->src, RT_PIXMAP,
|
||||||
RT_PIXMAP, DixReadAccess);
|
client, DixReadAccess);
|
||||||
if (!pPixmap)
|
if (rc != Success)
|
||||||
return BadPixmap;
|
return (rc == BadValue) ? BadPixmap : rc;
|
||||||
if (pPixmap->drawable.pScreen != pScreen ||
|
if (pPixmap->drawable.pScreen != pScreen ||
|
||||||
pPixmap->drawable.depth != 1)
|
pPixmap->drawable.depth != 1)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
@ -531,7 +525,7 @@ ProcShapeCombine (client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH (xShapeCombineReq);
|
REQUEST_SIZE_MATCH (xShapeCombineReq);
|
||||||
UpdateCurrentTime();
|
UpdateCurrentTime();
|
||||||
rc = dixLookupWindow(&pDestWin, stuff->dest, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pDestWin, stuff->dest, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
if (!pDestWin->optional)
|
if (!pDestWin->optional)
|
||||||
|
@ -552,7 +546,7 @@ ProcShapeCombine (client)
|
||||||
}
|
}
|
||||||
pScreen = pDestWin->drawable.pScreen;
|
pScreen = pDestWin->drawable.pScreen;
|
||||||
|
|
||||||
rc = dixLookupWindow(&pSrcWin, stuff->src, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pSrcWin, stuff->src, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
switch (stuff->srcKind) {
|
switch (stuff->srcKind) {
|
||||||
|
@ -651,7 +645,7 @@ ProcShapeOffset (client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH (xShapeOffsetReq);
|
REQUEST_SIZE_MATCH (xShapeOffsetReq);
|
||||||
UpdateCurrentTime();
|
UpdateCurrentTime();
|
||||||
rc = dixLookupWindow(&pWin, stuff->dest, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
switch (stuff->destKind) {
|
switch (stuff->destKind) {
|
||||||
|
@ -716,7 +710,7 @@ ProcShapeQueryExtents (client)
|
||||||
RegionPtr region;
|
RegionPtr region;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
|
REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
|
@ -826,7 +820,7 @@ ProcShapeSelectInput (client)
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH (xShapeSelectInputReq);
|
REQUEST_SIZE_MATCH (xShapeSelectInputReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
pHead = (ShapeEventPtr *)SecurityLookupIDByType(client,
|
pHead = (ShapeEventPtr *)SecurityLookupIDByType(client,
|
||||||
|
@ -999,7 +993,7 @@ ProcShapeInputSelected (client)
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
|
REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
pHead = (ShapeEventPtr *) SecurityLookupIDByType(client,
|
pHead = (ShapeEventPtr *) SecurityLookupIDByType(client,
|
||||||
|
@ -1041,7 +1035,7 @@ ProcShapeGetRectangles (client)
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
|
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
switch (stuff->kind) {
|
switch (stuff->kind) {
|
||||||
|
|
32
Xext/shm.c
32
Xext/shm.c
|
@ -58,6 +58,7 @@ in this Software without prior written authorization from The Open Group.
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "servermd.h"
|
#include "servermd.h"
|
||||||
#include "shmint.h"
|
#include "shmint.h"
|
||||||
|
#include "xace.h"
|
||||||
#define _XSHM_SERVER_
|
#define _XSHM_SERVER_
|
||||||
#include <X11/extensions/shmstr.h>
|
#include <X11/extensions/shmstr.h>
|
||||||
#include <X11/Xfuncproto.h>
|
#include <X11/Xfuncproto.h>
|
||||||
|
@ -146,7 +147,7 @@ static int pixmapFormat;
|
||||||
static int shmPixFormat[MAXSCREENS];
|
static int shmPixFormat[MAXSCREENS];
|
||||||
static ShmFuncsPtr shmFuncs[MAXSCREENS];
|
static ShmFuncsPtr shmFuncs[MAXSCREENS];
|
||||||
static DestroyPixmapProcPtr destroyPixmap[MAXSCREENS];
|
static DestroyPixmapProcPtr destroyPixmap[MAXSCREENS];
|
||||||
static int shmPixmapPrivate;
|
static DevPrivateKey shmPixmapPrivate = &shmPixmapPrivate;
|
||||||
static ShmFuncs miFuncs = {NULL, miShmPutImage};
|
static ShmFuncs miFuncs = {NULL, miShmPutImage};
|
||||||
static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage};
|
static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage};
|
||||||
|
|
||||||
|
@ -256,20 +257,11 @@ ShmExtensionInit(INITARGS)
|
||||||
if (!pixmapFormat)
|
if (!pixmapFormat)
|
||||||
pixmapFormat = ZPixmap;
|
pixmapFormat = ZPixmap;
|
||||||
if (sharedPixmaps)
|
if (sharedPixmaps)
|
||||||
{
|
|
||||||
for (i = 0; i < screenInfo.numScreens; i++)
|
for (i = 0; i < screenInfo.numScreens; i++)
|
||||||
{
|
{
|
||||||
destroyPixmap[i] = screenInfo.screens[i]->DestroyPixmap;
|
destroyPixmap[i] = screenInfo.screens[i]->DestroyPixmap;
|
||||||
screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
|
screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
|
||||||
}
|
}
|
||||||
shmPixmapPrivate = AllocatePixmapPrivateIndex();
|
|
||||||
for (i = 0; i < screenInfo.numScreens; i++)
|
|
||||||
{
|
|
||||||
if (!AllocatePixmapPrivate(screenInfo.screens[i],
|
|
||||||
shmPixmapPrivate, 0))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ShmSegType = CreateNewResourceType(ShmDetachSegment);
|
ShmSegType = CreateNewResourceType(ShmDetachSegment);
|
||||||
if (ShmSegType &&
|
if (ShmSegType &&
|
||||||
|
@ -322,7 +314,8 @@ ShmDestroyPixmap (PixmapPtr pPixmap)
|
||||||
if (pPixmap->refcnt == 1)
|
if (pPixmap->refcnt == 1)
|
||||||
{
|
{
|
||||||
ShmDescPtr shmdesc;
|
ShmDescPtr shmdesc;
|
||||||
shmdesc = (ShmDescPtr) pPixmap->devPrivates[shmPixmapPrivate].ptr;
|
shmdesc = (ShmDescPtr)dixLookupPrivate(&pPixmap->devPrivates,
|
||||||
|
shmPixmapPrivate);
|
||||||
if (shmdesc)
|
if (shmdesc)
|
||||||
ShmDetachSegment ((pointer) shmdesc, pPixmap->drawable.id);
|
ShmDetachSegment ((pointer) shmdesc, pPixmap->drawable.id);
|
||||||
}
|
}
|
||||||
|
@ -815,7 +808,7 @@ CreatePmap:
|
||||||
shmdesc->addr + stuff->offset);
|
shmdesc->addr + stuff->offset);
|
||||||
|
|
||||||
if (pMap) {
|
if (pMap) {
|
||||||
pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc;
|
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivate, shmdesc);
|
||||||
shmdesc->refcnt++;
|
shmdesc->refcnt++;
|
||||||
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||||
pMap->drawable.id = newPix->info[j].id;
|
pMap->drawable.id = newPix->info[j].id;
|
||||||
|
@ -855,7 +848,7 @@ ProcShmPutImage(client)
|
||||||
REQUEST(xShmPutImageReq);
|
REQUEST(xShmPutImageReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmPutImageReq);
|
REQUEST_SIZE_MATCH(xShmPutImageReq);
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||||
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
|
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
|
||||||
if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
|
if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
@ -968,7 +961,7 @@ ProcShmGetImage(client)
|
||||||
return(BadValue);
|
return(BadValue);
|
||||||
}
|
}
|
||||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||||
DixUnknownAccess);
|
DixReadAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
|
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
|
||||||
|
@ -1100,7 +1093,7 @@ ProcShmCreatePixmap(client)
|
||||||
return BadImplementation;
|
return BadImplementation;
|
||||||
LEGAL_NEW_RESOURCE(stuff->pid, client);
|
LEGAL_NEW_RESOURCE(stuff->pid, client);
|
||||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY,
|
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY,
|
||||||
DixUnknownAccess);
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
@ -1129,7 +1122,13 @@ CreatePmap:
|
||||||
shmdesc->addr + stuff->offset);
|
shmdesc->addr + stuff->offset);
|
||||||
if (pMap)
|
if (pMap)
|
||||||
{
|
{
|
||||||
pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc;
|
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, RT_PIXMAP,
|
||||||
|
pMap, RT_NONE, NULL, DixCreateAccess);
|
||||||
|
if (rc != Success) {
|
||||||
|
pDraw->pScreen->DestroyPixmap(pMap);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivate, shmdesc);
|
||||||
shmdesc->refcnt++;
|
shmdesc->refcnt++;
|
||||||
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||||
pMap->drawable.id = stuff->pid;
|
pMap->drawable.id = stuff->pid;
|
||||||
|
@ -1137,6 +1136,7 @@ CreatePmap:
|
||||||
{
|
{
|
||||||
return(client->noClientException);
|
return(client->noClientException);
|
||||||
}
|
}
|
||||||
|
pDraw->pScreen->DestroyPixmap(pMap);
|
||||||
}
|
}
|
||||||
return (BadAlloc);
|
return (BadAlloc);
|
||||||
}
|
}
|
||||||
|
|
16
Xext/sync.c
16
Xext/sync.c
|
@ -433,18 +433,18 @@ SyncInitTrigger(client, pTrigger, counter, changes)
|
||||||
Mask changes;
|
Mask changes;
|
||||||
{
|
{
|
||||||
SyncCounter *pCounter = pTrigger->pCounter;
|
SyncCounter *pCounter = pTrigger->pCounter;
|
||||||
int status;
|
int rc;
|
||||||
Bool newcounter = FALSE;
|
Bool newcounter = FALSE;
|
||||||
|
|
||||||
if (changes & XSyncCACounter)
|
if (changes & XSyncCACounter)
|
||||||
{
|
{
|
||||||
if (counter == None)
|
if (counter == None)
|
||||||
pCounter = NULL;
|
pCounter = NULL;
|
||||||
else if (!(pCounter = (SyncCounter *)SecurityLookupIDByType(
|
else if (Success != (rc = dixLookupResource((pointer *)&pCounter,
|
||||||
client, counter, RTCounter, DixReadAccess)))
|
counter, RTCounter, client, DixReadAccess)))
|
||||||
{
|
{
|
||||||
client->errorValue = counter;
|
client->errorValue = counter;
|
||||||
return SyncErrorBase + XSyncBadCounter;
|
return (rc == BadValue) ? SyncErrorBase + XSyncBadCounter : rc;
|
||||||
}
|
}
|
||||||
if (pCounter != pTrigger->pCounter)
|
if (pCounter != pTrigger->pCounter)
|
||||||
{ /* new counter for trigger */
|
{ /* new counter for trigger */
|
||||||
|
@ -526,8 +526,8 @@ SyncInitTrigger(client, pTrigger, counter, changes)
|
||||||
*/
|
*/
|
||||||
if (newcounter)
|
if (newcounter)
|
||||||
{
|
{
|
||||||
if ((status = SyncAddTriggerToCounter(pTrigger)) != Success)
|
if ((rc = SyncAddTriggerToCounter(pTrigger)) != Success)
|
||||||
return status;
|
return rc;
|
||||||
}
|
}
|
||||||
else if (IsSystemCounter(pCounter))
|
else if (IsSystemCounter(pCounter))
|
||||||
{
|
{
|
||||||
|
@ -1465,7 +1465,7 @@ ProcSyncSetPriority(client)
|
||||||
priorityclient = client;
|
priorityclient = client;
|
||||||
else {
|
else {
|
||||||
rc = dixLookupClient(&priorityclient, stuff->id, client,
|
rc = dixLookupClient(&priorityclient, stuff->id, client,
|
||||||
DixUnknownAccess);
|
DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -1502,7 +1502,7 @@ ProcSyncGetPriority(client)
|
||||||
priorityclient = client;
|
priorityclient = client;
|
||||||
else {
|
else {
|
||||||
rc = dixLookupClient(&priorityclient, stuff->id, client,
|
rc = dixLookupClient(&priorityclient, stuff->id, client,
|
||||||
DixUnknownAccess);
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
124
Xext/xace.c
124
Xext/xace.c
|
@ -22,9 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "windowstr.h"
|
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "gcstruct.h"
|
|
||||||
#include "xacestr.h"
|
#include "xacestr.h"
|
||||||
#include "modinit.h"
|
#include "modinit.h"
|
||||||
|
|
||||||
|
@ -81,95 +79,117 @@ int XaceHook(int hook, ...)
|
||||||
va_arg(ap, ClientPtr),
|
va_arg(ap, ClientPtr),
|
||||||
va_arg(ap, XID),
|
va_arg(ap, XID),
|
||||||
va_arg(ap, RESTYPE),
|
va_arg(ap, RESTYPE),
|
||||||
va_arg(ap, Mask),
|
|
||||||
va_arg(ap, pointer),
|
va_arg(ap, pointer),
|
||||||
TRUE /* default allow */
|
va_arg(ap, RESTYPE),
|
||||||
|
va_arg(ap, pointer),
|
||||||
|
va_arg(ap, Mask),
|
||||||
|
Success /* default allow */
|
||||||
};
|
};
|
||||||
calldata = &rec;
|
calldata = &rec;
|
||||||
prv = &rec.rval;
|
prv = &rec.status;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XACE_DEVICE_ACCESS: {
|
case XACE_DEVICE_ACCESS: {
|
||||||
XaceDeviceAccessRec rec = {
|
XaceDeviceAccessRec rec = {
|
||||||
va_arg(ap, ClientPtr),
|
va_arg(ap, ClientPtr),
|
||||||
va_arg(ap, DeviceIntPtr),
|
va_arg(ap, DeviceIntPtr),
|
||||||
va_arg(ap, Bool),
|
va_arg(ap, Mask),
|
||||||
TRUE /* default allow */
|
Success /* default allow */
|
||||||
};
|
};
|
||||||
calldata = &rec;
|
calldata = &rec;
|
||||||
prv = &rec.rval;
|
prv = &rec.status;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XACE_PROPERTY_ACCESS: {
|
case XACE_PROPERTY_ACCESS: {
|
||||||
XacePropertyAccessRec rec = {
|
XacePropertyAccessRec rec = {
|
||||||
va_arg(ap, ClientPtr),
|
va_arg(ap, ClientPtr),
|
||||||
va_arg(ap, WindowPtr),
|
va_arg(ap, WindowPtr),
|
||||||
va_arg(ap, Atom),
|
va_arg(ap, PropertyPtr),
|
||||||
va_arg(ap, Mask),
|
va_arg(ap, Mask),
|
||||||
XaceAllowOperation /* default allow */
|
Success /* default allow */
|
||||||
};
|
};
|
||||||
calldata = &rec;
|
calldata = &rec;
|
||||||
prv = &rec.rval;
|
prv = &rec.status;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XACE_DRAWABLE_ACCESS: {
|
case XACE_SEND_ACCESS: {
|
||||||
XaceDrawableAccessRec rec = {
|
XaceSendAccessRec rec = {
|
||||||
va_arg(ap, ClientPtr),
|
va_arg(ap, ClientPtr),
|
||||||
va_arg(ap, DrawablePtr),
|
va_arg(ap, DeviceIntPtr),
|
||||||
TRUE /* default allow */
|
va_arg(ap, WindowPtr),
|
||||||
|
va_arg(ap, xEventPtr),
|
||||||
|
va_arg(ap, int),
|
||||||
|
Success /* default allow */
|
||||||
};
|
};
|
||||||
calldata = &rec;
|
calldata = &rec;
|
||||||
prv = &rec.rval;
|
prv = &rec.status;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XACE_MAP_ACCESS:
|
case XACE_RECEIVE_ACCESS: {
|
||||||
case XACE_BACKGRND_ACCESS: {
|
XaceReceiveAccessRec rec = {
|
||||||
XaceMapAccessRec rec = {
|
|
||||||
va_arg(ap, ClientPtr),
|
va_arg(ap, ClientPtr),
|
||||||
va_arg(ap, WindowPtr),
|
va_arg(ap, WindowPtr),
|
||||||
TRUE /* default allow */
|
va_arg(ap, xEventPtr),
|
||||||
|
va_arg(ap, int),
|
||||||
|
Success /* default allow */
|
||||||
};
|
};
|
||||||
calldata = &rec;
|
calldata = &rec;
|
||||||
prv = &rec.rval;
|
prv = &rec.status;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case XACE_CLIENT_ACCESS: {
|
||||||
|
XaceClientAccessRec rec = {
|
||||||
|
va_arg(ap, ClientPtr),
|
||||||
|
va_arg(ap, ClientPtr),
|
||||||
|
va_arg(ap, Mask),
|
||||||
|
Success /* default allow */
|
||||||
|
};
|
||||||
|
calldata = &rec;
|
||||||
|
prv = &rec.status;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XACE_EXT_DISPATCH:
|
|
||||||
case XACE_EXT_ACCESS: {
|
case XACE_EXT_ACCESS: {
|
||||||
XaceExtAccessRec rec = {
|
XaceExtAccessRec rec = {
|
||||||
va_arg(ap, ClientPtr),
|
va_arg(ap, ClientPtr),
|
||||||
va_arg(ap, ExtensionEntry*),
|
va_arg(ap, ExtensionEntry*),
|
||||||
TRUE /* default allow */
|
DixGetAttrAccess,
|
||||||
|
Success /* default allow */
|
||||||
};
|
};
|
||||||
calldata = &rec;
|
calldata = &rec;
|
||||||
prv = &rec.rval;
|
prv = &rec.status;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XACE_HOSTLIST_ACCESS: {
|
case XACE_SERVER_ACCESS: {
|
||||||
XaceHostlistAccessRec rec = {
|
XaceServerAccessRec rec = {
|
||||||
va_arg(ap, ClientPtr),
|
va_arg(ap, ClientPtr),
|
||||||
va_arg(ap, Mask),
|
va_arg(ap, Mask),
|
||||||
TRUE /* default allow */
|
Success /* default allow */
|
||||||
};
|
};
|
||||||
calldata = &rec;
|
calldata = &rec;
|
||||||
prv = &rec.rval;
|
prv = &rec.status;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XACE_SITE_POLICY: {
|
case XACE_SELECTION_ACCESS: {
|
||||||
XaceSitePolicyRec rec = {
|
XaceSelectionAccessRec rec = {
|
||||||
va_arg(ap, char*),
|
va_arg(ap, ClientPtr),
|
||||||
va_arg(ap, int),
|
va_arg(ap, Atom),
|
||||||
FALSE /* default unrecognized */
|
va_arg(ap, Mask),
|
||||||
|
Success /* default allow */
|
||||||
};
|
};
|
||||||
calldata = &rec;
|
calldata = &rec;
|
||||||
prv = &rec.rval;
|
prv = &rec.status;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XACE_DECLARE_EXT_SECURE: {
|
case XACE_SCREEN_ACCESS:
|
||||||
XaceDeclareExtSecureRec rec = {
|
case XACE_SCREENSAVER_ACCESS: {
|
||||||
va_arg(ap, ExtensionEntry*),
|
XaceScreenAccessRec rec = {
|
||||||
va_arg(ap, Bool)
|
va_arg(ap, ClientPtr),
|
||||||
|
va_arg(ap, ScreenPtr),
|
||||||
|
va_arg(ap, Mask),
|
||||||
|
Success /* default allow */
|
||||||
};
|
};
|
||||||
calldata = &rec;
|
calldata = &rec;
|
||||||
|
prv = &rec.status;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XACE_AUTH_AVAIL: {
|
case XACE_AUTH_AVAIL: {
|
||||||
|
@ -189,14 +209,6 @@ int XaceHook(int hook, ...)
|
||||||
calldata = &rec;
|
calldata = &rec;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XACE_WINDOW_INIT: {
|
|
||||||
XaceWindowRec rec = {
|
|
||||||
va_arg(ap, ClientPtr),
|
|
||||||
va_arg(ap, WindowPtr)
|
|
||||||
};
|
|
||||||
calldata = &rec;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default: {
|
default: {
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return 0; /* unimplemented hook number */
|
return 0; /* unimplemented hook number */
|
||||||
|
@ -206,7 +218,7 @@ int XaceHook(int hook, ...)
|
||||||
|
|
||||||
/* call callbacks and return result, if any. */
|
/* call callbacks and return result, if any. */
|
||||||
CallCallbacks(&XaceHooks[hook], calldata);
|
CallCallbacks(&XaceHooks[hook], calldata);
|
||||||
return prv ? *prv : 0;
|
return prv ? *prv : Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -262,16 +274,16 @@ XaceCatchDispatchProc(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
int major = stuff->reqType;
|
int major = stuff->reqType;
|
||||||
XaceCoreDispatchRec rec = { client, TRUE /* default allow */ };
|
XaceCoreDispatchRec rec = { client, Success /* default allow */ };
|
||||||
|
|
||||||
if (!ProcVector[major])
|
if (!ProcVector[major])
|
||||||
return (BadRequest);
|
return BadRequest;
|
||||||
|
|
||||||
/* call callbacks and return result, if any. */
|
/* call callbacks and return result, if any. */
|
||||||
CallCallbacks(&XaceHooks[XACE_CORE_DISPATCH], &rec);
|
CallCallbacks(&XaceHooks[XACE_CORE_DISPATCH], &rec);
|
||||||
|
|
||||||
if (!rec.rval)
|
if (rec.status != Success)
|
||||||
return (BadAccess);
|
return rec.status;
|
||||||
|
|
||||||
return client->swapped ?
|
return client->swapped ?
|
||||||
(* SwappedProcVector[major])(client) :
|
(* SwappedProcVector[major])(client) :
|
||||||
|
@ -284,12 +296,16 @@ XaceCatchExtProc(ClientPtr client)
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
int major = stuff->reqType;
|
int major = stuff->reqType;
|
||||||
ExtensionEntry *ext = GetExtensionEntry(major);
|
ExtensionEntry *ext = GetExtensionEntry(major);
|
||||||
|
XaceExtAccessRec rec = { client, ext, DixUseAccess, Success };
|
||||||
|
|
||||||
if (!ext || !ProcVector[major])
|
if (!ext || !ProcVector[major])
|
||||||
return (BadRequest);
|
return BadRequest;
|
||||||
|
|
||||||
if (!XaceHook(XACE_EXT_DISPATCH, client, ext))
|
/* call callbacks and return result, if any. */
|
||||||
return (BadRequest); /* pretend extension doesn't exist */
|
CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &rec);
|
||||||
|
|
||||||
|
if (rec.status != Success)
|
||||||
|
return BadRequest; /* pretend extension doesn't exist */
|
||||||
|
|
||||||
return client->swapped ?
|
return client->swapped ?
|
||||||
(* SwappedProcVector[major])(client) :
|
(* SwappedProcVector[major])(client) :
|
||||||
|
|
35
Xext/xace.h
35
Xext/xace.h
|
@ -20,15 +20,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#ifndef _XACE_H
|
#ifndef _XACE_H
|
||||||
#define _XACE_H
|
#define _XACE_H
|
||||||
|
|
||||||
/* Hook return codes */
|
|
||||||
#define XaceErrorOperation 0
|
|
||||||
#define XaceAllowOperation 1
|
|
||||||
#define XaceIgnoreOperation 2
|
|
||||||
|
|
||||||
#ifdef XACE
|
#ifdef XACE
|
||||||
|
|
||||||
#define XACE_EXTENSION_NAME "XAccessControlExtension"
|
#define XACE_EXTENSION_NAME "XAccessControlExtension"
|
||||||
#define XACE_MAJOR_VERSION 1
|
#define XACE_MAJOR_VERSION 2
|
||||||
#define XACE_MINOR_VERSION 0
|
#define XACE_MINOR_VERSION 0
|
||||||
|
|
||||||
#include "pixmap.h" /* for DrawablePtr */
|
#include "pixmap.h" /* for DrawablePtr */
|
||||||
|
@ -37,6 +32,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#define XaceNumberEvents 0
|
#define XaceNumberEvents 0
|
||||||
#define XaceNumberErrors 0
|
#define XaceNumberErrors 0
|
||||||
|
|
||||||
|
/* Default window background */
|
||||||
|
#define XaceBackgroundNoneState None
|
||||||
|
|
||||||
/* security hooks */
|
/* security hooks */
|
||||||
/* Constants used to identify the available security hooks
|
/* Constants used to identify the available security hooks
|
||||||
*/
|
*/
|
||||||
|
@ -45,16 +43,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#define XACE_RESOURCE_ACCESS 2
|
#define XACE_RESOURCE_ACCESS 2
|
||||||
#define XACE_DEVICE_ACCESS 3
|
#define XACE_DEVICE_ACCESS 3
|
||||||
#define XACE_PROPERTY_ACCESS 4
|
#define XACE_PROPERTY_ACCESS 4
|
||||||
#define XACE_DRAWABLE_ACCESS 5
|
#define XACE_SEND_ACCESS 5
|
||||||
#define XACE_MAP_ACCESS 6
|
#define XACE_RECEIVE_ACCESS 6
|
||||||
#define XACE_BACKGRND_ACCESS 7
|
#define XACE_CLIENT_ACCESS 7
|
||||||
#define XACE_EXT_ACCESS 8
|
#define XACE_EXT_ACCESS 8
|
||||||
#define XACE_HOSTLIST_ACCESS 9
|
#define XACE_SERVER_ACCESS 9
|
||||||
#define XACE_SITE_POLICY 10
|
#define XACE_SELECTION_ACCESS 10
|
||||||
#define XACE_DECLARE_EXT_SECURE 11
|
#define XACE_SCREEN_ACCESS 11
|
||||||
#define XACE_AUTH_AVAIL 12
|
#define XACE_SCREENSAVER_ACCESS 12
|
||||||
#define XACE_KEY_AVAIL 13
|
#define XACE_AUTH_AVAIL 13
|
||||||
#define XACE_WINDOW_INIT 14
|
#define XACE_KEY_AVAIL 14
|
||||||
#define XACE_AUDIT_BEGIN 15
|
#define XACE_AUDIT_BEGIN 15
|
||||||
#define XACE_AUDIT_END 16
|
#define XACE_AUDIT_END 16
|
||||||
#define XACE_NUM_HOOKS 17
|
#define XACE_NUM_HOOKS 17
|
||||||
|
@ -99,15 +97,18 @@ extern void XaceCensorImage(
|
||||||
|
|
||||||
#else /* XACE */
|
#else /* XACE */
|
||||||
|
|
||||||
|
/* Default window background */
|
||||||
|
#define XaceBackgroundNoneState None
|
||||||
|
|
||||||
/* Define calls away when XACE is not being built. */
|
/* Define calls away when XACE is not being built. */
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define XaceHook(args...) XaceAllowOperation
|
#define XaceHook(args...) Success
|
||||||
#define XaceHookAuditEnd(args...) { ; }
|
#define XaceHookAuditEnd(args...) { ; }
|
||||||
#define XaceHookAuditBegin(args...) { ; }
|
#define XaceHookAuditBegin(args...) { ; }
|
||||||
#define XaceCensorImage(args...) { ; }
|
#define XaceCensorImage(args...) { ; }
|
||||||
#else
|
#else
|
||||||
#define XaceHook(...) XaceAllowOperation
|
#define XaceHook(...) Success
|
||||||
#define XaceHookAuditEnd(...) { ; }
|
#define XaceHookAuditEnd(...) { ; }
|
||||||
#define XaceHookAuditBegin(...) { ; }
|
#define XaceHookAuditBegin(...) { ; }
|
||||||
#define XaceCensorImage(...) { ; }
|
#define XaceCensorImage(...) { ; }
|
||||||
|
|
|
@ -20,91 +20,110 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#ifndef _XACESTR_H
|
#ifndef _XACESTR_H
|
||||||
#define _XACESTR_H
|
#define _XACESTR_H
|
||||||
|
|
||||||
#include <X11/Xdefs.h>
|
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
|
#include "propertyst.h"
|
||||||
|
#include "selection.h"
|
||||||
#include "xace.h"
|
#include "xace.h"
|
||||||
|
|
||||||
/* XACE_CORE_DISPATCH */
|
/* XACE_CORE_DISPATCH */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ClientPtr client;
|
ClientPtr client;
|
||||||
int rval;
|
int status;
|
||||||
} XaceCoreDispatchRec;
|
} XaceCoreDispatchRec;
|
||||||
|
|
||||||
/* XACE_RESOURCE_ACCESS */
|
/* XACE_RESOURCE_ACCESS */
|
||||||
/* XACE_RESOURCE_CREATE */
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ClientPtr client;
|
ClientPtr client;
|
||||||
XID id;
|
XID id;
|
||||||
RESTYPE rtype;
|
RESTYPE rtype;
|
||||||
Mask access_mode;
|
|
||||||
pointer res;
|
pointer res;
|
||||||
int rval;
|
RESTYPE ptype;
|
||||||
|
pointer parent;
|
||||||
|
Mask access_mode;
|
||||||
|
int status;
|
||||||
} XaceResourceAccessRec;
|
} XaceResourceAccessRec;
|
||||||
|
|
||||||
/* XACE_DEVICE_ACCESS */
|
/* XACE_DEVICE_ACCESS */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ClientPtr client;
|
ClientPtr client;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
Bool fromRequest;
|
Mask access_mode;
|
||||||
int rval;
|
int status;
|
||||||
} XaceDeviceAccessRec;
|
} XaceDeviceAccessRec;
|
||||||
|
|
||||||
/* XACE_PROPERTY_ACCESS */
|
/* XACE_PROPERTY_ACCESS */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ClientPtr client;
|
ClientPtr client;
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
Atom propertyName;
|
PropertyPtr pProp;
|
||||||
Mask access_mode;
|
Mask access_mode;
|
||||||
int rval;
|
int status;
|
||||||
} XacePropertyAccessRec;
|
} XacePropertyAccessRec;
|
||||||
|
|
||||||
/* XACE_DRAWABLE_ACCESS */
|
/* XACE_SEND_ACCESS */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ClientPtr client;
|
ClientPtr client;
|
||||||
DrawablePtr pDraw;
|
DeviceIntPtr dev;
|
||||||
int rval;
|
WindowPtr pWin;
|
||||||
} XaceDrawableAccessRec;
|
xEventPtr events;
|
||||||
|
int count;
|
||||||
|
int status;
|
||||||
|
} XaceSendAccessRec;
|
||||||
|
|
||||||
/* XACE_MAP_ACCESS */
|
/* XACE_RECEIVE_ACCESS */
|
||||||
/* XACE_BACKGRND_ACCESS */
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ClientPtr client;
|
ClientPtr client;
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
int rval;
|
xEventPtr events;
|
||||||
} XaceMapAccessRec;
|
int count;
|
||||||
|
int status;
|
||||||
|
} XaceReceiveAccessRec;
|
||||||
|
|
||||||
/* XACE_EXT_DISPATCH_ACCESS */
|
/* XACE_CLIENT_ACCESS */
|
||||||
|
typedef struct {
|
||||||
|
ClientPtr client;
|
||||||
|
ClientPtr target;
|
||||||
|
Mask access_mode;
|
||||||
|
int status;
|
||||||
|
} XaceClientAccessRec;
|
||||||
|
|
||||||
|
/* XACE_EXT_DISPATCH */
|
||||||
/* XACE_EXT_ACCESS */
|
/* XACE_EXT_ACCESS */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ClientPtr client;
|
ClientPtr client;
|
||||||
ExtensionEntry *ext;
|
ExtensionEntry *ext;
|
||||||
int rval;
|
Mask access_mode;
|
||||||
|
int status;
|
||||||
} XaceExtAccessRec;
|
} XaceExtAccessRec;
|
||||||
|
|
||||||
/* XACE_HOSTLIST_ACCESS */
|
/* XACE_SERVER_ACCESS */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ClientPtr client;
|
ClientPtr client;
|
||||||
Mask access_mode;
|
Mask access_mode;
|
||||||
int rval;
|
int status;
|
||||||
} XaceHostlistAccessRec;
|
} XaceServerAccessRec;
|
||||||
|
|
||||||
/* XACE_SITE_POLICY */
|
/* XACE_SELECTION_ACCESS */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *policyString;
|
ClientPtr client;
|
||||||
int len;
|
Atom name;
|
||||||
int rval;
|
Mask access_mode;
|
||||||
} XaceSitePolicyRec;
|
int status;
|
||||||
|
} XaceSelectionAccessRec;
|
||||||
|
|
||||||
/* XACE_DECLARE_EXT_SECURE */
|
/* XACE_SCREEN_ACCESS */
|
||||||
|
/* XACE_SCREENSAVER_ACCESS */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ExtensionEntry *ext;
|
ClientPtr client;
|
||||||
Bool secure;
|
ScreenPtr screen;
|
||||||
} XaceDeclareExtSecureRec;
|
Mask access_mode;
|
||||||
|
int status;
|
||||||
|
} XaceScreenAccessRec;
|
||||||
|
|
||||||
/* XACE_AUTH_AVAIL */
|
/* XACE_AUTH_AVAIL */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -119,12 +138,6 @@ typedef struct {
|
||||||
int count;
|
int count;
|
||||||
} XaceKeyAvailRec;
|
} XaceKeyAvailRec;
|
||||||
|
|
||||||
/* XACE_WINDOW_INIT */
|
|
||||||
typedef struct {
|
|
||||||
ClientPtr client;
|
|
||||||
WindowPtr pWin;
|
|
||||||
} XaceWindowRec;
|
|
||||||
|
|
||||||
/* XACE_AUDIT_BEGIN */
|
/* XACE_AUDIT_BEGIN */
|
||||||
/* XACE_AUDIT_END */
|
/* XACE_AUDIT_END */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -48,10 +48,6 @@ from The Open Group.
|
||||||
#define UINT32_MAX 0xffffffffU
|
#define UINT32_MAX 0xffffffffU
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
|
||||||
static unsigned char XCMiscCode;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void XCMiscResetProc(
|
static void XCMiscResetProc(
|
||||||
ExtensionEntry * /* extEntry */
|
ExtensionEntry * /* extEntry */
|
||||||
);
|
);
|
||||||
|
@ -68,20 +64,9 @@ static DISPATCH_PROC(SProcXCMiscGetXIDRange);
|
||||||
void
|
void
|
||||||
XCMiscExtensionInit(INITARGS)
|
XCMiscExtensionInit(INITARGS)
|
||||||
{
|
{
|
||||||
#if 0
|
AddExtension(XCMiscExtensionName, 0, 0,
|
||||||
ExtensionEntry *extEntry;
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension(XCMiscExtensionName, 0, 0,
|
|
||||||
ProcXCMiscDispatch, SProcXCMiscDispatch,
|
|
||||||
XCMiscResetProc, StandardMinorOpcode)) != 0)
|
|
||||||
XCMiscCode = (unsigned char)extEntry->base;
|
|
||||||
#else
|
|
||||||
(void) AddExtension(XCMiscExtensionName, 0, 0,
|
|
||||||
ProcXCMiscDispatch, SProcXCMiscDispatch,
|
ProcXCMiscDispatch, SProcXCMiscDispatch,
|
||||||
XCMiscResetProc, StandardMinorOpcode);
|
XCMiscResetProc, StandardMinorOpcode);
|
||||||
#endif
|
|
||||||
|
|
||||||
DeclareExtensionSecurity(XCMiscExtensionName, TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
|
|
21
Xext/xevie.c
21
Xext/xevie.c
|
@ -76,11 +76,11 @@ DeviceIntPtr xeviemouse = NULL;
|
||||||
Mask xevieMask = 0;
|
Mask xevieMask = 0;
|
||||||
int xevieEventSent = 0;
|
int xevieEventSent = 0;
|
||||||
int xevieKBEventSent = 0;
|
int xevieKBEventSent = 0;
|
||||||
static unsigned int xevieServerGeneration;
|
static DevPrivateKey xevieDevicePrivateKey = &xevieDevicePrivateKey;
|
||||||
static int xevieDevicePrivateIndex;
|
|
||||||
static Bool xevieModifiersOn = FALSE;
|
static Bool xevieModifiersOn = FALSE;
|
||||||
|
|
||||||
#define XEVIEINFO(dev) ((xevieDeviceInfoPtr)dev->devPrivates[xevieDevicePrivateIndex].ptr)
|
#define XEVIEINFO(dev) ((xevieDeviceInfoPtr) \
|
||||||
|
dixLookupPrivate(&(dev)->devPrivates, xevieDevicePrivateKey))
|
||||||
|
|
||||||
Mask xevieFilters[128] =
|
Mask xevieFilters[128] =
|
||||||
{
|
{
|
||||||
|
@ -134,12 +134,6 @@ XevieExtensionInit (void)
|
||||||
{
|
{
|
||||||
ExtensionEntry* extEntry;
|
ExtensionEntry* extEntry;
|
||||||
|
|
||||||
if (serverGeneration != xevieServerGeneration) {
|
|
||||||
if ((xevieDevicePrivateIndex = AllocateDevicePrivateIndex()) == -1)
|
|
||||||
return;
|
|
||||||
xevieServerGeneration = serverGeneration;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!AddCallback(&ServerGrabCallback,XevieServerGrabStateCallback,NULL))
|
if (!AddCallback(&ServerGrabCallback,XevieServerGrabStateCallback,NULL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -374,7 +368,7 @@ int SProcSelectInput (ClientPtr client)
|
||||||
|
|
||||||
REQUEST (xXevieSelectInputReq);
|
REQUEST (xXevieSelectInputReq);
|
||||||
swaps (&stuff->length, n);
|
swaps (&stuff->length, n);
|
||||||
REQUEST_AT_LEAST_SIZE (xXevieSendReq);
|
REQUEST_AT_LEAST_SIZE (xXevieSelectInputReq);
|
||||||
swapl(&stuff->event_mask, n);
|
swapl(&stuff->event_mask, n);
|
||||||
return ProcSelectInput (client);
|
return ProcSelectInput (client);
|
||||||
}
|
}
|
||||||
|
@ -618,14 +612,11 @@ XevieAdd(DeviceIntPtr device, void* data)
|
||||||
{
|
{
|
||||||
xevieDeviceInfoPtr xeviep;
|
xevieDeviceInfoPtr xeviep;
|
||||||
|
|
||||||
if (!AllocateDevicePrivate(device, xevieDevicePrivateIndex))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
xeviep = xalloc (sizeof (xevieDeviceInfoRec));
|
xeviep = xalloc (sizeof (xevieDeviceInfoRec));
|
||||||
if (!xeviep)
|
if (!xeviep)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
device->devPrivates[xevieDevicePrivateIndex].ptr = xeviep;
|
dixSetPrivate(&device->devPrivates, xevieDevicePrivateKey, xeviep);
|
||||||
XevieUnwrapAdd(device, data);
|
XevieUnwrapAdd(device, data);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -642,7 +633,7 @@ XevieRemove(DeviceIntPtr device,pointer data)
|
||||||
UNWRAP_UNWRAPPROC(device,xeviep->unwrapProc);
|
UNWRAP_UNWRAPPROC(device,xeviep->unwrapProc);
|
||||||
|
|
||||||
xfree(xeviep);
|
xfree(xeviep);
|
||||||
device->devPrivates[xevieDevicePrivateIndex].ptr = NULL;
|
dixSetPrivate(&device->devPrivates, xevieDevicePrivateKey, NULL);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,10 +86,6 @@ static DISPATCH_PROC(SProcXF86BigfontDispatch);
|
||||||
static DISPATCH_PROC(SProcXF86BigfontQueryVersion);
|
static DISPATCH_PROC(SProcXF86BigfontQueryVersion);
|
||||||
static DISPATCH_PROC(SProcXF86BigfontQueryFont);
|
static DISPATCH_PROC(SProcXF86BigfontQueryFont);
|
||||||
|
|
||||||
#if 0
|
|
||||||
static unsigned char XF86BigfontReqCode;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAS_SHM
|
#ifdef HAS_SHM
|
||||||
|
|
||||||
/* A random signature, transmitted to the clients so they can verify that the
|
/* A random signature, transmitted to the clients so they can verify that the
|
||||||
|
@ -149,18 +145,6 @@ CheckForShmSyscall(void)
|
||||||
void
|
void
|
||||||
XFree86BigfontExtensionInit()
|
XFree86BigfontExtensionInit()
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
ExtensionEntry* extEntry;
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension(XF86BIGFONTNAME,
|
|
||||||
XF86BigfontNumberEvents,
|
|
||||||
XF86BigfontNumberErrors,
|
|
||||||
ProcXF86BigfontDispatch,
|
|
||||||
SProcXF86BigfontDispatch,
|
|
||||||
XF86BigfontResetProc,
|
|
||||||
StandardMinorOpcode))) {
|
|
||||||
XF86BigfontReqCode = (unsigned char) extEntry->base;
|
|
||||||
#else
|
|
||||||
if (AddExtension(XF86BIGFONTNAME,
|
if (AddExtension(XF86BIGFONTNAME,
|
||||||
XF86BigfontNumberEvents,
|
XF86BigfontNumberEvents,
|
||||||
XF86BigfontNumberErrors,
|
XF86BigfontNumberErrors,
|
||||||
|
@ -168,7 +152,6 @@ XFree86BigfontExtensionInit()
|
||||||
SProcXF86BigfontDispatch,
|
SProcXF86BigfontDispatch,
|
||||||
XF86BigfontResetProc,
|
XF86BigfontResetProc,
|
||||||
StandardMinorOpcode)) {
|
StandardMinorOpcode)) {
|
||||||
#endif
|
|
||||||
#ifdef HAS_SHM
|
#ifdef HAS_SHM
|
||||||
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
|
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
|
||||||
/*
|
/*
|
||||||
|
@ -445,10 +428,10 @@ ProcXF86BigfontQueryFont(
|
||||||
#endif
|
#endif
|
||||||
client->errorValue = stuff->id; /* EITHER font or gc */
|
client->errorValue = stuff->id; /* EITHER font or gc */
|
||||||
pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT,
|
pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT,
|
||||||
DixReadAccess);
|
DixGetAttrAccess);
|
||||||
if (!pFont) {
|
if (!pFont) {
|
||||||
GC *pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC,
|
GC *pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC,
|
||||||
DixReadAccess);
|
DixGetAttrAccess);
|
||||||
if (!pGC) {
|
if (!pGC) {
|
||||||
client->errorValue = stuff->id;
|
client->errorValue = stuff->id;
|
||||||
return BadFont; /* procotol spec says only error is BadFont */
|
return BadFont; /* procotol spec says only error is BadFont */
|
||||||
|
|
191
Xext/xprint.c
191
Xext/xprint.c
|
@ -153,8 +153,6 @@ static int XpFreePage(pointer, XID);
|
||||||
static Bool XpCloseScreen(int, ScreenPtr);
|
static Bool XpCloseScreen(int, ScreenPtr);
|
||||||
static CARD32 GetAllEventMasks(XpContextPtr);
|
static CARD32 GetAllEventMasks(XpContextPtr);
|
||||||
static struct _XpClient *CreateXpClient(ClientPtr);
|
static struct _XpClient *CreateXpClient(ClientPtr);
|
||||||
static void InitContextPrivates(XpContextPtr);
|
|
||||||
static void ResetContextPrivates(void);
|
|
||||||
static struct _XpClient *FindClient(XpContextPtr, ClientPtr);
|
static struct _XpClient *FindClient(XpContextPtr, ClientPtr);
|
||||||
static struct _XpClient *AcquireClient(XpContextPtr, ClientPtr);
|
static struct _XpClient *AcquireClient(XpContextPtr, ClientPtr);
|
||||||
|
|
||||||
|
@ -233,21 +231,12 @@ static XpScreenPtr XpScreens[MAXSCREENS];
|
||||||
static unsigned char XpReqCode;
|
static unsigned char XpReqCode;
|
||||||
static int XpEventBase;
|
static int XpEventBase;
|
||||||
static int XpErrorBase;
|
static int XpErrorBase;
|
||||||
static unsigned long XpGeneration = 0;
|
static DevPrivateKey XpClientPrivateKey = &XpClientPrivateKey;
|
||||||
static int XpClientPrivateIndex;
|
|
||||||
|
|
||||||
/* Variables for the context private machinery.
|
#define XP_GETPRIV(pClient) ((XpContextPtr) \
|
||||||
* These must be initialized at compile time because
|
dixLookupPrivate(&(pClient)->devPrivates, XpClientPrivateKey))
|
||||||
* main() calls InitOutput before InitExtensions, and the
|
#define XP_SETPRIV(pClient, p) \
|
||||||
* output drivers are likely to call AllocateContextPrivate.
|
dixSetPrivate(&(pClient)->devPrivates, XpClientPrivateKey, p)
|
||||||
* These variables are reset at CloseScreen time. CloseScreen
|
|
||||||
* is used because it occurs after FreeAllResources, and before
|
|
||||||
* the next InitOutput cycle.
|
|
||||||
*/
|
|
||||||
static int contextPrivateCount = 0;
|
|
||||||
static int contextPrivateLen = 0;
|
|
||||||
static unsigned *contextPrivateSizes = (unsigned *)NULL;
|
|
||||||
static unsigned totalContextSize = sizeof(XpContextRec);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* There are three types of resources involved. One is the resource associated
|
* There are three types of resources involved. One is the resource associated
|
||||||
|
@ -305,20 +294,6 @@ XpExtensionInit(INITARGS)
|
||||||
EventSwapVector[XpEventBase+1] = (EventSwapPtr) SwapXpAttributeEvent;
|
EventSwapVector[XpEventBase+1] = (EventSwapPtr) SwapXpAttributeEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(XpGeneration != serverGeneration)
|
|
||||||
{
|
|
||||||
XpClientPrivateIndex = AllocateClientPrivateIndex();
|
|
||||||
/*
|
|
||||||
* We allocate 0 length & simply stuff a pointer to the
|
|
||||||
* ContextRec in the DevUnion.
|
|
||||||
*/
|
|
||||||
if(AllocateClientPrivate(XpClientPrivateIndex, 0) != TRUE)
|
|
||||||
{
|
|
||||||
/* we can't alloc a client private, should we bail??? XXX */
|
|
||||||
}
|
|
||||||
XpGeneration = serverGeneration;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(i = 0; i < MAXSCREENS; i++)
|
for(i = 0; i < MAXSCREENS; i++)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -335,7 +310,6 @@ XpExtensionInit(INITARGS)
|
||||||
screenInfo.screens[i]->CloseScreen = XpCloseScreen;
|
screenInfo.screens[i]->CloseScreen = XpCloseScreen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DeclareExtensionSecurity(XP_PRINTNAME, TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -378,36 +352,9 @@ XpCloseScreen(int index, ScreenPtr pScreen)
|
||||||
}
|
}
|
||||||
XpScreens[index] = (XpScreenPtr)NULL;
|
XpScreens[index] = (XpScreenPtr)NULL;
|
||||||
|
|
||||||
/*
|
|
||||||
* It's wasteful to call ResetContextPrivates() at every CloseScreen,
|
|
||||||
* but it's the best we know how to do for now. We do this because we
|
|
||||||
* have to wait until after all resources have been freed (so we know
|
|
||||||
* how to free the ContextRecs), and before the next InitOutput cycle.
|
|
||||||
* See dix/main.c for the order of initialization and reset.
|
|
||||||
*/
|
|
||||||
ResetContextPrivates();
|
|
||||||
return (*CloseScreen)(index, pScreen);
|
return (*CloseScreen)(index, pScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 /* NOT USED */
|
|
||||||
static void
|
|
||||||
FreeScreenEntry(XpScreenPtr pScreenEntry)
|
|
||||||
{
|
|
||||||
XpDriverPtr pDriver;
|
|
||||||
|
|
||||||
pDriver = pScreenEntry->drivers;
|
|
||||||
while(pDriver != (XpDriverPtr)NULL)
|
|
||||||
{
|
|
||||||
XpDriverPtr tmp;
|
|
||||||
|
|
||||||
tmp = pDriver->next;
|
|
||||||
xfree(pDriver);
|
|
||||||
pDriver = tmp;
|
|
||||||
}
|
|
||||||
xfree(pScreenEntry);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XpRegisterInitFunc tells the print extension which screens
|
* XpRegisterInitFunc tells the print extension which screens
|
||||||
* are printers as opposed to displays, and what drivers are
|
* are printers as opposed to displays, and what drivers are
|
||||||
|
@ -957,12 +904,10 @@ ProcXpCreateContext(ClientPtr client)
|
||||||
/*
|
/*
|
||||||
* Allocate and add the context resource.
|
* Allocate and add the context resource.
|
||||||
*/
|
*/
|
||||||
if((pContext = (XpContextPtr) xalloc(totalContextSize)) ==
|
if((pContext = (XpContextPtr) xalloc(sizeof(XpContextRec))) ==
|
||||||
(XpContextPtr) NULL)
|
(XpContextPtr) NULL)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
InitContextPrivates(pContext);
|
|
||||||
|
|
||||||
if(AddResource(stuff->contextID, RTcontext, (pointer) pContext)
|
if(AddResource(stuff->contextID, RTcontext, (pointer) pContext)
|
||||||
!= TRUE)
|
!= TRUE)
|
||||||
{
|
{
|
||||||
|
@ -976,6 +921,7 @@ ProcXpCreateContext(ClientPtr client)
|
||||||
pContext->state = 0;
|
pContext->state = 0;
|
||||||
pContext->clientSlept = (ClientPtr)NULL;
|
pContext->clientSlept = (ClientPtr)NULL;
|
||||||
pContext->imageRes = 0;
|
pContext->imageRes = 0;
|
||||||
|
pContext->devPrivates = NULL;
|
||||||
|
|
||||||
pContext->funcs.DestroyContext = 0;
|
pContext->funcs.DestroyContext = 0;
|
||||||
pContext->funcs.StartJob = 0;
|
pContext->funcs.StartJob = 0;
|
||||||
|
@ -1042,8 +988,7 @@ ProcXpSetContext(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xPrintSetContextReq);
|
REQUEST_AT_LEAST_SIZE(xPrintSetContextReq);
|
||||||
|
|
||||||
if((pContext = client->devPrivates[XpClientPrivateIndex].ptr) !=
|
if((pContext = XP_GETPRIV(client)) != (pointer)NULL)
|
||||||
(pointer)NULL)
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Erase this client's knowledge of its old context, if any.
|
* Erase this client's knowledge of its old context, if any.
|
||||||
|
@ -1056,7 +1001,7 @@ ProcXpSetContext(ClientPtr client)
|
||||||
FreeXpClient(pPrintClient, TRUE);
|
FreeXpClient(pPrintClient, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
client->devPrivates[XpClientPrivateIndex].ptr = (pointer)NULL;
|
XP_SETPRIV(client, NULL);
|
||||||
}
|
}
|
||||||
if(stuff->printContext == None)
|
if(stuff->printContext == None)
|
||||||
return Success;
|
return Success;
|
||||||
|
@ -1078,7 +1023,7 @@ ProcXpSetContext(ClientPtr client)
|
||||||
if((pPrintClient = AcquireClient(pContext, client)) == (XpClientPtr)NULL)
|
if((pPrintClient = AcquireClient(pContext, client)) == (XpClientPtr)NULL)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
client->devPrivates[XpClientPrivateIndex].ptr = pContext;
|
XP_SETPRIV(client, pContext);
|
||||||
|
|
||||||
XpSetFontResFunc(client);
|
XpSetFontResFunc(client);
|
||||||
|
|
||||||
|
@ -1091,7 +1036,7 @@ ProcXpSetContext(ClientPtr client)
|
||||||
XpContextPtr
|
XpContextPtr
|
||||||
XpGetPrintContext(ClientPtr client)
|
XpGetPrintContext(ClientPtr client)
|
||||||
{
|
{
|
||||||
return (client->devPrivates[XpClientPrivateIndex].ptr);
|
return XP_GETPRIV(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -1106,8 +1051,7 @@ ProcXpGetContext(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xPrintGetContextReq);
|
REQUEST_SIZE_MATCH(xPrintGetContextReq);
|
||||||
|
|
||||||
if((pContext = client->devPrivates[XpClientPrivateIndex].ptr) ==
|
if((pContext = XP_GETPRIV(client)) == (pointer)NULL)
|
||||||
(pointer)NULL)
|
|
||||||
rep.printContext = None;
|
rep.printContext = None;
|
||||||
else
|
else
|
||||||
rep.printContext = pContext->contextID;
|
rep.printContext = pContext->contextID;
|
||||||
|
@ -1250,6 +1194,7 @@ XpFreeContext(pointer data, XID id)
|
||||||
}
|
}
|
||||||
|
|
||||||
xfree(pContext->printerName);
|
xfree(pContext->printerName);
|
||||||
|
dixFreePrivates(pContext->devPrivates);
|
||||||
xfree(pContext);
|
xfree(pContext);
|
||||||
return Success; /* ??? */
|
return Success; /* ??? */
|
||||||
}
|
}
|
||||||
|
@ -1285,11 +1230,9 @@ FreeXpClient(XpClientPtr pXpClient, Bool freeResource)
|
||||||
* If we're freeing the clientRec associated with the context tied
|
* If we're freeing the clientRec associated with the context tied
|
||||||
* to the client's devPrivates, then we need to clear the devPrivates.
|
* to the client's devPrivates, then we need to clear the devPrivates.
|
||||||
*/
|
*/
|
||||||
if(pXpClient->client->devPrivates[XpClientPrivateIndex].ptr ==
|
if(XP_GETPRIV(pXpClient->client) == pXpClient->context)
|
||||||
pXpClient->context)
|
|
||||||
{
|
{
|
||||||
pXpClient->client->devPrivates[XpClientPrivateIndex].ptr =
|
XP_SETPRIV(pXpClient->client, NULL);
|
||||||
(pointer)NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(pPrev = (XpClientPtr)NULL, pCurrent = pContext->clientHead;
|
for(pPrev = (XpClientPtr)NULL, pCurrent = pContext->clientHead;
|
||||||
|
@ -1373,87 +1316,6 @@ XpFreePage(pointer data, XID id)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* ContextPrivate machinery.
|
|
||||||
* Context privates are intended for use by the drivers, allowing the
|
|
||||||
* drivers to maintain context-specific data. The driver should free
|
|
||||||
* the associated data at DestroyContext time.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void
|
|
||||||
InitContextPrivates(XpContextPtr context)
|
|
||||||
{
|
|
||||||
char *ptr;
|
|
||||||
DevUnion *ppriv;
|
|
||||||
unsigned *sizes;
|
|
||||||
unsigned size;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (totalContextSize == sizeof(XpContextRec))
|
|
||||||
ppriv = (DevUnion *)NULL;
|
|
||||||
else
|
|
||||||
ppriv = (DevUnion *)(context + 1);
|
|
||||||
|
|
||||||
context->devPrivates = ppriv;
|
|
||||||
sizes = contextPrivateSizes;
|
|
||||||
ptr = (char *)(ppriv + contextPrivateLen);
|
|
||||||
for (i = contextPrivateLen; --i >= 0; ppriv++, sizes++)
|
|
||||||
{
|
|
||||||
if ( (size = *sizes) )
|
|
||||||
{
|
|
||||||
ppriv->ptr = (pointer)ptr;
|
|
||||||
ptr += size;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ppriv->ptr = (pointer)NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
ResetContextPrivates(void)
|
|
||||||
{
|
|
||||||
contextPrivateCount = 0;
|
|
||||||
contextPrivateLen = 0;
|
|
||||||
xfree(contextPrivateSizes);
|
|
||||||
contextPrivateSizes = (unsigned *)NULL;
|
|
||||||
totalContextSize = sizeof(XpContextRec);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
XpAllocateContextPrivateIndex(void)
|
|
||||||
{
|
|
||||||
return contextPrivateCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool
|
|
||||||
XpAllocateContextPrivate(int index, unsigned amount)
|
|
||||||
{
|
|
||||||
unsigned oldamount;
|
|
||||||
|
|
||||||
if (index >= contextPrivateLen)
|
|
||||||
{
|
|
||||||
unsigned *nsizes;
|
|
||||||
nsizes = (unsigned *)xrealloc(contextPrivateSizes,
|
|
||||||
(index + 1) * sizeof(unsigned));
|
|
||||||
if (!nsizes)
|
|
||||||
return FALSE;
|
|
||||||
while (contextPrivateLen <= index)
|
|
||||||
{
|
|
||||||
nsizes[contextPrivateLen++] = 0;
|
|
||||||
totalContextSize += sizeof(DevUnion);
|
|
||||||
}
|
|
||||||
contextPrivateSizes = nsizes;
|
|
||||||
}
|
|
||||||
oldamount = contextPrivateSizes[index];
|
|
||||||
if (amount > oldamount)
|
|
||||||
{
|
|
||||||
contextPrivateSizes[index] = amount;
|
|
||||||
totalContextSize += (amount - oldamount);
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static XpClientPtr
|
static XpClientPtr
|
||||||
AcquireClient(XpContextPtr pContext, ClientPtr client)
|
AcquireClient(XpContextPtr pContext, ClientPtr client)
|
||||||
{
|
{
|
||||||
|
@ -1502,8 +1364,7 @@ ProcXpStartJob(ClientPtr client)
|
||||||
REQUEST_SIZE_MATCH(xPrintStartJobReq);
|
REQUEST_SIZE_MATCH(xPrintStartJobReq);
|
||||||
|
|
||||||
/* Check to see that a context has been established by this client. */
|
/* Check to see that a context has been established by this client. */
|
||||||
if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
|
if((pContext = XP_GETPRIV(client)) == (XpContextPtr)NULL)
|
||||||
== (XpContextPtr)NULL)
|
|
||||||
return XpErrorBase+XPBadContext;
|
return XpErrorBase+XPBadContext;
|
||||||
|
|
||||||
if(pContext->state != 0)
|
if(pContext->state != 0)
|
||||||
|
@ -1543,8 +1404,7 @@ ProcXpEndJob(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xPrintEndJobReq);
|
REQUEST_SIZE_MATCH(xPrintEndJobReq);
|
||||||
|
|
||||||
if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
|
if((pContext = XP_GETPRIV(client)) == (XpContextPtr)NULL)
|
||||||
== (XpContextPtr)NULL)
|
|
||||||
return XpErrorBase+XPBadSequence;
|
return XpErrorBase+XPBadSequence;
|
||||||
|
|
||||||
if(!(pContext->state & JOB_STARTED))
|
if(!(pContext->state & JOB_STARTED))
|
||||||
|
@ -1649,8 +1509,7 @@ ProcXpStartDoc(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xPrintStartDocReq);
|
REQUEST_SIZE_MATCH(xPrintStartDocReq);
|
||||||
|
|
||||||
if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
|
if((pContext = XP_GETPRIV(client)) == (XpContextPtr)NULL)
|
||||||
== (XpContextPtr)NULL)
|
|
||||||
return XpErrorBase+XPBadSequence;
|
return XpErrorBase+XPBadSequence;
|
||||||
|
|
||||||
if(!(pContext->state & JOB_STARTED) ||
|
if(!(pContext->state & JOB_STARTED) ||
|
||||||
|
@ -1685,8 +1544,7 @@ ProcXpEndDoc(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xPrintEndDocReq);
|
REQUEST_SIZE_MATCH(xPrintEndDocReq);
|
||||||
|
|
||||||
if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
|
if((pContext = XP_GETPRIV(client)) == (XpContextPtr)NULL)
|
||||||
== (XpContextPtr)NULL)
|
|
||||||
return XpErrorBase+XPBadSequence;
|
return XpErrorBase+XPBadSequence;
|
||||||
|
|
||||||
if(!(pContext->state & DOC_RAW_STARTED) &&
|
if(!(pContext->state & DOC_RAW_STARTED) &&
|
||||||
|
@ -1838,8 +1696,7 @@ ProcXpStartPage(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xPrintStartPageReq);
|
REQUEST_SIZE_MATCH(xPrintStartPageReq);
|
||||||
|
|
||||||
if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
|
if((pContext = XP_GETPRIV(client)) == (XpContextPtr)NULL)
|
||||||
== (XpContextPtr)NULL)
|
|
||||||
return XpErrorBase+XPBadSequence;
|
return XpErrorBase+XPBadSequence;
|
||||||
|
|
||||||
if(!(pContext->state & JOB_STARTED))
|
if(!(pContext->state & JOB_STARTED))
|
||||||
|
@ -1883,8 +1740,7 @@ ProcXpEndPage(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xPrintEndPageReq);
|
REQUEST_SIZE_MATCH(xPrintEndPageReq);
|
||||||
|
|
||||||
if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
|
if((pContext = XP_GETPRIV(client)) == (XpContextPtr)NULL)
|
||||||
== (XpContextPtr)NULL)
|
|
||||||
return XpErrorBase+XPBadSequence;
|
return XpErrorBase+XPBadSequence;
|
||||||
|
|
||||||
if(!(pContext->state & PAGE_STARTED))
|
if(!(pContext->state & PAGE_STARTED))
|
||||||
|
@ -1933,8 +1789,7 @@ ProcXpPutDocumentData(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xPrintPutDocumentDataReq);
|
REQUEST_AT_LEAST_SIZE(xPrintPutDocumentDataReq);
|
||||||
|
|
||||||
if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
|
if((pContext = XP_GETPRIV(client)) == (XpContextPtr)NULL)
|
||||||
== (XpContextPtr)NULL)
|
|
||||||
return XpErrorBase+XPBadSequence;
|
return XpErrorBase+XPBadSequence;
|
||||||
|
|
||||||
if(!(pContext->state & DOC_RAW_STARTED) &&
|
if(!(pContext->state & DOC_RAW_STARTED) &&
|
||||||
|
@ -2444,7 +2299,7 @@ GetAllEventMasks(XpContextPtr pContext)
|
||||||
XpContextPtr
|
XpContextPtr
|
||||||
XpContextOfClient(ClientPtr client)
|
XpContextOfClient(ClientPtr client)
|
||||||
{
|
{
|
||||||
return (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr;
|
return XP_GETPRIV(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
31
Xext/xres.c
31
Xext/xres.c
|
@ -17,6 +17,7 @@
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
|
#include "registry.h"
|
||||||
#include <X11/extensions/XResproto.h>
|
#include <X11/extensions/XResproto.h>
|
||||||
#include "pixmapstr.h"
|
#include "pixmapstr.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
|
@ -66,7 +67,7 @@ ProcXResQueryClients (ClientPtr client)
|
||||||
current_clients = xalloc((currentMaxClients - 1) * sizeof(int));
|
current_clients = xalloc((currentMaxClients - 1) * sizeof(int));
|
||||||
|
|
||||||
num_clients = 0;
|
num_clients = 0;
|
||||||
for(i = 1; i < currentMaxClients; i++) {
|
for(i = 0; i < currentMaxClients; i++) {
|
||||||
if(clients[i]) {
|
if(clients[i]) {
|
||||||
current_clients[num_clients] = i;
|
current_clients[num_clients] = i;
|
||||||
num_clients++;
|
num_clients++;
|
||||||
|
@ -127,9 +128,7 @@ ProcXResQueryClientResources (ClientPtr client)
|
||||||
|
|
||||||
clientID = CLIENT_ID(stuff->xid);
|
clientID = CLIENT_ID(stuff->xid);
|
||||||
|
|
||||||
/* we could remove the (clientID == 0) check if we wanted to allow
|
if((clientID >= currentMaxClients) || !clients[clientID]) {
|
||||||
probing the X-server's resource usage */
|
|
||||||
if(!clientID || (clientID >= currentMaxClients) || !clients[clientID]) {
|
|
||||||
client->errorValue = stuff->xid;
|
client->errorValue = stuff->xid;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
|
@ -161,17 +160,20 @@ ProcXResQueryClientResources (ClientPtr client)
|
||||||
|
|
||||||
if(num_types) {
|
if(num_types) {
|
||||||
xXResType scratch;
|
xXResType scratch;
|
||||||
|
char *name;
|
||||||
|
|
||||||
for(i = 0; i < lastResourceType; i++) {
|
for(i = 0; i < lastResourceType; i++) {
|
||||||
if(!counts[i]) continue;
|
if(!counts[i]) continue;
|
||||||
|
|
||||||
if(!ResourceNames[i + 1]) {
|
name = (char *)LookupResourceName(i + 1);
|
||||||
|
if (strcmp(name, XREGISTRY_UNKNOWN))
|
||||||
|
scratch.resource_type = MakeAtom(name, strlen(name), TRUE);
|
||||||
|
else {
|
||||||
char buf[40];
|
char buf[40];
|
||||||
snprintf(buf, sizeof(buf), "Unregistered resource %i", i + 1);
|
snprintf(buf, sizeof(buf), "Unregistered resource %i", i + 1);
|
||||||
RegisterResourceName(i + 1, buf);
|
scratch.resource_type = MakeAtom(buf, strlen(buf), TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
scratch.resource_type = ResourceNames[i + 1];
|
|
||||||
scratch.count = counts[i];
|
scratch.count = counts[i];
|
||||||
|
|
||||||
if(client->swapped) {
|
if(client->swapped) {
|
||||||
|
@ -250,9 +252,7 @@ ProcXResQueryClientPixmapBytes (ClientPtr client)
|
||||||
|
|
||||||
clientID = CLIENT_ID(stuff->xid);
|
clientID = CLIENT_ID(stuff->xid);
|
||||||
|
|
||||||
/* we could remove the (clientID == 0) check if we wanted to allow
|
if((clientID >= currentMaxClients) || !clients[clientID]) {
|
||||||
probing the X-server's resource usage */
|
|
||||||
if(!clientID || (clientID >= currentMaxClients) || !clients[clientID]) {
|
|
||||||
client->errorValue = stuff->xid;
|
client->errorValue = stuff->xid;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
|
@ -387,15 +387,4 @@ ResExtensionInit(INITARGS)
|
||||||
(void) AddExtension(XRES_NAME, 0, 0,
|
(void) AddExtension(XRES_NAME, 0, 0,
|
||||||
ProcResDispatch, SProcResDispatch,
|
ProcResDispatch, SProcResDispatch,
|
||||||
ResResetProc, StandardMinorOpcode);
|
ResResetProc, StandardMinorOpcode);
|
||||||
|
|
||||||
RegisterResourceName(RT_NONE, "NONE");
|
|
||||||
RegisterResourceName(RT_WINDOW, "WINDOW");
|
|
||||||
RegisterResourceName(RT_PIXMAP, "PIXMAP");
|
|
||||||
RegisterResourceName(RT_GC, "GC");
|
|
||||||
RegisterResourceName(RT_FONT, "FONT");
|
|
||||||
RegisterResourceName(RT_CURSOR, "CURSOR");
|
|
||||||
RegisterResourceName(RT_COLORMAP, "COLORMAP");
|
|
||||||
RegisterResourceName(RT_CMAPENTRY, "COLORMAP ENTRY");
|
|
||||||
RegisterResourceName(RT_OTHERCLIENT, "OTHER CLIENT");
|
|
||||||
RegisterResourceName(RT_PASSIVEGRAB, "PASSIVE GRAB");
|
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,195 @@
|
||||||
|
/************************************************************
|
||||||
|
|
||||||
|
Author: Eamon Walsh <ewalsh@epoch.ncsc.mil>
|
||||||
|
|
||||||
|
Permission to use, copy, modify, distribute, and sell this software and its
|
||||||
|
documentation for any purpose is hereby granted without fee, provided that
|
||||||
|
this permission notice appear in supporting documentation. 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
|
||||||
|
AUTHOR 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 _XSELINUX_H
|
||||||
|
#define _XSELINUX_H
|
||||||
|
|
||||||
|
#include "dixaccess.h"
|
||||||
|
|
||||||
|
/* Extension info */
|
||||||
|
#define XSELINUX_EXTENSION_NAME "SELinux"
|
||||||
|
#define XSELINUX_MAJOR_VERSION 1
|
||||||
|
#define XSELINUX_MINOR_VERSION 0
|
||||||
|
#define XSELinuxNumberEvents 0
|
||||||
|
#define XSELinuxNumberErrors 0
|
||||||
|
|
||||||
|
/* Extension protocol */
|
||||||
|
#define X_SELinuxQueryVersion 0
|
||||||
|
#define X_SELinuxSetSelectionManager 1
|
||||||
|
#define X_SELinuxGetSelectionManager 2
|
||||||
|
#define X_SELinuxSetDeviceCreateContext 3
|
||||||
|
#define X_SELinuxGetDeviceCreateContext 4
|
||||||
|
#define X_SELinuxSetDeviceContext 5
|
||||||
|
#define X_SELinuxGetDeviceContext 6
|
||||||
|
#define X_SELinuxSetPropertyCreateContext 7
|
||||||
|
#define X_SELinuxGetPropertyCreateContext 8
|
||||||
|
#define X_SELinuxGetPropertyContext 9
|
||||||
|
#define X_SELinuxSetWindowCreateContext 10
|
||||||
|
#define X_SELinuxGetWindowCreateContext 11
|
||||||
|
#define X_SELinuxGetWindowContext 12
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
CARD8 reqType;
|
||||||
|
CARD8 SELinuxReqType;
|
||||||
|
CARD16 length;
|
||||||
|
CARD8 client_major;
|
||||||
|
CARD8 client_minor;
|
||||||
|
CARD16 unused;
|
||||||
|
} SELinuxQueryVersionReq;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
CARD8 type;
|
||||||
|
CARD8 pad1;
|
||||||
|
CARD16 sequenceNumber;
|
||||||
|
CARD32 length;
|
||||||
|
CARD16 server_major;
|
||||||
|
CARD16 server_minor;
|
||||||
|
CARD32 pad2;
|
||||||
|
CARD32 pad3;
|
||||||
|
CARD32 pad4;
|
||||||
|
CARD32 pad5;
|
||||||
|
CARD32 pad6;
|
||||||
|
} SELinuxQueryVersionReply;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
CARD8 reqType;
|
||||||
|
CARD8 SELinuxReqType;
|
||||||
|
CARD16 length;
|
||||||
|
CARD32 window;
|
||||||
|
} SELinuxSetSelectionManagerReq;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
CARD8 reqType;
|
||||||
|
CARD8 SELinuxReqType;
|
||||||
|
CARD16 length;
|
||||||
|
} SELinuxGetSelectionManagerReq;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
CARD8 type;
|
||||||
|
CARD8 pad1;
|
||||||
|
CARD16 sequenceNumber;
|
||||||
|
CARD32 length;
|
||||||
|
CARD32 window;
|
||||||
|
CARD32 pad2;
|
||||||
|
CARD32 pad3;
|
||||||
|
CARD32 pad4;
|
||||||
|
CARD32 pad5;
|
||||||
|
CARD32 pad6;
|
||||||
|
} SELinuxGetSelectionManagerReply;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
CARD8 reqType;
|
||||||
|
CARD8 SELinuxReqType;
|
||||||
|
CARD16 length;
|
||||||
|
CARD8 permanent;
|
||||||
|
CARD8 unused;
|
||||||
|
CARD16 context_len;
|
||||||
|
} SELinuxSetCreateContextReq;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
CARD8 reqType;
|
||||||
|
CARD8 SELinuxReqType;
|
||||||
|
CARD16 length;
|
||||||
|
} SELinuxGetCreateContextReq;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
CARD8 type;
|
||||||
|
CARD8 permanent;
|
||||||
|
CARD16 sequenceNumber;
|
||||||
|
CARD32 length;
|
||||||
|
CARD16 context_len;
|
||||||
|
CARD16 pad1;
|
||||||
|
CARD32 pad2;
|
||||||
|
CARD32 pad3;
|
||||||
|
CARD32 pad4;
|
||||||
|
CARD32 pad5;
|
||||||
|
CARD32 pad6;
|
||||||
|
} SELinuxGetCreateContextReply;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
CARD8 reqType;
|
||||||
|
CARD8 SELinuxReqType;
|
||||||
|
CARD16 length;
|
||||||
|
CARD32 id;
|
||||||
|
CARD16 unused;
|
||||||
|
CARD16 context_len;
|
||||||
|
} SELinuxSetContextReq;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
CARD8 reqType;
|
||||||
|
CARD8 SELinuxReqType;
|
||||||
|
CARD16 length;
|
||||||
|
CARD32 id;
|
||||||
|
} SELinuxGetContextReq;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
CARD8 type;
|
||||||
|
CARD8 pad1;
|
||||||
|
CARD16 sequenceNumber;
|
||||||
|
CARD32 length;
|
||||||
|
CARD16 context_len;
|
||||||
|
CARD16 pad2;
|
||||||
|
CARD32 pad3;
|
||||||
|
CARD32 pad4;
|
||||||
|
CARD32 pad5;
|
||||||
|
CARD32 pad6;
|
||||||
|
CARD32 pad7;
|
||||||
|
} SELinuxGetContextReply;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
CARD8 reqType;
|
||||||
|
CARD8 SELinuxReqType;
|
||||||
|
CARD16 length;
|
||||||
|
CARD32 window;
|
||||||
|
CARD32 property;
|
||||||
|
} SELinuxGetPropertyContextReq;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
CARD8 type;
|
||||||
|
CARD8 pad1;
|
||||||
|
CARD16 sequenceNumber;
|
||||||
|
CARD32 length;
|
||||||
|
CARD16 context_len;
|
||||||
|
CARD16 pad2;
|
||||||
|
CARD32 pad3;
|
||||||
|
CARD32 pad4;
|
||||||
|
CARD32 pad5;
|
||||||
|
CARD32 pad6;
|
||||||
|
CARD32 pad7;
|
||||||
|
} SELinuxGetPropertyContextReply;
|
||||||
|
|
||||||
|
|
||||||
|
/* Private Flask definitions */
|
||||||
|
#define SECCLASS_X_DRAWABLE 1
|
||||||
|
#define SECCLASS_X_SCREEN 2
|
||||||
|
#define SECCLASS_X_GC 3
|
||||||
|
#define SECCLASS_X_FONT 4
|
||||||
|
#define SECCLASS_X_COLORMAP 5
|
||||||
|
#define SECCLASS_X_PROPERTY 6
|
||||||
|
#define SECCLASS_X_SELECTION 7
|
||||||
|
#define SECCLASS_X_CURSOR 8
|
||||||
|
#define SECCLASS_X_CLIENT 9
|
||||||
|
#define SECCLASS_X_DEVICE 10
|
||||||
|
#define SECCLASS_X_SERVER 11
|
||||||
|
#define SECCLASS_X_EXTENSION 12
|
||||||
|
#define SECCLASS_X_EVENT 13
|
||||||
|
#define SECCLASS_X_FAKEEVENT 14
|
||||||
|
#define SECCLASS_X_RESOURCE 15
|
||||||
|
|
||||||
|
#endif /* _XSELINUX_H */
|
40
Xext/xtest.c
40
Xext/xtest.c
|
@ -49,15 +49,10 @@ from The Open Group.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#define EXTENSION_EVENT_BASE 64
|
#define EXTENSION_EVENT_BASE 64
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#endif /* XINPUT */
|
#endif /* XINPUT */
|
||||||
|
|
||||||
#include "modinit.h"
|
#include "modinit.h"
|
||||||
|
|
||||||
#if 0
|
|
||||||
static unsigned char XTestReqCode;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef XINPUT
|
#ifdef XINPUT
|
||||||
extern int DeviceValuator;
|
extern int DeviceValuator;
|
||||||
#endif /* XINPUT */
|
#endif /* XINPUT */
|
||||||
|
@ -89,18 +84,9 @@ static DISPATCH_PROC(SProcXTestGrabControl);
|
||||||
void
|
void
|
||||||
XTestExtensionInit(INITARGS)
|
XTestExtensionInit(INITARGS)
|
||||||
{
|
{
|
||||||
#if 0
|
AddExtension(XTestExtensionName, 0, 0,
|
||||||
ExtensionEntry *extEntry;
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension(XTestExtensionName, 0, 0,
|
|
||||||
ProcXTestDispatch, SProcXTestDispatch,
|
|
||||||
XTestResetProc, StandardMinorOpcode)) != 0)
|
|
||||||
XTestReqCode = (unsigned char)extEntry->base;
|
|
||||||
#else
|
|
||||||
(void) AddExtension(XTestExtensionName, 0, 0,
|
|
||||||
ProcXTestDispatch, SProcXTestDispatch,
|
ProcXTestDispatch, SProcXTestDispatch,
|
||||||
XTestResetProc, StandardMinorOpcode);
|
XTestResetProc, StandardMinorOpcode);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
|
@ -140,22 +126,23 @@ ProcXTestCompareCursor(client)
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
CursorPtr pCursor;
|
CursorPtr pCursor;
|
||||||
int n, rc;
|
int n, rc;
|
||||||
DeviceIntPtr pointer = PickPointer(client);
|
DeviceIntPtr ptr = PickPointer(client);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
|
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
if (stuff->cursor == None)
|
if (stuff->cursor == None)
|
||||||
pCursor = NullCursor;
|
pCursor = NullCursor;
|
||||||
else if (stuff->cursor == XTestCurrentCursor)
|
else if (stuff->cursor == XTestCurrentCursor)
|
||||||
pCursor = GetSpriteCursor(pointer);
|
pCursor = GetSpriteCursor(ptr);
|
||||||
else {
|
else {
|
||||||
pCursor = (CursorPtr)LookupIDByType(stuff->cursor, RT_CURSOR);
|
rc = dixLookupResource((pointer *)&pCursor, stuff->cursor, RT_CURSOR,
|
||||||
if (!pCursor)
|
client, DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
{
|
{
|
||||||
client->errorValue = stuff->cursor;
|
client->errorValue = stuff->cursor;
|
||||||
return (BadCursor);
|
return (rc == BadValue) ? BadCursor : rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
|
@ -287,11 +274,12 @@ ProcXTestFakeInput(client)
|
||||||
#ifdef XINPUT
|
#ifdef XINPUT
|
||||||
if (extension)
|
if (extension)
|
||||||
{
|
{
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid & 0177);
|
rc = dixLookupDevice(&dev, stuff->deviceid & 0177, client,
|
||||||
if (!dev)
|
DixWriteAccess);
|
||||||
|
if (rc != Success)
|
||||||
{
|
{
|
||||||
client->errorValue = stuff->deviceid & 0177;
|
client->errorValue = stuff->deviceid & 0177;
|
||||||
return BadValue;
|
return rc;
|
||||||
}
|
}
|
||||||
if (nev > 1)
|
if (nev > 1)
|
||||||
{
|
{
|
||||||
|
@ -368,7 +356,7 @@ ProcXTestFakeInput(client)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rc = dixLookupWindow(&root, ev->u.keyButtonPointer.root, client,
|
rc = dixLookupWindow(&root, ev->u.keyButtonPointer.root, client,
|
||||||
DixUnknownAccess);
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
if (root->parent)
|
if (root->parent)
|
||||||
|
@ -461,7 +449,7 @@ ProcXTestFakeInput(client)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (screenIsSaved == SCREEN_SAVER_ON)
|
if (screenIsSaved == SCREEN_SAVER_ON)
|
||||||
SaveScreens(SCREEN_SAVER_OFF, ScreenSaverReset);
|
dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset);
|
||||||
ev->u.keyButtonPointer.time = currentTime.milliseconds;
|
ev->u.keyButtonPointer.time = currentTime.milliseconds;
|
||||||
(*dev->public.processInputProc)(ev, dev, nev);
|
(*dev->public.processInputProc)(ev, dev, nev);
|
||||||
return client->noClientException;
|
return client->noClientException;
|
||||||
|
|
895
Xext/xvdisp.c
895
Xext/xvdisp.c
File diff suppressed because it is too large
Load Diff
|
@ -1 +1,2 @@
|
||||||
extern void XineramifyXv(void);
|
extern void XineramifyXv(void);
|
||||||
|
extern void XvResetProcVector(void);
|
||||||
|
|
|
@ -55,7 +55,6 @@ SOFTWARE.
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include <X11/extensions/Xvproto.h>
|
#include <X11/extensions/Xvproto.h>
|
||||||
|
|
||||||
extern int XvScreenIndex;
|
|
||||||
extern unsigned long XvExtensionGeneration;
|
extern unsigned long XvExtensionGeneration;
|
||||||
extern unsigned long XvScreenGeneration;
|
extern unsigned long XvScreenGeneration;
|
||||||
extern unsigned long XvResourceGeneration;
|
extern unsigned long XvResourceGeneration;
|
||||||
|
@ -224,10 +223,8 @@ typedef struct {
|
||||||
DevUnion devPriv;
|
DevUnion devPriv;
|
||||||
} XvScreenRec, *XvScreenPtr;
|
} XvScreenRec, *XvScreenPtr;
|
||||||
|
|
||||||
#define SCREEN_PROLOGUE(pScreen, field)\
|
#define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = ((XvScreenPtr) \
|
||||||
((pScreen)->field = \
|
dixLookupPrivate(&(pScreen)->devPrivates, XvScreenKey))->field)
|
||||||
((XvScreenPtr) \
|
|
||||||
(pScreen)->devPrivates[XvScreenIndex].ptr)->field)
|
|
||||||
|
|
||||||
#define SCREEN_EPILOGUE(pScreen, field, wrapper)\
|
#define SCREEN_EPILOGUE(pScreen, field, wrapper)\
|
||||||
((pScreen)->field = wrapper)
|
((pScreen)->field = wrapper)
|
||||||
|
@ -242,7 +239,7 @@ extern int SProcXvDispatch(ClientPtr);
|
||||||
|
|
||||||
extern void XvExtensionInit(void);
|
extern void XvExtensionInit(void);
|
||||||
extern int XvScreenInit(ScreenPtr);
|
extern int XvScreenInit(ScreenPtr);
|
||||||
extern int XvGetScreenIndex(void);
|
extern DevPrivateKey XvGetScreenKey(void);
|
||||||
extern unsigned long XvGetRTPort(void);
|
extern unsigned long XvGetRTPort(void);
|
||||||
extern int XvdiSendPortNotify(XvPortPtr, Atom, INT32);
|
extern int XvdiSendPortNotify(XvPortPtr, Atom, INT32);
|
||||||
extern int XvdiVideoStopped(XvPortPtr, int);
|
extern int XvdiVideoStopped(XvPortPtr, int);
|
||||||
|
|
|
@ -102,10 +102,10 @@ SOFTWARE.
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
#include "panoramiX.h"
|
#include "panoramiX.h"
|
||||||
#include "panoramiXsrv.h"
|
#include "panoramiXsrv.h"
|
||||||
#include "xvdisp.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
#include "xvdisp.h"
|
||||||
|
|
||||||
int XvScreenIndex = -1;
|
static DevPrivateKey XvScreenKey = &XvScreenKey;
|
||||||
unsigned long XvExtensionGeneration = 0;
|
unsigned long XvExtensionGeneration = 0;
|
||||||
unsigned long XvScreenGeneration = 0;
|
unsigned long XvScreenGeneration = 0;
|
||||||
unsigned long XvResourceGeneration = 0;
|
unsigned long XvResourceGeneration = 0;
|
||||||
|
@ -166,12 +166,6 @@ XvExtensionInit(void)
|
||||||
ErrorF("XvExtensionInit: Unable to allocate resource types\n");
|
ErrorF("XvExtensionInit: Unable to allocate resource types\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
XvScreenIndex = AllocateScreenPrivateIndex ();
|
|
||||||
if (XvScreenIndex < 0)
|
|
||||||
{
|
|
||||||
ErrorF("XvExtensionInit: Unable to allocate screen private index\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
XineramaRegisterConnectionBlockCallback(XineramifyXv);
|
XineramaRegisterConnectionBlockCallback(XineramifyXv);
|
||||||
#endif
|
#endif
|
||||||
|
@ -265,19 +259,13 @@ XvScreenInit(ScreenPtr pScreen)
|
||||||
ErrorF("XvScreenInit: Unable to allocate resource types\n");
|
ErrorF("XvScreenInit: Unable to allocate resource types\n");
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
XvScreenIndex = AllocateScreenPrivateIndex ();
|
|
||||||
if (XvScreenIndex < 0)
|
|
||||||
{
|
|
||||||
ErrorF("XvScreenInit: Unable to allocate screen private index\n");
|
|
||||||
return BadAlloc;
|
|
||||||
}
|
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
XineramaRegisterConnectionBlockCallback(XineramifyXv);
|
XineramaRegisterConnectionBlockCallback(XineramifyXv);
|
||||||
#endif
|
#endif
|
||||||
XvScreenGeneration = serverGeneration;
|
XvScreenGeneration = serverGeneration;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pScreen->devPrivates[XvScreenIndex].ptr)
|
if (dixLookupPrivate(&pScreen->devPrivates, XvScreenKey))
|
||||||
{
|
{
|
||||||
ErrorF("XvScreenInit: screen devPrivates ptr non-NULL before init\n");
|
ErrorF("XvScreenInit: screen devPrivates ptr non-NULL before init\n");
|
||||||
}
|
}
|
||||||
|
@ -291,7 +279,7 @@ XvScreenInit(ScreenPtr pScreen)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
pScreen->devPrivates[XvScreenIndex].ptr = (pointer)pxvs;
|
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, pxvs);
|
||||||
|
|
||||||
|
|
||||||
pxvs->DestroyPixmap = pScreen->DestroyPixmap;
|
pxvs->DestroyPixmap = pScreen->DestroyPixmap;
|
||||||
|
@ -313,7 +301,7 @@ XvCloseScreen(
|
||||||
|
|
||||||
XvScreenPtr pxvs;
|
XvScreenPtr pxvs;
|
||||||
|
|
||||||
pxvs = (XvScreenPtr) pScreen->devPrivates[XvScreenIndex].ptr;
|
pxvs = (XvScreenPtr)dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
|
||||||
|
|
||||||
pScreen->DestroyPixmap = pxvs->DestroyPixmap;
|
pScreen->DestroyPixmap = pxvs->DestroyPixmap;
|
||||||
pScreen->DestroyWindow = pxvs->DestroyWindow;
|
pScreen->DestroyWindow = pxvs->DestroyWindow;
|
||||||
|
@ -323,21 +311,21 @@ XvCloseScreen(
|
||||||
|
|
||||||
xfree(pxvs);
|
xfree(pxvs);
|
||||||
|
|
||||||
pScreen->devPrivates[XvScreenIndex].ptr = (pointer)NULL;
|
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL);
|
||||||
|
|
||||||
return (*pScreen->CloseScreen)(ii, pScreen);
|
return (*pScreen->CloseScreen)(ii, pScreen);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
XvResetProc(ExtensionEntry* extEntry)
|
XvResetProc(ExtensionEntry* extEntry)
|
||||||
{
|
{
|
||||||
|
XvResetProcVector();
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT int
|
_X_EXPORT DevPrivateKey
|
||||||
XvGetScreenIndex(void)
|
XvGetScreenKey(void)
|
||||||
{
|
{
|
||||||
return XvScreenIndex;
|
return XvScreenKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT unsigned long
|
_X_EXPORT unsigned long
|
||||||
|
@ -361,7 +349,7 @@ XvDestroyPixmap(PixmapPtr pPix)
|
||||||
|
|
||||||
SCREEN_PROLOGUE(pScreen, DestroyPixmap);
|
SCREEN_PROLOGUE(pScreen, DestroyPixmap);
|
||||||
|
|
||||||
pxvs = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr;
|
pxvs = (XvScreenPtr)dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
|
||||||
|
|
||||||
/* CHECK TO SEE IF THIS PORT IS IN USE */
|
/* CHECK TO SEE IF THIS PORT IS IN USE */
|
||||||
|
|
||||||
|
@ -413,7 +401,7 @@ XvDestroyWindow(WindowPtr pWin)
|
||||||
|
|
||||||
SCREEN_PROLOGUE(pScreen, DestroyWindow);
|
SCREEN_PROLOGUE(pScreen, DestroyWindow);
|
||||||
|
|
||||||
pxvs = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr;
|
pxvs = (XvScreenPtr)dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
|
||||||
|
|
||||||
/* CHECK TO SEE IF THIS PORT IS IN USE */
|
/* CHECK TO SEE IF THIS PORT IS IN USE */
|
||||||
|
|
||||||
|
|
23
Xext/xvmc.c
23
Xext/xvmc.c
|
@ -39,7 +39,7 @@
|
||||||
#define DR_CLIENT_DRIVER_NAME_SIZE 48
|
#define DR_CLIENT_DRIVER_NAME_SIZE 48
|
||||||
#define DR_BUSID_SIZE 48
|
#define DR_BUSID_SIZE 48
|
||||||
|
|
||||||
int XvMCScreenIndex = -1;
|
static DevPrivateKey XvMCScreenKey = NULL;
|
||||||
|
|
||||||
unsigned long XvMCGeneration = 0;
|
unsigned long XvMCGeneration = 0;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ typedef struct {
|
||||||
} XvMCScreenRec, *XvMCScreenPtr;
|
} XvMCScreenRec, *XvMCScreenPtr;
|
||||||
|
|
||||||
#define XVMC_GET_PRIVATE(pScreen) \
|
#define XVMC_GET_PRIVATE(pScreen) \
|
||||||
(XvMCScreenPtr)((pScreen)->devPrivates[XvMCScreenIndex].ptr)
|
(XvMCScreenPtr)(dixLookupPrivate(&(pScreen)->devPrivates, XvMCScreenKey))
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -153,7 +153,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
|
||||||
return _XvBadPort;
|
return _XvBadPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(XvMCScreenIndex >= 0) { /* any adaptors at all */
|
if(XvMCScreenKey) { /* any adaptors at all */
|
||||||
ScreenPtr pScreen = pPort->pAdaptor->pScreen;
|
ScreenPtr pScreen = pPort->pAdaptor->pScreen;
|
||||||
if((pScreenPriv = XVMC_GET_PRIVATE(pScreen))) { /* any this screen */
|
if((pScreenPriv = XVMC_GET_PRIVATE(pScreen))) { /* any this screen */
|
||||||
for(i = 0; i < pScreenPriv->num_adaptors; i++) {
|
for(i = 0; i < pScreenPriv->num_adaptors; i++) {
|
||||||
|
@ -211,7 +211,7 @@ ProcXvMCCreateContext(ClientPtr client)
|
||||||
|
|
||||||
pScreen = pPort->pAdaptor->pScreen;
|
pScreen = pPort->pAdaptor->pScreen;
|
||||||
|
|
||||||
if(XvMCScreenIndex < 0) /* no XvMC adaptors */
|
if(XvMCScreenKey == NULL) /* no XvMC adaptors */
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) /* none this screen */
|
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) /* none this screen */
|
||||||
|
@ -494,7 +494,7 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
|
||||||
|
|
||||||
pScreen = pPort->pAdaptor->pScreen;
|
pScreen = pPort->pAdaptor->pScreen;
|
||||||
|
|
||||||
if(XvMCScreenIndex < 0) /* No XvMC adaptors */
|
if(XvMCScreenKey == NULL) /* No XvMC adaptors */
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
|
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
|
||||||
|
@ -679,7 +679,7 @@ XvMCExtensionInit(void)
|
||||||
{
|
{
|
||||||
ExtensionEntry *extEntry;
|
ExtensionEntry *extEntry;
|
||||||
|
|
||||||
if(XvMCScreenIndex < 0) /* nobody supports it */
|
if(XvMCScreenKey == NULL) /* nobody supports it */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes)))
|
if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes)))
|
||||||
|
@ -720,17 +720,12 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt)
|
||||||
{
|
{
|
||||||
XvMCScreenPtr pScreenPriv;
|
XvMCScreenPtr pScreenPriv;
|
||||||
|
|
||||||
if(XvMCGeneration != serverGeneration) {
|
XvMCScreenKey = &XvMCScreenKey;
|
||||||
if((XvMCScreenIndex = AllocateScreenPrivateIndex()) < 0)
|
|
||||||
return BadAlloc;
|
|
||||||
|
|
||||||
XvMCGeneration = serverGeneration;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!(pScreenPriv = (XvMCScreenPtr)xalloc(sizeof(XvMCScreenRec))))
|
if(!(pScreenPriv = (XvMCScreenPtr)xalloc(sizeof(XvMCScreenRec))))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
pScreen->devPrivates[XvMCScreenIndex].ptr = (pointer)pScreenPriv;
|
dixSetPrivate(&pScreen->devPrivates, XvMCScreenKey, pScreenPriv);
|
||||||
|
|
||||||
pScreenPriv->CloseScreen = pScreen->CloseScreen;
|
pScreenPriv->CloseScreen = pScreen->CloseScreen;
|
||||||
pScreen->CloseScreen = XvMCCloseScreen;
|
pScreen->CloseScreen = XvMCCloseScreen;
|
||||||
|
@ -754,7 +749,7 @@ XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id)
|
||||||
XvMCAdaptorPtr adaptor = NULL;
|
XvMCAdaptorPtr adaptor = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(XvMCScreenIndex < 0) return NULL;
|
if(XvMCScreenKey == NULL) return NULL;
|
||||||
|
|
||||||
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
|
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "allowev.h"
|
#include "allowev.h"
|
||||||
|
@ -95,13 +94,14 @@ ProcXAllowDeviceEvents(ClientPtr client)
|
||||||
{
|
{
|
||||||
TimeStamp time;
|
TimeStamp time;
|
||||||
DeviceIntPtr thisdev;
|
DeviceIntPtr thisdev;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xAllowDeviceEventsReq);
|
REQUEST(xAllowDeviceEventsReq);
|
||||||
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
|
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
|
||||||
|
|
||||||
thisdev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&thisdev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (thisdev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
time = ClientTimeToServerTime(stuff->time);
|
time = ClientTimeToServerTime(stuff->time);
|
||||||
|
|
||||||
switch (stuff->mode) {
|
switch (stuff->mode) {
|
||||||
|
|
|
@ -40,7 +40,6 @@ from the author.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -119,13 +118,12 @@ ProcXChangeWindowAccess(ClientPtr client)
|
||||||
/* if one of the devices cannot be accessed, we don't do anything.*/
|
/* if one of the devices cannot be accessed, we don't do anything.*/
|
||||||
for (i = 0; i < stuff->npermit; i++)
|
for (i = 0; i < stuff->npermit; i++)
|
||||||
{
|
{
|
||||||
perm_devices[i] = LookupDeviceIntRec(deviceids[i]);
|
err = dixLookupDevice(&perm_devices[i], deviceids[i], client,
|
||||||
if (!perm_devices[i])
|
DixWriteAccess);
|
||||||
|
if (err != Success)
|
||||||
{
|
{
|
||||||
xfree(perm_devices);
|
xfree(perm_devices);
|
||||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
|
return err;
|
||||||
deviceids[i], BadDevice);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,16 +144,15 @@ ProcXChangeWindowAccess(ClientPtr client)
|
||||||
|
|
||||||
for (i = 0; i < stuff->ndeny; i++)
|
for (i = 0; i < stuff->ndeny; i++)
|
||||||
{
|
{
|
||||||
deny_devices[i] =
|
err = dixLookupDevice(&deny_devices[i],
|
||||||
LookupDeviceIntRec(deviceids[i+stuff->npermit]);
|
deviceids[i+stuff->npermit],
|
||||||
|
client,
|
||||||
if (!deny_devices[i])
|
DixWriteAccess);
|
||||||
|
if (err != Success)
|
||||||
{
|
{
|
||||||
xfree(perm_devices);
|
xfree(perm_devices);
|
||||||
xfree(deny_devices);
|
xfree(deny_devices);
|
||||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
|
return err;
|
||||||
deviceids[i + stuff->npermit], BadDevice);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,9 +46,9 @@ from the author.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
#include "input.h"
|
||||||
|
|
||||||
#include "chdevcur.h"
|
#include "chdevcur.h"
|
||||||
|
|
||||||
|
@ -79,22 +79,15 @@ int ProcXChangeDeviceCursor(ClientPtr client)
|
||||||
REQUEST(xChangeDeviceCursorReq);
|
REQUEST(xChangeDeviceCursorReq);
|
||||||
REQUEST_SIZE_MATCH(xChangeDeviceCursorReq);
|
REQUEST_SIZE_MATCH(xChangeDeviceCursorReq);
|
||||||
|
|
||||||
pDev = LookupDeviceIntRec(stuff->deviceid);
|
err = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (pDev == NULL) {
|
if (err != Success)
|
||||||
SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor, 0,
|
return err;
|
||||||
BadDevice);
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stuff->win != None)
|
if (stuff->win != None)
|
||||||
{
|
{
|
||||||
err = dixLookupWindow(&pWin, stuff->win, client, DixReadWriteAccess);
|
err = dixLookupWindow(&pWin, stuff->win, client, DixSetAttrAccess);
|
||||||
if (err != Success)
|
if (err != Success)
|
||||||
{
|
return err;
|
||||||
SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor,
|
|
||||||
stuff->win, err);
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stuff->cursor == None)
|
if (stuff->cursor == None)
|
||||||
|
|
|
@ -49,7 +49,6 @@ from the author.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include <X11/extensions/geproto.h>
|
#include <X11/extensions/geproto.h>
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "geext.h"
|
#include "geext.h"
|
||||||
|
@ -83,6 +82,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
||||||
xAnyHierarchyChangeInfo *any;
|
xAnyHierarchyChangeInfo *any;
|
||||||
int required_len = sizeof(xChangeDeviceHierarchyReq);
|
int required_len = sizeof(xChangeDeviceHierarchyReq);
|
||||||
char n;
|
char n;
|
||||||
|
int rc;
|
||||||
deviceHierarchyChangedEvent ev;
|
deviceHierarchyChangedEvent ev;
|
||||||
|
|
||||||
REQUEST(xChangeDeviceHierarchyReq);
|
REQUEST(xChangeDeviceHierarchyReq);
|
||||||
|
@ -142,9 +142,16 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
||||||
r->returnMode != Floating)
|
r->returnMode != Floating)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
ptr = LookupDeviceIntRec(r->deviceid);
|
rc = dixLookupDevice(&ptr, r->deviceid, client,
|
||||||
if (!ptr || !ptr->isMaster)
|
DixWriteAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
if (!ptr->isMaster)
|
||||||
|
{
|
||||||
|
client->errorValue = r->deviceid;
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
}
|
||||||
|
|
||||||
/* XXX: For now, don't allow removal of VCP, VCK */
|
/* XXX: For now, don't allow removal of VCP, VCK */
|
||||||
if (ptr == inputInfo.pointer ||
|
if (ptr == inputInfo.pointer ||
|
||||||
|
@ -168,11 +175,27 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
||||||
newptr,
|
newptr,
|
||||||
newkeybd;
|
newkeybd;
|
||||||
|
|
||||||
newptr = LookupDeviceIntRec(r->returnPointer);
|
rc = dixLookupDevice(&newptr, r->returnPointer,
|
||||||
newkeybd = LookupDeviceIntRec(r->returnKeyboard);
|
client, DixWriteAccess);
|
||||||
if (!newptr || !newptr->isMaster ||
|
if (rc != Success)
|
||||||
!newkeybd || !newkeybd->isMaster)
|
return rc;
|
||||||
|
|
||||||
|
if (!newptr->isMaster)
|
||||||
|
{
|
||||||
|
client->errorValue = r->returnPointer;
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = dixLookupDevice(&newkeybd, r->returnKeyboard,
|
||||||
|
client, DixWriteAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
if (!newkeybd->isMaster)
|
||||||
|
{
|
||||||
|
client->errorValue = r->returnKeyboard;
|
||||||
|
return BadDevice;
|
||||||
|
}
|
||||||
|
|
||||||
for (attached = inputInfo.devices;
|
for (attached = inputInfo.devices;
|
||||||
attached;
|
attached;
|
||||||
|
@ -201,17 +224,31 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
||||||
{
|
{
|
||||||
xChangeAttachmentInfo* c = (xChangeAttachmentInfo*)any;
|
xChangeAttachmentInfo* c = (xChangeAttachmentInfo*)any;
|
||||||
|
|
||||||
ptr = LookupDeviceIntRec(c->deviceid);
|
rc = dixLookupDevice(&ptr, c->deviceid, client,
|
||||||
if (!ptr || ptr->isMaster)
|
DixWriteAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
if (ptr->isMaster)
|
||||||
|
{
|
||||||
|
client->errorValue = c->deviceid;
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
}
|
||||||
|
|
||||||
if (c->changeMode == Floating)
|
if (c->changeMode == Floating)
|
||||||
AttachDevice(client, ptr, NULL);
|
AttachDevice(client, ptr, NULL);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DeviceIntPtr newmaster = LookupDeviceIntRec(c->newMaster);
|
DeviceIntPtr newmaster;
|
||||||
if (!newmaster || !newmaster->isMaster)
|
rc = dixLookupDevice(&newmaster, c->newMaster,
|
||||||
|
client, DixWriteAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
if (!newmaster->isMaster)
|
||||||
|
{
|
||||||
|
client->errorValue = c->newMaster;
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
}
|
||||||
|
|
||||||
if ((IsPointerDevice(newmaster) &&
|
if ((IsPointerDevice(newmaster) &&
|
||||||
!IsPointerDevice(ptr)) ||
|
!IsPointerDevice(ptr)) ||
|
||||||
|
|
|
@ -61,7 +61,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h> /* control constants */
|
#include <X11/extensions/XIproto.h> /* control constants */
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
|
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
|
|
||||||
|
@ -112,11 +111,9 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
|
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
|
||||||
|
|
||||||
len = stuff->length - (sizeof(xChangeDeviceControlReq) >> 2);
|
len = stuff->length - (sizeof(xChangeDeviceControlReq) >> 2);
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (dev == NULL) {
|
if (ret != Success)
|
||||||
ret = BadDevice;
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep.repType = X_Reply;
|
||||||
rep.RepType = X_ChangeDeviceControl;
|
rep.RepType = X_ChangeDeviceControl;
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h> /* control constants */
|
#include <X11/extensions/XIproto.h> /* control constants */
|
||||||
|
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "chgfctl.h"
|
#include "chgfctl.h"
|
||||||
|
@ -444,14 +443,15 @@ ProcXChangeFeedbackControl(ClientPtr client)
|
||||||
StringFeedbackPtr s;
|
StringFeedbackPtr s;
|
||||||
BellFeedbackPtr b;
|
BellFeedbackPtr b;
|
||||||
LedFeedbackPtr l;
|
LedFeedbackPtr l;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xChangeFeedbackControlReq);
|
REQUEST(xChangeFeedbackControlReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
||||||
|
|
||||||
len = stuff->length - (sizeof(xChangeFeedbackControlReq) >> 2);
|
len = stuff->length - (sizeof(xChangeFeedbackControlReq) >> 2);
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
switch (stuff->feedbackid) {
|
switch (stuff->feedbackid) {
|
||||||
case KbdFeedbackClass:
|
case KbdFeedbackClass:
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -107,9 +106,9 @@ ProcXChangeDeviceKeyMapping(ClientPtr client)
|
||||||
REQUEST(xChangeDeviceKeyMappingReq);
|
REQUEST(xChangeDeviceKeyMappingReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
|
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (dev == NULL)
|
if (ret != Success)
|
||||||
return BadDevice;
|
return ret;
|
||||||
len = stuff->length - (sizeof(xChangeDeviceKeyMappingReq) >> 2);
|
len = stuff->length - (sizeof(xChangeDeviceKeyMappingReq) >> 2);
|
||||||
|
|
||||||
ret = ChangeKeyMapping(client, dev, len, DeviceMappingNotify,
|
ret = ChangeKeyMapping(client, dev, len, DeviceMappingNotify,
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
@ -115,7 +114,7 @@ ProcXChangeDeviceDontPropagateList(ClientPtr client)
|
||||||
stuff->count)
|
stuff->count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
|
@ -63,8 +63,6 @@ SOFTWARE.
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include "scrnintstr.h" /* screen structure */
|
#include "scrnintstr.h" /* screen structure */
|
||||||
|
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
|
|
||||||
#include "dixevents.h"
|
#include "dixevents.h"
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
|
@ -62,7 +62,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "closedev.h"
|
#include "closedev.h"
|
||||||
|
@ -140,16 +139,16 @@ DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcXCloseDevice(ClientPtr client)
|
ProcXCloseDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
int i;
|
int rc, i;
|
||||||
WindowPtr pWin, p1;
|
WindowPtr pWin, p1;
|
||||||
DeviceIntPtr d;
|
DeviceIntPtr d;
|
||||||
|
|
||||||
REQUEST(xCloseDeviceReq);
|
REQUEST(xCloseDeviceReq);
|
||||||
REQUEST_SIZE_MATCH(xCloseDeviceReq);
|
REQUEST_SIZE_MATCH(xCloseDeviceReq);
|
||||||
|
|
||||||
d = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&d, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (d == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
if (d->deviceGrab.grab && SameClient(d->deviceGrab.grab, client))
|
if (d->deviceGrab.grab && SameClient(d->deviceGrab.grab, client))
|
||||||
(*d->deviceGrab.DeactivateGrab) (d); /* release active grab */
|
(*d->deviceGrab.DeactivateGrab) (d); /* release active grab */
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "devbell.h"
|
#include "devbell.h"
|
||||||
|
@ -93,7 +92,7 @@ ProcXDeviceBell(ClientPtr client)
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
KbdFeedbackPtr k;
|
KbdFeedbackPtr k;
|
||||||
BellFeedbackPtr b;
|
BellFeedbackPtr b;
|
||||||
int base;
|
int rc, base;
|
||||||
int newpercent;
|
int newpercent;
|
||||||
CARD8 class;
|
CARD8 class;
|
||||||
pointer ctrl;
|
pointer ctrl;
|
||||||
|
@ -102,10 +101,10 @@ ProcXDeviceBell(ClientPtr client)
|
||||||
REQUEST(xDeviceBellReq);
|
REQUEST(xDeviceBellReq);
|
||||||
REQUEST_SIZE_MATCH(xDeviceBellReq);
|
REQUEST_SIZE_MATCH(xDeviceBellReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixBellAccess);
|
||||||
if (dev == NULL) {
|
if (rc != Success) {
|
||||||
client->errorValue = stuff->deviceid;
|
client->errorValue = stuff->deviceid;
|
||||||
return BadDevice;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stuff->percent < -100 || stuff->percent > 100) {
|
if (stuff->percent < -100 || stuff->percent > 100) {
|
||||||
|
|
|
@ -68,12 +68,12 @@ SOFTWARE.
|
||||||
#include "region.h"
|
#include "region.h"
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "dixevents.h" /* DeliverFocusedEvent */
|
#include "dixevents.h" /* DeliverFocusedEvent */
|
||||||
#include "dixgrabs.h" /* CreateGrab() */
|
#include "dixgrabs.h" /* CreateGrab() */
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "listdev.h" /* for CopySwapXXXClass */
|
#include "listdev.h" /* for CopySwapXXXClass */
|
||||||
|
#include "xace.h"
|
||||||
|
|
||||||
#ifdef XKB
|
#ifdef XKB
|
||||||
#include <X11/extensions/XKBproto.h>
|
#include <X11/extensions/XKBproto.h>
|
||||||
|
@ -144,7 +144,8 @@ CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master)
|
||||||
dk = device->key;
|
dk = device->key;
|
||||||
mk = master->key;
|
mk = master->key;
|
||||||
|
|
||||||
if (master->devPrivates[CoreDevicePrivatesIndex].ptr != device) {
|
if (device != dixLookupPrivate(&master->devPrivates,
|
||||||
|
CoreDevicePrivateKey)) {
|
||||||
memcpy(mk->modifierMap, dk->modifierMap, MAP_LENGTH);
|
memcpy(mk->modifierMap, dk->modifierMap, MAP_LENGTH);
|
||||||
|
|
||||||
if (dk->maxKeysPerModifier)
|
if (dk->maxKeysPerModifier)
|
||||||
|
@ -189,7 +190,7 @@ CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
master->devPrivates[CoreDevicePrivatesIndex].ptr = device;
|
dixSetPrivate(&master->devPrivates, CoreDevicePrivateKey, device);
|
||||||
sendNotify = TRUE;
|
sendNotify = TRUE;
|
||||||
} else if (lastMapNotifyDevice != master)
|
} else if (lastMapNotifyDevice != master)
|
||||||
sendNotify = TRUE;
|
sendNotify = TRUE;
|
||||||
|
@ -695,7 +696,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
|
||||||
(key == device->deviceGrab.activatingKey))
|
(key == device->deviceGrab.activatingKey))
|
||||||
deactivateDeviceGrab = TRUE;
|
deactivateDeviceGrab = TRUE;
|
||||||
} else if (xE->u.u.type == DeviceButtonPress) {
|
} else if (xE->u.u.type == DeviceButtonPress) {
|
||||||
xE->u.u.detail = b->map[key];
|
xE->u.u.detail = key;
|
||||||
if (xE->u.u.detail == 0)
|
if (xE->u.u.detail == 0)
|
||||||
return;
|
return;
|
||||||
if (!grab)
|
if (!grab)
|
||||||
|
@ -712,7 +713,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (xE->u.u.type == DeviceButtonRelease) {
|
} else if (xE->u.u.type == DeviceButtonRelease) {
|
||||||
xE->u.u.detail = b->map[key];
|
xE->u.u.detail = key;
|
||||||
if (xE->u.u.detail == 0)
|
if (xE->u.u.detail == 0)
|
||||||
return;
|
return;
|
||||||
if (!b->state && device->deviceGrab.fromPassiveGrab)
|
if (!b->state && device->deviceGrab.fromPassiveGrab)
|
||||||
|
@ -970,6 +971,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
||||||
WindowPtr pWin, confineTo;
|
WindowPtr pWin, confineTo;
|
||||||
CursorPtr cursor;
|
CursorPtr cursor;
|
||||||
GrabPtr grab;
|
GrabPtr grab;
|
||||||
|
Mask access_mode = DixGrabAccess;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if ((this_device_mode != GrabModeSync) &&
|
if ((this_device_mode != GrabModeSync) &&
|
||||||
|
@ -990,25 +992,33 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
||||||
client->errorValue = ownerEvents;
|
client->errorValue = ownerEvents;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
rc = dixLookupWindow(&pWin, grabWindow, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, grabWindow, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
if (rconfineTo == None)
|
if (rconfineTo == None)
|
||||||
confineTo = NullWindow;
|
confineTo = NullWindow;
|
||||||
else {
|
else {
|
||||||
rc = dixLookupWindow(&confineTo, rconfineTo, client, DixUnknownAccess);
|
rc = dixLookupWindow(&confineTo, rconfineTo, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
if (rcursor == None)
|
if (rcursor == None)
|
||||||
cursor = NullCursor;
|
cursor = NullCursor;
|
||||||
else {
|
else {
|
||||||
cursor = (CursorPtr) LookupIDByType(rcursor, RT_CURSOR);
|
rc = dixLookupResource((pointer *)&cursor, rcursor, RT_CURSOR,
|
||||||
if (!cursor) {
|
client, DixUseAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
{
|
||||||
client->errorValue = rcursor;
|
client->errorValue = rcursor;
|
||||||
return BadCursor;
|
return (rc == BadValue) ? BadCursor : rc;
|
||||||
}
|
}
|
||||||
|
access_mode |= DixForceAccess;
|
||||||
}
|
}
|
||||||
|
if (this_device_mode == GrabModeSync || other_devices_mode == GrabModeSync)
|
||||||
|
access_mode |= DixFreezeAccess;
|
||||||
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
grab = CreateGrab(client->index, dev, pWin, eventMask,
|
grab = CreateGrab(client->index, dev, pWin, eventMask,
|
||||||
(Bool) ownerEvents, (Bool) this_device_mode,
|
(Bool) ownerEvents, (Bool) this_device_mode,
|
||||||
|
@ -1016,7 +1026,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
||||||
DeviceButtonPress, button, confineTo, cursor);
|
DeviceButtonPress, button, confineTo, cursor);
|
||||||
if (!grab)
|
if (!grab)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
return AddPassiveGrabToList(grab);
|
return AddPassiveGrabToList(client, grab);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -1028,6 +1038,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
GrabPtr grab;
|
GrabPtr grab;
|
||||||
KeyClassPtr k = dev->key;
|
KeyClassPtr k = dev->key;
|
||||||
|
Mask access_mode = DixGrabAccess;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (k == NULL)
|
if (k == NULL)
|
||||||
|
@ -1055,7 +1066,12 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
||||||
client->errorValue = ownerEvents;
|
client->errorValue = ownerEvents;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
rc = dixLookupWindow(&pWin, grabWindow, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, grabWindow, client, DixSetAttrAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
if (this_device_mode == GrabModeSync || other_devices_mode == GrabModeSync)
|
||||||
|
access_mode |= DixFreezeAccess;
|
||||||
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
@ -1065,7 +1081,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
||||||
NullWindow, NullCursor);
|
NullWindow, NullCursor);
|
||||||
if (!grab)
|
if (!grab)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
return AddPassiveGrabToList(grab);
|
return AddPassiveGrabToList(client, grab);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -1296,7 +1312,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
|
||||||
if (!mask)
|
if (!mask)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else
|
} else if (!XaceHook(XACE_SEND_ACCESS, client, NULL, pWin, ev, count))
|
||||||
(void)(DeliverEventsToWindow(d, pWin, ev, count, mask, NullGrab, d->id));
|
(void)(DeliverEventsToWindow(d, pWin, ev, count, mask, NullGrab, d->id));
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -1560,7 +1576,8 @@ MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer * pEvents, Mask mask)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(pEvents->deviceid & DEVICE_BITS);
|
dixLookupDevice(&dev, pEvents->deviceid & DEVICE_BITS, serverClient,
|
||||||
|
DixReadAccess);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -1584,7 +1601,8 @@ CheckDeviceGrabAndHintWindow(WindowPtr pWin, int type,
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(xE->deviceid & DEVICE_BITS);
|
dixLookupDevice(&dev, xE->deviceid & DEVICE_BITS, serverClient,
|
||||||
|
DixReadAccess);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,6 @@ from the author.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include <X11/extensions/Xge.h>
|
#include <X11/extensions/Xge.h>
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -127,10 +126,8 @@ ProcXExtendedGrabDevice(ClientPtr client)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
err = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
|
||||||
if (dev == NULL) {
|
if (err != Success) {
|
||||||
errval = stuff->deviceid;
|
|
||||||
err = BadDevice;
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,9 +221,7 @@ cleanup:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SendErrorToClient(client, IReqCode,
|
return err;
|
||||||
X_ExtendedGrabDevice,
|
|
||||||
errval, err);
|
|
||||||
}
|
}
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
25
Xi/extinit.c
25
Xi/extinit.c
|
@ -71,6 +71,7 @@ SOFTWARE.
|
||||||
#include "extinit.h"
|
#include "extinit.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
|
#include "registry.h"
|
||||||
|
|
||||||
/* modules local to Xi */
|
/* modules local to Xi */
|
||||||
#include "allowev.h"
|
#include "allowev.h"
|
||||||
|
@ -1099,29 +1100,6 @@ MakeDeviceTypeAtoms(void)
|
||||||
MakeAtom(dev_type[i].name, strlen(dev_type[i].name), 1);
|
MakeAtom(dev_type[i].name, strlen(dev_type[i].name), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
* Return a DeviceIntPtr corresponding to a specified device id.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
DeviceIntPtr
|
|
||||||
LookupDeviceIntRec(CARD8 id)
|
|
||||||
{
|
|
||||||
DeviceIntPtr dev;
|
|
||||||
|
|
||||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
|
||||||
if (dev->id == id)
|
|
||||||
return dev;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (dev = inputInfo.off_devices; dev; dev = dev->next) {
|
|
||||||
if (dev->id == id)
|
|
||||||
return dev;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
*
|
*
|
||||||
* SEventIDispatch
|
* SEventIDispatch
|
||||||
|
@ -1239,6 +1217,7 @@ XInputExtensionInit(void)
|
||||||
AllExtensionVersions[IReqCode - 128] = thisversion;
|
AllExtensionVersions[IReqCode - 128] = thisversion;
|
||||||
MakeDeviceTypeAtoms();
|
MakeDeviceTypeAtoms();
|
||||||
RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone);
|
RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone);
|
||||||
|
RegisterResourceName(RT_INPUTCLIENT, "INPUTCLIENT");
|
||||||
FixExtensionEvents(extEntry);
|
FixExtensionEvents(extEntry);
|
||||||
ReplySwapVector[IReqCode] = (ReplySwapPtr) SReplyIDispatch;
|
ReplySwapVector[IReqCode] = (ReplySwapPtr) SReplyIDispatch;
|
||||||
EventSwapVector[DeviceValuator] = SEventIDispatch;
|
EventSwapVector[DeviceValuator] = SEventIDispatch;
|
||||||
|
|
|
@ -46,7 +46,6 @@ from the author.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "mi.h"
|
#include "mi.h"
|
||||||
|
@ -80,6 +79,7 @@ ProcXFakeDeviceData(ClientPtr client)
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int nevents, i;
|
int nevents, i;
|
||||||
int* valuators = NULL;
|
int* valuators = NULL;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xFakeDeviceDataReq);
|
REQUEST(xFakeDeviceDataReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xFakeDeviceDataReq);
|
REQUEST_AT_LEAST_SIZE(xFakeDeviceDataReq);
|
||||||
|
@ -90,11 +90,9 @@ ProcXFakeDeviceData(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixWriteAccess);
|
||||||
if (dev == NULL) {
|
if (rc != Success)
|
||||||
SendErrorToClient(client, IReqCode, X_FakeDeviceData, 0, BadDevice);
|
return rc;
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!fake_events && !(fake_events = InitEventList(GetMaximumEventsNum())))
|
if (!fake_events && !(fake_events = InitEventList(GetMaximumEventsNum())))
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getbmap.h"
|
#include "getbmap.h"
|
||||||
|
@ -92,6 +91,7 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xGetDeviceButtonMappingReply rep;
|
xGetDeviceButtonMappingReply rep;
|
||||||
ButtonClassPtr b;
|
ButtonClassPtr b;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xGetDeviceButtonMappingReq);
|
REQUEST(xGetDeviceButtonMappingReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
|
REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
|
||||||
|
@ -102,9 +102,9 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
b = dev->button;
|
b = dev->button;
|
||||||
if (b == NULL)
|
if (b == NULL)
|
||||||
|
|
17
Xi/getdctl.c
17
Xi/getdctl.c
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getdctl.h"
|
#include "getdctl.h"
|
||||||
|
@ -238,7 +237,7 @@ SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
|
||||||
int
|
int
|
||||||
ProcXGetDeviceControl(ClientPtr client)
|
ProcXGetDeviceControl(ClientPtr client)
|
||||||
{
|
{
|
||||||
int total_length = 0;
|
int rc, total_length = 0;
|
||||||
char *buf, *savbuf;
|
char *buf, *savbuf;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xGetDeviceControlReply rep;
|
xGetDeviceControlReply rep;
|
||||||
|
@ -246,9 +245,9 @@ ProcXGetDeviceControl(ClientPtr client)
|
||||||
REQUEST(xGetDeviceControlReq);
|
REQUEST(xGetDeviceControlReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
|
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep.repType = X_Reply;
|
||||||
rep.RepType = X_GetDeviceControl;
|
rep.RepType = X_GetDeviceControl;
|
||||||
|
@ -266,19 +265,19 @@ ProcXGetDeviceControl(ClientPtr client)
|
||||||
if (!dev->absolute)
|
if (!dev->absolute)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
total_length = sizeof(xDeviceAbsCalibCtl);
|
total_length = sizeof(xDeviceAbsCalibState);
|
||||||
break;
|
break;
|
||||||
case DEVICE_ABS_AREA:
|
case DEVICE_ABS_AREA:
|
||||||
if (!dev->absolute)
|
if (!dev->absolute)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
total_length = sizeof(xDeviceAbsAreaCtl);
|
total_length = sizeof(xDeviceAbsAreaState);
|
||||||
break;
|
break;
|
||||||
case DEVICE_CORE:
|
case DEVICE_CORE:
|
||||||
total_length = sizeof(xDeviceCoreCtl);
|
total_length = sizeof(xDeviceCoreState);
|
||||||
break;
|
break;
|
||||||
case DEVICE_ENABLE:
|
case DEVICE_ENABLE:
|
||||||
total_length = sizeof(xDeviceEnableCtl);
|
total_length = sizeof(xDeviceEnableState);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getfctl.h"
|
#include "getfctl.h"
|
||||||
|
@ -290,7 +289,7 @@ SRepXGetFeedbackControl(ClientPtr client, int size,
|
||||||
int
|
int
|
||||||
ProcXGetFeedbackControl(ClientPtr client)
|
ProcXGetFeedbackControl(ClientPtr client)
|
||||||
{
|
{
|
||||||
int total_length = 0;
|
int rc, total_length = 0;
|
||||||
char *buf, *savbuf;
|
char *buf, *savbuf;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
KbdFeedbackPtr k;
|
KbdFeedbackPtr k;
|
||||||
|
@ -304,9 +303,9 @@ ProcXGetFeedbackControl(ClientPtr client)
|
||||||
REQUEST(xGetFeedbackControlReq);
|
REQUEST(xGetFeedbackControlReq);
|
||||||
REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
|
REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep.repType = X_Reply;
|
||||||
rep.RepType = X_GetFeedbackControl;
|
rep.RepType = X_GetFeedbackControl;
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getfocus.h"
|
#include "getfocus.h"
|
||||||
|
@ -93,12 +92,15 @@ ProcXGetDeviceFocus(ClientPtr client)
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
FocusClassPtr focus;
|
FocusClassPtr focus;
|
||||||
xGetDeviceFocusReply rep;
|
xGetDeviceFocusReply rep;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xGetDeviceFocusReq);
|
REQUEST(xGetDeviceFocusReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceFocusReq);
|
REQUEST_SIZE_MATCH(xGetDeviceFocusReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetFocusAccess);
|
||||||
if (dev == NULL || !dev->focus)
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
if (!dev->focus)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep.repType = X_Reply;
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
|
|
||||||
|
@ -94,13 +93,14 @@ ProcXGetDeviceKeyMapping(ClientPtr client)
|
||||||
xGetDeviceKeyMappingReply rep;
|
xGetDeviceKeyMappingReply rep;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
KeySymsPtr k;
|
KeySymsPtr k;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xGetDeviceKeyMappingReq);
|
REQUEST(xGetDeviceKeyMappingReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceKeyMappingReq);
|
REQUEST_SIZE_MATCH(xGetDeviceKeyMappingReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
if (dev->key == NULL)
|
if (dev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
k = &dev->key->curKeySyms;
|
k = &dev->key->curKeySyms;
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h> /* Request macro */
|
#include <X11/extensions/XIproto.h> /* Request macro */
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getmmap.h"
|
#include "getmmap.h"
|
||||||
|
@ -94,13 +93,14 @@ ProcXGetDeviceModifierMapping(ClientPtr client)
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xGetDeviceModifierMappingReply rep;
|
xGetDeviceModifierMappingReply rep;
|
||||||
KeyClassPtr kp;
|
KeyClassPtr kp;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xGetDeviceModifierMappingReq);
|
REQUEST(xGetDeviceModifierMappingReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceModifierMappingReq);
|
REQUEST_SIZE_MATCH(xGetDeviceModifierMappingReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
kp = dev->key;
|
kp = dev->key;
|
||||||
if (kp == NULL)
|
if (kp == NULL)
|
||||||
|
|
|
@ -37,7 +37,6 @@ from the author.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -68,15 +67,17 @@ ProcXGetPairedPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
xGetPairedPointerReply rep;
|
xGetPairedPointerReply rep;
|
||||||
DeviceIntPtr kbd, ptr;
|
DeviceIntPtr kbd, ptr;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xGetPairedPointerReq);
|
REQUEST(xGetPairedPointerReq);
|
||||||
REQUEST_SIZE_MATCH(xGetPairedPointerReq);
|
REQUEST_SIZE_MATCH(xGetPairedPointerReq);
|
||||||
|
|
||||||
kbd = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&kbd, stuff->deviceid, client, DixReadAccess);
|
||||||
if (!kbd || !kbd->key || !kbd->isMaster) {
|
if (rc != Success)
|
||||||
SendErrorToClient(client, IReqCode, X_GetPairedPointer,
|
return rc;
|
||||||
stuff->deviceid, BadDevice);
|
else if (!kbd->key || !kbd->isMaster) {
|
||||||
return Success;
|
client->errorValue = stuff->deviceid;
|
||||||
|
return BadDevice;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = GetPairedDevice(kbd);
|
ptr = GetPairedDevice(kbd);
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include "windowstr.h" /* window structs */
|
#include "windowstr.h" /* window structs */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
|
|
||||||
|
@ -112,7 +111,7 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
rep.count = 0;
|
rep.count = 0;
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window struct */
|
#include "windowstr.h" /* window struct */
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
|
|
||||||
|
@ -114,7 +113,7 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
|
||||||
rep.this_client_count = 0;
|
rep.this_client_count = 0;
|
||||||
rep.all_clients_count = 0;
|
rep.all_clients_count = 0;
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getvers.h"
|
#include "getvers.h"
|
||||||
|
|
15
Xi/grabdev.c
15
Xi/grabdev.c
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "dixevents.h" /* GrabDevice */
|
#include "dixevents.h" /* GrabDevice */
|
||||||
|
|
||||||
|
@ -122,9 +121,9 @@ ProcXGrabDevice(ClientPtr client)
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
if ((rc = CreateMaskFromList(client, (XEventClass *) & stuff[1],
|
if ((rc = CreateMaskFromList(client, (XEventClass *) & stuff[1],
|
||||||
stuff->event_count, tmp, dev,
|
stuff->event_count, tmp, dev,
|
||||||
|
@ -171,7 +170,7 @@ int
|
||||||
CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
|
CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
|
||||||
struct tmask *mask, DeviceIntPtr dev, int req)
|
struct tmask *mask, DeviceIntPtr dev, int req)
|
||||||
{
|
{
|
||||||
int i, j;
|
int rc, i, j;
|
||||||
int device;
|
int device;
|
||||||
DeviceIntPtr tdev;
|
DeviceIntPtr tdev;
|
||||||
|
|
||||||
|
@ -185,8 +184,10 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
|
||||||
if (device > 255) /* FIXME: we only use 7 bit for devices? */
|
if (device > 255) /* FIXME: we only use 7 bit for devices? */
|
||||||
return BadClass;
|
return BadClass;
|
||||||
|
|
||||||
tdev = LookupDeviceIntRec(device);
|
rc = dixLookupDevice(&tdev, device, client, DixReadAccess);
|
||||||
if (tdev == NULL || (dev != NULL && tdev != dev))
|
if (rc != BadDevice && rc != Success)
|
||||||
|
return rc;
|
||||||
|
if (rc == BadDevice || (dev != NULL && tdev != dev))
|
||||||
return BadClass;
|
return BadClass;
|
||||||
|
|
||||||
for (j = 0; j < ExtEventIndex; j++)
|
for (j = 0; j < ExtEventIndex; j++)
|
||||||
|
|
|
@ -61,8 +61,8 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
#include "xace.h"
|
||||||
|
|
||||||
#include "grabdev.h"
|
#include "grabdev.h"
|
||||||
#include "grabdevb.h"
|
#include "grabdevb.h"
|
||||||
|
@ -117,18 +117,23 @@ ProcXGrabDeviceButton(ClientPtr client)
|
||||||
(sizeof(xGrabDeviceButtonReq) >> 2) + stuff->event_count)
|
(sizeof(xGrabDeviceButtonReq) >> 2) + stuff->event_count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||||
if (dev == NULL)
|
if (ret != Success)
|
||||||
return BadDevice;
|
return ret;
|
||||||
|
|
||||||
if (stuff->modifier_device != UseXKeyboard) {
|
if (stuff->modifier_device != UseXKeyboard) {
|
||||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
ret = dixLookupDevice(&mdev, stuff->modifier_device, client,
|
||||||
if (mdev == NULL)
|
DixReadAccess);
|
||||||
return BadDevice;
|
if (ret != Success)
|
||||||
|
return ret;
|
||||||
if (mdev->key == NULL)
|
if (mdev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
} else
|
} else {
|
||||||
mdev = PickKeyboard(client);
|
mdev = PickKeyboard(client);
|
||||||
|
ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixReadAccess);
|
||||||
|
if (ret != Success)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
class = (XEventClass *) (&stuff[1]); /* first word of values */
|
class = (XEventClass *) (&stuff[1]); /* first word of values */
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,8 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
#include "xace.h"
|
||||||
|
|
||||||
#include "grabdev.h"
|
#include "grabdev.h"
|
||||||
#include "grabdevk.h"
|
#include "grabdevk.h"
|
||||||
|
@ -115,18 +115,23 @@ ProcXGrabDeviceKey(ClientPtr client)
|
||||||
if (stuff->length != (sizeof(xGrabDeviceKeyReq) >> 2) + stuff->event_count)
|
if (stuff->length != (sizeof(xGrabDeviceKeyReq) >> 2) + stuff->event_count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||||
if (dev == NULL)
|
if (ret != Success)
|
||||||
return BadDevice;
|
return ret;
|
||||||
|
|
||||||
if (stuff->modifier_device != UseXKeyboard) {
|
if (stuff->modifier_device != UseXKeyboard) {
|
||||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
ret = dixLookupDevice(&mdev, stuff->modifier_device, client,
|
||||||
if (mdev == NULL)
|
DixReadAccess);
|
||||||
return BadDevice;
|
if (ret != Success)
|
||||||
|
return ret;
|
||||||
if (mdev->key == NULL)
|
if (mdev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
} else
|
} else {
|
||||||
mdev = PickKeyboard(client);
|
mdev = PickKeyboard(client);
|
||||||
|
ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixReadAccess);
|
||||||
|
if (ret != Success)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
class = (XEventClass *) (&stuff[1]); /* first word of values */
|
class = (XEventClass *) (&stuff[1]); /* first word of values */
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -96,7 +95,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
INT32 *coords = NULL, *bufptr;
|
INT32 *coords = NULL, *bufptr;
|
||||||
xGetDeviceMotionEventsReply rep;
|
xGetDeviceMotionEventsReply rep;
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
int num_events, axes, size = 0, tsize;
|
int rc, num_events, axes, size = 0, tsize;
|
||||||
unsigned long nEvents;
|
unsigned long nEvents;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
TimeStamp start, stop;
|
TimeStamp start, stop;
|
||||||
|
@ -106,9 +105,9 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
REQUEST(xGetDeviceMotionEventsReq);
|
REQUEST(xGetDeviceMotionEventsReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
|
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
v = dev->valuator;
|
v = dev->valuator;
|
||||||
if (v == NULL || v->numAxes == 0)
|
if (v == NULL || v->numAxes == 0)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
10
Xi/listdev.c
10
Xi/listdev.c
|
@ -63,8 +63,8 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h" /* FIXME */
|
#include "exglobals.h" /* FIXME */
|
||||||
|
#include "xace.h"
|
||||||
|
|
||||||
#include "listdev.h"
|
#include "listdev.h"
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ ProcXListInputDevices(ClientPtr client)
|
||||||
xListInputDevicesReply rep;
|
xListInputDevicesReply rep;
|
||||||
int numdevs = 0;
|
int numdevs = 0;
|
||||||
int namesize = 1; /* need 1 extra byte for strcpy */
|
int namesize = 1; /* need 1 extra byte for strcpy */
|
||||||
int size = 0;
|
int rc, size = 0;
|
||||||
int total_length;
|
int total_length;
|
||||||
char *devbuf;
|
char *devbuf;
|
||||||
char *classbuf;
|
char *classbuf;
|
||||||
|
@ -338,10 +338,16 @@ ProcXListInputDevices(ClientPtr client)
|
||||||
AddOtherInputDevices();
|
AddOtherInputDevices();
|
||||||
|
|
||||||
for (d = inputInfo.devices; d; d = d->next) {
|
for (d = inputInfo.devices; d; d = d->next) {
|
||||||
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
SizeDeviceInfo(d, &namesize, &size);
|
SizeDeviceInfo(d, &namesize, &size);
|
||||||
numdevs++;
|
numdevs++;
|
||||||
}
|
}
|
||||||
for (d = inputInfo.off_devices; d; d = d->next) {
|
for (d = inputInfo.off_devices; d; d = d->next) {
|
||||||
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
SizeDeviceInfo(d, &namesize, &size);
|
SizeDeviceInfo(d, &namesize, &size);
|
||||||
numdevs++;
|
numdevs++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "opendev.h"
|
#include "opendev.h"
|
||||||
|
@ -103,13 +102,15 @@ ProcXOpenDevice(ClientPtr client)
|
||||||
REQUEST(xOpenDeviceReq);
|
REQUEST(xOpenDeviceReq);
|
||||||
REQUEST_SIZE_MATCH(xOpenDeviceReq);
|
REQUEST_SIZE_MATCH(xOpenDeviceReq);
|
||||||
|
|
||||||
if ((dev = LookupDeviceIntRec(stuff->deviceid)) == NULL) { /* not open */
|
status = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
||||||
|
if (status == BadDevice) { /* not open */
|
||||||
for (dev = inputInfo.off_devices; dev; dev = dev->next)
|
for (dev = inputInfo.off_devices; dev; dev = dev->next)
|
||||||
if (dev->id == stuff->deviceid)
|
if (dev->id == stuff->deviceid)
|
||||||
break;
|
break;
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
}
|
} else if (status != Success)
|
||||||
|
return status;
|
||||||
|
|
||||||
OpenInputDevice(dev, client, &status);
|
OpenInputDevice(dev, client, &status);
|
||||||
if (status != Success)
|
if (status != Success)
|
||||||
|
|
14
Xi/querydp.c
14
Xi/querydp.c
|
@ -45,7 +45,6 @@ from the author.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -83,11 +82,14 @@ ProcXQueryDevicePointer(ClientPtr client)
|
||||||
REQUEST(xQueryDevicePointerReq);
|
REQUEST(xQueryDevicePointerReq);
|
||||||
REQUEST_SIZE_MATCH(xQueryDevicePointerReq);
|
REQUEST_SIZE_MATCH(xQueryDevicePointerReq);
|
||||||
|
|
||||||
pDev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixReadAccess);
|
||||||
if (pDev == NULL || pDev->valuator == NULL) {
|
if (rc != Success)
|
||||||
SendErrorToClient(client, IReqCode, X_QueryDevicePointer,
|
return rc;
|
||||||
stuff->deviceid, BadDevice);
|
|
||||||
return Success;
|
if (pDev->valuator == NULL)
|
||||||
|
{
|
||||||
|
client->errorValue = stuff->deviceid;
|
||||||
|
return BadDevice;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->win, client, DixReadAccess);
|
rc = dixLookupWindow(&pWin, stuff->win, client, DixReadAccess);
|
||||||
|
|
|
@ -42,7 +42,6 @@ from The Open Group.
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -74,7 +73,7 @@ int
|
||||||
ProcXQueryDeviceState(ClientPtr client)
|
ProcXQueryDeviceState(ClientPtr client)
|
||||||
{
|
{
|
||||||
char n;
|
char n;
|
||||||
int i;
|
int rc, i;
|
||||||
int num_classes = 0;
|
int num_classes = 0;
|
||||||
int total_length = 0;
|
int total_length = 0;
|
||||||
char *buf, *savbuf;
|
char *buf, *savbuf;
|
||||||
|
@ -96,9 +95,9 @@ ProcXQueryDeviceState(ClientPtr client)
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
|
|
||||||
v = dev->valuator;
|
v = dev->valuator;
|
||||||
if (v != NULL && v->motionHintWindow != NULL)
|
if (v != NULL && v->motionHintWindow != NULL)
|
||||||
|
|
|
@ -61,7 +61,6 @@ SOFTWARE.
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -164,7 +163,7 @@ ProcXSelectExtensionEvent(ClientPtr client)
|
||||||
if (stuff->length != (sizeof(xSelectExtensionEventReq) >> 2) + stuff->count)
|
if (stuff->length != (sizeof(xSelectExtensionEventReq) >> 2) + stuff->count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
ret = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
ret = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
|
@ -59,9 +59,9 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* Window */
|
#include "windowstr.h" /* Window */
|
||||||
|
#include "extnsionst.h" /* EventSwapPtr */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -131,9 +131,9 @@ ProcXSendExtensionEvent(ClientPtr client)
|
||||||
(stuff->num_events * (sizeof(xEvent) >> 2)))
|
(stuff->num_events * (sizeof(xEvent) >> 2)))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixWriteAccess);
|
||||||
if (dev == NULL)
|
if (ret != Success)
|
||||||
return BadDevice;
|
return ret;
|
||||||
|
|
||||||
/* The client's event type must be one defined by an extension. */
|
/* The client's event type must be one defined by an extension. */
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "setbmap.h"
|
#include "setbmap.h"
|
||||||
|
@ -110,9 +109,9 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.status = MappingSuccess;
|
rep.status = MappingSuccess;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (dev == NULL)
|
if (ret != Success)
|
||||||
return BadDevice;
|
return ret;
|
||||||
|
|
||||||
ret = SetButtonMapping(client, dev, stuff->map_length, (BYTE *) & stuff[1]);
|
ret = SetButtonMapping(client, dev, stuff->map_length, (BYTE *) & stuff[1]);
|
||||||
|
|
||||||
|
|
13
Xi/setcptr.c
13
Xi/setcptr.c
|
@ -48,7 +48,6 @@ from the author.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -77,8 +76,11 @@ ProcXSetClientPointer(ClientPtr client)
|
||||||
REQUEST_SIZE_MATCH(xSetClientPointerReq);
|
REQUEST_SIZE_MATCH(xSetClientPointerReq);
|
||||||
|
|
||||||
|
|
||||||
pDev = LookupDeviceIntRec(stuff->deviceid);
|
err = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess);
|
||||||
if (pDev == NULL || !IsPointerDevice(pDev) || !pDev->isMaster)
|
if (err != Success)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
if (!IsPointerDevice(pDev) || !pDev->isMaster)
|
||||||
{
|
{
|
||||||
client->errorValue = stuff->deviceid;
|
client->errorValue = stuff->deviceid;
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
@ -86,13 +88,14 @@ ProcXSetClientPointer(ClientPtr client)
|
||||||
|
|
||||||
if (stuff->win != None)
|
if (stuff->win != None)
|
||||||
{
|
{
|
||||||
err = dixLookupWindow(&pWin, stuff->win, client, DixReadWriteAccess);
|
err = dixLookupWindow(&pWin, stuff->win, client, DixWriteAccess);
|
||||||
if (err != Success)
|
if (err != Success)
|
||||||
{
|
{
|
||||||
/* window could not be found. maybe the window ID given was a pure
|
/* window could not be found. maybe the window ID given was a pure
|
||||||
client id? */
|
client id? */
|
||||||
|
/* XXX: Needs to be fixed for XACE */
|
||||||
err = dixLookupClient(&targetClient, stuff->win,
|
err = dixLookupClient(&targetClient, stuff->win,
|
||||||
client, DixReadWriteAccess);
|
client, DixWriteAccess);
|
||||||
if (err != Success)
|
if (err != Success)
|
||||||
{
|
{
|
||||||
client->errorValue = stuff->win;
|
client->errorValue = stuff->win;
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "setdval.h"
|
#include "setdval.h"
|
||||||
|
@ -92,6 +91,7 @@ ProcXSetDeviceValuators(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xSetDeviceValuatorsReply rep;
|
xSetDeviceValuatorsReply rep;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xSetDeviceValuatorsReq);
|
REQUEST(xSetDeviceValuatorsReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
|
REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
|
||||||
|
@ -106,9 +106,9 @@ ProcXSetDeviceValuators(ClientPtr client)
|
||||||
stuff->num_valuators)
|
stuff->num_valuators)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
if (dev->valuator == NULL)
|
if (dev->valuator == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,6 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "dixevents.h"
|
#include "dixevents.h"
|
||||||
|
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "setfocus.h"
|
#include "setfocus.h"
|
||||||
|
@ -102,8 +101,10 @@ ProcXSetDeviceFocus(ClientPtr client)
|
||||||
REQUEST(xSetDeviceFocusReq);
|
REQUEST(xSetDeviceFocusReq);
|
||||||
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
|
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->device);
|
ret = dixLookupDevice(&dev, stuff->device, client, DixSetFocusAccess);
|
||||||
if (dev == NULL || !dev->focus)
|
if (ret != Success)
|
||||||
|
return ret;
|
||||||
|
if (!dev->focus)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
|
||||||
ret = SetInputFocus(client, dev, stuff->focus, stuff->revertTo,
|
ret = SetInputFocus(client, dev, stuff->focus, stuff->revertTo,
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "setmmap.h"
|
#include "setmmap.h"
|
||||||
|
@ -99,9 +98,9 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
||||||
REQUEST(xSetDeviceModifierMappingReq);
|
REQUEST(xSetDeviceModifierMappingReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
|
REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (dev == NULL)
|
if (ret != Success)
|
||||||
return BadDevice;
|
return ret;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep.repType = X_Reply;
|
||||||
rep.RepType = X_SetDeviceModifierMapping;
|
rep.RepType = X_SetDeviceModifierMapping;
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "setmode.h"
|
#include "setmode.h"
|
||||||
|
@ -92,6 +91,7 @@ ProcXSetDeviceMode(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
xSetDeviceModeReply rep;
|
xSetDeviceModeReply rep;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xSetDeviceModeReq);
|
REQUEST(xSetDeviceModeReq);
|
||||||
REQUEST_SIZE_MATCH(xSetDeviceModeReq);
|
REQUEST_SIZE_MATCH(xSetDeviceModeReq);
|
||||||
|
@ -101,9 +101,9 @@ ProcXSetDeviceMode(ClientPtr client)
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
if (dev->valuator == NULL)
|
if (dev->valuator == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
if ((dev->deviceGrab.grab) && !SameClient(dev->deviceGrab.grab, client))
|
if ((dev->deviceGrab.grab) && !SameClient(dev->deviceGrab.grab, client))
|
||||||
|
|
|
@ -65,6 +65,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
|
#include "xace.h"
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
|
@ -153,6 +154,7 @@ AddOtherInputDevices(void)
|
||||||
void
|
void
|
||||||
OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
|
OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
|
||||||
{
|
{
|
||||||
|
*status = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "ungrdev.h"
|
#include "ungrdev.h"
|
||||||
|
@ -94,13 +93,14 @@ ProcXUngrabDevice(ClientPtr client)
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
GrabPtr grab;
|
GrabPtr grab;
|
||||||
TimeStamp time;
|
TimeStamp time;
|
||||||
|
int rc;
|
||||||
|
|
||||||
REQUEST(xUngrabDeviceReq);
|
REQUEST(xUngrabDeviceReq);
|
||||||
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
|
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
grab = dev->deviceGrab.grab;
|
grab = dev->deviceGrab.grab;
|
||||||
|
|
||||||
time = ClientTimeToServerTime(stuff->time);
|
time = ClientTimeToServerTime(stuff->time);
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "dixgrabs.h"
|
#include "dixgrabs.h"
|
||||||
|
|
||||||
|
@ -107,22 +106,23 @@ ProcXUngrabDeviceButton(ClientPtr client)
|
||||||
REQUEST(xUngrabDeviceButtonReq);
|
REQUEST(xUngrabDeviceButtonReq);
|
||||||
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
|
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
if (dev->button == NULL)
|
if (dev->button == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
if (stuff->modifier_device != UseXKeyboard) {
|
if (stuff->modifier_device != UseXKeyboard) {
|
||||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
rc = dixLookupDevice(&mdev, stuff->modifier_device, client,
|
||||||
if (mdev == NULL)
|
DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
if (mdev->key == NULL)
|
if (mdev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
} else
|
} else
|
||||||
mdev = PickKeyboard(client);
|
mdev = PickKeyboard(client);
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "dixgrabs.h"
|
#include "dixgrabs.h"
|
||||||
|
|
||||||
|
@ -107,22 +106,23 @@ ProcXUngrabDeviceKey(ClientPtr client)
|
||||||
REQUEST(xUngrabDeviceKeyReq);
|
REQUEST(xUngrabDeviceKeyReq);
|
||||||
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
|
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
|
||||||
|
|
||||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||||
if (dev == NULL)
|
if (rc != Success)
|
||||||
return BadDevice;
|
return rc;
|
||||||
if (dev->key == NULL)
|
if (dev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
if (stuff->modifier_device != UseXKeyboard) {
|
if (stuff->modifier_device != UseXKeyboard) {
|
||||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
rc = dixLookupDevice(&mdev, stuff->modifier_device, client,
|
||||||
if (mdev == NULL)
|
DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
if (mdev->key == NULL)
|
if (mdev->key == NULL)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
} else
|
} else
|
||||||
mdev = PickKeyboard(client);
|
mdev = PickKeyboard(client);
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,6 @@ from the author.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit.h" /* LookupDeviceIntRec */
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
@ -83,13 +82,10 @@ ProcXWarpDevicePointer(ClientPtr client)
|
||||||
|
|
||||||
/* FIXME: panoramix stuff is missing, look at ProcWarpPointer */
|
/* FIXME: panoramix stuff is missing, look at ProcWarpPointer */
|
||||||
|
|
||||||
pDev = LookupDeviceIntRec(stuff->deviceid);
|
err = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess);
|
||||||
if (pDev == NULL) {
|
|
||||||
SendErrorToClient(client, IReqCode, X_WarpDevicePointer,
|
if (err != Success)
|
||||||
stuff->deviceid,
|
return err;
|
||||||
BadDevice);
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stuff->dst_win != None)
|
if (stuff->dst_win != None)
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,7 +64,7 @@ ProcXiSelectEvent(ClientPtr client)
|
||||||
REQUEST(xXiSelectEventReq);
|
REQUEST(xXiSelectEventReq);
|
||||||
REQUEST_SIZE_MATCH(xXiSelectEventReq);
|
REQUEST_SIZE_MATCH(xXiSelectEventReq);
|
||||||
|
|
||||||
ret = dixLookupWindow(&pWin, stuff->window, client, DixReadWriteAccess);
|
ret = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
{
|
{
|
||||||
SendErrorToClient(client, IReqCode, X_XiSelectEvent, 0, ret);
|
SendErrorToClient(client, IReqCode, X_XiSelectEvent, 0, ret);
|
||||||
|
|
19
afb/afb.h
19
afb/afb.h
|
@ -55,11 +55,11 @@ SOFTWARE.
|
||||||
#include "gc.h"
|
#include "gc.h"
|
||||||
#include "colormap.h"
|
#include "colormap.h"
|
||||||
#include "regionstr.h"
|
#include "regionstr.h"
|
||||||
|
#include "privates.h"
|
||||||
#include "mibstore.h"
|
#include "mibstore.h"
|
||||||
#include "mfb.h"
|
#include "mfb.h"
|
||||||
|
|
||||||
extern int afbInverseAlu[];
|
extern int afbInverseAlu[];
|
||||||
extern int afbScreenPrivateIndex;
|
|
||||||
/* warning: PixelType definition duplicated in maskbits.h */
|
/* warning: PixelType definition duplicated in maskbits.h */
|
||||||
#ifndef PixelType
|
#ifndef PixelType
|
||||||
#define PixelType CARD32
|
#define PixelType CARD32
|
||||||
|
@ -731,20 +731,21 @@ typedef struct {
|
||||||
} afbPrivGC;
|
} afbPrivGC;
|
||||||
typedef afbPrivGC *afbPrivGCPtr;
|
typedef afbPrivGC *afbPrivGCPtr;
|
||||||
|
|
||||||
extern int afbGCPrivateIndex; /* index into GC private array */
|
extern DevPrivateKey afbScreenPrivateKey;
|
||||||
extern int afbWindowPrivateIndex; /* index into Window private array */
|
extern DevPrivateKey afbGCPrivateKey;
|
||||||
|
extern DevPrivateKey afbWindowPrivateKey;
|
||||||
#ifdef PIXMAP_PER_WINDOW
|
#ifdef PIXMAP_PER_WINDOW
|
||||||
extern int frameWindowPrivateIndex; /* index into Window private array */
|
extern DevPrivateKey frameWindowPrivateKey;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define afbGetGCPrivate(pGC) \
|
#define afbGetGCPrivate(pGC) \
|
||||||
((afbPrivGC *)((pGC)->devPrivates[afbGCPrivateIndex].ptr))
|
((afbPrivGC *)dixLookupPrivate(&(pGC)->devPrivates, afbGCPrivateKey))
|
||||||
|
|
||||||
/* Common macros for extracting drawing information */
|
/* Common macros for extracting drawing information */
|
||||||
|
|
||||||
#define afbGetTypedWidth(pDrawable,wtype)( \
|
#define afbGetTypedWidth(pDrawable,wtype)( \
|
||||||
(((pDrawable)->type == DRAWABLE_WINDOW) ? \
|
(((pDrawable)->type == DRAWABLE_WINDOW) ? \
|
||||||
(int)(((PixmapPtr)((pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr))->devKind) : \
|
(int)(((PixmapPtr)dixLookupPrivate(&(pDrawable)->pScreen->devPrivates, afbScreenPrivateKey)->devKind) : \
|
||||||
(int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
|
(int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
|
||||||
|
|
||||||
#define afbGetByteWidth(pDrawable) afbGetTypedWidth(pDrawable, unsigned char)
|
#define afbGetByteWidth(pDrawable) afbGetTypedWidth(pDrawable, unsigned char)
|
||||||
|
@ -754,7 +755,7 @@ extern int frameWindowPrivateIndex; /* index into Window private array */
|
||||||
#define afbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\
|
#define afbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\
|
||||||
PixmapPtr _pPix; \
|
PixmapPtr _pPix; \
|
||||||
if ((pDrawable)->type == DRAWABLE_WINDOW) \
|
if ((pDrawable)->type == DRAWABLE_WINDOW) \
|
||||||
_pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
|
_pPix = (PixmapPtr)dixLookupPrivate(&(pDrawable)->pScreen->devPrivates, afbScreenPrivateKey); \
|
||||||
else \
|
else \
|
||||||
_pPix = (PixmapPtr)(pDrawable); \
|
_pPix = (PixmapPtr)(pDrawable); \
|
||||||
(pointer) = (ptype *) _pPix->devPrivate.ptr; \
|
(pointer) = (ptype *) _pPix->devPrivate.ptr; \
|
||||||
|
@ -764,7 +765,7 @@ extern int frameWindowPrivateIndex; /* index into Window private array */
|
||||||
#define afbGetPixelWidthSizeDepthAndPointer(pDrawable, width, size, dep, pointer) {\
|
#define afbGetPixelWidthSizeDepthAndPointer(pDrawable, width, size, dep, pointer) {\
|
||||||
PixmapPtr _pPix; \
|
PixmapPtr _pPix; \
|
||||||
if ((pDrawable)->type == DRAWABLE_WINDOW) \
|
if ((pDrawable)->type == DRAWABLE_WINDOW) \
|
||||||
_pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
|
_pPix = (PixmapPtr)dixLookupPrivate(&(pDrawable)->pScreen->devPrivates, afbScreenPrivateKey); \
|
||||||
else \
|
else \
|
||||||
_pPix = (PixmapPtr)(pDrawable); \
|
_pPix = (PixmapPtr)(pDrawable); \
|
||||||
(pointer) = (PixelType *)_pPix->devPrivate.ptr; \
|
(pointer) = (PixelType *)_pPix->devPrivate.ptr; \
|
||||||
|
@ -780,7 +781,7 @@ extern int frameWindowPrivateIndex; /* index into Window private array */
|
||||||
afbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
|
afbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
|
||||||
|
|
||||||
#define afbGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\
|
#define afbGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\
|
||||||
PixmapPtr _pPix = (PixmapPtr)(pWin)->drawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
|
PixmapPtr _pPix = (PixmapPtr)dixLookupPrivate(&(pWin)->drawable.pScreen->devPrivates, afbScreenPrivateKey); \
|
||||||
(pointer) = (ptype *) _pPix->devPrivate.ptr; \
|
(pointer) = (ptype *) _pPix->devPrivate.ptr; \
|
||||||
(width) = ((int) _pPix->devKind) / sizeof (wtype); \
|
(width) = ((int) _pPix->devKind) / sizeof (wtype); \
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue