Merge branch 'master' into mpx

Conflicts:

	Xi/closedev.c
	Xi/exevents.c
	Xi/extinit.c
	Xi/listdev.c
	dix/window.c
	hw/xfree86/common/xf86Xinput.c
	include/extinit.h
	mi/mipointer.c
This commit is contained in:
Peter Hutterer 2007-04-02 15:36:26 +09:30
commit e8777a91f3
280 changed files with 4874 additions and 6050 deletions

View File

@ -14,7 +14,6 @@ AM_CFLAGS = \
-I@MESA_SOURCE@/src/mesa/glapi \ -I@MESA_SOURCE@/src/mesa/glapi \
-I@MESA_SOURCE@/src/mesa/main \ -I@MESA_SOURCE@/src/mesa/main \
-DXFree86Server \ -DXFree86Server \
-DNO_LIBCWRAPPER \
@GLX_DEFINES@ @GLX_DEFINES@
# none yet # none yet

View File

@ -20,13 +20,11 @@ INCLUDES = -I@MESA_SOURCE@/include \
AM_CFLAGS = \ AM_CFLAGS = \
$(DIX_CFLAGS) \ $(DIX_CFLAGS) \
-DXFree86Server \ -DXFree86Server \
@GLX_DEFINES@ \ @GLX_DEFINES@
-DXFree86Server
libX_la_SOURCES = xf86glx.c \ libX_la_SOURCES = xf86glx.c \
xf86glx_util.c \ xf86glx_util.c \
xf86glx_util.h \ xf86glx_util.h
xf86glxint.h
nodist_libX_la_SOURCES = \ nodist_libX_la_SOURCES = \
xm_api.c \ xm_api.c \

View File

@ -37,40 +37,19 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#endif #endif
#include <string.h> #include <string.h>
#include <regionstr.h>
#include <resource.h> #include <GL/xmesa.h>
#include <GL/gl.h> #include <GL/internal/glcore.h>
#include <GL/glxint.h>
#include <GL/glxtokens.h>
#include <scrnintstr.h>
#include <windowstr.h>
#include <config.h>
#include <glxserver.h> #include <glxserver.h>
#include <glxscreens.h> #include <glxscreens.h>
#include <glxdrawable.h> #include <glxdrawable.h>
#include <glxcontext.h> #include <glxcontext.h>
#include <glxext.h>
#include <glxutil.h> #include <glxutil.h>
#include "context.h"
#include "xmesaP.h" #include "xmesaP.h"
#include "context.h"
#include "glcontextmodes.h" #include "glcontextmodes.h"
#include "os.h" #include "os.h"
/*
* This define is for the glcore.h header file.
* If you add it here, then make sure you also add it in
* ../../../glx/Imakefile.
*/
#if 0
#define DEBUG
#include <GL/internal/glcore.h>
#undef DEBUG
#else
#include <GL/internal/glcore.h>
#endif
typedef struct __GLXMESAscreen __GLXMESAscreen; typedef struct __GLXMESAscreen __GLXMESAscreen;
typedef struct __GLXMESAcontext __GLXMESAcontext; typedef struct __GLXMESAcontext __GLXMESAcontext;
typedef struct __GLXMESAdrawable __GLXMESAdrawable; typedef struct __GLXMESAdrawable __GLXMESAdrawable;
@ -218,8 +197,7 @@ __glXMesaContextCopy(__GLXcontext *baseDst,
__GLXMESAcontext *dst = (__GLXMESAcontext *) baseDst; __GLXMESAcontext *dst = (__GLXMESAcontext *) baseDst;
__GLXMESAcontext *src = (__GLXMESAcontext *) baseSrc; __GLXMESAcontext *src = (__GLXMESAcontext *) baseSrc;
_mesa_copy_context(&src->xmesa->mesa, &dst->xmesa->mesa, mask); return XMesaCopyContext(src->xmesa, dst->xmesa, mask);
return GL_TRUE;
} }
static int static int
@ -227,7 +205,7 @@ __glXMesaContextForceCurrent(__GLXcontext *baseContext)
{ {
__GLXMESAcontext *context = (__GLXMESAcontext *) baseContext; __GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
GlxSetRenderTables (context->xmesa->mesa.CurrentDispatch); /* GlxSetRenderTables() call for XGL moved in XMesaForceCurrent() */
return XMesaForceCurrent(context->xmesa); return XMesaForceCurrent(context->xmesa);
} }

View File

@ -37,8 +37,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <stdlib.h> #include <stdlib.h>
#include <gcstruct.h>
#include "pixmapstr.h"
#include "xf86glx_util.h" #include "xf86glx_util.h"
#include <X11/Xmd.h> #include <X11/Xmd.h>

View File

@ -1,45 +0,0 @@
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sub license, 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 NON-INFRINGEMENT.
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
**************************************************************************/
/*
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
*
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _XF86GLXINT_H_
#define _XF86GLXINT_H_
#include <miscstruct.h>
#include <GL/gl.h>
#include <GL/xmesa.h>
#endif /* _XF86GLXINT_H_ */

View File

@ -68,6 +68,7 @@ nodist_libmain_la_SOURCES = accum.c \
rastpos.c \ rastpos.c \
rbadaptors.c \ rbadaptors.c \
renderbuffer.c \ renderbuffer.c \
shaders.c \
state.c \ state.c \
stencil.c \ stencil.c \
texcompress.c \ texcompress.c \

View File

@ -27,8 +27,13 @@ nodist_libshader_la_SOURCES = \
atifragshader.c \ atifragshader.c \
nvfragparse.c \ nvfragparse.c \
nvprogram.c \ nvprogram.c \
nvvertexec.c \ nvvertparse.c \
nvvertparse.c \ prog_debug.c \
prog_execute.c \
prog_instruction.c \
prog_parameter.c \
prog_print.c \
program.c \ program.c \
shaderobjects.c \ programopt.c \
shaderobjects_3dlabs.c prog_statevars.c \
shader_api.c

View File

@ -18,23 +18,23 @@ INCLUDES = -I@MESA_SOURCE@/include \
-I../.. \ -I../.. \
-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support
nodist_libslang_la_SOURCES = slang_analyse.c \ nodist_libslang_la_SOURCES = slang_builtin.c \
slang_assemble_assignment.c \ slang_codegen.c \
slang_assemble.c \
slang_assemble_conditional.c \
slang_assemble_constructor.c \
slang_assemble_typeinfo.c \
slang_compile.c \ slang_compile.c \
slang_compile_function.c \ slang_compile_function.c \
slang_compile_operation.c \ slang_compile_operation.c \
slang_compile_struct.c \ slang_compile_struct.c \
slang_compile_variable.c \ slang_compile_variable.c \
slang_execute.c \ slang_emit.c \
slang_execute_x86.c \ slang_ir.c \
slang_export.c \ slang_label.c \
slang_library_texsample.c \
slang_library_noise.c \ slang_library_noise.c \
slang_link.c \ slang_link.c \
slang_log.c \
slang_preprocess.c \ slang_preprocess.c \
slang_print.c \
slang_simplify.c \
slang_storage.c \ slang_storage.c \
slang_utility.c slang_typeinfo.c \
slang_utility.c \
slang_vartable.c

View File

@ -23,7 +23,6 @@ nodist_libswrast_la_SOURCES = s_aaline.c \
s_aatriangle.c \ s_aatriangle.c \
s_accum.c \ s_accum.c \
s_alpha.c \ s_alpha.c \
s_arbshader.c \
s_atifragshader.c \ s_atifragshader.c \
s_bitmap.c \ s_bitmap.c \
s_blend.c \ s_blend.c \
@ -35,11 +34,11 @@ nodist_libswrast_la_SOURCES = s_aaline.c \
s_drawpix.c \ s_drawpix.c \
s_feedback.c \ s_feedback.c \
s_fog.c \ s_fog.c \
s_fragprog.c \
s_imaging.c \ s_imaging.c \
s_lines.c \ s_lines.c \
s_logic.c \ s_logic.c \
s_masking.c \ s_masking.c \
s_nvfragprog.c \
s_points.c \ s_points.c \
s_readpix.c \ s_readpix.c \
s_span.c \ s_span.c \

View File

@ -23,7 +23,6 @@ nodist_libtnl_la_SOURCES = t_context.c \
t_pipeline.c \ t_pipeline.c \
t_vb_arbprogram.c \ t_vb_arbprogram.c \
t_vb_arbprogram_sse.c \ t_vb_arbprogram_sse.c \
t_vb_arbshader.c \
t_vb_cull.c \ t_vb_cull.c \
t_vb_fog.c \ t_vb_fog.c \
t_vb_light.c \ t_vb_light.c \

View File

@ -116,8 +116,7 @@ int XagAppGroupFree(
return Success; return Success;
} }
/* static */ static void XagClientStateChange(
void XagClientStateChange(
CallbackListPtr* pcbl, CallbackListPtr* pcbl,
pointer nulldata, pointer nulldata,
pointer calldata) pointer calldata)
@ -172,21 +171,6 @@ void XagClientStateChange(
} }
} }
void
XagExtensionInit(INITARGS)
{
if (AddExtension (XAGNAME,
0,
XagNumberErrors,
ProcXagDispatch,
SProcXagDispatch,
XagResetProc,
StandardMinorOpcode)) {
RT_APPGROUP = CreateNewResourceType (XagAppGroupFree);
XaceRegisterCallback(XACE_AUTH_AVAIL, XagCallClientStateChange, NULL);
}
}
/*ARGSUSED*/ /*ARGSUSED*/
static static
void XagResetProc( void XagResetProc(
@ -393,8 +377,7 @@ int AttrValidate(
return client->noClientException; return client->noClientException;
} }
/* static */ static int ProcXagCreate (
int ProcXagCreate (
register ClientPtr client) register ClientPtr client)
{ {
REQUEST (xXagCreateReq); REQUEST (xXagCreateReq);
@ -425,8 +408,7 @@ int ProcXagCreate (
return client->noClientException; return client->noClientException;
} }
/* static */ static int ProcXagDestroy(
int ProcXagDestroy(
register ClientPtr client) register ClientPtr client)
{ {
AppGroupPtr pAppGrp; AppGroupPtr pAppGrp;
@ -743,18 +725,7 @@ XID XagId(
return (client->appgroup ? client->appgroup->appgroupId : 0); return (client->appgroup ? client->appgroup->appgroupId : 0);
} }
void XagGetDeltaInfo( static void XagCallClientStateChange(
ClientPtr client,
CARD32* buf)
{
*buf++ = (CARD32) client->appgroup->default_root;
*buf++ = (CARD32) client->appgroup->root_visual;
*buf++ = (CARD32) client->appgroup->default_colormap;
*buf++ = (CARD32) client->appgroup->black_pixel;
*buf = (CARD32) client->appgroup->white_pixel;
}
void XagCallClientStateChange(
CallbackListPtr *pcbl, CallbackListPtr *pcbl,
pointer nulldata, pointer nulldata,
pointer calldata) pointer calldata)
@ -785,3 +756,18 @@ void XagCallClientStateChange(
XagClientStateChange (NULL, NULL, (pointer)&clientinfo); XagClientStateChange (NULL, NULL, (pointer)&clientinfo);
} }
} }
void
XagExtensionInit(INITARGS)
{
if (AddExtension (XAGNAME,
0,
XagNumberErrors,
ProcXagDispatch,
SProcXagDispatch,
XagResetProc,
StandardMinorOpcode)) {
RT_APPGROUP = CreateNewResourceType (XagAppGroupFree);
XaceRegisterCallback(XACE_AUTH_AVAIL, XagCallClientStateChange, NULL);
}
}

View File

@ -50,12 +50,6 @@ extern ClientPtr XagLeader(
ClientPtr /* client */ ClientPtr /* client */
); );
extern void XagCallClientStateChange(
CallbackListPtr * /* pcbl */,
pointer /* nulldata */,
pointer /* calldata */
);
extern Bool XagIsControlledRoot ( extern Bool XagIsControlledRoot (
ClientPtr /* client */, ClientPtr /* client */,
WindowPtr /* pParent */ WindowPtr /* pParent */
@ -65,22 +59,6 @@ extern XID XagId (
ClientPtr /* client */ ClientPtr /* client */
); );
extern void XagGetDeltaInfo (
ClientPtr /* client */,
CARD32* /* buf */
);
extern void XagClientStateChange(
CallbackListPtr* pcbl,
pointer nulldata,
pointer calldata);
extern int ProcXagCreate (
register ClientPtr client);
extern int ProcXagDestroy(
register ClientPtr client);
_XFUNCPROTOEND _XFUNCPROTOEND
#endif /* _APPGROUP_SRV_H_ */ #endif /* _APPGROUP_SRV_H_ */

View File

@ -77,7 +77,7 @@ int PanoramiXPixHeight = 0;
_X_EXPORT int PanoramiXNumScreens = 0; _X_EXPORT int PanoramiXNumScreens = 0;
_X_EXPORT PanoramiXData *panoramiXdataPtr = NULL; _X_EXPORT PanoramiXData *panoramiXdataPtr = NULL;
RegionRec PanoramiXScreenRegion = {{0, 0, 0, 0}, NULL}; static RegionRec PanoramiXScreenRegion = {{0, 0, 0, 0}, NULL};
static int PanoramiXNumDepths; static int PanoramiXNumDepths;
static DepthPtr PanoramiXDepths; static DepthPtr PanoramiXDepths;
@ -109,7 +109,6 @@ static void PanoramiXResetProc(ExtensionEntry*);
#include "panoramiXh.h" #include "panoramiXh.h"
int (* SavedProcVector[256]) (ClientPtr client) = { NULL, }; int (* SavedProcVector[256]) (ClientPtr client) = { NULL, };
ScreenInfo *GlobalScrInfo = NULL;
static int PanoramiXGCIndex = -1; static int PanoramiXGCIndex = -1;
static int PanoramiXScreenIndex = -1; static int PanoramiXScreenIndex = -1;
@ -135,7 +134,7 @@ static void XineramaChangeClip(GCPtr, int, pointer, int);
static void XineramaDestroyClip(GCPtr); static void XineramaDestroyClip(GCPtr);
static void XineramaCopyClip(GCPtr, GCPtr); static void XineramaCopyClip(GCPtr, GCPtr);
GCFuncs XineramaGCFuncs = { static GCFuncs XineramaGCFuncs = {
XineramaValidateGC, XineramaChangeGC, XineramaCopyGC, XineramaDestroyGC, XineramaValidateGC, XineramaChangeGC, XineramaCopyGC, XineramaDestroyGC,
XineramaChangeClip, XineramaDestroyClip, XineramaCopyClip XineramaChangeClip, XineramaDestroyClip, XineramaCopyClip
}; };
@ -168,7 +167,7 @@ XineramaCloseScreen (int i, ScreenPtr pScreen)
return (*pScreen->CloseScreen) (i, pScreen); return (*pScreen->CloseScreen) (i, pScreen);
} }
Bool static Bool
XineramaCreateGC(GCPtr pGC) XineramaCreateGC(GCPtr pGC)
{ {
ScreenPtr pScreen = pGC->pScreen; ScreenPtr pScreen = pGC->pScreen;
@ -330,8 +329,6 @@ XineramaDestroyClip(GCPtr pGC)
Xinerama_GC_FUNC_EPILOGUE (pGC); Xinerama_GC_FUNC_EPILOGUE (pGC);
} }
_X_EXPORT int _X_EXPORT int
XineramaDeleteResource(pointer data, XID id) XineramaDeleteResource(pointer data, XID id)
{ {
@ -339,32 +336,11 @@ XineramaDeleteResource(pointer data, XID id)
return 1; return 1;
} }
static Bool
XineramaFindIDOnAnyScreen(pointer resource, XID id, pointer privdata)
{
PanoramiXRes *res = (PanoramiXRes*)resource;
int j;
FOR_NSCREENS(j)
if(res->info[j].id == *((XID*)privdata)) return TRUE;
return FALSE;
}
PanoramiXRes *
PanoramiXFindIDOnAnyScreen(RESTYPE type, XID id)
{
return LookupClientResourceComplex(clients[CLIENT_ID(id)], type,
XineramaFindIDOnAnyScreen, &id);
}
typedef struct { typedef struct {
int screen; int screen;
int id; int id;
} PanoramiXSearchData; } PanoramiXSearchData;
static Bool static Bool
XineramaFindIDByScrnum(pointer resource, XID id, pointer privdata) XineramaFindIDByScrnum(pointer resource, XID id, pointer privdata)
{ {
@ -389,23 +365,6 @@ PanoramiXFindIDByScrnum(RESTYPE type, XID id, int screen)
XineramaFindIDByScrnum, &data); XineramaFindIDByScrnum, &data);
} }
WindowPtr
PanoramiXChangeWindow(int ScrnNum, WindowPtr pWin)
{
int num = pWin->drawable.pScreen->myNum;
if(num != ScrnNum) {
PanoramiXRes *win;
win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, num);
if (win)
pWin = (WindowPtr) LookupIDByType(win->info[ScrnNum].id, RT_WINDOW);
}
return pWin;
}
typedef struct _connect_callback_list { typedef struct _connect_callback_list {
void (*func)(void); void (*func)(void);
struct _connect_callback_list *next; struct _connect_callback_list *next;
@ -496,7 +455,6 @@ void PanoramiXExtensionInit(int argc, char *argv[])
if (noPanoramiXExtension) if (noPanoramiXExtension)
return; return;
GlobalScrInfo = &screenInfo; /* For debug visibility */
PanoramiXNumScreens = screenInfo.numScreens; PanoramiXNumScreens = screenInfo.numScreens;
if (PanoramiXNumScreens == 1) { /* Only 1 screen */ if (PanoramiXNumScreens == 1) { /* Only 1 screen */
noPanoramiXExtension = TRUE; noPanoramiXExtension = TRUE;

View File

@ -94,18 +94,6 @@ typedef struct {
(a).root = WindowTable[0]->drawable.id; \ (a).root = WindowTable[0]->drawable.id; \
} }
#define FORCE_WIN(a) { \
if ((win = PanoramiXFindIDOnAnyScreen(XRT_WINDOW, a))) { \
(a) = win->info[0].id; /* Real ID */ \
} \
}
#define FORCE_CMAP(a) { \
if ((win = PanoramiXFindIDOnAnyScreen(XRT_COLORMAP, a))) { \
(a) = win->info[0].id; /* Real ID */ \
} \
}
#define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared) #define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared)
#define SKIP_FAKE_WINDOW(a) if(!LookupIDByType(a, XRT_WINDOW)) return #define SKIP_FAKE_WINDOW(a) if(!LookupIDByType(a, XRT_WINDOW)) return

View File

@ -19,10 +19,10 @@ extern int PanoramiXGetGeometry(ClientPtr client);
extern int PanoramiXTranslateCoords(ClientPtr client); extern int PanoramiXTranslateCoords(ClientPtr client);
extern int PanoramiXCreatePixmap(ClientPtr client); extern int PanoramiXCreatePixmap(ClientPtr client);
extern int PanoramiXFreePixmap(ClientPtr client); extern int PanoramiXFreePixmap(ClientPtr client);
extern int PanoramiXCreateGC(ClientPtr client);
extern int PanoramiXChangeGC(ClientPtr client); extern int PanoramiXChangeGC(ClientPtr client);
extern int PanoramiXCopyGC(ClientPtr client); extern int PanoramiXCopyGC(ClientPtr client);
extern int PanoramiXCopyColormapAndFree(ClientPtr client); extern int PanoramiXCopyColormapAndFree(ClientPtr client);
extern int PanoramiXCreateGC(ClientPtr client);
extern int PanoramiXSetDashes(ClientPtr client); extern int PanoramiXSetDashes(ClientPtr client);
extern int PanoramiXSetClipRectangles(ClientPtr client); extern int PanoramiXSetClipRectangles(ClientPtr client);
extern int PanoramiXFreeGC(ClientPtr client); extern int PanoramiXFreeGC(ClientPtr client);
@ -64,7 +64,6 @@ PROC_EXTERN(ProcPanoramiXGetScreenSize);
PROC_EXTERN(ProcXineramaQueryScreens); PROC_EXTERN(ProcXineramaQueryScreens);
PROC_EXTERN(ProcXineramaIsActive); PROC_EXTERN(ProcXineramaIsActive);
extern Bool XineramaCreateGC(GCPtr pGC);
extern int SProcPanoramiXDispatch(ClientPtr client); extern int SProcPanoramiXDispatch(ClientPtr client);
@ -72,6 +71,4 @@ extern char *ConnectionInfo;
extern int connBlockScreenStart; extern int connBlockScreenStart;
extern xConnSetupPrefix connSetupPrefix; extern xConnSetupPrefix connSetupPrefix;
extern ScreenInfo *GlobalScrInfo;
extern int (* SavedProcVector[256]) (ClientPtr client); extern int (* SavedProcVector[256]) (ClientPtr client);

View File

@ -12,14 +12,11 @@ extern int PanoramiXNumScreens;
extern PanoramiXData *panoramiXdataPtr; extern PanoramiXData *panoramiXdataPtr;
extern int PanoramiXPixWidth; extern int PanoramiXPixWidth;
extern int PanoramiXPixHeight; extern int PanoramiXPixHeight;
extern RegionRec PanoramiXScreenRegion;
extern XID *PanoramiXVisualTable; extern XID *PanoramiXVisualTable;
extern void PanoramiXConsolidate(void); extern void PanoramiXConsolidate(void);
extern Bool PanoramiXCreateConnectionBlock(void); extern Bool PanoramiXCreateConnectionBlock(void);
extern PanoramiXRes * PanoramiXFindIDByScrnum(RESTYPE, XID, int); extern PanoramiXRes * PanoramiXFindIDByScrnum(RESTYPE, XID, int);
extern PanoramiXRes * PanoramiXFindIDOnAnyScreen(RESTYPE, XID);
extern WindowPtr PanoramiXChangeWindow(int, WindowPtr);
extern Bool XineramaRegisterConnectionBlockCallback(void (*func)(void)); extern Bool XineramaRegisterConnectionBlockCallback(void (*func)(void));
extern int XineramaDeleteResource(pointer, XID); extern int XineramaDeleteResource(pointer, XID);

View File

@ -66,7 +66,7 @@ static unsigned char ScreenSaverReqCode = 0;
#endif #endif
static int ScreenSaverEventBase = 0; static int ScreenSaverEventBase = 0;
extern DISPATCH_PROC(ProcScreenSaverQueryInfo); static DISPATCH_PROC(ProcScreenSaverQueryInfo);
static DISPATCH_PROC(ProcScreenSaverDispatch); static DISPATCH_PROC(ProcScreenSaverDispatch);
static DISPATCH_PROC(ProcScreenSaverQueryVersion); static DISPATCH_PROC(ProcScreenSaverQueryVersion);
static DISPATCH_PROC(ProcScreenSaverSelectInput); static DISPATCH_PROC(ProcScreenSaverSelectInput);
@ -774,7 +774,7 @@ ProcScreenSaverQueryVersion (client)
return (client->noClientException); return (client->noClientException);
} }
int static int
ProcScreenSaverQueryInfo (client) ProcScreenSaverQueryInfo (client)
register ClientPtr client; register ClientPtr client;
{ {

View File

@ -77,7 +77,7 @@ typedef struct {
#define AUTHID(client) \ #define AUTHID(client) \
(((SecurityClientStateRec*)STATEPTR(client))->authId) (((SecurityClientStateRec*)STATEPTR(client))->authId)
CallbackListPtr SecurityValidateGroupCallback = NULL; /* see security.h */ static CallbackListPtr SecurityValidateGroupCallback = NULL;
RESTYPE SecurityAuthorizationResType; /* resource type for authorizations */ RESTYPE SecurityAuthorizationResType; /* resource type for authorizations */

View File

@ -72,15 +72,6 @@ typedef struct {
struct _OtherClients *eventClients; /* clients wanting events */ struct _OtherClients *eventClients; /* clients wanting events */
} SecurityAuthorizationRec, *SecurityAuthorizationPtr; } SecurityAuthorizationRec, *SecurityAuthorizationPtr;
/* The following callback is called when a GenerateAuthorization request
* is processed to sanity check the group argument. The call data will
* be a pointer to a SecurityValidateGroupInfoRec (below).
* Functions registered on this callback are expected to examine the
* group and set the valid field to TRUE if they recognize the group as a
* legitimate group. If they don't recognize it, they should not change the
* valid field.
*/
extern CallbackListPtr SecurityValidateGroupCallback;
typedef struct { typedef struct {
XID group; /* the group that was sent in GenerateAuthorization */ XID group; /* the group that was sent in GenerateAuthorization */
Bool valid; /* did anyone recognize it? if so, set to TRUE */ Bool valid; /* did anyone recognize it? if so, set to TRUE */

View File

@ -37,10 +37,10 @@ CallbackListPtr XaceHooks[XACE_NUM_HOOKS] = {0};
* from guessing extension major opcodes and using the extension even though * from guessing extension major opcodes and using the extension even though
* the extension can't be listed or queried. * the extension can't be listed or queried.
*/ */
int (*UntrustedProcVector[256])( static int (*UntrustedProcVector[256])(
ClientPtr /*client*/ ClientPtr /*client*/
); );
int (*SwappedUntrustedProcVector[256])( static int (*SwappedUntrustedProcVector[256])(
ClientPtr /*client*/ ClientPtr /*client*/
); );

View File

@ -82,16 +82,6 @@ extern int XaceHook(
/* From the original Security extension... /* From the original Security extension...
*/ */
/* Proc vectors for untrusted clients, swapped and unswapped versions.
* These are the same as the normal proc vectors except that extensions
* that haven't declared themselves secure will have ProcBadRequest plugged
* in for their major opcode dispatcher. This prevents untrusted clients
* from guessing extension major opcodes and using the extension even though
* the extension can't be listed or queried.
*/
extern int (*UntrustedProcVector[256])(ClientPtr client);
extern int (*SwappedUntrustedProcVector[256])(ClientPtr client);
extern void XaceCensorImage( extern void XaceCensorImage(
ClientPtr client, ClientPtr client,
RegionPtr pVisibleRegion, RegionPtr pVisibleRegion,

View File

@ -52,7 +52,7 @@ of the copyright holder.
#include "inputstr.h" #include "inputstr.h"
#include "windowstr.h" #include "windowstr.h"
#include "cursorstr.h" #include "cursorstr.h"
#include <X11/extensions/XKBsrv.h> #include <xkbsrv.h>
#include "../os/osdep.h" #include "../os/osdep.h"
@ -105,7 +105,7 @@ typedef struct {
} xevieKeycQueueRec, *xevieKeycQueuePtr; } xevieKeycQueueRec, *xevieKeycQueuePtr;
#define KEYC_QUEUE_SIZE 100 #define KEYC_QUEUE_SIZE 100
xevieKeycQueueRec keycq[KEYC_QUEUE_SIZE] = {{0, NULL}}; static xevieKeycQueueRec keycq[KEYC_QUEUE_SIZE] = {{0, NULL}};
static int keycqHead = 0, keycqTail = 0; static int keycqHead = 0, keycqTail = 0;
static int ProcDispatch (ClientPtr), SProcDispatch (ClientPtr); static int ProcDispatch (ClientPtr), SProcDispatch (ClientPtr);

View File

@ -76,9 +76,9 @@ SOFTWARE.
*/ */
int int
SProcXAllowDeviceEvents(register ClientPtr client) SProcXAllowDeviceEvents(ClientPtr client)
{ {
register char n; char n;
REQUEST(xAllowDeviceEventsReq); REQUEST(xAllowDeviceEventsReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -94,7 +94,7 @@ SProcXAllowDeviceEvents(register ClientPtr client)
*/ */
int int
ProcXAllowDeviceEvents(register ClientPtr client) ProcXAllowDeviceEvents(ClientPtr client)
{ {
TimeStamp time; TimeStamp time;
DeviceIntPtr thisdev; DeviceIntPtr thisdev;

View File

@ -59,9 +59,9 @@ from the author.
*/ */
int int
SProcXChangeDeviceCursor(register ClientPtr client) SProcXChangeDeviceCursor(ClientPtr client)
{ {
register char n; char n;
REQUEST(xChangeDeviceCursorReq); REQUEST(xChangeDeviceCursorReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -69,7 +69,7 @@ SProcXChangeDeviceCursor(register ClientPtr client)
return (ProcXChangeDeviceCursor(client)); return (ProcXChangeDeviceCursor(client));
} }
int ProcXChangeDeviceCursor(register ClientPtr client) int ProcXChangeDeviceCursor(ClientPtr client)
{ {
int err; int err;
WindowPtr pWin = NULL; WindowPtr pWin = NULL;

View File

@ -78,9 +78,9 @@ SOFTWARE.
*/ */
int int
SProcXChangeDeviceControl(register ClientPtr client) SProcXChangeDeviceControl(ClientPtr client)
{ {
register char n; char n;
REQUEST(xChangeDeviceControlReq); REQUEST(xChangeDeviceControlReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -287,7 +287,7 @@ void
SRepXChangeDeviceControl(ClientPtr client, int size, SRepXChangeDeviceControl(ClientPtr client, int size,
xChangeDeviceControlReply * rep) xChangeDeviceControlReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -78,9 +78,9 @@ SOFTWARE.
*/ */
int int
SProcXChangeFeedbackControl(register ClientPtr client) SProcXChangeFeedbackControl(ClientPtr client)
{ {
register char n; char n;
REQUEST(xChangeFeedbackControlReq); REQUEST(xChangeFeedbackControlReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -89,141 +89,17 @@ SProcXChangeFeedbackControl(register ClientPtr client)
return (ProcXChangeFeedbackControl(client)); return (ProcXChangeFeedbackControl(client));
} }
/***********************************************************************
*
* Change the control attributes.
*
*/
int
ProcXChangeFeedbackControl(ClientPtr client)
{
unsigned len;
DeviceIntPtr dev;
KbdFeedbackPtr k;
PtrFeedbackPtr p;
IntegerFeedbackPtr i;
StringFeedbackPtr s;
BellFeedbackPtr b;
LedFeedbackPtr l;
REQUEST(xChangeFeedbackControlReq);
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
len = stuff->length - (sizeof(xChangeFeedbackControlReq) >> 2);
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
BadDevice);
return Success;
}
switch (stuff->feedbackid) {
case KbdFeedbackClass:
if (len != (sizeof(xKbdFeedbackCtl) >> 2)) {
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
0, BadLength);
return Success;
}
for (k = dev->kbdfeed; k; k = k->next)
if (k->ctrl.id == ((xKbdFeedbackCtl *) & stuff[1])->id) {
ChangeKbdFeedback(client, dev, stuff->mask, k,
(xKbdFeedbackCtl *) & stuff[1]);
return Success;
}
break;
case PtrFeedbackClass:
if (len != (sizeof(xPtrFeedbackCtl) >> 2)) {
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
0, BadLength);
return Success;
}
for (p = dev->ptrfeed; p; p = p->next)
if (p->ctrl.id == ((xPtrFeedbackCtl *) & stuff[1])->id) {
ChangePtrFeedback(client, dev, stuff->mask, p,
(xPtrFeedbackCtl *) & stuff[1]);
return Success;
}
break;
case StringFeedbackClass:
{
register char n;
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) & stuff[1]);
if (client->swapped) {
swaps(&f->num_keysyms, n);
}
if (len != ((sizeof(xStringFeedbackCtl) >> 2) + f->num_keysyms)) {
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
0, BadLength);
return Success;
}
for (s = dev->stringfeed; s; s = s->next)
if (s->ctrl.id == ((xStringFeedbackCtl *) & stuff[1])->id) {
ChangeStringFeedback(client, dev, stuff->mask, s,
(xStringFeedbackCtl *) & stuff[1]);
return Success;
}
break;
}
case IntegerFeedbackClass:
if (len != (sizeof(xIntegerFeedbackCtl) >> 2)) {
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
0, BadLength);
return Success;
}
for (i = dev->intfeed; i; i = i->next)
if (i->ctrl.id == ((xIntegerFeedbackCtl *) & stuff[1])->id) {
ChangeIntegerFeedback(client, dev, stuff->mask, i,
(xIntegerFeedbackCtl *) & stuff[1]);
return Success;
}
break;
case LedFeedbackClass:
if (len != (sizeof(xLedFeedbackCtl) >> 2)) {
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
0, BadLength);
return Success;
}
for (l = dev->leds; l; l = l->next)
if (l->ctrl.id == ((xLedFeedbackCtl *) & stuff[1])->id) {
ChangeLedFeedback(client, dev, stuff->mask, l,
(xLedFeedbackCtl *) & stuff[1]);
return Success;
}
break;
case BellFeedbackClass:
if (len != (sizeof(xBellFeedbackCtl) >> 2)) {
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
0, BadLength);
return Success;
}
for (b = dev->bell; b; b = b->next)
if (b->ctrl.id == ((xBellFeedbackCtl *) & stuff[1])->id) {
ChangeBellFeedback(client, dev, stuff->mask, b,
(xBellFeedbackCtl *) & stuff[1]);
return Success;
}
break;
default:
break;
}
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0, BadMatch);
return Success;
}
/****************************************************************************** /******************************************************************************
* *
* This procedure changes KbdFeedbackClass data. * This procedure changes KbdFeedbackClass data.
* *
*/ */
int static int
ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
KbdFeedbackPtr k, xKbdFeedbackCtl * f) KbdFeedbackPtr k, xKbdFeedbackCtl * f)
{ {
register char n; char n;
KeybdCtrl kctrl; KeybdCtrl kctrl;
int t; int t;
int key = DO_ALL; int key = DO_ALL;
@ -351,11 +227,11 @@ ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
* *
*/ */
int static int
ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
PtrFeedbackPtr p, xPtrFeedbackCtl * f) PtrFeedbackPtr p, xPtrFeedbackCtl * f)
{ {
register char n; char n;
PtrCtrl pctrl; /* might get BadValue part way through */ PtrCtrl pctrl; /* might get BadValue part way through */
if (client->swapped) { if (client->swapped) {
@ -422,12 +298,12 @@ ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
* *
*/ */
int static int
ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev, ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, IntegerFeedbackPtr i, long unsigned int mask, IntegerFeedbackPtr i,
xIntegerFeedbackCtl * f) xIntegerFeedbackCtl * f)
{ {
register char n; char n;
if (client->swapped) { if (client->swapped) {
swaps(&f->length, n); swaps(&f->length, n);
@ -445,13 +321,13 @@ ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev,
* *
*/ */
int static int
ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev, ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, StringFeedbackPtr s, long unsigned int mask, StringFeedbackPtr s,
xStringFeedbackCtl * f) xStringFeedbackCtl * f)
{ {
register char n; char n;
register long *p; long *p;
int i, j; int i, j;
KeySym *syms, *sup_syms; KeySym *syms, *sup_syms;
@ -495,12 +371,12 @@ ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev,
* *
*/ */
int static int
ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev, ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, BellFeedbackPtr b, long unsigned int mask, BellFeedbackPtr b,
xBellFeedbackCtl * f) xBellFeedbackCtl * f)
{ {
register char n; char n;
int t; int t;
BellCtrl bctrl; /* might get BadValue part way through */ BellCtrl bctrl; /* might get BadValue part way through */
@ -560,11 +436,11 @@ ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev,
* *
*/ */
int static int
ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
LedFeedbackPtr l, xLedFeedbackCtl * f) LedFeedbackPtr l, xLedFeedbackCtl * f)
{ {
register char n; char n;
LedCtrl lctrl; /* might get BadValue part way through */ LedCtrl lctrl; /* might get BadValue part way through */
if (client->swapped) { if (client->swapped) {
@ -585,3 +461,128 @@ ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
return Success; return Success;
} }
/***********************************************************************
*
* Change the control attributes.
*
*/
int
ProcXChangeFeedbackControl(ClientPtr client)
{
unsigned len;
DeviceIntPtr dev;
KbdFeedbackPtr k;
PtrFeedbackPtr p;
IntegerFeedbackPtr i;
StringFeedbackPtr s;
BellFeedbackPtr b;
LedFeedbackPtr l;
REQUEST(xChangeFeedbackControlReq);
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
len = stuff->length - (sizeof(xChangeFeedbackControlReq) >> 2);
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
BadDevice);
return Success;
}
switch (stuff->feedbackid) {
case KbdFeedbackClass:
if (len != (sizeof(xKbdFeedbackCtl) >> 2)) {
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
0, BadLength);
return Success;
}
for (k = dev->kbdfeed; k; k = k->next)
if (k->ctrl.id == ((xKbdFeedbackCtl *) & stuff[1])->id) {
ChangeKbdFeedback(client, dev, stuff->mask, k,
(xKbdFeedbackCtl *) & stuff[1]);
return Success;
}
break;
case PtrFeedbackClass:
if (len != (sizeof(xPtrFeedbackCtl) >> 2)) {
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
0, BadLength);
return Success;
}
for (p = dev->ptrfeed; p; p = p->next)
if (p->ctrl.id == ((xPtrFeedbackCtl *) & stuff[1])->id) {
ChangePtrFeedback(client, dev, stuff->mask, p,
(xPtrFeedbackCtl *) & stuff[1]);
return Success;
}
break;
case StringFeedbackClass:
{
char n;
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) & stuff[1]);
if (client->swapped) {
swaps(&f->num_keysyms, n);
}
if (len != ((sizeof(xStringFeedbackCtl) >> 2) + f->num_keysyms)) {
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
0, BadLength);
return Success;
}
for (s = dev->stringfeed; s; s = s->next)
if (s->ctrl.id == ((xStringFeedbackCtl *) & stuff[1])->id) {
ChangeStringFeedback(client, dev, stuff->mask, s,
(xStringFeedbackCtl *) & stuff[1]);
return Success;
}
break;
}
case IntegerFeedbackClass:
if (len != (sizeof(xIntegerFeedbackCtl) >> 2)) {
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
0, BadLength);
return Success;
}
for (i = dev->intfeed; i; i = i->next)
if (i->ctrl.id == ((xIntegerFeedbackCtl *) & stuff[1])->id) {
ChangeIntegerFeedback(client, dev, stuff->mask, i,
(xIntegerFeedbackCtl *) & stuff[1]);
return Success;
}
break;
case LedFeedbackClass:
if (len != (sizeof(xLedFeedbackCtl) >> 2)) {
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
0, BadLength);
return Success;
}
for (l = dev->leds; l; l = l->next)
if (l->ctrl.id == ((xLedFeedbackCtl *) & stuff[1])->id) {
ChangeLedFeedback(client, dev, stuff->mask, l,
(xLedFeedbackCtl *) & stuff[1]);
return Success;
}
break;
case BellFeedbackClass:
if (len != (sizeof(xBellFeedbackCtl) >> 2)) {
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
0, BadLength);
return Success;
}
for (b = dev->bell; b; b = b->next)
if (b->ctrl.id == ((xBellFeedbackCtl *) & stuff[1])->id) {
ChangeBellFeedback(client, dev, stuff->mask, b,
(xBellFeedbackCtl *) & stuff[1]);
return Success;
}
break;
default:
break;
}
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0, BadMatch);
return Success;
}

View File

@ -36,46 +36,4 @@ int SProcXChangeFeedbackControl(ClientPtr /* client */
int ProcXChangeFeedbackControl(ClientPtr /* client */ int ProcXChangeFeedbackControl(ClientPtr /* client */
); );
int ChangeKbdFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
KbdFeedbackPtr /* k */ ,
xKbdFeedbackCtl * /* f */
);
int ChangePtrFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
PtrFeedbackPtr /* p */ ,
xPtrFeedbackCtl * /* f */
);
int ChangeIntegerFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
IntegerFeedbackPtr /* i */ ,
xIntegerFeedbackCtl * /* f */
);
int ChangeStringFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
StringFeedbackPtr /* s */ ,
xStringFeedbackCtl * /* f */
);
int ChangeBellFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
BellFeedbackPtr /* b */ ,
xBellFeedbackCtl * /* f */
);
int ChangeLedFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
LedFeedbackPtr /* l */ ,
xLedFeedbackCtl * /* f */
);
#endif /* CHGFCTL_H */ #endif /* CHGFCTL_H */

View File

@ -78,9 +78,9 @@ SOFTWARE.
*/ */
int int
SProcXChangeKeyboardDevice(register ClientPtr client) SProcXChangeKeyboardDevice(ClientPtr client)
{ {
register char n; char n;
REQUEST(xChangeKeyboardDeviceReq); REQUEST(xChangeKeyboardDeviceReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -96,7 +96,7 @@ SProcXChangeKeyboardDevice(register ClientPtr client)
*/ */
int int
ProcXChangeKeyboardDevice(register ClientPtr client) ProcXChangeKeyboardDevice(ClientPtr client)
{ {
REQUEST(xChangeKeyboardDeviceReq); REQUEST(xChangeKeyboardDeviceReq);
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq); REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);

View File

@ -76,11 +76,11 @@ SOFTWARE.
*/ */
int int
SProcXChangeDeviceKeyMapping(register ClientPtr client) SProcXChangeDeviceKeyMapping(ClientPtr client)
{ {
register char n; char n;
register long *p; long *p;
register int i, count; int i, count;
REQUEST(xChangeDeviceKeyMappingReq); REQUEST(xChangeDeviceKeyMappingReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -101,7 +101,7 @@ SProcXChangeDeviceKeyMapping(register ClientPtr client)
*/ */
int int
ProcXChangeDeviceKeyMapping(register ClientPtr client) ProcXChangeDeviceKeyMapping(ClientPtr client)
{ {
int ret; int ret;
unsigned len; unsigned len;

View File

@ -78,11 +78,11 @@ SOFTWARE.
*/ */
int int
SProcXChangeDeviceDontPropagateList(register ClientPtr client) SProcXChangeDeviceDontPropagateList(ClientPtr client)
{ {
register char n; char n;
register long *p; long *p;
register int i; int i;
REQUEST(xChangeDeviceDontPropagateListReq); REQUEST(xChangeDeviceDontPropagateListReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -104,7 +104,7 @@ SProcXChangeDeviceDontPropagateList(register ClientPtr client)
*/ */
int int
ProcXChangeDeviceDontPropagateList(register ClientPtr client) ProcXChangeDeviceDontPropagateList(ClientPtr client)
{ {
int i, rc; int i, rc;
WindowPtr pWin; WindowPtr pWin;

View File

@ -82,9 +82,9 @@ SOFTWARE.
*/ */
int int
SProcXChangePointerDevice(register ClientPtr client) SProcXChangePointerDevice(ClientPtr client)
{ {
register char n; char n;
REQUEST(xChangePointerDeviceReq); REQUEST(xChangePointerDeviceReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -99,7 +99,7 @@ SProcXChangePointerDevice(register ClientPtr client)
*/ */
int int
ProcXChangePointerDevice(register ClientPtr client) ProcXChangePointerDevice(ClientPtr client)
{ {
REQUEST(xChangePointerDeviceReq); REQUEST(xChangePointerDeviceReq);
REQUEST_SIZE_MATCH(xChangePointerDeviceReq); REQUEST_SIZE_MATCH(xChangePointerDeviceReq);

View File

@ -45,12 +45,4 @@ void SendEventToAllWindows(DeviceIntPtr /* dev */ ,
int /* count */ int /* count */
); );
void FindInterestedChildren( /* FIXME: could be static? */
DeviceIntPtr /* dev */ ,
WindowPtr /* p1 */ ,
Mask /* mask */ ,
xEvent * /* ev */ ,
int /* count */
);
#endif /* CHGPTR_H */ #endif /* CHGPTR_H */

View File

@ -60,9 +60,9 @@ from the author.
* *
*/ */
int SProcXChangePointerKeyboardPairing(register ClientPtr client) int SProcXChangePointerKeyboardPairing(ClientPtr client)
{ {
register char n; char n;
REQUEST(xChangePointerKeyboardPairingReq); REQUEST(xChangePointerKeyboardPairingReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -70,7 +70,7 @@ int SProcXChangePointerKeyboardPairing(register ClientPtr client)
} }
int int
ProcXChangePointerKeyboardPairing(register ClientPtr client) ProcXChangePointerKeyboardPairing(ClientPtr client)
{ {
DeviceIntPtr pPointer, pKeyboard; DeviceIntPtr pPointer, pKeyboard;
int ret; int ret;

View File

@ -77,9 +77,9 @@ SOFTWARE.
*/ */
int int
SProcXCloseDevice(register ClientPtr client) SProcXCloseDevice(ClientPtr client)
{ {
register char n; char n;
REQUEST(xCloseDeviceReq); REQUEST(xCloseDeviceReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -87,6 +87,53 @@ SProcXCloseDevice(register ClientPtr client)
return (ProcXCloseDevice(client)); return (ProcXCloseDevice(client));
} }
/***********************************************************************
*
* Clear out event selections and passive grabs from a window for the
* specified device.
*
*/
static void
DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
{
InputClientsPtr others;
OtherInputMasks *pOthers;
GrabPtr grab, next;
if ((pOthers = wOtherInputMasks(pWin)) != 0)
for (others = pOthers->inputClients; others; others = others->next)
if (SameClient(others, client))
others->mask[dev->id] = NoEventMask;
for (grab = wPassiveGrabs(pWin); grab; grab = next) {
next = grab->next;
if ((grab->device == dev) &&
(client->clientAsMask == CLIENT_BITS(grab->resource)))
FreeResource(grab->resource, RT_NONE);
}
}
/***********************************************************************
*
* Walk througth the window tree, deleting event selections for this client
* from this device from all windows.
*
*/
static void
DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client)
{
WindowPtr p2;
while (p1) {
p2 = p1->firstChild;
DeleteDeviceEvents(dev, p1, client);
DeleteEventsFromChildren(dev, p2, client);
p1 = p1->nextSib;
}
}
/*********************************************************************** /***********************************************************************
* *
* This procedure closes an input device. * This procedure closes an input device.
@ -94,7 +141,7 @@ SProcXCloseDevice(register ClientPtr client)
*/ */
int int
ProcXCloseDevice(register ClientPtr client) ProcXCloseDevice(ClientPtr client)
{ {
int i; int i;
WindowPtr pWin, p1; WindowPtr pWin, p1;
@ -126,50 +173,3 @@ ProcXCloseDevice(register ClientPtr client)
CloseInputDevice(d, client); CloseInputDevice(d, client);
return Success; return Success;
} }
/***********************************************************************
*
* Walk througth the window tree, deleting event selections for this client
* from this device from all windows.
*
*/
void
DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client)
{
WindowPtr p2;
while (p1) {
p2 = p1->firstChild;
DeleteDeviceEvents(dev, p1, client);
DeleteEventsFromChildren(dev, p2, client);
p1 = p1->nextSib;
}
}
/***********************************************************************
*
* Clear out event selections and passive grabs from a window for the
* specified device.
*
*/
void
DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
{
InputClientsPtr others;
OtherInputMasks *pOthers;
GrabPtr grab, next;
if ((pOthers = wOtherInputMasks(pWin)) != 0)
for (others = pOthers->inputClients; others; others = others->next)
if (SameClient(others, client))
others->mask[dev->id] = NoEventMask;
for (grab = wPassiveGrabs(pWin); grab; grab = next) {
next = grab->next;
if ((grab->device == dev) &&
(client->clientAsMask == CLIENT_BITS(grab->resource)))
FreeResource(grab->resource, RT_NONE);
}
}

View File

@ -36,14 +36,4 @@ int SProcXCloseDevice(ClientPtr /* client */
int ProcXCloseDevice(ClientPtr /* client */ int ProcXCloseDevice(ClientPtr /* client */
); );
void DeleteEventsFromChildren(DeviceIntPtr /* dev */ ,
WindowPtr /* p1 */ ,
ClientPtr /* client */
);
void DeleteDeviceEvents(DeviceIntPtr /* dev */ ,
WindowPtr /* pWin */ ,
ClientPtr /* client */
);
#endif /* CLOSEDEV_H */ #endif /* CLOSEDEV_H */

View File

@ -75,9 +75,9 @@ SOFTWARE.
*/ */
int int
SProcXDeviceBell(register ClientPtr client) SProcXDeviceBell(ClientPtr client)
{ {
register char n; char n;
REQUEST(xDeviceBellReq); REQUEST(xDeviceBellReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -91,7 +91,7 @@ SProcXDeviceBell(register ClientPtr client)
*/ */
int int
ProcXDeviceBell(register ClientPtr client) ProcXDeviceBell(ClientPtr client)
{ {
DeviceIntPtr dev; DeviceIntPtr dev;
KbdFeedbackPtr k; KbdFeedbackPtr k;

View File

@ -319,7 +319,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
_X_EXPORT int _X_EXPORT int
InitProximityClassDeviceStruct(DeviceIntPtr dev) InitProximityClassDeviceStruct(DeviceIntPtr dev)
{ {
register ProximityClassPtr proxc; ProximityClassPtr proxc;
proxc = (ProximityClassPtr) xalloc(sizeof(ProximityClassRec)); proxc = (ProximityClassPtr) xalloc(sizeof(ProximityClassRec));
if (!proxc) if (!proxc)
@ -332,7 +332,7 @@ _X_EXPORT void
InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, int minval, int maxval, InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, int minval, int maxval,
int resolution, int min_res, int max_res) int resolution, int min_res, int max_res)
{ {
register AxisInfoPtr ax; AxisInfoPtr ax;
if (!dev || !dev->valuator) if (!dev || !dev->valuator)
return; return;
@ -409,7 +409,7 @@ FixDeviceValuator(DeviceIntPtr dev, deviceValuator * ev, ValuatorClassPtr v,
void void
DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
register WindowPtr pWin) WindowPtr pWin)
{ {
deviceFocus event; deviceFocus event;
@ -734,9 +734,9 @@ MakeInputMasks(WindowPtr pWin)
void void
RecalculateDeviceDeliverableEvents(WindowPtr pWin) RecalculateDeviceDeliverableEvents(WindowPtr pWin)
{ {
register InputClientsPtr others; InputClientsPtr others;
struct _OtherInputMasks *inputMasks; /* default: NULL */ struct _OtherInputMasks *inputMasks; /* default: NULL */
register WindowPtr pChild, tmp; WindowPtr pChild, tmp;
int i; int i;
pChild = pWin; pChild = pWin;
@ -770,9 +770,9 @@ RecalculateDeviceDeliverableEvents(WindowPtr pWin)
} }
int int
InputClientGone(register WindowPtr pWin, XID id) InputClientGone(WindowPtr pWin, XID id)
{ {
register InputClientsPtr other, prev; InputClientsPtr other, prev;
if (!wOtherInputMasks(pWin)) if (!wOtherInputMasks(pWin))
return (Success); return (Success);
@ -870,7 +870,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
int int
SetButtonMapping(ClientPtr client, DeviceIntPtr dev, int nElts, BYTE * map) SetButtonMapping(ClientPtr client, DeviceIntPtr dev, int nElts, BYTE * map)
{ {
register int i; int i;
ButtonClassPtr b = dev->button; ButtonClassPtr b = dev->button;
if (b == NULL) if (b == NULL)
@ -896,7 +896,7 @@ SetModifierMapping(ClientPtr client, DeviceIntPtr dev, int len, int rlen,
{ {
KeyCode *map = NULL; KeyCode *map = NULL;
int inputMapLen; int inputMapLen;
register int i; int i;
*k = dev->key; *k = dev->key;
if (*k == NULL) if (*k == NULL)
@ -1025,33 +1025,7 @@ ChangeKeyMapping(ClientPtr client,
return client->noClientException; return client->noClientException;
} }
void static void
DeleteWindowFromAnyExtEvents(WindowPtr pWin, Bool freeResources)
{
int i;
DeviceIntPtr dev;
InputClientsPtr ic;
struct _OtherInputMasks *inputMasks;
for (dev = inputInfo.devices; dev; dev = dev->next) {
if (dev == inputInfo.pointer || dev == inputInfo.keyboard)
continue;
DeleteDeviceFromAnyExtEvents(pWin, dev);
}
for (dev = inputInfo.off_devices; dev; dev = dev->next)
DeleteDeviceFromAnyExtEvents(pWin, dev);
if (freeResources)
while ((inputMasks = wOtherInputMasks(pWin)) != 0) {
ic = inputMasks->inputClients;
for (i = 0; i < EMASKSIZE; i++)
inputMasks->dontPropagateMask[i] = 0;
FreeResource(ic->resource, RT_NONE);
}
}
void
DeleteDeviceFromAnyExtEvents(WindowPtr pWin, DeviceIntPtr dev) DeleteDeviceFromAnyExtEvents(WindowPtr pWin, DeviceIntPtr dev)
{ {
WindowPtr parent; WindowPtr parent;
@ -1116,6 +1090,32 @@ DeleteDeviceFromAnyExtEvents(WindowPtr pWin, DeviceIntPtr dev)
dev->valuator->motionHintWindow = NullWindow; dev->valuator->motionHintWindow = NullWindow;
} }
void
DeleteWindowFromAnyExtEvents(WindowPtr pWin, Bool freeResources)
{
int i;
DeviceIntPtr dev;
InputClientsPtr ic;
struct _OtherInputMasks *inputMasks;
for (dev = inputInfo.devices; dev; dev = dev->next) {
if (dev == inputInfo.pointer || dev == inputInfo.keyboard)
continue;
DeleteDeviceFromAnyExtEvents(pWin, dev);
}
for (dev = inputInfo.off_devices; dev; dev = dev->next)
DeleteDeviceFromAnyExtEvents(pWin, dev);
if (freeResources)
while ((inputMasks = wOtherInputMasks(pWin)) != 0) {
ic = inputMasks->inputClients;
for (i = 0; i < EMASKSIZE; i++)
inputMasks->dontPropagateMask[i] = 0;
FreeResource(ic->resource, RT_NONE);
}
}
int int
MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer * pEvents, Mask mask) MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer * pEvents, Mask mask)
{ {
@ -1169,10 +1169,10 @@ CheckDeviceGrabAndHintWindow(WindowPtr pWin, int type,
} }
} }
Mask static Mask
DeviceEventMaskForClient(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client) DeviceEventMaskForClient(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
{ {
register InputClientsPtr other; InputClientsPtr other;
if (!wOtherInputMasks(pWin)) if (!wOtherInputMasks(pWin))
return 0; return 0;
@ -1185,7 +1185,7 @@ DeviceEventMaskForClient(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
} }
void void
MaybeStopDeviceHint(register DeviceIntPtr dev, ClientPtr client) MaybeStopDeviceHint(DeviceIntPtr dev, ClientPtr client)
{ {
WindowPtr pWin; WindowPtr pWin;
GrabPtr grab = dev->deviceGrab.grab; GrabPtr grab = dev->deviceGrab.grab;
@ -1254,7 +1254,7 @@ ShouldFreeInputMasks(WindowPtr pWin, Bool ignoreSelectedEvents)
* *
*/ */
void static void
FindInterestedChildren(DeviceIntPtr dev, WindowPtr p1, Mask mask, FindInterestedChildren(DeviceIntPtr dev, WindowPtr p1, Mask mask,
xEvent * ev, int count) xEvent * ev, int count)
{ {

View File

@ -37,7 +37,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
extern int IReqCode; extern int IReqCode;
extern int BadDevice; extern int BadDevice;
extern int BadEvent;
extern int BadMode; extern int BadMode;
extern int DeviceBusy; extern int DeviceBusy;
extern int BadClass; extern int BadClass;
@ -46,7 +45,6 @@ extern Mask DevicePointerMotionMask;
extern Mask DevicePointerMotionHintMask; extern Mask DevicePointerMotionHintMask;
extern Mask DeviceFocusChangeMask; extern Mask DeviceFocusChangeMask;
extern Mask DeviceStateNotifyMask; extern Mask DeviceStateNotifyMask;
extern Mask ChangeDeviceNotifyMask;
extern Mask DeviceMappingNotifyMask; extern Mask DeviceMappingNotifyMask;
extern Mask DeviceOwnerGrabButtonMask; extern Mask DeviceOwnerGrabButtonMask;
extern Mask DeviceButtonGrabMask; extern Mask DeviceButtonGrabMask;

View File

@ -127,7 +127,7 @@ int ExtEventIndex;
Mask ExtValidMasks[EMASKSIZE]; Mask ExtValidMasks[EMASKSIZE];
Mask ExtExclusiveMasks[EMASKSIZE]; Mask ExtExclusiveMasks[EMASKSIZE];
struct dev_type static struct dev_type
{ {
Atom type; Atom type;
char *name; char *name;
@ -163,7 +163,7 @@ XExtEventInfo EventInfo[32];
int IReqCode = 0; int IReqCode = 0;
int BadDevice = 0; int BadDevice = 0;
int BadEvent = 1; static int BadEvent = 1;
int BadMode = 2; int BadMode = 2;
int DeviceBusy = 3; int DeviceBusy = 3;
int BadClass = 4; int BadClass = 4;
@ -172,7 +172,7 @@ Mask DevicePointerMotionMask;
Mask DevicePointerMotionHintMask; Mask DevicePointerMotionHintMask;
Mask DeviceFocusChangeMask; Mask DeviceFocusChangeMask;
Mask DeviceStateNotifyMask; Mask DeviceStateNotifyMask;
Mask ChangeDeviceNotifyMask; static Mask ChangeDeviceNotifyMask;
Mask DeviceMappingNotifyMask; Mask DeviceMappingNotifyMask;
Mask DeviceOwnerGrabButtonMask; Mask DeviceOwnerGrabButtonMask;
Mask DeviceButtonGrabMask; Mask DeviceButtonGrabMask;
@ -225,54 +225,6 @@ static XExtensionVersion thisversion = { XI_Present,
XI_Add_DevicePresenceNotify_Minor XI_Add_DevicePresenceNotify_Minor
}; };
/**********************************************************************
*
* IExtensionInit - initialize the input extension.
*
* Called from InitExtensions in main() or from QueryExtension() if the
* extension is dynamically loaded.
*
* This extension has several events and errors.
*
*/
void
XInputExtensionInit(void)
{
ExtensionEntry *extEntry;
extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch,
SProcIDispatch, IResetProc, StandardMinorOpcode);
if (extEntry) {
IReqCode = extEntry->base;
AllExtensionVersions[IReqCode - 128] = thisversion;
MakeDeviceTypeAtoms();
RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone);
FixExtensionEvents(extEntry);
ReplySwapVector[IReqCode] = (ReplySwapPtr) SReplyIDispatch;
EventSwapVector[DeviceValuator] = SEventIDispatch;
EventSwapVector[DeviceKeyPress] = SEventIDispatch;
EventSwapVector[DeviceKeyRelease] = SEventIDispatch;
EventSwapVector[DeviceButtonPress] = SEventIDispatch;
EventSwapVector[DeviceButtonRelease] = SEventIDispatch;
EventSwapVector[DeviceMotionNotify] = SEventIDispatch;
EventSwapVector[DeviceFocusIn] = SEventIDispatch;
EventSwapVector[DeviceFocusOut] = SEventIDispatch;
EventSwapVector[ProximityIn] = SEventIDispatch;
EventSwapVector[ProximityOut] = SEventIDispatch;
EventSwapVector[DeviceStateNotify] = SEventIDispatch;
EventSwapVector[DeviceKeyStateNotify] = SEventIDispatch;
EventSwapVector[DeviceButtonStateNotify] = SEventIDispatch;
EventSwapVector[DeviceMappingNotify] = SEventIDispatch;
EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
EventSwapVector[DeviceEnterNotify] = SEventIDispatch;
EventSwapVector[DeviceLeaveNotify] = SEventIDispatch;
EventSwapVector[PointerKeyboardPairingChangedNotify] = SEventIDispatch;
} else {
FatalError("IExtensionInit: AddExtensions failed\n");
}
}
/************************************************************************* /*************************************************************************
* *
* ProcIDispatch - main dispatch routine for requests to this extension. * ProcIDispatch - main dispatch routine for requests to this extension.
@ -280,8 +232,8 @@ XInputExtensionInit(void)
* *
*/ */
int static int
ProcIDispatch(register ClientPtr client) ProcIDispatch(ClientPtr client)
{ {
REQUEST(xReq); REQUEST(xReq);
if (stuff->data == X_GetExtensionVersion) if (stuff->data == X_GetExtensionVersion)
@ -391,8 +343,8 @@ ProcIDispatch(register ClientPtr client)
* *
*/ */
int static int
SProcIDispatch(register ClientPtr client) SProcIDispatch(ClientPtr client)
{ {
REQUEST(xReq); REQUEST(xReq);
if (stuff->data == X_GetExtensionVersion) if (stuff->data == X_GetExtensionVersion)
@ -505,7 +457,7 @@ SProcIDispatch(register ClientPtr client)
if (rep->RepType == X_##code) \ if (rep->RepType == X_##code) \
SRepX##code (client, len, (x##code##Reply *) rep) SRepX##code (client, len, (x##code##Reply *) rep)
void static void
SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep) SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
/* All we look at is the type field */ /* All we look at is the type field */
{ /* This is common to all replies */ { /* This is common to all replies */
@ -580,78 +532,17 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
} }
} }
/*****************************************************************************
*
* SEventIDispatch
*
* Swap any events defined in this extension.
*/
#define DO_SWAP(func,type) func ((type *)from, (type *)to)
void
SEventIDispatch(xEvent * from, xEvent * to)
{
int type = from->u.u.type & 0177;
if (type == DeviceValuator)
DO_SWAP(SEventDeviceValuator, deviceValuator);
else if (type == DeviceKeyPress) {
SKeyButtonPtrEvent(from, to);
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
} else if (type == DeviceKeyRelease) {
SKeyButtonPtrEvent(from, to);
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
} else if (type == DeviceButtonPress) {
SKeyButtonPtrEvent(from, to);
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
} else if (type == DeviceButtonRelease) {
SKeyButtonPtrEvent(from, to);
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
} else if (type == DeviceMotionNotify) {
SKeyButtonPtrEvent(from, to);
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
} else if (type == DeviceFocusIn)
DO_SWAP(SEventFocus, deviceFocus);
else if (type == DeviceFocusOut)
DO_SWAP(SEventFocus, deviceFocus);
else if (type == ProximityIn) {
SKeyButtonPtrEvent(from, to);
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
} else if (type == ProximityOut) {
SKeyButtonPtrEvent(from, to);
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
} else if (type == DeviceStateNotify)
DO_SWAP(SDeviceStateNotifyEvent, deviceStateNotify);
else if (type == DeviceKeyStateNotify)
DO_SWAP(SDeviceKeyStateNotifyEvent, deviceKeyStateNotify);
else if (type == DeviceButtonStateNotify)
DO_SWAP(SDeviceButtonStateNotifyEvent, deviceButtonStateNotify);
else if (type == DeviceMappingNotify)
DO_SWAP(SDeviceMappingNotifyEvent, deviceMappingNotify);
else if (type == ChangeDeviceNotify)
DO_SWAP(SChangeDeviceNotifyEvent, changeDeviceNotify);
else if (type == DeviceEnterNotify)
DO_SWAP(SDeviceEnterNotifyEvent, deviceEnterNotify);
else if (type == DeviceLeaveNotify)
DO_SWAP(SDeviceLeaveNotifyEvent, deviceLeaveNotify);
else if (type == PointerKeyboardPairingChangedNotify)
DO_SWAP(SPointerKeyboardPairingChangedNotifyEvent, pairingChangedNotify);
else {
FatalError("XInputExtension: Impossible event!\n");
}
}
/************************************************************************ /************************************************************************
* *
* This function swaps the DeviceValuator event. * This function swaps the DeviceValuator event.
* *
*/ */
void static void
SEventDeviceValuator(deviceValuator * from, deviceValuator * to) SEventDeviceValuator(deviceValuator * from, deviceValuator * to)
{ {
register char n; char n;
register int i; int i;
INT32 *ip B32; INT32 *ip B32;
*to = *from; *to = *from;
@ -663,10 +554,10 @@ SEventDeviceValuator(deviceValuator * from, deviceValuator * to)
} }
} }
void static void
SEventFocus(deviceFocus * from, deviceFocus * to) SEventFocus(deviceFocus * from, deviceFocus * to)
{ {
register char n; char n;
*to = *from; *to = *from;
swaps(&to->sequenceNumber, n); swaps(&to->sequenceNumber, n);
@ -674,11 +565,11 @@ SEventFocus(deviceFocus * from, deviceFocus * to)
swapl(&to->window, n); swapl(&to->window, n);
} }
void static void
SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to) SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to)
{ {
register int i; int i;
register char n; char n;
INT32 *ip B32; INT32 *ip B32;
*to = *from; *to = *from;
@ -690,50 +581,50 @@ SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to)
} }
} }
void static void
SDeviceKeyStateNotifyEvent(deviceKeyStateNotify * from, SDeviceKeyStateNotifyEvent(deviceKeyStateNotify * from,
deviceKeyStateNotify * to) deviceKeyStateNotify * to)
{ {
register char n; char n;
*to = *from; *to = *from;
swaps(&to->sequenceNumber, n); swaps(&to->sequenceNumber, n);
} }
void static void
SDeviceButtonStateNotifyEvent(deviceButtonStateNotify * from, SDeviceButtonStateNotifyEvent(deviceButtonStateNotify * from,
deviceButtonStateNotify * to) deviceButtonStateNotify * to)
{ {
register char n; char n;
*to = *from; *to = *from;
swaps(&to->sequenceNumber, n); swaps(&to->sequenceNumber, n);
} }
void static void
SChangeDeviceNotifyEvent(changeDeviceNotify * from, changeDeviceNotify * to) SChangeDeviceNotifyEvent(changeDeviceNotify * from, changeDeviceNotify * to)
{ {
register char n; char n;
*to = *from; *to = *from;
swaps(&to->sequenceNumber, n); swaps(&to->sequenceNumber, n);
swapl(&to->time, n); swapl(&to->time, n);
} }
void static void
SDeviceMappingNotifyEvent(deviceMappingNotify * from, deviceMappingNotify * to) SDeviceMappingNotifyEvent(deviceMappingNotify * from, deviceMappingNotify * to)
{ {
register char n; char n;
*to = *from; *to = *from;
swaps(&to->sequenceNumber, n); swaps(&to->sequenceNumber, n);
swapl(&to->time, n); swapl(&to->time, n);
} }
void static void
SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to) SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to)
{ {
register char n; char n;
*to = *from; *to = *from;
swaps(&to->sequenceNumber,n); swaps(&to->sequenceNumber,n);
@ -741,18 +632,20 @@ SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to
swaps(&to->control, n); swaps(&to->control, n);
} }
void SDeviceEnterNotifyEvent (deviceEnterNotify *from, deviceEnterNotify *to) static void
SDeviceEnterNotifyEvent (deviceEnterNotify *from, deviceEnterNotify *to)
{ {
register char n; char n;
*to = *from; *to = *from;
swaps(&to->sequenceNumber,n); swaps(&to->sequenceNumber,n);
swapl(&to->time, n); swapl(&to->time, n);
} }
void SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to) static void
SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to)
{ {
register char n; char n;
*to = *from; *to = *from;
swaps(&to->sequenceNumber,n); swaps(&to->sequenceNumber,n);
@ -766,23 +659,117 @@ void SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to)
swaps(&to->eventY, n); swaps(&to->eventY, n);
} }
void SPointerKeyboardPairingChangedNotifyEvent (pairingChangedNotify *from, static void
SPointerKeyboardPairingChangedNotifyEvent (pairingChangedNotify *from,
pairingChangedNotify *to) pairingChangedNotify *to)
{ {
register char n; char n;
*to = *from; *to = *from;
swaps(&to->sequenceNumber, n); swaps(&to->sequenceNumber, n);
swapl(&to->time, n); swapl(&to->time, n);
} }
/**************************************************************************
*
* Allow the specified event to have its propagation suppressed.
* The default is to not allow suppression of propagation.
*
*/
static void
AllowPropagateSuppress(Mask mask)
{
int i;
for (i = 0; i < MAX_DEVICES; i++)
PropagateMask[i] |= mask;
}
/**************************************************************************
*
* Return the next available extension event mask.
*
*/
static Mask
GetNextExtEventMask(void)
{
int i;
Mask mask = lastExtEventMask;
if (lastExtEventMask == 0) {
FatalError("GetNextExtEventMask: no more events are available.");
}
lastExtEventMask <<= 1;
for (i = 0; i < MAX_DEVICES; i++)
ExtValidMasks[i] |= mask;
return mask;
}
/**************************************************************************
*
* Record an event mask where there is no unique corresponding event type.
* We can't call SetMaskForEvent, since that would clobber the existing
* mask for that event. MotionHint and ButtonMotion are examples.
*
* Since extension event types will never be less than 64, we can use
* 0-63 in the EventInfo array as the "type" to be used to look up this
* mask. This means that the corresponding macros such as
* DevicePointerMotionHint must have access to the same constants.
*
*/
static void
SetEventInfo(Mask mask, int constant)
{
EventInfo[ExtEventIndex].mask = mask;
EventInfo[ExtEventIndex++].type = constant;
}
/**************************************************************************
*
* Allow the specified event to be restricted to being selected by one
* client at a time.
* The default is to allow more than one client to select the event.
*
*/
static void
SetExclusiveAccess(Mask mask)
{
int i;
for (i = 0; i < MAX_DEVICES; i++)
ExtExclusiveMasks[i] |= mask;
}
/**************************************************************************
*
* Assign the specified mask to the specified event.
*
*/
static void
SetMaskForExtEvent(Mask mask, int event)
{
EventInfo[ExtEventIndex].mask = mask;
EventInfo[ExtEventIndex++].type = event;
if ((event < LASTEvent) || (event >= 128))
FatalError("MaskForExtensionEvent: bogus event number");
SetMaskForEvent(mask, event);
}
/************************************************************************ /************************************************************************
* *
* This function sets up extension event types and masks. * This function sets up extension event types and masks.
* *
*/ */
void static void
FixExtensionEvents(ExtensionEntry * extEntry) FixExtensionEvents(ExtensionEntry * extEntry)
{ {
Mask mask; Mask mask;
@ -905,7 +892,7 @@ FixExtensionEvents(ExtensionEntry * extEntry)
* *
*/ */
void static void
RestoreExtensionEvents(void) RestoreExtensionEvents(void)
{ {
int i; int i;
@ -956,7 +943,7 @@ RestoreExtensionEvents(void)
* *
*/ */
void static void
IResetProc(ExtensionEntry * unused) IResetProc(ExtensionEntry * unused)
{ {
@ -989,7 +976,7 @@ IResetProc(ExtensionEntry * unused)
* *
*/ */
Bool _X_EXPORT Bool
DeviceIsPointerType(DeviceIntPtr dev) DeviceIsPointerType(DeviceIntPtr dev)
{ {
if (dev_type[1].type == dev->type) if (dev_type[1].type == dev->type)
@ -1019,7 +1006,7 @@ AssignTypeAndName(DeviceIntPtr dev, Atom type, char *name)
* *
*/ */
void static void
MakeDeviceTypeAtoms(void) MakeDeviceTypeAtoms(void)
{ {
int i; int i;
@ -1052,95 +1039,113 @@ LookupDeviceIntRec(CARD8 id)
return NULL; return NULL;
} }
/************************************************************************** /*****************************************************************************
* *
* Allow the specified event to be restricted to being selected by one * SEventIDispatch
* client at a time.
* The default is to allow more than one client to select the event.
* *
* Swap any events defined in this extension.
*/ */
#define DO_SWAP(func,type) func ((type *)from, (type *)to)
void static void
SetExclusiveAccess(Mask mask) SEventIDispatch(xEvent * from, xEvent * to)
{ {
int i; int type = from->u.u.type & 0177;
for (i = 0; i < MAX_DEVICES; i++) if (type == DeviceValuator)
ExtExclusiveMasks[i] |= mask; DO_SWAP(SEventDeviceValuator, deviceValuator);
} else if (type == DeviceKeyPress) {
SKeyButtonPtrEvent(from, to);
/************************************************************************** to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
* } else if (type == DeviceKeyRelease) {
* Allow the specified event to have its propagation suppressed. SKeyButtonPtrEvent(from, to);
* The default is to not allow suppression of propagation. to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
* } else if (type == DeviceButtonPress) {
*/ SKeyButtonPtrEvent(from, to);
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
void } else if (type == DeviceButtonRelease) {
AllowPropagateSuppress(Mask mask) SKeyButtonPtrEvent(from, to);
{ to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
int i; } else if (type == DeviceMotionNotify) {
SKeyButtonPtrEvent(from, to);
for (i = 0; i < MAX_DEVICES; i++) to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
PropagateMask[i] |= mask; } else if (type == DeviceFocusIn)
} DO_SWAP(SEventFocus, deviceFocus);
else if (type == DeviceFocusOut)
/************************************************************************** DO_SWAP(SEventFocus, deviceFocus);
* else if (type == ProximityIn) {
* Return the next available extension event mask. SKeyButtonPtrEvent(from, to);
* to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
*/ } else if (type == ProximityOut) {
SKeyButtonPtrEvent(from, to);
Mask to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
GetNextExtEventMask(void) } else if (type == DeviceStateNotify)
{ DO_SWAP(SDeviceStateNotifyEvent, deviceStateNotify);
int i; else if (type == DeviceKeyStateNotify)
Mask mask = lastExtEventMask; DO_SWAP(SDeviceKeyStateNotifyEvent, deviceKeyStateNotify);
else if (type == DeviceButtonStateNotify)
if (lastExtEventMask == 0) { DO_SWAP(SDeviceButtonStateNotifyEvent, deviceButtonStateNotify);
FatalError("GetNextExtEventMask: no more events are available."); else if (type == DeviceMappingNotify)
DO_SWAP(SDeviceMappingNotifyEvent, deviceMappingNotify);
else if (type == ChangeDeviceNotify)
DO_SWAP(SChangeDeviceNotifyEvent, changeDeviceNotify);
else if (type == DevicePresenceNotify)
DO_SWAP(SDevicePresenceNotifyEvent, devicePresenceNotify);
else if (type == DeviceEnterNotify)
DO_SWAP(SDeviceEnterNotifyEvent, deviceEnterNotify);
else if (type == DeviceLeaveNotify)
DO_SWAP(SDeviceLeaveNotifyEvent, deviceLeaveNotify);
else if (type == PointerKeyboardPairingChangedNotify)
DO_SWAP(SPointerKeyboardPairingChangedNotifyEvent, pairingChangedNotify);
else {
FatalError("XInputExtension: Impossible event!\n");
} }
lastExtEventMask <<= 1;
for (i = 0; i < MAX_DEVICES; i++)
ExtValidMasks[i] |= mask;
return mask;
} }
/************************************************************************** /**********************************************************************
* *
* Assign the specified mask to the specified event. * IExtensionInit - initialize the input extension.
*
* Called from InitExtensions in main() or from QueryExtension() if the
* extension is dynamically loaded.
*
* This extension has several events and errors.
* *
*/ */
void void
SetMaskForExtEvent(Mask mask, int event) XInputExtensionInit(void)
{ {
ExtensionEntry *extEntry;
EventInfo[ExtEventIndex].mask = mask; extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch,
EventInfo[ExtEventIndex++].type = event; SProcIDispatch, IResetProc, StandardMinorOpcode);
if (extEntry) {
if ((event < LASTEvent) || (event >= 128)) IReqCode = extEntry->base;
FatalError("MaskForExtensionEvent: bogus event number"); AllExtensionVersions[IReqCode - 128] = thisversion;
SetMaskForEvent(mask, event); MakeDeviceTypeAtoms();
} RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone);
FixExtensionEvents(extEntry);
/************************************************************************** ReplySwapVector[IReqCode] = (ReplySwapPtr) SReplyIDispatch;
* EventSwapVector[DeviceValuator] = SEventIDispatch;
* Record an event mask where there is no unique corresponding event type. EventSwapVector[DeviceKeyPress] = SEventIDispatch;
* We can't call SetMaskForEvent, since that would clobber the existing EventSwapVector[DeviceKeyRelease] = SEventIDispatch;
* mask for that event. MotionHint and ButtonMotion are examples. EventSwapVector[DeviceButtonPress] = SEventIDispatch;
* EventSwapVector[DeviceButtonRelease] = SEventIDispatch;
* Since extension event types will never be less than 64, we can use EventSwapVector[DeviceMotionNotify] = SEventIDispatch;
* 0-63 in the EventInfo array as the "type" to be used to look up this EventSwapVector[DeviceFocusIn] = SEventIDispatch;
* mask. This means that the corresponding macros such as EventSwapVector[DeviceFocusOut] = SEventIDispatch;
* DevicePointerMotionHint must have access to the same constants. EventSwapVector[ProximityIn] = SEventIDispatch;
* EventSwapVector[ProximityOut] = SEventIDispatch;
*/ EventSwapVector[DeviceStateNotify] = SEventIDispatch;
EventSwapVector[DeviceKeyStateNotify] = SEventIDispatch;
void EventSwapVector[DeviceButtonStateNotify] = SEventIDispatch;
SetEventInfo(Mask mask, int constant) EventSwapVector[DeviceMappingNotify] = SEventIDispatch;
{ EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
EventInfo[ExtEventIndex].mask = mask; EventSwapVector[DeviceEnterNotify] = SEventIDispatch;
EventInfo[ExtEventIndex++].type = constant; EventSwapVector[DeviceLeaveNotify] = SEventIDispatch;
EventSwapVector[PointerKeyboardPairingChangedNotify] = SEventIDispatch;
} else {
FatalError("IExtensionInit: AddExtensions failed\n");
}
} }

View File

@ -74,9 +74,9 @@ SOFTWARE.
*/ */
int int
SProcXGetDeviceButtonMapping(register ClientPtr client) SProcXGetDeviceButtonMapping(ClientPtr client)
{ {
register char n; char n;
REQUEST(xGetDeviceButtonMappingReq); REQUEST(xGetDeviceButtonMappingReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -90,7 +90,7 @@ SProcXGetDeviceButtonMapping(register ClientPtr client)
*/ */
int int
ProcXGetDeviceButtonMapping(register ClientPtr client) ProcXGetDeviceButtonMapping(ClientPtr client)
{ {
DeviceIntPtr dev; DeviceIntPtr dev;
xGetDeviceButtonMappingReply rep; xGetDeviceButtonMappingReply rep;
@ -136,7 +136,7 @@ void
SRepXGetDeviceButtonMapping(ClientPtr client, int size, SRepXGetDeviceButtonMapping(ClientPtr client, int size,
xGetDeviceButtonMappingReply * rep) xGetDeviceButtonMappingReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -75,9 +75,9 @@ SOFTWARE.
*/ */
int int
SProcXGetDeviceControl(register ClientPtr client) SProcXGetDeviceControl(ClientPtr client)
{ {
register char n; char n;
REQUEST(xGetDeviceControlReq); REQUEST(xGetDeviceControlReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -86,6 +86,152 @@ SProcXGetDeviceControl(register ClientPtr client)
return (ProcXGetDeviceControl(client)); return (ProcXGetDeviceControl(client));
} }
/***********************************************************************
*
* This procedure copies DeviceResolution data, swapping if necessary.
*
*/
static void
CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
int length)
{
char n;
AxisInfoPtr a;
xDeviceResolutionState *r;
int i, *iptr;
r = (xDeviceResolutionState *) buf;
r->control = DEVICE_RESOLUTION;
r->length = length;
r->num_valuators = v->numAxes;
buf += sizeof(xDeviceResolutionState);
iptr = (int *)buf;
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
*iptr++ = a->resolution;
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
*iptr++ = a->min_resolution;
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
*iptr++ = a->max_resolution;
if (client->swapped) {
swaps(&r->control, n);
swaps(&r->length, n);
swapl(&r->num_valuators, n);
iptr = (int *)buf;
for (i = 0; i < (3 * v->numAxes); i++, iptr++) {
swapl(iptr, n);
}
}
}
static void CopySwapDeviceAbsCalib (ClientPtr client, AbsoluteClassPtr dts,
char *buf)
{
char n;
xDeviceAbsCalibState *calib = (xDeviceAbsCalibState *) buf;
calib->control = DEVICE_ABS_CALIB;
calib->length = sizeof(calib);
calib->min_x = dts->min_x;
calib->max_x = dts->max_x;
calib->min_y = dts->min_y;
calib->max_y = dts->max_y;
calib->flip_x = dts->flip_x;
calib->flip_y = dts->flip_y;
calib->rotation = dts->rotation;
calib->button_threshold = dts->button_threshold;
if (client->swapped) {
swaps(&calib->control, n);
swaps(&calib->length, n);
swapl(&calib->min_x, n);
swapl(&calib->max_x, n);
swapl(&calib->min_y, n);
swapl(&calib->max_y, n);
swapl(&calib->flip_x, n);
swapl(&calib->flip_y, n);
swapl(&calib->rotation, n);
swapl(&calib->button_threshold, n);
}
}
static void CopySwapDeviceAbsArea (ClientPtr client, AbsoluteClassPtr dts,
char *buf)
{
char n;
xDeviceAbsAreaState *area = (xDeviceAbsAreaState *) buf;
area->control = DEVICE_ABS_AREA;
area->length = sizeof(area);
area->offset_x = dts->offset_x;
area->offset_y = dts->offset_y;
area->width = dts->width;
area->height = dts->height;
area->screen = dts->screen;
area->following = dts->following;
if (client->swapped) {
swaps(&area->control, n);
swaps(&area->length, n);
swapl(&area->offset_x, n);
swapl(&area->offset_y, n);
swapl(&area->width, n);
swapl(&area->height, n);
swapl(&area->screen, n);
swapl(&area->following, n);
}
}
static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
{
char n;
xDeviceCoreState *c = (xDeviceCoreState *) buf;
c->control = DEVICE_CORE;
c->length = sizeof(c);
c->status = dev->coreEvents;
c->iscore = (dev == inputInfo.keyboard || dev == inputInfo.pointer);
if (client->swapped) {
swaps(&c->control, n);
swaps(&c->length, n);
swaps(&c->status, n);
}
}
static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
{
char n;
xDeviceEnableState *e = (xDeviceEnableState *) buf;
e->control = DEVICE_ENABLE;
e->length = sizeof(e);
e->enable = dev->enabled;
if (client->swapped) {
swaps(&e->control, n);
swaps(&e->length, n);
swaps(&e->enable, n);
}
}
/***********************************************************************
*
* This procedure writes the reply for the xGetDeviceControl function,
* if the client and server have a different byte ordering.
*
*/
void
SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
{
char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep);
}
/*********************************************************************** /***********************************************************************
* *
* Get the state of the specified device control. * Get the state of the specified device control.
@ -97,7 +243,7 @@ ProcXGetDeviceControl(ClientPtr client)
{ {
int total_length = 0; int total_length = 0;
char *buf, *savbuf; char *buf, *savbuf;
register DeviceIntPtr dev; DeviceIntPtr dev;
xGetDeviceControlReply rep; xGetDeviceControlReply rep;
REQUEST(xGetDeviceControlReq); REQUEST(xGetDeviceControlReq);
@ -186,150 +332,3 @@ ProcXGetDeviceControl(ClientPtr client)
xfree(savbuf); xfree(savbuf);
return Success; return Success;
} }
/***********************************************************************
*
* This procedure copies DeviceResolution data, swapping if necessary.
*
*/
void
CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
int length)
{
register char n;
AxisInfoPtr a;
xDeviceResolutionState *r;
int i, *iptr;
r = (xDeviceResolutionState *) buf;
r->control = DEVICE_RESOLUTION;
r->length = length;
r->num_valuators = v->numAxes;
buf += sizeof(xDeviceResolutionState);
iptr = (int *)buf;
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
*iptr++ = a->resolution;
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
*iptr++ = a->min_resolution;
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
*iptr++ = a->max_resolution;
if (client->swapped) {
swaps(&r->control, n);
swaps(&r->length, n);
swapl(&r->num_valuators, n);
iptr = (int *)buf;
for (i = 0; i < (3 * v->numAxes); i++, iptr++) {
swapl(iptr, n);
}
}
}
void CopySwapDeviceAbsCalib (ClientPtr client, AbsoluteClassPtr dts,
char *buf)
{
register char n;
xDeviceAbsCalibState *calib = (xDeviceAbsCalibState *) buf;
calib->control = DEVICE_ABS_CALIB;
calib->length = sizeof(calib);
calib->min_x = dts->min_x;
calib->max_x = dts->max_x;
calib->min_y = dts->min_y;
calib->max_y = dts->max_y;
calib->flip_x = dts->flip_x;
calib->flip_y = dts->flip_y;
calib->rotation = dts->rotation;
calib->button_threshold = dts->button_threshold;
if (client->swapped) {
swaps(&calib->control, n);
swaps(&calib->length, n);
swapl(&calib->min_x, n);
swapl(&calib->max_x, n);
swapl(&calib->min_y, n);
swapl(&calib->max_y, n);
swapl(&calib->flip_x, n);
swapl(&calib->flip_y, n);
swapl(&calib->rotation, n);
swapl(&calib->button_threshold, n);
}
}
void CopySwapDeviceAbsArea (ClientPtr client, AbsoluteClassPtr dts,
char *buf)
{
register char n;
xDeviceAbsAreaState *area = (xDeviceAbsAreaState *) buf;
area->control = DEVICE_ABS_AREA;
area->length = sizeof(area);
area->offset_x = dts->offset_x;
area->offset_y = dts->offset_y;
area->width = dts->width;
area->height = dts->height;
area->screen = dts->screen;
area->following = dts->following;
if (client->swapped) {
swaps(&area->control, n);
swaps(&area->length, n);
swapl(&area->offset_x, n);
swapl(&area->offset_y, n);
swapl(&area->width, n);
swapl(&area->height, n);
swapl(&area->screen, n);
swapl(&area->following, n);
}
}
void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
{
register char n;
xDeviceCoreState *c = (xDeviceCoreState *) buf;
c->control = DEVICE_CORE;
c->length = sizeof(c);
c->status = dev->coreEvents;
c->iscore = (dev == inputInfo.keyboard || dev == inputInfo.pointer);
if (client->swapped) {
swaps(&c->control, n);
swaps(&c->length, n);
swaps(&c->status, n);
}
}
void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
{
register char n;
xDeviceEnableState *e = (xDeviceEnableState *) buf;
e->control = DEVICE_ENABLE;
e->length = sizeof(e);
e->enable = dev->enabled;
if (client->swapped) {
swaps(&e->control, n);
swaps(&e->length, n);
swaps(&e->enable, n);
}
}
/***********************************************************************
*
* This procedure writes the reply for the xGetDeviceControl function,
* if the client and server have a different byte ordering.
*
*/
void
SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep);
}

View File

@ -36,30 +36,6 @@ int SProcXGetDeviceControl(ClientPtr /* client */
int ProcXGetDeviceControl(ClientPtr /* client */ int ProcXGetDeviceControl(ClientPtr /* client */
); );
void CopySwapDeviceResolution(ClientPtr /* client */ ,
ValuatorClassPtr /* v */ ,
char * /* buf */ ,
int /* length */
);
void CopySwapDeviceAbsCalib (ClientPtr client,
AbsoluteClassPtr dts,
char *buf);
void CopySwapDeviceAbsArea (ClientPtr client,
AbsoluteClassPtr dts,
char *buf);
void CopySwapDeviceCore(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
char * /* buf */
);
void CopySwapDeviceEnable(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
char * /* buf */
);
void SRepXGetDeviceControl(ClientPtr /* client */ , void SRepXGetDeviceControl(ClientPtr /* client */ ,
int /* size */ , int /* size */ ,
xGetDeviceControlReply * /* rep */ xGetDeviceControlReply * /* rep */

View File

@ -75,15 +75,215 @@ SOFTWARE.
*/ */
int int
SProcXGetFeedbackControl(register ClientPtr client) SProcXGetFeedbackControl(ClientPtr client)
{ {
register char n; char n;
REQUEST(xGetFeedbackControlReq); REQUEST(xGetFeedbackControlReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
return (ProcXGetFeedbackControl(client)); return (ProcXGetFeedbackControl(client));
} }
/***********************************************************************
*
* This procedure copies KbdFeedbackClass data, swapping if necessary.
*
*/
static void
CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
{
int i;
char n;
xKbdFeedbackState *k2;
k2 = (xKbdFeedbackState *) * buf;
k2->class = KbdFeedbackClass;
k2->length = sizeof(xKbdFeedbackState);
k2->id = k->ctrl.id;
k2->click = k->ctrl.click;
k2->percent = k->ctrl.bell;
k2->pitch = k->ctrl.bell_pitch;
k2->duration = k->ctrl.bell_duration;
k2->led_mask = k->ctrl.leds;
k2->global_auto_repeat = k->ctrl.autoRepeat;
for (i = 0; i < 32; i++)
k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
if (client->swapped) {
swaps(&k2->length, n);
swaps(&k2->pitch, n);
swaps(&k2->duration, n);
swapl(&k2->led_mask, n);
swapl(&k2->led_values, n);
}
*buf += sizeof(xKbdFeedbackState);
}
/***********************************************************************
*
* This procedure copies PtrFeedbackClass data, swapping if necessary.
*
*/
static void
CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
{
char n;
xPtrFeedbackState *p2;
p2 = (xPtrFeedbackState *) * buf;
p2->class = PtrFeedbackClass;
p2->length = sizeof(xPtrFeedbackState);
p2->id = p->ctrl.id;
p2->accelNum = p->ctrl.num;
p2->accelDenom = p->ctrl.den;
p2->threshold = p->ctrl.threshold;
if (client->swapped) {
swaps(&p2->length, n);
swaps(&p2->accelNum, n);
swaps(&p2->accelDenom, n);
swaps(&p2->threshold, n);
}
*buf += sizeof(xPtrFeedbackState);
}
/***********************************************************************
*
* This procedure copies IntegerFeedbackClass data, swapping if necessary.
*
*/
static void
CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
{
char n;
xIntegerFeedbackState *i2;
i2 = (xIntegerFeedbackState *) * buf;
i2->class = IntegerFeedbackClass;
i2->length = sizeof(xIntegerFeedbackState);
i2->id = i->ctrl.id;
i2->resolution = i->ctrl.resolution;
i2->min_value = i->ctrl.min_value;
i2->max_value = i->ctrl.max_value;
if (client->swapped) {
swaps(&i2->length, n);
swapl(&i2->resolution, n);
swapl(&i2->min_value, n);
swapl(&i2->max_value, n);
}
*buf += sizeof(xIntegerFeedbackState);
}
/***********************************************************************
*
* This procedure copies StringFeedbackClass data, swapping if necessary.
*
*/
static void
CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
{
int i;
char n;
xStringFeedbackState *s2;
KeySym *kptr;
s2 = (xStringFeedbackState *) * buf;
s2->class = StringFeedbackClass;
s2->length = sizeof(xStringFeedbackState) +
s->ctrl.num_symbols_supported * sizeof(KeySym);
s2->id = s->ctrl.id;
s2->max_symbols = s->ctrl.max_symbols;
s2->num_syms_supported = s->ctrl.num_symbols_supported;
*buf += sizeof(xStringFeedbackState);
kptr = (KeySym *) (*buf);
for (i = 0; i < s->ctrl.num_symbols_supported; i++)
*kptr++ = *(s->ctrl.symbols_supported + i);
if (client->swapped) {
swaps(&s2->length, n);
swaps(&s2->max_symbols, n);
swaps(&s2->num_syms_supported, n);
kptr = (KeySym *) (*buf);
for (i = 0; i < s->ctrl.num_symbols_supported; i++, kptr++) {
swapl(kptr, n);
}
}
*buf += (s->ctrl.num_symbols_supported * sizeof(KeySym));
}
/***********************************************************************
*
* This procedure copies LedFeedbackClass data, swapping if necessary.
*
*/
static void
CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
{
char n;
xLedFeedbackState *l2;
l2 = (xLedFeedbackState *) * buf;
l2->class = LedFeedbackClass;
l2->length = sizeof(xLedFeedbackState);
l2->id = l->ctrl.id;
l2->led_values = l->ctrl.led_values;
l2->led_mask = l->ctrl.led_mask;
if (client->swapped) {
swaps(&l2->length, n);
swapl(&l2->led_values, n);
swapl(&l2->led_mask, n);
}
*buf += sizeof(xLedFeedbackState);
}
/***********************************************************************
*
* This procedure copies BellFeedbackClass data, swapping if necessary.
*
*/
static void
CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
{
char n;
xBellFeedbackState *b2;
b2 = (xBellFeedbackState *) * buf;
b2->class = BellFeedbackClass;
b2->length = sizeof(xBellFeedbackState);
b2->id = b->ctrl.id;
b2->percent = b->ctrl.percent;
b2->pitch = b->ctrl.pitch;
b2->duration = b->ctrl.duration;
if (client->swapped) {
swaps(&b2->length, n);
swaps(&b2->pitch, n);
swaps(&b2->duration, n);
}
*buf += sizeof(xBellFeedbackState);
}
/***********************************************************************
*
* This procedure writes the reply for the xGetFeedbackControl function,
* if the client and server have a different byte ordering.
*
*/
void
SRepXGetFeedbackControl(ClientPtr client, int size,
xGetFeedbackControlReply * rep)
{
char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->num_feedbacks, n);
WriteToClient(client, size, (char *)rep);
}
/*********************************************************************** /***********************************************************************
* *
* Get the feedback control state. * Get the feedback control state.
@ -95,7 +295,7 @@ ProcXGetFeedbackControl(ClientPtr client)
{ {
int total_length = 0; int total_length = 0;
char *buf, *savbuf; char *buf, *savbuf;
register DeviceIntPtr dev; DeviceIntPtr dev;
KbdFeedbackPtr k; KbdFeedbackPtr k;
PtrFeedbackPtr p; PtrFeedbackPtr p;
IntegerFeedbackPtr i; IntegerFeedbackPtr i;
@ -176,203 +376,3 @@ ProcXGetFeedbackControl(ClientPtr client)
xfree(savbuf); xfree(savbuf);
return Success; return Success;
} }
/***********************************************************************
*
* This procedure copies KbdFeedbackClass data, swapping if necessary.
*
*/
void
CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
{
int i;
register char n;
xKbdFeedbackState *k2;
k2 = (xKbdFeedbackState *) * buf;
k2->class = KbdFeedbackClass;
k2->length = sizeof(xKbdFeedbackState);
k2->id = k->ctrl.id;
k2->click = k->ctrl.click;
k2->percent = k->ctrl.bell;
k2->pitch = k->ctrl.bell_pitch;
k2->duration = k->ctrl.bell_duration;
k2->led_mask = k->ctrl.leds;
k2->global_auto_repeat = k->ctrl.autoRepeat;
for (i = 0; i < 32; i++)
k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
if (client->swapped) {
swaps(&k2->length, n);
swaps(&k2->pitch, n);
swaps(&k2->duration, n);
swapl(&k2->led_mask, n);
swapl(&k2->led_values, n);
}
*buf += sizeof(xKbdFeedbackState);
}
/***********************************************************************
*
* This procedure copies PtrFeedbackClass data, swapping if necessary.
*
*/
void
CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
{
register char n;
xPtrFeedbackState *p2;
p2 = (xPtrFeedbackState *) * buf;
p2->class = PtrFeedbackClass;
p2->length = sizeof(xPtrFeedbackState);
p2->id = p->ctrl.id;
p2->accelNum = p->ctrl.num;
p2->accelDenom = p->ctrl.den;
p2->threshold = p->ctrl.threshold;
if (client->swapped) {
swaps(&p2->length, n);
swaps(&p2->accelNum, n);
swaps(&p2->accelDenom, n);
swaps(&p2->threshold, n);
}
*buf += sizeof(xPtrFeedbackState);
}
/***********************************************************************
*
* This procedure copies IntegerFeedbackClass data, swapping if necessary.
*
*/
void
CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
{
register char n;
xIntegerFeedbackState *i2;
i2 = (xIntegerFeedbackState *) * buf;
i2->class = IntegerFeedbackClass;
i2->length = sizeof(xIntegerFeedbackState);
i2->id = i->ctrl.id;
i2->resolution = i->ctrl.resolution;
i2->min_value = i->ctrl.min_value;
i2->max_value = i->ctrl.max_value;
if (client->swapped) {
swaps(&i2->length, n);
swapl(&i2->resolution, n);
swapl(&i2->min_value, n);
swapl(&i2->max_value, n);
}
*buf += sizeof(xIntegerFeedbackState);
}
/***********************************************************************
*
* This procedure copies StringFeedbackClass data, swapping if necessary.
*
*/
void
CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
{
int i;
register char n;
xStringFeedbackState *s2;
KeySym *kptr;
s2 = (xStringFeedbackState *) * buf;
s2->class = StringFeedbackClass;
s2->length = sizeof(xStringFeedbackState) +
s->ctrl.num_symbols_supported * sizeof(KeySym);
s2->id = s->ctrl.id;
s2->max_symbols = s->ctrl.max_symbols;
s2->num_syms_supported = s->ctrl.num_symbols_supported;
*buf += sizeof(xStringFeedbackState);
kptr = (KeySym *) (*buf);
for (i = 0; i < s->ctrl.num_symbols_supported; i++)
*kptr++ = *(s->ctrl.symbols_supported + i);
if (client->swapped) {
swaps(&s2->length, n);
swaps(&s2->max_symbols, n);
swaps(&s2->num_syms_supported, n);
kptr = (KeySym *) (*buf);
for (i = 0; i < s->ctrl.num_symbols_supported; i++, kptr++) {
swapl(kptr, n);
}
}
*buf += (s->ctrl.num_symbols_supported * sizeof(KeySym));
}
/***********************************************************************
*
* This procedure copies LedFeedbackClass data, swapping if necessary.
*
*/
void
CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
{
register char n;
xLedFeedbackState *l2;
l2 = (xLedFeedbackState *) * buf;
l2->class = LedFeedbackClass;
l2->length = sizeof(xLedFeedbackState);
l2->id = l->ctrl.id;
l2->led_values = l->ctrl.led_values;
l2->led_mask = l->ctrl.led_mask;
if (client->swapped) {
swaps(&l2->length, n);
swapl(&l2->led_values, n);
swapl(&l2->led_mask, n);
}
*buf += sizeof(xLedFeedbackState);
}
/***********************************************************************
*
* This procedure copies BellFeedbackClass data, swapping if necessary.
*
*/
void
CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
{
register char n;
xBellFeedbackState *b2;
b2 = (xBellFeedbackState *) * buf;
b2->class = BellFeedbackClass;
b2->length = sizeof(xBellFeedbackState);
b2->id = b->ctrl.id;
b2->percent = b->ctrl.percent;
b2->pitch = b->ctrl.pitch;
b2->duration = b->ctrl.duration;
if (client->swapped) {
swaps(&b2->length, n);
swaps(&b2->pitch, n);
swaps(&b2->duration, n);
}
*buf += sizeof(xBellFeedbackState);
}
/***********************************************************************
*
* This procedure writes the reply for the xGetFeedbackControl function,
* if the client and server have a different byte ordering.
*
*/
void
SRepXGetFeedbackControl(ClientPtr client, int size,
xGetFeedbackControlReply * rep)
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->num_feedbacks, n);
WriteToClient(client, size, (char *)rep);
}

View File

@ -36,36 +36,6 @@ int SProcXGetFeedbackControl(ClientPtr /* client */
int ProcXGetFeedbackControl(ClientPtr /* client */ int ProcXGetFeedbackControl(ClientPtr /* client */
); );
void CopySwapKbdFeedback(ClientPtr /* client */ ,
KbdFeedbackPtr /* k */ ,
char ** /* buf */
);
void CopySwapPtrFeedback(ClientPtr /* client */ ,
PtrFeedbackPtr /* p */ ,
char ** /* buf */
);
void CopySwapIntegerFeedback(ClientPtr /* client */ ,
IntegerFeedbackPtr /* i */ ,
char ** /* buf */
);
void CopySwapStringFeedback(ClientPtr /* client */ ,
StringFeedbackPtr /* s */ ,
char ** /* buf */
);
void CopySwapLedFeedback(ClientPtr /* client */ ,
LedFeedbackPtr /* l */ ,
char ** /* buf */
);
void CopySwapBellFeedback(ClientPtr /* client */ ,
BellFeedbackPtr /* b */ ,
char ** /* buf */
);
void SRepXGetFeedbackControl(ClientPtr /* client */ , void SRepXGetFeedbackControl(ClientPtr /* client */ ,
int /* size */ , int /* size */ ,
xGetFeedbackControlReply * /* rep */ xGetFeedbackControlReply * /* rep */

View File

@ -75,9 +75,9 @@ SOFTWARE.
*/ */
int int
SProcXGetDeviceFocus(register ClientPtr client) SProcXGetDeviceFocus(ClientPtr client)
{ {
register char n; char n;
REQUEST(xGetDeviceFocusReq); REQUEST(xGetDeviceFocusReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -138,7 +138,7 @@ ProcXGetDeviceFocus(ClientPtr client)
void void
SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep) SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -76,9 +76,9 @@ SOFTWARE.
*/ */
int int
SProcXGetDeviceKeyMapping(register ClientPtr client) SProcXGetDeviceKeyMapping(ClientPtr client)
{ {
register char n; char n;
REQUEST(xGetDeviceKeyMappingReq); REQUEST(xGetDeviceKeyMappingReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -92,7 +92,7 @@ SProcXGetDeviceKeyMapping(register ClientPtr client)
*/ */
int int
ProcXGetDeviceKeyMapping(register ClientPtr client) ProcXGetDeviceKeyMapping(ClientPtr client)
{ {
xGetDeviceKeyMappingReply rep; xGetDeviceKeyMappingReply rep;
DeviceIntPtr dev; DeviceIntPtr dev;
@ -154,7 +154,7 @@ void
SRepXGetDeviceKeyMapping(ClientPtr client, int size, SRepXGetDeviceKeyMapping(ClientPtr client, int size,
xGetDeviceKeyMappingReply * rep) xGetDeviceKeyMappingReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -75,9 +75,9 @@ SOFTWARE.
*/ */
int int
SProcXGetDeviceModifierMapping(register ClientPtr client) SProcXGetDeviceModifierMapping(ClientPtr client)
{ {
register char n; char n;
REQUEST(xGetDeviceModifierMappingReq); REQUEST(xGetDeviceModifierMappingReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -141,7 +141,7 @@ void
SRepXGetDeviceModifierMapping(ClientPtr client, int size, SRepXGetDeviceModifierMapping(ClientPtr client, int size,
xGetDeviceModifierMappingReply * rep) xGetDeviceModifierMappingReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -79,9 +79,9 @@ extern int ExtEventIndex;
*/ */
int int
SProcXGetDeviceDontPropagateList(register ClientPtr client) SProcXGetDeviceDontPropagateList(ClientPtr client)
{ {
register char n; char n;
REQUEST(xGetDeviceDontPropagateListReq); REQUEST(xGetDeviceDontPropagateListReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -97,7 +97,7 @@ SProcXGetDeviceDontPropagateList(register ClientPtr client)
*/ */
int int
ProcXGetDeviceDontPropagateList(register ClientPtr client) ProcXGetDeviceDontPropagateList(ClientPtr client)
{ {
CARD16 count = 0; CARD16 count = 0;
int i, rc; int i, rc;
@ -187,7 +187,7 @@ void
SRepXGetDeviceDontPropagateList(ClientPtr client, int size, SRepXGetDeviceDontPropagateList(ClientPtr client, int size,
xGetDeviceDontPropagateListReply * rep) xGetDeviceDontPropagateListReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -77,9 +77,9 @@ SOFTWARE.
*/ */
int int
SProcXGetSelectedExtensionEvents(register ClientPtr client) SProcXGetSelectedExtensionEvents(ClientPtr client)
{ {
register char n; char n;
REQUEST(xGetSelectedExtensionEventsReq); REQUEST(xGetSelectedExtensionEventsReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -96,7 +96,7 @@ SProcXGetSelectedExtensionEvents(register ClientPtr client)
*/ */
int int
ProcXGetSelectedExtensionEvents(register ClientPtr client) ProcXGetSelectedExtensionEvents(ClientPtr client)
{ {
int i, rc, total_length = 0; int i, rc, total_length = 0;
xGetSelectedExtensionEventsReply rep; xGetSelectedExtensionEventsReply rep;
@ -177,7 +177,7 @@ void
SRepXGetSelectedExtensionEvents(ClientPtr client, int size, SRepXGetSelectedExtensionEvents(ClientPtr client, int size,
xGetSelectedExtensionEventsReply * rep) xGetSelectedExtensionEventsReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -76,9 +76,9 @@ XExtensionVersion AllExtensionVersions[128];
*/ */
int int
SProcXGetExtensionVersion(register ClientPtr client) SProcXGetExtensionVersion(ClientPtr client)
{ {
register char n; char n;
REQUEST(xGetExtensionVersionReq); REQUEST(xGetExtensionVersionReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -94,7 +94,7 @@ SProcXGetExtensionVersion(register ClientPtr client)
*/ */
int int
ProcXGetExtensionVersion(register ClientPtr client) ProcXGetExtensionVersion(ClientPtr client)
{ {
xGetExtensionVersionReply rep; xGetExtensionVersionReply rep;
@ -136,7 +136,7 @@ void
SRepXGetExtensionVersion(ClientPtr client, int size, SRepXGetExtensionVersion(ClientPtr client, int size,
xGetExtensionVersionReply * rep) xGetExtensionVersionReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -93,7 +93,7 @@ void
SRepXGrabAccessControl(ClientPtr client, int size, SRepXGrabAccessControl(ClientPtr client, int size,
xGrabAccessControlReply* rep) xGrabAccessControlReply* rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -79,11 +79,11 @@ extern int ExtEventIndex;
*/ */
int int
SProcXGrabDevice(register ClientPtr client) SProcXGrabDevice(ClientPtr client)
{ {
register char n; char n;
register long *p; long *p;
register int i; int i;
REQUEST(xGrabDeviceReq); REQUEST(xGrabDeviceReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -202,7 +202,7 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
void void
SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep) SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -77,11 +77,11 @@ SOFTWARE.
*/ */
int int
SProcXGrabDeviceButton(register ClientPtr client) SProcXGrabDeviceButton(ClientPtr client)
{ {
register char n; char n;
register long *p; long *p;
register int i; int i;
REQUEST(xGrabDeviceButtonReq); REQUEST(xGrabDeviceButtonReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);

View File

@ -77,11 +77,11 @@ SOFTWARE.
*/ */
int int
SProcXGrabDeviceKey(register ClientPtr client) SProcXGrabDeviceKey(ClientPtr client)
{ {
register char n; char n;
register long *p; long *p;
register int i; int i;
REQUEST(xGrabDeviceKeyReq); REQUEST(xGrabDeviceKeyReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);

View File

@ -75,9 +75,9 @@ SOFTWARE.
*/ */
int int
SProcXGetDeviceMotionEvents(register ClientPtr client) SProcXGetDeviceMotionEvents(ClientPtr client)
{ {
register char n; char n;
REQUEST(xGetDeviceMotionEventsReq); REQUEST(xGetDeviceMotionEventsReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -162,7 +162,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep); WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
if (nEvents) { if (nEvents) {
if (client->swapped) { if (client->swapped) {
register char n; char n;
bufptr = coords; bufptr = coords;
for (i = 0; i < nEvents * (axes + 1); i++) { for (i = 0; i < nEvents * (axes + 1); i++) {
@ -188,7 +188,7 @@ void
SRepXGetDeviceMotionEvents(ClientPtr client, int size, SRepXGetDeviceMotionEvents(ClientPtr client, int size,
xGetDeviceMotionEventsReply * rep) xGetDeviceMotionEventsReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -77,15 +77,227 @@ SOFTWARE.
*/ */
int int
SProcXListInputDevices(register ClientPtr client) SProcXListInputDevices(ClientPtr client)
{ {
register char n; char n;
REQUEST(xListInputDevicesReq); REQUEST(xListInputDevicesReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
return (ProcXListInputDevices(client)); return (ProcXListInputDevices(client));
} }
/***********************************************************************
*
* This procedure calculates the size of the information to be returned
* for an input device.
*
*/
static void
SizeDeviceInfo(DeviceIntPtr d, int *namesize, int *size)
{
int chunks;
*namesize += 1;
if (d->name)
*namesize += strlen(d->name);
if (d->key != NULL)
*size += sizeof(xKeyInfo);
if (d->button != NULL)
*size += sizeof(xButtonInfo);
if (d->valuator != NULL) {
chunks = ((int)d->valuator->numAxes + 19) / VPC;
*size += (chunks * sizeof(xValuatorInfo) +
d->valuator->numAxes * sizeof(xAxisInfo));
}
}
/***********************************************************************
*
* This procedure copies data to the DeviceInfo struct, swapping if necessary.
*
* We need the extra byte in the allocated buffer, because the trailing null
* hammers one extra byte, which is overwritten by the next name except for
* the last name copied.
*
*/
static void
CopyDeviceName(char **namebuf, char *name)
{
char *nameptr = (char *)*namebuf;
if (name) {
*nameptr++ = strlen(name);
strcpy(nameptr, name);
*namebuf += (strlen(name) + 1);
} else {
*nameptr++ = 0;
*namebuf += 1;
}
}
/***********************************************************************
*
* This procedure copies ButtonClass information, swapping if necessary.
*
*/
static void
CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf)
{
char n;
xButtonInfoPtr b2;
b2 = (xButtonInfoPtr) * buf;
b2->class = ButtonClass;
b2->length = sizeof(xButtonInfo);
b2->num_buttons = b->numButtons;
if (client->swapped) {
swaps(&b2->num_buttons, n); /* macro - braces are required */
}
*buf += sizeof(xButtonInfo);
}
/***********************************************************************
*
* This procedure copies data to the DeviceInfo struct, swapping if necessary.
*
*/
static void
CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
char **buf)
{
char n;
xDeviceInfoPtr dev;
dev = (xDeviceInfoPtr) * buf;
dev->id = d->id;
dev->type = d->type;
dev->num_classes = num_classes;
if (d == inputInfo.keyboard)
dev->use = IsXKeyboard;
else if (d == inputInfo.pointer)
dev->use = IsXPointer;
else if (d->key && d->kbdfeed)
dev->use = IsXExtensionKeyboard;
else if (d->valuator && d->button)
dev->use = IsXExtensionPointer;
else
dev->use = IsXExtensionDevice;
if (client->swapped) {
swapl(&dev->type, n); /* macro - braces are required */
}
*buf += sizeof(xDeviceInfo);
}
/***********************************************************************
*
* This procedure copies KeyClass information, swapping if necessary.
*
*/
static void
CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf)
{
char n;
xKeyInfoPtr k2;
k2 = (xKeyInfoPtr) * buf;
k2->class = KeyClass;
k2->length = sizeof(xKeyInfo);
k2->min_keycode = k->curKeySyms.minKeyCode;
k2->max_keycode = k->curKeySyms.maxKeyCode;
k2->num_keys = k2->max_keycode - k2->min_keycode + 1;
if (client->swapped) {
swaps(&k2->num_keys, n);
}
*buf += sizeof(xKeyInfo);
}
/***********************************************************************
*
* This procedure copies ValuatorClass information, swapping if necessary.
*
* Devices may have up to 255 valuators. The length of a ValuatorClass is
* defined to be sizeof(ValuatorClassInfo) + num_axes * sizeof (xAxisInfo).
* The maximum length is therefore (8 + 255 * 12) = 3068. However, the
* length field is one byte. If a device has more than 20 valuators, we
* must therefore return multiple valuator classes to the client.
*
*/
static int
CopySwapValuatorClass(ClientPtr client, ValuatorClassPtr v, char **buf)
{
int i, j, axes, t_axes;
char n;
xValuatorInfoPtr v2;
AxisInfo *a;
xAxisInfoPtr a2;
for (i = 0, axes = v->numAxes; i < ((v->numAxes + 19) / VPC);
i++, axes -= VPC) {
t_axes = axes < VPC ? axes : VPC;
if (t_axes < 0)
t_axes = v->numAxes % VPC;
v2 = (xValuatorInfoPtr) * buf;
v2->class = ValuatorClass;
v2->length = sizeof(xValuatorInfo) + t_axes * sizeof(xAxisInfo);
v2->num_axes = t_axes;
v2->mode = v->mode & DeviceMode;
v2->motion_buffer_size = v->numMotionEvents;
if (client->swapped) {
swapl(&v2->motion_buffer_size, n);
}
*buf += sizeof(xValuatorInfo);
a = v->axes + (VPC * i);
a2 = (xAxisInfoPtr) * buf;
for (j = 0; j < t_axes; j++) {
a2->min_value = a->min_value;
a2->max_value = a->max_value;
a2->resolution = a->resolution;
if (client->swapped) {
swapl(&a2->min_value, n);
swapl(&a2->max_value, n);
swapl(&a2->resolution, n);
}
a2++;
a++;
*buf += sizeof(xAxisInfo);
}
}
return (i);
}
/***********************************************************************
*
* This procedure lists information to be returned for an input device.
*
*/
static void
ListDeviceInfo(ClientPtr client, DeviceIntPtr d, xDeviceInfoPtr dev,
char **devbuf, char **classbuf, char **namebuf)
{
CopyDeviceName(namebuf, d->name);
CopySwapDevice(client, d, 0, devbuf);
if (d->key != NULL) {
CopySwapKeyClass(client, d->key, classbuf);
dev->num_classes++;
}
if (d->button != NULL) {
CopySwapButtonClass(client, d->button, classbuf);
dev->num_classes++;
}
if (d->valuator != NULL) {
dev->num_classes +=
CopySwapValuatorClass(client, d->valuator, classbuf);
}
}
/*********************************************************************** /***********************************************************************
* *
* This procedure lists the input devices available to the server. * This procedure lists the input devices available to the server.
@ -93,7 +305,7 @@ SProcXListInputDevices(register ClientPtr client)
*/ */
int int
ProcXListInputDevices(register ClientPtr client) ProcXListInputDevices(ClientPtr client)
{ {
xListInputDevicesReply rep; xListInputDevicesReply rep;
int numdevs = 0; int numdevs = 0;
@ -154,218 +366,6 @@ ProcXListInputDevices(register ClientPtr client)
return Success; return Success;
} }
/***********************************************************************
*
* This procedure calculates the size of the information to be returned
* for an input device.
*
*/
void
SizeDeviceInfo(DeviceIntPtr d, int *namesize, int *size)
{
int chunks;
*namesize += 1;
if (d->name)
*namesize += strlen(d->name);
if (d->key != NULL)
*size += sizeof(xKeyInfo);
if (d->button != NULL)
*size += sizeof(xButtonInfo);
if (d->valuator != NULL) {
chunks = ((int)d->valuator->numAxes + 19) / VPC;
*size += (chunks * sizeof(xValuatorInfo) +
d->valuator->numAxes * sizeof(xAxisInfo));
}
}
/***********************************************************************
*
* This procedure lists information to be returned for an input device.
*
*/
void
ListDeviceInfo(ClientPtr client, DeviceIntPtr d, xDeviceInfoPtr dev,
char **devbuf, char **classbuf, char **namebuf)
{
CopyDeviceName(namebuf, d->name);
CopySwapDevice(client, d, 0, devbuf);
if (d->key != NULL) {
CopySwapKeyClass(client, d->key, classbuf);
dev->num_classes++;
}
if (d->button != NULL) {
CopySwapButtonClass(client, d->button, classbuf);
dev->num_classes++;
}
if (d->valuator != NULL) {
dev->num_classes +=
CopySwapValuatorClass(client, d->valuator, classbuf);
}
}
/***********************************************************************
*
* This procedure copies data to the DeviceInfo struct, swapping if necessary.
*
* We need the extra byte in the allocated buffer, because the trailing null
* hammers one extra byte, which is overwritten by the next name except for
* the last name copied.
*
*/
void
CopyDeviceName(char **namebuf, char *name)
{
char *nameptr = (char *)*namebuf;
if (name) {
*nameptr++ = strlen(name);
strcpy(nameptr, name);
*namebuf += (strlen(name) + 1);
} else {
*nameptr++ = 0;
*namebuf += 1;
}
}
/***********************************************************************
*
* This procedure copies data to the DeviceInfo struct, swapping if necessary.
*
*/
void
CopySwapDevice(register ClientPtr client, DeviceIntPtr d, int num_classes,
char **buf)
{
register char n;
xDeviceInfoPtr dev;
dev = (xDeviceInfoPtr) * buf;
dev->id = d->id;
dev->type = d->type;
dev->num_classes = num_classes;
if (d == inputInfo.keyboard)
dev->use = IsXKeyboard;
else if (d == inputInfo.pointer)
dev->use = IsXPointer;
else if (d->key && d->kbdfeed)
dev->use = IsXExtensionKeyboard;
else if (d->valuator && d->button)
dev->use = IsXExtensionPointer;
else
dev->use = IsXExtensionDevice;
if (client->swapped) {
swapl(&dev->type, n); /* macro - braces are required */
}
*buf += sizeof(xDeviceInfo);
}
/***********************************************************************
*
* This procedure copies KeyClass information, swapping if necessary.
*
*/
void
CopySwapKeyClass(register ClientPtr client, KeyClassPtr k, char **buf)
{
register char n;
xKeyInfoPtr k2;
k2 = (xKeyInfoPtr) * buf;
k2->class = KeyClass;
k2->length = sizeof(xKeyInfo);
k2->min_keycode = k->curKeySyms.minKeyCode;
k2->max_keycode = k->curKeySyms.maxKeyCode;
k2->num_keys = k2->max_keycode - k2->min_keycode + 1;
if (client->swapped) {
swaps(&k2->num_keys, n);
}
*buf += sizeof(xKeyInfo);
}
/***********************************************************************
*
* This procedure copies ButtonClass information, swapping if necessary.
*
*/
void
CopySwapButtonClass(register ClientPtr client, ButtonClassPtr b, char **buf)
{
register char n;
xButtonInfoPtr b2;
b2 = (xButtonInfoPtr) * buf;
b2->class = ButtonClass;
b2->length = sizeof(xButtonInfo);
b2->num_buttons = b->numButtons;
if (client->swapped) {
swaps(&b2->num_buttons, n); /* macro - braces are required */
}
*buf += sizeof(xButtonInfo);
}
/***********************************************************************
*
* This procedure copies ValuatorClass information, swapping if necessary.
*
* Devices may have up to 255 valuators. The length of a ValuatorClass is
* defined to be sizeof(ValuatorClassInfo) + num_axes * sizeof (xAxisInfo).
* The maximum length is therefore (8 + 255 * 12) = 3068. However, the
* length field is one byte. If a device has more than 20 valuators, we
* must therefore return multiple valuator classes to the client.
*
*/
int
CopySwapValuatorClass(register ClientPtr client, ValuatorClassPtr v, char **buf)
{
int i, j, axes, t_axes;
register char n;
xValuatorInfoPtr v2;
AxisInfo *a;
xAxisInfoPtr a2;
for (i = 0, axes = v->numAxes; i < ((v->numAxes + 19) / VPC);
i++, axes -= VPC) {
t_axes = axes < VPC ? axes : VPC;
if (t_axes < 0)
t_axes = v->numAxes % VPC;
v2 = (xValuatorInfoPtr) * buf;
v2->class = ValuatorClass;
v2->length = sizeof(xValuatorInfo) + t_axes * sizeof(xAxisInfo);
v2->num_axes = t_axes;
v2->mode = v->mode & DeviceMode;
v2->motion_buffer_size = v->numMotionEvents;
if (client->swapped) {
swapl(&v2->motion_buffer_size, n);
}
*buf += sizeof(xValuatorInfo);
a = v->axes + (VPC * i);
a2 = (xAxisInfoPtr) * buf;
for (j = 0; j < t_axes; j++) {
a2->min_value = a->min_value;
a2->max_value = a->max_value;
a2->resolution = a->resolution;
if (client->swapped) {
swapl(&a2->min_value, n);
swapl(&a2->max_value, n);
swapl(&a2->resolution, n);
}
a2++;
a++;
*buf += sizeof(xAxisInfo);
}
}
return (i);
}
/*********************************************************************** /***********************************************************************
* *
* This procedure writes the reply for the XListInputDevices function, * This procedure writes the reply for the XListInputDevices function,
@ -376,7 +376,7 @@ CopySwapValuatorClass(register ClientPtr client, ValuatorClassPtr v, char **buf)
void void
SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep) SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -36,44 +36,6 @@ int SProcXListInputDevices(ClientPtr /* client */
int ProcXListInputDevices(ClientPtr /* client */ int ProcXListInputDevices(ClientPtr /* client */
); );
void SizeDeviceInfo(DeviceIntPtr /* d */ ,
int * /* namesize */ ,
int * /* size */
);
void ListDeviceInfo(ClientPtr /* client */ ,
DeviceIntPtr /* d */ ,
xDeviceInfoPtr /* dev */ ,
char ** /* devbuf */ ,
char ** /* classbuf */ ,
char ** /* namebuf */
);
void CopyDeviceName(char ** /* namebuf */ ,
char * /* name */
);
void CopySwapDevice(ClientPtr /* client */ ,
DeviceIntPtr /* d */ ,
int /* num_classes */ ,
char ** /* buf */
);
void CopySwapKeyClass(ClientPtr /* client */ ,
KeyClassPtr /* k */ ,
char ** /* buf */
);
void CopySwapButtonClass(ClientPtr /* client */ ,
ButtonClassPtr /* b */ ,
char ** /* buf */
);
int CopySwapValuatorClass(ClientPtr /* client */ ,
ValuatorClassPtr /* v */ ,
char ** /* buf */
);
void SRepXListInputDevices(ClientPtr /* client */ , void SRepXListInputDevices(ClientPtr /* client */ ,
int /* size */ , int /* size */ ,
xListInputDevicesReply * /* rep */ xListInputDevicesReply * /* rep */

View File

@ -79,9 +79,9 @@ extern CARD8 event_base[];
*/ */
int int
SProcXOpenDevice(register ClientPtr client) SProcXOpenDevice(ClientPtr client)
{ {
register char n; char n;
REQUEST(xOpenDeviceReq); REQUEST(xOpenDeviceReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -95,7 +95,7 @@ SProcXOpenDevice(register ClientPtr client)
*/ */
int int
ProcXOpenDevice(register ClientPtr client) ProcXOpenDevice(ClientPtr client)
{ {
xInputClassInfo evbase[numInputClasses]; xInputClassInfo evbase[numInputClasses];
Bool enableit = FALSE; Bool enableit = FALSE;
@ -179,7 +179,7 @@ ProcXOpenDevice(register ClientPtr client)
void void
SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep) SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -62,9 +62,9 @@ from the author.
*/ */
int int
SProcXQueryDevicePointer(register ClientPtr client) SProcXQueryDevicePointer(ClientPtr client)
{ {
register char n; char n;
REQUEST(xQueryDevicePointerReq); REQUEST(xQueryDevicePointerReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -72,7 +72,7 @@ SProcXQueryDevicePointer(register ClientPtr client)
} }
int int
ProcXQueryDevicePointer(register ClientPtr client) ProcXQueryDevicePointer(ClientPtr client)
{ {
int rc; int rc;
xQueryDevicePointerReply rep; xQueryDevicePointerReply rep;
@ -158,7 +158,7 @@ void
SRepXQueryDevicePointer(ClientPtr client, int size, SRepXQueryDevicePointer(ClientPtr client, int size,
xQueryDevicePointerReply * rep) xQueryDevicePointerReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -58,9 +58,9 @@ from The Open Group.
*/ */
int int
SProcXQueryDeviceState(register ClientPtr client) SProcXQueryDeviceState(ClientPtr client)
{ {
register char n; char n;
REQUEST(xQueryDeviceStateReq); REQUEST(xQueryDeviceStateReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -74,9 +74,9 @@ SProcXQueryDeviceState(register ClientPtr client)
*/ */
int int
ProcXQueryDeviceState(register ClientPtr client) ProcXQueryDeviceState(ClientPtr client)
{ {
register char n; char n;
int i; int i;
int num_classes = 0; int num_classes = 0;
int total_length = 0; int total_length = 0;
@ -187,7 +187,7 @@ ProcXQueryDeviceState(register ClientPtr client)
void void
SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep) SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -128,11 +128,11 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win,
*/ */
int int
SProcXSelectExtensionEvent(register ClientPtr client) SProcXSelectExtensionEvent(ClientPtr client)
{ {
register char n; char n;
register long *p; long *p;
register int i; int i;
REQUEST(xSelectExtensionEventReq); REQUEST(xSelectExtensionEventReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -154,7 +154,7 @@ SProcXSelectExtensionEvent(register ClientPtr client)
*/ */
int int
ProcXSelectExtensionEvent(register ClientPtr client) ProcXSelectExtensionEvent(ClientPtr client)
{ {
int ret; int ret;
int i; int i;

View File

@ -80,11 +80,11 @@ extern int lastEvent; /* Defined in extension.c */
*/ */
int int
SProcXSendExtensionEvent(register ClientPtr client) SProcXSendExtensionEvent(ClientPtr client)
{ {
register char n; char n;
register long *p; long *p;
register int i; int i;
xEvent eventT; xEvent eventT;
xEvent *eventP; xEvent *eventP;
EventSwapPtr proc; EventSwapPtr proc;
@ -119,7 +119,7 @@ SProcXSendExtensionEvent(register ClientPtr client)
*/ */
int int
ProcXSendExtensionEvent(register ClientPtr client) ProcXSendExtensionEvent(ClientPtr client)
{ {
int ret; int ret;
DeviceIntPtr dev; DeviceIntPtr dev;

View File

@ -78,9 +78,9 @@ SOFTWARE.
*/ */
int int
SProcXSetDeviceButtonMapping(register ClientPtr client) SProcXSetDeviceButtonMapping(ClientPtr client)
{ {
register char n; char n;
REQUEST(xSetDeviceButtonMappingReq); REQUEST(xSetDeviceButtonMappingReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -94,7 +94,7 @@ SProcXSetDeviceButtonMapping(register ClientPtr client)
*/ */
int int
ProcXSetDeviceButtonMapping(register ClientPtr client) ProcXSetDeviceButtonMapping(ClientPtr client)
{ {
int ret; int ret;
xSetDeviceButtonMappingReply rep; xSetDeviceButtonMappingReply rep;
@ -149,7 +149,7 @@ void
SRepXSetDeviceButtonMapping(ClientPtr client, int size, SRepXSetDeviceButtonMapping(ClientPtr client, int size,
xSetDeviceButtonMappingReply * rep) xSetDeviceButtonMappingReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -75,9 +75,9 @@ SOFTWARE.
*/ */
int int
SProcXSetDeviceValuators(register ClientPtr client) SProcXSetDeviceValuators(ClientPtr client)
{ {
register char n; char n;
REQUEST(xSetDeviceValuatorsReq); REQUEST(xSetDeviceValuatorsReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -91,7 +91,7 @@ SProcXSetDeviceValuators(register ClientPtr client)
*/ */
int int
ProcXSetDeviceValuators(register ClientPtr client) ProcXSetDeviceValuators(ClientPtr client)
{ {
DeviceIntPtr dev; DeviceIntPtr dev;
xSetDeviceValuatorsReply rep; xSetDeviceValuatorsReply rep;
@ -152,7 +152,7 @@ void
SRepXSetDeviceValuators(ClientPtr client, int size, SRepXSetDeviceValuators(ClientPtr client, int size,
xSetDeviceValuatorsReply * rep) xSetDeviceValuatorsReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -78,9 +78,9 @@ SOFTWARE.
*/ */
int int
SProcXSetDeviceFocus(register ClientPtr client) SProcXSetDeviceFocus(ClientPtr client)
{ {
register char n; char n;
REQUEST(xSetDeviceFocusReq); REQUEST(xSetDeviceFocusReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -97,10 +97,10 @@ SProcXSetDeviceFocus(register ClientPtr client)
*/ */
int int
ProcXSetDeviceFocus(register ClientPtr client) ProcXSetDeviceFocus(ClientPtr client)
{ {
int ret; int ret;
register DeviceIntPtr dev; DeviceIntPtr dev;
REQUEST(xSetDeviceFocusReq); REQUEST(xSetDeviceFocusReq);
REQUEST_SIZE_MATCH(xSetDeviceFocusReq); REQUEST_SIZE_MATCH(xSetDeviceFocusReq);

View File

@ -76,9 +76,9 @@ SOFTWARE.
*/ */
int int
SProcXSetDeviceModifierMapping(register ClientPtr client) SProcXSetDeviceModifierMapping(ClientPtr client)
{ {
register char n; char n;
REQUEST(xSetDeviceModifierMappingReq); REQUEST(xSetDeviceModifierMappingReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -145,7 +145,7 @@ void
SRepXSetDeviceModifierMapping(ClientPtr client, int size, SRepXSetDeviceModifierMapping(ClientPtr client, int size,
xSetDeviceModifierMappingReply * rep) xSetDeviceModifierMappingReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -75,9 +75,9 @@ SOFTWARE.
*/ */
int int
SProcXSetDeviceMode(register ClientPtr client) SProcXSetDeviceMode(ClientPtr client)
{ {
register char n; char n;
REQUEST(xSetDeviceModeReq); REQUEST(xSetDeviceModeReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -91,7 +91,7 @@ SProcXSetDeviceMode(register ClientPtr client)
*/ */
int int
ProcXSetDeviceMode(register ClientPtr client) ProcXSetDeviceMode(ClientPtr client)
{ {
DeviceIntPtr dev; DeviceIntPtr dev;
xSetDeviceModeReply rep; xSetDeviceModeReply rep;
@ -139,7 +139,7 @@ ProcXSetDeviceMode(register ClientPtr client)
void void
SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep) SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep)
{ {
register char n; char n;
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);

View File

@ -168,7 +168,7 @@ OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
*/ */
int int
SetDeviceMode(register ClientPtr client, DeviceIntPtr dev, int mode) SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode)
{ {
return BadMatch; return BadMatch;
} }
@ -186,7 +186,7 @@ SetDeviceMode(register ClientPtr client, DeviceIntPtr dev, int mode)
*/ */
int int
SetDeviceValuators(register ClientPtr client, DeviceIntPtr dev, SetDeviceValuators(ClientPtr client, DeviceIntPtr dev,
int *valuators, int first_valuator, int num_valuators) int *valuators, int first_valuator, int num_valuators)
{ {
return BadMatch; return BadMatch;
@ -201,7 +201,7 @@ SetDeviceValuators(register ClientPtr client, DeviceIntPtr dev,
*/ */
int int
ChangeDeviceControl(register ClientPtr client, DeviceIntPtr dev, ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev,
xDeviceCtl * control) xDeviceCtl * control)
{ {
switch (control->control) { switch (control->control) {

View File

@ -74,9 +74,9 @@ SOFTWARE.
*/ */
int int
SProcXUngrabDevice(register ClientPtr client) SProcXUngrabDevice(ClientPtr client)
{ {
register char n; char n;
REQUEST(xUngrabDeviceReq); REQUEST(xUngrabDeviceReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -92,7 +92,7 @@ SProcXUngrabDevice(register ClientPtr client)
*/ */
int int
ProcXUngrabDevice(register ClientPtr client) ProcXUngrabDevice(ClientPtr client)
{ {
DeviceIntPtr dev; DeviceIntPtr dev;
GrabPtr grab; GrabPtr grab;

View File

@ -80,9 +80,9 @@ SOFTWARE.
*/ */
int int
SProcXUngrabDeviceButton(register ClientPtr client) SProcXUngrabDeviceButton(ClientPtr client)
{ {
register char n; char n;
REQUEST(xUngrabDeviceButtonReq); REQUEST(xUngrabDeviceButtonReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);

View File

@ -80,9 +80,9 @@ SOFTWARE.
*/ */
int int
SProcXUngrabDeviceKey(register ClientPtr client) SProcXUngrabDeviceKey(ClientPtr client)
{ {
register char n; char n;
REQUEST(xUngrabDeviceKeyReq); REQUEST(xUngrabDeviceKeyReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);

View File

@ -59,9 +59,9 @@ from the author.
*/ */
int int
SProcXWarpDevicePointer(register ClientPtr client) SProcXWarpDevicePointer(ClientPtr client)
{ {
register char n; char n;
REQUEST(xWarpDevicePointerReq); REQUEST(xWarpDevicePointerReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
@ -69,7 +69,7 @@ SProcXWarpDevicePointer(register ClientPtr client)
} }
int int
ProcXWarpDevicePointer(register ClientPtr client) ProcXWarpDevicePointer(ClientPtr client)
{ {
int err; int err;
int x, y; int x, y;

124
afb/afb.h
View File

@ -78,27 +78,6 @@ extern void afbDoBitblt(
unsigned long /*planemask*/ unsigned long /*planemask*/
); );
extern RegionPtr afbBitBlt(
DrawablePtr /*pSrc*/,
DrawablePtr /*pDst*/,
GCPtr /*pGC*/,
int /*srcx*/,
int /*srcy*/,
int /*width*/,
int /*height*/,
int /*dstx*/,
int /*dsty*/,
void (*doBitBlt)(
DrawablePtr /*pSrc*/,
DrawablePtr /*pDst*/,
int /*alu*/,
RegionPtr /*prgnDst*/,
DDXPointPtr /*pptSrc*/,
unsigned long /*planemask*/
),
unsigned long /*planemask*/
);
extern RegionPtr afbCopyArea( extern RegionPtr afbCopyArea(
DrawablePtr /*pSrcDrawable*/, DrawablePtr /*pSrcDrawable*/,
DrawablePtr /*pDstDrawable*/, DrawablePtr /*pDstDrawable*/,
@ -111,27 +90,6 @@ extern RegionPtr afbCopyArea(
int /*dsty*/ int /*dsty*/
); );
extern RegionPtr afbCopyPlane(
DrawablePtr /*pSrcDrawable*/,
DrawablePtr /*pDstDrawable*/,
GCPtr/*pGC*/,
int /*srcx*/,
int /*srcy*/,
int /*width*/,
int /*height*/,
int /*dstx*/,
int /*dsty*/,
unsigned long /*plane*/
);
extern void afbCopy1ToN(
DrawablePtr /*pSrc*/,
DrawablePtr /*pDst*/,
int /*alu*/,
RegionPtr /*prgnDst*/,
DDXPointPtr /*pptSrc*/,
unsigned long /*planemask*/
);
/* afbbltC.c */ /* afbbltC.c */
extern void afbDoBitbltCopy( extern void afbDoBitbltCopy(
@ -273,23 +231,6 @@ extern Bool afbInitializeColormap(
ColormapPtr /*pmap*/ ColormapPtr /*pmap*/
); );
extern int afbExpandDirectColors(
ColormapPtr /*pmap*/,
int /*ndefs*/,
xColorItem * /*indefs*/,
xColorItem * /*outdefs*/
);
extern Bool afbCreateDefColormap(
ScreenPtr /*pScreen*/
);
extern Bool afbSetVisualTypes(
int /*depth*/,
int /*visuals*/,
int /*bitsPerRGB*/
);
extern Bool afbInitVisuals( extern Bool afbInitVisuals(
VisualPtr * /*visualp*/, VisualPtr * /*visualp*/,
DepthPtr * /*depthp*/, DepthPtr * /*depthp*/,
@ -410,16 +351,6 @@ extern Bool afbCreateGC(
GCPtr /*pGC*/ GCPtr /*pGC*/
); );
extern void afbValidateGC(
GCPtr /*pGC*/,
unsigned long /*changes*/,
DrawablePtr /*pDrawable*/
);
extern void afbDestroyGC(
GCPtr /*pGC*/
);
extern void afbReduceRop( extern void afbReduceRop(
int /*alu*/, int /*alu*/,
Pixel /*src*/, Pixel /*src*/,
@ -428,19 +359,6 @@ extern void afbReduceRop(
unsigned char * /*rrops*/ unsigned char * /*rrops*/
); );
extern void afbReduceOpaqueStipple (
Pixel /*fg*/,
Pixel /*bg*/,
unsigned long /*planemask*/,
int /*depth*/,
unsigned char * /*rrops*/
);
extern void afbComputeCompositeClip(
GCPtr /*pGC*/,
DrawablePtr /*pDrawable*/
);
/* afbgetsp.c */ /* afbgetsp.c */
extern void afbGetSpans( extern void afbGetSpans(
@ -588,14 +506,6 @@ extern Bool afbDestroyPixmap(
PixmapPtr /*pPixmap*/ PixmapPtr /*pPixmap*/
); );
extern PixmapPtr afbCopyPixmap(
PixmapPtr /*pSrc*/
);
extern void afbPadPixmap(
PixmapPtr /*pPixmap*/
);
extern void afbXRotatePixmap( extern void afbXRotatePixmap(
PixmapPtr /*pPix*/, PixmapPtr /*pPix*/,
int /*rw*/ int /*rw*/
@ -637,20 +547,9 @@ extern void afbPushPixels(
int /*xOrg*/, int /*xOrg*/,
int /*yOrg*/ int /*yOrg*/
); );
/* afbscrclse.c */
extern Bool afbCloseScreen(
int /*index*/,
ScreenPtr /*pScreen*/
);
/* afbscrinit.c */ /* afbscrinit.c */
extern Bool afbAllocatePrivates(
ScreenPtr /*pScreen*/,
int * /*pWinIndex*/,
int * /*pGCIndex*/
);
extern Bool afbScreenInit( extern Bool afbScreenInit(
ScreenPtr /*pScreen*/, ScreenPtr /*pScreen*/,
pointer /*pbits*/, pointer /*pbits*/,
@ -661,15 +560,6 @@ extern Bool afbScreenInit(
int /*width*/ int /*width*/
); );
extern PixmapPtr afbGetWindowPixmap(
WindowPtr /*pWin*/
);
extern void afbSetWindowPixmap(
WindowPtr /*pWin*/,
PixmapPtr /*pPix*/
);
/* afbseg.c */ /* afbseg.c */
extern void afbSegmentSS( extern void afbSegmentSS(
@ -687,20 +577,6 @@ extern void afbSegmentSD(
); );
/* afbsetsp.c */ /* afbsetsp.c */
extern void afbSetScanline(
int /*y*/,
int /*xOrigin*/,
int /*xStart*/,
int /*xEnd*/,
PixelType * /*psrc*/,
int /*alu*/,
PixelType * /*pdstBase*/,
int /*widthDst*/,
int /*sizeDst*/,
int /*depthDst*/,
int /*sizeSrc*/
);
extern void afbSetSpans( extern void afbSetSpans(
DrawablePtr /*pDrawable*/, DrawablePtr /*pDrawable*/,
GCPtr /*pGC*/, GCPtr /*pGC*/,

View File

@ -67,9 +67,6 @@ SOFTWARE.
#include "afb.h" #include "afb.h"
#include "maskbits.h" #include "maskbits.h"
static unsigned char afbRropsOS[AFB_MAX_DEPTH];
/* CopyArea and CopyPlane for a monchrome frame buffer /* CopyArea and CopyPlane for a monchrome frame buffer
@ -126,34 +123,7 @@ afbDoBitblt(DrawablePtr pSrc, DrawablePtr pDst, int alu, RegionPtr prgnDst, DDXP
typedef void (*afb_blit_func) typedef void (*afb_blit_func)
(DrawablePtr, DrawablePtr, int, RegionPtr, DDXPointPtr, unsigned long); (DrawablePtr, DrawablePtr, int, RegionPtr, DDXPointPtr, unsigned long);
RegionPtr static RegionPtr
afbCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty)
{
afb_blit_func doBitBlt;
switch (pGC->alu) {
case GXcopy:
doBitBlt = afbDoBitbltCopy;
break;
case GXxor:
doBitBlt = afbDoBitbltXor;
break;
case GXcopyInverted:
doBitBlt = afbDoBitbltCopyInverted;
break;
case GXor:
doBitBlt = afbDoBitbltOr;
break;
default:
doBitBlt = afbDoBitbltGeneral;
break;
}
return(afbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
width, height, dstx, dsty, doBitBlt, pGC->planemask));
}
RegionPtr
afbBitBlt(register DrawablePtr pSrcDrawable, register DrawablePtr pDstDrawable, register GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, afb_blit_func doBitBlt, long unsigned int planemask) afbBitBlt(register DrawablePtr pSrcDrawable, register DrawablePtr pDstDrawable, register GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, afb_blit_func doBitBlt, long unsigned int planemask)
{ {
RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */ RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
@ -346,102 +316,28 @@ afbBitBlt(register DrawablePtr pSrcDrawable, register DrawablePtr pDstDrawable,
} }
RegionPtr RegionPtr
afbCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, register GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, long unsigned int plane) afbCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty)
{ {
int alu; afb_blit_func doBitBlt;
RegionPtr prgnExposed = NULL;
unsigned long old_planemask;
if (pDstDrawable->depth == 1) { switch (pGC->alu) {
old_planemask = pGC->planemask; case GXcopy:
pGC->planemask = plane; doBitBlt = afbDoBitbltCopy;
if ((pGC->fgPixel & 1) == 1 && (pGC->bgPixel & 1) == 0) { break;
prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable, case GXxor:
pGC, srcx, srcy, width, height, dstx, dsty); doBitBlt = afbDoBitbltXor;
} else if ((pGC->fgPixel & 1) == (pGC->bgPixel & 1)) { break;
unsigned char rop; case GXcopyInverted:
doBitBlt = afbDoBitbltCopyInverted;
afbReduceRop(pGC->alu, pGC->fgPixel, 1, 1, &rop); break;
alu = pGC->alu; case GXor:
pGC->alu = rop; doBitBlt = afbDoBitbltOr;
prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable, pGC, break;
srcx, srcy, width, height, dstx, default:
dsty); doBitBlt = afbDoBitbltGeneral;
pGC->alu = alu; break;
} else { /* need to invert the src */
alu = pGC->alu;
pGC->alu = afbInverseAlu[alu];
prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable, pGC,
srcx, srcy, width, height, dstx,
dsty);
pGC->alu = alu;
}
pGC->planemask = old_planemask;
} else {
int free_pixmap = FALSE;
PixmapPtr pBitmap = (PixmapPtr)pSrcDrawable;
ScreenPtr pScreen = pSrcDrawable->pScreen;
GCPtr pGC1 = NULL;
if (pSrcDrawable == pDstDrawable ||
pSrcDrawable->type == DRAWABLE_WINDOW || pSrcDrawable->depth != 1) {
/* Copy a plane from source drawable to a tmp 1-bit deep pixmap */
/* XXX: Range check width and height */
pBitmap = (*pScreen->CreatePixmap)(pScreen, width, height, 1);
if (!pBitmap)
return(NULL);
pGC1 = GetScratchGC(1, pScreen);
if (!pGC1) {
(*pScreen->DestroyPixmap)(pBitmap);
return(NULL);
}
ValidateGC((DrawablePtr)pBitmap, pGC1);
(void)afbBitBlt(pSrcDrawable, (DrawablePtr)pBitmap, pGC1, srcx, srcy,
width, height, 0, 0, afbDoBitbltCopy, plane);
free_pixmap = TRUE;
}
#if 0
else {
/* XXX: could cope with N-deep pixmap source case without using tmp
* src bitmap by setting up a scratch pixmap header and fiddle
* around with the pbits pointer.
*/
}
#endif
afbReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask,
pGC->depth, afbRropsOS);
(void)afbBitBlt((DrawablePtr)pBitmap, pDstDrawable, pGC, 0, 0, width,
height, dstx, dsty, afbCopy1ToN, pGC->planemask);
if (free_pixmap) {
(*pScreen->DestroyPixmap)(pBitmap);
FreeScratchGC(pGC1);
}
if (pGC->fExpose)
prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx,
srcy, width, height, dstx, dsty,
plane);
}
return prgnExposed;
}
void
afbCopy1ToN(DrawablePtr pSrc, DrawablePtr pDst, int alu, RegionPtr prgnDst, DDXPointPtr pptSrc, long unsigned int planemask)
{
int numRects = REGION_NUM_RECTS(prgnDst);
BoxPtr pbox = REGION_RECTS(prgnDst);
int r;
for (r = 0; r < numRects; r++, pbox++, pptSrc++) {
int dx = pptSrc->x;
int dy = pptSrc->y;
if (alu == GXcopy)
afbOpaqueStippleAreaCopy(pDst, 1, pbox, alu, (PixmapPtr)pSrc, dx, dy,
afbRropsOS, planemask);
else
afbOpaqueStippleAreaGeneral(pDst, 1, pbox, alu, (PixmapPtr)pSrc, dx,
dy, afbRropsOS, planemask);
} }
return(afbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
width, height, dstx, dsty, doBitBlt, pGC->planemask));
} }

View File

@ -70,24 +70,6 @@ afbInitializeColormap(register ColormapPtr pmap)
return miInitializeColormap(pmap); return miInitializeColormap(pmap);
} }
int
afbExpandDirectColors(ColormapPtr pmap, int ndef, xColorItem *indefs, xColorItem *outdefs)
{
return miExpandDirectColors(pmap, ndef, indefs, outdefs);
}
Bool
afbCreateDefColormap(ScreenPtr pScreen)
{
return miCreateDefColormap(pScreen);
}
Bool
afbSetVisualTypes(int depth, int visuals, int bitsPerRGB)
{
return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
}
/* /*
* Given a list of formats for a screen, create a list * Given a list of formats for a screen, create a list
* of visuals and depths for the screen which correspond to * of visuals and depths for the screen which correspond to

View File

@ -69,6 +69,9 @@ SOFTWARE.
#include "maskbits.h" #include "maskbits.h"
static void afbDestroyGC(GCPtr);
static void afbValidateGC(GCPtr, unsigned long, DrawablePtr);
static GCFuncs afbFuncs = { static GCFuncs afbFuncs = {
afbValidateGC, afbValidateGC,
miChangeGC, miChangeGC,
@ -102,6 +105,33 @@ static GCOps afbGCOps = {
afbPushPixels afbPushPixels
}; };
static void
afbReduceOpaqueStipple(PixelType fg, PixelType bg, unsigned long planemask,
int depth, unsigned char *rop)
{
register int d;
register Pixel mask = 1;
bg ^= fg;
for (d = 0; d < depth; d++, mask <<= 1) {
if (!(planemask & mask))
rop[d] = RROP_NOP;
else if (!(bg & mask)) {
/* Both fg and bg have a 0 or 1 in this plane */
if (fg & mask)
rop[d] = RROP_WHITE;
else
rop[d] = RROP_BLACK;
} else {
/* Both fg and bg have different bits on this plane */
if (fg & mask)
rop[d] = RROP_COPY;
else
rop[d] = RROP_INVERT;
}
}
}
Bool Bool
afbCreateGC(pGC) afbCreateGC(pGC)
@ -136,6 +166,95 @@ afbCreateGC(pGC)
return TRUE; return TRUE;
} }
static void
afbComputeCompositeClip(GCPtr pGC, DrawablePtr pDrawable)
{
if (pDrawable->type == DRAWABLE_WINDOW) {
WindowPtr pWin = (WindowPtr) pDrawable;
RegionPtr pregWin;
Bool freeTmpClip, freeCompClip;
if (pGC->subWindowMode == IncludeInferiors) {
pregWin = NotClippedByChildren(pWin);
freeTmpClip = TRUE;
} else {
pregWin = &pWin->clipList;
freeTmpClip = FALSE;
}
freeCompClip = pGC->freeCompClip;
/*
* if there is no client clip, we can get by with just keeping the
* pointer we got, and remembering whether or not should destroy (or
* maybe re-use) it later. this way, we avoid unnecessary copying of
* regions. (this wins especially if many clients clip by children
* and have no client clip.)
*/
if (pGC->clientClipType == CT_NONE) {
if (freeCompClip)
REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
pGC->pCompositeClip = pregWin;
pGC->freeCompClip = freeTmpClip;
} else {
/*
* we need one 'real' region to put into the composite clip. if
* pregWin the current composite clip are real, we can get rid of
* one. if pregWin is real and the current composite clip isn't,
* use pregWin for the composite clip. if the current composite
* clip is real and pregWin isn't, use the current composite
* clip. if neither is real, create a new region.
*/
REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
pDrawable->x + pGC->clipOrg.x,
pDrawable->y + pGC->clipOrg.y);
if (freeCompClip) {
REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, pregWin,
pGC->clientClip);
if (freeTmpClip)
REGION_DESTROY(pGC->pScreen, pregWin);
} else if (freeTmpClip) {
REGION_INTERSECT(pGC->pScreen, pregWin, pregWin, pGC->clientClip);
pGC->pCompositeClip = pregWin;
} else {
pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, NullBox, 0);
REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
pregWin, pGC->clientClip);
}
pGC->freeCompClip = TRUE;
REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
-(pDrawable->x + pGC->clipOrg.x),
-(pDrawable->y + pGC->clipOrg.y));
}
} /* end of composite clip for a window */
else {
BoxRec pixbounds;
/* XXX should we translate by drawable.x/y here ? */
pixbounds.x1 = 0;
pixbounds.y1 = 0;
pixbounds.x2 = pDrawable->width;
pixbounds.y2 = pDrawable->height;
if (pGC->freeCompClip) {
REGION_RESET(pGC->pScreen, pGC->pCompositeClip, &pixbounds);
} else {
pGC->freeCompClip = TRUE;
pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, &pixbounds, 1);
}
if (pGC->clientClipType == CT_REGION) {
REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, -pGC->clipOrg.x,
-pGC->clipOrg.y);
REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
pGC->pCompositeClip, pGC->clientClip);
REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, pGC->clipOrg.x,
pGC->clipOrg.y);
}
} /* end of composite clip for pixmap */
} /* end afbComputeCompositeClip */
/* Clipping conventions /* Clipping conventions
if the drawable is a window if the drawable is a window
CT_REGION ==> pCompositeClip really is the composite CT_REGION ==> pCompositeClip really is the composite
@ -147,7 +266,7 @@ afbCreateGC(pGC)
*/ */
/*ARGSUSED*/ /*ARGSUSED*/
void static void
afbValidateGC(pGC, changes, pDrawable) afbValidateGC(pGC, changes, pDrawable)
register GCPtr pGC; register GCPtr pGC;
unsigned long changes; unsigned long changes;
@ -434,7 +553,7 @@ afbValidateGC(pGC, changes, pDrawable)
} /* end of new_fill */ } /* end of new_fill */
} }
void static void
afbDestroyGC(pGC) afbDestroyGC(pGC)
GCPtr pGC; GCPtr pGC;
{ {
@ -445,58 +564,6 @@ afbDestroyGC(pGC)
miDestroyGCOps(pGC->ops); miDestroyGCOps(pGC->ops);
} }
/* table to map alu(src, dst) to alu(~src, dst) */
int afbInverseAlu[16] = {
GXclear,
GXandInverted,
GXnor,
GXcopyInverted,
GXand,
GXnoop,
GXequiv,
GXorInverted,
GXandReverse,
GXxor,
GXinvert,
GXnand,
GXcopy,
GXor,
GXorReverse,
GXset
};
void
afbReduceOpaqueStipple(fg, bg, planemask, depth, rop)
register PixelType fg;
register PixelType bg;
register unsigned long planemask;
int depth;
register unsigned char *rop;
{
register int d;
register Pixel mask = 1;
bg ^= fg;
for (d = 0; d < depth; d++, mask <<= 1) {
if (!(planemask & mask))
rop[d] = RROP_NOP;
else if (!(bg & mask)) {
/* Both fg and bg have a 0 or 1 in this plane */
if (fg & mask)
rop[d] = RROP_WHITE;
else
rop[d] = RROP_BLACK;
} else {
/* Both fg and bg have different bits on this plane */
if (fg & mask)
rop[d] = RROP_COPY;
else
rop[d] = RROP_INVERT;
}
}
}
void void
afbReduceRop(alu, src, planemask, depth, rop) afbReduceRop(alu, src, planemask, depth, rop)
register int alu; register int alu;
@ -615,94 +682,3 @@ afbReduceRop(alu, src, planemask, depth, rop)
} }
} }
} }
void
afbComputeCompositeClip(pGC, pDrawable)
GCPtr pGC;
DrawablePtr pDrawable;
{
if (pDrawable->type == DRAWABLE_WINDOW) {
WindowPtr pWin = (WindowPtr) pDrawable;
RegionPtr pregWin;
Bool freeTmpClip, freeCompClip;
if (pGC->subWindowMode == IncludeInferiors) {
pregWin = NotClippedByChildren(pWin);
freeTmpClip = TRUE;
} else {
pregWin = &pWin->clipList;
freeTmpClip = FALSE;
}
freeCompClip = pGC->freeCompClip;
/*
* if there is no client clip, we can get by with just keeping the
* pointer we got, and remembering whether or not should destroy (or
* maybe re-use) it later. this way, we avoid unnecessary copying of
* regions. (this wins especially if many clients clip by children
* and have no client clip.)
*/
if (pGC->clientClipType == CT_NONE) {
if (freeCompClip)
REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
pGC->pCompositeClip = pregWin;
pGC->freeCompClip = freeTmpClip;
} else {
/*
* we need one 'real' region to put into the composite clip. if
* pregWin the current composite clip are real, we can get rid of
* one. if pregWin is real and the current composite clip isn't,
* use pregWin for the composite clip. if the current composite
* clip is real and pregWin isn't, use the current composite
* clip. if neither is real, create a new region.
*/
REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
pDrawable->x + pGC->clipOrg.x,
pDrawable->y + pGC->clipOrg.y);
if (freeCompClip) {
REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, pregWin,
pGC->clientClip);
if (freeTmpClip)
REGION_DESTROY(pGC->pScreen, pregWin);
} else if (freeTmpClip) {
REGION_INTERSECT(pGC->pScreen, pregWin, pregWin, pGC->clientClip);
pGC->pCompositeClip = pregWin;
} else {
pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, NullBox, 0);
REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
pregWin, pGC->clientClip);
}
pGC->freeCompClip = TRUE;
REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
-(pDrawable->x + pGC->clipOrg.x),
-(pDrawable->y + pGC->clipOrg.y));
}
} /* end of composite clip for a window */
else {
BoxRec pixbounds;
/* XXX should we translate by drawable.x/y here ? */
pixbounds.x1 = 0;
pixbounds.y1 = 0;
pixbounds.x2 = pDrawable->width;
pixbounds.y2 = pDrawable->height;
if (pGC->freeCompClip) {
REGION_RESET(pGC->pScreen, pGC->pCompositeClip, &pixbounds);
} else {
pGC->freeCompClip = TRUE;
pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, &pixbounds, 1);
}
if (pGC->clientClipType == CT_REGION) {
REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, -pGC->clipOrg.x,
-pGC->clipOrg.y);
REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
pGC->pCompositeClip, pGC->clientClip);
REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, pGC->clipOrg.x,
pGC->clipOrg.y);
}
} /* end of composite clip for pixmap */
} /* end afbComputeCompositeClip */

View File

@ -42,39 +42,8 @@ afbPutImage(pDraw, pGC, depth, x, y, width, height, leftPad, format, pImage)
(void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, pDraw, pGC, leftPad, (void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, pDraw, pGC, leftPad,
0, width, height, x, y, 1); 0, width, height, x, y, 1);
else { else {
#if 0
/* XXX: bit plane order wronge ! */
pPixmap->drawable.depth = 1;
pPixmap->drawable.bitsPerPixel = 1;
switch (pGC->alu) {
case GXcopy:
doBitBlt = afbDoBitbltCopy;
break;
case GXxor:
doBitBlt = afbDoBitbltXor;
break;
case GXcopyInverted:
doBitBlt = afbDoBitbltCopyInverted;
break;
case GXor:
doBitBlt = afbDoBitbltOr;
break;
default:
doBitBlt = afbDoBitbltGeneral;
break;
}
for (plane = (1L << (pPixmap->drawable.depth - 1)); plane;
plane >>= 1) {
(void)afbBitBlt((DrawablePtr)pPixmap, pDraw, pGC, leftPad, 0,
width, height, x, y, doBitBlt, plane);
/* pDraw->devKind += sizeDst; */
}
#else
(void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, pDraw, pGC, leftPad, (void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, pDraw, pGC, leftPad,
0, width, height, x, y); 0, width, height, x, y);
#endif
} }
pGC->fExpose = TRUE; pGC->fExpose = TRUE;

View File

@ -118,9 +118,8 @@ afbDestroyPixmap(pPixmap)
} }
PixmapPtr static PixmapPtr
afbCopyPixmap(pSrc) afbCopyPixmap(PixmapPtr pSrc)
register PixmapPtr pSrc;
{ {
register PixmapPtr pDst; register PixmapPtr pDst;
int size; int size;
@ -148,9 +147,8 @@ afbCopyPixmap(pSrc)
zero out area to be filled with replicate zero out area to be filled with replicate
left shift and or in original as many times as needed left shift and or in original as many times as needed
*/ */
void static void
afbPadPixmap(pPixmap) afbPadPixmap(PixmapPtr pPixmap)
PixmapPtr pPixmap;
{ {
register int width = pPixmap->drawable.width; register int width = pPixmap->drawable.width;
register int h; register int h;

View File

@ -77,7 +77,7 @@ int afbScreenPrivateIndex;
static unsigned long afbGeneration = 0; static unsigned long afbGeneration = 0;
BSFuncRec afbBSFuncRec = { static BSFuncRec afbBSFuncRec = {
afbSaveAreas, afbSaveAreas,
afbRestoreAreas, afbRestoreAreas,
(BackingStoreSetClipmaskRgnProcPtr) 0, (BackingStoreSetClipmaskRgnProcPtr) 0,
@ -85,7 +85,7 @@ BSFuncRec afbBSFuncRec = {
(BackingStoreGetSpansPixmapProcPtr) 0, (BackingStoreGetSpansPixmapProcPtr) 0,
}; };
Bool static Bool
afbCloseScreen(int index, ScreenPtr pScreen) afbCloseScreen(int index, ScreenPtr pScreen)
{ {
int d; int d;
@ -119,7 +119,29 @@ afbCreateScreenResources(ScreenPtr pScreen)
return(retval); return(retval);
} }
Bool static PixmapPtr
afbGetWindowPixmap(WindowPtr pWin)
{
#ifdef PIXMAP_PER_WINDOW
return (PixmapPtr)(pWin->devPrivates[frameWindowPrivateIndex].ptr);
#else
ScreenPtr pScreen = pWin->drawable.pScreen;
return (* pScreen->GetScreenPixmap)(pScreen);
#endif
}
static void
afbSetWindowPixmap(WindowPtr pWin, PixmapPtr pPix)
{
#ifdef PIXMAP_PER_WINDOW
pWin->devPrivates[frameWindowPrivateIndex].ptr = (pointer)pPix;
#else
(* pWin->drawable.pScreen->SetScreenPixmap)(pPix);
#endif
}
static Bool
afbAllocatePrivates(ScreenPtr pScreen, int *pWinIndex, int *pGCIndex) afbAllocatePrivates(ScreenPtr pScreen, int *pWinIndex, int *pGCIndex)
{ {
if (afbGeneration != serverGeneration) { if (afbGeneration != serverGeneration) {
@ -216,25 +238,3 @@ afbScreenInit(register ScreenPtr pScreen, pointer pbits, int xsize, int ysize, i
return TRUE; return TRUE;
} }
PixmapPtr
afbGetWindowPixmap(WindowPtr pWin)
{
#ifdef PIXMAP_PER_WINDOW
return (PixmapPtr)(pWin->devPrivates[frameWindowPrivateIndex].ptr);
#else
ScreenPtr pScreen = pWin->drawable.pScreen;
return (* pScreen->GetScreenPixmap)(pScreen);
#endif
}
void
afbSetWindowPixmap(WindowPtr pWin, PixmapPtr pPix)
{
#ifdef PIXMAP_PER_WINDOW
pWin->devPrivates[frameWindowPrivateIndex].ptr = (pointer)pPix;
#else
(* pWin->drawable.pScreen->SetScreenPixmap)(pPix);
#endif
}

View File

@ -73,20 +73,10 @@ SOFTWARE.
* boxes, we may not want to start grabbing bits at psrc but at some offset * boxes, we may not want to start grabbing bits at psrc but at some offset
* further on.) * further on.)
*/ */
void static void
afbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst, afbSetScanline(int y, int xOrigin, int xStart, int xEnd, PixelType *psrc,
sizeDst, depthDst, sizeSrc) int alu, PixelType *pdstBase, int widthDst, int sizeDst,
int y; int depthDst, int sizeSrc)
int xOrigin; /* where this scanline starts */
int xStart; /* first bit to use from scanline */
int xEnd; /* last bit to use from scanline + 1 */
register PixelType *psrc;
register int alu; /* raster op */
PixelType *pdstBase; /* start of the drawable */
int widthDst; /* width of drawable in words */
int sizeDst;
int depthDst;
int sizeSrc;
{ {
int w; /* width of scanline in bits */ int w; /* width of scanline in bits */
register PixelType *pdst; /* where to put the bits */ register PixelType *pdst; /* where to put the bits */

View File

@ -48,7 +48,7 @@
#include "compint.h" #include "compint.h"
void static void
compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure) compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
{ {
WindowPtr pWin = (WindowPtr) closure; WindowPtr pWin = (WindowPtr) closure;

View File

@ -50,10 +50,10 @@
#include "compint.h" #include "compint.h"
static CARD8 CompositeReqCode; static CARD8 CompositeReqCode;
int CompositeClientPrivateIndex; static int CompositeClientPrivateIndex;
RESTYPE CompositeClientWindowType; RESTYPE CompositeClientWindowType;
RESTYPE CompositeClientSubwindowsType; RESTYPE CompositeClientSubwindowsType;
RESTYPE CompositeClientOverlayType; static RESTYPE CompositeClientOverlayType;
static void deleteCompOverlayClient (CompOverlayClientPtr pOcToDel, static void deleteCompOverlayClient (CompOverlayClientPtr pOcToDel,
ScreenPtr pScreen); ScreenPtr pScreen);
@ -423,7 +423,7 @@ createOverlayWindow (ScreenPtr pScreen)
return pWin; return pWin;
} }
int static int
ProcCompositeGetOverlayWindow (ClientPtr client) ProcCompositeGetOverlayWindow (ClientPtr client)
{ {
REQUEST(xCompositeGetOverlayWindowReq); REQUEST(xCompositeGetOverlayWindowReq);
@ -477,7 +477,7 @@ ProcCompositeGetOverlayWindow (ClientPtr client)
return client->noClientException; return client->noClientException;
} }
int static int
ProcCompositeReleaseOverlayWindow (ClientPtr client) ProcCompositeReleaseOverlayWindow (ClientPtr client)
{ {
REQUEST(xCompositeReleaseOverlayWindowReq); REQUEST(xCompositeReleaseOverlayWindowReq);
@ -515,7 +515,7 @@ ProcCompositeReleaseOverlayWindow (ClientPtr client)
return client->noClientException; return client->noClientException;
} }
int (*ProcCompositeVector[CompositeNumberRequests])(ClientPtr) = { static int (*ProcCompositeVector[CompositeNumberRequests])(ClientPtr) = {
ProcCompositeQueryVersion, ProcCompositeQueryVersion,
ProcCompositeRedirectWindow, ProcCompositeRedirectWindow,
ProcCompositeRedirectSubwindows, ProcCompositeRedirectSubwindows,
@ -625,7 +625,7 @@ SProcCompositeNameWindowPixmap (ClientPtr client)
return (*ProcCompositeVector[stuff->compositeReqType]) (client); return (*ProcCompositeVector[stuff->compositeReqType]) (client);
} }
int static int
SProcCompositeGetOverlayWindow (ClientPtr client) SProcCompositeGetOverlayWindow (ClientPtr client)
{ {
int n; int n;
@ -637,7 +637,7 @@ SProcCompositeGetOverlayWindow (ClientPtr client)
return (*ProcCompositeVector[stuff->compositeReqType]) (client); return (*ProcCompositeVector[stuff->compositeReqType]) (client);
} }
int static int
SProcCompositeReleaseOverlayWindow (ClientPtr client) SProcCompositeReleaseOverlayWindow (ClientPtr client)
{ {
int n; int n;
@ -649,7 +649,7 @@ SProcCompositeReleaseOverlayWindow (ClientPtr client)
return (*ProcCompositeVector[stuff->compositeReqType]) (client); return (*ProcCompositeVector[stuff->compositeReqType]) (client);
} }
int (*SProcCompositeVector[CompositeNumberRequests])(ClientPtr) = { static int (*SProcCompositeVector[CompositeNumberRequests])(ClientPtr) = {
SProcCompositeQueryVersion, SProcCompositeQueryVersion,
SProcCompositeRedirectWindow, SProcCompositeRedirectWindow,
SProcCompositeRedirectSubwindows, SProcCompositeRedirectSubwindows,
@ -678,6 +678,30 @@ CompositeExtensionInit (void)
ExtensionEntry *extEntry; ExtensionEntry *extEntry;
int s; int s;
for (s = 0; s < screenInfo.numScreens; s++) {
ScreenPtr pScreen = screenInfo.screens[s];
VisualPtr vis;
/* Composite on 8bpp pseudocolor root windows appears to fail, so
* just disable it on anything pseudocolor for safety.
*/
for (vis = pScreen->visuals; vis->vid != pScreen->rootVisual; vis++)
;
if ((vis->class | DynamicClass) == PseudoColor)
return;
/* Ensure that Render is initialized, which is required for automatic
* compositing.
*/
if (GetPictureScreenIfSet(pScreen) == NULL)
return;
}
/* Xinerama's rewriting of window drawing before Composite gets to it
* breaks Composite.
*/
if (!noPanoramiXExtension)
return;
CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow); CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow);
if (!CompositeClientWindowType) if (!CompositeClientWindowType)
return; return;

View File

@ -51,7 +51,7 @@
int CompScreenPrivateIndex; int CompScreenPrivateIndex;
int CompWindowPrivateIndex; int CompWindowPrivateIndex;
int CompSubwindowsPrivateIndex; int CompSubwindowsPrivateIndex;
int CompGeneration; static int CompGeneration;
static Bool static Bool

View File

@ -171,9 +171,6 @@ extern RESTYPE CompositeClientSubwindowsType;
* compalloc.c * compalloc.c
*/ */
void
compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure);
Bool Bool
compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update); compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
@ -292,18 +289,6 @@ compWindowUpdate (WindowPtr pWin);
void void
deleteCompOverlayClientsForScreen (ScreenPtr pScreen); deleteCompOverlayClientsForScreen (ScreenPtr pScreen);
int
ProcCompositeGetOverlayWindow (ClientPtr client);
int
ProcCompositeReleaseOverlayWindow (ClientPtr client);
int
SProcCompositeGetOverlayWindow (ClientPtr client);
int
SProcCompositeReleaseOverlayWindow (ClientPtr client);
WindowPtr WindowPtr
CompositeRealChildHead (WindowPtr pWin); CompositeRealChildHead (WindowPtr pWin);

View File

@ -852,10 +852,6 @@ AC_DEFINE(DAMAGE,1,[Support Damage extension])
DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la' DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la'
DAMAGE_INC='-I$(top_srcdir)/damageext' DAMAGE_INC='-I$(top_srcdir)/damageext'
MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la' MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la'
dnl damage (may) need the composite wrapper when composite is enabled
if test "$COMPOSITE" = yes; then
MIEXT_DAMAGE_LIB="$MIEXT_DAMAGE_LIB "'$(top_builddir)/miext/cw/libcw.la'
fi
MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage' MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage'
AC_DEFINE(XINPUT, 1, [Support X Input extension]) AC_DEFINE(XINPUT, 1, [Support X Input extension])
@ -1412,6 +1408,8 @@ return 0;}
fi fi
if test "${OS_MINOR}" -lt 8 ; then if test "${OS_MINOR}" -lt 8 ; then
solaris_usl_console="yes" solaris_usl_console="yes"
else
XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
fi fi
;; ;;
*) *)

View File

@ -28,12 +28,12 @@
#include "damageextint.h" #include "damageextint.h"
unsigned char DamageReqCode; static unsigned char DamageReqCode;
int DamageEventBase; static int DamageEventBase;
int DamageErrorBase; static int DamageErrorBase;
int DamageClientPrivateIndex; static int DamageClientPrivateIndex;
RESTYPE DamageExtType; static RESTYPE DamageExtType;
RESTYPE DamageExtWinType; static RESTYPE DamageExtWinType;
/* Version of the damage extension supported by the server, as opposed to the /* Version of the damage extension supported by the server, as opposed to the
* DAMAGE_* defines from damageproto for what version the proto header * DAMAGE_* defines from damageproto for what version the proto header
@ -319,7 +319,7 @@ static const int version_requests[] = {
#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0])) #define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0]))
int (*ProcDamageVector[XDamageNumberRequests])(ClientPtr) = { static int (*ProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
/*************** Version 1 ******************/ /*************** Version 1 ******************/
ProcDamageQueryVersion, ProcDamageQueryVersion,
ProcDamageCreate, ProcDamageCreate,
@ -408,7 +408,7 @@ SProcDamageAdd (ClientPtr client)
return (*ProcDamageVector[stuff->damageReqType]) (client); return (*ProcDamageVector[stuff->damageReqType]) (client);
} }
int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = { static int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
/*************** Version 1 ******************/ /*************** Version 1 ******************/
SProcDamageQueryVersion, SProcDamageQueryVersion,
SProcDamageCreate, SProcDamageCreate,
@ -478,7 +478,7 @@ FreeDamageExtWin (pointer value, XID wid)
return Success; return Success;
} }
void static void
SDamageNotifyEvent (xDamageNotifyEvent *from, SDamageNotifyEvent (xDamageNotifyEvent *from,
xDamageNotifyEvent *to) xDamageNotifyEvent *to)
{ {

View File

@ -44,13 +44,6 @@
#include "damage.h" #include "damage.h"
#include "xfixes.h" #include "xfixes.h"
extern unsigned char DamageReqCode;
extern int DamageEventBase;
extern int DamageErrorBase;
extern int DamageClientPrivateIndex;
extern RESTYPE DamageExtType;
extern RESTYPE DamageExtWinType;
typedef struct _DamageClient { typedef struct _DamageClient {
CARD32 major_version; CARD32 major_version;
CARD32 minor_version; CARD32 minor_version;
@ -67,9 +60,6 @@ typedef struct _DamageExt {
XID id; XID id;
} DamageExtRec, *DamageExtPtr; } DamageExtRec, *DamageExtPtr;
extern int (*ProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
extern int (*SProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
#define VERIFY_DAMAGEEXT(pDamageExt, rid, client, mode) { \ #define VERIFY_DAMAGEEXT(pDamageExt, rid, client, mode) { \
pDamageExt = SecurityLookupIDByType (client, rid, DamageExtType, mode); \ pDamageExt = SecurityLookupIDByType (client, rid, DamageExtType, mode); \
if (!pDamageExt) { \ if (!pDamageExt) { \
@ -78,10 +68,6 @@ extern int (*SProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
} \ } \
} }
void
SDamageNotifyEvent (xDamageNotifyEvent *from,
xDamageNotifyEvent *to);
void void
DamageExtSetCritical (ClientPtr pClient, Bool critical); DamageExtSetCritical (ClientPtr pClient, Bool critical);

View File

@ -79,36 +79,6 @@ static int dbeErrorBase;
*/ */
static Bool firstRegistrationPass = TRUE; static Bool firstRegistrationPass = TRUE;
/******************************************************************************
*
* DBE DIX Procedure: DbeValidateBuffer
*
* Description:
*
* This function is called from VALIDATE_DRAWABLE_AND_GC and from
* various places in dispatch.c if the server has been compiled with
* the flags -DNEED_DBE_BUF_BITS and -DNEED_DBE_BUF_VALIDATE.
* When pWin->dstBuffer changes, this function will be called with pWin
* as the first argument, the drawable ID that was specified as the
* second argument (could be a back buffer id), and True for the third
* argument.
* When pWin->srcBuffer changes, the third argument will be False, and
* the first two arguments are as described for dstBuffer.
*
* This function should prepare the hardware to access the specified
* buffer for reads (if dstbuf is False) or writes (if dstbuf is True).
*
*****************************************************************************/
void
DbeValidateBuffer(WindowPtr pWin, XID drawID, Bool dstbuf)
{
DbeScreenPrivPtr pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin);
if (pDbeScreenPriv->ValidateBuffer)
(*pDbeScreenPriv->ValidateBuffer)(pWin, drawID, dstbuf);
}
/****************************************************************************** /******************************************************************************
* *
@ -317,7 +287,6 @@ DbeStubScreen(DbeScreenPrivPtr pDbeScreenPriv, int *nStubbedScreens)
pDbeScreenPriv->EndIdiom = NULL; pDbeScreenPriv->EndIdiom = NULL;
pDbeScreenPriv->WinPrivDelete = NULL; pDbeScreenPriv->WinPrivDelete = NULL;
pDbeScreenPriv->ResetProc = NULL; pDbeScreenPriv->ResetProc = NULL;
pDbeScreenPriv->ValidateBuffer = NULL;
(*nStubbedScreens)++; (*nStubbedScreens)++;

View File

@ -221,11 +221,6 @@ typedef struct _DbeScreenPrivRec
void (*ResetProc)( void (*ResetProc)(
ScreenPtr /*pScreen*/ ScreenPtr /*pScreen*/
); );
void (*ValidateBuffer)(
WindowPtr /*pWin*/,
XID /*bufId*/,
Bool /*dstbuffer*/
);
/* Device-specific private information. /* Device-specific private information.
*/ */

View File

@ -59,21 +59,12 @@
#include <stdio.h> #include <stdio.h>
/* DEFINES */
/* TYPEDEFS */
/* GLOBALS */
static int miDbePrivPrivGeneration = 0; static int miDbePrivPrivGeneration = 0;
static int miDbeWindowPrivPrivIndex = -1; static int miDbeWindowPrivPrivIndex = -1;
RESTYPE dbeDrawableResType; static RESTYPE dbeDrawableResType;
RESTYPE dbeWindowPrivResType; static RESTYPE dbeWindowPrivResType;
int dbeScreenPrivIndex = -1; static int dbeScreenPrivIndex = -1;
int dbeWindowPrivIndex = -1; static int dbeWindowPrivIndex = -1;
/****************************************************************************** /******************************************************************************
@ -768,11 +759,6 @@ miDbeResetProc(ScreenPtr pScreen)
} /* miDbeResetProc() */ } /* miDbeResetProc() */
static void
miDbeNopValidateBuffer(WindowPtr pWin, XID bufId, Bool dstbuffer)
{
}
/****************************************************************************** /******************************************************************************
* *
@ -830,9 +816,6 @@ miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv)
pDbeScreenPriv->ResetProc = miDbeResetProc; pDbeScreenPriv->ResetProc = miDbeResetProc;
pDbeScreenPriv->WinPrivDelete = miDbeWinPrivDelete; pDbeScreenPriv->WinPrivDelete = miDbeWinPrivDelete;
/* The mi implementation doesn't need buffer validation. */
pDbeScreenPriv->ValidateBuffer = miDbeNopValidateBuffer;
return(TRUE); return(TRUE);
} /* miDbeInit() */ } /* miDbeInit() */

View File

@ -67,7 +67,7 @@ SOFTWARE.
#define XKB_IN_SERVER #define XKB_IN_SERVER
#endif #endif
#ifdef XKB #ifdef XKB
#include <X11/extensions/XKBsrv.h> #include <xkbsrv.h>
#endif #endif
#include "xace.h" #include "xace.h"
@ -79,7 +79,8 @@ SOFTWARE.
#include "exglobals.h" #include "exglobals.h"
#include "exevents.h" #include "exevents.h"
int CoreDevicePrivatesIndex = 0, CoreDevicePrivatesGeneration = -1; int CoreDevicePrivatesIndex = 0;
static int CoreDevicePrivatesGeneration = -1;
/* The client that is allowed to change pointer-keyboard pairings. */ /* The client that is allowed to change pointer-keyboard pairings. */
static ClientPtr pairingClient = NULL; static ClientPtr pairingClient = NULL;
@ -994,16 +995,16 @@ InitPtrFeedbackClassDeviceStruct(DeviceIntPtr dev, PtrCtrlProcPtr controlProc)
} }
LedCtrl defaultLedControl = { static LedCtrl defaultLedControl = {
DEFAULT_LEDS, DEFAULT_LEDS_MASK, 0}; DEFAULT_LEDS, DEFAULT_LEDS_MASK, 0};
BellCtrl defaultBellControl = { static BellCtrl defaultBellControl = {
DEFAULT_BELL, DEFAULT_BELL,
DEFAULT_BELL_PITCH, DEFAULT_BELL_PITCH,
DEFAULT_BELL_DURATION, DEFAULT_BELL_DURATION,
0}; 0};
IntegerCtrl defaultIntegerControl = { static IntegerCtrl defaultIntegerControl = {
DEFAULT_INT_RESOLUTION, DEFAULT_INT_RESOLUTION,
DEFAULT_INT_MIN_VALUE, DEFAULT_INT_MIN_VALUE,
DEFAULT_INT_MAX_VALUE, DEFAULT_INT_MAX_VALUE,

View File

@ -143,7 +143,7 @@ int ProcInitialConnection();
#define XKB_IN_SERVER #define XKB_IN_SERVER
#endif #endif
#include "inputstr.h" #include "inputstr.h"
#include <X11/extensions/XKBsrv.h> #include <xkbsrv.h>
#endif #endif
#ifdef XSERVER_DTRACE #ifdef XSERVER_DTRACE
@ -297,9 +297,8 @@ long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL;
long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL;
long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE;
long SmartScheduleTime; long SmartScheduleTime;
ClientPtr SmartLastClient; static ClientPtr SmartLastClient;
int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1]; static int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1];
int SmartScheduleClient(int *clientReady, int nready);
#ifdef SMART_DEBUG #ifdef SMART_DEBUG
long SmartLastPrint; long SmartLastPrint;
@ -308,7 +307,7 @@ long SmartLastPrint;
void Dispatch(void); void Dispatch(void);
void InitProcVectors(void); void InitProcVectors(void);
int static int
SmartScheduleClient (int *clientReady, int nready) SmartScheduleClient (int *clientReady, int nready)
{ {
ClientPtr pClient; ClientPtr pClient;
@ -834,7 +833,7 @@ ProcCirculateWindow(ClientPtr client)
return(client->noClientException); return(client->noClientException);
} }
int static int
GetGeometry(ClientPtr client, xGetGeometryReply *rep) GetGeometry(ClientPtr client, xGetGeometryReply *rep)
{ {
DrawablePtr pDraw; DrawablePtr pDraw;
@ -1804,8 +1803,6 @@ ProcCopyArea(ClientPtr client)
else else
pSrc = pDst; pSrc = pDst;
SET_DBE_SRCBUF(pSrc, stuff->srcDrawable);
pRgn = (*pGC->ops->CopyArea)(pSrc, pDst, pGC, stuff->srcX, stuff->srcY, pRgn = (*pGC->ops->CopyArea)(pSrc, pDst, pGC, stuff->srcX, stuff->srcY,
stuff->width, stuff->height, stuff->width, stuff->height,
stuff->dstX, stuff->dstY); stuff->dstX, stuff->dstY);
@ -1848,8 +1845,6 @@ ProcCopyPlane(ClientPtr client)
else else
psrcDraw = pdstDraw; psrcDraw = pdstDraw;
SET_DBE_SRCBUF(psrcDraw, stuff->srcDrawable);
/* Check to see if stuff->bitPlane has exactly ONE good bit set */ /* Check to see if stuff->bitPlane has exactly ONE good bit set */
if(stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) || if(stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) ||
(stuff->bitPlane > (1L << (psrcDraw->depth - 1)))) (stuff->bitPlane > (1L << (psrcDraw->depth - 1))))
@ -2157,8 +2152,7 @@ ProcPutImage(ClientPtr client)
return (client->noClientException); return (client->noClientException);
} }
static int
int
DoGetImage(ClientPtr client, int format, Drawable drawable, DoGetImage(ClientPtr client, int format, Drawable drawable,
int x, int y, int width, int height, int x, int y, int width, int height,
Mask planemask, xGetImageReply **im_return) Mask planemask, xGetImageReply **im_return)
@ -2210,8 +2204,6 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
xgi.visual = None; xgi.visual = None;
} }
SET_DBE_SRCBUF(pDraw, drawable);
xgi.type = X_Reply; xgi.type = X_Reply;
xgi.sequenceNumber = client->sequence; xgi.sequenceNumber = client->sequence;
xgi.depth = pDraw->depth; xgi.depth = pDraw->depth;
@ -3383,6 +3375,28 @@ ProcChangeAccessControl(ClientPtr client)
return (result); return (result);
} }
/*********************
* CloseDownRetainedResources
*
* Find all clients that are gone and have terminated in RetainTemporary
* and destroy their resources.
*********************/
static void
CloseDownRetainedResources(void)
{
int i;
ClientPtr client;
for (i=1; i<currentMaxClients; i++)
{
client = clients[i];
if (client && (client->closeDownMode == RetainTemporary)
&& (client->clientGone))
CloseDownClient(client);
}
}
int int
ProcKillClient(ClientPtr client) ProcKillClient(ClientPtr client)
{ {
@ -3653,28 +3667,6 @@ KillAllClients()
} }
} }
/*********************
* CloseDownRetainedResources
*
* Find all clients that are gone and have terminated in RetainTemporary
* and destroy their resources.
*********************/
void
CloseDownRetainedResources()
{
int i;
ClientPtr client;
for (i=1; i<currentMaxClients; i++)
{
client = clients[i];
if (client && (client->closeDownMode == RetainTemporary)
&& (client->clientGone))
CloseDownClient(client);
}
}
extern int clientPrivateLen; extern int clientPrivateLen;
extern unsigned *clientPrivateSizes; extern unsigned *clientPrivateSizes;
extern unsigned totalClientSize; extern unsigned totalClientSize;

View File

@ -882,9 +882,7 @@ static CallbackFuncsRec default_cbfuncs =
_DeleteCallbackList _DeleteCallbackList
}; };
/* ===== Public Procedures ===== */ static Bool
Bool
CreateCallbackList(CallbackListPtr *pcbl, CallbackFuncsPtr cbfuncs) CreateCallbackList(CallbackListPtr *pcbl, CallbackFuncsPtr cbfuncs)
{ {
CallbackListPtr cbl; CallbackListPtr cbl;
@ -916,6 +914,8 @@ CreateCallbackList(CallbackListPtr *pcbl, CallbackFuncsPtr cbfuncs)
return TRUE; return TRUE;
} }
/* ===== Public Procedures ===== */
_X_EXPORT Bool _X_EXPORT Bool
AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data)
{ {

View File

@ -139,7 +139,7 @@ of the copyright holder.
#ifdef XKB #ifdef XKB
#include <X11/extensions/XKBproto.h> #include <X11/extensions/XKBproto.h>
#include <X11/extensions/XKBsrv.h> #include <xkbsrv.h>
extern Bool XkbFilterEvents(ClientPtr, int, xEvent *); extern Bool XkbFilterEvents(ClientPtr, int, xEvent *);
#endif #endif
@ -162,7 +162,7 @@ extern Mask xevieFilters[128];
extern int xevieEventSent; extern int xevieEventSent;
extern int xevieKBEventSent; extern int xevieKBEventSent;
int xeviegrabState = 0; int xeviegrabState = 0;
xEvent *xeviexE; static xEvent *xeviexE;
#endif #endif
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>

View File

@ -66,8 +66,6 @@ SOFTWARE.
#define LAST_EVENT 128 #define LAST_EVENT 128
#define LAST_ERROR 255 #define LAST_ERROR 255
ScreenProcEntry AuxillaryScreenProcs[MAXSCREENS];
static ExtensionEntry **extensions = (ExtensionEntry **)NULL; static ExtensionEntry **extensions = (ExtensionEntry **)NULL;
int lastEvent = EXTENSION_EVENT_BASE; int lastEvent = EXTENSION_EVENT_BASE;
@ -298,21 +296,8 @@ CloseDownExtensions()
extensions = (ExtensionEntry **)NULL; extensions = (ExtensionEntry **)NULL;
lastEvent = EXTENSION_EVENT_BASE; lastEvent = EXTENSION_EVENT_BASE;
lastError = FirstExtensionError; lastError = FirstExtensionError;
for (i=0; i<MAXSCREENS; i++)
{
ScreenProcEntry *spentry = &AuxillaryScreenProcs[i];
while (spentry->num)
{
spentry->num--;
xfree(spentry->procList[spentry->num].name);
}
xfree(spentry->procList);
spentry->procList = (ProcEntryPtr)NULL;
}
} }
int int
ProcQueryExtension(ClientPtr client) ProcQueryExtension(ClientPtr client)
{ {
@ -406,72 +391,6 @@ ProcListExtensions(ClientPtr client)
return(client->noClientException); return(client->noClientException);
} }
ExtensionLookupProc
LookupProc(char *name, GCPtr pGC)
{
int i;
ScreenProcEntry *spentry;
spentry = &AuxillaryScreenProcs[pGC->pScreen->myNum];
if (spentry->num)
{
for (i = 0; i < spentry->num; i++)
if (strcmp(name, spentry->procList[i].name) == 0)
return(spentry->procList[i].proc);
}
return (ExtensionLookupProc)NULL;
}
Bool
RegisterProc(char *name, GC *pGC, ExtensionLookupProc proc)
{
return RegisterScreenProc(name, pGC->pScreen, proc);
}
Bool
RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc)
{
ScreenProcEntry *spentry;
ProcEntryPtr procEntry = (ProcEntryPtr)NULL;
char *newname;
int i;
spentry = &AuxillaryScreenProcs[pScreen->myNum];
/* first replace duplicates */
if (spentry->num)
{
for (i = 0; i < spentry->num; i++)
if (strcmp(name, spentry->procList[i].name) == 0)
{
procEntry = &spentry->procList[i];
break;
}
}
if (procEntry)
procEntry->proc = proc;
else
{
newname = (char *)xalloc(strlen(name)+1);
if (!newname)
return FALSE;
procEntry = (ProcEntryPtr)
xrealloc(spentry->procList,
sizeof(ProcEntryRec) * (spentry->num+1));
if (!procEntry)
{
xfree(newname);
return FALSE;
}
spentry->procList = procEntry;
procEntry += spentry->num;
procEntry->name = newname;
strcpy(newname, name);
procEntry->proc = proc;
spentry->num++;
}
return TRUE;
}
#ifdef XSERVER_DTRACE #ifdef XSERVER_DTRACE
void LoadExtensionNames(char **RequestNames) { void LoadExtensionNames(char **RequestNames) {
int i; int i;

View File

@ -69,7 +69,7 @@ extern FontPtr defaultFont;
static Bool CreateDefaultTile(GCPtr pGC); static Bool CreateDefaultTile(GCPtr pGC);
unsigned char DefaultDash[2] = {4, 4}; static unsigned char DefaultDash[2] = {4, 4};
_X_EXPORT void _X_EXPORT void
ValidateGC(DrawablePtr pDraw, GC *pGC) ValidateGC(DrawablePtr pDraw, GC *pGC)
@ -907,17 +907,6 @@ FreeGC(pointer value, XID gid)
return(Success); return(Success);
} }
void
SetGCMask(GCPtr pGC, Mask selectMask, Mask newDataMask)
{
pGC->stateChanges = (~selectMask & pGC->stateChanges) |
(selectMask & newDataMask);
if (selectMask & newDataMask)
pGC->serialNumber |= GC_CHANGE_SERIAL_BIT;
}
/* CreateScratchGC(pScreen, depth) /* CreateScratchGC(pScreen, depth)
like CreateGC, but doesn't do the default tile or stipple, like CreateGC, but doesn't do the default tile or stipple,
since we can't create them without already having a GC. any code since we can't create them without already having a GC. any code

View File

@ -50,7 +50,7 @@
#ifdef XKB #ifdef XKB
#include <X11/extensions/XKBproto.h> #include <X11/extensions/XKBproto.h>
#include <X11/extensions/XKBsrv.h> #include <xkbsrv.h>
extern Bool XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies); extern Bool XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies);
#endif #endif

View File

@ -246,7 +246,7 @@ CreateNewResourceClass()
return next; return next;
} }
ClientResourceRec clientTable[MAXCLIENTS]; static ClientResourceRec clientTable[MAXCLIENTS];
/***************** /*****************
* InitClientResources * InitClientResources

View File

@ -317,7 +317,7 @@ SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply *pRep)
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void static void
SwapTimecoord(xTimecoord* pCoord) SwapTimecoord(xTimecoord* pCoord)
{ {
char n; char n;
@ -584,7 +584,7 @@ SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply *pRep
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void static void
SwapRGB(xrgb *prgb) SwapRGB(xrgb *prgb)
{ {
char n; char n;
@ -1159,6 +1159,58 @@ SKeymapNotifyEvent(xEvent *from, xEvent *to)
*to = *from; *to = *from;
} }
static void
SwapConnSetup(xConnSetup *pConnSetup, xConnSetup *pConnSetupT)
{
cpswapl(pConnSetup->release, pConnSetupT->release);
cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase);
cpswapl(pConnSetup->ridMask, pConnSetupT->ridMask);
cpswapl(pConnSetup->motionBufferSize, pConnSetupT->motionBufferSize);
cpswaps(pConnSetup->nbytesVendor, pConnSetupT->nbytesVendor);
cpswaps(pConnSetup->maxRequestSize, pConnSetupT->maxRequestSize);
pConnSetupT->minKeyCode = pConnSetup->minKeyCode;
pConnSetupT->maxKeyCode = pConnSetup->maxKeyCode;
pConnSetupT->numRoots = pConnSetup->numRoots;
pConnSetupT->numFormats = pConnSetup->numFormats;
pConnSetupT->imageByteOrder = pConnSetup->imageByteOrder;
pConnSetupT->bitmapBitOrder = pConnSetup->bitmapBitOrder;
pConnSetupT->bitmapScanlineUnit = pConnSetup->bitmapScanlineUnit;
pConnSetupT->bitmapScanlinePad = pConnSetup->bitmapScanlinePad;
}
static void
SwapWinRoot(xWindowRoot *pRoot, xWindowRoot *pRootT)
{
cpswapl(pRoot->windowId, pRootT->windowId);
cpswapl(pRoot->defaultColormap, pRootT->defaultColormap);
cpswapl(pRoot->whitePixel, pRootT->whitePixel);
cpswapl(pRoot->blackPixel, pRootT->blackPixel);
cpswapl(pRoot->currentInputMask, pRootT->currentInputMask);
cpswaps(pRoot->pixWidth, pRootT->pixWidth);
cpswaps(pRoot->pixHeight, pRootT->pixHeight);
cpswaps(pRoot->mmWidth, pRootT->mmWidth);
cpswaps(pRoot->mmHeight, pRootT->mmHeight);
cpswaps(pRoot->minInstalledMaps, pRootT->minInstalledMaps);
cpswaps(pRoot->maxInstalledMaps, pRootT->maxInstalledMaps);
cpswapl(pRoot->rootVisualID, pRootT->rootVisualID);
pRootT->backingStore = pRoot->backingStore;
pRootT->saveUnders = pRoot->saveUnders;
pRootT->rootDepth = pRoot->rootDepth;
pRootT->nDepths = pRoot->nDepths;
}
static void
SwapVisual(xVisualType *pVis, xVisualType *pVisT)
{
cpswapl(pVis->visualID, pVisT->visualID);
pVisT->class = pVis->class;
pVisT->bitsPerRGB = pVis->bitsPerRGB;
cpswaps(pVis->colormapEntries, pVisT->colormapEntries);
cpswapl(pVis->redMask, pVisT->redMask);
cpswapl(pVis->greenMask, pVisT->greenMask);
cpswapl(pVis->blueMask, pVisT->blueMask);
}
_X_EXPORT void _X_EXPORT void
SwapConnSetupInfo( SwapConnSetupInfo(
char *pInfo, char *pInfo,
@ -1210,7 +1262,6 @@ SwapConnSetupInfo(
} }
} }
void void
WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo) WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
{ {
@ -1227,58 +1278,6 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
DEALLOCATE_LOCAL(pInfoTBase); DEALLOCATE_LOCAL(pInfoTBase);
} }
void
SwapConnSetup(xConnSetup *pConnSetup, xConnSetup *pConnSetupT)
{
cpswapl(pConnSetup->release, pConnSetupT->release);
cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase);
cpswapl(pConnSetup->ridMask, pConnSetupT->ridMask);
cpswapl(pConnSetup->motionBufferSize, pConnSetupT->motionBufferSize);
cpswaps(pConnSetup->nbytesVendor, pConnSetupT->nbytesVendor);
cpswaps(pConnSetup->maxRequestSize, pConnSetupT->maxRequestSize);
pConnSetupT->minKeyCode = pConnSetup->minKeyCode;
pConnSetupT->maxKeyCode = pConnSetup->maxKeyCode;
pConnSetupT->numRoots = pConnSetup->numRoots;
pConnSetupT->numFormats = pConnSetup->numFormats;
pConnSetupT->imageByteOrder = pConnSetup->imageByteOrder;
pConnSetupT->bitmapBitOrder = pConnSetup->bitmapBitOrder;
pConnSetupT->bitmapScanlineUnit = pConnSetup->bitmapScanlineUnit;
pConnSetupT->bitmapScanlinePad = pConnSetup->bitmapScanlinePad;
}
void
SwapWinRoot(xWindowRoot *pRoot, xWindowRoot *pRootT)
{
cpswapl(pRoot->windowId, pRootT->windowId);
cpswapl(pRoot->defaultColormap, pRootT->defaultColormap);
cpswapl(pRoot->whitePixel, pRootT->whitePixel);
cpswapl(pRoot->blackPixel, pRootT->blackPixel);
cpswapl(pRoot->currentInputMask, pRootT->currentInputMask);
cpswaps(pRoot->pixWidth, pRootT->pixWidth);
cpswaps(pRoot->pixHeight, pRootT->pixHeight);
cpswaps(pRoot->mmWidth, pRootT->mmWidth);
cpswaps(pRoot->mmHeight, pRootT->mmHeight);
cpswaps(pRoot->minInstalledMaps, pRootT->minInstalledMaps);
cpswaps(pRoot->maxInstalledMaps, pRootT->maxInstalledMaps);
cpswapl(pRoot->rootVisualID, pRootT->rootVisualID);
pRootT->backingStore = pRoot->backingStore;
pRootT->saveUnders = pRoot->saveUnders;
pRootT->rootDepth = pRoot->rootDepth;
pRootT->nDepths = pRoot->nDepths;
}
void
SwapVisual(xVisualType *pVis, xVisualType *pVisT)
{
cpswapl(pVis->visualID, pVisT->visualID);
pVisT->class = pVis->class;
pVisT->bitsPerRGB = pVis->bitsPerRGB;
cpswaps(pVis->colormapEntries, pVisT->colormapEntries);
cpswapl(pVis->redMask, pVisT->redMask);
cpswapl(pVis->greenMask, pVisT->greenMask);
cpswapl(pVis->blueMask, pVisT->blueMask);
}
_X_EXPORT void _X_EXPORT void
SwapConnSetupPrefix(xConnSetupPrefix *pcspFrom, xConnSetupPrefix *pcspTo) SwapConnSetupPrefix(xConnSetupPrefix *pcspFrom, xConnSetupPrefix *pcspTo)
{ {

View File

@ -307,10 +307,6 @@ SetWindowToDefaults(WindowPtr pWin)
pWin->deliverableEvents = 0; pWin->deliverableEvents = 0;
pWin->dontPropagate = 0; pWin->dontPropagate = 0;
pWin->forcedBS = FALSE; pWin->forcedBS = FALSE;
#ifdef NEED_DBE_BUF_BITS
pWin->srcBuffer = DBE_FRONT_BUFFER;
pWin->dstBuffer = DBE_FRONT_BUFFER;
#endif
#ifdef COMPOSITE #ifdef COMPOSITE
pWin->redirectDraw = 0; pWin->redirectDraw = 0;
#endif #endif
@ -557,7 +553,7 @@ InitRootWindow(WindowPtr pWin)
* window from which the region came. * window from which the region came.
*/ */
void static void
ClippedRegionFromBox(WindowPtr pWin, RegionPtr Rgn, ClippedRegionFromBox(WindowPtr pWin, RegionPtr Rgn,
int x, int y, int x, int y,
int w, int h) int w, int h)
@ -853,6 +849,46 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
return pWin; return pWin;
} }
static void
DisposeWindowOptional (WindowPtr pWin)
{
if (!pWin->optional)
return;
/*
* everything is peachy. Delete the optional record
* and clean up
*/
if (pWin->optional->cursor)
{
FreeCursor (pWin->optional->cursor, (Cursor)0);
pWin->cursorIsNone = FALSE;
}
else
pWin->cursorIsNone = TRUE;
if (pWin->optional->deviceCursors)
{
DevCursorList pList;
DevCursorList pPrev;
pList = pWin->optional->deviceCursors;
while(pList)
{
if (pList->cursor)
FreeCursor(pList->cursor, (XID)0);
pPrev = pList;
pList = pList->next;
xfree(pPrev);
}
pWin->optional->deviceCursors = NULL;
}
xfree(pWin->optional->access.perm);
xfree(pWin->optional->access.deny);
xfree (pWin->optional);
pWin->optional = NULL;
}
static void static void
FreeWindowResources(WindowPtr pWin) FreeWindowResources(WindowPtr pWin)
{ {
@ -2721,6 +2757,30 @@ RealizeTree(WindowPtr pWin)
} }
} }
static WindowPtr windowDisableMapUnmapEvents;
void
DisableMapUnmapEvents(WindowPtr pWin)
{
assert (windowDisableMapUnmapEvents == NULL);
windowDisableMapUnmapEvents = pWin;
}
void
EnableMapUnmapEvents(WindowPtr pWin)
{
assert (windowDisableMapUnmapEvents != NULL);
windowDisableMapUnmapEvents = NULL;
}
static Bool
MapUnmapEventsEnabled(WindowPtr pWin)
{
return pWin != windowDisableMapUnmapEvents;
}
/***** /*****
* MapWindow * MapWindow
* If some other client has selected SubStructureReDirect on the parent * If some other client has selected SubStructureReDirect on the parent
@ -3219,21 +3279,6 @@ HandleSaveSet(ClientPtr client)
client->saveSet = (SaveSetElt *)NULL; client->saveSet = (SaveSetElt *)NULL;
} }
/**
*
* \param x,y in root
* \param box "return" value
*/
Bool
VisibleBoundingBoxFromPoint(WindowPtr pWin, int x, int y, BoxPtr box)
{
if (!pWin->realized)
return (FALSE);
if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->clipList, x, y, box))
return(TRUE);
return(FALSE);
}
/** /**
* *
* \param x,y in root * \param x,y in root
@ -3342,30 +3387,6 @@ SendVisibilityNotify(WindowPtr pWin)
DeliverEvents(pWin, &event, 1, NullWindow); DeliverEvents(pWin, &event, 1, NullWindow);
} }
static WindowPtr windowDisableMapUnmapEvents;
void
DisableMapUnmapEvents(WindowPtr pWin)
{
assert (windowDisableMapUnmapEvents == NULL);
windowDisableMapUnmapEvents = pWin;
}
void
EnableMapUnmapEvents(WindowPtr pWin)
{
assert (windowDisableMapUnmapEvents != NULL);
windowDisableMapUnmapEvents = NULL;
}
Bool
MapUnmapEventsEnabled(WindowPtr pWin)
{
return pWin != windowDisableMapUnmapEvents;
}
#define RANDOM_WIDTH 32 #define RANDOM_WIDTH 32
#ifndef NOLOGOHACK #ifndef NOLOGOHACK
@ -3738,61 +3759,6 @@ MakeWindowOptional (WindowPtr pWin)
return TRUE; return TRUE;
} }
void
DisposeWindowOptional (WindowPtr pWin)
{
if (!pWin->optional)
return;
/*
* everything is peachy. Delete the optional record
* and clean up
*/
/*
* TOG changed this code to:
*
* if (pWin->cursorIsNone == FALSE)
* FreeCursor (pWin->optional->cursor, (Cursor)0);
* pWin->cursorIsNone = TRUE;
*
* This is blatently wrong; windows without optionals can have
* two different cursor values, either None or sharing their
* parents cursor. This difference is controlled by the
* cursorIsNone value; when TRUE, the window has no cursor,
* when false, it shares its cursor with its parent; TOG
* made it impossible for a window to have a cursor without
* an optional record.
*/
if (pWin->optional->cursor)
{
FreeCursor (pWin->optional->cursor, (Cursor)0);
pWin->cursorIsNone = FALSE;
}
else
pWin->cursorIsNone = TRUE;
if (pWin->optional->deviceCursors)
{
DevCursorList pList;
DevCursorList pPrev;
pList = pWin->optional->deviceCursors;
while(pList)
{
if (pList->cursor)
FreeCursor(pList->cursor, (XID)0);
pPrev = pList;
pList = pList->next;
xfree(pPrev);
}
pWin->optional->deviceCursors = NULL;
}
xfree(pWin->optional->access.perm);
xfree(pWin->optional->access.deny);
xfree (pWin->optional);
pWin->optional = NULL;
}
/* /*
* Changes the cursor struct for the given device and the given window. * Changes the cursor struct for the given device and the given window.
* A cursor that does not have a device cursor set will use whatever the * A cursor that does not have a device cursor set will use whatever the
@ -3807,9 +3773,10 @@ DisposeWindowOptional (WindowPtr pWin)
* Assumption: If there is a node for a device in the list, the device has a * Assumption: If there is a node for a device in the list, the device has a
* cursor. If the cursor is set to None, it is inherited by the parent. * cursor. If the cursor is set to None, it is inherited by the parent.
*/ */
int ChangeWindowDeviceCursor(register WindowPtr pWin, _X_EXPORT int
DeviceIntPtr pDev, ChangeWindowDeviceCursor(WindowPtr pWin,
CursorPtr pCursor) DeviceIntPtr pDev,
CursorPtr pCursor)
{ {
DevCursNodePtr pNode, pPrev; DevCursNodePtr pNode, pPrev;
CursorPtr pOldCursor = NULL; CursorPtr pOldCursor = NULL;
@ -3905,7 +3872,8 @@ int ChangeWindowDeviceCursor(register WindowPtr pWin,
} }
/* Get device cursor for given device or None if none is set */ /* Get device cursor for given device or None if none is set */
CursorPtr WindowGetDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev) _X_EXPORT CursorPtr
WindowGetDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev)
{ {
DevCursorList pList; DevCursorList pList;
@ -4001,7 +3969,6 @@ WindowParentHasDeviceCursor(WindowPtr pWin,
return FALSE; return FALSE;
} }
#ifndef NOLOGOHACK #ifndef NOLOGOHACK
static void static void
DrawLogo(WindowPtr pWin) DrawLogo(WindowPtr pWin)

Some files were not shown because too many files have changed in this diff Show More