Merge branch 'master' into mpx
Conflicts: configure.ac dix/events.c hw/xfree86/common/xf86Xinput.c
This commit is contained in:
commit
d4dad6f84f
|
@ -829,12 +829,16 @@ static Bool
|
||||||
glxDRIEnterVT (int index, int flags)
|
glxDRIEnterVT (int index, int flags)
|
||||||
{
|
{
|
||||||
__GLXDRIscreen *screen = (__GLXDRIscreen *) __glXgetActiveScreen(index);
|
__GLXDRIscreen *screen = (__GLXDRIscreen *) __glXgetActiveScreen(index);
|
||||||
|
Bool ret;
|
||||||
|
|
||||||
LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
|
LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
|
||||||
|
|
||||||
|
if (!(*screen->enterVT) (index, flags))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
glxResumeClients();
|
glxResumeClients();
|
||||||
|
|
||||||
return (*screen->enterVT) (index, flags);
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -275,7 +275,7 @@ static GLboolean errorOccured = GL_FALSE;
|
||||||
/*
|
/*
|
||||||
** The GL was will call this routine if an error occurs.
|
** The GL was will call this routine if an error occurs.
|
||||||
*/
|
*/
|
||||||
void __glXErrorCallBack(__GLinterface *gc, GLenum code)
|
void __glXErrorCallBack(GLenum code)
|
||||||
{
|
{
|
||||||
errorOccured = GL_TRUE;
|
errorOccured = GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ typedef struct {
|
||||||
extern GLboolean __glXFreeContext(__GLXcontext *glxc);
|
extern GLboolean __glXFreeContext(__GLXcontext *glxc);
|
||||||
extern void __glXFlushContextCache(void);
|
extern void __glXFlushContextCache(void);
|
||||||
|
|
||||||
extern void __glXErrorCallBack(__GLinterface *gc, GLenum code);
|
extern void __glXErrorCallBack(GLenum code);
|
||||||
extern void __glXClearErrorOccured(void);
|
extern void __glXClearErrorOccured(void);
|
||||||
extern GLboolean __glXErrorOccured(void);
|
extern GLboolean __glXErrorOccured(void);
|
||||||
extern void __glXResetLargeCommandStatus(__GLXclientState*);
|
extern void __glXResetLargeCommandStatus(__GLXclientState*);
|
||||||
|
|
|
@ -639,7 +639,7 @@ __glGetBooleanv_size(GLenum e)
|
||||||
case GL_PROGRAM_ERROR_POSITION_ARB:
|
case GL_PROGRAM_ERROR_POSITION_ARB:
|
||||||
case GL_DEPTH_CLAMP_NV:
|
case GL_DEPTH_CLAMP_NV:
|
||||||
case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
|
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_MAX_VERTEX_UNITS_ARB:
|
||||||
case GL_ACTIVE_VERTEX_UNITS_ARB:
|
case GL_ACTIVE_VERTEX_UNITS_ARB:
|
||||||
case GL_WEIGHT_SUM_UNITY_ARB:
|
case GL_WEIGHT_SUM_UNITY_ARB:
|
||||||
|
@ -699,6 +699,8 @@ __glGetBooleanv_size(GLenum e)
|
||||||
/* case GL_POINT_SPRITE_NV:*/
|
/* case GL_POINT_SPRITE_NV:*/
|
||||||
case GL_POINT_SPRITE_R_MODE_NV:
|
case GL_POINT_SPRITE_R_MODE_NV:
|
||||||
case GL_MAX_VERTEX_ATTRIBS_ARB:
|
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_DEPTH_BOUNDS_TEST_EXT:
|
||||||
case GL_STENCIL_TEST_TWO_SIDE_EXT:
|
case GL_STENCIL_TEST_TWO_SIDE_EXT:
|
||||||
case GL_ACTIVE_STENCIL_FACE_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_ALU_INSTRUCTIONS_ARB:
|
||||||
case GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB:
|
case GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB:
|
||||||
case GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_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_FORMAT_ARB:
|
||||||
case GL_PROGRAM_INSTRUCTIONS_ARB:
|
case GL_PROGRAM_INSTRUCTIONS_ARB:
|
||||||
case GL_MAX_PROGRAM_INSTRUCTIONS_ARB:
|
case GL_MAX_PROGRAM_INSTRUCTIONS_ARB:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
X/drivers
|
X/drivers
|
||||||
X/glxheader.h
|
X/glxheader.h
|
||||||
X/xmesaP.h
|
X/xm*.h
|
||||||
X/xm*.c
|
X/xm*.c
|
||||||
mesa/drivers
|
mesa/drivers
|
||||||
mesa/glxheader.h
|
mesa/glxheader.h
|
||||||
|
|
|
@ -22,14 +22,13 @@ AM_CFLAGS = \
|
||||||
-DXFree86Server \
|
-DXFree86Server \
|
||||||
@GLX_DEFINES@
|
@GLX_DEFINES@
|
||||||
|
|
||||||
libX_la_SOURCES = xf86glx.c \
|
libX_la_SOURCES = xf86glx.c
|
||||||
xf86glx_util.c \
|
|
||||||
xf86glx_util.h
|
|
||||||
|
|
||||||
nodist_libX_la_SOURCES = \
|
nodist_libX_la_SOURCES = \
|
||||||
xm_api.c \
|
xm_api.c \
|
||||||
xm_buffer.c \
|
xm_buffer.c \
|
||||||
xm_dd.c \
|
xm_dd.c \
|
||||||
|
xm_image.c \
|
||||||
xm_line.c \
|
xm_line.c \
|
||||||
xm_span.c \
|
xm_span.c \
|
||||||
xm_tri.c \
|
xm_tri.c \
|
||||||
|
|
|
@ -1,149 +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 "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);
|
|
||||||
}
|
|
|
@ -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_ */
|
|
|
@ -168,6 +168,8 @@ symlink_mesa_x() {
|
||||||
action xm_api.c
|
action xm_api.c
|
||||||
action xm_buffer.c
|
action xm_buffer.c
|
||||||
action xm_dd.c
|
action xm_dd.c
|
||||||
|
action xm_image.c
|
||||||
|
action xm_image.h
|
||||||
action xm_line.c
|
action xm_line.c
|
||||||
action xm_span.c
|
action xm_span.c
|
||||||
action xm_tri.c
|
action xm_tri.c
|
||||||
|
@ -225,9 +227,6 @@ symlink_glx() {
|
||||||
dst_dir glx
|
dst_dir glx
|
||||||
|
|
||||||
action indirect_size.h
|
action indirect_size.h
|
||||||
|
|
||||||
src_dir src/mesa/drivers/dri/common
|
|
||||||
|
|
||||||
action glcontextmodes.c
|
action glcontextmodes.c
|
||||||
action glcontextmodes.h
|
action glcontextmodes.h
|
||||||
|
|
||||||
|
|
|
@ -2509,7 +2509,7 @@ ServertimeBracketValues(pCounter, pbracket_less, pbracket_greater)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SyncInitServerTime()
|
SyncInitServerTime(void)
|
||||||
{
|
{
|
||||||
CARD64 resolution;
|
CARD64 resolution;
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,12 @@ from The Open Group.
|
||||||
#include <X11/extensions/xcmiscstr.h>
|
#include <X11/extensions/xcmiscstr.h>
|
||||||
#include "modinit.h"
|
#include "modinit.h"
|
||||||
|
|
||||||
|
#if HAVE_STDINT_H
|
||||||
|
#include <stdint.h>
|
||||||
|
#elif !defined(UINT32_MAX)
|
||||||
|
#define UINT32_MAX 0xffffffffU
|
||||||
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static unsigned char XCMiscCode;
|
static unsigned char XCMiscCode;
|
||||||
#endif
|
#endif
|
||||||
|
@ -143,7 +149,10 @@ ProcXCMiscGetXIDList(client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
|
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)
|
if (!pids)
|
||||||
{
|
{
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
@ -164,7 +173,7 @@ ProcXCMiscGetXIDList(client)
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||||
WriteSwappedDataToClient(client, count * sizeof(XID), pids);
|
WriteSwappedDataToClient(client, count * sizeof(XID), pids);
|
||||||
}
|
}
|
||||||
DEALLOCATE_LOCAL(pids);
|
Xfree(pids);
|
||||||
return(client->noClientException);
|
return(client->noClientException);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ static int XvdiSendVideoNotify(XvPortPtr, DrawablePtr, int);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
XvExtensionInit()
|
XvExtensionInit(void)
|
||||||
{
|
{
|
||||||
ExtensionEntry *extEntry;
|
ExtensionEntry *extEntry;
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ XvExtensionInit()
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
CreateResourceTypes()
|
CreateResourceTypes(void)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -335,13 +335,13 @@ XvResetProc(ExtensionEntry* extEntry)
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT int
|
_X_EXPORT int
|
||||||
XvGetScreenIndex()
|
XvGetScreenIndex(void)
|
||||||
{
|
{
|
||||||
return XvScreenIndex;
|
return XvScreenIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT unsigned long
|
_X_EXPORT unsigned long
|
||||||
XvGetRTPort()
|
XvGetRTPort(void)
|
||||||
{
|
{
|
||||||
return XvRTPort;
|
return XvRTPort;
|
||||||
}
|
}
|
||||||
|
|
|
@ -675,7 +675,7 @@ SProcXvMCDispatch (ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
XvMCExtensionInit()
|
XvMCExtensionInit(void)
|
||||||
{
|
{
|
||||||
ExtensionEntry *extEntry;
|
ExtensionEntry *extEntry;
|
||||||
|
|
||||||
|
|
14
Xi/stubs.c
14
Xi/stubs.c
|
@ -226,7 +226,19 @@ ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev,
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
NewInputDeviceRequest(InputOption *options)
|
NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev)
|
||||||
{
|
{
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
*
|
||||||
|
* Caller: configRemoveDevice (and others)
|
||||||
|
*
|
||||||
|
* Remove the specified device previously added.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
DeleteInputDeviceRequest(DeviceIntPtr dev)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
113
config/config.c
113
config/config.c
|
@ -92,12 +92,15 @@ configTeardown(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
configAddDevice(DBusMessage *message, DBusMessageIter *iter, DBusError *error)
|
configAddDevice(DBusMessage *message, DBusMessageIter *iter,
|
||||||
|
DBusMessage *reply, DBusMessageIter *r_iter,
|
||||||
|
DBusError *error)
|
||||||
{
|
{
|
||||||
DBusMessageIter subiter;
|
DBusMessageIter subiter;
|
||||||
InputOption *tmpo = NULL, *options = NULL;
|
InputOption *tmpo = NULL, *options = NULL;
|
||||||
char *tmp = NULL;
|
char *tmp = NULL;
|
||||||
int ret = BadMatch;
|
int ret = BadMatch;
|
||||||
|
DeviceIntPtr dev = NULL;
|
||||||
|
|
||||||
DebugF("[config] adding device\n");
|
DebugF("[config] adding device\n");
|
||||||
|
|
||||||
|
@ -110,6 +113,11 @@ configAddDevice(DBusMessage *message, DBusMessageIter *iter, DBusError *error)
|
||||||
|
|
||||||
options->key = xstrdup("_source");
|
options->key = xstrdup("_source");
|
||||||
options->value = xstrdup("client/dbus");
|
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) {
|
while (dbus_message_iter_get_arg_type(iter) == DBUS_TYPE_ARRAY) {
|
||||||
tmpo = (InputOption *) xcalloc(sizeof(InputOption), 1);
|
tmpo = (InputOption *) xcalloc(sizeof(InputOption), 1);
|
||||||
|
@ -118,6 +126,8 @@ configAddDevice(DBusMessage *message, DBusMessageIter *iter, DBusError *error)
|
||||||
ret = BadAlloc;
|
ret = BadAlloc;
|
||||||
goto unwind;
|
goto unwind;
|
||||||
}
|
}
|
||||||
|
tmpo->next = options;
|
||||||
|
options = tmpo;
|
||||||
|
|
||||||
dbus_message_iter_recurse(iter, &subiter);
|
dbus_message_iter_recurse(iter, &subiter);
|
||||||
|
|
||||||
|
@ -132,8 +142,8 @@ configAddDevice(DBusMessage *message, DBusMessageIter *iter, DBusError *error)
|
||||||
tmp);
|
tmp);
|
||||||
MALFORMED_MESSAGE();
|
MALFORMED_MESSAGE();
|
||||||
}
|
}
|
||||||
tmpo->key = xstrdup(tmp);
|
options->key = xstrdup(tmp);
|
||||||
if (!tmpo->key) {
|
if (!options->key) {
|
||||||
ErrorF("[config] couldn't duplicate key!\n");
|
ErrorF("[config] couldn't duplicate key!\n");
|
||||||
ret = BadAlloc;
|
ret = BadAlloc;
|
||||||
goto unwind;
|
goto unwind;
|
||||||
|
@ -148,31 +158,37 @@ configAddDevice(DBusMessage *message, DBusMessageIter *iter, DBusError *error)
|
||||||
dbus_message_iter_get_basic(&subiter, &tmp);
|
dbus_message_iter_get_basic(&subiter, &tmp);
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
MALFORMED_MESSAGE();
|
MALFORMED_MESSAGE();
|
||||||
tmpo->value = xstrdup(tmp);
|
options->value = xstrdup(tmp);
|
||||||
if (!tmpo->value) {
|
if (!options->value) {
|
||||||
ErrorF("[config] couldn't duplicate option!\n");
|
ErrorF("[config] couldn't duplicate option!\n");
|
||||||
ret = BadAlloc;
|
ret = BadAlloc;
|
||||||
goto unwind;
|
goto unwind;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpo->next = options;
|
|
||||||
options = tmpo;
|
|
||||||
dbus_message_iter_next(iter);
|
dbus_message_iter_next(iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = NewInputDeviceRequest(options);
|
ret = NewInputDeviceRequest(options, &dev);
|
||||||
if (ret != Success)
|
if (ret != Success) {
|
||||||
DebugF("[config] NewInputDeviceRequest failed\n");
|
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:
|
unwind:
|
||||||
if (tmpo->key)
|
if (dev && ret != Success)
|
||||||
xfree(tmpo->key);
|
RemoveDevice(dev);
|
||||||
if (tmpo->value)
|
|
||||||
xfree(tmpo->value);
|
|
||||||
if (tmpo)
|
|
||||||
xfree(tmpo);
|
|
||||||
|
|
||||||
while (options) {
|
while (options) {
|
||||||
tmpo = options;
|
tmpo = options;
|
||||||
|
@ -212,7 +228,7 @@ configRemoveDevice(DBusMessage *message, DBusMessageIter *iter,
|
||||||
* already been removed. */
|
* already been removed. */
|
||||||
OsBlockSignals();
|
OsBlockSignals();
|
||||||
ProcessInputEvents();
|
ProcessInputEvents();
|
||||||
RemoveDevice(pDev);
|
DeleteInputDeviceRequest(pDev);
|
||||||
OsReleaseSignals();
|
OsReleaseSignals();
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
@ -221,17 +237,47 @@ unwind:
|
||||||
return ret;
|
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
|
static DBusHandlerResult
|
||||||
configMessage(DBusConnection *connection, DBusMessage *message, void *closure)
|
configMessage(DBusConnection *connection, DBusMessage *message, void *closure)
|
||||||
{
|
{
|
||||||
DBusMessageIter iter;
|
DBusMessageIter iter;
|
||||||
DBusError error;
|
DBusError error;
|
||||||
DBusMessage *reply;
|
DBusMessage *reply;
|
||||||
|
DBusMessageIter r_iter;
|
||||||
DBusConnection *bus = closure;
|
DBusConnection *bus = closure;
|
||||||
int ret = BadDrawable; /* nonsensical value */
|
int ret = BadDrawable; /* nonsensical value */
|
||||||
|
|
||||||
dbus_error_init(&error);
|
dbus_error_init(&error);
|
||||||
|
|
||||||
|
DebugF("[config] received a message\n");
|
||||||
|
|
||||||
if (strcmp(dbus_message_get_interface(message),
|
if (strcmp(dbus_message_get_interface(message),
|
||||||
"org.x.config.input") == 0) {
|
"org.x.config.input") == 0) {
|
||||||
if (!dbus_message_iter_init(message, &iter)) {
|
if (!dbus_message_iter_init(message, &iter)) {
|
||||||
|
@ -240,26 +286,33 @@ configMessage(DBusConnection *connection, DBusMessage *message, void *closure)
|
||||||
return DBUS_HANDLER_RESULT_NEED_MEMORY; /* ?? */
|
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)
|
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)
|
else if (strcmp(dbus_message_get_member(message), "remove") == 0)
|
||||||
ret = configRemoveDevice(message, &iter, &error);
|
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) {
|
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)) {
|
if (!strlen(dbus_message_get_signature(reply)))
|
||||||
ErrorF("[config] couldn't append to iterator\n");
|
if (!dbus_message_iter_append_basic(&r_iter, DBUS_TYPE_INT32, &ret)) {
|
||||||
dbus_error_free(&error);
|
ErrorF("[config] couldn't append to iterator\n");
|
||||||
return DBUS_HANDLER_RESULT_HANDLED;
|
dbus_error_free(&error);
|
||||||
}
|
return DBUS_HANDLER_RESULT_HANDLED;
|
||||||
|
}
|
||||||
|
|
||||||
if (!dbus_connection_send(bus, reply, NULL))
|
if (!dbus_connection_send(bus, reply, NULL))
|
||||||
ErrorF("[config] failed to send reply\n");
|
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);
|
dbus_error_free(&error);
|
||||||
|
@ -410,13 +463,13 @@ configReconnect(OsTimerPtr timer, CARD32 time, pointer arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
configInitialise()
|
configInitialise(void)
|
||||||
{
|
{
|
||||||
TimerSet(NULL, 0, 1, configReconnect, NULL);
|
TimerSet(NULL, 0, 1, configReconnect, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
configFini()
|
configFini(void)
|
||||||
{
|
{
|
||||||
DBusError error;
|
DBusError error;
|
||||||
|
|
||||||
|
|
25
configure.ac
25
configure.ac
|
@ -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]),
|
AC_ARG_WITH(builderstring, AS_HELP_STRING([--with-builderstring=BUILDERSTRING], [Additional builder string]),
|
||||||
[ BUILDERSTRING="$withval" ]
|
[ 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)]),
|
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="$withval" ],
|
||||||
[ FONTDIR="${libdir}/X11/fonts" ])
|
[ 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)]),
|
AC_ARG_WITH(rgb-path, AS_HELP_STRING([--with-rgb-path=PATH], [Path to RGB database (default: ${datadir}/X11/rgb)]),
|
||||||
[ RGBPATH="$withval" ],
|
[ RGBPATH="$withval" ],
|
||||||
[ RGBPATH="${datadir}/X11/rgb" ])
|
[ 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"
|
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)]),
|
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}" ].
|
[ APPLE_APPLICATIONS_DIR="${withval}" ].
|
||||||
|
@ -493,6 +487,21 @@ AC_ARG_ENABLE(builtin-fonts, AS_HELP_STRING([--enable-builtin-fonts], [Use only
|
||||||
AC_ARG_ENABLE(null-root-cursor, AS_HELP_STRING([--enable-null-root-cursor], [Use an empty root cursor (default: use core cursor)]),
|
AC_ARG_ENABLE(null-root-cursor, AS_HELP_STRING([--enable-null-root-cursor], [Use an empty root cursor (default: use core cursor)]),
|
||||||
[NULL_ROOT_CURSOR=$enableval],
|
[NULL_ROOT_CURSOR=$enableval],
|
||||||
[NULL_ROOT_CURSOR=no])
|
[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.
|
dnl Extensions.
|
||||||
AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes])
|
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])
|
AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-shm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes])
|
||||||
|
@ -507,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(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(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(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(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(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(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(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(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(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])
|
AC_ARG_ENABLE(xcalibrate, AS_HELP_STRING([--enable-xcalibrate], [Build XCalibrate extension (default: disabled)]), [XCALIBRATE=$enableval], [XCALIBRATE=no])
|
||||||
|
|
|
@ -167,7 +167,7 @@ NameForAtom(Atom atom)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AtomError()
|
AtomError(void)
|
||||||
{
|
{
|
||||||
FatalError("initializing atoms");
|
FatalError("initializing atoms");
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ FreeAtom(NodePtr patom)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
FreeAllAtoms()
|
FreeAllAtoms(void)
|
||||||
{
|
{
|
||||||
if(atomRoot == (NodePtr)NULL)
|
if(atomRoot == (NodePtr)NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -197,7 +197,7 @@ FreeAllAtoms()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
InitAtoms()
|
InitAtoms(void)
|
||||||
{
|
{
|
||||||
FreeAllAtoms();
|
FreeAllAtoms();
|
||||||
tableLength = InitialTableSize;
|
tableLength = InitialTableSize;
|
||||||
|
|
|
@ -92,15 +92,27 @@ DeviceIntPtr
|
||||||
AddInputDevice(DeviceProc deviceProc, Bool autoStart)
|
AddInputDevice(DeviceProc deviceProc, Bool autoStart)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev, *prev; /* not a typo */
|
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;
|
return (DeviceIntPtr)NULL;
|
||||||
dev = (DeviceIntPtr) xcalloc(sizeof(DeviceIntRec), 1);
|
dev = (DeviceIntPtr) xcalloc(sizeof(DeviceIntRec), 1);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return (DeviceIntPtr)NULL;
|
return (DeviceIntPtr)NULL;
|
||||||
dev->name = (char *)NULL;
|
dev->name = (char *)NULL;
|
||||||
dev->type = 0;
|
dev->type = 0;
|
||||||
dev->id = inputInfo.numDevices;
|
dev->id = devid;
|
||||||
inputInfo.numDevices++;
|
inputInfo.numDevices++;
|
||||||
dev->public.on = FALSE;
|
dev->public.on = FALSE;
|
||||||
dev->public.processInputProc = (ProcessInputProc)NoopDDA;
|
dev->public.processInputProc = (ProcessInputProc)NoopDDA;
|
||||||
|
@ -373,7 +385,7 @@ CorePointerProc(DeviceIntPtr pDev, int what)
|
||||||
* fallback if no physical device is available.
|
* fallback if no physical device is available.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
InitCoreDevices()
|
InitCoreDevices(void)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
||||||
|
@ -460,7 +472,7 @@ InitCoreDevices()
|
||||||
* Each physical keyboard is paired with the first available unpaired pointer.
|
* Each physical keyboard is paired with the first available unpaired pointer.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
InitAndStartDevices()
|
InitAndStartDevices(void)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev, next;
|
DeviceIntPtr dev, next;
|
||||||
|
|
||||||
|
@ -530,8 +542,13 @@ CloseDevice(DeviceIntPtr dev)
|
||||||
xfree(dev->key);
|
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);
|
xfree(dev->valuator);
|
||||||
|
}
|
||||||
|
|
||||||
if (dev->button) {
|
if (dev->button) {
|
||||||
#ifdef XKB
|
#ifdef XKB
|
||||||
|
@ -617,7 +634,7 @@ CloseDevice(DeviceIntPtr dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CloseDownDevices()
|
CloseDownDevices(void)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev, next;
|
DeviceIntPtr dev, next;
|
||||||
|
|
||||||
|
@ -703,6 +720,7 @@ RemoveDevice(DeviceIntPtr dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret == Success) {
|
if (ret == Success) {
|
||||||
|
inputInfo.numDevices--;
|
||||||
ev.type = DevicePresenceNotify;
|
ev.type = DevicePresenceNotify;
|
||||||
ev.time = currentTime.milliseconds;
|
ev.time = currentTime.milliseconds;
|
||||||
ev.devchange = 0;
|
ev.devchange = 0;
|
||||||
|
@ -716,7 +734,7 @@ RemoveDevice(DeviceIntPtr dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NumMotionEvents()
|
NumMotionEvents(void)
|
||||||
{
|
{
|
||||||
/* only called to fill data in initial connection reply.
|
/* only called to fill data in initial connection reply.
|
||||||
* VCP is ok here, it is the only fixed device we have. */
|
* VCP is ok here, it is the only fixed device we have. */
|
||||||
|
@ -736,13 +754,13 @@ RegisterKeyboardDevice(DeviceIntPtr device)
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT DevicePtr
|
_X_EXPORT DevicePtr
|
||||||
LookupKeyboardDevice()
|
LookupKeyboardDevice(void)
|
||||||
{
|
{
|
||||||
return inputInfo.keyboard ? &inputInfo.keyboard->public : NULL;
|
return inputInfo.keyboard ? &inputInfo.keyboard->public : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT DevicePtr
|
_X_EXPORT DevicePtr
|
||||||
LookupPointerDevice()
|
LookupPointerDevice(void)
|
||||||
{
|
{
|
||||||
return inputInfo.pointer ? &inputInfo.pointer->public : NULL;
|
return inputInfo.pointer ? &inputInfo.pointer->public : NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,7 +218,7 @@ SetInputCheck(HWEventQueuePtr c0, HWEventQueuePtr c1)
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT void
|
_X_EXPORT void
|
||||||
UpdateCurrentTime()
|
UpdateCurrentTime(void)
|
||||||
{
|
{
|
||||||
TimeStamp systime;
|
TimeStamp systime;
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ UpdateCurrentTime()
|
||||||
|
|
||||||
/* Like UpdateCurrentTime, but can't call ProcessInputEvents */
|
/* Like UpdateCurrentTime, but can't call ProcessInputEvents */
|
||||||
_X_EXPORT void
|
_X_EXPORT void
|
||||||
UpdateCurrentTimeIf()
|
UpdateCurrentTimeIf(void)
|
||||||
{
|
{
|
||||||
TimeStamp systime;
|
TimeStamp systime;
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ UpdateCurrentTimeIf()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
InitSelections()
|
InitSelections(void)
|
||||||
{
|
{
|
||||||
if (CurrentSelections)
|
if (CurrentSelections)
|
||||||
xfree(CurrentSelections);
|
xfree(CurrentSelections);
|
||||||
|
@ -3656,7 +3656,7 @@ CloseDownClient(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
KillAllClients()
|
KillAllClients(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i=1; i<currentMaxClients; i++)
|
for (i=1; i<currentMaxClients; i++)
|
||||||
|
|
|
@ -1878,7 +1878,7 @@ DeleteClientFontStuff(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
InitFonts ()
|
InitFonts (void)
|
||||||
{
|
{
|
||||||
patternCache = MakeFontPatternCache();
|
patternCache = MakeFontPatternCache();
|
||||||
|
|
||||||
|
@ -1997,7 +1997,7 @@ RegisterFPEFunctions(NameCheckFunc name_func,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
FreeFonts()
|
FreeFonts(void)
|
||||||
{
|
{
|
||||||
if (patternCache) {
|
if (patternCache) {
|
||||||
FreeFontPatternCache(patternCache);
|
FreeFontPatternCache(patternCache);
|
||||||
|
|
|
@ -550,7 +550,7 @@ RemoveBlockAndWakeupHandlers (BlockHandlerProcPtr blockHandler,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
InitBlockAndWakeupHandlers ()
|
InitBlockAndWakeupHandlers (void)
|
||||||
{
|
{
|
||||||
xfree (handlers);
|
xfree (handlers);
|
||||||
handlers = (BlockHandlerPtr) 0;
|
handlers = (BlockHandlerPtr) 0;
|
||||||
|
@ -950,7 +950,7 @@ DeleteCallbackList(CallbackListPtr *pcbl)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
InitCallbackManager()
|
InitCallbackManager(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -974,7 +974,7 @@ PostNewCursor(DeviceIntPtr pDev)
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT WindowPtr
|
_X_EXPORT WindowPtr
|
||||||
GetCurrentRootWindow()
|
GetCurrentRootWindow(void)
|
||||||
{
|
{
|
||||||
return ROOT;
|
return ROOT;
|
||||||
}
|
}
|
||||||
|
@ -1179,7 +1179,7 @@ FreezeThaw(DeviceIntPtr dev, Bool frozen)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ComputeFreezes()
|
ComputeFreezes(void)
|
||||||
{
|
{
|
||||||
DeviceIntPtr replayDev = syncEvents.replayDev;
|
DeviceIntPtr replayDev = syncEvents.replayDev;
|
||||||
int i;
|
int i;
|
||||||
|
@ -2190,7 +2190,7 @@ CheckMotion(xEvent *xE, DeviceIntPtr pDev)
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT void
|
_X_EXPORT void
|
||||||
WindowsRestructured()
|
WindowsRestructured(void)
|
||||||
{
|
{
|
||||||
DeviceIntPtr pDev = inputInfo.devices;
|
DeviceIntPtr pDev = inputInfo.devices;
|
||||||
while(pDev)
|
while(pDev)
|
||||||
|
@ -4281,7 +4281,7 @@ ProcQueryPointer(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
InitEvents()
|
InitEvents(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -278,7 +278,7 @@ MinorOpcodeOfRequest(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CloseDownExtensions()
|
CloseDownExtensions(void)
|
||||||
{
|
{
|
||||||
int i,j;
|
int i,j;
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ extern Bool XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies);
|
||||||
* Pick some arbitrary size for Xi motion history.
|
* Pick some arbitrary size for Xi motion history.
|
||||||
*/
|
*/
|
||||||
_X_EXPORT int
|
_X_EXPORT int
|
||||||
GetMotionHistorySize()
|
GetMotionHistorySize(void)
|
||||||
{
|
{
|
||||||
return MOTION_HISTORY_SIZE;
|
return MOTION_HISTORY_SIZE;
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator,
|
||||||
* xEvent *events = xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
* xEvent *events = xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
||||||
*/
|
*/
|
||||||
_X_EXPORT int
|
_X_EXPORT int
|
||||||
GetMaximumEventsNum() {
|
GetMaximumEventsNum(void) {
|
||||||
/* Two base events -- core and device, plus valuator events. Multiply
|
/* Two base events -- core and device, plus valuator events. Multiply
|
||||||
* by two if we're doing key repeats. */
|
* by two if we're doing key repeats. */
|
||||||
int ret = 2 + MAX_VALUATOR_EVENTS;
|
int ret = 2 + MAX_VALUATOR_EVENTS;
|
||||||
|
@ -700,6 +700,7 @@ _X_EXPORT void
|
||||||
SwitchCoreKeyboard(DeviceIntPtr pDev)
|
SwitchCoreKeyboard(DeviceIntPtr pDev)
|
||||||
{
|
{
|
||||||
KeyClassPtr ckeyc = inputInfo.keyboard->key;
|
KeyClassPtr ckeyc = inputInfo.keyboard->key;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
if (inputInfo.keyboard->devPrivates[CoreDevicePrivatesIndex].ptr != pDev) {
|
if (inputInfo.keyboard->devPrivates[CoreDevicePrivatesIndex].ptr != pDev) {
|
||||||
memcpy(ckeyc->modifierMap, pDev->key->modifierMap, MAP_LENGTH);
|
memcpy(ckeyc->modifierMap, pDev->key->modifierMap, MAP_LENGTH);
|
||||||
|
@ -714,6 +715,25 @@ SwitchCoreKeyboard(DeviceIntPtr pDev)
|
||||||
ckeyc->curKeySyms.maxKeyCode = pDev->key->curKeySyms.maxKeyCode;
|
ckeyc->curKeySyms.maxKeyCode = pDev->key->curKeySyms.maxKeyCode;
|
||||||
SetKeySymsMap(&ckeyc->curKeySyms, &pDev->key->curKeySyms);
|
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
|
#ifdef XKB
|
||||||
if (!noXkbExtension && pDev->key->xkbInfo && pDev->key->xkbInfo->desc) {
|
if (!noXkbExtension && pDev->key->xkbInfo && pDev->key->xkbInfo->desc) {
|
||||||
if (!XkbCopyKeymap(pDev->key->xkbInfo->desc, ckeyc->xkbInfo->desc,
|
if (!XkbCopyKeymap(pDev->key->xkbInfo->desc, ckeyc->xkbInfo->desc,
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "dix.h"
|
#include "dix.h"
|
||||||
void MakePredeclaredAtoms()
|
void MakePredeclaredAtoms(void)
|
||||||
{
|
{
|
||||||
if (MakeAtom("PRIMARY", 7, 1) != XA_PRIMARY) AtomError();
|
if (MakeAtom("PRIMARY", 7, 1) != XA_PRIMARY) AtomError();
|
||||||
if (MakeAtom("SECONDARY", 9, 1) != XA_SECONDARY) AtomError();
|
if (MakeAtom("SECONDARY", 9, 1) != XA_SECONDARY) AtomError();
|
||||||
|
|
|
@ -546,7 +546,7 @@ static int padlength[4] = {0, 3, 2, 1};
|
||||||
static
|
static
|
||||||
#endif
|
#endif
|
||||||
Bool
|
Bool
|
||||||
CreateConnectionBlock()
|
CreateConnectionBlock(void)
|
||||||
{
|
{
|
||||||
xConnSetup setup;
|
xConnSetup setup;
|
||||||
xWindowRoot root;
|
xWindowRoot root;
|
||||||
|
|
|
@ -60,7 +60,7 @@ unsigned *extensionPrivateSizes;
|
||||||
unsigned totalExtensionSize;
|
unsigned totalExtensionSize;
|
||||||
|
|
||||||
void
|
void
|
||||||
ResetExtensionPrivates()
|
ResetExtensionPrivates(void)
|
||||||
{
|
{
|
||||||
extensionPrivateCount = 0;
|
extensionPrivateCount = 0;
|
||||||
extensionPrivateLen = 0;
|
extensionPrivateLen = 0;
|
||||||
|
@ -71,7 +71,7 @@ ResetExtensionPrivates()
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT int
|
_X_EXPORT int
|
||||||
AllocateExtensionPrivateIndex()
|
AllocateExtensionPrivateIndex(void)
|
||||||
{
|
{
|
||||||
return extensionPrivateCount++;
|
return extensionPrivateCount++;
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ unsigned *clientPrivateSizes;
|
||||||
unsigned totalClientSize;
|
unsigned totalClientSize;
|
||||||
|
|
||||||
void
|
void
|
||||||
ResetClientPrivates()
|
ResetClientPrivates(void)
|
||||||
{
|
{
|
||||||
clientPrivateCount = 0;
|
clientPrivateCount = 0;
|
||||||
clientPrivateLen = 0;
|
clientPrivateLen = 0;
|
||||||
|
@ -128,7 +128,7 @@ ResetClientPrivates()
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT int
|
_X_EXPORT int
|
||||||
AllocateClientPrivateIndex()
|
AllocateClientPrivateIndex(void)
|
||||||
{
|
{
|
||||||
return clientPrivateCount++;
|
return clientPrivateCount++;
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ AllocateClientPrivate(int index2, unsigned amount)
|
||||||
int screenPrivateCount;
|
int screenPrivateCount;
|
||||||
|
|
||||||
void
|
void
|
||||||
ResetScreenPrivates()
|
ResetScreenPrivates(void)
|
||||||
{
|
{
|
||||||
screenPrivateCount = 0;
|
screenPrivateCount = 0;
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ ResetScreenPrivates()
|
||||||
* so we have to worry about resizing existing devPrivates
|
* so we have to worry about resizing existing devPrivates
|
||||||
*/
|
*/
|
||||||
_X_EXPORT int
|
_X_EXPORT int
|
||||||
AllocateScreenPrivateIndex()
|
AllocateScreenPrivateIndex(void)
|
||||||
{
|
{
|
||||||
int idx;
|
int idx;
|
||||||
int i;
|
int i;
|
||||||
|
@ -213,13 +213,13 @@ AllocateScreenPrivateIndex()
|
||||||
static int windowPrivateCount;
|
static int windowPrivateCount;
|
||||||
|
|
||||||
void
|
void
|
||||||
ResetWindowPrivates()
|
ResetWindowPrivates(void)
|
||||||
{
|
{
|
||||||
windowPrivateCount = 0;
|
windowPrivateCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT int
|
_X_EXPORT int
|
||||||
AllocateWindowPrivateIndex()
|
AllocateWindowPrivateIndex(void)
|
||||||
{
|
{
|
||||||
return windowPrivateCount++;
|
return windowPrivateCount++;
|
||||||
}
|
}
|
||||||
|
@ -263,13 +263,13 @@ AllocateWindowPrivate(ScreenPtr pScreen, int index2, unsigned amount)
|
||||||
static int gcPrivateCount;
|
static int gcPrivateCount;
|
||||||
|
|
||||||
void
|
void
|
||||||
ResetGCPrivates()
|
ResetGCPrivates(void)
|
||||||
{
|
{
|
||||||
gcPrivateCount = 0;
|
gcPrivateCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT int
|
_X_EXPORT int
|
||||||
AllocateGCPrivateIndex()
|
AllocateGCPrivateIndex(void)
|
||||||
{
|
{
|
||||||
return gcPrivateCount++;
|
return gcPrivateCount++;
|
||||||
}
|
}
|
||||||
|
@ -312,13 +312,13 @@ AllocateGCPrivate(ScreenPtr pScreen, int index2, unsigned amount)
|
||||||
static int pixmapPrivateCount;
|
static int pixmapPrivateCount;
|
||||||
|
|
||||||
void
|
void
|
||||||
ResetPixmapPrivates()
|
ResetPixmapPrivates(void)
|
||||||
{
|
{
|
||||||
pixmapPrivateCount = 0;
|
pixmapPrivateCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT int
|
_X_EXPORT int
|
||||||
AllocatePixmapPrivateIndex()
|
AllocatePixmapPrivateIndex(void)
|
||||||
{
|
{
|
||||||
return pixmapPrivateCount++;
|
return pixmapPrivateCount++;
|
||||||
}
|
}
|
||||||
|
@ -363,7 +363,7 @@ AllocatePixmapPrivate(ScreenPtr pScreen, int index2, unsigned amount)
|
||||||
int colormapPrivateCount;
|
int colormapPrivateCount;
|
||||||
|
|
||||||
void
|
void
|
||||||
ResetColormapPrivates()
|
ResetColormapPrivates(void)
|
||||||
{
|
{
|
||||||
colormapPrivateCount = 0;
|
colormapPrivateCount = 0;
|
||||||
}
|
}
|
||||||
|
@ -424,7 +424,7 @@ AllocateColormapPrivateIndex (InitCmapPrivFunc initPrivFunc)
|
||||||
static int devicePrivateIndex = 0;
|
static int devicePrivateIndex = 0;
|
||||||
|
|
||||||
_X_EXPORT int
|
_X_EXPORT int
|
||||||
AllocateDevicePrivateIndex()
|
AllocateDevicePrivateIndex(void)
|
||||||
{
|
{
|
||||||
return devicePrivateIndex++;
|
return devicePrivateIndex++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -235,7 +235,7 @@ CreateNewResourceType(DeleteType deleteFunc)
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT RESTYPE
|
_X_EXPORT RESTYPE
|
||||||
CreateNewResourceClass()
|
CreateNewResourceClass(void)
|
||||||
{
|
{
|
||||||
RESTYPE next = lastResourceClass >> 1;
|
RESTYPE next = lastResourceClass >> 1;
|
||||||
|
|
||||||
|
@ -844,7 +844,7 @@ FreeClientResources(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
FreeAllResources()
|
FreeAllResources(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -322,6 +322,9 @@ exaPixmapIsOffscreen(PixmapPtr p)
|
||||||
if (p->devPrivate.ptr == NULL)
|
if (p->devPrivate.ptr == NULL)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
if (pExaScr->info->PixmapIsOffscreen)
|
||||||
|
return pExaScr->info->PixmapIsOffscreen(p);
|
||||||
|
|
||||||
return ((unsigned long) ((CARD8 *) p->devPrivate.ptr -
|
return ((unsigned long) ((CARD8 *) p->devPrivate.ptr -
|
||||||
(CARD8 *) pExaScr->info->memoryBase) <
|
(CARD8 *) pExaScr->info->memoryBase) <
|
||||||
pExaScr->info->memorySize);
|
pExaScr->info->memorySize);
|
||||||
|
|
19
exa/exa.h
19
exa/exa.h
|
@ -39,7 +39,7 @@
|
||||||
#include "fb.h"
|
#include "fb.h"
|
||||||
|
|
||||||
#define EXA_VERSION_MAJOR 2
|
#define EXA_VERSION_MAJOR 2
|
||||||
#define EXA_VERSION_MINOR 1
|
#define EXA_VERSION_MINOR 2
|
||||||
#define EXA_VERSION_RELEASE 0
|
#define EXA_VERSION_RELEASE 0
|
||||||
|
|
||||||
typedef struct _ExaOffscreenArea ExaOffscreenArea;
|
typedef struct _ExaOffscreenArea ExaOffscreenArea;
|
||||||
|
@ -636,6 +636,23 @@ typedef struct _ExaDriver {
|
||||||
*/
|
*/
|
||||||
void (*FinishAccess)(PixmapPtr pPix, int index);
|
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
|
/** @name PrepareAccess() and FinishAccess() indices
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -78,4 +78,4 @@ libwfb_la_SOURCES = $(libfb_la_SOURCES)
|
||||||
|
|
||||||
libfb_la_LIBADD = libfbmmx.la
|
libfb_la_LIBADD = libfbmmx.la
|
||||||
|
|
||||||
EXTRA_DIST = fbcmap.c
|
EXTRA_DIST = fbcmap.c fbcmap_mi.c
|
||||||
|
|
91
fb/fbcmap.c
91
fb/fbcmap.c
|
@ -39,7 +39,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "fb.h"
|
#include "fb.h"
|
||||||
|
|
||||||
#ifndef XFree86Server
|
#ifdef XFree86Server
|
||||||
|
#error "You should be compiling fbcmap_mi.c instead of fbcmap.c!"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ColormapPtr FbInstalledMaps[MAXSCREENS];
|
ColormapPtr FbInstalledMaps[MAXSCREENS];
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -584,87 +589,3 @@ fbInitVisuals (VisualPtr *visualp,
|
||||||
*defaultVisp = depth[i].vids[j];
|
*defaultVisp = depth[i].vids[j];
|
||||||
return TRUE;
|
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
|
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
|
@ -26,12 +26,12 @@ libdarwinShared_a_SOURCES = darwin.c \
|
||||||
|
|
||||||
bin_PROGRAMS = XDarwin Xquartz
|
bin_PROGRAMS = XDarwin Xquartz
|
||||||
XDarwin_SOURCES = \
|
XDarwin_SOURCES = \
|
||||||
$(top_srcdir)/fb/fbcmap.c \
|
$(top_srcdir)/fb/fbcmap_mi.c \
|
||||||
$(top_srcdir)/mi/miinitext.c \
|
$(top_srcdir)/mi/miinitext.c \
|
||||||
$(top_srcdir)/Xi/stubs.c
|
$(top_srcdir)/Xi/stubs.c
|
||||||
|
|
||||||
Xquartz_SOURCES = \
|
Xquartz_SOURCES = \
|
||||||
$(top_srcdir)/fb/fbcmap.c \
|
$(top_srcdir)/fb/fbcmap_mi.c \
|
||||||
$(top_srcdir)/mi/miinitext.c \
|
$(top_srcdir)/mi/miinitext.c \
|
||||||
$(top_srcdir)/Xi/stubs.c \
|
$(top_srcdir)/Xi/stubs.c \
|
||||||
apple/X11Application.m \
|
apple/X11Application.m \
|
||||||
|
@ -115,7 +115,7 @@ x11app:
|
||||||
cd apple && xcodebuild CFLAGS="$(XSERVERCFLAGS_CFLAGS)" LDFLAGS="$(XSERVERCFLAGS_LIBS)"
|
cd apple && xcodebuild CFLAGS="$(XSERVERCFLAGS_CFLAGS)" LDFLAGS="$(XSERVERCFLAGS_LIBS)"
|
||||||
|
|
||||||
XDarwinApp_SOURCES = \
|
XDarwinApp_SOURCES = \
|
||||||
$(top_srcdir)/fb/fbcmap.c \
|
$(top_srcdir)/fb/fbcmap_mi.c \
|
||||||
$(top_srcdir)/mi/miinitext.c \
|
$(top_srcdir)/mi/miinitext.c \
|
||||||
$(top_srcdir)/Xi/stubs.c
|
$(top_srcdir)/Xi/stubs.c
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,6 @@ GLX_INCS = -I$(top_srcdir)/hw/xfree86/dixmods/extmod \
|
||||||
GLX_DEFS = @GL_CFLAGS@
|
GLX_DEFS = @GL_CFLAGS@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# It's essential that fbcmap.c be compiled with this flag for DMX to work!!
|
|
||||||
DMX_CFLAGS = -DXFree86Server=1
|
|
||||||
|
|
||||||
if BUILDDOCS
|
if BUILDDOCS
|
||||||
SUBDIRS += doc
|
SUBDIRS += doc
|
||||||
endif
|
endif
|
||||||
|
@ -76,7 +73,7 @@ Xdmx_SOURCES = dmx.c \
|
||||||
dmxwindow.c \
|
dmxwindow.c \
|
||||||
dmxwindow.h \
|
dmxwindow.h \
|
||||||
$(top_srcdir)/mi/miinitext.c \
|
$(top_srcdir)/mi/miinitext.c \
|
||||||
$(top_srcdir)/fb/fbcmap.c \
|
$(top_srcdir)/fb/fbcmap_mi.c \
|
||||||
$(GLX_SRCS)
|
$(GLX_SRCS)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -242,11 +242,7 @@ static int dmxBackendOffscreen(int screen, int x, int y)
|
||||||
void dmxBackendUpdatePosition(pointer private, int x, int y)
|
void dmxBackendUpdatePosition(pointer private, int x, int y)
|
||||||
{
|
{
|
||||||
GETPRIVFROMPRIVATE;
|
GETPRIVFROMPRIVATE;
|
||||||
#if 00 /*BP*/
|
|
||||||
int screen = miPointerCurrentScreen()->myNum;
|
|
||||||
#else
|
|
||||||
int screen = miPointerGetScreen(inputInfo.pointer)->myNum;
|
int screen = miPointerGetScreen(inputInfo.pointer)->myNum;
|
||||||
#endif
|
|
||||||
DMXScreenInfo *dmxScreen = &dmxScreens[priv->myScreen];
|
DMXScreenInfo *dmxScreen = &dmxScreens[priv->myScreen];
|
||||||
int oldRelative = priv->relative;
|
int oldRelative = priv->relative;
|
||||||
int topscreen = dmxBackendFindOverlapping(priv, screen, x, y);
|
int topscreen = dmxBackendFindOverlapping(priv, screen, x, y);
|
||||||
|
@ -358,7 +354,8 @@ void dmxBackendCollectEvents(DevicePtr pDev,
|
||||||
switch (X.type) {
|
switch (X.type) {
|
||||||
case EnterNotify:
|
case EnterNotify:
|
||||||
dmxCommonSaveState(priv);
|
dmxCommonSaveState(priv);
|
||||||
if (entered++) continue;
|
if (entered++)
|
||||||
|
continue;
|
||||||
priv->entered = 1;
|
priv->entered = 1;
|
||||||
ignoreLeave = 1;
|
ignoreLeave = 1;
|
||||||
DMXDBG5("dmxBackendCollectEvents: Enter %lu %d,%d; GRAB %s %p\n",
|
DMXDBG5("dmxBackendCollectEvents: Enter %lu %d,%d; GRAB %s %p\n",
|
||||||
|
@ -382,7 +379,8 @@ void dmxBackendCollectEvents(DevicePtr pDev,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
dmxCommonRestoreState(priv);
|
dmxCommonRestoreState(priv);
|
||||||
if (left++) continue;
|
if (left++)
|
||||||
|
continue;
|
||||||
DMXDBG7("dmxBackendCollectEvents: Leave %lu %d,%d %d %d %s %s\n",
|
DMXDBG7("dmxBackendCollectEvents: Leave %lu %d,%d %d %d %s %s\n",
|
||||||
X.xcrossing.root, X.xcrossing.x, X.xcrossing.y,
|
X.xcrossing.root, X.xcrossing.x, X.xcrossing.y,
|
||||||
X.xcrossing.detail, X.xcrossing.focus,
|
X.xcrossing.detail, X.xcrossing.focus,
|
||||||
|
@ -395,7 +393,6 @@ void dmxBackendCollectEvents(DevicePtr pDev,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
#if 001 /*BP*/
|
|
||||||
DMXDBG9("dmxBackendCollectEvents: MotionNotify %d/%d (mi %d)"
|
DMXDBG9("dmxBackendCollectEvents: MotionNotify %d/%d (mi %d)"
|
||||||
" newscreen=%d: %d %d (e=%d; last=%d,%d)\n",
|
" newscreen=%d: %d %d (e=%d; last=%d,%d)\n",
|
||||||
dmxScreen->index, priv->myScreen,
|
dmxScreen->index, priv->myScreen,
|
||||||
|
@ -403,7 +400,8 @@ void dmxBackendCollectEvents(DevicePtr pDev,
|
||||||
priv->newscreen,
|
priv->newscreen,
|
||||||
X.xmotion.x, X.xmotion.y,
|
X.xmotion.x, X.xmotion.y,
|
||||||
entered, priv->lastX, priv->lastY);
|
entered, priv->lastX, priv->lastY);
|
||||||
if (dmxBackendPendingMotionEvent(priv, TRUE)) continue;
|
if (dmxBackendPendingMotionEvent(priv, TRUE))
|
||||||
|
continue;
|
||||||
if (!(dmxScreen = dmxBackendFindWindow(priv, X.xmotion.window)))
|
if (!(dmxScreen = dmxBackendFindWindow(priv, X.xmotion.window)))
|
||||||
dmxLog(dmxFatal,
|
dmxLog(dmxFatal,
|
||||||
" Event on non-existant window %lu\n",
|
" Event on non-existant window %lu\n",
|
||||||
|
@ -448,25 +446,15 @@ void dmxBackendCollectEvents(DevicePtr pDev,
|
||||||
(dmxScreen->rootYOrigin + X.xmotion.y
|
(dmxScreen->rootYOrigin + X.xmotion.y
|
||||||
- dmxScreen->rootY));
|
- dmxScreen->rootY));
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
/*
|
|
||||||
ErrorF("motion %d, %d, %d\n",
|
|
||||||
X.xmotion.x, X.xmotion.y, X.xmotion.state);
|
|
||||||
*/
|
|
||||||
enqueue(priv->mou, X.type, 0/*X.xbutton.button*/, 0, &X, block);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
enqueue(priv->kbd, X.type, X.xkey.keycode, 0, NULL, block);
|
enqueue(priv->kbd, X.type, X.xkey.keycode, 0, NULL, block);
|
||||||
break;
|
break;
|
||||||
#if 11/*BP*/
|
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
ErrorF("press/release at %d, %d\n", X.xbutton.x, X.xbutton.y);
|
/* fall-through */
|
||||||
/* fall-through */
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
/* Pass the whole event here, because
|
/* Pass the whole event here, because
|
||||||
* this may be an extension event. */
|
* this may be an extension event. */
|
||||||
|
@ -589,12 +577,16 @@ void dmxBackendInit(DevicePtr pDev)
|
||||||
/** Get information about the backend pointer (for initialization). */
|
/** Get information about the backend pointer (for initialization). */
|
||||||
void dmxBackendMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
|
void dmxBackendMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
|
||||||
{
|
{
|
||||||
|
const DMXScreenInfo *dmxScreen = dmxBackendInitPrivate(pDev);
|
||||||
|
|
||||||
info->buttonClass = 1;
|
info->buttonClass = 1;
|
||||||
dmxCommonMouGetMap(pDev, info->map, &info->numButtons);
|
dmxCommonMouGetMap(pDev, info->map, &info->numButtons);
|
||||||
info->valuatorClass = 1;
|
info->valuatorClass = 1;
|
||||||
info->numRelAxes = 2;
|
info->numRelAxes = 2;
|
||||||
info->minval[0] = 0;
|
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->res[0] = 1;
|
||||||
info->minres[0] = 0;
|
info->minres[0] = 0;
|
||||||
info->maxres[0] = 1;
|
info->maxres[0] = 1;
|
||||||
|
|
|
@ -241,13 +241,15 @@ void dmxCommonKbdGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
|
||||||
|
|
||||||
/* Compute pModMap */
|
/* Compute pModMap */
|
||||||
modifier_mapping = XGetModifierMapping(priv->display);
|
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++) {
|
for (j = 0; j < 8; j++) {
|
||||||
int max_keypermod = modifier_mapping->max_keypermod;
|
int max_keypermod = modifier_mapping->max_keypermod;
|
||||||
|
|
||||||
for (i = 0; i < max_keypermod; i++) {
|
for (i = 0; i < max_keypermod; i++) {
|
||||||
CARD8 keycode = modifier_mapping->modifiermap[j*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);
|
XFreeModifiermap(modifier_mapping);
|
||||||
|
@ -611,6 +613,7 @@ void dmxCommonSaveState(pointer private)
|
||||||
&priv->dmxLocal->kctrl);
|
&priv->dmxLocal->kctrl);
|
||||||
|
|
||||||
priv->savedModMap = XGetModifierMapping(priv->display);
|
priv->savedModMap = XGetModifierMapping(priv->display);
|
||||||
|
|
||||||
modmap = XNewModifiermap(0);
|
modmap = XNewModifiermap(0);
|
||||||
XSetModifierMapping(priv->display, modmap);
|
XSetModifierMapping(priv->display, modmap);
|
||||||
if (dmxInput->scrnIdx != -1)
|
if (dmxInput->scrnIdx != -1)
|
||||||
|
@ -627,8 +630,10 @@ void dmxCommonRestoreState(pointer private)
|
||||||
int retcode = -1;
|
int retcode = -1;
|
||||||
CARD32 start;
|
CARD32 start;
|
||||||
|
|
||||||
if (dmxInput->console) priv = dmxInput->devs[0]->private;
|
if (dmxInput->console)
|
||||||
if (!priv->stateSaved) return;
|
priv = dmxInput->devs[0]->private;
|
||||||
|
if (!priv->stateSaved)
|
||||||
|
return;
|
||||||
priv->stateSaved = 0;
|
priv->stateSaved = 0;
|
||||||
|
|
||||||
DMXDBG0("dmxCommonRestoreState\n");
|
DMXDBG0("dmxCommonRestoreState\n");
|
||||||
|
@ -645,7 +650,8 @@ void dmxCommonRestoreState(pointer private)
|
||||||
CARD32 tmp;
|
CARD32 tmp;
|
||||||
|
|
||||||
retcode = XSetModifierMapping(priv->display, priv->savedModMap);
|
retcode = XSetModifierMapping(priv->display, priv->savedModMap);
|
||||||
if (retcode == MappingSuccess) break;
|
if (retcode == MappingSuccess)
|
||||||
|
break;
|
||||||
if (retcode == MappingBusy)
|
if (retcode == MappingBusy)
|
||||||
dmxLogInput(dmxInput, "Keyboard busy, waiting\n");
|
dmxLogInput(dmxInput, "Keyboard busy, waiting\n");
|
||||||
else
|
else
|
||||||
|
|
|
@ -860,12 +860,17 @@ void dmxConsoleInit(DevicePtr pDev)
|
||||||
* for pointers. */
|
* for pointers. */
|
||||||
void dmxConsoleMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
|
void dmxConsoleMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
|
||||||
{
|
{
|
||||||
|
GETPRIVFROMPDEV;
|
||||||
|
|
||||||
info->buttonClass = 1;
|
info->buttonClass = 1;
|
||||||
dmxCommonMouGetMap(pDev, info->map, &info->numButtons);
|
dmxCommonMouGetMap(pDev, info->map, &info->numButtons);
|
||||||
info->valuatorClass = 1;
|
info->valuatorClass = 1;
|
||||||
info->numRelAxes = 2;
|
info->numRelAxes = 2;
|
||||||
info->minval[0] = 0;
|
info->minval[0] = 0;
|
||||||
info->maxval[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->res[0] = 1;
|
||||||
info->minres[0] = 0;
|
info->minres[0] = 0;
|
||||||
info->maxres[0] = 1;
|
info->maxres[0] = 1;
|
||||||
|
|
|
@ -79,7 +79,9 @@ void dmxDummyMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
|
||||||
info->valuatorClass = 1;
|
info->valuatorClass = 1;
|
||||||
info->numRelAxes = 2;
|
info->numRelAxes = 2;
|
||||||
info->minval[0] = 0;
|
info->minval[0] = 0;
|
||||||
|
info->minval[1] = 0;
|
||||||
info->maxval[0] = 0;
|
info->maxval[0] = 0;
|
||||||
|
info->maxval[1] = 0;
|
||||||
info->res[0] = 1;
|
info->res[0] = 1;
|
||||||
info->minres[0] = 0;
|
info->minres[0] = 0;
|
||||||
info->maxres[0] = 1;
|
info->maxres[0] = 1;
|
||||||
|
|
|
@ -103,7 +103,25 @@ static int dmxCheckFunctionKeys(DMXLocalInputInfoPtr dmxLocal,
|
||||||
{
|
{
|
||||||
DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
|
DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
|
||||||
unsigned short state = 0;
|
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)
|
if (dmxLocal->sendsCore)
|
||||||
state = dmxLocalCoreKeyboard->pDevice->key->state;
|
state = dmxLocalCoreKeyboard->pDevice->key->state;
|
||||||
else if (dmxLocal->pDevice->key)
|
else if (dmxLocal->pDevice->key)
|
||||||
|
@ -112,7 +130,9 @@ static int dmxCheckFunctionKeys(DMXLocalInputInfoPtr dmxLocal,
|
||||||
DMXDBG3("dmxCheckFunctionKeys: keySym=0x%04x %s state=0x%04x\n",
|
DMXDBG3("dmxCheckFunctionKeys: keySym=0x%04x %s state=0x%04x\n",
|
||||||
keySym, type == KeyPress ? "press" : "release", state);
|
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) {
|
switch (keySym) {
|
||||||
case XK_g:
|
case XK_g:
|
||||||
|
@ -147,16 +167,25 @@ static void dmxEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, xEvent *e,
|
||||||
int type = e->u.u.type;
|
int type = e->u.u.type;
|
||||||
|
|
||||||
switch (e->u.u.type) {
|
switch (e->u.u.type) {
|
||||||
case KeyPress: type = DeviceKeyPress; break;
|
case KeyPress:
|
||||||
case KeyRelease: type = DeviceKeyRelease; break;
|
type = DeviceKeyPress;
|
||||||
case ButtonPress: type = DeviceButtonPress; break;
|
break;
|
||||||
case ButtonRelease: type = DeviceButtonRelease; break;
|
case KeyRelease:
|
||||||
|
type = DeviceKeyRelease;
|
||||||
|
break;
|
||||||
|
case ButtonPress:
|
||||||
|
type = DeviceButtonPress;
|
||||||
|
break;
|
||||||
|
case ButtonRelease:
|
||||||
|
type = DeviceButtonRelease;
|
||||||
|
break;
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
dmxLog(dmxError,
|
dmxLog(dmxError,
|
||||||
"dmxEnqueueExtEvent: MotionNotify not allowed here\n");
|
"dmxEnqueueExtEvent: MotionNotify not allowed here\n");
|
||||||
return;
|
return;
|
||||||
default:
|
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,
|
dmxLogInput(dmxInput,
|
||||||
"dmxEnqueueExtEvent: Unhandled %s event (%d)\n",
|
"dmxEnqueueExtEvent: Unhandled %s event (%d)\n",
|
||||||
e->u.u.type >= LASTEvent ? "extension" : "non-extension",
|
e->u.u.type >= LASTEvent ? "extension" : "non-extension",
|
||||||
|
@ -174,9 +203,11 @@ static void dmxEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, xEvent *e,
|
||||||
xv->num_valuators = 0;
|
xv->num_valuators = 0;
|
||||||
xv->first_valuator = 0;
|
xv->first_valuator = 0;
|
||||||
|
|
||||||
if (block) dmxSigioBlock();
|
if (block)
|
||||||
|
dmxSigioBlock();
|
||||||
dmxeqEnqueue(xE);
|
dmxeqEnqueue(xE);
|
||||||
if (block) dmxSigioUnblock();
|
if (block)
|
||||||
|
dmxSigioUnblock();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -186,38 +217,27 @@ DMXScreenInfo *dmxFindFirstScreen(int x, int y)
|
||||||
|
|
||||||
for (i = 0; i < dmxNumScreens; i++) {
|
for (i = 0; i < dmxNumScreens; i++) {
|
||||||
DMXScreenInfo *dmxScreen = &dmxScreens[i];
|
DMXScreenInfo *dmxScreen = &dmxScreens[i];
|
||||||
if (dmxOnScreen(x, y, dmxScreen)) return dmxScreen;
|
if (dmxOnScreen(x, y, dmxScreen))
|
||||||
|
return dmxScreen;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 11/*BP*/
|
/**
|
||||||
|
* Enqueue a motion event.
|
||||||
|
*/
|
||||||
static void enqueueMotion(DevicePtr pDev, int x, int y)
|
static void enqueueMotion(DevicePtr pDev, int x, int y)
|
||||||
{
|
{
|
||||||
GETDMXINPUTFROMPDEV;
|
GETDMXLOCALFROMPDEV;
|
||||||
DeviceIntPtr p = dmxLocal->pDevice;
|
DeviceIntPtr p = dmxLocal->pDevice;
|
||||||
int i, nevents, valuators[3];
|
int i, nevents, valuators[3];
|
||||||
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
||||||
int detail = 0;
|
int detail = 0; /* XXX should this be mask of pressed buttons? */
|
||||||
|
|
||||||
valuators[0] = x;
|
valuators[0] = x;
|
||||||
valuators[1] = y;
|
valuators[1] = y;
|
||||||
valuators[2] = detail;
|
nevents = GetPointerEvents(events, p, MotionNotify, detail,
|
||||||
nevents = GetPointerEvents(events,
|
POINTER_ABSOLUTE, 0, 2, valuators);
|
||||||
/*pDev*/p,
|
|
||||||
MotionNotify,
|
|
||||||
detail,
|
|
||||||
POINTER_ABSOLUTE,
|
|
||||||
0, 2, valuators);
|
|
||||||
ErrorF("MOTION2 %d, %d n = %d\n", valuators[0], valuators[1], nevents);
|
|
||||||
/*
|
|
||||||
ErrorF("NEW MOTION %d st %d (%d,%d,%d) n=%d\n",
|
|
||||||
detail, e->xmotion.state,
|
|
||||||
valuators[0], valuators[1], valuators[2],
|
|
||||||
nevents);
|
|
||||||
*/
|
|
||||||
for (i = 0; i < nevents; i++)
|
for (i = 0; i < nevents; i++)
|
||||||
mieqEnqueue(p, events + i);
|
mieqEnqueue(p, events + i);
|
||||||
xfree(events);
|
xfree(events);
|
||||||
|
@ -225,8 +245,8 @@ static void enqueueMotion(DevicePtr pDev, int x, int y)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
void
|
||||||
dmxCoreMotion2(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
|
dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
|
||||||
{
|
{
|
||||||
DMXScreenInfo *dmxScreen;
|
DMXScreenInfo *dmxScreen;
|
||||||
DMXInputInfo *dmxInput;
|
DMXInputInfo *dmxInput;
|
||||||
|
@ -235,7 +255,8 @@ dmxCoreMotion2(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
|
||||||
int localY;
|
int localY;
|
||||||
int i;
|
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",
|
DMXDBG5("dmxCoreMotion(%d,%d,%d) dmxGlobalX=%d dmxGlobalY=%d\n",
|
||||||
x, y, delta, dmxGlobalX, dmxGlobalY);
|
x, y, delta, dmxGlobalX, dmxGlobalY);
|
||||||
|
@ -244,13 +265,15 @@ dmxCoreMotion2(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
|
||||||
dmxGlobalX = x;
|
dmxGlobalX = x;
|
||||||
dmxGlobalY = y;
|
dmxGlobalY = y;
|
||||||
|
|
||||||
if (dmxGlobalX < 0) dmxGlobalX = 0;
|
if (dmxGlobalX < 0)
|
||||||
if (dmxGlobalY < 0) dmxGlobalY = 0;
|
dmxGlobalX = 0;
|
||||||
if (dmxGlobalX >= dmxGlobalWidth) dmxGlobalX = dmxGlobalWidth + delta -1;
|
if (dmxGlobalY < 0)
|
||||||
if (dmxGlobalY >= dmxGlobalHeight) dmxGlobalY = dmxGlobalHeight + delta -1;
|
dmxGlobalY = 0;
|
||||||
|
if (dmxGlobalX >= dmxGlobalWidth)
|
||||||
|
dmxGlobalX = dmxGlobalWidth + delta -1;
|
||||||
|
if (dmxGlobalY >= dmxGlobalHeight)
|
||||||
|
dmxGlobalY = dmxGlobalHeight + delta -1;
|
||||||
|
|
||||||
ErrorF("Global Pos: %d, %d\n", dmxGlobalX, dmxGlobalY);
|
|
||||||
|
|
||||||
if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) {
|
if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) {
|
||||||
localX = dmxGlobalX - dmxScreen->rootXOrigin;
|
localX = dmxGlobalX - dmxScreen->rootXOrigin;
|
||||||
localY = dmxGlobalY - dmxScreen->rootYOrigin;
|
localY = dmxGlobalY - dmxScreen->rootYOrigin;
|
||||||
|
@ -259,13 +282,8 @@ dmxCoreMotion2(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
|
||||||
/* Screen is old screen */
|
/* Screen is old screen */
|
||||||
if (block)
|
if (block)
|
||||||
dmxSigioBlock();
|
dmxSigioBlock();
|
||||||
#if 000
|
|
||||||
miPointerSetPosition(inputInfo.pointer, &localX, &localY,
|
|
||||||
GetTimeInMillis());
|
|
||||||
#else
|
|
||||||
if (pDev)
|
if (pDev)
|
||||||
enqueueMotion(pDev, localX, localY);
|
enqueueMotion(pDev, localX, localY);
|
||||||
#endif
|
|
||||||
if (block)
|
if (block)
|
||||||
dmxSigioUnblock();
|
dmxSigioUnblock();
|
||||||
} else {
|
} else {
|
||||||
|
@ -277,13 +295,8 @@ dmxCoreMotion2(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
|
||||||
dmxeqProcessInputEvents();
|
dmxeqProcessInputEvents();
|
||||||
miPointerSetScreen(inputInfo.pointer, dmxScreen->index,
|
miPointerSetScreen(inputInfo.pointer, dmxScreen->index,
|
||||||
localX, localY);
|
localX, localY);
|
||||||
#if 000
|
|
||||||
miPointerSetPosition(inputInfo.pointer, &localX, &localY,
|
|
||||||
GetTimeInMillis());
|
|
||||||
#else
|
|
||||||
if (pDev)
|
if (pDev)
|
||||||
enqueueMotion(pDev, localX, localY);
|
enqueueMotion(pDev, localX, localY);
|
||||||
#endif
|
|
||||||
if (block)
|
if (block)
|
||||||
dmxSigioUnblock();
|
dmxSigioUnblock();
|
||||||
}
|
}
|
||||||
|
@ -307,109 +320,6 @@ dmxCoreMotion2(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
|
||||||
* drivers */
|
* drivers */
|
||||||
for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) {
|
for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) {
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
for (j = 0; j < dmxInput->numDevs; j += dmxInput->devs[j]->binding)
|
|
||||||
if (!dmxInput->detached
|
|
||||||
&& dmxInput->devs[j]->sendsCore
|
|
||||||
&& dmxInput->devs[j]->update_position)
|
|
||||||
dmxInput->devs[j]->update_position(dmxInput->devs[j]->private,
|
|
||||||
dmxGlobalX, dmxGlobalY);
|
|
||||||
}
|
|
||||||
if (!dmxScreen) ProcessInputEvents();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
|
|
||||||
{
|
|
||||||
DMXScreenInfo *dmxScreen;
|
|
||||||
DMXInputInfo *dmxInput;
|
|
||||||
ScreenPtr pScreen;
|
|
||||||
int localX;
|
|
||||||
int localY;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
#if 11/*BP*/
|
|
||||||
dmxCoreMotion2(pDev, x, y, delta, block);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!dmxGlobalInvalid && dmxGlobalX == x && dmxGlobalY == y) return;
|
|
||||||
|
|
||||||
DMXDBG5("dmxCoreMotion(%d,%d,%d) dmxGlobalX=%d dmxGlobalY=%d\n",
|
|
||||||
x, y, delta, dmxGlobalX, dmxGlobalY);
|
|
||||||
|
|
||||||
dmxGlobalInvalid = 0;
|
|
||||||
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;
|
|
||||||
|
|
||||||
ErrorF("Global Pos: %d, %d\n", dmxGlobalX, dmxGlobalY);
|
|
||||||
|
|
||||||
if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) {
|
|
||||||
localX = dmxGlobalX - dmxScreen->rootXOrigin;
|
|
||||||
localY = dmxGlobalY - dmxScreen->rootYOrigin;
|
|
||||||
#if 00 /*BP*/
|
|
||||||
if ((pScreen = miPointerCurrentScreen())
|
|
||||||
#else
|
|
||||||
if ((pScreen = miPointerGetScreen(inputInfo.pointer))
|
|
||||||
#endif
|
|
||||||
&& pScreen->myNum == dmxScreen->index) {
|
|
||||||
/* Screen is old screen */
|
|
||||||
if (block) dmxSigioBlock();
|
|
||||||
#if 00 /*BP*/
|
|
||||||
miPointerAbsoluteCursor(localX, localY, GetTimeInMillis());
|
|
||||||
#else
|
|
||||||
miPointerSetPosition(inputInfo.pointer, &localX, &localY,
|
|
||||||
GetTimeInMillis());
|
|
||||||
#endif
|
|
||||||
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();
|
|
||||||
dmxeqProcessInputEvents();
|
|
||||||
#if 00 /*BP*/
|
|
||||||
miPointerSetNewScreen(dmxScreen->index, localX, localY);
|
|
||||||
miPointerAbsoluteCursor(localX, localY, GetTimeInMillis());
|
|
||||||
#else
|
|
||||||
miPointerSetScreen(inputInfo.pointer, dmxScreen->index,
|
|
||||||
localX, localY);
|
|
||||||
miPointerSetPosition(inputInfo.pointer, &localX, &localY,
|
|
||||||
GetTimeInMillis());
|
|
||||||
#endif
|
|
||||||
if (block) dmxSigioUnblock();
|
|
||||||
}
|
|
||||||
#if 00 /*BP*/
|
|
||||||
miPointerPosition(&localX, &localY);
|
|
||||||
#else
|
|
||||||
miPointerGetPosition(inputInfo.pointer, &localX, &localY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 00 /*BP*/
|
|
||||||
if ((pScreen = miPointerCurrentScreen())) {
|
|
||||||
#else
|
|
||||||
if ((pScreen = miPointerGetScreen(inputInfo.pointer))) {
|
|
||||||
#endif
|
|
||||||
dmxGlobalX = localX + dmxScreens[pScreen->myNum].rootXOrigin;
|
|
||||||
dmxGlobalY = localY + dmxScreens[pScreen->myNum].rootYOrigin;
|
|
||||||
ErrorF("Global is now %d, %d\n", dmxGlobalX, dmxGlobalY);
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* 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)
|
for (j = 0; j < dmxInput->numDevs; j += dmxInput->devs[j]->binding)
|
||||||
if (!dmxInput->detached
|
if (!dmxInput->detached
|
||||||
&& dmxInput->devs[j]->sendsCore
|
&& dmxInput->devs[j]->sendsCore
|
||||||
|
@ -512,10 +422,12 @@ static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block) dmxSigioBlock();
|
if (block)
|
||||||
|
dmxSigioBlock();
|
||||||
dmxPointerPutMotionEvent(pDevice, firstAxis, axesCount, v, xev->time);
|
dmxPointerPutMotionEvent(pDevice, firstAxis, axesCount, v, xev->time);
|
||||||
dmxeqEnqueue(xE);
|
dmxeqEnqueue(xE);
|
||||||
if (block) dmxSigioUnblock();
|
if (block)
|
||||||
|
dmxSigioUnblock();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
|
static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
|
||||||
|
@ -529,7 +441,8 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
|
||||||
XDeviceKeyEvent *ke = (XDeviceKeyEvent *)e;
|
XDeviceKeyEvent *ke = (XDeviceKeyEvent *)e;
|
||||||
XDeviceMotionEvent *me = (XDeviceMotionEvent *)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) {
|
if ((XID)dmxLocal->deviceId != ke->deviceid) {
|
||||||
/* Search for the correct dmxLocal,
|
/* Search for the correct dmxLocal,
|
||||||
|
@ -540,7 +453,8 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
|
||||||
DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
|
DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
|
||||||
for (i = 0; i < dmxInput->numDevs; i++) {
|
for (i = 0; i < dmxInput->numDevs; i++) {
|
||||||
dmxLocal = dmxInput->devs[i];
|
dmxLocal = dmxInput->devs[i];
|
||||||
if ((XID)dmxLocal->deviceId == ke->deviceid) break;
|
if ((XID)dmxLocal->deviceId == ke->deviceid)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -589,9 +503,11 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
|
||||||
xv->valuator4 = ke->axis_data[4];
|
xv->valuator4 = ke->axis_data[4];
|
||||||
xv->valuator5 = ke->axis_data[5];
|
xv->valuator5 = ke->axis_data[5];
|
||||||
|
|
||||||
if (block) dmxSigioBlock();
|
if (block)
|
||||||
|
dmxSigioBlock();
|
||||||
dmxeqEnqueue(xE);
|
dmxeqEnqueue(xE);
|
||||||
if (block) dmxSigioUnblock();
|
if (block)
|
||||||
|
dmxSigioUnblock();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XI_DeviceMotionNotify:
|
case XI_DeviceMotionNotify:
|
||||||
|
@ -694,7 +610,8 @@ static KeySym dmxKeyCodeToKeySym(DMXLocalInputInfoPtr dmxLocal,
|
||||||
if (!dmxLocal || !dmxLocal->pDevice || !dmxLocal->pDevice->key)
|
if (!dmxLocal || !dmxLocal->pDevice || !dmxLocal->pDevice->key)
|
||||||
return NoSymbol;
|
return NoSymbol;
|
||||||
pKeySyms = &dmxLocal->pDevice->key->curKeySyms;
|
pKeySyms = &dmxLocal->pDevice->key->curKeySyms;
|
||||||
if (!pKeySyms) return NoSymbol;
|
if (!pKeySyms)
|
||||||
|
return NoSymbol;
|
||||||
|
|
||||||
if (keyCode > pKeySyms->minKeyCode && keyCode <= pKeySyms->maxKeyCode) {
|
if (keyCode > pKeySyms->minKeyCode && keyCode <= pKeySyms->maxKeyCode) {
|
||||||
DMXDBG2("dmxKeyCodeToKeySym: Translated keyCode=%d to keySym=0x%04x\n",
|
DMXDBG2("dmxKeyCodeToKeySym: Translated keyCode=%d to keySym=0x%04x\n",
|
||||||
|
@ -743,14 +660,16 @@ static int dmxFixup(DevicePtr pDev, int detail, KeySym keySym)
|
||||||
dmxLocal->pDevice->name);
|
dmxLocal->pDevice->name);
|
||||||
return NoSymbol;
|
return NoSymbol;
|
||||||
}
|
}
|
||||||
if (!keySym) keySym = dmxKeyCodeToKeySym(dmxLocal, detail);
|
if (!keySym)
|
||||||
if (keySym == NoSymbol) return detail;
|
keySym = dmxKeyCodeToKeySym(dmxLocal, detail);
|
||||||
|
if (keySym == NoSymbol)
|
||||||
|
return detail;
|
||||||
keyCode = dmxKeySymToKeyCode(dmxLocalCoreKeyboard, keySym, detail);
|
keyCode = dmxKeySymToKeyCode(dmxLocalCoreKeyboard, keySym, detail);
|
||||||
|
|
||||||
return keyCode ? keyCode : 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
|
* specified \a type and \a detail. If the event is a KeyPress or
|
||||||
* KeyRelease event, then the \a keySym is also specified.
|
* KeyRelease event, then the \a keySym is also specified.
|
||||||
*
|
*
|
||||||
|
@ -762,103 +681,56 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
|
||||||
{
|
{
|
||||||
GETDMXINPUTFROMPDEV;
|
GETDMXINPUTFROMPDEV;
|
||||||
xEvent xE;
|
xEvent xE;
|
||||||
|
DeviceIntPtr p = dmxLocal->pDevice;
|
||||||
|
int i, nevents, valuators[3];
|
||||||
|
xEvent *events;
|
||||||
|
|
||||||
DMXDBG2("dmxEnqueue: Enqueuing type=%d detail=0x%0x\n", type, detail);
|
DMXDBG2("dmxEnqueue: Enqueuing type=%d detail=0x%0x\n", type, detail);
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
if (!keySym) keySym = dmxKeyCodeToKeySym(dmxLocal, detail);
|
if (!keySym)
|
||||||
|
keySym = dmxKeyCodeToKeySym(dmxLocal, detail);
|
||||||
if (dmxCheckFunctionKeys(dmxLocal, type, keySym))
|
if (dmxCheckFunctionKeys(dmxLocal, type, keySym))
|
||||||
return;
|
return;
|
||||||
if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard)
|
if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard)
|
||||||
xE.u.u.detail = dmxFixup(pDev, detail, keySym);
|
xE.u.u.detail = dmxFixup(pDev, detail, keySym);
|
||||||
#if 11/*BP*/
|
|
||||||
{
|
events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
||||||
DeviceIntPtr p = dmxLocal->pDevice;
|
/*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/
|
||||||
int i, nevents;
|
nevents = GetKeyboardEvents(events, p, type, detail);
|
||||||
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
for (i = 0; i < nevents; i++)
|
||||||
nevents = GetKeyboardEvents(events,
|
mieqEnqueue(p, events + i);
|
||||||
/*pDev*/p,
|
xfree(events);
|
||||||
/*KeyPress*/type,
|
return;
|
||||||
/*n*/detail);
|
|
||||||
ErrorF("KEY %d n=%d\n", detail, nevents);
|
|
||||||
for (i = 0; i < nevents; i++)
|
|
||||||
mieqEnqueue(p, events + i);
|
|
||||||
xfree(events);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
#if 00 /*BP*/
|
|
||||||
detail = dmxGetButtonMapping(dmxLocal, detail);
|
detail = dmxGetButtonMapping(dmxLocal, detail);
|
||||||
#else
|
events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
||||||
{
|
nevents = GetPointerEvents(events, p, type, detail,
|
||||||
DeviceIntPtr p = dmxLocal->pDevice;
|
POINTER_ABSOLUTE,
|
||||||
int i, nevents, valuators[3];
|
0, /* first_valuator = 0 */
|
||||||
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
0, /* num_valuators = 0 */
|
||||||
|
valuators);
|
||||||
|
for (i = 0; i < nevents; i++)
|
||||||
|
mieqEnqueue(p, events + i);
|
||||||
|
xfree(events);
|
||||||
|
return;
|
||||||
|
|
||||||
valuators[0] = e->xbutton.x;
|
|
||||||
valuators[1] = e->xbutton.y;
|
|
||||||
/*
|
|
||||||
valuators[0] = dmxGlobalX;
|
|
||||||
valuators[1] = dmxGlobalY;
|
|
||||||
*/
|
|
||||||
valuators[2] = e->xbutton.button;
|
|
||||||
nevents = GetPointerEvents(events,
|
|
||||||
/*pDev*/p,
|
|
||||||
/*KeyPress*/type,
|
|
||||||
detail,
|
|
||||||
POINTER_ABSOLUTE,
|
|
||||||
0, 2/*3*/, valuators);
|
|
||||||
|
|
||||||
ErrorF("BUTTON %d, %d %d n=%d\n",
|
|
||||||
valuators[0], valuators[1], valuators[2], nevents);
|
|
||||||
|
|
||||||
for (i = 0; i < nevents; i++)
|
|
||||||
mieqEnqueue(p, events + i);
|
|
||||||
xfree(events);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
/* All MotionNotify events should be sent via dmxCoreMotion and
|
events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
||||||
* dmxExtMotion -- no input driver should build motion events by
|
valuators[0] = e->xmotion.x;
|
||||||
* hand. */
|
valuators[1] = e->xmotion.y;
|
||||||
#if 00 /*BP*/
|
valuators[2] = e->xmotion.state;
|
||||||
dmxLog(dmxError, "dmxEnqueueXEvent: MotionNotify not allowed here\n");
|
nevents = GetPointerEvents(events, p, type, detail,
|
||||||
#else
|
POINTER_ABSOLUTE, 0, 3, valuators);
|
||||||
{
|
for (i = 0; i < nevents; i++)
|
||||||
DeviceIntPtr p = dmxLocal->pDevice;
|
mieqEnqueue(p, events + i);
|
||||||
int i, nevents, valuators[3];
|
xfree(events);
|
||||||
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
return;
|
||||||
valuators[0] = e->xmotion.x;
|
|
||||||
valuators[1] = e->xmotion.y;
|
|
||||||
valuators[2] = e->xmotion.state;
|
|
||||||
nevents = GetPointerEvents(events,
|
|
||||||
/*pDev*/p,
|
|
||||||
/*KeyPress*/type,
|
|
||||||
detail,
|
|
||||||
POINTER_ABSOLUTE,
|
|
||||||
0, 3, valuators);
|
|
||||||
ErrorF("MOTION %d, %d n = %d\n", valuators[0], valuators[1], nevents);
|
|
||||||
/*
|
|
||||||
ErrorF("NEW MOTION %d st %d (%d,%d,%d) n=%d\n",
|
|
||||||
detail, e->xmotion.state,
|
|
||||||
valuators[0], valuators[1], valuators[2],
|
|
||||||
nevents);
|
|
||||||
*/
|
|
||||||
for (i = 0; i < nevents; i++)
|
|
||||||
mieqEnqueue(p, events + i);
|
|
||||||
xfree(events);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
/* Always ignore these events */
|
|
||||||
case EnterNotify:
|
case EnterNotify:
|
||||||
case LeaveNotify:
|
case LeaveNotify:
|
||||||
case KeymapNotify:
|
case KeymapNotify:
|
||||||
|
@ -866,12 +738,12 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
|
||||||
* modifier map on the backend/console
|
* modifier map on the backend/console
|
||||||
* input device so that we have complete
|
* input device so that we have complete
|
||||||
* control of the input device LEDs. */
|
* control of the input device LEDs. */
|
||||||
ErrorF("Enter/Leave/Keymap/Mapping\n");
|
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
#ifdef XINPUT
|
#ifdef XINPUT
|
||||||
if (type == ProximityIn || type == ProximityOut) {
|
if (type == ProximityIn || type == ProximityOut) {
|
||||||
if (dmxLocal->sendsCore) return; /* Not a core event */
|
if (dmxLocal->sendsCore)
|
||||||
|
return; /* Not a core event */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -887,25 +759,19 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 00 /* dead code? */
|
||||||
memset(&xE, 0, sizeof(xE));
|
memset(&xE, 0, sizeof(xE));
|
||||||
xE.u.u.type = type;
|
xE.u.u.type = type;
|
||||||
xE.u.u.detail = detail;
|
xE.u.u.detail = detail;
|
||||||
xE.u.keyButtonPointer.time = GetTimeInMillis();
|
xE.u.keyButtonPointer.time = GetTimeInMillis();
|
||||||
|
|
||||||
#ifdef XINPUT
|
#ifdef XINPUT
|
||||||
if (!dmxLocal->sendsCore) dmxEnqueueExtEvent(dmxLocal, &xE, block);
|
if (!dmxLocal->sendsCore)
|
||||||
|
dmxEnqueueExtEvent(dmxLocal, &xE, block);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#if 00 /*BP*/
|
|
||||||
dmxeqEnqueue(&xE);
|
dmxeqEnqueue(&xE);
|
||||||
#else
|
#endif /*00*/
|
||||||
/* never get here! */
|
|
||||||
if (0) {
|
|
||||||
DeviceIntPtr p = dmxLocal->pDevice;
|
|
||||||
ErrorF("enque %d\n", type);
|
|
||||||
mieqEnqueue(p, &xE);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A pointer to this routine is passed to low-level input drivers so
|
/** A pointer to this routine is passed to low-level input drivers so
|
||||||
|
|
|
@ -505,11 +505,10 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
|
||||||
GetMaximumEventsNum(),
|
GetMaximumEventsNum(),
|
||||||
#endif
|
#endif
|
||||||
Relative);
|
Relative);
|
||||||
ErrorF("MOTION BUFFER SIZE %d\n", GetMaximumEventsNum());
|
|
||||||
#ifdef XINPUT
|
#ifdef XINPUT
|
||||||
for (i = 0; i < info.numRelAxes; i++)
|
for (i = 0; i < info.numRelAxes; i++)
|
||||||
InitValuatorAxisStruct(pDevice, i, info.minval[0],
|
InitValuatorAxisStruct(pDevice, i, info.minval[0],
|
||||||
1280/*info.maxval[0]*/, info.res[0],
|
info.maxval[0], info.res[0],
|
||||||
info.minres[0], info.maxres[0]);
|
info.minres[0], info.maxres[0]);
|
||||||
#endif
|
#endif
|
||||||
} else if (info.numRelAxes) {
|
} else if (info.numRelAxes) {
|
||||||
|
@ -520,7 +519,7 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
|
||||||
#ifdef XINPUT
|
#ifdef XINPUT
|
||||||
for (i = 0; i < info.numRelAxes; i++)
|
for (i = 0; i < info.numRelAxes; i++)
|
||||||
InitValuatorAxisStruct(pDevice, i, info.minval[0],
|
InitValuatorAxisStruct(pDevice, i, info.minval[0],
|
||||||
1280/*info.maxval[0]*/, info.res[0],
|
info.maxval[0], info.res[0],
|
||||||
info.minres[0], info.maxres[0]);
|
info.minres[0], info.maxres[0]);
|
||||||
#endif
|
#endif
|
||||||
} else if (info.numAbsAxes) {
|
} else if (info.numAbsAxes) {
|
||||||
|
@ -531,7 +530,7 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
|
||||||
#ifdef XINPUT
|
#ifdef XINPUT
|
||||||
for (i = 0; i < info.numAbsAxes; i++)
|
for (i = 0; i < info.numAbsAxes; i++)
|
||||||
InitValuatorAxisStruct(pDevice, i+info.numRelAxes,
|
InitValuatorAxisStruct(pDevice, i+info.numRelAxes,
|
||||||
info.minval[i+1], 1280/*info.maxval[i+1]*/,
|
info.minval[i+1], info.maxval[i+1],
|
||||||
info.res[i+1], info.minres[i+1],
|
info.res[i+1], info.minres[i+1],
|
||||||
info.maxres[i+1]);
|
info.maxres[i+1]);
|
||||||
#endif
|
#endif
|
||||||
|
@ -588,10 +587,6 @@ static void dmxProcessInputEvents(DMXInputInfo *dmxInput)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/*
|
|
||||||
ErrorF("%s\n", __FUNCTION__);
|
|
||||||
*/
|
|
||||||
|
|
||||||
dmxeqProcessInputEvents();
|
dmxeqProcessInputEvents();
|
||||||
#if 00 /*BP*/
|
#if 00 /*BP*/
|
||||||
miPointerUpdate();
|
miPointerUpdate();
|
||||||
|
|
|
@ -2307,7 +2307,7 @@ ChangeDeviceControl(register ClientPtr client, DeviceIntPtr pDev,
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NewInputDeviceRequest(InputOption *options)
|
NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev)
|
||||||
{
|
{
|
||||||
InputOption *option = NULL;
|
InputOption *option = NULL;
|
||||||
KdPointerInfo *pi = NULL;
|
KdPointerInfo *pi = NULL;
|
||||||
|
@ -2372,5 +2372,16 @@ NewInputDeviceRequest(InputOption *options)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pi) {
|
||||||
|
*pdev = pi->dixdev;
|
||||||
|
} else if(ki) {
|
||||||
|
*pdev = ki->dixdev;
|
||||||
|
}
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
DeleteInputDeviceRequest(DeviceIntPtr pDev)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -14,8 +14,8 @@ SRCS = InitInput.c \
|
||||||
$(top_srcdir)/Xi/stubs.c \
|
$(top_srcdir)/Xi/stubs.c \
|
||||||
$(top_srcdir)/mi/miinitext.c
|
$(top_srcdir)/mi/miinitext.c
|
||||||
|
|
||||||
libfbcmap_a_CFLAGS = $(AM_CFLAGS) -DXFree86Server
|
libfbcmap_a_CFLAGS = $(AM_CFLAGS)
|
||||||
libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap.c
|
libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c
|
||||||
|
|
||||||
Xvfb_SOURCES = $(SRCS)
|
Xvfb_SOURCES = $(SRCS)
|
||||||
|
|
||||||
|
|
|
@ -1271,7 +1271,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
|
||||||
(count + 1) * sizeof(IDevRec));
|
(count + 1) * sizeof(IDevRec));
|
||||||
indp[count - 1] = Pointer;
|
indp[count - 1] = Pointer;
|
||||||
indp[count - 1].extraOptions =
|
indp[count - 1].extraOptions =
|
||||||
xf86addNewOption(NULL, "CorePointer", NULL);
|
xf86addNewOption(NULL, xnfstrdup("CorePointer"), NULL);
|
||||||
indp[count].identifier = NULL;
|
indp[count].identifier = NULL;
|
||||||
servlayoutp->inputs = indp;
|
servlayoutp->inputs = indp;
|
||||||
}
|
}
|
||||||
|
@ -1287,9 +1287,13 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
|
||||||
* always synthesize a 'mouse' section configured to send core
|
* always synthesize a 'mouse' section configured to send core
|
||||||
* events, unless a 'void' section is found, in which case the user
|
* events, unless a 'void' section is found, in which case the user
|
||||||
* probably wants to run footless.
|
* 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++) {
|
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;
|
found = 1; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1306,7 +1310,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
|
||||||
(count + 1) * sizeof(IDevRec));
|
(count + 1) * sizeof(IDevRec));
|
||||||
indp[count - 1] = Pointer;
|
indp[count - 1] = Pointer;
|
||||||
indp[count - 1].extraOptions =
|
indp[count - 1].extraOptions =
|
||||||
xf86addNewOption(NULL, "AlwaysCore", NULL);
|
xf86addNewOption(NULL, xnfstrdup("AlwaysCore"), NULL);
|
||||||
indp[count].identifier = NULL;
|
indp[count].identifier = NULL;
|
||||||
servlayoutp->inputs = indp;
|
servlayoutp->inputs = indp;
|
||||||
}
|
}
|
||||||
|
@ -1397,7 +1401,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
|
||||||
(count + 1) * sizeof(IDevRec));
|
(count + 1) * sizeof(IDevRec));
|
||||||
indp[count - 1] = Keyboard;
|
indp[count - 1] = Keyboard;
|
||||||
indp[count - 1].extraOptions =
|
indp[count - 1].extraOptions =
|
||||||
xf86addNewOption(NULL, "CoreKeyboard", NULL);
|
xf86addNewOption(NULL, xnfstrdup("CoreKeyboard"), NULL);
|
||||||
indp[count].identifier = NULL;
|
indp[count].identifier = NULL;
|
||||||
servlayoutp->inputs = indp;
|
servlayoutp->inputs = indp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -309,13 +309,16 @@ configureInputSection (void)
|
||||||
mouse->inp_identifier = "Mouse0";
|
mouse->inp_identifier = "Mouse0";
|
||||||
mouse->inp_driver = "mouse";
|
mouse->inp_driver = "mouse";
|
||||||
mouse->inp_option_lst =
|
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__
|
#ifndef __SCO__
|
||||||
mouse->inp_option_lst =
|
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
|
#endif
|
||||||
mouse->inp_option_lst =
|
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);
|
ptr = (XF86ConfInputPtr)xf86addListItem((glp)ptr, (glp)mouse);
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
@ -519,7 +522,7 @@ configureLayoutSection (void)
|
||||||
iptr->iref_option_lst = NULL;
|
iptr->iref_option_lst = NULL;
|
||||||
iptr->iref_inputdev_str = "Mouse0";
|
iptr->iref_inputdev_str = "Mouse0";
|
||||||
iptr->iref_option_lst =
|
iptr->iref_option_lst =
|
||||||
xf86addNewOption (iptr->iref_option_lst, "CorePointer", NULL);
|
xf86addNewOption (iptr->iref_option_lst, xstrdup("CorePointer"), NULL);
|
||||||
ptr->lay_input_lst = (XF86ConfInputrefPtr)
|
ptr->lay_input_lst = (XF86ConfInputrefPtr)
|
||||||
xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
|
xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
|
||||||
}
|
}
|
||||||
|
@ -532,7 +535,7 @@ configureLayoutSection (void)
|
||||||
iptr->iref_option_lst = NULL;
|
iptr->iref_option_lst = NULL;
|
||||||
iptr->iref_inputdev_str = "Keyboard0";
|
iptr->iref_inputdev_str = "Keyboard0";
|
||||||
iptr->iref_option_lst =
|
iptr->iref_option_lst =
|
||||||
xf86addNewOption (iptr->iref_option_lst, "CoreKeyboard", NULL);
|
xf86addNewOption (iptr->iref_option_lst, xstrdup("CoreKeyboard"), NULL);
|
||||||
ptr->lay_input_lst = (XF86ConfInputrefPtr)
|
ptr->lay_input_lst = (XF86ConfInputrefPtr)
|
||||||
xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
|
xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
|
||||||
}
|
}
|
||||||
|
@ -751,7 +754,7 @@ configureDDCMonitorSection (int screennum)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ConfiguredMonitor->features.dpms) {
|
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;
|
return ptr;
|
||||||
|
|
|
@ -249,14 +249,11 @@ DGACloseScreen(int i, ScreenPtr pScreen)
|
||||||
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
|
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
|
||||||
|
|
||||||
if (XDGAEventBase) {
|
if (XDGAEventBase) {
|
||||||
OsBlockSignals();
|
|
||||||
ProcessInputEvents();
|
|
||||||
mieqSetHandler(*XDGAEventBase + MotionNotify, NULL);
|
mieqSetHandler(*XDGAEventBase + MotionNotify, NULL);
|
||||||
mieqSetHandler(*XDGAEventBase + ButtonPress, NULL);
|
mieqSetHandler(*XDGAEventBase + ButtonPress, NULL);
|
||||||
mieqSetHandler(*XDGAEventBase + ButtonRelease, NULL);
|
mieqSetHandler(*XDGAEventBase + ButtonRelease, NULL);
|
||||||
mieqSetHandler(*XDGAEventBase + KeyPress, NULL);
|
mieqSetHandler(*XDGAEventBase + KeyPress, NULL);
|
||||||
mieqSetHandler(*XDGAEventBase + KeyRelease, NULL);
|
mieqSetHandler(*XDGAEventBase + KeyRelease, NULL);
|
||||||
OsReleaseSignals();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FreeMarkedVisuals(pScreen);
|
FreeMarkedVisuals(pScreen);
|
||||||
|
|
|
@ -371,8 +371,11 @@ xf86DeleteInput(InputInfoPtr pInp, int flags)
|
||||||
if (pInp->drv)
|
if (pInp->drv)
|
||||||
pInp->drv->refCount--;
|
pInp->drv->refCount--;
|
||||||
|
|
||||||
|
/* This should *really* be handled in drv->UnInit(dev) call instead */
|
||||||
|
#if 0
|
||||||
if (pInp->private)
|
if (pInp->private)
|
||||||
xfree(pInp->private);
|
xfree(pInp->private);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Remove the entry from the list. */
|
/* Remove the entry from the list. */
|
||||||
if (pInp == xf86InputDevs)
|
if (pInp == xf86InputDevs)
|
||||||
|
|
|
@ -289,7 +289,7 @@ xf86CheckBoolOption(pointer optlist, const char *name, int deflt)
|
||||||
_X_EXPORT pointer
|
_X_EXPORT pointer
|
||||||
xf86ReplaceIntOption(pointer optlist, const char *name, const int val)
|
xf86ReplaceIntOption(pointer optlist, const char *name, const int val)
|
||||||
{
|
{
|
||||||
char *tmp = xnfalloc(16);
|
char tmp[16];
|
||||||
sprintf(tmp,"%i",val);
|
sprintf(tmp,"%i",val);
|
||||||
return xf86AddNewOption(optlist,name,tmp);
|
return xf86AddNewOption(optlist,name,tmp);
|
||||||
}
|
}
|
||||||
|
@ -297,7 +297,7 @@ xf86ReplaceIntOption(pointer optlist, const char *name, const int val)
|
||||||
_X_EXPORT pointer
|
_X_EXPORT pointer
|
||||||
xf86ReplaceRealOption(pointer optlist, const char *name, const double val)
|
xf86ReplaceRealOption(pointer optlist, const char *name, const double val)
|
||||||
{
|
{
|
||||||
char *tmp = xnfalloc(32);
|
char tmp[32];
|
||||||
snprintf(tmp,32,"%f",val);
|
snprintf(tmp,32,"%f",val);
|
||||||
return xf86AddNewOption(optlist,name,tmp);
|
return xf86AddNewOption(optlist,name,tmp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -344,13 +344,14 @@ AddOtherInputDevices()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
NewInputDeviceRequest (InputOption *options)
|
NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev)
|
||||||
{
|
{
|
||||||
IDevRec *idev = NULL;
|
IDevRec *idev = NULL;
|
||||||
InputDriverPtr drv = NULL;
|
InputDriverPtr drv = NULL;
|
||||||
InputInfoPtr pInfo = NULL;
|
InputInfoPtr pInfo = NULL;
|
||||||
InputOption *option = NULL;
|
InputOption *option = NULL;
|
||||||
DeviceIntPtr dev = NULL;
|
DeviceIntPtr dev = NULL;
|
||||||
|
int rval = Success;
|
||||||
|
|
||||||
idev = xcalloc(sizeof(*idev), 1);
|
idev = xcalloc(sizeof(*idev), 1);
|
||||||
if (!idev)
|
if (!idev)
|
||||||
|
@ -358,29 +359,46 @@ NewInputDeviceRequest (InputOption *options)
|
||||||
|
|
||||||
for (option = options; option; option = option->next) {
|
for (option = options; option; option = option->next) {
|
||||||
if (strcmp(option->key, "driver") == 0) {
|
if (strcmp(option->key, "driver") == 0) {
|
||||||
if (!xf86LoadOneModule(option->value, NULL))
|
if (idev->driver) {
|
||||||
return BadName;
|
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);
|
drv = xf86LookupInputDriver(option->value);
|
||||||
|
if (!drv)
|
||||||
|
if(xf86LoadOneModule(option->value, NULL))
|
||||||
|
drv = xf86LookupInputDriver(option->value);
|
||||||
if (!drv) {
|
if (!drv) {
|
||||||
xf86Msg(X_ERROR, "No input driver matching `%s'\n",
|
xf86Msg(X_ERROR, "No input driver matching `%s'\n",
|
||||||
option->value);
|
option->value);
|
||||||
return BadName;
|
rval = BadName;
|
||||||
|
goto unwind;
|
||||||
}
|
}
|
||||||
idev->driver = xstrdup(option->value);
|
idev->driver = xstrdup(option->value);
|
||||||
if (!idev->driver) {
|
if (!idev->driver) {
|
||||||
xfree(idev);
|
rval = BadAlloc;
|
||||||
return BadAlloc;
|
goto unwind;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (strcmp(option->key, "name") == 0 ||
|
if (strcmp(option->key, "name") == 0 ||
|
||||||
strcmp(option->key, "identifier") == 0) {
|
strcmp(option->key, "identifier") == 0) {
|
||||||
|
if (idev->identifier) {
|
||||||
|
rval = BadRequest;
|
||||||
|
goto unwind;
|
||||||
|
}
|
||||||
idev->identifier = xstrdup(option->value);
|
idev->identifier = xstrdup(option->value);
|
||||||
if (!idev->identifier) {
|
if (!idev->identifier) {
|
||||||
xfree(idev);
|
rval = BadAlloc;
|
||||||
return BadAlloc;
|
goto unwind;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!idev->driver || !idev->identifier) {
|
||||||
|
xf86Msg(X_ERROR, "No input driver/identifier specified (ignoring)\n");
|
||||||
|
rval = BadRequest;
|
||||||
|
goto unwind;
|
||||||
|
}
|
||||||
|
|
||||||
if (!drv) {
|
if (!drv) {
|
||||||
xf86Msg(X_ERROR, "No input driver specified (ignoring)\n");
|
xf86Msg(X_ERROR, "No input driver specified (ignoring)\n");
|
||||||
|
@ -396,26 +414,31 @@ NewInputDeviceRequest (InputOption *options)
|
||||||
xf86Msg(X_ERROR,
|
xf86Msg(X_ERROR,
|
||||||
"Input driver `%s' has no PreInit function (ignoring)\n",
|
"Input driver `%s' has no PreInit function (ignoring)\n",
|
||||||
drv->driverName);
|
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,
|
idev->commonOptions = xf86addNewOption(idev->commonOptions,
|
||||||
option->key, option->value);
|
option->key, option->value);
|
||||||
idev->extraOptions = NULL;
|
option->key = NULL;
|
||||||
|
option->value = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
pInfo = drv->PreInit(drv, idev, 0);
|
pInfo = drv->PreInit(drv, idev, 0);
|
||||||
|
|
||||||
if (!pInfo) {
|
if (!pInfo) {
|
||||||
xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n", idev->identifier);
|
xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n", idev->identifier);
|
||||||
return BadMatch;
|
rval = BadMatch;
|
||||||
|
goto unwind;
|
||||||
}
|
}
|
||||||
else if (!(pInfo->flags & XI86_CONFIGURED)) {
|
else if (!(pInfo->flags & XI86_CONFIGURED)) {
|
||||||
xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n",
|
xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n",
|
||||||
idev->identifier);
|
idev->identifier);
|
||||||
xf86DeleteInput(pInfo, 0);
|
rval = BadMatch;
|
||||||
return BadMatch;
|
goto unwind;
|
||||||
}
|
}
|
||||||
|
|
||||||
xf86ActivateDevice(pInfo);
|
xf86ActivateDevice(pInfo);
|
||||||
|
@ -431,7 +454,43 @@ NewInputDeviceRequest (InputOption *options)
|
||||||
/* send enter/leave event, update sprite window */
|
/* send enter/leave event, update sprite window */
|
||||||
CheckMotion(NULL, dev);
|
CheckMotion(NULL, dev);
|
||||||
|
|
||||||
|
*pdev = dev;
|
||||||
return Success;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -75,13 +75,13 @@ libdbe_la_SOURCES = dbemodule.c
|
||||||
|
|
||||||
libfb_la_LDFLAGS = -avoid-version
|
libfb_la_LDFLAGS = -avoid-version
|
||||||
libfb_la_LIBADD = $(top_builddir)/fb/libfb.la
|
libfb_la_LIBADD = $(top_builddir)/fb/libfb.la
|
||||||
libfb_la_SOURCES = $(top_builddir)/fb/fbcmap.c fbmodule.c
|
libfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c
|
||||||
libfb_la_CFLAGS = -DXFree86Server $(AM_CFLAGS)
|
libfb_la_CFLAGS = $(AM_CFLAGS)
|
||||||
|
|
||||||
libwfb_la_LDFLAGS = -avoid-version
|
libwfb_la_LDFLAGS = -avoid-version
|
||||||
libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la
|
libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la
|
||||||
libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap.c fbmodule.c
|
libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c
|
||||||
libwfb_la_CFLAGS = -DXFree86Server $(AM_CFLAGS) -DFB_ACCESS_WRAPPER
|
libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER
|
||||||
|
|
||||||
libglx_la_LDFLAGS = -avoid-version
|
libglx_la_LDFLAGS = -avoid-version
|
||||||
if AIGLX
|
if AIGLX
|
||||||
|
|
|
@ -958,6 +958,10 @@ the driver-specific documentation recommends it.
|
||||||
This optional entry specifies the pixel clock frequency that is used
|
This optional entry specifies the pixel clock frequency that is used
|
||||||
for the regular text mode. The frequency is specified in MHz. This is
|
for the regular text mode. The frequency is specified in MHz. This is
|
||||||
rarely used.
|
rarely used.
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qModeDebug\*q \*q" boolean \*q
|
||||||
|
Enable printing of additional debugging information about modesetting to
|
||||||
|
the server log.
|
||||||
.ig
|
.ig
|
||||||
.TP 7
|
.TP 7
|
||||||
This optional entry allows an IRQ number to be specified.
|
This optional entry allows an IRQ number to be specified.
|
||||||
|
|
|
@ -233,8 +233,6 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
|
||||||
int saved_x, saved_y;
|
int saved_x, saved_y;
|
||||||
Rotation saved_rotation;
|
Rotation saved_rotation;
|
||||||
|
|
||||||
adjusted_mode = xf86DuplicateMode(mode);
|
|
||||||
|
|
||||||
crtc->enabled = xf86CrtcInUse (crtc);
|
crtc->enabled = xf86CrtcInUse (crtc);
|
||||||
|
|
||||||
if (!crtc->enabled)
|
if (!crtc->enabled)
|
||||||
|
@ -243,6 +241,8 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
adjusted_mode = xf86DuplicateMode(mode);
|
||||||
|
|
||||||
didLock = crtc->funcs->lock (crtc);
|
didLock = crtc->funcs->lock (crtc);
|
||||||
|
|
||||||
saved_mode = crtc->mode;
|
saved_mode = crtc->mode;
|
||||||
|
@ -377,6 +377,15 @@ static OptionInfoRec xf86OutputOptions[] = {
|
||||||
{-1, NULL, OPTV_NONE, {0}, FALSE },
|
{-1, NULL, OPTV_NONE, {0}, FALSE },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
OPTION_MODEDEBUG,
|
||||||
|
};
|
||||||
|
|
||||||
|
static OptionInfoRec xf86DeviceOptions[] = {
|
||||||
|
{OPTION_MODEDEBUG, "ModeDebug", OPTV_STRING, {0}, FALSE },
|
||||||
|
{-1, NULL, OPTV_NONE, {0}, FALSE },
|
||||||
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xf86OutputSetMonitor (xf86OutputPtr output)
|
xf86OutputSetMonitor (xf86OutputPtr output)
|
||||||
{
|
{
|
||||||
|
@ -589,7 +598,6 @@ xf86CrtcCloseScreen (int index, ScreenPtr screen)
|
||||||
{
|
{
|
||||||
xf86OutputPtr output = config->output[o];
|
xf86OutputPtr output = config->output[o];
|
||||||
|
|
||||||
output->crtc = NULL;
|
|
||||||
output->randr_output = NULL;
|
output->randr_output = NULL;
|
||||||
}
|
}
|
||||||
for (c = 0; c < config->num_crtc; c++)
|
for (c = 0; c < config->num_crtc; c++)
|
||||||
|
@ -1160,8 +1168,6 @@ xf86SortModes (DisplayModePtr input)
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DEBUG_REPROBE 1
|
|
||||||
|
|
||||||
void
|
void
|
||||||
xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
|
xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
|
||||||
{
|
{
|
||||||
|
@ -1330,7 +1336,8 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
|
||||||
if (mode->status == MODE_OK)
|
if (mode->status == MODE_OK)
|
||||||
mode->status = (*output->funcs->mode_valid)(output, mode);
|
mode->status = (*output->funcs->mode_valid)(output, mode);
|
||||||
|
|
||||||
xf86PruneInvalidModes(scrn, &output->probed_modes, TRUE);
|
xf86PruneInvalidModes(scrn, &output->probed_modes,
|
||||||
|
config->debug_modes);
|
||||||
|
|
||||||
output->probed_modes = xf86SortModes (output->probed_modes);
|
output->probed_modes = xf86SortModes (output->probed_modes);
|
||||||
|
|
||||||
|
@ -1363,17 +1370,17 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
|
||||||
|
|
||||||
output->initial_rotation = xf86OutputInitialRotation (output);
|
output->initial_rotation = xf86OutputInitialRotation (output);
|
||||||
|
|
||||||
#ifdef DEBUG_REPROBE
|
if (config->debug_modes) {
|
||||||
if (output->probed_modes != NULL) {
|
if (output->probed_modes != NULL) {
|
||||||
xf86DrvMsg(scrn->scrnIndex, X_INFO,
|
xf86DrvMsg(scrn->scrnIndex, X_INFO,
|
||||||
"Printing probed modes for output %s\n",
|
"Printing probed modes for output %s\n",
|
||||||
output->name);
|
output->name);
|
||||||
} else {
|
} else {
|
||||||
xf86DrvMsg(scrn->scrnIndex, X_INFO,
|
xf86DrvMsg(scrn->scrnIndex, X_INFO,
|
||||||
"No remaining probed modes for output %s\n",
|
"No remaining probed modes for output %s\n",
|
||||||
output->name);
|
output->name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
for (mode = output->probed_modes; mode != NULL; mode = mode->next)
|
for (mode = output->probed_modes; mode != NULL; mode = mode->next)
|
||||||
{
|
{
|
||||||
/* The code to choose the best mode per pipe later on will require
|
/* The code to choose the best mode per pipe later on will require
|
||||||
|
@ -1382,9 +1389,8 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
|
||||||
mode->VRefresh = xf86ModeVRefresh(mode);
|
mode->VRefresh = xf86ModeVRefresh(mode);
|
||||||
xf86SetModeCrtc(mode, INTERLACE_HALVE_V);
|
xf86SetModeCrtc(mode, INTERLACE_HALVE_V);
|
||||||
|
|
||||||
#ifdef DEBUG_REPROBE
|
if (config->debug_modes)
|
||||||
xf86PrintModeline(scrn->scrnIndex, mode);
|
xf86PrintModeline(scrn->scrnIndex, mode);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1479,6 +1485,15 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
|
|
||||||
|
/* Set up the device options */
|
||||||
|
config->options = xnfalloc (sizeof (xf86DeviceOptions));
|
||||||
|
memcpy (config->options, xf86DeviceOptions, sizeof (xf86DeviceOptions));
|
||||||
|
xf86ProcessOptions (scrn->scrnIndex,
|
||||||
|
scrn->options,
|
||||||
|
config->options);
|
||||||
|
config->debug_modes = xf86ReturnOptValBool (config->options,
|
||||||
|
OPTION_MODEDEBUG, FALSE);
|
||||||
|
|
||||||
if (scrn->display->virtualX)
|
if (scrn->display->virtualX)
|
||||||
width = scrn->display->virtualX;
|
width = scrn->display->virtualX;
|
||||||
else
|
else
|
||||||
|
@ -1818,6 +1833,11 @@ xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation)
|
||||||
else
|
else
|
||||||
crtc_mode = xf86OutputFindClosestMode (output, desired);
|
crtc_mode = xf86OutputFindClosestMode (output, desired);
|
||||||
}
|
}
|
||||||
|
if (!crtc_mode)
|
||||||
|
{
|
||||||
|
crtc->enabled = FALSE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!xf86CrtcSetMode (crtc, crtc_mode, rotation, 0, 0))
|
if (!xf86CrtcSetMode (crtc, crtc_mode, rotation, 0, 0))
|
||||||
ok = FALSE;
|
ok = FALSE;
|
||||||
else
|
else
|
||||||
|
@ -1829,6 +1849,7 @@ xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xf86DisableUnusedFunctions(pScrn);
|
xf86DisableUnusedFunctions(pScrn);
|
||||||
|
xf86RandR12TellChanged (pScrn->pScreen);
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1962,10 +1983,12 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon)
|
||||||
|
|
||||||
output->MonInfo = edid_mon;
|
output->MonInfo = edid_mon;
|
||||||
|
|
||||||
/* Debug info for now, at least */
|
if (config->debug_modes) {
|
||||||
xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n", output->name);
|
xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n",
|
||||||
xf86PrintEDID(edid_mon);
|
output->name);
|
||||||
|
xf86PrintEDID(edid_mon);
|
||||||
|
}
|
||||||
|
|
||||||
/* Set the DDC properties for the 'compat' output */
|
/* Set the DDC properties for the 'compat' output */
|
||||||
if (output == config->output[config->compat_output])
|
if (output == config->output[config->compat_output])
|
||||||
xf86SetDDCproperties(scrn, edid_mon);
|
xf86SetDDCproperties(scrn, edid_mon);
|
||||||
|
|
|
@ -552,6 +552,13 @@ typedef struct _xf86CrtcConfig {
|
||||||
CARD8 *cursor_image;
|
CARD8 *cursor_image;
|
||||||
Bool cursor_on;
|
Bool cursor_on;
|
||||||
CARD32 cursor_fg, cursor_bg;
|
CARD32 cursor_fg, cursor_bg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Options parsed from the related device section
|
||||||
|
*/
|
||||||
|
OptionInfoPtr options;
|
||||||
|
|
||||||
|
Bool debug_modes;
|
||||||
} xf86CrtcConfigRec, *xf86CrtcConfigPtr;
|
} xf86CrtcConfigRec, *xf86CrtcConfigPtr;
|
||||||
|
|
||||||
extern int xf86CrtcConfigPrivateIndex;
|
extern int xf86CrtcConfigPrivateIndex;
|
||||||
|
|
|
@ -1049,6 +1049,28 @@ xf86RandR12CreateScreenResources12 (ScreenPtr pScreen)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Something happened within the screen configuration due
|
||||||
|
* to DGA, VidMode or hot key. Tell RandR
|
||||||
|
*/
|
||||||
|
|
||||||
|
void
|
||||||
|
xf86RandR12TellChanged (ScreenPtr pScreen)
|
||||||
|
{
|
||||||
|
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||||
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
||||||
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
||||||
|
int c;
|
||||||
|
|
||||||
|
if (!randrp)
|
||||||
|
return;
|
||||||
|
xf86RandR12SetInfo12 (pScreen);
|
||||||
|
for (c = 0; c < config->num_crtc; c++)
|
||||||
|
xf86RandR12CrtcNotify (config->crtc[c]->randr_crtc);
|
||||||
|
|
||||||
|
RRTellChanged (pScreen);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xf86RandR12PointerMoved (int scrnIndex, int x, int y)
|
xf86RandR12PointerMoved (int scrnIndex, int x, int y)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,5 +33,6 @@ Bool xf86RandR12SetConfig(ScreenPtr pScreen, Rotation rotation, int rate,
|
||||||
Rotation xf86RandR12GetRotation(ScreenPtr pScreen);
|
Rotation xf86RandR12GetRotation(ScreenPtr pScreen);
|
||||||
void xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y);
|
void xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y);
|
||||||
Bool xf86RandR12PreInit (ScrnInfoPtr pScrn);
|
Bool xf86RandR12PreInit (ScrnInfoPtr pScrn);
|
||||||
|
void xf86RandR12TellChanged (ScreenPtr pScreen);
|
||||||
|
|
||||||
#endif /* _XF86_RANDR_H_ */
|
#endif /* _XF86_RANDR_H_ */
|
||||||
|
|
|
@ -38,8 +38,7 @@ ARCH_SOURCES = i386_video.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if PPC_VIDEO
|
if PPC_VIDEO
|
||||||
ARCH_SOURCES = ppc_video.c \
|
ARCH_SOURCES = ppc_video.c
|
||||||
$(srcdir)/../shared/ioperm_noop.c
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if SPARC64_VIDEO
|
if SPARC64_VIDEO
|
||||||
|
|
|
@ -56,6 +56,9 @@
|
||||||
static pointer ppcMapVidMem(int, unsigned long, unsigned long, int flags);
|
static pointer ppcMapVidMem(int, unsigned long, unsigned long, int flags);
|
||||||
static void ppcUnmapVidMem(int, pointer, unsigned long);
|
static void ppcUnmapVidMem(int, pointer, unsigned long);
|
||||||
|
|
||||||
|
Bool xf86EnableIO(void);
|
||||||
|
void xf86DisableIO(void);
|
||||||
|
|
||||||
void
|
void
|
||||||
xf86OSInitVidMem(VidMemInfoPtr pVidMem)
|
xf86OSInitVidMem(VidMemInfoPtr pVidMem)
|
||||||
{
|
{
|
||||||
|
@ -63,6 +66,7 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
|
||||||
pVidMem->mapMem = ppcMapVidMem;
|
pVidMem->mapMem = ppcMapVidMem;
|
||||||
pVidMem->unmapMem = ppcUnmapVidMem;
|
pVidMem->unmapMem = ppcUnmapVidMem;
|
||||||
pVidMem->initialised = TRUE;
|
pVidMem->initialised = TRUE;
|
||||||
|
xf86EnableIO();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -138,3 +142,32 @@ xf86EnableInterrupts()
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool xf86EnableIO()
|
||||||
|
{
|
||||||
|
int fd = xf86Info.screenFd;
|
||||||
|
|
||||||
|
xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd);
|
||||||
|
if (ioBase == MAP_FAILED)
|
||||||
|
{
|
||||||
|
ioBase=mmap(NULL, 0x10000, PROT_READ|PROT_WRITE, MAP_SHARED, fd,
|
||||||
|
0xf2000000);
|
||||||
|
xf86MsgVerb(X_INFO, 3, "xf86EnableIO: %08x\n", ioBase);
|
||||||
|
if (ioBase == MAP_FAILED) {
|
||||||
|
xf86MsgVerb(X_WARNING, 3, "Can't map IO space!\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void xf86DisableIO()
|
||||||
|
{
|
||||||
|
|
||||||
|
if (ioBase != MAP_FAILED)
|
||||||
|
{
|
||||||
|
munmap(__UNVOLATILE(ioBase), 0x10000);
|
||||||
|
ioBase = MAP_FAILED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -773,8 +773,8 @@ xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, unsigned char *Buf)
|
||||||
bus = PCI_BUS_NO_DOMAIN(PCI_BUS_FROM_TAG(Tag));
|
bus = PCI_BUS_NO_DOMAIN(PCI_BUS_FROM_TAG(Tag));
|
||||||
dev = PCI_DEV_FROM_TAG(Tag);
|
dev = PCI_DEV_FROM_TAG(Tag);
|
||||||
func = PCI_FUNC_FROM_TAG(Tag);
|
func = PCI_FUNC_FROM_TAG(Tag);
|
||||||
sprintf(file, "/sys/devices/pci%04x:%02x/%04x:%02x:%02x.%1x/rom",
|
sprintf(file, "/sys/bus/pci/devices/%04x:%02x:%02x.%1x/rom",
|
||||||
dom, bus, dom, bus, dev, func);
|
dom, bus, dev, func);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the caller wants the ROM and the sysfs rom interface exists,
|
* If the caller wants the ROM and the sysfs rom interface exists,
|
||||||
|
|
|
@ -245,15 +245,15 @@ xf86OpenConsole(void)
|
||||||
lnx_savefont();
|
lnx_savefont();
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* now get the VT
|
* now get the VT. This _must_ succeed, or else fail completely.
|
||||||
*/
|
*/
|
||||||
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0)
|
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0)
|
||||||
xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed: %s\n",
|
FatalError("xf86OpenConsole: VT_ACTIVATE failed: %s\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
|
||||||
if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) < 0)
|
if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) < 0)
|
||||||
xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed: %s\n",
|
FatalError("xf86OpenConsole: VT_WAITACTIVE failed: %s\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
|
||||||
if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
|
if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
|
||||||
FatalError("xf86OpenConsole: VT_GETMODE failed %s\n",
|
FatalError("xf86OpenConsole: VT_GETMODE failed %s\n",
|
||||||
|
@ -350,6 +350,10 @@ xf86CloseConsole()
|
||||||
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, activeVT) < 0)
|
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, activeVT) < 0)
|
||||||
xf86Msg(X_WARNING, "xf86CloseConsole: VT_ACTIVATE failed: %s\n",
|
xf86Msg(X_WARNING, "xf86CloseConsole: VT_ACTIVATE failed: %s\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, activeVT) < 0)
|
||||||
|
xf86Msg(X_WARNING,
|
||||||
|
"xf86CloseConsole: VT_WAITACTIVE failed: %s\n",
|
||||||
|
strerror(errno));
|
||||||
activeVT = -1;
|
activeVT = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -198,21 +198,21 @@ addNewOption2 (XF86OptionPtr head, char *name, char *val, int used)
|
||||||
{
|
{
|
||||||
XF86OptionPtr new, old = NULL;
|
XF86OptionPtr new, old = NULL;
|
||||||
|
|
||||||
/* Don't allow duplicates */
|
/* Don't allow duplicates, free old strings */
|
||||||
if (head != NULL && (old = xf86findOption(head, name)) != NULL)
|
if (head != NULL && (old = xf86findOption(head, name)) != NULL) {
|
||||||
new = old;
|
new = old;
|
||||||
else {
|
xf86conffree(new->opt_name);
|
||||||
|
xf86conffree(new->opt_val);
|
||||||
|
}
|
||||||
|
else
|
||||||
new = xf86confcalloc (1, sizeof (XF86OptionRec));
|
new = xf86confcalloc (1, sizeof (XF86OptionRec));
|
||||||
new->list.next = NULL;
|
new->opt_name = name;
|
||||||
}
|
new->opt_val = val;
|
||||||
new->opt_name = name;
|
new->opt_used = used;
|
||||||
new->opt_val = val;
|
|
||||||
new->opt_used = used;
|
if (old)
|
||||||
|
return head;
|
||||||
if (old == NULL)
|
return ((XF86OptionPtr) xf86addListItem ((glp) head, (glp) new));
|
||||||
return ((XF86OptionPtr) xf86addListItem ((glp) head, (glp) new));
|
|
||||||
else
|
|
||||||
return head;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
XF86OptionPtr
|
XF86OptionPtr
|
||||||
|
|
|
@ -107,13 +107,19 @@ doWriteConfigFile (const char *filename, XF86ConfigPtr cptr)
|
||||||
|
|
||||||
xf86printLayoutSection (cf, cptr->conf_layout_lst);
|
xf86printLayoutSection (cf, cptr->conf_layout_lst);
|
||||||
|
|
||||||
fprintf (cf, "Section \"Files\"\n");
|
if (cptr->conf_files != NULL)
|
||||||
xf86printFileSection (cf, cptr->conf_files);
|
{
|
||||||
fprintf (cf, "EndSection\n\n");
|
fprintf (cf, "Section \"Files\"\n");
|
||||||
|
xf86printFileSection (cf, cptr->conf_files);
|
||||||
|
fprintf (cf, "EndSection\n\n");
|
||||||
|
}
|
||||||
|
|
||||||
fprintf (cf, "Section \"Module\"\n");
|
if (cptr->conf_modules != NULL)
|
||||||
xf86printModuleSection (cf, cptr->conf_modules);
|
{
|
||||||
fprintf (cf, "EndSection\n\n");
|
fprintf (cf, "Section \"Module\"\n");
|
||||||
|
xf86printModuleSection (cf, cptr->conf_modules);
|
||||||
|
fprintf (cf, "EndSection\n\n");
|
||||||
|
}
|
||||||
|
|
||||||
xf86printVendorSection (cf, cptr->conf_vendor_lst);
|
xf86printVendorSection (cf, cptr->conf_vendor_lst);
|
||||||
|
|
||||||
|
|
|
@ -2111,7 +2111,7 @@ LayoutConfig(void)
|
||||||
else
|
else
|
||||||
iref->iref_option_lst =
|
iref->iref_option_lst =
|
||||||
xf86addNewOption(iref->iref_option_lst,
|
xf86addNewOption(iref->iref_option_lst,
|
||||||
"CorePointer", NULL);
|
XtNewString("CorePointer"), NULL);
|
||||||
option = xf86findOption(mref->iref_option_lst,
|
option = xf86findOption(mref->iref_option_lst,
|
||||||
"CorePointer");
|
"CorePointer");
|
||||||
XtFree(option->opt_name);
|
XtFree(option->opt_name);
|
||||||
|
@ -2209,7 +2209,7 @@ LayoutConfig(void)
|
||||||
else
|
else
|
||||||
iref->iref_option_lst =
|
iref->iref_option_lst =
|
||||||
xf86addNewOption(iref->iref_option_lst,
|
xf86addNewOption(iref->iref_option_lst,
|
||||||
"CoreKeyboard", NULL);
|
XtNewString("CoreKeyboard"), NULL);
|
||||||
option = xf86findOption(kref->iref_option_lst,
|
option = xf86findOption(kref->iref_option_lst,
|
||||||
"CoreKeyboard");
|
"CoreKeyboard");
|
||||||
XtFree(option->opt_name);
|
XtFree(option->opt_name);
|
||||||
|
|
|
@ -176,7 +176,7 @@ xnestOpenDisplay(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xnestCloseDisplay()
|
xnestCloseDisplay(void)
|
||||||
{
|
{
|
||||||
if (!xnestDoFullGeneration || !xnestDisplay) return;
|
if (!xnestDoFullGeneration || !xnestDisplay) return;
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ ProcessInputEvents()
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
TimeSinceLastInputEvent()
|
TimeSinceLastInputEvent(void)
|
||||||
{
|
{
|
||||||
if (lastEventTime == 0)
|
if (lastEventTime == 0)
|
||||||
lastEventTime = GetTimeInMillis();
|
lastEventTime = GetTimeInMillis();
|
||||||
|
@ -61,7 +61,7 @@ TimeSinceLastInputEvent()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SetTimeSinceLastInputEvent()
|
SetTimeSinceLastInputEvent(void)
|
||||||
{
|
{
|
||||||
lastEventTime = GetTimeInMillis();
|
lastEventTime = GetTimeInMillis();
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ xnestNotExposurePredicate(Display *display, XEvent *event, char *args)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xnestCollectExposures()
|
xnestCollectExposures(void)
|
||||||
{
|
{
|
||||||
XEvent X;
|
XEvent X;
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
|
@ -114,7 +114,7 @@ xnestQueueKeyEvent(int type, unsigned int keycode)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xnestCollectEvents()
|
xnestCollectEvents(void)
|
||||||
{
|
{
|
||||||
XEvent X;
|
XEvent X;
|
||||||
xEvent x;
|
xEvent x;
|
||||||
|
|
|
@ -45,8 +45,8 @@ SRCS = Args.c \
|
||||||
$(top_srcdir)/Xi/stubs.c \
|
$(top_srcdir)/Xi/stubs.c \
|
||||||
$(top_srcdir)/mi/miinitext.c
|
$(top_srcdir)/mi/miinitext.c
|
||||||
|
|
||||||
libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap.c
|
libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c
|
||||||
libfbcmap_a_CFLAGS = $(AM_CFLAGS) -DXFree86Server
|
libfbcmap_a_CFLAGS = $(AM_CFLAGS)
|
||||||
|
|
||||||
Xnest_SOURCES = $(SRCS)
|
Xnest_SOURCES = $(SRCS)
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,6 @@ Xprt_SOURCES = \
|
||||||
Util.c \
|
Util.c \
|
||||||
miinitext-wrapper.c \
|
miinitext-wrapper.c \
|
||||||
dpmsstubs-wrapper.c \
|
dpmsstubs-wrapper.c \
|
||||||
$(top_srcdir)/fb/fbcmap.c
|
$(top_srcdir)/fb/fbcmap_mi.c
|
||||||
|
|
||||||
EXTRA_DIST = ValTree.c
|
EXTRA_DIST = ValTree.c
|
||||||
|
|
|
@ -89,6 +89,12 @@ InitOutput(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
DDXRingBell(int volume, int pitch, int duration)
|
||||||
|
{
|
||||||
|
/* dummy func; link fails without */
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
BellProc(
|
BellProc(
|
||||||
int volume,
|
int volume,
|
||||||
|
|
|
@ -485,7 +485,10 @@ extern Bool ACDeviceAllowed(WindowPtr win,
|
||||||
|
|
||||||
/* Implemented by the DDX. */
|
/* Implemented by the DDX. */
|
||||||
extern int NewInputDeviceRequest(
|
extern int NewInputDeviceRequest(
|
||||||
InputOption *options);
|
InputOption *options,
|
||||||
|
DeviceIntPtr *dev);
|
||||||
|
extern void DeleteInputDeviceRequest(
|
||||||
|
DeviceIntPtr dev);
|
||||||
|
|
||||||
extern void DDXRingBell(
|
extern void DDXRingBell(
|
||||||
int volume,
|
int volume,
|
||||||
|
|
|
@ -385,7 +385,7 @@ static int miVisualPriority[] = {
|
||||||
static miVisualsPtr miVisuals;
|
static miVisualsPtr miVisuals;
|
||||||
|
|
||||||
_X_EXPORT void
|
_X_EXPORT void
|
||||||
miClearVisualTypes()
|
miClearVisualTypes(void)
|
||||||
{
|
{
|
||||||
miVisualsPtr v;
|
miVisualsPtr v;
|
||||||
|
|
||||||
|
@ -690,7 +690,7 @@ miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
miResetInitVisuals()
|
miResetInitVisuals(void)
|
||||||
{
|
{
|
||||||
miInitVisualsProc = miDoInitVisuals;
|
miInitVisualsProc = miDoInitVisuals;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ in this Software without prior written authorization from The Open Group.
|
||||||
# include <X11/extensions/dpms.h>
|
# include <X11/extensions/dpms.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define QUEUE_SIZE 256
|
#define QUEUE_SIZE 512
|
||||||
|
|
||||||
typedef struct _Event {
|
typedef struct _Event {
|
||||||
xEvent event[7];
|
xEvent event[7];
|
||||||
|
@ -87,7 +87,7 @@ typedef struct _EventQueue {
|
||||||
static EventQueueRec miEventQueue;
|
static EventQueueRec miEventQueue;
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
mieqInit()
|
mieqInit(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ mieqSetHandler(int event, mieqHandler handler)
|
||||||
|
|
||||||
/* Call this from ProcessInputEvents(). */
|
/* Call this from ProcessInputEvents(). */
|
||||||
void
|
void
|
||||||
mieqProcessInputEvents()
|
mieqProcessInputEvents(void)
|
||||||
{
|
{
|
||||||
EventRec *e = NULL;
|
EventRec *e = NULL;
|
||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
|
|
4
os/log.c
4
os/log.c
|
@ -221,7 +221,7 @@ LogInit(const char *fname, const char *backup)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LogClose()
|
LogClose(void)
|
||||||
{
|
{
|
||||||
if (logFile) {
|
if (logFile) {
|
||||||
fclose(logFile);
|
fclose(logFile);
|
||||||
|
@ -616,7 +616,7 @@ Error(char *str)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LogPrintMarkers()
|
LogPrintMarkers(void)
|
||||||
{
|
{
|
||||||
/* Show what the message marker symbols mean. */
|
/* Show what the message marker symbols mean. */
|
||||||
ErrorF("Markers: ");
|
ErrorF("Markers: ");
|
||||||
|
|
|
@ -102,7 +102,7 @@ typedef struct _builtinColor {
|
||||||
#define NUM_BUILTIN_COLORS (sizeof (BuiltinColors) / sizeof (BuiltinColors[0]))
|
#define NUM_BUILTIN_COLORS (sizeof (BuiltinColors) / sizeof (BuiltinColors[0]))
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
OsInitColors()
|
OsInitColors(void)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,8 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include <X11/Xos.h>
|
#include <X11/Xos.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/resource.h>
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#define XSERV_t
|
#define XSERV_t
|
||||||
|
@ -795,7 +797,13 @@ ProcessCommandLine(int argc, char *argv[])
|
||||||
UseMsg();
|
UseMsg();
|
||||||
}
|
}
|
||||||
else if ( strcmp( argv[i], "-core") == 0)
|
else if ( strcmp( argv[i], "-core") == 0)
|
||||||
|
{
|
||||||
|
struct rlimit core_limit;
|
||||||
CoreDump = TRUE;
|
CoreDump = TRUE;
|
||||||
|
getrlimit (RLIMIT_CORE, &core_limit);
|
||||||
|
core_limit.rlim_cur = core_limit.rlim_max;
|
||||||
|
setrlimit (RLIMIT_CORE, &core_limit);
|
||||||
|
}
|
||||||
else if ( strcmp( argv[i], "-dpi") == 0)
|
else if ( strcmp( argv[i], "-dpi") == 0)
|
||||||
{
|
{
|
||||||
if(++i < argc)
|
if(++i < argc)
|
||||||
|
|
|
@ -116,11 +116,19 @@ RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen)
|
||||||
|
|
||||||
se.sequenceNumber = client->sequence;
|
se.sequenceNumber = client->sequence;
|
||||||
se.sizeID = RR10CurrentSizeID (pScreen);
|
se.sizeID = RR10CurrentSizeID (pScreen);
|
||||||
|
|
||||||
se.widthInPixels = pScreen->width;
|
if (se.rotation & (RR_Rotate_90 | RR_Rotate_270)) {
|
||||||
se.heightInPixels = pScreen->height;
|
se.widthInPixels = pScreen->height;
|
||||||
se.widthInMillimeters = pScreen->mmWidth;
|
se.heightInPixels = pScreen->width;
|
||||||
se.heightInMillimeters = pScreen->mmHeight;
|
se.widthInMillimeters = pScreen->mmHeight;
|
||||||
|
se.heightInMillimeters = pScreen->mmWidth;
|
||||||
|
} else {
|
||||||
|
se.widthInPixels = pScreen->width;
|
||||||
|
se.heightInPixels = pScreen->height;
|
||||||
|
se.widthInMillimeters = pScreen->mmWidth;
|
||||||
|
se.heightInMillimeters = pScreen->mmHeight;
|
||||||
|
}
|
||||||
|
|
||||||
WriteEventsToClient (client, 1, (xEvent *) &se);
|
WriteEventsToClient (client, 1, (xEvent *) &se);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -733,6 +741,7 @@ ProcRRSetScreenConfig (ClientPtr client)
|
||||||
RRModePtr mode;
|
RRModePtr mode;
|
||||||
RR10DataPtr pData = NULL;
|
RR10DataPtr pData = NULL;
|
||||||
RRScreenSizePtr pSize;
|
RRScreenSizePtr pSize;
|
||||||
|
int width, height;
|
||||||
|
|
||||||
UpdateCurrentTime ();
|
UpdateCurrentTime ();
|
||||||
|
|
||||||
|
@ -875,8 +884,14 @@ ProcRRSetScreenConfig (ClientPtr client)
|
||||||
* If the screen size is changing, adjust all of the other outputs
|
* If the screen size is changing, adjust all of the other outputs
|
||||||
* to fit the new size, mirroring as much as possible
|
* to fit the new size, mirroring as much as possible
|
||||||
*/
|
*/
|
||||||
if (mode->mode.width != pScreen->width ||
|
width = mode->mode.width;
|
||||||
mode->mode.height != pScreen->height)
|
height = mode->mode.height;
|
||||||
|
if (rotation & (RR_Rotate_90|RR_Rotate_270))
|
||||||
|
{
|
||||||
|
width = mode->mode.height;
|
||||||
|
height = mode->mode.width;
|
||||||
|
}
|
||||||
|
if (width != pScreen->width || height != pScreen->height)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
@ -890,7 +905,7 @@ ProcRRSetScreenConfig (ClientPtr client)
|
||||||
goto sendReply;
|
goto sendReply;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!RRScreenSizeSet (pScreen, mode->mode.width, mode->mode.height,
|
if (!RRScreenSizeSet (pScreen, width, height,
|
||||||
pScreen->mmWidth, pScreen->mmHeight))
|
pScreen->mmWidth, pScreen->mmHeight))
|
||||||
{
|
{
|
||||||
rep.status = RRSetConfigFailed;
|
rep.status = RRSetConfigFailed;
|
||||||
|
|
|
@ -86,13 +86,13 @@ static int globalTotalGlyphPrivateSize = 0;
|
||||||
static int glyphPrivateCount = 0;
|
static int glyphPrivateCount = 0;
|
||||||
|
|
||||||
void
|
void
|
||||||
ResetGlyphPrivates ()
|
ResetGlyphPrivates (void)
|
||||||
{
|
{
|
||||||
glyphPrivateCount = 0;
|
glyphPrivateCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
AllocateGlyphPrivateIndex ()
|
AllocateGlyphPrivateIndex (void)
|
||||||
{
|
{
|
||||||
return glyphPrivateCount++;
|
return glyphPrivateCount++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue