Merge branch 'origin' into glucose-2

This commit is contained in:
Alan Hourihane 2007-04-18 14:58:19 +01:00
commit da2c4faa9f
141 changed files with 2281 additions and 1188 deletions

View file

@ -14,7 +14,6 @@ AM_CFLAGS = \
-I@MESA_SOURCE@/src/mesa/glapi \
-I@MESA_SOURCE@/src/mesa/main \
-DXFree86Server \
-DNO_LIBCWRAPPER \
@GLX_DEFINES@
# none yet
@ -47,12 +46,13 @@ libglx_la_SOURCES = \
glxdrawable.h \
glxext.c \
glxext.h \
glxvisuals.c \
glxglcore.c \
glxscreens.c \
glxscreens.h \
glxserver.h \
glxutil.c \
glxutil.h \
glxvisuals.c \
indirect_dispatch.c \
indirect_dispatch.h \
indirect_dispatch_swap.c \

View file

@ -40,9 +40,6 @@
**
*/
/* XXX: should be defined somewhere globally */
#define CAPI
#include "GL/internal/glcore.h"
typedef struct __GLXtextureFromPixmap __GLXtextureFromPixmap;

View file

@ -829,12 +829,16 @@ static Bool
glxDRIEnterVT (int index, int flags)
{
__GLXDRIscreen *screen = (__GLXDRIscreen *) __glXgetActiveScreen(index);
Bool ret;
LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
if (!(*screen->enterVT) (index, flags))
return FALSE;
glxResumeClients();
return (*screen->enterVT) (index, flags);
return TRUE;
}
static void

View file

@ -277,7 +277,7 @@ static GLboolean errorOccured = GL_FALSE;
/*
** The GL was will call this routine if an error occurs.
*/
void __glXErrorCallBack(__GLinterface *gc, GLenum code)
void __glXErrorCallBack(GLenum code)
{
errorOccured = GL_TRUE;
}

View file

@ -66,7 +66,7 @@ typedef struct {
extern GLboolean __glXFreeContext(__GLXcontext *glxc);
extern void __glXFlushContextCache(void);
extern void __glXErrorCallBack(__GLinterface *gc, GLenum code);
extern void __glXErrorCallBack(GLenum code);
extern void __glXClearErrorOccured(void);
extern GLboolean __glXErrorOccured(void);
extern void __glXResetLargeCommandStatus(__GLXclientState*);

View file

@ -37,40 +37,18 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#endif
#include <string.h>
#include <regionstr.h>
#include <resource.h>
#include <GL/gl.h>
#include <GL/glxint.h>
#include <GL/glxtokens.h>
#include <scrnintstr.h>
#include <windowstr.h>
#include <config.h>
#include <GL/xmesa.h>
#include <GL/internal/glcore.h>
#include <glxserver.h>
#include <glxscreens.h>
#include <glxdrawable.h>
#include <glxcontext.h>
#include <glxext.h>
#include <glxutil.h>
#include "context.h"
#include "xmesaP.h"
#include "context.h"
#include "glcontextmodes.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 __GLXMESAcontext __GLXMESAcontext;
typedef struct __GLXMESAdrawable __GLXMESAdrawable;
@ -218,8 +196,7 @@ __glXMesaContextCopy(__GLXcontext *baseDst,
__GLXMESAcontext *dst = (__GLXMESAcontext *) baseDst;
__GLXMESAcontext *src = (__GLXMESAcontext *) baseSrc;
_mesa_copy_context(&src->xmesa->mesa, &dst->xmesa->mesa, mask);
return GL_TRUE;
return XMesaCopyContext(src->xmesa, dst->xmesa, mask);
}
static int
@ -227,7 +204,7 @@ __glXMesaContextForceCurrent(__GLXcontext *baseContext)
{
__GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
GlxSetRenderTables (context->xmesa->mesa.CurrentDispatch);
/* GlxSetRenderTables() call for XGL moved in XMesaForceCurrent() */
return XMesaForceCurrent(context->xmesa);
}

View file

@ -40,9 +40,6 @@
**
*/
/* XXX: should be defined somewhere globally */
#define CAPI
#include "GL/internal/glcore.h"
/*

View file

@ -639,7 +639,7 @@ __glGetBooleanv_size(GLenum e)
case GL_PROGRAM_ERROR_POSITION_ARB:
case GL_DEPTH_CLAMP_NV:
case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
/* case GL_NUM_TEXTURE_COMPRESSED_FORMATS_ARB:*/
/* case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:*/
case GL_MAX_VERTEX_UNITS_ARB:
case GL_ACTIVE_VERTEX_UNITS_ARB:
case GL_WEIGHT_SUM_UNITY_ARB:
@ -699,6 +699,8 @@ __glGetBooleanv_size(GLenum e)
/* case GL_POINT_SPRITE_NV:*/
case GL_POINT_SPRITE_R_MODE_NV:
case GL_MAX_VERTEX_ATTRIBS_ARB:
case GL_MAX_TEXTURE_COORDS_ARB:
case GL_MAX_TEXTURE_IMAGE_UNITS_ARB:
case GL_DEPTH_BOUNDS_TEST_EXT:
case GL_STENCIL_TEST_TWO_SIDE_EXT:
case GL_ACTIVE_STENCIL_FACE_EXT:
@ -1005,8 +1007,6 @@ __glGetProgramivARB_size(GLenum e)
case GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB:
case GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB:
case GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB:
case GL_MAX_TEXTURE_COORDS_ARB:
case GL_MAX_TEXTURE_IMAGE_UNITS_ARB:
case GL_PROGRAM_FORMAT_ARB:
case GL_PROGRAM_INSTRUCTIONS_ARB:
case GL_MAX_PROGRAM_INSTRUCTIONS_ARB:

2
GL/mesa/.gitignore vendored
View file

@ -1,6 +1,6 @@
X/drivers
X/glxheader.h
X/xmesaP.h
X/xm*.h
X/xm*.c
mesa/drivers
mesa/glxheader.h

View file

@ -20,18 +20,13 @@ INCLUDES = -I@MESA_SOURCE@/include \
AM_CFLAGS = \
$(DIX_CFLAGS) \
-DXFree86Server \
@GLX_DEFINES@ \
-DXFree86Server
libX_la_SOURCES = xf86glx.c \
xf86glx_util.c \
xf86glx_util.h \
xf86glxint.h
@GLX_DEFINES@
nodist_libX_la_SOURCES = \
xm_api.c \
xm_buffer.c \
xm_dd.c \
xm_image.c \
xm_line.c \
xm_span.c \
xm_tri.c \

View file

@ -1,151 +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>
* Brian Paul <brian@precisioninsight.com>
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdlib.h>
#include <gcstruct.h>
#include "pixmapstr.h"
#include "xf86glx_util.h"
#include <X11/Xmd.h>
#ifdef ROUNDUP
#undef ROUNDUP
#endif
#define ROUNDUP(nbytes, pad) ((((nbytes) + ((pad)-1)) / (pad)) * ((pad)>>3))
XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height, char *data)
{
XMesaImage *image;
image = (XMesaImage *)xalloc(sizeof(XMesaImage));
if (image) {
image->width = width;
image->height = height;
image->data = data;
/* Always pad to 32 bits */
image->bytes_per_line = ROUNDUP((bitsPerPixel * width), 32);
image->bits_per_pixel = bitsPerPixel;
}
return image;
}
void XMesaDestroyImage(XMesaImage *image)
{
if (image->data)
free(image->data);
xfree(image);
}
unsigned long XMesaGetPixel(XMesaImage *image, int x, int y)
{
CARD8 *row = (CARD8 *)(image->data + y*image->bytes_per_line);
CARD8 *i8;
CARD16 *i16;
CARD32 *i32;
switch (image->bits_per_pixel) {
case 8:
i8 = (CARD8 *)row;
return i8[x];
break;
case 15:
case 16:
i16 = (CARD16 *)row;
return i16[x];
break;
case 24: /* WARNING: architecture specific code */
i8 = (CARD8 *)row;
return (((CARD32)i8[x*3]) |
(((CARD32)i8[x*3+1])<<8) |
(((CARD32)i8[x*3+2])<<16));
break;
case 32:
i32 = (CARD32 *)row;
return i32[x];
break;
}
return 0;
}
#ifndef XMESA_USE_PUTPIXEL_MACRO
void XMesaPutPixel(XMesaImage *image, int x, int y, unsigned long pixel)
{
CARD8 *row = (CARD8 *)(image->data + y*image->bytes_per_line);
CARD8 *i8;
CARD16 *i16;
CARD32 *i32;
switch (image->bits_per_pixel) {
case 8:
i8 = (CARD8 *)row;
i8[x] = (CARD8)pixel;
break;
case 15:
case 16:
i16 = (CARD16 *)row;
i16[x] = (CARD16)pixel;
break;
case 24: /* WARNING: architecture specific code */
i8 = (CARD8 *)__row;
i8[x*3] = (CARD8)(p);
i8[x*3+1] = (CARD8)(p>>8);
i8[x*3+2] = (CARD8)(p>>16);
case 32:
i32 = (CARD32 *)row;
i32[x] = (CARD32)pixel;
break;
}
}
#endif
void XMesaPutImageHelper(ScreenPtr display,
DrawablePtr d, GCPtr gc,
XMesaImage *image,
int src_x, int src_y,
int dest_x, int dest_y,
unsigned int width, unsigned int height)
{
/* NOT_DONE: Verify that the following works for all depths */
char *src = (image->data +
src_y * image->bytes_per_line +
((src_x * image->bits_per_pixel) >> 3));
ValidateGC(d, gc);
(*gc->ops->PutImage)(d, gc, d->depth, dest_x, dest_y, width, height,
0, ZPixmap, src);
}

View file

@ -1,105 +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>
* Brian Paul <brian@precisioninsight.com>
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _XF86GLX_UTIL_H_
#define _XF86GLX_UTIL_H_
#ifdef __CYGWIN__
#undef WIN32
#undef _WIN32
#endif
#include <screenint.h>
#include <pixmap.h>
#include <gc.h>
#include "GL/xmesa.h"
#define XMESA_USE_PUTPIXEL_MACRO
struct _XMesaImageRec {
int width, height;
char *data;
int bytes_per_line; /* Padded to 32 bits */
int bits_per_pixel;
};
extern XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height,
char *data);
extern void XMesaDestroyImage(XMesaImage *image);
extern unsigned long XMesaGetPixel(XMesaImage *image, int x, int y);
#ifdef XMESA_USE_PUTPIXEL_MACRO
#define XMesaPutPixel(__i,__x,__y,__p) \
{ \
CARD8 *__row = (CARD8 *)(__i->data + __y*__i->bytes_per_line); \
CARD8 *__i8; \
CARD16 *__i16; \
CARD32 *__i32; \
switch (__i->bits_per_pixel) { \
case 8: \
__i8 = (CARD8 *)__row; \
__i8[__x] = (CARD8)__p; \
break; \
case 15: \
case 16: \
__i16 = (CARD16 *)__row; \
__i16[__x] = (CARD16)__p; \
break; \
case 24: /* WARNING: architecture specific code */ \
__i8 = (CARD8 *)__row; \
__i8[__x*3] = (CARD8)(__p); \
__i8[__x*3+1] = (CARD8)(__p>>8); \
__i8[__x*3+2] = (CARD8)(__p>>16); \
break; \
case 32: \
__i32 = (CARD32 *)__row; \
__i32[__x] = (CARD32)__p; \
break; \
} \
}
#else
extern void XMesaPutPixel(XMesaImage *image, int x, int y,
unsigned long pixel);
#endif
extern void XMesaPutImageHelper(ScreenPtr display,
DrawablePtr d, GCPtr gc,
XMesaImage *image,
int src_x, int src_y,
int dest_x, int dest_y,
unsigned int width, unsigned int height);
#endif /* _XF86GLX_UTIL_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

@ -21,8 +21,6 @@ INCLUDES = -I@MESA_SOURCE@/include \
nodist_libtnl_la_SOURCES = t_context.c \
t_draw.c \
t_pipeline.c \
t_vb_arbprogram.c \
t_vb_arbprogram_sse.c \
t_vb_cull.c \
t_vb_fog.c \
t_vb_light.c \

View file

@ -168,6 +168,8 @@ symlink_mesa_x() {
action xm_api.c
action xm_buffer.c
action xm_dd.c
action xm_image.c
action xm_image.h
action xm_line.c
action xm_span.c
action xm_tri.c
@ -225,9 +227,6 @@ symlink_glx() {
dst_dir glx
action indirect_size.h
src_dir src/mesa/drivers/dri/common
action glcontextmodes.c
action glcontextmodes.h

View file

@ -2509,7 +2509,7 @@ ServertimeBracketValues(pCounter, pbracket_less, pbracket_greater)
}
static void
SyncInitServerTime()
SyncInitServerTime(void)
{
CARD64 resolution;

View file

@ -42,6 +42,12 @@ from The Open Group.
#include <X11/extensions/xcmiscstr.h>
#include "modinit.h"
#if HAVE_STDINT_H
#include <stdint.h>
#elif !defined(UINT32_MAX)
#define UINT32_MAX 0xffffffffU
#endif
#if 0
static unsigned char XCMiscCode;
#endif
@ -143,7 +149,10 @@ ProcXCMiscGetXIDList(client)
REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
pids = (XID *)ALLOCATE_LOCAL(stuff->count * sizeof(XID));
if (stuff->count > UINT32_MAX / sizeof(XID))
return BadAlloc;
pids = (XID *)Xalloc(stuff->count * sizeof(XID));
if (!pids)
{
return BadAlloc;
@ -164,7 +173,7 @@ ProcXCMiscGetXIDList(client)
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, count * sizeof(XID), pids);
}
DEALLOCATE_LOCAL(pids);
Xfree(pids);
return(client->noClientException);
}

View file

@ -153,7 +153,7 @@ static int XvdiSendVideoNotify(XvPortPtr, DrawablePtr, int);
*/
void
XvExtensionInit()
XvExtensionInit(void)
{
ExtensionEntry *extEntry;
@ -205,7 +205,7 @@ XvExtensionInit()
}
static Bool
CreateResourceTypes()
CreateResourceTypes(void)
{
@ -335,13 +335,13 @@ XvResetProc(ExtensionEntry* extEntry)
}
_X_EXPORT int
XvGetScreenIndex()
XvGetScreenIndex(void)
{
return XvScreenIndex;
}
_X_EXPORT unsigned long
XvGetRTPort()
XvGetRTPort(void)
{
return XvRTPort;
}

View file

@ -675,7 +675,7 @@ SProcXvMCDispatch (ClientPtr client)
}
void
XvMCExtensionInit()
XvMCExtensionInit(void)
{
ExtensionEntry *extEntry;

View file

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

View file

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

View file

@ -78,9 +78,9 @@ SOFTWARE.
*/
int
SProcXChangeFeedbackControl(register ClientPtr client)
SProcXChangeFeedbackControl(ClientPtr client)
{
register char n;
char n;
REQUEST(xChangeFeedbackControlReq);
swaps(&stuff->length, n);
@ -99,7 +99,7 @@ static int
ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
KbdFeedbackPtr k, xKbdFeedbackCtl * f)
{
register char n;
char n;
KeybdCtrl kctrl;
int t;
int key = DO_ALL;
@ -231,7 +231,7 @@ static int
ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
PtrFeedbackPtr p, xPtrFeedbackCtl * f)
{
register char n;
char n;
PtrCtrl pctrl; /* might get BadValue part way through */
if (client->swapped) {
@ -303,7 +303,7 @@ ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, IntegerFeedbackPtr i,
xIntegerFeedbackCtl * f)
{
register char n;
char n;
if (client->swapped) {
swaps(&f->length, n);
@ -326,8 +326,8 @@ ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, StringFeedbackPtr s,
xStringFeedbackCtl * f)
{
register char n;
register long *p;
char n;
long *p;
int i, j;
KeySym *syms, *sup_syms;
@ -376,7 +376,7 @@ ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, BellFeedbackPtr b,
xBellFeedbackCtl * f)
{
register char n;
char n;
int t;
BellCtrl bctrl; /* might get BadValue part way through */
@ -440,7 +440,7 @@ static int
ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
LedFeedbackPtr l, xLedFeedbackCtl * f)
{
register char n;
char n;
LedCtrl lctrl; /* might get BadValue part way through */
if (client->swapped) {
@ -520,7 +520,7 @@ ProcXChangeFeedbackControl(ClientPtr client)
break;
case StringFeedbackClass:
{
register char n;
char n;
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) & stuff[1]);
if (client->swapped) {

View file

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

View file

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

View file

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

View file

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

View file

@ -77,9 +77,9 @@ SOFTWARE.
*/
int
SProcXCloseDevice(register ClientPtr client)
SProcXCloseDevice(ClientPtr client)
{
register char n;
char n;
REQUEST(xCloseDeviceReq);
swaps(&stuff->length, n);
@ -141,7 +141,7 @@ DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client)
*/
int
ProcXCloseDevice(register ClientPtr client)
ProcXCloseDevice(ClientPtr client)
{
int i;
WindowPtr pWin, p1;

View file

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

View file

@ -104,12 +104,12 @@ RegisterOtherDevice(DeviceIntPtr device)
}
/*ARGSUSED*/ void
ProcessOtherEvent(xEventPtr xE, register DeviceIntPtr other, int count)
ProcessOtherEvent(xEventPtr xE, DeviceIntPtr other, int count)
{
register BYTE *kptr;
register int i;
register CARD16 modifiers;
register CARD16 mask;
BYTE *kptr;
int i;
CARD16 modifiers;
CARD16 mask;
GrabPtr grab = other->grab;
Bool deactivateDeviceGrab = FALSE;
int key = 0, bit = 0, rootX, rootY;
@ -288,7 +288,7 @@ ProcessOtherEvent(xEventPtr xE, register DeviceIntPtr other, int count)
_X_EXPORT int
InitProximityClassDeviceStruct(DeviceIntPtr dev)
{
register ProximityClassPtr proxc;
ProximityClassPtr proxc;
proxc = (ProximityClassPtr) xalloc(sizeof(ProximityClassRec));
if (!proxc)
@ -301,7 +301,7 @@ _X_EXPORT void
InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, int minval, int maxval,
int resolution, int min_res, int max_res)
{
register AxisInfoPtr ax;
AxisInfoPtr ax;
if (!dev || !dev->valuator)
return;
@ -378,7 +378,7 @@ FixDeviceValuator(DeviceIntPtr dev, deviceValuator * ev, ValuatorClassPtr v,
void
DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
register WindowPtr pWin)
WindowPtr pWin)
{
deviceFocus event;
@ -703,9 +703,9 @@ MakeInputMasks(WindowPtr pWin)
void
RecalculateDeviceDeliverableEvents(WindowPtr pWin)
{
register InputClientsPtr others;
InputClientsPtr others;
struct _OtherInputMasks *inputMasks; /* default: NULL */
register WindowPtr pChild, tmp;
WindowPtr pChild, tmp;
int i;
pChild = pWin;
@ -739,9 +739,9 @@ RecalculateDeviceDeliverableEvents(WindowPtr pWin)
}
int
InputClientGone(register WindowPtr pWin, XID id)
InputClientGone(WindowPtr pWin, XID id)
{
register InputClientsPtr other, prev;
InputClientsPtr other, prev;
if (!wOtherInputMasks(pWin))
return (Success);
@ -839,7 +839,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
int
SetButtonMapping(ClientPtr client, DeviceIntPtr dev, int nElts, BYTE * map)
{
register int i;
int i;
ButtonClassPtr b = dev->button;
if (b == NULL)
@ -865,7 +865,7 @@ SetModifierMapping(ClientPtr client, DeviceIntPtr dev, int len, int rlen,
{
KeyCode *map = NULL;
int inputMapLen;
register int i;
int i;
*k = dev->key;
if (*k == NULL)
@ -1141,7 +1141,7 @@ CheckDeviceGrabAndHintWindow(WindowPtr pWin, int type,
static Mask
DeviceEventMaskForClient(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
{
register InputClientsPtr other;
InputClientsPtr other;
if (!wOtherInputMasks(pWin))
return 0;
@ -1154,7 +1154,7 @@ DeviceEventMaskForClient(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
}
void
MaybeStopDeviceHint(register DeviceIntPtr dev, ClientPtr client)
MaybeStopDeviceHint(DeviceIntPtr dev, ClientPtr client)
{
WindowPtr pWin;
GrabPtr grab = dev->grab;

View file

@ -216,7 +216,7 @@ static XExtensionVersion thisversion = { XI_Present,
*/
static int
ProcIDispatch(register ClientPtr client)
ProcIDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data == X_GetExtensionVersion)
@ -305,7 +305,7 @@ ProcIDispatch(register ClientPtr client)
*/
static int
SProcIDispatch(register ClientPtr client)
SProcIDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data == X_GetExtensionVersion)
@ -464,8 +464,8 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
static void
SEventDeviceValuator(deviceValuator * from, deviceValuator * to)
{
register char n;
register int i;
char n;
int i;
INT32 *ip B32;
*to = *from;
@ -480,7 +480,7 @@ SEventDeviceValuator(deviceValuator * from, deviceValuator * to)
static void
SEventFocus(deviceFocus * from, deviceFocus * to)
{
register char n;
char n;
*to = *from;
swaps(&to->sequenceNumber, n);
@ -491,8 +491,8 @@ SEventFocus(deviceFocus * from, deviceFocus * to)
static void
SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to)
{
register int i;
register char n;
int i;
char n;
INT32 *ip B32;
*to = *from;
@ -508,7 +508,7 @@ static void
SDeviceKeyStateNotifyEvent(deviceKeyStateNotify * from,
deviceKeyStateNotify * to)
{
register char n;
char n;
*to = *from;
swaps(&to->sequenceNumber, n);
@ -518,7 +518,7 @@ static void
SDeviceButtonStateNotifyEvent(deviceButtonStateNotify * from,
deviceButtonStateNotify * to)
{
register char n;
char n;
*to = *from;
swaps(&to->sequenceNumber, n);
@ -527,7 +527,7 @@ SDeviceButtonStateNotifyEvent(deviceButtonStateNotify * from,
static void
SChangeDeviceNotifyEvent(changeDeviceNotify * from, changeDeviceNotify * to)
{
register char n;
char n;
*to = *from;
swaps(&to->sequenceNumber, n);
@ -537,7 +537,7 @@ SChangeDeviceNotifyEvent(changeDeviceNotify * from, changeDeviceNotify * to)
static void
SDeviceMappingNotifyEvent(deviceMappingNotify * from, deviceMappingNotify * to)
{
register char n;
char n;
*to = *from;
swaps(&to->sequenceNumber, n);
@ -547,7 +547,7 @@ SDeviceMappingNotifyEvent(deviceMappingNotify * from, deviceMappingNotify * to)
static void
SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to)
{
register char n;
char n;
*to = *from;
swaps(&to->sequenceNumber,n);

View file

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

View file

@ -75,9 +75,9 @@ SOFTWARE.
*/
int
SProcXGetDeviceControl(register ClientPtr client)
SProcXGetDeviceControl(ClientPtr client)
{
register char n;
char n;
REQUEST(xGetDeviceControlReq);
swaps(&stuff->length, n);
@ -96,7 +96,7 @@ static void
CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
int length)
{
register char n;
char n;
AxisInfoPtr a;
xDeviceResolutionState *r;
int i, *iptr;
@ -127,7 +127,7 @@ CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
static void CopySwapDeviceAbsCalib (ClientPtr client, AbsoluteClassPtr dts,
char *buf)
{
register char n;
char n;
xDeviceAbsCalibState *calib = (xDeviceAbsCalibState *) buf;
calib->control = DEVICE_ABS_CALIB;
@ -158,7 +158,7 @@ static void CopySwapDeviceAbsCalib (ClientPtr client, AbsoluteClassPtr dts,
static void CopySwapDeviceAbsArea (ClientPtr client, AbsoluteClassPtr dts,
char *buf)
{
register char n;
char n;
xDeviceAbsAreaState *area = (xDeviceAbsAreaState *) buf;
area->control = DEVICE_ABS_AREA;
@ -184,7 +184,7 @@ static void CopySwapDeviceAbsArea (ClientPtr client, AbsoluteClassPtr dts,
static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
{
register char n;
char n;
xDeviceCoreState *c = (xDeviceCoreState *) buf;
c->control = DEVICE_CORE;
@ -201,7 +201,7 @@ static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
{
register char n;
char n;
xDeviceEnableState *e = (xDeviceEnableState *) buf;
e->control = DEVICE_ENABLE;
@ -225,7 +225,7 @@ static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
void
SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
{
register char n;
char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
@ -243,7 +243,7 @@ ProcXGetDeviceControl(ClientPtr client)
{
int total_length = 0;
char *buf, *savbuf;
register DeviceIntPtr dev;
DeviceIntPtr dev;
xGetDeviceControlReply rep;
REQUEST(xGetDeviceControlReq);

View file

@ -75,9 +75,9 @@ SOFTWARE.
*/
int
SProcXGetFeedbackControl(register ClientPtr client)
SProcXGetFeedbackControl(ClientPtr client)
{
register char n;
char n;
REQUEST(xGetFeedbackControlReq);
swaps(&stuff->length, n);
@ -94,7 +94,7 @@ static void
CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
{
int i;
register char n;
char n;
xKbdFeedbackState *k2;
k2 = (xKbdFeedbackState *) * buf;
@ -128,7 +128,7 @@ CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
static void
CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
{
register char n;
char n;
xPtrFeedbackState *p2;
p2 = (xPtrFeedbackState *) * buf;
@ -156,7 +156,7 @@ CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
static void
CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
{
register char n;
char n;
xIntegerFeedbackState *i2;
i2 = (xIntegerFeedbackState *) * buf;
@ -185,7 +185,7 @@ static void
CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
{
int i;
register char n;
char n;
xStringFeedbackState *s2;
KeySym *kptr;
@ -221,7 +221,7 @@ CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
static void
CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
{
register char n;
char n;
xLedFeedbackState *l2;
l2 = (xLedFeedbackState *) * buf;
@ -247,7 +247,7 @@ CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
static void
CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
{
register char n;
char n;
xBellFeedbackState *b2;
b2 = (xBellFeedbackState *) * buf;
@ -276,7 +276,7 @@ void
SRepXGetFeedbackControl(ClientPtr client, int size,
xGetFeedbackControlReply * rep)
{
register char n;
char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
@ -295,7 +295,7 @@ ProcXGetFeedbackControl(ClientPtr client)
{
int total_length = 0;
char *buf, *savbuf;
register DeviceIntPtr dev;
DeviceIntPtr dev;
KbdFeedbackPtr k;
PtrFeedbackPtr p;
IntegerFeedbackPtr i;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -77,9 +77,9 @@ SOFTWARE.
*/
int
SProcXListInputDevices(register ClientPtr client)
SProcXListInputDevices(ClientPtr client)
{
register char n;
char n;
REQUEST(xListInputDevicesReq);
swaps(&stuff->length, n);
@ -144,9 +144,9 @@ CopyDeviceName(char **namebuf, char *name)
*/
static void
CopySwapButtonClass(register ClientPtr client, ButtonClassPtr b, char **buf)
CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf)
{
register char n;
char n;
xButtonInfoPtr b2;
b2 = (xButtonInfoPtr) * buf;
@ -166,10 +166,10 @@ CopySwapButtonClass(register ClientPtr client, ButtonClassPtr b, char **buf)
*/
static void
CopySwapDevice(register ClientPtr client, DeviceIntPtr d, int num_classes,
CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
char **buf)
{
register char n;
char n;
xDeviceInfoPtr dev;
dev = (xDeviceInfoPtr) * buf;
@ -200,9 +200,9 @@ CopySwapDevice(register ClientPtr client, DeviceIntPtr d, int num_classes,
*/
static void
CopySwapKeyClass(register ClientPtr client, KeyClassPtr k, char **buf)
CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf)
{
register char n;
char n;
xKeyInfoPtr k2;
k2 = (xKeyInfoPtr) * buf;
@ -230,10 +230,10 @@ CopySwapKeyClass(register ClientPtr client, KeyClassPtr k, char **buf)
*/
static int
CopySwapValuatorClass(register ClientPtr client, ValuatorClassPtr v, char **buf)
CopySwapValuatorClass(ClientPtr client, ValuatorClassPtr v, char **buf)
{
int i, j, axes, t_axes;
register char n;
char n;
xValuatorInfoPtr v2;
AxisInfo *a;
xAxisInfoPtr a2;
@ -305,7 +305,7 @@ ListDeviceInfo(ClientPtr client, DeviceIntPtr d, xDeviceInfoPtr dev,
*/
int
ProcXListInputDevices(register ClientPtr client)
ProcXListInputDevices(ClientPtr client)
{
xListInputDevicesReply rep;
int numdevs = 0;
@ -367,7 +367,7 @@ ProcXListInputDevices(register ClientPtr client)
void
SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep)
{
register char n;
char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -168,7 +168,7 @@ OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
*/
int
SetDeviceMode(register ClientPtr client, DeviceIntPtr dev, int mode)
SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode)
{
return BadMatch;
}
@ -186,7 +186,7 @@ SetDeviceMode(register ClientPtr client, DeviceIntPtr dev, int mode)
*/
int
SetDeviceValuators(register ClientPtr client, DeviceIntPtr dev,
SetDeviceValuators(ClientPtr client, DeviceIntPtr dev,
int *valuators, int first_valuator, int num_valuators)
{
return BadMatch;
@ -201,7 +201,7 @@ SetDeviceValuators(register ClientPtr client, DeviceIntPtr dev,
*/
int
ChangeDeviceControl(register ClientPtr client, DeviceIntPtr dev,
ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev,
xDeviceCtl * control)
{
switch (control->control) {
@ -226,7 +226,19 @@ ChangeDeviceControl(register ClientPtr client, DeviceIntPtr dev,
*
*/
int
NewInputDeviceRequest(InputOption *options)
NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev)
{
return BadValue;
}
/****************************************************************************
*
* Caller: configRemoveDevice (and others)
*
* Remove the specified device previously added.
*
*/
void
DeleteInputDeviceRequest(DeviceIntPtr dev)
{
}

View file

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

View file

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

View file

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

View file

@ -92,12 +92,15 @@ configTeardown(void)
}
static int
configAddDevice(DBusMessage *message, DBusMessageIter *iter, DBusError *error)
configAddDevice(DBusMessage *message, DBusMessageIter *iter,
DBusMessage *reply, DBusMessageIter *r_iter,
DBusError *error)
{
DBusMessageIter subiter;
InputOption *tmpo = NULL, *options = NULL;
char *tmp = NULL;
int ret = BadMatch;
DeviceIntPtr dev = NULL;
DebugF("[config] adding device\n");
@ -110,6 +113,11 @@ configAddDevice(DBusMessage *message, DBusMessageIter *iter, DBusError *error)
options->key = xstrdup("_source");
options->value = xstrdup("client/dbus");
if(!options->key || !options->value) {
ErrorF("[config] couldn't allocate first key/value pair\n");
ret = BadAlloc;
goto unwind;
}
while (dbus_message_iter_get_arg_type(iter) == DBUS_TYPE_ARRAY) {
tmpo = (InputOption *) xcalloc(sizeof(InputOption), 1);
@ -118,6 +126,8 @@ configAddDevice(DBusMessage *message, DBusMessageIter *iter, DBusError *error)
ret = BadAlloc;
goto unwind;
}
tmpo->next = options;
options = tmpo;
dbus_message_iter_recurse(iter, &subiter);
@ -132,8 +142,8 @@ configAddDevice(DBusMessage *message, DBusMessageIter *iter, DBusError *error)
tmp);
MALFORMED_MESSAGE();
}
tmpo->key = xstrdup(tmp);
if (!tmpo->key) {
options->key = xstrdup(tmp);
if (!options->key) {
ErrorF("[config] couldn't duplicate key!\n");
ret = BadAlloc;
goto unwind;
@ -148,31 +158,37 @@ configAddDevice(DBusMessage *message, DBusMessageIter *iter, DBusError *error)
dbus_message_iter_get_basic(&subiter, &tmp);
if (!tmp)
MALFORMED_MESSAGE();
tmpo->value = xstrdup(tmp);
if (!tmpo->value) {
options->value = xstrdup(tmp);
if (!options->value) {
ErrorF("[config] couldn't duplicate option!\n");
ret = BadAlloc;
goto unwind;
}
tmpo->next = options;
options = tmpo;
dbus_message_iter_next(iter);
}
ret = NewInputDeviceRequest(options);
if (ret != Success)
ret = NewInputDeviceRequest(options, &dev);
if (ret != Success) {
DebugF("[config] NewInputDeviceRequest failed\n");
goto unwind;
}
return ret;
if (!dev) {
DebugF("[config] NewInputDeviceRequest succeeded, without device\n");
ret = BadMatch;
goto unwind;
}
if (!dbus_message_iter_append_basic(r_iter, DBUS_TYPE_INT32, &(dev->id))) {
ErrorF("[config] couldn't append to iterator\n");
ret = BadAlloc;
goto unwind;
}
unwind:
if (tmpo->key)
xfree(tmpo->key);
if (tmpo->value)
xfree(tmpo->value);
if (tmpo)
xfree(tmpo);
if (dev && ret != Success)
RemoveDevice(dev);
while (options) {
tmpo = options;
@ -212,7 +228,7 @@ configRemoveDevice(DBusMessage *message, DBusMessageIter *iter,
* already been removed. */
OsBlockSignals();
ProcessInputEvents();
RemoveDevice(pDev);
DeleteInputDeviceRequest(pDev);
OsReleaseSignals();
return Success;
@ -221,17 +237,47 @@ unwind:
return ret;
}
static int
configListDevices(DBusMessage *message, DBusMessageIter *iter,
DBusMessage *reply, DBusMessageIter *r_iter,
DBusError *error)
{
DeviceIntPtr d;
int ret = BadMatch;
for (d = inputInfo.devices; d; d = d->next) {
if (!dbus_message_iter_append_basic(r_iter, DBUS_TYPE_INT32,
&(d->id))) {
ErrorF("[config] couldn't append to iterator\n");
ret = BadAlloc;
goto unwind;
}
if (!dbus_message_iter_append_basic(r_iter, DBUS_TYPE_STRING,
&(d->name))) {
ErrorF("[config] couldn't append to iterator\n");
ret = BadAlloc;
goto unwind;
}
}
unwind:
return ret;
}
static DBusHandlerResult
configMessage(DBusConnection *connection, DBusMessage *message, void *closure)
{
DBusMessageIter iter;
DBusError error;
DBusMessage *reply;
DBusMessageIter r_iter;
DBusConnection *bus = closure;
int ret = BadDrawable; /* nonsensical value */
dbus_error_init(&error);
DebugF("[config] received a message\n");
if (strcmp(dbus_message_get_interface(message),
"org.x.config.input") == 0) {
if (!dbus_message_iter_init(message, &iter)) {
@ -240,26 +286,33 @@ configMessage(DBusConnection *connection, DBusMessage *message, void *closure)
return DBUS_HANDLER_RESULT_NEED_MEMORY; /* ?? */
}
if (!(reply = dbus_message_new_method_return(message))) {
ErrorF("[config] failed to create the reply message\n");
dbus_error_free(&error);
return DBUS_HANDLER_RESULT_NEED_MEMORY;
}
dbus_message_iter_init_append(reply, &r_iter);
if (strcmp(dbus_message_get_member(message), "add") == 0)
ret = configAddDevice(message, &iter, &error);
ret = configAddDevice(message, &iter, reply, &r_iter, &error);
else if (strcmp(dbus_message_get_member(message), "remove") == 0)
ret = configRemoveDevice(message, &iter, &error);
else if (strcmp(dbus_message_get_member(message), "listDevices") == 0)
ret = configListDevices(message, &iter, reply, &r_iter, &error);
if (ret != BadDrawable && ret != BadAlloc) {
reply = dbus_message_new_method_return(message);
dbus_message_iter_init_append(reply, &iter);
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret)) {
ErrorF("[config] couldn't append to iterator\n");
dbus_error_free(&error);
return DBUS_HANDLER_RESULT_HANDLED;
}
if (!strlen(dbus_message_get_signature(reply)))
if (!dbus_message_iter_append_basic(&r_iter, DBUS_TYPE_INT32, &ret)) {
ErrorF("[config] couldn't append to iterator\n");
dbus_error_free(&error);
return DBUS_HANDLER_RESULT_HANDLED;
}
if (!dbus_connection_send(bus, reply, NULL))
ErrorF("[config] failed to send reply\n");
dbus_connection_flush(bus);
dbus_message_unref(reply);
}
dbus_message_unref(reply);
dbus_connection_flush(bus);
}
dbus_error_free(&error);
@ -410,13 +463,13 @@ configReconnect(OsTimerPtr timer, CARD32 time, pointer arg)
}
void
configInitialise()
configInitialise(void)
{
TimerSet(NULL, 0, 1, configReconnect, NULL);
}
void
configFini()
configFini(void)
{
DBusError error;

View file

@ -453,9 +453,6 @@ AC_ARG_WITH(os-vendor, AS_HELP_STRING([--with-os-vendor=OSVENDOR], [Name o
AC_ARG_WITH(builderstring, AS_HELP_STRING([--with-builderstring=BUILDERSTRING], [Additional builder string]),
[ BUILDERSTRING="$withval" ]
[ ])
AC_ARG_WITH(mesa-source, AS_HELP_STRING([--with-mesa-source=MESA_SOURCE], [Path to Mesa source tree]),
[ MESA_SOURCE="$withval" ],
[ MESA_SOURCE="" ])
AC_ARG_WITH(fontdir, AS_HELP_STRING([--with-fontdir=FONTDIR], [Path to top level dir where fonts are installed (default: ${libdir}/X11/fonts)]),
[ FONTDIR="$withval" ],
[ FONTDIR="${libdir}/X11/fonts" ])
@ -472,9 +469,6 @@ AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to
AC_ARG_WITH(rgb-path, AS_HELP_STRING([--with-rgb-path=PATH], [Path to RGB database (default: ${datadir}/X11/rgb)]),
[ RGBPATH="$withval" ],
[ RGBPATH="${datadir}/X11/rgb" ])
AC_ARG_WITH(dri-driver-path, AS_HELP_STRING([--with-dri-driver-path=PATH], [Path to DRI drivers (default: ${libdir}/dri)]),
[ DRI_DRIVER_PATH="$withval" ],
[ DRI_DRIVER_PATH="${libdir}/dri" ])
APPLE_APPLICATIONS_DIR="${bindir}/Applications"
AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir=PATH], [Path to the Applications directory (default: ${bindir}/Applications)]),
[ APPLE_APPLICATIONS_DIR="${withval}" ].
@ -494,6 +488,20 @@ AC_ARG_ENABLE(null-root-cursor, AS_HELP_STRING([--enable-null-root-cursor], [Use
[NULL_ROOT_CURSOR=$enableval],
[NULL_ROOT_CURSOR=no])
dnl GLX build options
AC_ARG_WITH(mesa-source, AS_HELP_STRING([--with-mesa-source=MESA_SOURCE], [Path to Mesa source tree]),
[ MESA_SOURCE="$withval" ],
[ MESA_SOURCE="" ])
AC_ARG_WITH(dri-driver-path, AS_HELP_STRING([--with-dri-driver-path=PATH], [Path to DRI drivers (default: ${libdir}/dri)]),
[ DRI_DRIVER_PATH="$withval" ],
[ DRI_DRIVER_PATH="${libdir}/dri" ])
AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]),
[AIGLX=$enableval],
[AIGLX=yes])
AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: disabled)]),
[GLX_USE_TLS=$enableval],
[GLX_USE_TLS=no])
dnl Extensions.
AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes])
AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-shm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes])
@ -508,13 +516,11 @@ AC_ARG_ENABLE(screensaver, AS_HELP_STRING([--disable-screensaver], [Build Scr
AC_ARG_ENABLE(xdmcp, AS_HELP_STRING([--disable-xdmcp], [Build XDMCP extension (default: auto)]), [XDMCP=$enableval], [XDMCP=auto])
AC_ARG_ENABLE(xdm-auth-1, AS_HELP_STRING([--disable-xdm-auth-1], [Build XDM-Auth-1 extension (default: auto)]), [XDMAUTH=$enableval], [XDMAUTH=auto])
AC_ARG_ENABLE(glx, AS_HELP_STRING([--disable-glx], [Build GLX extension (default: enabled)]), [GLX=$enableval], [GLX=yes])
AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]), [AIGLX=$enableval], [AIGLX=yes])
AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: disabled)]), [GLX_USE_TLS=$enableval], [GLX_USE_TLS=no])
AC_ARG_ENABLE(dri, AS_HELP_STRING([--enable-dri], [Build DRI extension (default: auto)]), [DRI=$enableval])
AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--disable-xinerama], [Build Xinerama extension (default: enabled)]), [XINERAMA=$enableval], [XINERAMA=yes])
AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: auto)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=auto])
AC_ARG_ENABLE(xf86misc, AS_HELP_STRING([--disable-xf86misc], [Build XF86Misc extension (default: auto)]), [XF86MISC=$enableval], [XF86MISC=auto])
AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes])
AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes])
AC_ARG_ENABLE(xcsecurity, AS_HELP_STRING([--disable-xcsecurity], [Build Security extension (default: enabled)]), [XCSECURITY=$enableval], [XCSECURITY=$XACE])
AC_ARG_ENABLE(appgroup, AS_HELP_STRING([--disable-appgroup], [Build XC-APPGROUP extension (default: enabled)]), [APPGROUP=$enableval], [APPGROUP=$XCSECURITY])
AC_ARG_ENABLE(xcalibrate, AS_HELP_STRING([--enable-xcalibrate], [Build XCalibrate extension (default: disabled)]), [XCALIBRATE=$enableval], [XCALIBRATE=no])

View file

@ -167,7 +167,7 @@ NameForAtom(Atom atom)
}
void
AtomError()
AtomError(void)
{
FatalError("initializing atoms");
}
@ -185,7 +185,7 @@ FreeAtom(NodePtr patom)
}
void
FreeAllAtoms()
FreeAllAtoms(void)
{
if(atomRoot == (NodePtr)NULL)
return;
@ -197,7 +197,7 @@ FreeAllAtoms()
}
void
InitAtoms()
InitAtoms(void)
{
FreeAllAtoms();
tableLength = InitialTableSize;

View file

@ -86,15 +86,27 @@ DeviceIntPtr
AddInputDevice(DeviceProc deviceProc, Bool autoStart)
{
DeviceIntPtr dev, *prev; /* not a typo */
DeviceIntPtr devtmp;
int devid;
char devind[MAX_DEVICES];
if (inputInfo.numDevices >= MAX_DEVICES)
/* Find next available id */
memset(devind, 0, sizeof(char)*MAX_DEVICES);
for (devtmp = inputInfo.devices; devtmp; devtmp = devtmp->next)
devind[devtmp->id]++;
for (devtmp = inputInfo.off_devices; devtmp; devtmp = devtmp->next)
devind[devtmp->id]++;
for (devid = 0; devid < MAX_DEVICES && devind[devid]; devid++)
;
if (devid >= MAX_DEVICES)
return (DeviceIntPtr)NULL;
dev = (DeviceIntPtr) xcalloc(sizeof(DeviceIntRec), 1);
if (!dev)
return (DeviceIntPtr)NULL;
dev->name = (char *)NULL;
dev->type = 0;
dev->id = inputInfo.numDevices;
dev->id = devid;
inputInfo.numDevices++;
dev->public.on = FALSE;
dev->public.processInputProc = (ProcessInputProc)NoopDDA;
@ -314,7 +326,7 @@ CorePointerProc(DeviceIntPtr pDev, int what)
}
void
InitCoreDevices()
InitCoreDevices(void)
{
DeviceIntPtr dev;
@ -373,7 +385,7 @@ InitCoreDevices()
}
int
InitAndStartDevices()
InitAndStartDevices(void)
{
DeviceIntPtr dev, next;
@ -431,8 +443,13 @@ CloseDevice(DeviceIntPtr dev)
xfree(dev->key);
}
if (dev->valuator)
if (dev->valuator) {
/* Counterpart to 'biggest hack ever' in init. */
if (dev->valuator->motion &&
dev->valuator->GetMotionProc == GetMotionHistory)
xfree(dev->valuator->motion);
xfree(dev->valuator);
}
if (dev->button) {
#ifdef XKB
@ -503,7 +520,7 @@ CloseDevice(DeviceIntPtr dev)
}
void
CloseDownDevices()
CloseDownDevices(void)
{
DeviceIntPtr dev, next;
@ -567,6 +584,7 @@ RemoveDevice(DeviceIntPtr dev)
}
if (ret == Success) {
inputInfo.numDevices--;
ev.type = DevicePresenceNotify;
ev.time = currentTime.milliseconds;
ev.devchange = 0;
@ -580,7 +598,7 @@ RemoveDevice(DeviceIntPtr dev)
}
int
NumMotionEvents()
NumMotionEvents(void)
{
return inputInfo.pointer->valuator->numMotionEvents;
}
@ -598,13 +616,13 @@ RegisterKeyboardDevice(DeviceIntPtr device)
}
_X_EXPORT DevicePtr
LookupKeyboardDevice()
LookupKeyboardDevice(void)
{
return inputInfo.keyboard ? &inputInfo.keyboard->public : NULL;
}
_X_EXPORT DevicePtr
LookupPointerDevice()
LookupPointerDevice(void)
{
return inputInfo.pointer ? &inputInfo.pointer->public : NULL;
}

View file

@ -218,7 +218,7 @@ SetInputCheck(HWEventQueuePtr c0, HWEventQueuePtr c1)
}
_X_EXPORT void
UpdateCurrentTime()
UpdateCurrentTime(void)
{
TimeStamp systime;
@ -237,7 +237,7 @@ UpdateCurrentTime()
/* Like UpdateCurrentTime, but can't call ProcessInputEvents */
_X_EXPORT void
UpdateCurrentTimeIf()
UpdateCurrentTimeIf(void)
{
TimeStamp systime;
@ -250,7 +250,7 @@ UpdateCurrentTimeIf()
}
void
InitSelections()
InitSelections(void)
{
if (CurrentSelections)
xfree(CurrentSelections);
@ -3654,7 +3654,7 @@ CloseDownClient(ClientPtr client)
}
static void
KillAllClients()
KillAllClients(void)
{
int i;
for (i=1; i<currentMaxClients; i++)

View file

@ -1878,7 +1878,7 @@ DeleteClientFontStuff(ClientPtr client)
}
void
InitFonts ()
InitFonts (void)
{
patternCache = MakeFontPatternCache();
@ -1997,7 +1997,7 @@ RegisterFPEFunctions(NameCheckFunc name_func,
}
void
FreeFonts()
FreeFonts(void)
{
if (patternCache) {
FreeFontPatternCache(patternCache);

View file

@ -550,7 +550,7 @@ RemoveBlockAndWakeupHandlers (BlockHandlerProcPtr blockHandler,
}
void
InitBlockAndWakeupHandlers ()
InitBlockAndWakeupHandlers (void)
{
xfree (handlers);
handlers = (BlockHandlerPtr) 0;
@ -950,7 +950,7 @@ DeleteCallbackList(CallbackListPtr *pcbl)
}
void
InitCallbackManager()
InitCallbackManager(void)
{
int i;

View file

@ -107,6 +107,10 @@ of the copyright holder.
******************************************************************/
/** @file
* This file handles event delivery and a big part of the server-side protocol
* handling (the parts for input devices).
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
@ -168,7 +172,9 @@ static xEvent *xeviexE;
#include "dixevents.h"
#include "dixgrabs.h"
#include "dispatch.h"
/**
* Extension events type numbering starts at EXTENSION_EVENT_BASE.
*/
#define EXTENSION_EVENT_BASE 64
#define NoSuchEvent 0x80000000 /* so doesn't match NoEventMask */
@ -214,6 +220,28 @@ _X_EXPORT CallbackListPtr DeviceEventCallback;
Mask DontPropagateMasks[DNPMCOUNT];
static int DontPropagateRefCnts[DNPMCOUNT];
/**
* Main input device struct.
* inputInfo.pointer
* is the core pointer. Referred to as "virtual core pointer", "VCP",
* "core pointer" or inputInfo.pointer. There is exactly one core pointer,
* but multiple devices may send core events. If a device generates core
* events, those events will appear to originate from the core pointer.
*
* inputInfo.keyboard
* is the core keyboard ("virtual core keyboard", "VCK", "core keyboard").
* See inputInfo.pointer.
*
* inputInfo.devices
* linked list containing all devices including VCK and VCP. The VCK will
* always be the first entry, the VCP the second entry in the device list.
*
* inputInfo.off_devices
* Devices that have not been initialized and are thus turned off.
*
* inputInfo.numDevices
* Total number of devices.
*/
_X_EXPORT InputInfo inputInfo;
static struct {
@ -228,12 +256,19 @@ static struct {
* The window trace information is used to avoid having to compute all the
* windows between the root and the current pointer window each time a button
* or key goes down. The grabs on each of those windows must be checked.
*
* @see XYToWindow() for a documentation on how the array is set up.
*/
static WindowPtr *spriteTrace = (WindowPtr *)NULL;
#define ROOT spriteTrace[0]
static int spriteTraceSize = 0;
static int spriteTraceGood;
/**
* DIX sprite information. This is the sprite as seen from the DIX. It does
* not represent the actual sprite rendered to the screen.
*
*/
static struct {
CursorPtr current;
BoxRec hotLimits; /* logical constraints of hot spot */
@ -270,6 +305,9 @@ static WindowPtr XYToWindow(
int y
);
/**
* Max event opcode.
*/
extern int lastEvent;
static Mask lastEventMask;
@ -844,11 +882,18 @@ ConfineCursorToWindow(WindowPtr pWin, Bool generateEvents, Bool confineToScreen)
}
_X_EXPORT Bool
PointerConfinedToScreen()
PointerConfinedToScreen(void)
{
return sprite.confined;
}
/**
* Update the sprite cursor to the given cursor.
*
* ChangeToCursor() will display the new cursor and free the old cursor (if
* applicable). If the provided cursor is already the updated cursor, nothing
* happens.
*/
static void
ChangeToCursor(CursorPtr cursor)
{
@ -873,7 +918,9 @@ ChangeToCursor(CursorPtr cursor)
}
}
/* returns true if b is a descendent of a */
/**
* @returns true if b is a descendent of a
*/
Bool
IsParent(WindowPtr a, WindowPtr b)
{
@ -882,6 +929,11 @@ IsParent(WindowPtr a, WindowPtr b)
return FALSE;
}
/**
* Update the cursor displayed on the screen.
*
* Called whenever a cursor may have changed shape or position.
*/
static void
PostNewCursor(void)
{
@ -912,24 +964,36 @@ PostNewCursor(void)
}
}
/**
* @return root window of current active screen.
*/
_X_EXPORT WindowPtr
GetCurrentRootWindow()
GetCurrentRootWindow(void)
{
return ROOT;
}
/**
* @return window underneath the cursor sprite.
*/
_X_EXPORT WindowPtr
GetSpriteWindow()
GetSpriteWindow(void)
{
return sprite.win;
}
/**
* @return current sprite cursor.
*/
_X_EXPORT CursorPtr
GetSpriteCursor()
GetSpriteCursor(void)
{
return sprite.current;
}
/**
* Set x/y current sprite position in screen coordinates.
*/
_X_EXPORT void
GetSpritePosition(int *px, int *py)
{
@ -939,7 +1003,7 @@ GetSpritePosition(int *px, int *py)
#ifdef PANORAMIX
_X_EXPORT int
XineramaGetCursorScreen()
XineramaGetCursorScreen(void)
{
if(!noPanoramiXExtension) {
return sprite.screen->myNum;
@ -1114,7 +1178,7 @@ FreezeThaw(DeviceIntPtr dev, Bool frozen)
}
void
ComputeFreezes()
ComputeFreezes(void)
{
DeviceIntPtr replayDev = syncEvents.replayDev;
int i;
@ -1231,6 +1295,19 @@ CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, Bool otherMode)
ComputeFreezes();
}
/**
* Activate a pointer grab on the given device. A pointer grab will cause all
* core pointer events to be delivered to the grabbing client only. Can cause
* the cursor to change if a grab cursor is set.
*
* As a pointer grab can only be issued on the core devices, mouse is always
* inputInfo.pointer. Extension devices are set up for ActivateKeyboardGrab().
*
* @param mouse The device to grab.
* @param grab The grab structure, needs to be setup.
* @param autoGrab True if the grab was caused by a button down event and not
* explicitely by a client.
*/
void
ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab,
TimeStamp time, Bool autoGrab)
@ -1259,6 +1336,12 @@ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab,
CheckGrabForSyncs(mouse,(Bool)grab->pointerMode, (Bool)grab->keyboardMode);
}
/**
* Delete grab on given device, update the sprite.
*
* As a pointer grab can only be issued on the core devices, mouse is always
* inputInfo.pointer. Extension devices are set up for ActivateKeyboardGrab().
*/
void
DeactivatePointerGrab(DeviceIntPtr mouse)
{
@ -1283,6 +1366,11 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
ComputeFreezes();
}
/**
* Activate a keyboard grab on the given device.
*
* Extension devices have ActivateKeyboardGrab() set as their grabbing proc.
*/
void
ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool passive)
{
@ -1309,6 +1397,9 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool pass
CheckGrabForSyncs(keybd, (Bool)grab->keyboardMode, (Bool)grab->pointerMode);
}
/**
* Delete keyboard grab for the given device.
*/
void
DeactivateKeyboardGrab(DeviceIntPtr keybd)
{
@ -1441,6 +1532,11 @@ AllowSome(ClientPtr client, TimeStamp time, DeviceIntPtr thisDev, int newState)
}
}
/**
* Server-side protocol handling for AllowEvents request.
*
* Release some events from a frozen device. Only applicable for core devices.
*/
int
ProcAllowEvents(ClientPtr client)
{
@ -1484,6 +1580,9 @@ ProcAllowEvents(ClientPtr client)
return Success;
}
/**
* Deactivate grabs from any device that has been grabbed by the client.
*/
void
ReleaseActiveGrabs(ClientPtr client)
{
@ -1510,6 +1609,30 @@ ReleaseActiveGrabs(ClientPtr client)
* The following procedures deal with delivering events *
**************************************************************************/
/**
* Deliver the given events to the given client.
*
* More than one event may be delivered at a time. This is the case with
* DeviceMotionNotifies which may be followed by DeviceValuator events.
*
* TryClientEvents() is the last station before actually writing the events to
* the socket. Anything that is not filtered here, will get delivered to the
* client.
* An event is only delivered if
* - mask and filter match up.
* - no other client has a grab on the device that caused the event.
*
*
* @param client The target client to deliver to.
* @param pEvents The events to be delivered.
* @param count Number of elements in pEvents.
* @param mask Event mask as set by the window.
* @param filter Mask based on event type.
* @param grab Possible grab on the device that caused the event.
*
* @return 1 if event was delivered, 0 if not or -1 if grab was not set by the
* client.
*/
_X_EXPORT int
TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
Mask filter, GrabPtr grab)
@ -1588,6 +1711,23 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
}
}
/**
* Deliver events to a window. At this point, we do not yet know if the event
* actually needs to be delivered. May activate a grab if the event is a
* button press.
*
* More than one event may be delivered at a time. This is the case with
* DeviceMotionNotifies which may be followed by DeviceValuator events.
*
* @param pWin The window that would get the event.
* @param pEvents The events to be delivered.
* @param count Number of elements in pEvents.
* @param filter Mask based on event type.
* @param grab Possible grab on the device that caused the event.
* @param mskidx Mask index, depending on device that caused event.
*
* @return Number of events delivered to various clients.
*/
int
DeliverEventsToWindow(WindowPtr pWin, xEvent *pEvents, int count,
Mask filter, GrabPtr grab, int mskidx)
@ -1707,6 +1847,15 @@ XineramaTryClientEventsResult(
}
#endif
/**
* Try to deliver events to the interested parties.
*
* @param pWin The window that would get the event.
* @param pEvents The events to be delivered.
* @param count Number of elements in pEvents.
* @param filter Mask based on event type.
* @param dontClient Don't deliver to the dontClient.
*/
int
MaybeDeliverEventsToClient(WindowPtr pWin, xEvent *pEvents,
int count, Mask filter, ClientPtr dontClient)
@ -1744,6 +1893,14 @@ MaybeDeliverEventsToClient(WindowPtr pWin, xEvent *pEvents,
return 2;
}
/**
* Adjust event fields to comply with the window properties.
*
* @param xE Event to be modified in place
* @param pWin The window to get the information from.
* @param child Child window setting for event (if applicable)
* @param calcChild If True, calculate the child window.
*/
static void
FixUpEventFromWindow(
xEvent *xE,
@ -1798,6 +1955,22 @@ FixUpEventFromWindow(
}
}
/**
* Deliver events caused by input devices. Called for all core input events
* and XI events. No filtering of events happens before DeliverDeviceEvents(),
* it will be called for any event that comes out of the event queue.
*
* For all core events, dev is either inputInfo.pointer or inputInfo.keyboard.
* For all extension events, dev is the device that caused the event.
*
* @param pWin Window to deliver event to.
* @param xE Events to deliver.
* @param grab Possible grab on a device.
* @param stopAt Don't recurse up to the root window.
* @param dev The device that is responsible for the event.
* @param count number of events in xE.
*
*/
int
DeliverDeviceEvents(WindowPtr pWin, xEvent *xE, GrabPtr grab,
WindowPtr stopAt, DeviceIntPtr dev, int count)
@ -1861,7 +2034,19 @@ DeliverDeviceEvents(WindowPtr pWin, xEvent *xE, GrabPtr grab,
return 0;
}
/* not useful for events that propagate up the tree or extension events */
/**
* Deliver event to a window and it's immediate parent. Used for most window
* events (CreateNotify, ConfigureNotify, etc.). Not useful for events that
* propagate up the tree or extension events
*
* In case of a ReparentNotify event, the event will be delivered to the
* otherParent as well.
*
* @param pWin Window to deliver events to.
* @param xE Events to deliver.
* @param count number of events in xE.
* @param otherParent Used for ReparentNotify events.
*/
_X_EXPORT int
DeliverEvents(WindowPtr pWin, xEvent *xE, int count,
WindowPtr otherParent)
@ -1926,6 +2111,17 @@ PointInBorderSize(WindowPtr pWin, int x, int y)
return FALSE;
}
/**
* Traversed from the root window to the window at the position x/y. While
* traversing, it sets up the traversal history in the spriteTrace array.
* After completing, the spriteTrace history is set in the following way:
* spriteTrace[0] ... root window
* spriteTrace[1] ... top level window that encloses x/y
* ...
* spriteTrace[spriteTraceGood - 1] ... window at x/y
*
* @returns the window at the given coordinates.
*/
static WindowPtr
XYToWindow(int x, int y)
{
@ -1974,6 +2170,12 @@ XYToWindow(int x, int y)
return spriteTrace[spriteTraceGood-1];
}
/**
* Update the sprite coordinates based on the event. Update the cursor
* position, then update the event with the new coordinates that may have been
* changed. If the window underneath the sprite has changed, change to new
* cursor and send enter/leave events.
*/
static Bool
CheckMotion(xEvent *xE)
{
@ -2046,8 +2248,12 @@ CheckMotion(xEvent *xE)
return TRUE;
}
/**
* Windows have restructured, we need to update the sprite position and the
* sprite's cursor.
*/
_X_EXPORT void
WindowsRestructured()
WindowsRestructured(void)
{
(void) CheckMotion((xEvent *)NULL);
}
@ -2091,6 +2297,10 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff)
}
#endif
/**
* Set the given window to sane values, display the cursor in the center of
* the screen. Called from main() with the root window on the first screen.
*/
void
DefineInitialRootWindow(WindowPtr win)
{
@ -2297,6 +2507,10 @@ XineramaWarpPointer(ClientPtr client)
#endif
/**
* Server-side protocol handling for WarpPointer request.
* Warps the cursor position to the coordinates given in the request.
*/
int
ProcWarpPointer(ClientPtr client)
{
@ -2405,8 +2619,15 @@ BorderSizeNotEmpty(WindowPtr pWin)
return FALSE;
}
/* "CheckPassiveGrabsOnWindow" checks to see if the event passed in causes a
passive grab set on the window to be activated. */
/**
* "CheckPassiveGrabsOnWindow" checks to see if the event passed in causes a
* passive grab set on the window to be activated.
*
* @param pWin The window that may be subject to a passive grab.
* @param device Device that caused the event.
* @param xE List of events (multiple ones for DeviceMotionNotify)
* @count number of elements in xE.
*/
static Bool
CheckPassiveGrabsOnWindow(
@ -2556,6 +2777,16 @@ CheckDeviceGrabs(DeviceIntPtr device, xEvent *xE,
return FALSE;
}
/**
* Called for keyboard events to deliver event to whatever client owns the
* focus. Event is delivered to the keyboard's focus window, the root window
* or to the window owning the input focus.
*
* @param keybd The keyboard originating the event.
* @param xE The event list.
* @param window Window underneath the sprite.
* @param count number of events in xE.
*/
void
DeliverFocusedEvent(DeviceIntPtr keybd, xEvent *xE, WindowPtr window, int count)
{
@ -2584,6 +2815,13 @@ DeliverFocusedEvent(DeviceIntPtr keybd, xEvent *xE, WindowPtr window, int count)
NullGrab, mskidx);
}
/**
* Deliver an event from a device that is currently grabbed. Uses
* DeliverDeviceEvents() for further delivery if a ownerEvents is set on the
* grab. If not, TryClientEvents() is used.
*
* @param deactivateGrab True if the device's grab should be deactivated.
*/
void
DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
Bool deactivateGrab, int count)
@ -2666,6 +2904,17 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
}
}
/**
* Main keyboard event processing function for core keyboard events.
* Updates the events fields from the current pointer state and delivers the
* event.
*
* For key events, xE will always be a single event.
*
* @param xE Event list
* @param keybd The device that caused an event.
* @param count Number of elements in xE.
*/
void
#ifdef XKB
CoreProcessKeyboardEvent (xEvent *xE, DeviceIntPtr keybd, int count)
@ -2861,6 +3110,18 @@ FixKeyState (xEvent *xE, DeviceIntPtr keybd)
}
#endif
/**
* Main pointer event processing function for core pointer events.
* For motion events: update the sprite.
* For all other events: Update the event fields based on the current sprite
* state.
*
* For core pointer events, xE will always be a single event.
*
* @param xE Event list
* @param mouse The device that caused an event.
* @param count Number of elements in xE.
*/
void
#ifdef XKB
CoreProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count)
@ -2974,6 +3235,18 @@ ProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count)
#define AtMostOneClient \
(SubstructureRedirectMask | ResizeRedirectMask | ButtonPressMask)
/**
* Recalculate which events may be deliverable for the given window.
* Recalculated mask is used for quicker determination which events may be
* delivered to a window.
*
* The otherEventMasks on a WindowOptional is the combination of all event
* masks set by all clients on the window.
* deliverableEventMask is the combination of the eventMask and the
* otherEventMask.
*
* Traverses to siblings and parents of the window.
*/
void
RecalculateDeliverableEvents(pWin)
WindowPtr pWin;
@ -3172,6 +3445,9 @@ EventSuppressForWindow(WindowPtr pWin, ClientPtr client,
return Success;
}
/**
* @return The window that is the first ancestor of both a and b.
*/
static WindowPtr
CommonAncestor(
WindowPtr a,
@ -3182,6 +3458,10 @@ CommonAncestor(
return NullWindow;
}
/**
* Assembles an EnterNotify or LeaveNotify and sends it event to the client.
* The core devices are used to fill in the event fields.
*/
static void
EnterLeaveEvent(
int type,
@ -3264,6 +3544,10 @@ EnterLeaveEvent(
}
}
/**
* Send enter notifies to all parent windows up to ancestor.
* This function recurses.
*/
static void
EnterNotifies(WindowPtr ancestor, WindowPtr child, int mode, int detail)
{
@ -3275,6 +3559,11 @@ EnterNotifies(WindowPtr ancestor, WindowPtr child, int mode, int detail)
EnterLeaveEvent(EnterNotify, mode, detail, parent, child->drawable.id);
}
/**
* Send leave notifies to all parent windows up to ancestor.
* This function recurses.
*/
static void
LeaveNotifies(WindowPtr child, WindowPtr ancestor, int mode, int detail)
{
@ -3289,6 +3578,13 @@ LeaveNotifies(WindowPtr child, WindowPtr ancestor, int mode, int detail)
}
}
/**
* Figure out if enter/leave events are necessary and send them to the
* appropriate windows.
*
* @param fromWin Window the sprite moved out of.
* @param toWin Window the sprite moved into.
*/
static void
DoEnterLeaveEvents(WindowPtr fromWin, WindowPtr toWin, int mode)
{
@ -3522,6 +3818,23 @@ DoFocusEvents(DeviceIntPtr dev, WindowPtr fromWin, WindowPtr toWin, int mode)
}
}
/**
* Set the input focus to the given window. Subsequent keyboard events will be
* delivered to the given window.
*
* Usually called from ProcSetInputFocus as result of a client request. If so,
* the device is the inputInfo.keyboard.
* If called from ProcXSetInputFocus as result of a client xinput request, the
* device is set to the device specified by the client.
*
* @param client Client that requested input focus change.
* @param dev Focus device.
* @param focusID The window to obtain the focus. Can be PointerRoot or None.
* @param revertTo Specifies where the focus reverts to when window becomes
* unviewable.
* @param ctime Specifies the time.
* @param followOK True if pointer is allowed to follow the keyboard.
*/
int
SetInputFocus(
ClientPtr client,
@ -3598,6 +3911,11 @@ SetInputFocus(
return Success;
}
/**
* Server-side protocol handling for SetInputFocus request.
*
* Sets the input focus for the virtual core keyboard.
*/
int
ProcSetInputFocus(client)
ClientPtr client;
@ -3613,6 +3931,12 @@ ProcSetInputFocus(client)
stuff->revertTo, stuff->time, FALSE);
}
/**
* Server-side protocol handling for GetInputFocus request.
*
* Sends the current input focus for the virtual core keyboard back to the
* client.
*/
int
ProcGetInputFocus(ClientPtr client)
{
@ -3634,6 +3958,12 @@ ProcGetInputFocus(ClientPtr client)
return Success;
}
/**
* Server-side protocol handling for Grabpointer request.
*
* Sets an active grab on the inputInfo.pointer and returns success status to
* client.
*/
int
ProcGrabPointer(ClientPtr client)
{
@ -3741,6 +4071,14 @@ ProcGrabPointer(ClientPtr client)
return Success;
}
/**
* Server-side protocol handling for ChangeActivePointerGrab request.
*
* Changes properties of the grab hold by the client. If the client does not
* hold an active grab on the device, nothing happens.
*
* Works on the core pointer only.
*/
int
ProcChangeActivePointerGrab(ClientPtr client)
{
@ -3787,6 +4125,11 @@ ProcChangeActivePointerGrab(ClientPtr client)
return Success;
}
/**
* Server-side protocol handling for UngrabPointer request.
*
* Deletes the pointer grab on the core pointer device.
*/
int
ProcUngrabPointer(ClientPtr client)
{
@ -3806,6 +4149,24 @@ ProcUngrabPointer(ClientPtr client)
return Success;
}
/**
* Sets a grab on the given device.
*
* Called from ProcGrabKeyboard to work on the inputInfo.keyboard.
* Called from ProcXGrabDevice to work on the device specified by the client.
*
* The parameters this_mode and other_mode represent the keyboard_mode and
* pointer_mode parameters of XGrabKeyboard().
* See man page for details on all the parameters
*
* @param client Client that owns the grab.
* @param dev The device to grab.
* @param this_mode GrabModeSync or GrabModeAsync
* @param other_mode GrabModeSync or GrabModeAsync
* @param status Return code to be returned to the caller.
*
* @returns Success or BadValue.
*/
int
GrabDevice(ClientPtr client, DeviceIntPtr dev,
unsigned this_mode, unsigned other_mode, Window grabWindow,
@ -3864,6 +4225,11 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
return Success;
}
/**
* Server-side protocol handling for GrabKeyboard request.
*
* Grabs the inputInfo.keyboad and returns success status to client.
*/
int
ProcGrabKeyboard(ClientPtr client)
{
@ -3892,6 +4258,11 @@ ProcGrabKeyboard(ClientPtr client)
return Success;
}
/**
* Server-side protocol handling for UngrabKeyboard request.
*
* Deletes a possible grab on the inputInfo.keyboard.
*/
int
ProcUngrabKeyboard(ClientPtr client)
{
@ -3911,6 +4282,11 @@ ProcUngrabKeyboard(ClientPtr client)
return Success;
}
/**
* Server-side protocol handling for QueryPointer request.
*
* Returns the current state and position of the core pointer to the client.
*/
int
ProcQueryPointer(ClientPtr client)
{
@ -3969,8 +4345,12 @@ ProcQueryPointer(ClientPtr client)
return(Success);
}
/**
* Initializes the device list and the DIX sprite to sane values. Allocates
* trace memory used for quick window traversal.
*/
void
InitEvents()
InitEvents(void)
{
int i;
@ -4030,6 +4410,11 @@ CloseDownEvents(void)
spriteTraceSize = 0;
}
/**
* Server-side protocol handling for SendEvent request.
*
* Locates the window to send the event to and forwards the event.
*/
int
ProcSendEvent(ClientPtr client)
{
@ -4117,6 +4502,12 @@ ProcSendEvent(ClientPtr client)
return Success;
}
/**
* Server-side protocol handling for UngrabKey request.
*
* Deletes a passive grab for the given key. Only works on the
* inputInfo.keyboard.
*/
int
ProcUngrabKey(ClientPtr client)
{
@ -4159,6 +4550,12 @@ ProcUngrabKey(ClientPtr client)
return(Success);
}
/**
* Server-side protocol handling for GrabKey request.
*
* Creates a grab for the inputInfo.keyboard and adds it to the list of
* passive grabs.
*/
int
ProcGrabKey(ClientPtr client)
{
@ -4214,6 +4611,12 @@ ProcGrabKey(ClientPtr client)
}
/**
* Server-side protocol handling for GrabButton request.
*
* Creates a grab for the inputInfo.pointer and adds it as a passive grab to
* the list.
*/
int
ProcGrabButton(ClientPtr client)
{
@ -4287,6 +4690,11 @@ ProcGrabButton(ClientPtr client)
return AddPassiveGrabToList(grab);
}
/**
* Server-side protocol handling for UngrabButton request.
*
* Deletes a passive grab on the inputInfo.pointer from the list.
*/
int
ProcUngrabButton(ClientPtr client)
{
@ -4320,6 +4728,17 @@ ProcUngrabButton(ClientPtr client)
return(Success);
}
/**
* Deactivate any grab that may be on the window, remove the focus.
* Delete any XInput extension events from the window too. Does not change the
* window mask. Use just before the window is deleted.
*
* If freeResources is set, passive grabs on the window are deleted.
*
* @param pWin The window to delete events from.
* @param freeResources True if resources associated with the window should be
* deleted.
*/
void
DeleteWindowFromAnyEvents(WindowPtr pWin, Bool freeResources)
{
@ -4409,7 +4828,9 @@ DeleteWindowFromAnyEvents(WindowPtr pWin, Bool freeResources)
}
/**
* Call this whenever some window at or below pWin has changed geometry
* Call this whenever some window at or below pWin has changed geometry. If
* there is a grab on the window, the cursor will be re-confined into the
* window.
*/
_X_EXPORT void
CheckCursorConfinement(WindowPtr pWin)
@ -4445,6 +4866,9 @@ EventMaskForClient(WindowPtr pWin, ClientPtr client)
return 0;
}
/**
* Server-side protocol handling for RecolorCursor request.
*/
int
ProcRecolorCursor(ClientPtr client)
{
@ -4486,6 +4910,20 @@ ProcRecolorCursor(ClientPtr client)
return (Success);
}
/**
* Write the given events to a client, swapping the byte order if necessary.
* To swap the byte ordering, a callback is called that has to be set up for
* the given event type.
*
* In the case of DeviceMotionNotify trailed by DeviceValuators, the events
* can be more than one. Usually it's just one event.
*
* Do not modify the event structure passed in. See comment below.
*
* @param pClient Client to send events to.
* @param count Number of events.
* @param events The event list.
*/
_X_EXPORT void
WriteEventsToClient(ClientPtr pClient, int count, xEvent *events)
{

View file

@ -278,7 +278,7 @@ MinorOpcodeOfRequest(ClientPtr client)
}
void
CloseDownExtensions()
CloseDownExtensions(void)
{
int i,j;

View file

@ -73,7 +73,7 @@ extern Bool XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies);
* Pick some arbitrary size for Xi motion history.
*/
_X_EXPORT int
GetMotionHistorySize()
GetMotionHistorySize(void)
{
return MOTION_HISTORY_SIZE;
}
@ -183,7 +183,7 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator,
* xEvent *events = xcalloc(sizeof(xEvent), GetMaximumEventsNum());
*/
_X_EXPORT int
GetMaximumEventsNum() {
GetMaximumEventsNum(void) {
/* Two base events -- core and device, plus valuator events. Multiply
* by two if we're doing key repeats. */
int ret = 2 + MAX_VALUATOR_EVENTS;
@ -714,6 +714,7 @@ _X_EXPORT void
SwitchCoreKeyboard(DeviceIntPtr pDev)
{
KeyClassPtr ckeyc = inputInfo.keyboard->key;
int i = 0;
if (inputInfo.keyboard->devPrivates[CoreDevicePrivatesIndex].ptr != pDev) {
memcpy(ckeyc->modifierMap, pDev->key->modifierMap, MAP_LENGTH);
@ -728,6 +729,25 @@ SwitchCoreKeyboard(DeviceIntPtr pDev)
ckeyc->curKeySyms.maxKeyCode = pDev->key->curKeySyms.maxKeyCode;
SetKeySymsMap(&ckeyc->curKeySyms, &pDev->key->curKeySyms);
/*
* Copy state from the extended keyboard to core. If you omit this,
* holding Ctrl on keyboard one, and pressing Q on keyboard two, will
* cause your app to quit. This feels wrong to me, hence the below
* code.
*
* XXX: If you synthesise core modifier events, the state will get
* clobbered here. You'll have to work out something sensible
* to fix that. Good luck.
*/
#define KEYBOARD_MASK (ShiftMask | LockMask | ControlMask | Mod1Mask | \
Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask)
ckeyc->state &= ~(KEYBOARD_MASK);
ckeyc->state |= (pDev->key->state & KEYBOARD_MASK);
#undef KEYBOARD_MASK
for (i = 0; i < 8; i++)
ckeyc->modifierKeyCount[i] = pDev->key->modifierKeyCount[i];
#ifdef XKB
if (!noXkbExtension && pDev->key->xkbInfo && pDev->key->xkbInfo->desc) {
if (!XkbCopyKeymap(pDev->key->xkbInfo->desc, ckeyc->xkbInfo->desc,

View file

@ -11,7 +11,7 @@
#include <X11/Xatom.h>
#include "misc.h"
#include "dix.h"
void MakePredeclaredAtoms()
void MakePredeclaredAtoms(void)
{
if (MakeAtom("PRIMARY", 7, 1) != XA_PRIMARY) AtomError();
if (MakeAtom("SECONDARY", 9, 1) != XA_SECONDARY) AtomError();

View file

@ -544,7 +544,7 @@ static int padlength[4] = {0, 3, 2, 1};
static
#endif
Bool
CreateConnectionBlock()
CreateConnectionBlock(void)
{
xConnSetup setup;
xWindowRoot root;

View file

@ -60,7 +60,7 @@ unsigned *extensionPrivateSizes;
unsigned totalExtensionSize;
void
ResetExtensionPrivates()
ResetExtensionPrivates(void)
{
extensionPrivateCount = 0;
extensionPrivateLen = 0;
@ -71,7 +71,7 @@ ResetExtensionPrivates()
}
_X_EXPORT int
AllocateExtensionPrivateIndex()
AllocateExtensionPrivateIndex(void)
{
return extensionPrivateCount++;
}
@ -117,7 +117,7 @@ unsigned *clientPrivateSizes;
unsigned totalClientSize;
void
ResetClientPrivates()
ResetClientPrivates(void)
{
clientPrivateCount = 0;
clientPrivateLen = 0;
@ -128,7 +128,7 @@ ResetClientPrivates()
}
_X_EXPORT int
AllocateClientPrivateIndex()
AllocateClientPrivateIndex(void)
{
return clientPrivateCount++;
}
@ -171,7 +171,7 @@ AllocateClientPrivate(int index2, unsigned amount)
int screenPrivateCount;
void
ResetScreenPrivates()
ResetScreenPrivates(void)
{
screenPrivateCount = 0;
}
@ -180,7 +180,7 @@ ResetScreenPrivates()
* so we have to worry about resizing existing devPrivates
*/
_X_EXPORT int
AllocateScreenPrivateIndex()
AllocateScreenPrivateIndex(void)
{
int idx;
int i;
@ -213,13 +213,13 @@ AllocateScreenPrivateIndex()
static int windowPrivateCount;
void
ResetWindowPrivates()
ResetWindowPrivates(void)
{
windowPrivateCount = 0;
}
_X_EXPORT int
AllocateWindowPrivateIndex()
AllocateWindowPrivateIndex(void)
{
return windowPrivateCount++;
}
@ -263,13 +263,13 @@ AllocateWindowPrivate(ScreenPtr pScreen, int index2, unsigned amount)
static int gcPrivateCount;
void
ResetGCPrivates()
ResetGCPrivates(void)
{
gcPrivateCount = 0;
}
_X_EXPORT int
AllocateGCPrivateIndex()
AllocateGCPrivateIndex(void)
{
return gcPrivateCount++;
}
@ -312,13 +312,13 @@ AllocateGCPrivate(ScreenPtr pScreen, int index2, unsigned amount)
static int pixmapPrivateCount;
void
ResetPixmapPrivates()
ResetPixmapPrivates(void)
{
pixmapPrivateCount = 0;
}
_X_EXPORT int
AllocatePixmapPrivateIndex()
AllocatePixmapPrivateIndex(void)
{
return pixmapPrivateCount++;
}
@ -363,7 +363,7 @@ AllocatePixmapPrivate(ScreenPtr pScreen, int index2, unsigned amount)
int colormapPrivateCount;
void
ResetColormapPrivates()
ResetColormapPrivates(void)
{
colormapPrivateCount = 0;
}
@ -424,7 +424,7 @@ AllocateColormapPrivateIndex (InitCmapPrivFunc initPrivFunc)
static int devicePrivateIndex = 0;
_X_EXPORT int
AllocateDevicePrivateIndex()
AllocateDevicePrivateIndex(void)
{
return devicePrivateIndex++;
}

View file

@ -235,7 +235,7 @@ CreateNewResourceType(DeleteType deleteFunc)
}
_X_EXPORT RESTYPE
CreateNewResourceClass()
CreateNewResourceClass(void)
{
RESTYPE next = lastResourceClass >> 1;
@ -844,7 +844,7 @@ FreeClientResources(ClientPtr client)
}
void
FreeAllResources()
FreeAllResources(void)
{
int i;

View file

@ -322,6 +322,9 @@ exaPixmapIsOffscreen(PixmapPtr p)
if (p->devPrivate.ptr == NULL)
return TRUE;
if (pExaScr->info->PixmapIsOffscreen)
return pExaScr->info->PixmapIsOffscreen(p);
return ((unsigned long) ((CARD8 *) p->devPrivate.ptr -
(CARD8 *) pExaScr->info->memoryBase) <
pExaScr->info->memorySize);

View file

@ -39,7 +39,7 @@
#include "fb.h"
#define EXA_VERSION_MAJOR 2
#define EXA_VERSION_MINOR 1
#define EXA_VERSION_MINOR 2
#define EXA_VERSION_RELEASE 0
typedef struct _ExaOffscreenArea ExaOffscreenArea;
@ -636,6 +636,23 @@ typedef struct _ExaDriver {
*/
void (*FinishAccess)(PixmapPtr pPix, int index);
/**
* PixmapIsOffscreen() is an optional driver replacement to
* exaPixmapIsOffscreen(). Set to NULL if you want the standard behaviour
* of exaPixmapIsOffscreen().
*
* @param pPix the pixmap
* @return TRUE if the given drawable is in framebuffer memory.
*
* exaPixmapIsOffscreen() is used to determine if a pixmap is in offscreen
* memory, meaning that acceleration could probably be done to it, and that it
* will need to be wrapped by PrepareAccess()/FinishAccess() when accessing it
* with the CPU.
*
*
*/
Bool (*PixmapIsOffscreen)(PixmapPtr pPix);
/** @name PrepareAccess() and FinishAccess() indices
* @{
*/

View file

@ -78,4 +78,4 @@ libwfb_la_SOURCES = $(libfb_la_SOURCES)
libfb_la_LIBADD = libfbmmx.la
EXTRA_DIST = fbcmap.c
EXTRA_DIST = fbcmap.c fbcmap_mi.c

View file

@ -39,7 +39,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "resource.h"
#include "fb.h"
#ifndef XFree86Server
#ifdef XFree86Server
#error "You should be compiling fbcmap_mi.c instead of fbcmap.c!"
#endif
ColormapPtr FbInstalledMaps[MAXSCREENS];
int
@ -584,87 +589,3 @@ fbInitVisuals (VisualPtr *visualp,
*defaultVisp = depth[i].vids[j];
return TRUE;
}
#else
#include "micmap.h"
int
fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
{
return miListInstalledColormaps(pScreen, pmaps);
}
void
fbInstallColormap(ColormapPtr pmap)
{
miInstallColormap(pmap);
}
void
fbUninstallColormap(ColormapPtr pmap)
{
miUninstallColormap(pmap);
}
void
fbResolveColor(unsigned short *pred,
unsigned short *pgreen,
unsigned short *pblue,
VisualPtr pVisual)
{
miResolveColor(pred, pgreen, pblue, pVisual);
}
Bool
fbInitializeColormap(ColormapPtr pmap)
{
return miInitializeColormap(pmap);
}
int
fbExpandDirectColors (ColormapPtr pmap,
int ndef,
xColorItem *indefs,
xColorItem *outdefs)
{
return miExpandDirectColors(pmap, ndef, indefs, outdefs);
}
Bool
fbCreateDefColormap(ScreenPtr pScreen)
{
return miCreateDefColormap(pScreen);
}
void
fbClearVisualTypes(void)
{
miClearVisualTypes();
}
Bool
fbSetVisualTypes (int depth, int visuals, int bitsPerRGB)
{
return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
}
/*
* Given a list of formats for a screen, create a list
* of visuals and depths for the screen which coorespond to
* the set which can be used with this version of fb.
*/
Bool
fbInitVisuals (VisualPtr *visualp,
DepthPtr *depthp,
int *nvisualp,
int *ndepthp,
int *rootDepthp,
VisualID *defaultVisp,
unsigned long sizes,
int bitsPerRGB)
{
return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp,
defaultVisp, sizes, bitsPerRGB, -1);
}
#endif

123
fb/fbcmap_mi.c Normal file
View file

@ -0,0 +1,123 @@
/************************************************************
Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
All Rights Reserved
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright no-
tice appear in all copies and that both that copyright no-
tice and this permission notice appear in supporting docu-
mentation, and that the names of Sun or X Consortium
not be used in advertising or publicity pertaining to
distribution of the software without specific prior
written permission. Sun and X Consortium make no
representations about the suitability of this software for
any purpose. It is provided "as is" without any express or
implied warranty.
SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
/**
* This version of fbcmap.c is implemented in terms of mi functions.
* These functions used to be in fbcmap.c and depended upon the symbol
* XFree86Server being defined.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include "fb.h"
#include "micmap.h"
int
fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
{
return miListInstalledColormaps(pScreen, pmaps);
}
void
fbInstallColormap(ColormapPtr pmap)
{
miInstallColormap(pmap);
}
void
fbUninstallColormap(ColormapPtr pmap)
{
miUninstallColormap(pmap);
}
void
fbResolveColor(unsigned short *pred,
unsigned short *pgreen,
unsigned short *pblue,
VisualPtr pVisual)
{
miResolveColor(pred, pgreen, pblue, pVisual);
}
Bool
fbInitializeColormap(ColormapPtr pmap)
{
return miInitializeColormap(pmap);
}
int
fbExpandDirectColors (ColormapPtr pmap,
int ndef,
xColorItem *indefs,
xColorItem *outdefs)
{
return miExpandDirectColors(pmap, ndef, indefs, outdefs);
}
Bool
fbCreateDefColormap(ScreenPtr pScreen)
{
return miCreateDefColormap(pScreen);
}
void
fbClearVisualTypes(void)
{
miClearVisualTypes();
}
Bool
fbSetVisualTypes (int depth, int visuals, int bitsPerRGB)
{
return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
}
/*
* Given a list of formats for a screen, create a list
* of visuals and depths for the screen which coorespond to
* the set which can be used with this version of fb.
*/
Bool
fbInitVisuals (VisualPtr *visualp,
DepthPtr *depthp,
int *nvisualp,
int *ndepthp,
int *rootDepthp,
VisualID *defaultVisp,
unsigned long sizes,
int bitsPerRGB)
{
return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp,
defaultVisp, sizes, bitsPerRGB, -1);
}

View file

@ -26,12 +26,12 @@ libdarwinShared_a_SOURCES = darwin.c \
bin_PROGRAMS = XDarwin Xquartz
XDarwin_SOURCES = \
$(top_srcdir)/fb/fbcmap.c \
$(top_srcdir)/fb/fbcmap_mi.c \
$(top_srcdir)/mi/miinitext.c \
$(top_srcdir)/Xi/stubs.c
Xquartz_SOURCES = \
$(top_srcdir)/fb/fbcmap.c \
$(top_srcdir)/fb/fbcmap_mi.c \
$(top_srcdir)/mi/miinitext.c \
$(top_srcdir)/Xi/stubs.c \
apple/X11Application.m \
@ -115,7 +115,7 @@ x11app:
cd apple && xcodebuild CFLAGS="$(XSERVERCFLAGS_CFLAGS)" LDFLAGS="$(XSERVERCFLAGS_LIBS)"
XDarwinApp_SOURCES = \
$(top_srcdir)/fb/fbcmap.c \
$(top_srcdir)/fb/fbcmap_mi.c \
$(top_srcdir)/mi/miinitext.c \
$(top_srcdir)/Xi/stubs.c

View file

@ -2,7 +2,6 @@ DIST_SUBDIRS = input config glxProxy examples doc
SUBDIRS = input config examples
bin_PROGRAMS = Xdmx
noinst_LIBRARIES = libfbcmap.a
if XINERAMA
PANORAMIX_SRCS = $(top_srcdir)/Xext/panoramiX.c
@ -26,11 +25,9 @@ AM_CFLAGS = \
$(DIX_CFLAGS) \
$(GLX_INCS) \
$(GLX_DEFS) \
$(DMX_CFLAGS) \
@DMXMODULES_CFLAGS@
libfbcmap_a_SOURCES = libfbcmap.a
libfbcmap_a_CFLAGS = $(AM_CFLAGS) -DXFree86Server
Xdmx_SOURCES = dmx.c \
dmxcb.c \
dmxcb.h \
@ -76,6 +73,7 @@ Xdmx_SOURCES = dmx.c \
dmxwindow.c \
dmxwindow.h \
$(top_srcdir)/mi/miinitext.c \
$(top_srcdir)/fb/fbcmap_mi.c \
$(GLX_SRCS)
@ -89,7 +87,6 @@ Xdmx_LDADD = $(XORG_CORE_LIBS) \
$(GLX_LIBS) \
input/libdmxinput.a \
config/libdmxconfig.a \
libfbcmap.a \
@DMXMODULES_LIBS@
# Man page

View file

@ -130,14 +130,16 @@ static Bool dmxCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
int globalX;
int globalY;
if (screenInfo.numScreens == 1) return FALSE;
if (screenInfo.numScreens == 1)
return FALSE;
/* On current screen? */
dmxScreen = &dmxScreens[(*ppScreen)->myNum];
if (localX >= 0
&& localX < dmxScreen->rootWidth
&& localY >= 0
&& localY < dmxScreen->rootHeight) return FALSE;
&& localY < dmxScreen->rootHeight)
return FALSE;
/* Convert to global coordinate space */
globalX = dmxScreen->rootXOrigin + localX;
@ -162,7 +164,8 @@ static Bool dmxCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
&& globalX < dmxScreen->rootXOrigin + dmxScreen->rootWidth
&& globalY >= dmxScreen->rootYOrigin
&& globalY < dmxScreen->rootYOrigin + dmxScreen->rootHeight) {
if (dmxScreen->index == (*ppScreen)->myNum) return FALSE;
if (dmxScreen->index == (*ppScreen)->myNum)
return FALSE;
*ppScreen = screenInfo.screens[dmxScreen->index];
*x = globalX - dmxScreen->rootXOrigin;
*y = globalY - dmxScreen->rootYOrigin;
@ -179,7 +182,12 @@ static void dmxCrossScreen(ScreenPtr pScreen, Bool entering)
static void dmxWarpCursor(ScreenPtr pScreen, int x, int y)
{
DMXDBG3("dmxWarpCursor(%d,%d,%d)\n", pScreen->myNum, x, y);
#if 11 /*BP*/
/* This call is depracated. Replace with???? */
miPointerWarpCursor(pScreen, x, y);
#else
pScreen->SetCursorPosition(pScreen, x, y, FALSE);
#endif
}
miPointerScreenFuncRec dmxPointerCursorFuncs =
@ -187,7 +195,7 @@ miPointerScreenFuncRec dmxPointerCursorFuncs =
dmxCursorOffScreen,
dmxCrossScreen,
dmxWarpCursor,
dmxeqEnqueue,
dmxeqEnqueue, /*XXX incompatible type/function! */
dmxeqSwitchScreen
};
@ -198,7 +206,8 @@ static int *dmxSLCreate(void)
int *list = malloc(dmxNumScreens * sizeof(*list));
int i;
for (i = 0; i < dmxNumScreens; i++) list[i] = 1;
for (i = 0; i < dmxNumScreens; i++)
list[i] = 1;
return list;
}
@ -212,7 +221,9 @@ static void dmxSLFree(int *list)
static int dmxSLFindNext(int *list)
{
int i;
for (i = 0; i < dmxNumScreens; i++) if (list[i]) return i;
for (i = 0; i < dmxNumScreens; i++)
if (list[i])
return i;
return -1;
}
@ -225,7 +236,8 @@ static int dmxTryComputeScreenOrigins(int *screensLeft)
int changed = 0;
for (i = 0; i < dmxNumScreens; i++) {
if (!screensLeft[i]) continue;
if (!screensLeft[i])
continue;
screen = &dmxScreens[i];
switch (screen->where) {
case PosAbsolute:
@ -235,14 +247,16 @@ static int dmxTryComputeScreenOrigins(int *screensLeft)
break;
case PosRelative:
ref = screen->whereRefScreen;
if (screensLeft[ref]) break;
if (screensLeft[ref])
break;
dixScreenOrigins[i].x = dixScreenOrigins[ref].x + screen->whereX;
dixScreenOrigins[i].y = dixScreenOrigins[ref].y + screen->whereY;
++changed, screensLeft[i] = 0;
break;
case PosRightOf:
ref = screen->whereRefScreen;
if (screensLeft[ref]) break;
if (screensLeft[ref])
break;
pScreen = screenInfo.screens[ref];
dixScreenOrigins[i].x = dixScreenOrigins[ref].x + pScreen->width;
dixScreenOrigins[i].y = dixScreenOrigins[ref].y;
@ -250,7 +264,8 @@ static int dmxTryComputeScreenOrigins(int *screensLeft)
break;
case PosLeftOf:
ref = screen->whereRefScreen;
if (screensLeft[ref]) break;
if (screensLeft[ref])
break;
pScreen = screenInfo.screens[i];
dixScreenOrigins[i].x = dixScreenOrigins[ref].x - pScreen->width;
dixScreenOrigins[i].y = dixScreenOrigins[ref].y;
@ -258,7 +273,8 @@ static int dmxTryComputeScreenOrigins(int *screensLeft)
break;
case PosBelow:
ref = screen->whereRefScreen;
if (screensLeft[ref]) break;
if (screensLeft[ref])
break;
pScreen = screenInfo.screens[ref];
dixScreenOrigins[i].x = dixScreenOrigins[ref].x;
dixScreenOrigins[i].y = dixScreenOrigins[ref].y + pScreen->height;
@ -266,7 +282,8 @@ static int dmxTryComputeScreenOrigins(int *screensLeft)
break;
case PosAbove:
ref = screen->whereRefScreen;
if (screensLeft[ref]) break;
if (screensLeft[ref])
break;
pScreen = screenInfo.screens[i];
dixScreenOrigins[i].x = dixScreenOrigins[ref].x;
dixScreenOrigins[i].y = dixScreenOrigins[ref].y - pScreen->height;
@ -308,8 +325,10 @@ static void dmxComputeScreenOrigins(void)
minX = dixScreenOrigins[0].x;
minY = dixScreenOrigins[0].y;
for (i = 1; i < dmxNumScreens; i++) { /* Compute minX, minY */
if (dixScreenOrigins[i].x < minX) minX = dixScreenOrigins[i].x;
if (dixScreenOrigins[i].y < minY) minY = dixScreenOrigins[i].y;
if (dixScreenOrigins[i].x < minX)
minX = dixScreenOrigins[i].x;
if (dixScreenOrigins[i].y < minY)
minY = dixScreenOrigins[i].y;
}
if (minX || minY) {
for (i = 0; i < dmxNumScreens; i++) {
@ -411,28 +430,36 @@ int dmxOnScreen(int x, int y, DMXScreenInfo *dmxScreen)
static int dmxDoesOverlap(DMXScreenInfo *a, DMXScreenInfo *b)
{
if (dmxOnScreen(a->rootXOrigin,
a->rootYOrigin, b)) return 1;
a->rootYOrigin, b))
return 1;
if (dmxOnScreen(a->rootXOrigin,
a->rootYOrigin + a->scrnWidth, b)) return 1;
a->rootYOrigin + a->scrnWidth, b))
return 1;
if (dmxOnScreen(a->rootXOrigin + a->scrnHeight,
a->rootYOrigin, b)) return 1;
a->rootYOrigin, b))
return 1;
if (dmxOnScreen(a->rootXOrigin + a->scrnHeight,
a->rootYOrigin + a->scrnWidth, b)) return 1;
a->rootYOrigin + a->scrnWidth, b))
return 1;
if (dmxOnScreen(b->rootXOrigin,
b->rootYOrigin, a)) return 1;
b->rootYOrigin, a))
return 1;
if (dmxOnScreen(b->rootXOrigin,
b->rootYOrigin + b->scrnWidth, a)) return 1;
b->rootYOrigin + b->scrnWidth, a))
return 1;
if (dmxOnScreen(b->rootXOrigin + b->scrnHeight,
b->rootYOrigin, a)) return 1;
b->rootYOrigin, a))
return 1;
if (dmxOnScreen(b->rootXOrigin + b->scrnHeight,
b->rootYOrigin + b->scrnWidth, a)) return 1;
b->rootYOrigin + b->scrnWidth, a))
return 1;
return 0;
}
@ -476,7 +503,8 @@ static void *dmxTestSameDisplay(DMXScreenInfo *a, void *closure)
{
DMXScreenInfo *b = closure;
if (a == b) return a;
if (a == b)
return a;
return NULL;
}
@ -489,14 +517,16 @@ void dmxInitOverlap(void)
int i, j;
DMXScreenInfo *a, *b, *pt;
for (i = 0; i < dmxNumScreens; i++) dmxScreens[i].over = NULL;
for (i = 0; i < dmxNumScreens; i++)
dmxScreens[i].over = NULL;
for (i = 0; i < dmxNumScreens; i++) {
a = &dmxScreens[i];
for (j = i+1; j < dmxNumScreens; j++) {
b = &dmxScreens[j];
if (b->over) continue;
if (b->over)
continue;
if (dmxDoesOverlap(a, b)) {
DMXDBG6("%d overlaps %d: a=%p %p b=%p %p\n",
@ -510,7 +540,8 @@ void dmxInitOverlap(void)
for (i = 0; i < dmxNumScreens; i++) {
a = &dmxScreens[i];
if (!a->over) continue;
if (!a->over)
continue;
/* Flag all pairs that are on same display */
for (pt = a->over; pt != a; pt = pt->over) {
@ -521,7 +552,8 @@ void dmxInitOverlap(void)
* screens that mutually overlap on the backend display,
* so we call dmxDoesOverlap, which is stricter than the
* ->over set. */
if (!dmxDoesOverlap(a, pt)) continue;
if (!dmxDoesOverlap(a, pt))
continue;
a->cursorNotShared = 1;
pt->cursorNotShared = 1;
dmxLog(dmxInfo,
@ -731,9 +763,11 @@ static Bool dmxRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
return _dmxRealizeCursor(pScreen, pCursor);
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
if (pt->cursorNotShared) continue;
if (pt->cursorNotShared)
continue;
_dmxRealizeCursor(screenInfo.screens[pt->index], pCursor);
if (pt == start) break;
if (pt == start)
break;
}
return TRUE;
}
@ -747,9 +781,11 @@ static Bool dmxUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
return _dmxUnrealizeCursor(pScreen, pCursor);
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
if (pt->cursorNotShared) continue;
if (pt->cursorNotShared)
continue;
_dmxUnrealizeCursor(screenInfo.screens[pt->index], pCursor);
if (pt == start) break;
if (pt == start)
break;
}
return TRUE;
}
@ -758,10 +794,13 @@ static CursorPtr dmxFindCursor(DMXScreenInfo *start)
{
DMXScreenInfo *pt;
if (!start || !start->over) return GetSpriteCursor();
if (!start || !start->over)
return GetSpriteCursor();
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
if (pt->cursor) return pt->cursor;
if (pt == start) break;
if (pt->cursor)
return pt->cursor;
if (pt == start)
break;
}
return GetSpriteCursor();
}
@ -769,7 +808,12 @@ static CursorPtr dmxFindCursor(DMXScreenInfo *start)
/** Move the cursor to coordinates (\a x, \a y)on \a pScreen. This
* function is usually called via #dmxPointerSpriteFuncs, except during
* reconfiguration when the cursor is repositioned to force an update on
* newley overlapping screens and on screens that no longer overlap. */
* newley overlapping screens and on screens that no longer overlap.
*
* The coords (x,y) are in global coord space. We'll loop over the
* back-end screens and see if they contain the global coord. If so, call
* _dmxMoveCursor() (XWarpPointer) to position the pointer on that screen.
*/
void dmxMoveCursor(ScreenPtr pScreen, int x, int y)
{
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
@ -783,7 +827,8 @@ void dmxMoveCursor(ScreenPtr pScreen, int x, int y)
}
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
if (pt->cursorNotShared) continue;
if (pt->cursorNotShared)
continue;
if (dmxOnScreen(x + start->rootXOrigin, y + start->rootYOrigin, pt)) {
if (/* pt != start && */ !pt->cursorVisible) {
if (!pt->cursor) {
@ -811,7 +856,8 @@ void dmxMoveCursor(ScreenPtr pScreen, int x, int y)
x + start->rootXOrigin - pt->rootXOrigin,
y + start->rootYOrigin - pt->rootYOrigin);
}
if (pt == start) break;
if (pt == start)
break;
}
}
@ -843,7 +889,7 @@ static void dmxSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
gx = start->rootXOrigin + x;
gy = start->rootYOrigin + y;
if (x && y && (GX != gx || GY != gy))
dmxCoreMotion(gx, gy, 0, DMX_NO_BLOCK);
dmxCoreMotion(NULL, gx, gy, 0, DMX_NO_BLOCK);
if (!start->over || !dmxCursorDoMultiCursors || start->cursorNotShared) {
_dmxSetCursor(pScreen, pCursor, x, y);
@ -851,7 +897,8 @@ static void dmxSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
}
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
if (pt->cursorNotShared) continue;
if (pt->cursorNotShared)
continue;
if (dmxOnScreen(x + start->rootXOrigin, y + start->rootYOrigin, pt)) {
_dmxSetCursor(screenInfo.screens[pt->index], pCursor,
x + start->rootXOrigin - pt->rootXOrigin,
@ -861,7 +908,8 @@ static void dmxSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
x + start->rootXOrigin - pt->rootXOrigin,
y + start->rootYOrigin - pt->rootYOrigin);
}
if (pt == start) break;
if (pt == start)
break;
}
}
@ -896,8 +944,13 @@ void dmxCheckCursor(void)
pScreen = screenInfo.screens[dmxScreen->index];
if (!dmxOnScreen(x, y, dmxScreen)) {
#if 00
if (firstScreen && i == miPointerCurrentScreen()->myNum)
miPointerSetNewScreen(firstScreen->index, x, y);
#else
if (firstScreen && i == miPointerGetScreen(inputInfo.pointer)->myNum)
miPointerSetScreen(inputInfo.pointer, firstScreen->index, x, y);
#endif
_dmxSetCursor(pScreen, NULL,
x - dmxScreen->rootXOrigin,
y - dmxScreen->rootYOrigin);

View file

@ -49,6 +49,7 @@
#include "inputstr.h"
#include "input.h"
#include "mi.h"
/** Returns TRUE if the key is a valid modifier. For PC-class
* keyboards, all keys can be used as modifiers, so return TRUE
@ -75,6 +76,8 @@ void InitInput(int argc, char **argv)
dmxLog(dmxWarning, "Use keyboard/mouse pair with the first -input\n");
dmxLog(dmxFatal, "At least one core keyboard/mouse pair required\n");
}
mieqInit();
}
/** Called from dix/dispatch.c in Dispatch() whenever input events

View file

@ -154,7 +154,7 @@ typedef enum {
extern void dmxGetGlobalPosition(int *x, int *y);
extern DMXScreenInfo *dmxFindFirstScreen(int x, int y);
extern void dmxCoreMotion(int x, int y, int delta,
extern void dmxCoreMotion(DevicePtr pDev, int x, int y, int delta,
DMXBlockType block);
/* Support for dynamic addition of inputs. This functions is defined in

View file

@ -242,7 +242,7 @@ static int dmxBackendOffscreen(int screen, int x, int y)
void dmxBackendUpdatePosition(pointer private, int x, int y)
{
GETPRIVFROMPRIVATE;
int screen = miPointerCurrentScreen()->myNum;
int screen = miPointerGetScreen(inputInfo.pointer)->myNum;
DMXScreenInfo *dmxScreen = &dmxScreens[priv->myScreen];
int oldRelative = priv->relative;
int topscreen = dmxBackendFindOverlapping(priv, screen, x, y);
@ -354,7 +354,8 @@ void dmxBackendCollectEvents(DevicePtr pDev,
switch (X.type) {
case EnterNotify:
dmxCommonSaveState(priv);
if (entered++) continue;
if (entered++)
continue;
priv->entered = 1;
ignoreLeave = 1;
DMXDBG5("dmxBackendCollectEvents: Enter %lu %d,%d; GRAB %s %p\n",
@ -378,7 +379,8 @@ void dmxBackendCollectEvents(DevicePtr pDev,
continue;
}
dmxCommonRestoreState(priv);
if (left++) continue;
if (left++)
continue;
DMXDBG7("dmxBackendCollectEvents: Leave %lu %d,%d %d %d %s %s\n",
X.xcrossing.root, X.xcrossing.x, X.xcrossing.y,
X.xcrossing.detail, X.xcrossing.focus,
@ -398,7 +400,8 @@ void dmxBackendCollectEvents(DevicePtr pDev,
priv->newscreen,
X.xmotion.x, X.xmotion.y,
entered, priv->lastX, priv->lastY);
if (dmxBackendPendingMotionEvent(priv, TRUE)) continue;
if (dmxBackendPendingMotionEvent(priv, TRUE))
continue;
if (!(dmxScreen = dmxBackendFindWindow(priv, X.xmotion.window)))
dmxLog(dmxFatal,
" Event on non-existant window %lu\n",
@ -449,6 +452,9 @@ void dmxBackendCollectEvents(DevicePtr pDev,
case KeyRelease:
enqueue(priv->kbd, X.type, X.xkey.keycode, 0, NULL, block);
break;
case ButtonPress:
case ButtonRelease:
/* fall-through */
default:
/* Pass the whole event here, because
* this may be an extension event. */
@ -571,12 +577,16 @@ void dmxBackendInit(DevicePtr pDev)
/** Get information about the backend pointer (for initialization). */
void dmxBackendMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
const DMXScreenInfo *dmxScreen = dmxBackendInitPrivate(pDev);
info->buttonClass = 1;
dmxCommonMouGetMap(pDev, info->map, &info->numButtons);
info->valuatorClass = 1;
info->numRelAxes = 2;
info->minval[0] = 0;
info->maxval[0] = 0;
info->minval[1] = 0;
info->maxval[0] = dmxScreen->beWidth;
info->maxval[1] = dmxScreen->beHeight;
info->res[0] = 1;
info->minres[0] = 0;
info->maxres[0] = 1;

View file

@ -241,13 +241,15 @@ void dmxCommonKbdGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
/* Compute pModMap */
modifier_mapping = XGetModifierMapping(priv->display);
for (i = 0; i < MAP_LENGTH; i++) pModMap[i] = 0;
for (i = 0; i < MAP_LENGTH; i++)
pModMap[i] = 0;
for (j = 0; j < 8; j++) {
int max_keypermod = modifier_mapping->max_keypermod;
for (i = 0; i < max_keypermod; i++) {
CARD8 keycode = modifier_mapping->modifiermap[j*max_keypermod + i];
if (keycode) pModMap[keycode] |= 1 << j;
if (keycode)
pModMap[keycode] |= 1 << j;
}
}
XFreeModifiermap(modifier_mapping);
@ -611,6 +613,7 @@ void dmxCommonSaveState(pointer private)
&priv->dmxLocal->kctrl);
priv->savedModMap = XGetModifierMapping(priv->display);
modmap = XNewModifiermap(0);
XSetModifierMapping(priv->display, modmap);
if (dmxInput->scrnIdx != -1)
@ -627,8 +630,10 @@ void dmxCommonRestoreState(pointer private)
int retcode = -1;
CARD32 start;
if (dmxInput->console) priv = dmxInput->devs[0]->private;
if (!priv->stateSaved) return;
if (dmxInput->console)
priv = dmxInput->devs[0]->private;
if (!priv->stateSaved)
return;
priv->stateSaved = 0;
DMXDBG0("dmxCommonRestoreState\n");
@ -645,7 +650,8 @@ void dmxCommonRestoreState(pointer private)
CARD32 tmp;
retcode = XSetModifierMapping(priv->display, priv->savedModMap);
if (retcode == MappingSuccess) break;
if (retcode == MappingSuccess)
break;
if (retcode == MappingBusy)
dmxLogInput(dmxInput, "Keyboard busy, waiting\n");
else

View file

@ -860,12 +860,17 @@ void dmxConsoleInit(DevicePtr pDev)
* for pointers. */
void dmxConsoleMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
GETPRIVFROMPDEV;
info->buttonClass = 1;
dmxCommonMouGetMap(pDev, info->map, &info->numButtons);
info->valuatorClass = 1;
info->numRelAxes = 2;
info->minval[0] = 0;
info->maxval[0] = 0;
info->minval[0] = 0;
info->minval[1] = 0;
/* max possible console window size: */
info->maxval[0] = DisplayWidth(priv->display, DefaultScreen(priv->display));
info->maxval[1] = DisplayHeight(priv->display, DefaultScreen(priv->display));
info->res[0] = 1;
info->minres[0] = 0;
info->maxres[0] = 1;

View file

@ -79,7 +79,9 @@ void dmxDummyMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
info->valuatorClass = 1;
info->numRelAxes = 2;
info->minval[0] = 0;
info->minval[1] = 0;
info->maxval[0] = 0;
info->maxval[1] = 0;
info->res[0] = 1;
info->minres[0] = 0;
info->maxres[0] = 1;

View file

@ -56,6 +56,7 @@
#include "opaque.h"
#include "inputstr.h"
#include "mipointer.h"
#include "mi.h"
#ifdef XINPUT
#include "XIstubs.h"
@ -102,7 +103,25 @@ static int dmxCheckFunctionKeys(DMXLocalInputInfoPtr dmxLocal,
{
DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
unsigned short state = 0;
#if 1 /* hack to detect ctrl-alt-q, etc */
static int ctrl = 0, alt = 0;
/* keep track of ctrl/alt key status */
if (type == KeyPress && keySym == 0xffe3) {
ctrl = 1;
}
else if (type == KeyRelease && keySym == 0xffe3) {
ctrl = 0;
}
else if (type == KeyPress && keySym == 0xffe9) {
alt = 1;
}
else if (type == KeyRelease && keySym == 0xffe9) {
alt = 0;
}
if (!ctrl || !alt)
return 0;
#else
if (dmxLocal->sendsCore)
state = dmxLocalCoreKeyboard->pDevice->key->state;
else if (dmxLocal->pDevice->key)
@ -111,7 +130,9 @@ static int dmxCheckFunctionKeys(DMXLocalInputInfoPtr dmxLocal,
DMXDBG3("dmxCheckFunctionKeys: keySym=0x%04x %s state=0x%04x\n",
keySym, type == KeyPress ? "press" : "release", state);
if ((state & (ControlMask|Mod1Mask)) != (ControlMask|Mod1Mask)) return 0;
if ((state & (ControlMask|Mod1Mask)) != (ControlMask|Mod1Mask))
return 0;
#endif
switch (keySym) {
case XK_g:
@ -146,16 +167,25 @@ static void dmxEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, xEvent *e,
int type = e->u.u.type;
switch (e->u.u.type) {
case KeyPress: type = DeviceKeyPress; break;
case KeyRelease: type = DeviceKeyRelease; break;
case ButtonPress: type = DeviceButtonPress; break;
case ButtonRelease: type = DeviceButtonRelease; break;
case KeyPress:
type = DeviceKeyPress;
break;
case KeyRelease:
type = DeviceKeyRelease;
break;
case ButtonPress:
type = DeviceButtonPress;
break;
case ButtonRelease:
type = DeviceButtonRelease;
break;
case MotionNotify:
dmxLog(dmxError,
"dmxEnqueueExtEvent: MotionNotify not allowed here\n");
return;
default:
if (e->u.u.type == ProximityIn || e->u.u.type == ProximityOut) break;
if (e->u.u.type == ProximityIn || e->u.u.type == ProximityOut)
break;
dmxLogInput(dmxInput,
"dmxEnqueueExtEvent: Unhandled %s event (%d)\n",
e->u.u.type >= LASTEvent ? "extension" : "non-extension",
@ -173,9 +203,11 @@ static void dmxEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, xEvent *e,
xv->num_valuators = 0;
xv->first_valuator = 0;
if (block) dmxSigioBlock();
if (block)
dmxSigioBlock();
dmxeqEnqueue(xE);
if (block) dmxSigioUnblock();
if (block)
dmxSigioUnblock();
}
#endif
@ -185,12 +217,36 @@ DMXScreenInfo *dmxFindFirstScreen(int x, int y)
for (i = 0; i < dmxNumScreens; i++) {
DMXScreenInfo *dmxScreen = &dmxScreens[i];
if (dmxOnScreen(x, y, dmxScreen)) return dmxScreen;
if (dmxOnScreen(x, y, dmxScreen))
return dmxScreen;
}
return NULL;
}
void dmxCoreMotion(int x, int y, int delta, DMXBlockType block)
/**
* Enqueue a motion event.
*/
static void enqueueMotion(DevicePtr pDev, int x, int y)
{
GETDMXLOCALFROMPDEV;
DeviceIntPtr p = dmxLocal->pDevice;
int i, nevents, valuators[3];
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
int detail = 0; /* XXX should this be mask of pressed buttons? */
valuators[0] = x;
valuators[1] = y;
nevents = GetPointerEvents(events, p, MotionNotify, detail,
POINTER_ABSOLUTE, 0, 2, valuators);
for (i = 0; i < nevents; i++)
mieqEnqueue(p, events + i);
xfree(events);
return;
}
void
dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
{
DMXScreenInfo *dmxScreen;
DMXInputInfo *dmxInput;
@ -199,7 +255,8 @@ void dmxCoreMotion(int x, int y, int delta, DMXBlockType block)
int localY;
int i;
if (!dmxGlobalInvalid && dmxGlobalX == x && dmxGlobalY == y) return;
if (!dmxGlobalInvalid && dmxGlobalX == x && dmxGlobalY == y)
return;
DMXDBG5("dmxCoreMotion(%d,%d,%d) dmxGlobalX=%d dmxGlobalY=%d\n",
x, y, delta, dmxGlobalX, dmxGlobalY);
@ -208,47 +265,61 @@ void dmxCoreMotion(int x, int y, int delta, DMXBlockType block)
dmxGlobalX = x;
dmxGlobalY = y;
if (dmxGlobalX < 0) dmxGlobalX = 0;
if (dmxGlobalY < 0) dmxGlobalY = 0;
if (dmxGlobalX >= dmxGlobalWidth) dmxGlobalX = dmxGlobalWidth + delta -1;
if (dmxGlobalY >= dmxGlobalHeight) dmxGlobalY = dmxGlobalHeight + delta -1;
if (dmxGlobalX < 0)
dmxGlobalX = 0;
if (dmxGlobalY < 0)
dmxGlobalY = 0;
if (dmxGlobalX >= dmxGlobalWidth)
dmxGlobalX = dmxGlobalWidth + delta -1;
if (dmxGlobalY >= dmxGlobalHeight)
dmxGlobalY = dmxGlobalHeight + delta -1;
if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) {
localX = dmxGlobalX - dmxScreen->rootXOrigin;
localY = dmxGlobalY - dmxScreen->rootYOrigin;
if ((pScreen = miPointerCurrentScreen())
if ((pScreen = miPointerGetScreen(inputInfo.pointer))
&& pScreen->myNum == dmxScreen->index) {
/* Screen is old screen */
if (block) dmxSigioBlock();
miPointerAbsoluteCursor(localX, localY, GetTimeInMillis());
if (block) dmxSigioUnblock();
if (block)
dmxSigioBlock();
if (pDev)
enqueueMotion(pDev, localX, localY);
if (block)
dmxSigioUnblock();
} else {
/* Screen is new */
DMXDBG4(" New screen: old=%d new=%d localX=%d localY=%d\n",
pScreen->myNum, dmxScreen->index, localX, localY);
if (block) dmxSigioBlock();
if (block)
dmxSigioBlock();
dmxeqProcessInputEvents();
miPointerSetNewScreen(dmxScreen->index, localX, localY);
miPointerAbsoluteCursor(localX, localY, GetTimeInMillis());
if (block) dmxSigioUnblock();
miPointerSetScreen(inputInfo.pointer, dmxScreen->index,
localX, localY);
if (pDev)
enqueueMotion(pDev, localX, localY);
if (block)
dmxSigioUnblock();
}
miPointerPosition(&localX, &localY);
#if 00
miPointerGetPosition(inputInfo.pointer, &localX, &localY);
if ((pScreen = miPointerCurrentScreen())) {
if ((pScreen = miPointerGetScreen(inputInfo.pointer))) {
dmxGlobalX = localX + dmxScreens[pScreen->myNum].rootXOrigin;
dmxGlobalY = localY + dmxScreens[pScreen->myNum].rootYOrigin;
ErrorF("Global is now %d, %d %d, %d\n", dmxGlobalX, dmxGlobalY,
localX, localY);
DMXDBG6(" Moved to dmxGlobalX=%d dmxGlobalY=%d"
" on screen index=%d/%d localX=%d localY=%d\n",
dmxGlobalX, dmxGlobalY,
dmxScreen ? dmxScreen->index : -1, pScreen->myNum,
localX, localY);
}
#endif
}
/* Send updates down to all core input
* drivers */
for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) {
int j;
for (j = 0; j < dmxInput->numDevs; j += dmxInput->devs[j]->binding)
if (!dmxInput->detached
&& dmxInput->devs[j]->sendsCore
@ -259,6 +330,8 @@ void dmxCoreMotion(int x, int y, int delta, DMXBlockType block)
if (!dmxScreen) ProcessInputEvents();
}
#ifdef XINPUT
#define DMX_MAX_AXES 32 /* Max axes reported by this routine */
static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
@ -349,10 +422,12 @@ static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
}
}
if (block) dmxSigioBlock();
if (block)
dmxSigioBlock();
dmxPointerPutMotionEvent(pDevice, firstAxis, axesCount, v, xev->time);
dmxeqEnqueue(xE);
if (block) dmxSigioUnblock();
if (block)
dmxSigioUnblock();
}
static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
@ -366,7 +441,8 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
XDeviceKeyEvent *ke = (XDeviceKeyEvent *)e;
XDeviceMotionEvent *me = (XDeviceMotionEvent *)e;
if (!e) return -1; /* No extended event passed, cannot handle */
if (!e)
return -1; /* No extended event passed, cannot handle */
if ((XID)dmxLocal->deviceId != ke->deviceid) {
/* Search for the correct dmxLocal,
@ -377,7 +453,8 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
for (i = 0; i < dmxInput->numDevs; i++) {
dmxLocal = dmxInput->devs[i];
if ((XID)dmxLocal->deviceId == ke->deviceid) break;
if ((XID)dmxLocal->deviceId == ke->deviceid)
break;
}
}
@ -426,9 +503,11 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
xv->valuator4 = ke->axis_data[4];
xv->valuator5 = ke->axis_data[5];
if (block) dmxSigioBlock();
if (block)
dmxSigioBlock();
dmxeqEnqueue(xE);
if (block) dmxSigioUnblock();
if (block)
dmxSigioUnblock();
break;
case XI_DeviceMotionNotify:
@ -508,12 +587,18 @@ void dmxMotion(DevicePtr pDev, int *v, int firstAxes, int axesCount,
return;
}
#endif
if (axesCount == 2) switch (type) {
case DMX_RELATIVE: dmxCoreMotion(dmxGlobalX - v[0],
dmxGlobalY - v[1],
0, block); break;
case DMX_ABSOLUTE: dmxCoreMotion(v[0], v[1], 0, block); break;
case DMX_ABSOLUTE_CONFINED: dmxCoreMotion(v[0], v[1], -1, block); break;
if (axesCount == 2) {
switch (type) {
case DMX_RELATIVE:
dmxCoreMotion(pDev, dmxGlobalX - v[0], dmxGlobalY - v[1], 0, block);
break;
case DMX_ABSOLUTE:
dmxCoreMotion(pDev, v[0], v[1], 0, block);
break;
case DMX_ABSOLUTE_CONFINED:
dmxCoreMotion(pDev, v[0], v[1], -1, block);
break;
}
}
}
@ -525,7 +610,8 @@ static KeySym dmxKeyCodeToKeySym(DMXLocalInputInfoPtr dmxLocal,
if (!dmxLocal || !dmxLocal->pDevice || !dmxLocal->pDevice->key)
return NoSymbol;
pKeySyms = &dmxLocal->pDevice->key->curKeySyms;
if (!pKeySyms) return NoSymbol;
if (!pKeySyms)
return NoSymbol;
if (keyCode > pKeySyms->minKeyCode && keyCode <= pKeySyms->maxKeyCode) {
DMXDBG2("dmxKeyCodeToKeySym: Translated keyCode=%d to keySym=0x%04x\n",
@ -574,14 +660,16 @@ static int dmxFixup(DevicePtr pDev, int detail, KeySym keySym)
dmxLocal->pDevice->name);
return NoSymbol;
}
if (!keySym) keySym = dmxKeyCodeToKeySym(dmxLocal, detail);
if (keySym == NoSymbol) return detail;
if (!keySym)
keySym = dmxKeyCodeToKeySym(dmxLocal, detail);
if (keySym == NoSymbol)
return detail;
keyCode = dmxKeySymToKeyCode(dmxLocalCoreKeyboard, keySym, detail);
return keyCode ? keyCode : detail;
}
/** Enqueue a non-motion event from the \a pDev device with the
/** Enqueue an event from the \a pDev device with the
* specified \a type and \a detail. If the event is a KeyPress or
* KeyRelease event, then the \a keySym is also specified.
*
@ -593,29 +681,56 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
{
GETDMXINPUTFROMPDEV;
xEvent xE;
DeviceIntPtr p = dmxLocal->pDevice;
int i, nevents, valuators[3];
xEvent *events;
DMXDBG2("dmxEnqueue: Enqueuing type=%d detail=0x%0x\n", type, detail);
switch (type) {
case KeyPress:
case KeyRelease:
if (!keySym) keySym = dmxKeyCodeToKeySym(dmxLocal, detail);
if (!keySym)
keySym = dmxKeyCodeToKeySym(dmxLocal, detail);
if (dmxCheckFunctionKeys(dmxLocal, type, keySym))
return;
if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard)
xE.u.u.detail = dmxFixup(pDev, detail, keySym);
break;
events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
/*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/
nevents = GetKeyboardEvents(events, p, type, detail);
for (i = 0; i < nevents; i++)
mieqEnqueue(p, events + i);
xfree(events);
return;
case ButtonPress:
case ButtonRelease:
detail = dmxGetButtonMapping(dmxLocal, detail);
break;
events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
nevents = GetPointerEvents(events, p, type, detail,
POINTER_ABSOLUTE,
0, /* first_valuator = 0 */
0, /* num_valuators = 0 */
valuators);
for (i = 0; i < nevents; i++)
mieqEnqueue(p, events + i);
xfree(events);
return;
case MotionNotify:
/* All MotionNotify events should be sent via dmxCoreMotion and
* dmxExtMotion -- no input driver should build motion events by
* hand. */
dmxLog(dmxError, "dmxEnqueueXEvent: MotionNotify not allowed here\n");
break;
/* Always ignore these events */
events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
valuators[0] = e->xmotion.x;
valuators[1] = e->xmotion.y;
valuators[2] = e->xmotion.state;
nevents = GetPointerEvents(events, p, type, detail,
POINTER_ABSOLUTE, 0, 3, valuators);
for (i = 0; i < nevents; i++)
mieqEnqueue(p, events + i);
xfree(events);
return;
case EnterNotify:
case LeaveNotify:
case KeymapNotify:
@ -627,7 +742,8 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
default:
#ifdef XINPUT
if (type == ProximityIn || type == ProximityOut) {
if (dmxLocal->sendsCore) return; /* Not a core event */
if (dmxLocal->sendsCore)
return; /* Not a core event */
break;
}
#endif
@ -643,16 +759,19 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
return;
}
#if 00 /* dead code? */
memset(&xE, 0, sizeof(xE));
xE.u.u.type = type;
xE.u.u.detail = detail;
xE.u.keyButtonPointer.time = GetTimeInMillis();
#ifdef XINPUT
if (!dmxLocal->sendsCore) dmxEnqueueExtEvent(dmxLocal, &xE, block);
if (!dmxLocal->sendsCore)
dmxEnqueueExtEvent(dmxLocal, &xE, block);
else
#endif
dmxeqEnqueue(&xE);
#endif /*00*/
}
/** A pointer to this routine is passed to low-level input drivers so

View file

@ -72,6 +72,7 @@
#include "input.h"
#include "mipointer.h"
#include "windowstr.h"
#include "mi.h"
#ifdef XINPUT
#include <X11/extensions/XI.h>
@ -222,6 +223,57 @@ static DMXLocalInputInfoRec DMXLocalDevices[] = {
{ NULL } /* Must be last */
};
#if 11 /*BP*/
void
DDXRingBell(int volume, int pitch, int duration)
{
/* NO-OP */
}
/* taken from kdrive/src/kinput.c: */
static void
dmxKbdCtrl (DeviceIntPtr pDevice, KeybdCtrl *ctrl)
{
#if 0
KdKeyboardInfo *ki;
for (ki = kdKeyboards; ki; ki = ki->next) {
if (ki->dixdev && ki->dixdev->id == pDevice->id)
break;
}
if (!ki || !ki->dixdev || ki->dixdev->id != pDevice->id || !ki->driver)
return;
KdSetLeds(ki, ctrl->leds);
ki->bellPitch = ctrl->bell_pitch;
ki->bellDuration = ctrl->bell_duration;
#endif
}
/* taken from kdrive/src/kinput.c: */
static void
dmxBell(int volume, DeviceIntPtr pDev, pointer arg, int something)
{
#if 0
KeybdCtrl *ctrl = arg;
KdKeyboardInfo *ki = NULL;
for (ki = kdKeyboards; ki; ki = ki->next) {
if (ki->dixdev && ki->dixdev->id == pDev->id)
break;
}
if (!ki || !ki->dixdev || ki->dixdev->id != pDev->id || !ki->driver)
return;
KdRingBell(ki, volume, ctrl->bell_pitch, ctrl->bell_duration);
#endif
}
#endif /*BP*/
static void _dmxChangePointerControl(DMXLocalInputInfoPtr dmxLocal,
PtrCtrl *ctrl)
{
@ -420,14 +472,24 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
memset(&info, 0, sizeof(info));
switch (what) {
case DEVICE_INIT:
if (dmxLocal->init) dmxLocal->init(pDev);
if (dmxLocal->get_info) dmxLocal->get_info(pDev, &info);
if (dmxLocal->init)
dmxLocal->init(pDev);
if (dmxLocal->get_info)
dmxLocal->get_info(pDev, &info);
if (info.keyboard) { /* XKEYBOARD makes this a special case */
dmxKeyboardOn(pDevice, &info);
break;
}
if (info.keyClass) {
#if 00 /*BP*/
InitKeyClassDeviceStruct(pDevice, &info.keySyms, info.modMap);
#else
DevicePtr pDev = (DevicePtr) pDevice;
InitKeyboardDeviceStruct(pDev,
&info.keySyms,
info.modMap,
dmxBell, dmxKbdCtrl);
#endif
}
if (info.buttonClass) {
InitButtonClassDeviceStruct(pDevice, info.numButtons, info.map);
@ -435,8 +497,13 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
if (info.valuatorClass) {
if (info.numRelAxes && dmxLocal->sendsCore) {
InitValuatorClassDeviceStruct(pDevice, info.numRelAxes,
#if 00 /*BP*/
miPointerGetMotionEvents,
miPointerGetMotionBufferSize(),
#else
GetMotionHistory,
GetMaximumEventsNum(),
#endif
Relative);
#ifdef XINPUT
for (i = 0; i < info.numRelAxes; i++)
@ -521,11 +588,22 @@ static void dmxProcessInputEvents(DMXInputInfo *dmxInput)
int i;
dmxeqProcessInputEvents();
#if 00 /*BP*/
miPointerUpdate();
if (dmxInput->detached) return;
#endif
if (dmxInput->detached)
return;
for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
if (dmxInput->devs[i]->process_input)
if (dmxInput->devs[i]->process_input) {
#if 11 /*BP*/
miPointerUpdateSprite(dmxInput->devs[i]->pDevice);
#endif
dmxInput->devs[i]->process_input(dmxInput->devs[i]->private);
}
#if 11 /*BP*/
mieqProcessInputEvents();
#endif
}
static void dmxUpdateWindowInformation(DMXInputInfo *dmxInput,
@ -553,7 +631,8 @@ static void dmxUpdateWindowInformation(DMXInputInfo *dmxInput,
}
#endif
if (dmxInput->detached) return;
if (dmxInput->detached)
return;
for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
if (dmxInput->devs[i]->update_info)
dmxInput->devs[i]->update_info(dmxInput->devs[i]->private,
@ -564,7 +643,8 @@ static void dmxCollectAll(DMXInputInfo *dmxInput)
{
int i;
if (dmxInput->detached) return;
if (dmxInput->detached)
return;
for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
if (dmxInput->devs[i]->collect_events)
dmxInput->devs[i]->collect_events(&dmxInput->devs[i]
@ -661,7 +741,8 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal)
char *devname;
DMXInputInfo *dmxInput;
if (!dmxLocal) return NULL;
if (!dmxLocal)
return NULL;
dmxInput = &dmxInputs[dmxLocal->inputIdx];
if (dmxLocal->sendsCore) {
@ -710,8 +791,13 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal)
registerProcPtr(pDevice);
if (dmxLocal->isCore && dmxLocal->type == DMX_LOCAL_MOUSE)
if (dmxLocal->isCore && dmxLocal->type == DMX_LOCAL_MOUSE) {
#if 00 /*BP*/
miRegisterPointerDevice(screenInfo.screens[0], pDevice);
#else
/* Nothing? dmxDeviceOnOff() should get called to init, right? */
#endif
}
if (dmxLocal->create_private)
dmxLocal->private = dmxLocal->create_private(pDevice);

View file

@ -99,9 +99,13 @@ int ChangePointerDevice(DeviceIntPtr old_dev,
}
dmxLocalNew->savedMotionProc = new_dev->valuator->GetMotionProc;
dmxLocalNew->savedMotionEvents = new_dev->valuator->numMotionEvents;
#if 00 /*BP*/
new_dev->valuator->GetMotionProc = miPointerGetMotionEvents;
new_dev->valuator->numMotionEvents = miPointerGetMotionBufferSize();
#else
new_dev->valuator->GetMotionProc = GetMotionHistory;
new_dev->valuator->numMotionEvents = GetMaximumEventsNum();
#endif
/* Switch our notion of core pointer */
dmxLocalOld->isCore = 0;
dmxLocalOld->sendsCore = dmxLocalOld->savedSendsCore;

View file

@ -164,7 +164,9 @@
#include <sys/kd.h>
#include <termios.h>
#include "atKeynames.h"
#if 00
#include "xf86Keymap.h"
#endif
#include <linux/keyboard.h>
#define NUM_AT2LNX (sizeof(at2lnx) / sizeof(at2lnx[0]))
@ -800,7 +802,12 @@ static void kbdLinuxReadKernelMapping(int fd, KeySymsPtr pKeySyms)
tbl[2] = 8; /* alt */
tbl[3] = tbl[2] | 1;
#if 00/*BP*/
k = map+GLYPHS_PER_KEY;
#else
ErrorF("kbdLinuxReadKernelMapping() is broken/no-op'd\n");
return;
#endif
maxkey = NUM_AT2LNX;
for (i = 0; i < maxkey; ++i) {
@ -927,8 +934,13 @@ static void kbdLinuxGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
char type;
int i;
#if 00/*BP*/
mapCopy = xalloc(sizeof(map));
memcpy(mapCopy, map, sizeof(map));
#else
ErrorF("kbdLinuxGetMap() is broken/no-op'd\n");
return;
#endif
kbdLinuxReadKernelMapping(priv->fd, pKeySyms);

View file

@ -788,7 +788,7 @@ ATIPseudoDMAInit(ScreenPtr pScreen)
atis->cce_pri_size = MMIO_IN32(mmio, RADEON_REG_CP_CSQ_CNTL) &
R200_CSQ_CNT_PRIMARY_MASK;
MMIO_OUT32(mmio, RADEON_REG_ME_CNTL, RADEON_ME_MODE_FREE_RUN);
} if (atic->is_radeon) {
} else if (atic->is_radeon) {
MMIO_OUT32(mmio, RADEON_REG_CP_CSQ_CNTL,
RADEON_CSQ_PRIPIO_INDDIS);
atis->cce_pri_size = MMIO_IN32(mmio, RADEON_REG_CP_CSQ_CNTL) &

View file

@ -2307,7 +2307,7 @@ ChangeDeviceControl(register ClientPtr client, DeviceIntPtr pDev,
}
int
NewInputDeviceRequest(InputOption *options)
NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev)
{
InputOption *option = NULL;
KdPointerInfo *pi = NULL;
@ -2372,5 +2372,16 @@ NewInputDeviceRequest(InputOption *options)
}
}
if (pi) {
*pdev = pi->dixdev;
} else if(ki) {
*pdev = ki->dixdev;
}
return Success;
}
void
DeleteInputDeviceRequest(DeviceIntPtr pDev)
{
}

View file

@ -14,8 +14,8 @@ SRCS = InitInput.c \
$(top_srcdir)/Xi/stubs.c \
$(top_srcdir)/mi/miinitext.c
libfbcmap_a_CFLAGS = $(AM_CFLAGS) -DXFree86Server
libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap.c
libfbcmap_a_CFLAGS = $(AM_CFLAGS)
libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c
Xvfb_SOURCES = $(SRCS)

View file

@ -1271,7 +1271,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
(count + 1) * sizeof(IDevRec));
indp[count - 1] = Pointer;
indp[count - 1].extraOptions =
xf86addNewOption(NULL, "CorePointer", NULL);
xf86addNewOption(NULL, xnfstrdup("CorePointer"), NULL);
indp[count].identifier = NULL;
servlayoutp->inputs = indp;
}
@ -1287,9 +1287,13 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
* always synthesize a 'mouse' section configured to send core
* events, unless a 'void' section is found, in which case the user
* probably wants to run footless.
*
* If you're using an evdev keyboard and expect a default mouse
* section ... deal.
*/
for (i = servlayoutp->inputs; i->identifier && i->driver; i++) {
if (!strcmp(i->driver, "void") || !strcmp(i->driver, "mouse")) {
if (!strcmp(i->driver, "void") || !strcmp(i->driver, "mouse") ||
!strcmp(i->driver, "vmmouse") || !strcmp(i->driver, "evdev")) {
found = 1; break;
}
}
@ -1306,7 +1310,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
(count + 1) * sizeof(IDevRec));
indp[count - 1] = Pointer;
indp[count - 1].extraOptions =
xf86addNewOption(NULL, "AlwaysCore", NULL);
xf86addNewOption(NULL, xnfstrdup("AlwaysCore"), NULL);
indp[count].identifier = NULL;
servlayoutp->inputs = indp;
}
@ -1397,7 +1401,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
(count + 1) * sizeof(IDevRec));
indp[count - 1] = Keyboard;
indp[count - 1].extraOptions =
xf86addNewOption(NULL, "CoreKeyboard", NULL);
xf86addNewOption(NULL, xnfstrdup("CoreKeyboard"), NULL);
indp[count].identifier = NULL;
servlayoutp->inputs = indp;
}

View file

@ -309,13 +309,16 @@ configureInputSection (void)
mouse->inp_identifier = "Mouse0";
mouse->inp_driver = "mouse";
mouse->inp_option_lst =
xf86addNewOption(mouse->inp_option_lst, "Protocol", DFLT_MOUSE_PROTO);
xf86addNewOption(mouse->inp_option_lst, xstrdup("Protocol"),
xstrdup(DFLT_MOUSE_PROTO));
#ifndef __SCO__
mouse->inp_option_lst =
xf86addNewOption(mouse->inp_option_lst, "Device", DFLT_MOUSE_DEV);
xf86addNewOption(mouse->inp_option_lst, xstrdup("Device"),
xstrdup(DFLT_MOUSE_DEV));
#endif
mouse->inp_option_lst =
xf86addNewOption(mouse->inp_option_lst, "ZAxisMapping", "4 5 6 7");
xf86addNewOption(mouse->inp_option_lst, xstrdup("ZAxisMapping"),
xstrdup("4 5 6 7"));
ptr = (XF86ConfInputPtr)xf86addListItem((glp)ptr, (glp)mouse);
return ptr;
}
@ -519,7 +522,7 @@ configureLayoutSection (void)
iptr->iref_option_lst = NULL;
iptr->iref_inputdev_str = "Mouse0";
iptr->iref_option_lst =
xf86addNewOption (iptr->iref_option_lst, "CorePointer", NULL);
xf86addNewOption (iptr->iref_option_lst, xstrdup("CorePointer"), NULL);
ptr->lay_input_lst = (XF86ConfInputrefPtr)
xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
}
@ -532,7 +535,7 @@ configureLayoutSection (void)
iptr->iref_option_lst = NULL;
iptr->iref_inputdev_str = "Keyboard0";
iptr->iref_option_lst =
xf86addNewOption (iptr->iref_option_lst, "CoreKeyboard", NULL);
xf86addNewOption (iptr->iref_option_lst, xstrdup("CoreKeyboard"), NULL);
ptr->lay_input_lst = (XF86ConfInputrefPtr)
xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
}
@ -751,7 +754,7 @@ configureDDCMonitorSection (int screennum)
}
if (ConfiguredMonitor->features.dpms) {
ptr->mon_option_lst = xf86addNewOption(ptr->mon_option_lst, "DPMS", NULL);
ptr->mon_option_lst = xf86addNewOption(ptr->mon_option_lst, xstrdup("DPMS"), NULL);
}
return ptr;

View file

@ -249,14 +249,11 @@ DGACloseScreen(int i, ScreenPtr pScreen)
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
if (XDGAEventBase) {
OsBlockSignals();
ProcessInputEvents();
mieqSetHandler(*XDGAEventBase + MotionNotify, NULL);
mieqSetHandler(*XDGAEventBase + ButtonPress, NULL);
mieqSetHandler(*XDGAEventBase + ButtonRelease, NULL);
mieqSetHandler(*XDGAEventBase + KeyPress, NULL);
mieqSetHandler(*XDGAEventBase + KeyRelease, NULL);
OsReleaseSignals();
}
FreeMarkedVisuals(pScreen);

View file

@ -371,8 +371,11 @@ xf86DeleteInput(InputInfoPtr pInp, int flags)
if (pInp->drv)
pInp->drv->refCount--;
/* This should *really* be handled in drv->UnInit(dev) call instead */
#if 0
if (pInp->private)
xfree(pInp->private);
#endif
/* Remove the entry from the list. */
if (pInp == xf86InputDevs)

View file

@ -84,7 +84,7 @@ typedef enum {
* mask is 0xFFFF0000.
*/
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 3)
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(1, 2)
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(2, 0)
#define ABI_XINPUT_VERSION SET_ABI_VERSION(1, 0)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 3)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 5)

View file

@ -289,7 +289,7 @@ xf86CheckBoolOption(pointer optlist, const char *name, int deflt)
_X_EXPORT pointer
xf86ReplaceIntOption(pointer optlist, const char *name, const int val)
{
char *tmp = xnfalloc(16);
char tmp[16];
sprintf(tmp,"%i",val);
return xf86AddNewOption(optlist,name,tmp);
}
@ -297,7 +297,7 @@ xf86ReplaceIntOption(pointer optlist, const char *name, const int val)
_X_EXPORT pointer
xf86ReplaceRealOption(pointer optlist, const char *name, const double val)
{
char *tmp = xnfalloc(32);
char tmp[32];
snprintf(tmp,32,"%f",val);
return xf86AddNewOption(optlist,name,tmp);
}

View file

@ -315,13 +315,14 @@ AddOtherInputDevices()
#endif
int
NewInputDeviceRequest (InputOption *options)
NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev)
{
IDevRec *idev = NULL;
InputDriverPtr drv = NULL;
InputInfoPtr pInfo = NULL;
InputOption *option = NULL;
DeviceIntPtr dev = NULL;
int rval = Success;
idev = xcalloc(sizeof(*idev), 1);
if (!idev)
@ -329,64 +330,122 @@ NewInputDeviceRequest (InputOption *options)
for (option = options; option; option = option->next) {
if (strcmp(option->key, "driver") == 0) {
if (!xf86LoadOneModule(option->value, NULL))
return BadName;
if (idev->driver) {
rval = BadRequest;
goto unwind;
}
/* Memory leak for every attached device if we don't
* test if the module is already loaded first */
drv = xf86LookupInputDriver(option->value);
if (!drv)
if(xf86LoadOneModule(option->value, NULL))
drv = xf86LookupInputDriver(option->value);
if (!drv) {
xf86Msg(X_ERROR, "No input driver matching `%s'\n",
option->value);
return BadName;
rval = BadName;
goto unwind;
}
idev->driver = xstrdup(option->value);
if (!idev->driver) {
xfree(idev);
return BadAlloc;
rval = BadAlloc;
goto unwind;
}
}
if (strcmp(option->key, "name") == 0 ||
strcmp(option->key, "identifier") == 0) {
if (idev->identifier) {
rval = BadRequest;
goto unwind;
}
idev->identifier = xstrdup(option->value);
if (!idev->identifier) {
xfree(idev);
return BadAlloc;
rval = BadAlloc;
goto unwind;
}
}
}
if(!idev->driver || !idev->identifier) {
xf86Msg(X_ERROR, "No input driver/identifier specified (ignoring)\n");
rval = BadRequest;
goto unwind;
}
if (!drv->PreInit) {
xf86Msg(X_ERROR,
"Input driver `%s' has no PreInit function (ignoring)\n",
drv->driverName);
return BadImplementation;
rval = BadImplementation;
goto unwind;
}
idev->commonOptions = NULL;
for (option = options; option; option = option->next)
for (option = options; option; option = option->next) {
/* Steal option key/value strings from the provided list.
* We need those strings, the InputOption list doesn't. */
idev->commonOptions = xf86addNewOption(idev->commonOptions,
option->key, option->value);
idev->extraOptions = NULL;
option->key = NULL;
option->value = NULL;
}
pInfo = drv->PreInit(drv, idev, 0);
if (!pInfo) {
xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n", idev->identifier);
return BadMatch;
rval = BadMatch;
goto unwind;
}
else if (!(pInfo->flags & XI86_CONFIGURED)) {
xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n",
idev->identifier);
xf86DeleteInput(pInfo, 0);
return BadMatch;
rval = BadMatch;
goto unwind;
}
xf86ActivateDevice(pInfo);
dev = pInfo->dev;
dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
ActivateDevice(dev);
if (dev->inited && dev->startup)
EnableDevice(dev);
*pdev = dev;
return Success;
unwind:
if(pInfo) {
if(drv->UnInit)
drv->UnInit(drv, pInfo, 0);
else
xf86DeleteInput(pInfo, 0);
}
if(idev->driver)
xfree(idev->driver);
if(idev->identifier)
xfree(idev->identifier);
xf86optionListFree(idev->commonOptions);
xfree(idev);
return rval;
}
void
DeleteInputDeviceRequest(DeviceIntPtr pDev)
{
LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate;
InputDriverPtr drv = pInfo->drv;
IDevRec *idev = pInfo->conf_idev;
RemoveDevice(pDev);
if(drv->UnInit)
drv->UnInit(drv, pInfo, 0);
else
xf86DeleteInput(pInfo, 0);
xfree(idev->driver);
xfree(idev->identifier);
xf86optionListFree(idev->commonOptions);
xfree(idev);
}
/*

View file

@ -107,6 +107,19 @@ DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing,
{
DisplayModePtr Mode;
/*
* Refuse to create modes that are insufficiently large. 64 is a random
* number, maybe the spec says something about what the minimum is. In
* particular I see this frequently with _old_ EDID, 1.0 or so, so maybe
* our parser is just being too aggresive there.
*/
if (timing->h_active < 64 || timing->v_active < 64) {
xf86DrvMsg(scrnIndex, X_INFO,
"%s: Ignoring tiny %dx%d mode\n", __func__,
timing->h_active, timing->v_active);
return NULL;
}
/* We don't do stereo */
if (timing->stereo) {
xf86DrvMsg(scrnIndex, X_INFO,

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