Merge branch 'master' into mpx
Conflicts: Xi/closedev.c Xi/exevents.c Xi/extinit.c Xi/listdev.c dix/window.c hw/xfree86/common/xf86Xinput.c include/extinit.h mi/mipointer.c
This commit is contained in:
commit
e8777a91f3
|
@ -14,7 +14,6 @@ AM_CFLAGS = \
|
|||
-I@MESA_SOURCE@/src/mesa/glapi \
|
||||
-I@MESA_SOURCE@/src/mesa/main \
|
||||
-DXFree86Server \
|
||||
-DNO_LIBCWRAPPER \
|
||||
@GLX_DEFINES@
|
||||
|
||||
# none yet
|
||||
|
|
|
@ -20,13 +20,11 @@ INCLUDES = -I@MESA_SOURCE@/include \
|
|||
AM_CFLAGS = \
|
||||
$(DIX_CFLAGS) \
|
||||
-DXFree86Server \
|
||||
@GLX_DEFINES@ \
|
||||
-DXFree86Server
|
||||
@GLX_DEFINES@
|
||||
|
||||
libX_la_SOURCES = xf86glx.c \
|
||||
xf86glx_util.c \
|
||||
xf86glx_util.h \
|
||||
xf86glxint.h
|
||||
xf86glx_util.h
|
||||
|
||||
nodist_libX_la_SOURCES = \
|
||||
xm_api.c \
|
||||
|
|
|
@ -37,40 +37,19 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <regionstr.h>
|
||||
#include <resource.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glxint.h>
|
||||
#include <GL/glxtokens.h>
|
||||
#include <scrnintstr.h>
|
||||
#include <windowstr.h>
|
||||
#include <config.h>
|
||||
|
||||
#include <GL/xmesa.h>
|
||||
#include <GL/internal/glcore.h>
|
||||
#include <glxserver.h>
|
||||
#include <glxscreens.h>
|
||||
#include <glxdrawable.h>
|
||||
#include <glxcontext.h>
|
||||
#include <glxext.h>
|
||||
#include <glxutil.h>
|
||||
#include "context.h"
|
||||
#include "xmesaP.h"
|
||||
#include "context.h"
|
||||
|
||||
#include "glcontextmodes.h"
|
||||
#include "os.h"
|
||||
|
||||
/*
|
||||
* This define is for the glcore.h header file.
|
||||
* If you add it here, then make sure you also add it in
|
||||
* ../../../glx/Imakefile.
|
||||
*/
|
||||
#if 0
|
||||
#define DEBUG
|
||||
#include <GL/internal/glcore.h>
|
||||
#undef DEBUG
|
||||
#else
|
||||
#include <GL/internal/glcore.h>
|
||||
#endif
|
||||
|
||||
typedef struct __GLXMESAscreen __GLXMESAscreen;
|
||||
typedef struct __GLXMESAcontext __GLXMESAcontext;
|
||||
typedef struct __GLXMESAdrawable __GLXMESAdrawable;
|
||||
|
@ -218,8 +197,7 @@ __glXMesaContextCopy(__GLXcontext *baseDst,
|
|||
__GLXMESAcontext *dst = (__GLXMESAcontext *) baseDst;
|
||||
__GLXMESAcontext *src = (__GLXMESAcontext *) baseSrc;
|
||||
|
||||
_mesa_copy_context(&src->xmesa->mesa, &dst->xmesa->mesa, mask);
|
||||
return GL_TRUE;
|
||||
return XMesaCopyContext(src->xmesa, dst->xmesa, mask);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -227,7 +205,7 @@ __glXMesaContextForceCurrent(__GLXcontext *baseContext)
|
|||
{
|
||||
__GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
|
||||
|
||||
GlxSetRenderTables (context->xmesa->mesa.CurrentDispatch);
|
||||
/* GlxSetRenderTables() call for XGL moved in XMesaForceCurrent() */
|
||||
|
||||
return XMesaForceCurrent(context->xmesa);
|
||||
}
|
||||
|
|
|
@ -37,8 +37,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <gcstruct.h>
|
||||
#include "pixmapstr.h"
|
||||
#include "xf86glx_util.h"
|
||||
#include <X11/Xmd.h>
|
||||
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
/**************************************************************************
|
||||
|
||||
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sub license, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the
|
||||
next paragraph) shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* Kevin E. Martin <kevin@precisioninsight.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _XF86GLXINT_H_
|
||||
#define _XF86GLXINT_H_
|
||||
|
||||
#include <miscstruct.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/xmesa.h>
|
||||
|
||||
#endif /* _XF86GLXINT_H_ */
|
|
@ -68,6 +68,7 @@ nodist_libmain_la_SOURCES = accum.c \
|
|||
rastpos.c \
|
||||
rbadaptors.c \
|
||||
renderbuffer.c \
|
||||
shaders.c \
|
||||
state.c \
|
||||
stencil.c \
|
||||
texcompress.c \
|
||||
|
|
|
@ -27,8 +27,13 @@ nodist_libshader_la_SOURCES = \
|
|||
atifragshader.c \
|
||||
nvfragparse.c \
|
||||
nvprogram.c \
|
||||
nvvertexec.c \
|
||||
nvvertparse.c \
|
||||
nvvertparse.c \
|
||||
prog_debug.c \
|
||||
prog_execute.c \
|
||||
prog_instruction.c \
|
||||
prog_parameter.c \
|
||||
prog_print.c \
|
||||
program.c \
|
||||
shaderobjects.c \
|
||||
shaderobjects_3dlabs.c
|
||||
programopt.c \
|
||||
prog_statevars.c \
|
||||
shader_api.c
|
||||
|
|
|
@ -18,23 +18,23 @@ INCLUDES = -I@MESA_SOURCE@/include \
|
|||
-I../.. \
|
||||
-I$(top_srcdir)/hw/xfree86/os-support
|
||||
|
||||
nodist_libslang_la_SOURCES = slang_analyse.c \
|
||||
slang_assemble_assignment.c \
|
||||
slang_assemble.c \
|
||||
slang_assemble_conditional.c \
|
||||
slang_assemble_constructor.c \
|
||||
slang_assemble_typeinfo.c \
|
||||
nodist_libslang_la_SOURCES = slang_builtin.c \
|
||||
slang_codegen.c \
|
||||
slang_compile.c \
|
||||
slang_compile_function.c \
|
||||
slang_compile_operation.c \
|
||||
slang_compile_struct.c \
|
||||
slang_compile_variable.c \
|
||||
slang_execute.c \
|
||||
slang_execute_x86.c \
|
||||
slang_export.c \
|
||||
slang_library_texsample.c \
|
||||
slang_emit.c \
|
||||
slang_ir.c \
|
||||
slang_label.c \
|
||||
slang_library_noise.c \
|
||||
slang_link.c \
|
||||
slang_log.c \
|
||||
slang_preprocess.c \
|
||||
slang_print.c \
|
||||
slang_simplify.c \
|
||||
slang_storage.c \
|
||||
slang_utility.c
|
||||
slang_typeinfo.c \
|
||||
slang_utility.c \
|
||||
slang_vartable.c
|
||||
|
|
|
@ -23,7 +23,6 @@ nodist_libswrast_la_SOURCES = s_aaline.c \
|
|||
s_aatriangle.c \
|
||||
s_accum.c \
|
||||
s_alpha.c \
|
||||
s_arbshader.c \
|
||||
s_atifragshader.c \
|
||||
s_bitmap.c \
|
||||
s_blend.c \
|
||||
|
@ -35,11 +34,11 @@ nodist_libswrast_la_SOURCES = s_aaline.c \
|
|||
s_drawpix.c \
|
||||
s_feedback.c \
|
||||
s_fog.c \
|
||||
s_fragprog.c \
|
||||
s_imaging.c \
|
||||
s_lines.c \
|
||||
s_logic.c \
|
||||
s_masking.c \
|
||||
s_nvfragprog.c \
|
||||
s_points.c \
|
||||
s_readpix.c \
|
||||
s_span.c \
|
||||
|
|
|
@ -23,7 +23,6 @@ nodist_libtnl_la_SOURCES = t_context.c \
|
|||
t_pipeline.c \
|
||||
t_vb_arbprogram.c \
|
||||
t_vb_arbprogram_sse.c \
|
||||
t_vb_arbshader.c \
|
||||
t_vb_cull.c \
|
||||
t_vb_fog.c \
|
||||
t_vb_light.c \
|
||||
|
|
|
@ -116,8 +116,7 @@ int XagAppGroupFree(
|
|||
return Success;
|
||||
}
|
||||
|
||||
/* static */
|
||||
void XagClientStateChange(
|
||||
static void XagClientStateChange(
|
||||
CallbackListPtr* pcbl,
|
||||
pointer nulldata,
|
||||
pointer calldata)
|
||||
|
@ -172,21 +171,6 @@ void XagClientStateChange(
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
XagExtensionInit(INITARGS)
|
||||
{
|
||||
if (AddExtension (XAGNAME,
|
||||
0,
|
||||
XagNumberErrors,
|
||||
ProcXagDispatch,
|
||||
SProcXagDispatch,
|
||||
XagResetProc,
|
||||
StandardMinorOpcode)) {
|
||||
RT_APPGROUP = CreateNewResourceType (XagAppGroupFree);
|
||||
XaceRegisterCallback(XACE_AUTH_AVAIL, XagCallClientStateChange, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static
|
||||
void XagResetProc(
|
||||
|
@ -393,8 +377,7 @@ int AttrValidate(
|
|||
return client->noClientException;
|
||||
}
|
||||
|
||||
/* static */
|
||||
int ProcXagCreate (
|
||||
static int ProcXagCreate (
|
||||
register ClientPtr client)
|
||||
{
|
||||
REQUEST (xXagCreateReq);
|
||||
|
@ -425,8 +408,7 @@ int ProcXagCreate (
|
|||
return client->noClientException;
|
||||
}
|
||||
|
||||
/* static */
|
||||
int ProcXagDestroy(
|
||||
static int ProcXagDestroy(
|
||||
register ClientPtr client)
|
||||
{
|
||||
AppGroupPtr pAppGrp;
|
||||
|
@ -743,18 +725,7 @@ XID XagId(
|
|||
return (client->appgroup ? client->appgroup->appgroupId : 0);
|
||||
}
|
||||
|
||||
void XagGetDeltaInfo(
|
||||
ClientPtr client,
|
||||
CARD32* buf)
|
||||
{
|
||||
*buf++ = (CARD32) client->appgroup->default_root;
|
||||
*buf++ = (CARD32) client->appgroup->root_visual;
|
||||
*buf++ = (CARD32) client->appgroup->default_colormap;
|
||||
*buf++ = (CARD32) client->appgroup->black_pixel;
|
||||
*buf = (CARD32) client->appgroup->white_pixel;
|
||||
}
|
||||
|
||||
void XagCallClientStateChange(
|
||||
static void XagCallClientStateChange(
|
||||
CallbackListPtr *pcbl,
|
||||
pointer nulldata,
|
||||
pointer calldata)
|
||||
|
@ -785,3 +756,18 @@ void XagCallClientStateChange(
|
|||
XagClientStateChange (NULL, NULL, (pointer)&clientinfo);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
XagExtensionInit(INITARGS)
|
||||
{
|
||||
if (AddExtension (XAGNAME,
|
||||
0,
|
||||
XagNumberErrors,
|
||||
ProcXagDispatch,
|
||||
SProcXagDispatch,
|
||||
XagResetProc,
|
||||
StandardMinorOpcode)) {
|
||||
RT_APPGROUP = CreateNewResourceType (XagAppGroupFree);
|
||||
XaceRegisterCallback(XACE_AUTH_AVAIL, XagCallClientStateChange, NULL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,12 +50,6 @@ extern ClientPtr XagLeader(
|
|||
ClientPtr /* client */
|
||||
);
|
||||
|
||||
extern void XagCallClientStateChange(
|
||||
CallbackListPtr * /* pcbl */,
|
||||
pointer /* nulldata */,
|
||||
pointer /* calldata */
|
||||
);
|
||||
|
||||
extern Bool XagIsControlledRoot (
|
||||
ClientPtr /* client */,
|
||||
WindowPtr /* pParent */
|
||||
|
@ -65,22 +59,6 @@ extern XID XagId (
|
|||
ClientPtr /* client */
|
||||
);
|
||||
|
||||
extern void XagGetDeltaInfo (
|
||||
ClientPtr /* client */,
|
||||
CARD32* /* buf */
|
||||
);
|
||||
|
||||
extern void XagClientStateChange(
|
||||
CallbackListPtr* pcbl,
|
||||
pointer nulldata,
|
||||
pointer calldata);
|
||||
|
||||
extern int ProcXagCreate (
|
||||
register ClientPtr client);
|
||||
|
||||
extern int ProcXagDestroy(
|
||||
register ClientPtr client);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _APPGROUP_SRV_H_ */
|
||||
|
|
|
@ -77,7 +77,7 @@ int PanoramiXPixHeight = 0;
|
|||
_X_EXPORT int PanoramiXNumScreens = 0;
|
||||
|
||||
_X_EXPORT PanoramiXData *panoramiXdataPtr = NULL;
|
||||
RegionRec PanoramiXScreenRegion = {{0, 0, 0, 0}, NULL};
|
||||
static RegionRec PanoramiXScreenRegion = {{0, 0, 0, 0}, NULL};
|
||||
|
||||
static int PanoramiXNumDepths;
|
||||
static DepthPtr PanoramiXDepths;
|
||||
|
@ -109,7 +109,6 @@ static void PanoramiXResetProc(ExtensionEntry*);
|
|||
#include "panoramiXh.h"
|
||||
|
||||
int (* SavedProcVector[256]) (ClientPtr client) = { NULL, };
|
||||
ScreenInfo *GlobalScrInfo = NULL;
|
||||
|
||||
static int PanoramiXGCIndex = -1;
|
||||
static int PanoramiXScreenIndex = -1;
|
||||
|
@ -135,7 +134,7 @@ static void XineramaChangeClip(GCPtr, int, pointer, int);
|
|||
static void XineramaDestroyClip(GCPtr);
|
||||
static void XineramaCopyClip(GCPtr, GCPtr);
|
||||
|
||||
GCFuncs XineramaGCFuncs = {
|
||||
static GCFuncs XineramaGCFuncs = {
|
||||
XineramaValidateGC, XineramaChangeGC, XineramaCopyGC, XineramaDestroyGC,
|
||||
XineramaChangeClip, XineramaDestroyClip, XineramaCopyClip
|
||||
};
|
||||
|
@ -168,7 +167,7 @@ XineramaCloseScreen (int i, ScreenPtr pScreen)
|
|||
return (*pScreen->CloseScreen) (i, pScreen);
|
||||
}
|
||||
|
||||
Bool
|
||||
static Bool
|
||||
XineramaCreateGC(GCPtr pGC)
|
||||
{
|
||||
ScreenPtr pScreen = pGC->pScreen;
|
||||
|
@ -330,8 +329,6 @@ XineramaDestroyClip(GCPtr pGC)
|
|||
Xinerama_GC_FUNC_EPILOGUE (pGC);
|
||||
}
|
||||
|
||||
|
||||
|
||||
_X_EXPORT int
|
||||
XineramaDeleteResource(pointer data, XID id)
|
||||
{
|
||||
|
@ -339,32 +336,11 @@ XineramaDeleteResource(pointer data, XID id)
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static Bool
|
||||
XineramaFindIDOnAnyScreen(pointer resource, XID id, pointer privdata)
|
||||
{
|
||||
PanoramiXRes *res = (PanoramiXRes*)resource;
|
||||
int j;
|
||||
|
||||
FOR_NSCREENS(j)
|
||||
if(res->info[j].id == *((XID*)privdata)) return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
PanoramiXRes *
|
||||
PanoramiXFindIDOnAnyScreen(RESTYPE type, XID id)
|
||||
{
|
||||
return LookupClientResourceComplex(clients[CLIENT_ID(id)], type,
|
||||
XineramaFindIDOnAnyScreen, &id);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
int screen;
|
||||
int id;
|
||||
} PanoramiXSearchData;
|
||||
|
||||
|
||||
static Bool
|
||||
XineramaFindIDByScrnum(pointer resource, XID id, pointer privdata)
|
||||
{
|
||||
|
@ -389,23 +365,6 @@ PanoramiXFindIDByScrnum(RESTYPE type, XID id, int screen)
|
|||
XineramaFindIDByScrnum, &data);
|
||||
}
|
||||
|
||||
WindowPtr
|
||||
PanoramiXChangeWindow(int ScrnNum, WindowPtr pWin)
|
||||
{
|
||||
int num = pWin->drawable.pScreen->myNum;
|
||||
|
||||
if(num != ScrnNum) {
|
||||
PanoramiXRes *win;
|
||||
|
||||
win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, num);
|
||||
|
||||
if (win)
|
||||
pWin = (WindowPtr) LookupIDByType(win->info[ScrnNum].id, RT_WINDOW);
|
||||
}
|
||||
|
||||
return pWin;
|
||||
}
|
||||
|
||||
typedef struct _connect_callback_list {
|
||||
void (*func)(void);
|
||||
struct _connect_callback_list *next;
|
||||
|
@ -496,7 +455,6 @@ void PanoramiXExtensionInit(int argc, char *argv[])
|
|||
if (noPanoramiXExtension)
|
||||
return;
|
||||
|
||||
GlobalScrInfo = &screenInfo; /* For debug visibility */
|
||||
PanoramiXNumScreens = screenInfo.numScreens;
|
||||
if (PanoramiXNumScreens == 1) { /* Only 1 screen */
|
||||
noPanoramiXExtension = TRUE;
|
||||
|
|
|
@ -94,18 +94,6 @@ typedef struct {
|
|||
(a).root = WindowTable[0]->drawable.id; \
|
||||
}
|
||||
|
||||
#define FORCE_WIN(a) { \
|
||||
if ((win = PanoramiXFindIDOnAnyScreen(XRT_WINDOW, a))) { \
|
||||
(a) = win->info[0].id; /* Real ID */ \
|
||||
} \
|
||||
}
|
||||
|
||||
#define FORCE_CMAP(a) { \
|
||||
if ((win = PanoramiXFindIDOnAnyScreen(XRT_COLORMAP, a))) { \
|
||||
(a) = win->info[0].id; /* Real ID */ \
|
||||
} \
|
||||
}
|
||||
|
||||
#define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared)
|
||||
|
||||
#define SKIP_FAKE_WINDOW(a) if(!LookupIDByType(a, XRT_WINDOW)) return
|
||||
|
|
|
@ -19,10 +19,10 @@ extern int PanoramiXGetGeometry(ClientPtr client);
|
|||
extern int PanoramiXTranslateCoords(ClientPtr client);
|
||||
extern int PanoramiXCreatePixmap(ClientPtr client);
|
||||
extern int PanoramiXFreePixmap(ClientPtr client);
|
||||
extern int PanoramiXCreateGC(ClientPtr client);
|
||||
extern int PanoramiXChangeGC(ClientPtr client);
|
||||
extern int PanoramiXCopyGC(ClientPtr client);
|
||||
extern int PanoramiXCopyColormapAndFree(ClientPtr client);
|
||||
extern int PanoramiXCreateGC(ClientPtr client);
|
||||
extern int PanoramiXSetDashes(ClientPtr client);
|
||||
extern int PanoramiXSetClipRectangles(ClientPtr client);
|
||||
extern int PanoramiXFreeGC(ClientPtr client);
|
||||
|
@ -64,7 +64,6 @@ PROC_EXTERN(ProcPanoramiXGetScreenSize);
|
|||
|
||||
PROC_EXTERN(ProcXineramaQueryScreens);
|
||||
PROC_EXTERN(ProcXineramaIsActive);
|
||||
extern Bool XineramaCreateGC(GCPtr pGC);
|
||||
|
||||
extern int SProcPanoramiXDispatch(ClientPtr client);
|
||||
|
||||
|
@ -72,6 +71,4 @@ extern char *ConnectionInfo;
|
|||
extern int connBlockScreenStart;
|
||||
extern xConnSetupPrefix connSetupPrefix;
|
||||
|
||||
extern ScreenInfo *GlobalScrInfo;
|
||||
extern int (* SavedProcVector[256]) (ClientPtr client);
|
||||
|
||||
|
|
|
@ -12,14 +12,11 @@ extern int PanoramiXNumScreens;
|
|||
extern PanoramiXData *panoramiXdataPtr;
|
||||
extern int PanoramiXPixWidth;
|
||||
extern int PanoramiXPixHeight;
|
||||
extern RegionRec PanoramiXScreenRegion;
|
||||
extern XID *PanoramiXVisualTable;
|
||||
|
||||
extern void PanoramiXConsolidate(void);
|
||||
extern Bool PanoramiXCreateConnectionBlock(void);
|
||||
extern PanoramiXRes * PanoramiXFindIDByScrnum(RESTYPE, XID, int);
|
||||
extern PanoramiXRes * PanoramiXFindIDOnAnyScreen(RESTYPE, XID);
|
||||
extern WindowPtr PanoramiXChangeWindow(int, WindowPtr);
|
||||
extern Bool XineramaRegisterConnectionBlockCallback(void (*func)(void));
|
||||
extern int XineramaDeleteResource(pointer, XID);
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ static unsigned char ScreenSaverReqCode = 0;
|
|||
#endif
|
||||
static int ScreenSaverEventBase = 0;
|
||||
|
||||
extern DISPATCH_PROC(ProcScreenSaverQueryInfo);
|
||||
static DISPATCH_PROC(ProcScreenSaverQueryInfo);
|
||||
static DISPATCH_PROC(ProcScreenSaverDispatch);
|
||||
static DISPATCH_PROC(ProcScreenSaverQueryVersion);
|
||||
static DISPATCH_PROC(ProcScreenSaverSelectInput);
|
||||
|
@ -774,7 +774,7 @@ ProcScreenSaverQueryVersion (client)
|
|||
return (client->noClientException);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
ProcScreenSaverQueryInfo (client)
|
||||
register ClientPtr client;
|
||||
{
|
||||
|
|
|
@ -77,7 +77,7 @@ typedef struct {
|
|||
#define AUTHID(client) \
|
||||
(((SecurityClientStateRec*)STATEPTR(client))->authId)
|
||||
|
||||
CallbackListPtr SecurityValidateGroupCallback = NULL; /* see security.h */
|
||||
static CallbackListPtr SecurityValidateGroupCallback = NULL;
|
||||
|
||||
RESTYPE SecurityAuthorizationResType; /* resource type for authorizations */
|
||||
|
||||
|
|
|
@ -72,15 +72,6 @@ typedef struct {
|
|||
struct _OtherClients *eventClients; /* clients wanting events */
|
||||
} SecurityAuthorizationRec, *SecurityAuthorizationPtr;
|
||||
|
||||
/* The following callback is called when a GenerateAuthorization request
|
||||
* is processed to sanity check the group argument. The call data will
|
||||
* be a pointer to a SecurityValidateGroupInfoRec (below).
|
||||
* Functions registered on this callback are expected to examine the
|
||||
* group and set the valid field to TRUE if they recognize the group as a
|
||||
* legitimate group. If they don't recognize it, they should not change the
|
||||
* valid field.
|
||||
*/
|
||||
extern CallbackListPtr SecurityValidateGroupCallback;
|
||||
typedef struct {
|
||||
XID group; /* the group that was sent in GenerateAuthorization */
|
||||
Bool valid; /* did anyone recognize it? if so, set to TRUE */
|
||||
|
|
|
@ -37,10 +37,10 @@ CallbackListPtr XaceHooks[XACE_NUM_HOOKS] = {0};
|
|||
* from guessing extension major opcodes and using the extension even though
|
||||
* the extension can't be listed or queried.
|
||||
*/
|
||||
int (*UntrustedProcVector[256])(
|
||||
static int (*UntrustedProcVector[256])(
|
||||
ClientPtr /*client*/
|
||||
);
|
||||
int (*SwappedUntrustedProcVector[256])(
|
||||
static int (*SwappedUntrustedProcVector[256])(
|
||||
ClientPtr /*client*/
|
||||
);
|
||||
|
||||
|
|
10
Xext/xace.h
10
Xext/xace.h
|
@ -82,16 +82,6 @@ extern int XaceHook(
|
|||
/* From the original Security extension...
|
||||
*/
|
||||
|
||||
/* Proc vectors for untrusted clients, swapped and unswapped versions.
|
||||
* These are the same as the normal proc vectors except that extensions
|
||||
* that haven't declared themselves secure will have ProcBadRequest plugged
|
||||
* in for their major opcode dispatcher. This prevents untrusted clients
|
||||
* from guessing extension major opcodes and using the extension even though
|
||||
* the extension can't be listed or queried.
|
||||
*/
|
||||
extern int (*UntrustedProcVector[256])(ClientPtr client);
|
||||
extern int (*SwappedUntrustedProcVector[256])(ClientPtr client);
|
||||
|
||||
extern void XaceCensorImage(
|
||||
ClientPtr client,
|
||||
RegionPtr pVisibleRegion,
|
||||
|
|
|
@ -52,7 +52,7 @@ of the copyright holder.
|
|||
#include "inputstr.h"
|
||||
#include "windowstr.h"
|
||||
#include "cursorstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
|
||||
#include "../os/osdep.h"
|
||||
|
||||
|
@ -105,7 +105,7 @@ typedef struct {
|
|||
} xevieKeycQueueRec, *xevieKeycQueuePtr;
|
||||
|
||||
#define KEYC_QUEUE_SIZE 100
|
||||
xevieKeycQueueRec keycq[KEYC_QUEUE_SIZE] = {{0, NULL}};
|
||||
static xevieKeycQueueRec keycq[KEYC_QUEUE_SIZE] = {{0, NULL}};
|
||||
static int keycqHead = 0, keycqTail = 0;
|
||||
|
||||
static int ProcDispatch (ClientPtr), SProcDispatch (ClientPtr);
|
||||
|
|
|
@ -76,9 +76,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXAllowDeviceEvents(register ClientPtr client)
|
||||
SProcXAllowDeviceEvents(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xAllowDeviceEventsReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -94,7 +94,7 @@ SProcXAllowDeviceEvents(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXAllowDeviceEvents(register ClientPtr client)
|
||||
ProcXAllowDeviceEvents(ClientPtr client)
|
||||
{
|
||||
TimeStamp time;
|
||||
DeviceIntPtr thisdev;
|
||||
|
|
|
@ -59,9 +59,9 @@ from the author.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXChangeDeviceCursor(register ClientPtr client)
|
||||
SProcXChangeDeviceCursor(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xChangeDeviceCursorReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -69,7 +69,7 @@ SProcXChangeDeviceCursor(register ClientPtr client)
|
|||
return (ProcXChangeDeviceCursor(client));
|
||||
}
|
||||
|
||||
int ProcXChangeDeviceCursor(register ClientPtr client)
|
||||
int ProcXChangeDeviceCursor(ClientPtr client)
|
||||
{
|
||||
int err;
|
||||
WindowPtr pWin = NULL;
|
||||
|
|
|
@ -78,9 +78,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXChangeDeviceControl(register ClientPtr client)
|
||||
SProcXChangeDeviceControl(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xChangeDeviceControlReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -287,7 +287,7 @@ void
|
|||
SRepXChangeDeviceControl(ClientPtr client, int size,
|
||||
xChangeDeviceControlReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
279
Xi/chgfctl.c
279
Xi/chgfctl.c
|
@ -78,9 +78,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXChangeFeedbackControl(register ClientPtr client)
|
||||
SProcXChangeFeedbackControl(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xChangeFeedbackControlReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -89,141 +89,17 @@ SProcXChangeFeedbackControl(register ClientPtr client)
|
|||
return (ProcXChangeFeedbackControl(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Change the control attributes.
|
||||
*
|
||||
*/
|
||||
|
||||
int
|
||||
ProcXChangeFeedbackControl(ClientPtr client)
|
||||
{
|
||||
unsigned len;
|
||||
DeviceIntPtr dev;
|
||||
KbdFeedbackPtr k;
|
||||
PtrFeedbackPtr p;
|
||||
IntegerFeedbackPtr i;
|
||||
StringFeedbackPtr s;
|
||||
BellFeedbackPtr b;
|
||||
LedFeedbackPtr l;
|
||||
|
||||
REQUEST(xChangeFeedbackControlReq);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
||||
|
||||
len = stuff->length - (sizeof(xChangeFeedbackControlReq) >> 2);
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
|
||||
switch (stuff->feedbackid) {
|
||||
case KbdFeedbackClass:
|
||||
if (len != (sizeof(xKbdFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (k = dev->kbdfeed; k; k = k->next)
|
||||
if (k->ctrl.id == ((xKbdFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeKbdFeedback(client, dev, stuff->mask, k,
|
||||
(xKbdFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
case PtrFeedbackClass:
|
||||
if (len != (sizeof(xPtrFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (p = dev->ptrfeed; p; p = p->next)
|
||||
if (p->ctrl.id == ((xPtrFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangePtrFeedback(client, dev, stuff->mask, p,
|
||||
(xPtrFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
case StringFeedbackClass:
|
||||
{
|
||||
register char n;
|
||||
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) & stuff[1]);
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&f->num_keysyms, n);
|
||||
}
|
||||
if (len != ((sizeof(xStringFeedbackCtl) >> 2) + f->num_keysyms)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (s = dev->stringfeed; s; s = s->next)
|
||||
if (s->ctrl.id == ((xStringFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeStringFeedback(client, dev, stuff->mask, s,
|
||||
(xStringFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case IntegerFeedbackClass:
|
||||
if (len != (sizeof(xIntegerFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (i = dev->intfeed; i; i = i->next)
|
||||
if (i->ctrl.id == ((xIntegerFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeIntegerFeedback(client, dev, stuff->mask, i,
|
||||
(xIntegerFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
case LedFeedbackClass:
|
||||
if (len != (sizeof(xLedFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (l = dev->leds; l; l = l->next)
|
||||
if (l->ctrl.id == ((xLedFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeLedFeedback(client, dev, stuff->mask, l,
|
||||
(xLedFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
case BellFeedbackClass:
|
||||
if (len != (sizeof(xBellFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (b = dev->bell; b; b = b->next)
|
||||
if (b->ctrl.id == ((xBellFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeBellFeedback(client, dev, stuff->mask, b,
|
||||
(xBellFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* This procedure changes KbdFeedbackClass data.
|
||||
*
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
||||
KbdFeedbackPtr k, xKbdFeedbackCtl * f)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
KeybdCtrl kctrl;
|
||||
int t;
|
||||
int key = DO_ALL;
|
||||
|
@ -351,11 +227,11 @@ ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
|||
*
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
||||
PtrFeedbackPtr p, xPtrFeedbackCtl * f)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
PtrCtrl pctrl; /* might get BadValue part way through */
|
||||
|
||||
if (client->swapped) {
|
||||
|
@ -422,12 +298,12 @@ ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
|||
*
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev,
|
||||
long unsigned int mask, IntegerFeedbackPtr i,
|
||||
xIntegerFeedbackCtl * f)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&f->length, n);
|
||||
|
@ -445,13 +321,13 @@ ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev,
|
|||
*
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev,
|
||||
long unsigned int mask, StringFeedbackPtr s,
|
||||
xStringFeedbackCtl * f)
|
||||
{
|
||||
register char n;
|
||||
register long *p;
|
||||
char n;
|
||||
long *p;
|
||||
int i, j;
|
||||
KeySym *syms, *sup_syms;
|
||||
|
||||
|
@ -495,12 +371,12 @@ ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev,
|
|||
*
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev,
|
||||
long unsigned int mask, BellFeedbackPtr b,
|
||||
xBellFeedbackCtl * f)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
int t;
|
||||
BellCtrl bctrl; /* might get BadValue part way through */
|
||||
|
||||
|
@ -560,11 +436,11 @@ ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev,
|
|||
*
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
||||
LedFeedbackPtr l, xLedFeedbackCtl * f)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
LedCtrl lctrl; /* might get BadValue part way through */
|
||||
|
||||
if (client->swapped) {
|
||||
|
@ -585,3 +461,128 @@ ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
|||
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Change the control attributes.
|
||||
*
|
||||
*/
|
||||
|
||||
int
|
||||
ProcXChangeFeedbackControl(ClientPtr client)
|
||||
{
|
||||
unsigned len;
|
||||
DeviceIntPtr dev;
|
||||
KbdFeedbackPtr k;
|
||||
PtrFeedbackPtr p;
|
||||
IntegerFeedbackPtr i;
|
||||
StringFeedbackPtr s;
|
||||
BellFeedbackPtr b;
|
||||
LedFeedbackPtr l;
|
||||
|
||||
REQUEST(xChangeFeedbackControlReq);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
||||
|
||||
len = stuff->length - (sizeof(xChangeFeedbackControlReq) >> 2);
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
|
||||
switch (stuff->feedbackid) {
|
||||
case KbdFeedbackClass:
|
||||
if (len != (sizeof(xKbdFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (k = dev->kbdfeed; k; k = k->next)
|
||||
if (k->ctrl.id == ((xKbdFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeKbdFeedback(client, dev, stuff->mask, k,
|
||||
(xKbdFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
case PtrFeedbackClass:
|
||||
if (len != (sizeof(xPtrFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (p = dev->ptrfeed; p; p = p->next)
|
||||
if (p->ctrl.id == ((xPtrFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangePtrFeedback(client, dev, stuff->mask, p,
|
||||
(xPtrFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
case StringFeedbackClass:
|
||||
{
|
||||
char n;
|
||||
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) & stuff[1]);
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&f->num_keysyms, n);
|
||||
}
|
||||
if (len != ((sizeof(xStringFeedbackCtl) >> 2) + f->num_keysyms)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (s = dev->stringfeed; s; s = s->next)
|
||||
if (s->ctrl.id == ((xStringFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeStringFeedback(client, dev, stuff->mask, s,
|
||||
(xStringFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case IntegerFeedbackClass:
|
||||
if (len != (sizeof(xIntegerFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (i = dev->intfeed; i; i = i->next)
|
||||
if (i->ctrl.id == ((xIntegerFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeIntegerFeedback(client, dev, stuff->mask, i,
|
||||
(xIntegerFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
case LedFeedbackClass:
|
||||
if (len != (sizeof(xLedFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (l = dev->leds; l; l = l->next)
|
||||
if (l->ctrl.id == ((xLedFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeLedFeedback(client, dev, stuff->mask, l,
|
||||
(xLedFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
case BellFeedbackClass:
|
||||
if (len != (sizeof(xBellFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (b = dev->bell; b; b = b->next)
|
||||
if (b->ctrl.id == ((xBellFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeBellFeedback(client, dev, stuff->mask, b,
|
||||
(xBellFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
42
Xi/chgfctl.h
42
Xi/chgfctl.h
|
@ -36,46 +36,4 @@ int SProcXChangeFeedbackControl(ClientPtr /* client */
|
|||
int ProcXChangeFeedbackControl(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ChangeKbdFeedback(ClientPtr /* client */ ,
|
||||
DeviceIntPtr /* dev */ ,
|
||||
unsigned long /* mask */ ,
|
||||
KbdFeedbackPtr /* k */ ,
|
||||
xKbdFeedbackCtl * /* f */
|
||||
);
|
||||
|
||||
int ChangePtrFeedback(ClientPtr /* client */ ,
|
||||
DeviceIntPtr /* dev */ ,
|
||||
unsigned long /* mask */ ,
|
||||
PtrFeedbackPtr /* p */ ,
|
||||
xPtrFeedbackCtl * /* f */
|
||||
);
|
||||
|
||||
int ChangeIntegerFeedback(ClientPtr /* client */ ,
|
||||
DeviceIntPtr /* dev */ ,
|
||||
unsigned long /* mask */ ,
|
||||
IntegerFeedbackPtr /* i */ ,
|
||||
xIntegerFeedbackCtl * /* f */
|
||||
);
|
||||
|
||||
int ChangeStringFeedback(ClientPtr /* client */ ,
|
||||
DeviceIntPtr /* dev */ ,
|
||||
unsigned long /* mask */ ,
|
||||
StringFeedbackPtr /* s */ ,
|
||||
xStringFeedbackCtl * /* f */
|
||||
);
|
||||
|
||||
int ChangeBellFeedback(ClientPtr /* client */ ,
|
||||
DeviceIntPtr /* dev */ ,
|
||||
unsigned long /* mask */ ,
|
||||
BellFeedbackPtr /* b */ ,
|
||||
xBellFeedbackCtl * /* f */
|
||||
);
|
||||
|
||||
int ChangeLedFeedback(ClientPtr /* client */ ,
|
||||
DeviceIntPtr /* dev */ ,
|
||||
unsigned long /* mask */ ,
|
||||
LedFeedbackPtr /* l */ ,
|
||||
xLedFeedbackCtl * /* f */
|
||||
);
|
||||
|
||||
#endif /* CHGFCTL_H */
|
||||
|
|
|
@ -78,9 +78,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXChangeKeyboardDevice(register ClientPtr client)
|
||||
SProcXChangeKeyboardDevice(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xChangeKeyboardDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -96,7 +96,7 @@ SProcXChangeKeyboardDevice(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXChangeKeyboardDevice(register ClientPtr client)
|
||||
ProcXChangeKeyboardDevice(ClientPtr client)
|
||||
{
|
||||
REQUEST(xChangeKeyboardDeviceReq);
|
||||
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
|
||||
|
|
10
Xi/chgkmap.c
10
Xi/chgkmap.c
|
@ -76,11 +76,11 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXChangeDeviceKeyMapping(register ClientPtr client)
|
||||
SProcXChangeDeviceKeyMapping(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
register long *p;
|
||||
register int i, count;
|
||||
char n;
|
||||
long *p;
|
||||
int i, count;
|
||||
|
||||
REQUEST(xChangeDeviceKeyMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -101,7 +101,7 @@ SProcXChangeDeviceKeyMapping(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXChangeDeviceKeyMapping(register ClientPtr client)
|
||||
ProcXChangeDeviceKeyMapping(ClientPtr client)
|
||||
{
|
||||
int ret;
|
||||
unsigned len;
|
||||
|
|
10
Xi/chgprop.c
10
Xi/chgprop.c
|
@ -78,11 +78,11 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXChangeDeviceDontPropagateList(register ClientPtr client)
|
||||
SProcXChangeDeviceDontPropagateList(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
register long *p;
|
||||
register int i;
|
||||
char n;
|
||||
long *p;
|
||||
int i;
|
||||
|
||||
REQUEST(xChangeDeviceDontPropagateListReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -104,7 +104,7 @@ SProcXChangeDeviceDontPropagateList(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXChangeDeviceDontPropagateList(register ClientPtr client)
|
||||
ProcXChangeDeviceDontPropagateList(ClientPtr client)
|
||||
{
|
||||
int i, rc;
|
||||
WindowPtr pWin;
|
||||
|
|
|
@ -82,9 +82,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXChangePointerDevice(register ClientPtr client)
|
||||
SProcXChangePointerDevice(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xChangePointerDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -99,7 +99,7 @@ SProcXChangePointerDevice(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXChangePointerDevice(register ClientPtr client)
|
||||
ProcXChangePointerDevice(ClientPtr client)
|
||||
{
|
||||
REQUEST(xChangePointerDeviceReq);
|
||||
REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
|
||||
|
|
|
@ -45,12 +45,4 @@ void SendEventToAllWindows(DeviceIntPtr /* dev */ ,
|
|||
int /* count */
|
||||
);
|
||||
|
||||
void FindInterestedChildren( /* FIXME: could be static? */
|
||||
DeviceIntPtr /* dev */ ,
|
||||
WindowPtr /* p1 */ ,
|
||||
Mask /* mask */ ,
|
||||
xEvent * /* ev */ ,
|
||||
int /* count */
|
||||
);
|
||||
|
||||
#endif /* CHGPTR_H */
|
||||
|
|
|
@ -60,9 +60,9 @@ from the author.
|
|||
*
|
||||
*/
|
||||
|
||||
int SProcXChangePointerKeyboardPairing(register ClientPtr client)
|
||||
int SProcXChangePointerKeyboardPairing(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xChangePointerKeyboardPairingReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -70,7 +70,7 @@ int SProcXChangePointerKeyboardPairing(register ClientPtr client)
|
|||
}
|
||||
|
||||
int
|
||||
ProcXChangePointerKeyboardPairing(register ClientPtr client)
|
||||
ProcXChangePointerKeyboardPairing(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr pPointer, pKeyboard;
|
||||
int ret;
|
||||
|
|
100
Xi/closedev.c
100
Xi/closedev.c
|
@ -77,9 +77,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXCloseDevice(register ClientPtr client)
|
||||
SProcXCloseDevice(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xCloseDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -87,6 +87,53 @@ SProcXCloseDevice(register ClientPtr client)
|
|||
return (ProcXCloseDevice(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Clear out event selections and passive grabs from a window for the
|
||||
* specified device.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
|
||||
{
|
||||
InputClientsPtr others;
|
||||
OtherInputMasks *pOthers;
|
||||
GrabPtr grab, next;
|
||||
|
||||
if ((pOthers = wOtherInputMasks(pWin)) != 0)
|
||||
for (others = pOthers->inputClients; others; others = others->next)
|
||||
if (SameClient(others, client))
|
||||
others->mask[dev->id] = NoEventMask;
|
||||
|
||||
for (grab = wPassiveGrabs(pWin); grab; grab = next) {
|
||||
next = grab->next;
|
||||
if ((grab->device == dev) &&
|
||||
(client->clientAsMask == CLIENT_BITS(grab->resource)))
|
||||
FreeResource(grab->resource, RT_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Walk througth the window tree, deleting event selections for this client
|
||||
* from this device from all windows.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client)
|
||||
{
|
||||
WindowPtr p2;
|
||||
|
||||
while (p1) {
|
||||
p2 = p1->firstChild;
|
||||
DeleteDeviceEvents(dev, p1, client);
|
||||
DeleteEventsFromChildren(dev, p2, client);
|
||||
p1 = p1->nextSib;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure closes an input device.
|
||||
|
@ -94,7 +141,7 @@ SProcXCloseDevice(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXCloseDevice(register ClientPtr client)
|
||||
ProcXCloseDevice(ClientPtr client)
|
||||
{
|
||||
int i;
|
||||
WindowPtr pWin, p1;
|
||||
|
@ -126,50 +173,3 @@ ProcXCloseDevice(register ClientPtr client)
|
|||
CloseInputDevice(d, client);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Walk througth the window tree, deleting event selections for this client
|
||||
* from this device from all windows.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client)
|
||||
{
|
||||
WindowPtr p2;
|
||||
|
||||
while (p1) {
|
||||
p2 = p1->firstChild;
|
||||
DeleteDeviceEvents(dev, p1, client);
|
||||
DeleteEventsFromChildren(dev, p2, client);
|
||||
p1 = p1->nextSib;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Clear out event selections and passive grabs from a window for the
|
||||
* specified device.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
|
||||
{
|
||||
InputClientsPtr others;
|
||||
OtherInputMasks *pOthers;
|
||||
GrabPtr grab, next;
|
||||
|
||||
if ((pOthers = wOtherInputMasks(pWin)) != 0)
|
||||
for (others = pOthers->inputClients; others; others = others->next)
|
||||
if (SameClient(others, client))
|
||||
others->mask[dev->id] = NoEventMask;
|
||||
|
||||
for (grab = wPassiveGrabs(pWin); grab; grab = next) {
|
||||
next = grab->next;
|
||||
if ((grab->device == dev) &&
|
||||
(client->clientAsMask == CLIENT_BITS(grab->resource)))
|
||||
FreeResource(grab->resource, RT_NONE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,14 +36,4 @@ int SProcXCloseDevice(ClientPtr /* client */
|
|||
int ProcXCloseDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void DeleteEventsFromChildren(DeviceIntPtr /* dev */ ,
|
||||
WindowPtr /* p1 */ ,
|
||||
ClientPtr /* client */
|
||||
);
|
||||
|
||||
void DeleteDeviceEvents(DeviceIntPtr /* dev */ ,
|
||||
WindowPtr /* pWin */ ,
|
||||
ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* CLOSEDEV_H */
|
||||
|
|
|
@ -75,9 +75,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXDeviceBell(register ClientPtr client)
|
||||
SProcXDeviceBell(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xDeviceBellReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -91,7 +91,7 @@ SProcXDeviceBell(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXDeviceBell(register ClientPtr client)
|
||||
ProcXDeviceBell(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
KbdFeedbackPtr k;
|
||||
|
|
|
@ -319,7 +319,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
|
|||
_X_EXPORT int
|
||||
InitProximityClassDeviceStruct(DeviceIntPtr dev)
|
||||
{
|
||||
register ProximityClassPtr proxc;
|
||||
ProximityClassPtr proxc;
|
||||
|
||||
proxc = (ProximityClassPtr) xalloc(sizeof(ProximityClassRec));
|
||||
if (!proxc)
|
||||
|
@ -332,7 +332,7 @@ _X_EXPORT void
|
|||
InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, int minval, int maxval,
|
||||
int resolution, int min_res, int max_res)
|
||||
{
|
||||
register AxisInfoPtr ax;
|
||||
AxisInfoPtr ax;
|
||||
|
||||
if (!dev || !dev->valuator)
|
||||
return;
|
||||
|
@ -409,7 +409,7 @@ FixDeviceValuator(DeviceIntPtr dev, deviceValuator * ev, ValuatorClassPtr v,
|
|||
|
||||
void
|
||||
DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
|
||||
register WindowPtr pWin)
|
||||
WindowPtr pWin)
|
||||
{
|
||||
deviceFocus event;
|
||||
|
||||
|
@ -734,9 +734,9 @@ MakeInputMasks(WindowPtr pWin)
|
|||
void
|
||||
RecalculateDeviceDeliverableEvents(WindowPtr pWin)
|
||||
{
|
||||
register InputClientsPtr others;
|
||||
InputClientsPtr others;
|
||||
struct _OtherInputMasks *inputMasks; /* default: NULL */
|
||||
register WindowPtr pChild, tmp;
|
||||
WindowPtr pChild, tmp;
|
||||
int i;
|
||||
|
||||
pChild = pWin;
|
||||
|
@ -770,9 +770,9 @@ RecalculateDeviceDeliverableEvents(WindowPtr pWin)
|
|||
}
|
||||
|
||||
int
|
||||
InputClientGone(register WindowPtr pWin, XID id)
|
||||
InputClientGone(WindowPtr pWin, XID id)
|
||||
{
|
||||
register InputClientsPtr other, prev;
|
||||
InputClientsPtr other, prev;
|
||||
|
||||
if (!wOtherInputMasks(pWin))
|
||||
return (Success);
|
||||
|
@ -870,7 +870,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
|
|||
int
|
||||
SetButtonMapping(ClientPtr client, DeviceIntPtr dev, int nElts, BYTE * map)
|
||||
{
|
||||
register int i;
|
||||
int i;
|
||||
ButtonClassPtr b = dev->button;
|
||||
|
||||
if (b == NULL)
|
||||
|
@ -896,7 +896,7 @@ SetModifierMapping(ClientPtr client, DeviceIntPtr dev, int len, int rlen,
|
|||
{
|
||||
KeyCode *map = NULL;
|
||||
int inputMapLen;
|
||||
register int i;
|
||||
int i;
|
||||
|
||||
*k = dev->key;
|
||||
if (*k == NULL)
|
||||
|
@ -1025,33 +1025,7 @@ ChangeKeyMapping(ClientPtr client,
|
|||
return client->noClientException;
|
||||
}
|
||||
|
||||
void
|
||||
DeleteWindowFromAnyExtEvents(WindowPtr pWin, Bool freeResources)
|
||||
{
|
||||
int i;
|
||||
DeviceIntPtr dev;
|
||||
InputClientsPtr ic;
|
||||
struct _OtherInputMasks *inputMasks;
|
||||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if (dev == inputInfo.pointer || dev == inputInfo.keyboard)
|
||||
continue;
|
||||
DeleteDeviceFromAnyExtEvents(pWin, dev);
|
||||
}
|
||||
|
||||
for (dev = inputInfo.off_devices; dev; dev = dev->next)
|
||||
DeleteDeviceFromAnyExtEvents(pWin, dev);
|
||||
|
||||
if (freeResources)
|
||||
while ((inputMasks = wOtherInputMasks(pWin)) != 0) {
|
||||
ic = inputMasks->inputClients;
|
||||
for (i = 0; i < EMASKSIZE; i++)
|
||||
inputMasks->dontPropagateMask[i] = 0;
|
||||
FreeResource(ic->resource, RT_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
DeleteDeviceFromAnyExtEvents(WindowPtr pWin, DeviceIntPtr dev)
|
||||
{
|
||||
WindowPtr parent;
|
||||
|
@ -1116,6 +1090,32 @@ DeleteDeviceFromAnyExtEvents(WindowPtr pWin, DeviceIntPtr dev)
|
|||
dev->valuator->motionHintWindow = NullWindow;
|
||||
}
|
||||
|
||||
void
|
||||
DeleteWindowFromAnyExtEvents(WindowPtr pWin, Bool freeResources)
|
||||
{
|
||||
int i;
|
||||
DeviceIntPtr dev;
|
||||
InputClientsPtr ic;
|
||||
struct _OtherInputMasks *inputMasks;
|
||||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if (dev == inputInfo.pointer || dev == inputInfo.keyboard)
|
||||
continue;
|
||||
DeleteDeviceFromAnyExtEvents(pWin, dev);
|
||||
}
|
||||
|
||||
for (dev = inputInfo.off_devices; dev; dev = dev->next)
|
||||
DeleteDeviceFromAnyExtEvents(pWin, dev);
|
||||
|
||||
if (freeResources)
|
||||
while ((inputMasks = wOtherInputMasks(pWin)) != 0) {
|
||||
ic = inputMasks->inputClients;
|
||||
for (i = 0; i < EMASKSIZE; i++)
|
||||
inputMasks->dontPropagateMask[i] = 0;
|
||||
FreeResource(ic->resource, RT_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer * pEvents, Mask mask)
|
||||
{
|
||||
|
@ -1169,10 +1169,10 @@ CheckDeviceGrabAndHintWindow(WindowPtr pWin, int type,
|
|||
}
|
||||
}
|
||||
|
||||
Mask
|
||||
static Mask
|
||||
DeviceEventMaskForClient(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
|
||||
{
|
||||
register InputClientsPtr other;
|
||||
InputClientsPtr other;
|
||||
|
||||
if (!wOtherInputMasks(pWin))
|
||||
return 0;
|
||||
|
@ -1185,7 +1185,7 @@ DeviceEventMaskForClient(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
|
|||
}
|
||||
|
||||
void
|
||||
MaybeStopDeviceHint(register DeviceIntPtr dev, ClientPtr client)
|
||||
MaybeStopDeviceHint(DeviceIntPtr dev, ClientPtr client)
|
||||
{
|
||||
WindowPtr pWin;
|
||||
GrabPtr grab = dev->deviceGrab.grab;
|
||||
|
@ -1254,7 +1254,7 @@ ShouldFreeInputMasks(WindowPtr pWin, Bool ignoreSelectedEvents)
|
|||
*
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
FindInterestedChildren(DeviceIntPtr dev, WindowPtr p1, Mask mask,
|
||||
xEvent * ev, int count)
|
||||
{
|
||||
|
|
|
@ -37,7 +37,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
|
||||
extern int IReqCode;
|
||||
extern int BadDevice;
|
||||
extern int BadEvent;
|
||||
extern int BadMode;
|
||||
extern int DeviceBusy;
|
||||
extern int BadClass;
|
||||
|
@ -46,7 +45,6 @@ extern Mask DevicePointerMotionMask;
|
|||
extern Mask DevicePointerMotionHintMask;
|
||||
extern Mask DeviceFocusChangeMask;
|
||||
extern Mask DeviceStateNotifyMask;
|
||||
extern Mask ChangeDeviceNotifyMask;
|
||||
extern Mask DeviceMappingNotifyMask;
|
||||
extern Mask DeviceOwnerGrabButtonMask;
|
||||
extern Mask DeviceButtonGrabMask;
|
||||
|
|
447
Xi/extinit.c
447
Xi/extinit.c
|
@ -127,7 +127,7 @@ int ExtEventIndex;
|
|||
Mask ExtValidMasks[EMASKSIZE];
|
||||
Mask ExtExclusiveMasks[EMASKSIZE];
|
||||
|
||||
struct dev_type
|
||||
static struct dev_type
|
||||
{
|
||||
Atom type;
|
||||
char *name;
|
||||
|
@ -163,7 +163,7 @@ XExtEventInfo EventInfo[32];
|
|||
|
||||
int IReqCode = 0;
|
||||
int BadDevice = 0;
|
||||
int BadEvent = 1;
|
||||
static int BadEvent = 1;
|
||||
int BadMode = 2;
|
||||
int DeviceBusy = 3;
|
||||
int BadClass = 4;
|
||||
|
@ -172,7 +172,7 @@ Mask DevicePointerMotionMask;
|
|||
Mask DevicePointerMotionHintMask;
|
||||
Mask DeviceFocusChangeMask;
|
||||
Mask DeviceStateNotifyMask;
|
||||
Mask ChangeDeviceNotifyMask;
|
||||
static Mask ChangeDeviceNotifyMask;
|
||||
Mask DeviceMappingNotifyMask;
|
||||
Mask DeviceOwnerGrabButtonMask;
|
||||
Mask DeviceButtonGrabMask;
|
||||
|
@ -225,54 +225,6 @@ static XExtensionVersion thisversion = { XI_Present,
|
|||
XI_Add_DevicePresenceNotify_Minor
|
||||
};
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* IExtensionInit - initialize the input extension.
|
||||
*
|
||||
* Called from InitExtensions in main() or from QueryExtension() if the
|
||||
* extension is dynamically loaded.
|
||||
*
|
||||
* This extension has several events and errors.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
XInputExtensionInit(void)
|
||||
{
|
||||
ExtensionEntry *extEntry;
|
||||
|
||||
extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch,
|
||||
SProcIDispatch, IResetProc, StandardMinorOpcode);
|
||||
if (extEntry) {
|
||||
IReqCode = extEntry->base;
|
||||
AllExtensionVersions[IReqCode - 128] = thisversion;
|
||||
MakeDeviceTypeAtoms();
|
||||
RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone);
|
||||
FixExtensionEvents(extEntry);
|
||||
ReplySwapVector[IReqCode] = (ReplySwapPtr) SReplyIDispatch;
|
||||
EventSwapVector[DeviceValuator] = SEventIDispatch;
|
||||
EventSwapVector[DeviceKeyPress] = SEventIDispatch;
|
||||
EventSwapVector[DeviceKeyRelease] = SEventIDispatch;
|
||||
EventSwapVector[DeviceButtonPress] = SEventIDispatch;
|
||||
EventSwapVector[DeviceButtonRelease] = SEventIDispatch;
|
||||
EventSwapVector[DeviceMotionNotify] = SEventIDispatch;
|
||||
EventSwapVector[DeviceFocusIn] = SEventIDispatch;
|
||||
EventSwapVector[DeviceFocusOut] = SEventIDispatch;
|
||||
EventSwapVector[ProximityIn] = SEventIDispatch;
|
||||
EventSwapVector[ProximityOut] = SEventIDispatch;
|
||||
EventSwapVector[DeviceStateNotify] = SEventIDispatch;
|
||||
EventSwapVector[DeviceKeyStateNotify] = SEventIDispatch;
|
||||
EventSwapVector[DeviceButtonStateNotify] = SEventIDispatch;
|
||||
EventSwapVector[DeviceMappingNotify] = SEventIDispatch;
|
||||
EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
|
||||
EventSwapVector[DeviceEnterNotify] = SEventIDispatch;
|
||||
EventSwapVector[DeviceLeaveNotify] = SEventIDispatch;
|
||||
EventSwapVector[PointerKeyboardPairingChangedNotify] = SEventIDispatch;
|
||||
} else {
|
||||
FatalError("IExtensionInit: AddExtensions failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* ProcIDispatch - main dispatch routine for requests to this extension.
|
||||
|
@ -280,8 +232,8 @@ XInputExtensionInit(void)
|
|||
*
|
||||
*/
|
||||
|
||||
int
|
||||
ProcIDispatch(register ClientPtr client)
|
||||
static int
|
||||
ProcIDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
if (stuff->data == X_GetExtensionVersion)
|
||||
|
@ -391,8 +343,8 @@ ProcIDispatch(register ClientPtr client)
|
|||
*
|
||||
*/
|
||||
|
||||
int
|
||||
SProcIDispatch(register ClientPtr client)
|
||||
static int
|
||||
SProcIDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
if (stuff->data == X_GetExtensionVersion)
|
||||
|
@ -505,7 +457,7 @@ SProcIDispatch(register ClientPtr client)
|
|||
if (rep->RepType == X_##code) \
|
||||
SRepX##code (client, len, (x##code##Reply *) rep)
|
||||
|
||||
void
|
||||
static void
|
||||
SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
|
||||
/* All we look at is the type field */
|
||||
{ /* This is common to all replies */
|
||||
|
@ -580,78 +532,17 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
|
|||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* SEventIDispatch
|
||||
*
|
||||
* Swap any events defined in this extension.
|
||||
*/
|
||||
#define DO_SWAP(func,type) func ((type *)from, (type *)to)
|
||||
|
||||
void
|
||||
SEventIDispatch(xEvent * from, xEvent * to)
|
||||
{
|
||||
int type = from->u.u.type & 0177;
|
||||
|
||||
if (type == DeviceValuator)
|
||||
DO_SWAP(SEventDeviceValuator, deviceValuator);
|
||||
else if (type == DeviceKeyPress) {
|
||||
SKeyButtonPtrEvent(from, to);
|
||||
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
|
||||
} else if (type == DeviceKeyRelease) {
|
||||
SKeyButtonPtrEvent(from, to);
|
||||
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
|
||||
} else if (type == DeviceButtonPress) {
|
||||
SKeyButtonPtrEvent(from, to);
|
||||
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
|
||||
} else if (type == DeviceButtonRelease) {
|
||||
SKeyButtonPtrEvent(from, to);
|
||||
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
|
||||
} else if (type == DeviceMotionNotify) {
|
||||
SKeyButtonPtrEvent(from, to);
|
||||
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
|
||||
} else if (type == DeviceFocusIn)
|
||||
DO_SWAP(SEventFocus, deviceFocus);
|
||||
else if (type == DeviceFocusOut)
|
||||
DO_SWAP(SEventFocus, deviceFocus);
|
||||
else if (type == ProximityIn) {
|
||||
SKeyButtonPtrEvent(from, to);
|
||||
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
|
||||
} else if (type == ProximityOut) {
|
||||
SKeyButtonPtrEvent(from, to);
|
||||
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
|
||||
} else if (type == DeviceStateNotify)
|
||||
DO_SWAP(SDeviceStateNotifyEvent, deviceStateNotify);
|
||||
else if (type == DeviceKeyStateNotify)
|
||||
DO_SWAP(SDeviceKeyStateNotifyEvent, deviceKeyStateNotify);
|
||||
else if (type == DeviceButtonStateNotify)
|
||||
DO_SWAP(SDeviceButtonStateNotifyEvent, deviceButtonStateNotify);
|
||||
else if (type == DeviceMappingNotify)
|
||||
DO_SWAP(SDeviceMappingNotifyEvent, deviceMappingNotify);
|
||||
else if (type == ChangeDeviceNotify)
|
||||
DO_SWAP(SChangeDeviceNotifyEvent, changeDeviceNotify);
|
||||
else if (type == DeviceEnterNotify)
|
||||
DO_SWAP(SDeviceEnterNotifyEvent, deviceEnterNotify);
|
||||
else if (type == DeviceLeaveNotify)
|
||||
DO_SWAP(SDeviceLeaveNotifyEvent, deviceLeaveNotify);
|
||||
else if (type == PointerKeyboardPairingChangedNotify)
|
||||
DO_SWAP(SPointerKeyboardPairingChangedNotifyEvent, pairingChangedNotify);
|
||||
else {
|
||||
FatalError("XInputExtension: Impossible event!\n");
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* This function swaps the DeviceValuator event.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
SEventDeviceValuator(deviceValuator * from, deviceValuator * to)
|
||||
{
|
||||
register char n;
|
||||
register int i;
|
||||
char n;
|
||||
int i;
|
||||
INT32 *ip B32;
|
||||
|
||||
*to = *from;
|
||||
|
@ -663,10 +554,10 @@ SEventDeviceValuator(deviceValuator * from, deviceValuator * to)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
SEventFocus(deviceFocus * from, deviceFocus * to)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber, n);
|
||||
|
@ -674,11 +565,11 @@ SEventFocus(deviceFocus * from, deviceFocus * to)
|
|||
swapl(&to->window, n);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to)
|
||||
{
|
||||
register int i;
|
||||
register char n;
|
||||
int i;
|
||||
char n;
|
||||
INT32 *ip B32;
|
||||
|
||||
*to = *from;
|
||||
|
@ -690,50 +581,50 @@ SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
SDeviceKeyStateNotifyEvent(deviceKeyStateNotify * from,
|
||||
deviceKeyStateNotify * to)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber, n);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
SDeviceButtonStateNotifyEvent(deviceButtonStateNotify * from,
|
||||
deviceButtonStateNotify * to)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber, n);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
SChangeDeviceNotifyEvent(changeDeviceNotify * from, changeDeviceNotify * to)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber, n);
|
||||
swapl(&to->time, n);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
SDeviceMappingNotifyEvent(deviceMappingNotify * from, deviceMappingNotify * to)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber, n);
|
||||
swapl(&to->time, n);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber,n);
|
||||
|
@ -741,18 +632,20 @@ SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to
|
|||
swaps(&to->control, n);
|
||||
}
|
||||
|
||||
void SDeviceEnterNotifyEvent (deviceEnterNotify *from, deviceEnterNotify *to)
|
||||
static void
|
||||
SDeviceEnterNotifyEvent (deviceEnterNotify *from, deviceEnterNotify *to)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber,n);
|
||||
swapl(&to->time, n);
|
||||
}
|
||||
|
||||
void SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to)
|
||||
static void
|
||||
SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber,n);
|
||||
|
@ -766,23 +659,117 @@ void SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to)
|
|||
swaps(&to->eventY, n);
|
||||
}
|
||||
|
||||
void SPointerKeyboardPairingChangedNotifyEvent (pairingChangedNotify *from,
|
||||
static void
|
||||
SPointerKeyboardPairingChangedNotifyEvent (pairingChangedNotify *from,
|
||||
pairingChangedNotify *to)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber, n);
|
||||
swapl(&to->time, n);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Allow the specified event to have its propagation suppressed.
|
||||
* The default is to not allow suppression of propagation.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
AllowPropagateSuppress(Mask mask)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_DEVICES; i++)
|
||||
PropagateMask[i] |= mask;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Return the next available extension event mask.
|
||||
*
|
||||
*/
|
||||
|
||||
static Mask
|
||||
GetNextExtEventMask(void)
|
||||
{
|
||||
int i;
|
||||
Mask mask = lastExtEventMask;
|
||||
|
||||
if (lastExtEventMask == 0) {
|
||||
FatalError("GetNextExtEventMask: no more events are available.");
|
||||
}
|
||||
lastExtEventMask <<= 1;
|
||||
|
||||
for (i = 0; i < MAX_DEVICES; i++)
|
||||
ExtValidMasks[i] |= mask;
|
||||
return mask;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Record an event mask where there is no unique corresponding event type.
|
||||
* We can't call SetMaskForEvent, since that would clobber the existing
|
||||
* mask for that event. MotionHint and ButtonMotion are examples.
|
||||
*
|
||||
* Since extension event types will never be less than 64, we can use
|
||||
* 0-63 in the EventInfo array as the "type" to be used to look up this
|
||||
* mask. This means that the corresponding macros such as
|
||||
* DevicePointerMotionHint must have access to the same constants.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
SetEventInfo(Mask mask, int constant)
|
||||
{
|
||||
EventInfo[ExtEventIndex].mask = mask;
|
||||
EventInfo[ExtEventIndex++].type = constant;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Allow the specified event to be restricted to being selected by one
|
||||
* client at a time.
|
||||
* The default is to allow more than one client to select the event.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
SetExclusiveAccess(Mask mask)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_DEVICES; i++)
|
||||
ExtExclusiveMasks[i] |= mask;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Assign the specified mask to the specified event.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
SetMaskForExtEvent(Mask mask, int event)
|
||||
{
|
||||
|
||||
EventInfo[ExtEventIndex].mask = mask;
|
||||
EventInfo[ExtEventIndex++].type = event;
|
||||
|
||||
if ((event < LASTEvent) || (event >= 128))
|
||||
FatalError("MaskForExtensionEvent: bogus event number");
|
||||
SetMaskForEvent(mask, event);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* This function sets up extension event types and masks.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
FixExtensionEvents(ExtensionEntry * extEntry)
|
||||
{
|
||||
Mask mask;
|
||||
|
@ -905,7 +892,7 @@ FixExtensionEvents(ExtensionEntry * extEntry)
|
|||
*
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
RestoreExtensionEvents(void)
|
||||
{
|
||||
int i;
|
||||
|
@ -956,7 +943,7 @@ RestoreExtensionEvents(void)
|
|||
*
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
IResetProc(ExtensionEntry * unused)
|
||||
{
|
||||
|
||||
|
@ -989,7 +976,7 @@ IResetProc(ExtensionEntry * unused)
|
|||
*
|
||||
*/
|
||||
|
||||
Bool
|
||||
_X_EXPORT Bool
|
||||
DeviceIsPointerType(DeviceIntPtr dev)
|
||||
{
|
||||
if (dev_type[1].type == dev->type)
|
||||
|
@ -1019,7 +1006,7 @@ AssignTypeAndName(DeviceIntPtr dev, Atom type, char *name)
|
|||
*
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
MakeDeviceTypeAtoms(void)
|
||||
{
|
||||
int i;
|
||||
|
@ -1052,95 +1039,113 @@ LookupDeviceIntRec(CARD8 id)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Allow the specified event to be restricted to being selected by one
|
||||
* client at a time.
|
||||
* The default is to allow more than one client to select the event.
|
||||
* SEventIDispatch
|
||||
*
|
||||
* Swap any events defined in this extension.
|
||||
*/
|
||||
#define DO_SWAP(func,type) func ((type *)from, (type *)to)
|
||||
|
||||
void
|
||||
SetExclusiveAccess(Mask mask)
|
||||
static void
|
||||
SEventIDispatch(xEvent * from, xEvent * to)
|
||||
{
|
||||
int i;
|
||||
int type = from->u.u.type & 0177;
|
||||
|
||||
for (i = 0; i < MAX_DEVICES; i++)
|
||||
ExtExclusiveMasks[i] |= mask;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Allow the specified event to have its propagation suppressed.
|
||||
* The default is to not allow suppression of propagation.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
AllowPropagateSuppress(Mask mask)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_DEVICES; i++)
|
||||
PropagateMask[i] |= mask;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Return the next available extension event mask.
|
||||
*
|
||||
*/
|
||||
|
||||
Mask
|
||||
GetNextExtEventMask(void)
|
||||
{
|
||||
int i;
|
||||
Mask mask = lastExtEventMask;
|
||||
|
||||
if (lastExtEventMask == 0) {
|
||||
FatalError("GetNextExtEventMask: no more events are available.");
|
||||
if (type == DeviceValuator)
|
||||
DO_SWAP(SEventDeviceValuator, deviceValuator);
|
||||
else if (type == DeviceKeyPress) {
|
||||
SKeyButtonPtrEvent(from, to);
|
||||
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
|
||||
} else if (type == DeviceKeyRelease) {
|
||||
SKeyButtonPtrEvent(from, to);
|
||||
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
|
||||
} else if (type == DeviceButtonPress) {
|
||||
SKeyButtonPtrEvent(from, to);
|
||||
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
|
||||
} else if (type == DeviceButtonRelease) {
|
||||
SKeyButtonPtrEvent(from, to);
|
||||
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
|
||||
} else if (type == DeviceMotionNotify) {
|
||||
SKeyButtonPtrEvent(from, to);
|
||||
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
|
||||
} else if (type == DeviceFocusIn)
|
||||
DO_SWAP(SEventFocus, deviceFocus);
|
||||
else if (type == DeviceFocusOut)
|
||||
DO_SWAP(SEventFocus, deviceFocus);
|
||||
else if (type == ProximityIn) {
|
||||
SKeyButtonPtrEvent(from, to);
|
||||
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
|
||||
} else if (type == ProximityOut) {
|
||||
SKeyButtonPtrEvent(from, to);
|
||||
to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
|
||||
} else if (type == DeviceStateNotify)
|
||||
DO_SWAP(SDeviceStateNotifyEvent, deviceStateNotify);
|
||||
else if (type == DeviceKeyStateNotify)
|
||||
DO_SWAP(SDeviceKeyStateNotifyEvent, deviceKeyStateNotify);
|
||||
else if (type == DeviceButtonStateNotify)
|
||||
DO_SWAP(SDeviceButtonStateNotifyEvent, deviceButtonStateNotify);
|
||||
else if (type == DeviceMappingNotify)
|
||||
DO_SWAP(SDeviceMappingNotifyEvent, deviceMappingNotify);
|
||||
else if (type == ChangeDeviceNotify)
|
||||
DO_SWAP(SChangeDeviceNotifyEvent, changeDeviceNotify);
|
||||
else if (type == DevicePresenceNotify)
|
||||
DO_SWAP(SDevicePresenceNotifyEvent, devicePresenceNotify);
|
||||
else if (type == DeviceEnterNotify)
|
||||
DO_SWAP(SDeviceEnterNotifyEvent, deviceEnterNotify);
|
||||
else if (type == DeviceLeaveNotify)
|
||||
DO_SWAP(SDeviceLeaveNotifyEvent, deviceLeaveNotify);
|
||||
else if (type == PointerKeyboardPairingChangedNotify)
|
||||
DO_SWAP(SPointerKeyboardPairingChangedNotifyEvent, pairingChangedNotify);
|
||||
else {
|
||||
FatalError("XInputExtension: Impossible event!\n");
|
||||
}
|
||||
lastExtEventMask <<= 1;
|
||||
|
||||
for (i = 0; i < MAX_DEVICES; i++)
|
||||
ExtValidMasks[i] |= mask;
|
||||
return mask;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
/**********************************************************************
|
||||
*
|
||||
* Assign the specified mask to the specified event.
|
||||
* IExtensionInit - initialize the input extension.
|
||||
*
|
||||
* Called from InitExtensions in main() or from QueryExtension() if the
|
||||
* extension is dynamically loaded.
|
||||
*
|
||||
* This extension has several events and errors.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
SetMaskForExtEvent(Mask mask, int event)
|
||||
XInputExtensionInit(void)
|
||||
{
|
||||
ExtensionEntry *extEntry;
|
||||
|
||||
EventInfo[ExtEventIndex].mask = mask;
|
||||
EventInfo[ExtEventIndex++].type = event;
|
||||
|
||||
if ((event < LASTEvent) || (event >= 128))
|
||||
FatalError("MaskForExtensionEvent: bogus event number");
|
||||
SetMaskForEvent(mask, event);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Record an event mask where there is no unique corresponding event type.
|
||||
* We can't call SetMaskForEvent, since that would clobber the existing
|
||||
* mask for that event. MotionHint and ButtonMotion are examples.
|
||||
*
|
||||
* Since extension event types will never be less than 64, we can use
|
||||
* 0-63 in the EventInfo array as the "type" to be used to look up this
|
||||
* mask. This means that the corresponding macros such as
|
||||
* DevicePointerMotionHint must have access to the same constants.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
SetEventInfo(Mask mask, int constant)
|
||||
{
|
||||
EventInfo[ExtEventIndex].mask = mask;
|
||||
EventInfo[ExtEventIndex++].type = constant;
|
||||
extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch,
|
||||
SProcIDispatch, IResetProc, StandardMinorOpcode);
|
||||
if (extEntry) {
|
||||
IReqCode = extEntry->base;
|
||||
AllExtensionVersions[IReqCode - 128] = thisversion;
|
||||
MakeDeviceTypeAtoms();
|
||||
RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone);
|
||||
FixExtensionEvents(extEntry);
|
||||
ReplySwapVector[IReqCode] = (ReplySwapPtr) SReplyIDispatch;
|
||||
EventSwapVector[DeviceValuator] = SEventIDispatch;
|
||||
EventSwapVector[DeviceKeyPress] = SEventIDispatch;
|
||||
EventSwapVector[DeviceKeyRelease] = SEventIDispatch;
|
||||
EventSwapVector[DeviceButtonPress] = SEventIDispatch;
|
||||
EventSwapVector[DeviceButtonRelease] = SEventIDispatch;
|
||||
EventSwapVector[DeviceMotionNotify] = SEventIDispatch;
|
||||
EventSwapVector[DeviceFocusIn] = SEventIDispatch;
|
||||
EventSwapVector[DeviceFocusOut] = SEventIDispatch;
|
||||
EventSwapVector[ProximityIn] = SEventIDispatch;
|
||||
EventSwapVector[ProximityOut] = SEventIDispatch;
|
||||
EventSwapVector[DeviceStateNotify] = SEventIDispatch;
|
||||
EventSwapVector[DeviceKeyStateNotify] = SEventIDispatch;
|
||||
EventSwapVector[DeviceButtonStateNotify] = SEventIDispatch;
|
||||
EventSwapVector[DeviceMappingNotify] = SEventIDispatch;
|
||||
EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
|
||||
EventSwapVector[DeviceEnterNotify] = SEventIDispatch;
|
||||
EventSwapVector[DeviceLeaveNotify] = SEventIDispatch;
|
||||
EventSwapVector[PointerKeyboardPairingChangedNotify] = SEventIDispatch;
|
||||
} else {
|
||||
FatalError("IExtensionInit: AddExtensions failed\n");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,9 +74,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXGetDeviceButtonMapping(register ClientPtr client)
|
||||
SProcXGetDeviceButtonMapping(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xGetDeviceButtonMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -90,7 +90,7 @@ SProcXGetDeviceButtonMapping(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXGetDeviceButtonMapping(register ClientPtr client)
|
||||
ProcXGetDeviceButtonMapping(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
xGetDeviceButtonMappingReply rep;
|
||||
|
@ -136,7 +136,7 @@ void
|
|||
SRepXGetDeviceButtonMapping(ClientPtr client, int size,
|
||||
xGetDeviceButtonMappingReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
299
Xi/getdctl.c
299
Xi/getdctl.c
|
@ -75,9 +75,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXGetDeviceControl(register ClientPtr client)
|
||||
SProcXGetDeviceControl(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xGetDeviceControlReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -86,6 +86,152 @@ SProcXGetDeviceControl(register ClientPtr client)
|
|||
return (ProcXGetDeviceControl(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies DeviceResolution data, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
|
||||
int length)
|
||||
{
|
||||
char n;
|
||||
AxisInfoPtr a;
|
||||
xDeviceResolutionState *r;
|
||||
int i, *iptr;
|
||||
|
||||
r = (xDeviceResolutionState *) buf;
|
||||
r->control = DEVICE_RESOLUTION;
|
||||
r->length = length;
|
||||
r->num_valuators = v->numAxes;
|
||||
buf += sizeof(xDeviceResolutionState);
|
||||
iptr = (int *)buf;
|
||||
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
|
||||
*iptr++ = a->resolution;
|
||||
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
|
||||
*iptr++ = a->min_resolution;
|
||||
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
|
||||
*iptr++ = a->max_resolution;
|
||||
if (client->swapped) {
|
||||
swaps(&r->control, n);
|
||||
swaps(&r->length, n);
|
||||
swapl(&r->num_valuators, n);
|
||||
iptr = (int *)buf;
|
||||
for (i = 0; i < (3 * v->numAxes); i++, iptr++) {
|
||||
swapl(iptr, n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void CopySwapDeviceAbsCalib (ClientPtr client, AbsoluteClassPtr dts,
|
||||
char *buf)
|
||||
{
|
||||
char n;
|
||||
xDeviceAbsCalibState *calib = (xDeviceAbsCalibState *) buf;
|
||||
|
||||
calib->control = DEVICE_ABS_CALIB;
|
||||
calib->length = sizeof(calib);
|
||||
calib->min_x = dts->min_x;
|
||||
calib->max_x = dts->max_x;
|
||||
calib->min_y = dts->min_y;
|
||||
calib->max_y = dts->max_y;
|
||||
calib->flip_x = dts->flip_x;
|
||||
calib->flip_y = dts->flip_y;
|
||||
calib->rotation = dts->rotation;
|
||||
calib->button_threshold = dts->button_threshold;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&calib->control, n);
|
||||
swaps(&calib->length, n);
|
||||
swapl(&calib->min_x, n);
|
||||
swapl(&calib->max_x, n);
|
||||
swapl(&calib->min_y, n);
|
||||
swapl(&calib->max_y, n);
|
||||
swapl(&calib->flip_x, n);
|
||||
swapl(&calib->flip_y, n);
|
||||
swapl(&calib->rotation, n);
|
||||
swapl(&calib->button_threshold, n);
|
||||
}
|
||||
}
|
||||
|
||||
static void CopySwapDeviceAbsArea (ClientPtr client, AbsoluteClassPtr dts,
|
||||
char *buf)
|
||||
{
|
||||
char n;
|
||||
xDeviceAbsAreaState *area = (xDeviceAbsAreaState *) buf;
|
||||
|
||||
area->control = DEVICE_ABS_AREA;
|
||||
area->length = sizeof(area);
|
||||
area->offset_x = dts->offset_x;
|
||||
area->offset_y = dts->offset_y;
|
||||
area->width = dts->width;
|
||||
area->height = dts->height;
|
||||
area->screen = dts->screen;
|
||||
area->following = dts->following;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&area->control, n);
|
||||
swaps(&area->length, n);
|
||||
swapl(&area->offset_x, n);
|
||||
swapl(&area->offset_y, n);
|
||||
swapl(&area->width, n);
|
||||
swapl(&area->height, n);
|
||||
swapl(&area->screen, n);
|
||||
swapl(&area->following, n);
|
||||
}
|
||||
}
|
||||
|
||||
static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
|
||||
{
|
||||
char n;
|
||||
xDeviceCoreState *c = (xDeviceCoreState *) buf;
|
||||
|
||||
c->control = DEVICE_CORE;
|
||||
c->length = sizeof(c);
|
||||
c->status = dev->coreEvents;
|
||||
c->iscore = (dev == inputInfo.keyboard || dev == inputInfo.pointer);
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&c->control, n);
|
||||
swaps(&c->length, n);
|
||||
swaps(&c->status, n);
|
||||
}
|
||||
}
|
||||
|
||||
static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
|
||||
{
|
||||
char n;
|
||||
xDeviceEnableState *e = (xDeviceEnableState *) buf;
|
||||
|
||||
e->control = DEVICE_ENABLE;
|
||||
e->length = sizeof(e);
|
||||
e->enable = dev->enabled;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&e->control, n);
|
||||
swaps(&e->length, n);
|
||||
swaps(&e->enable, n);
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure writes the reply for the xGetDeviceControl function,
|
||||
* if the client and server have a different byte ordering.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Get the state of the specified device control.
|
||||
|
@ -97,7 +243,7 @@ ProcXGetDeviceControl(ClientPtr client)
|
|||
{
|
||||
int total_length = 0;
|
||||
char *buf, *savbuf;
|
||||
register DeviceIntPtr dev;
|
||||
DeviceIntPtr dev;
|
||||
xGetDeviceControlReply rep;
|
||||
|
||||
REQUEST(xGetDeviceControlReq);
|
||||
|
@ -186,150 +332,3 @@ ProcXGetDeviceControl(ClientPtr client)
|
|||
xfree(savbuf);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies DeviceResolution data, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
|
||||
int length)
|
||||
{
|
||||
register char n;
|
||||
AxisInfoPtr a;
|
||||
xDeviceResolutionState *r;
|
||||
int i, *iptr;
|
||||
|
||||
r = (xDeviceResolutionState *) buf;
|
||||
r->control = DEVICE_RESOLUTION;
|
||||
r->length = length;
|
||||
r->num_valuators = v->numAxes;
|
||||
buf += sizeof(xDeviceResolutionState);
|
||||
iptr = (int *)buf;
|
||||
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
|
||||
*iptr++ = a->resolution;
|
||||
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
|
||||
*iptr++ = a->min_resolution;
|
||||
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
|
||||
*iptr++ = a->max_resolution;
|
||||
if (client->swapped) {
|
||||
swaps(&r->control, n);
|
||||
swaps(&r->length, n);
|
||||
swapl(&r->num_valuators, n);
|
||||
iptr = (int *)buf;
|
||||
for (i = 0; i < (3 * v->numAxes); i++, iptr++) {
|
||||
swapl(iptr, n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CopySwapDeviceAbsCalib (ClientPtr client, AbsoluteClassPtr dts,
|
||||
char *buf)
|
||||
{
|
||||
register char n;
|
||||
xDeviceAbsCalibState *calib = (xDeviceAbsCalibState *) buf;
|
||||
|
||||
calib->control = DEVICE_ABS_CALIB;
|
||||
calib->length = sizeof(calib);
|
||||
calib->min_x = dts->min_x;
|
||||
calib->max_x = dts->max_x;
|
||||
calib->min_y = dts->min_y;
|
||||
calib->max_y = dts->max_y;
|
||||
calib->flip_x = dts->flip_x;
|
||||
calib->flip_y = dts->flip_y;
|
||||
calib->rotation = dts->rotation;
|
||||
calib->button_threshold = dts->button_threshold;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&calib->control, n);
|
||||
swaps(&calib->length, n);
|
||||
swapl(&calib->min_x, n);
|
||||
swapl(&calib->max_x, n);
|
||||
swapl(&calib->min_y, n);
|
||||
swapl(&calib->max_y, n);
|
||||
swapl(&calib->flip_x, n);
|
||||
swapl(&calib->flip_y, n);
|
||||
swapl(&calib->rotation, n);
|
||||
swapl(&calib->button_threshold, n);
|
||||
}
|
||||
}
|
||||
|
||||
void CopySwapDeviceAbsArea (ClientPtr client, AbsoluteClassPtr dts,
|
||||
char *buf)
|
||||
{
|
||||
register char n;
|
||||
xDeviceAbsAreaState *area = (xDeviceAbsAreaState *) buf;
|
||||
|
||||
area->control = DEVICE_ABS_AREA;
|
||||
area->length = sizeof(area);
|
||||
area->offset_x = dts->offset_x;
|
||||
area->offset_y = dts->offset_y;
|
||||
area->width = dts->width;
|
||||
area->height = dts->height;
|
||||
area->screen = dts->screen;
|
||||
area->following = dts->following;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&area->control, n);
|
||||
swaps(&area->length, n);
|
||||
swapl(&area->offset_x, n);
|
||||
swapl(&area->offset_y, n);
|
||||
swapl(&area->width, n);
|
||||
swapl(&area->height, n);
|
||||
swapl(&area->screen, n);
|
||||
swapl(&area->following, n);
|
||||
}
|
||||
}
|
||||
|
||||
void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
|
||||
{
|
||||
register char n;
|
||||
xDeviceCoreState *c = (xDeviceCoreState *) buf;
|
||||
|
||||
c->control = DEVICE_CORE;
|
||||
c->length = sizeof(c);
|
||||
c->status = dev->coreEvents;
|
||||
c->iscore = (dev == inputInfo.keyboard || dev == inputInfo.pointer);
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&c->control, n);
|
||||
swaps(&c->length, n);
|
||||
swaps(&c->status, n);
|
||||
}
|
||||
}
|
||||
|
||||
void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
|
||||
{
|
||||
register char n;
|
||||
xDeviceEnableState *e = (xDeviceEnableState *) buf;
|
||||
|
||||
e->control = DEVICE_ENABLE;
|
||||
e->length = sizeof(e);
|
||||
e->enable = dev->enabled;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&e->control, n);
|
||||
swaps(&e->length, n);
|
||||
swaps(&e->enable, n);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure writes the reply for the xGetDeviceControl function,
|
||||
* if the client and server have a different byte ordering.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
24
Xi/getdctl.h
24
Xi/getdctl.h
|
@ -36,30 +36,6 @@ int SProcXGetDeviceControl(ClientPtr /* client */
|
|||
int ProcXGetDeviceControl(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void CopySwapDeviceResolution(ClientPtr /* client */ ,
|
||||
ValuatorClassPtr /* v */ ,
|
||||
char * /* buf */ ,
|
||||
int /* length */
|
||||
);
|
||||
|
||||
void CopySwapDeviceAbsCalib (ClientPtr client,
|
||||
AbsoluteClassPtr dts,
|
||||
char *buf);
|
||||
|
||||
void CopySwapDeviceAbsArea (ClientPtr client,
|
||||
AbsoluteClassPtr dts,
|
||||
char *buf);
|
||||
|
||||
void CopySwapDeviceCore(ClientPtr /* client */ ,
|
||||
DeviceIntPtr /* dev */ ,
|
||||
char * /* buf */
|
||||
);
|
||||
|
||||
void CopySwapDeviceEnable(ClientPtr /* client */ ,
|
||||
DeviceIntPtr /* dev */ ,
|
||||
char * /* buf */
|
||||
);
|
||||
|
||||
void SRepXGetDeviceControl(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xGetDeviceControlReply * /* rep */
|
||||
|
|
406
Xi/getfctl.c
406
Xi/getfctl.c
|
@ -75,15 +75,215 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXGetFeedbackControl(register ClientPtr client)
|
||||
SProcXGetFeedbackControl(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xGetFeedbackControlReq);
|
||||
swaps(&stuff->length, n);
|
||||
return (ProcXGetFeedbackControl(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies KbdFeedbackClass data, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
|
||||
{
|
||||
int i;
|
||||
char n;
|
||||
xKbdFeedbackState *k2;
|
||||
|
||||
k2 = (xKbdFeedbackState *) * buf;
|
||||
k2->class = KbdFeedbackClass;
|
||||
k2->length = sizeof(xKbdFeedbackState);
|
||||
k2->id = k->ctrl.id;
|
||||
k2->click = k->ctrl.click;
|
||||
k2->percent = k->ctrl.bell;
|
||||
k2->pitch = k->ctrl.bell_pitch;
|
||||
k2->duration = k->ctrl.bell_duration;
|
||||
k2->led_mask = k->ctrl.leds;
|
||||
k2->global_auto_repeat = k->ctrl.autoRepeat;
|
||||
for (i = 0; i < 32; i++)
|
||||
k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
|
||||
if (client->swapped) {
|
||||
swaps(&k2->length, n);
|
||||
swaps(&k2->pitch, n);
|
||||
swaps(&k2->duration, n);
|
||||
swapl(&k2->led_mask, n);
|
||||
swapl(&k2->led_values, n);
|
||||
}
|
||||
*buf += sizeof(xKbdFeedbackState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies PtrFeedbackClass data, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
|
||||
{
|
||||
char n;
|
||||
xPtrFeedbackState *p2;
|
||||
|
||||
p2 = (xPtrFeedbackState *) * buf;
|
||||
p2->class = PtrFeedbackClass;
|
||||
p2->length = sizeof(xPtrFeedbackState);
|
||||
p2->id = p->ctrl.id;
|
||||
p2->accelNum = p->ctrl.num;
|
||||
p2->accelDenom = p->ctrl.den;
|
||||
p2->threshold = p->ctrl.threshold;
|
||||
if (client->swapped) {
|
||||
swaps(&p2->length, n);
|
||||
swaps(&p2->accelNum, n);
|
||||
swaps(&p2->accelDenom, n);
|
||||
swaps(&p2->threshold, n);
|
||||
}
|
||||
*buf += sizeof(xPtrFeedbackState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies IntegerFeedbackClass data, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
|
||||
{
|
||||
char n;
|
||||
xIntegerFeedbackState *i2;
|
||||
|
||||
i2 = (xIntegerFeedbackState *) * buf;
|
||||
i2->class = IntegerFeedbackClass;
|
||||
i2->length = sizeof(xIntegerFeedbackState);
|
||||
i2->id = i->ctrl.id;
|
||||
i2->resolution = i->ctrl.resolution;
|
||||
i2->min_value = i->ctrl.min_value;
|
||||
i2->max_value = i->ctrl.max_value;
|
||||
if (client->swapped) {
|
||||
swaps(&i2->length, n);
|
||||
swapl(&i2->resolution, n);
|
||||
swapl(&i2->min_value, n);
|
||||
swapl(&i2->max_value, n);
|
||||
}
|
||||
*buf += sizeof(xIntegerFeedbackState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies StringFeedbackClass data, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
|
||||
{
|
||||
int i;
|
||||
char n;
|
||||
xStringFeedbackState *s2;
|
||||
KeySym *kptr;
|
||||
|
||||
s2 = (xStringFeedbackState *) * buf;
|
||||
s2->class = StringFeedbackClass;
|
||||
s2->length = sizeof(xStringFeedbackState) +
|
||||
s->ctrl.num_symbols_supported * sizeof(KeySym);
|
||||
s2->id = s->ctrl.id;
|
||||
s2->max_symbols = s->ctrl.max_symbols;
|
||||
s2->num_syms_supported = s->ctrl.num_symbols_supported;
|
||||
*buf += sizeof(xStringFeedbackState);
|
||||
kptr = (KeySym *) (*buf);
|
||||
for (i = 0; i < s->ctrl.num_symbols_supported; i++)
|
||||
*kptr++ = *(s->ctrl.symbols_supported + i);
|
||||
if (client->swapped) {
|
||||
swaps(&s2->length, n);
|
||||
swaps(&s2->max_symbols, n);
|
||||
swaps(&s2->num_syms_supported, n);
|
||||
kptr = (KeySym *) (*buf);
|
||||
for (i = 0; i < s->ctrl.num_symbols_supported; i++, kptr++) {
|
||||
swapl(kptr, n);
|
||||
}
|
||||
}
|
||||
*buf += (s->ctrl.num_symbols_supported * sizeof(KeySym));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies LedFeedbackClass data, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
|
||||
{
|
||||
char n;
|
||||
xLedFeedbackState *l2;
|
||||
|
||||
l2 = (xLedFeedbackState *) * buf;
|
||||
l2->class = LedFeedbackClass;
|
||||
l2->length = sizeof(xLedFeedbackState);
|
||||
l2->id = l->ctrl.id;
|
||||
l2->led_values = l->ctrl.led_values;
|
||||
l2->led_mask = l->ctrl.led_mask;
|
||||
if (client->swapped) {
|
||||
swaps(&l2->length, n);
|
||||
swapl(&l2->led_values, n);
|
||||
swapl(&l2->led_mask, n);
|
||||
}
|
||||
*buf += sizeof(xLedFeedbackState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies BellFeedbackClass data, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
|
||||
{
|
||||
char n;
|
||||
xBellFeedbackState *b2;
|
||||
|
||||
b2 = (xBellFeedbackState *) * buf;
|
||||
b2->class = BellFeedbackClass;
|
||||
b2->length = sizeof(xBellFeedbackState);
|
||||
b2->id = b->ctrl.id;
|
||||
b2->percent = b->ctrl.percent;
|
||||
b2->pitch = b->ctrl.pitch;
|
||||
b2->duration = b->ctrl.duration;
|
||||
if (client->swapped) {
|
||||
swaps(&b2->length, n);
|
||||
swaps(&b2->pitch, n);
|
||||
swaps(&b2->duration, n);
|
||||
}
|
||||
*buf += sizeof(xBellFeedbackState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure writes the reply for the xGetFeedbackControl function,
|
||||
* if the client and server have a different byte ordering.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
SRepXGetFeedbackControl(ClientPtr client, int size,
|
||||
xGetFeedbackControlReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->num_feedbacks, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Get the feedback control state.
|
||||
|
@ -95,7 +295,7 @@ ProcXGetFeedbackControl(ClientPtr client)
|
|||
{
|
||||
int total_length = 0;
|
||||
char *buf, *savbuf;
|
||||
register DeviceIntPtr dev;
|
||||
DeviceIntPtr dev;
|
||||
KbdFeedbackPtr k;
|
||||
PtrFeedbackPtr p;
|
||||
IntegerFeedbackPtr i;
|
||||
|
@ -176,203 +376,3 @@ ProcXGetFeedbackControl(ClientPtr client)
|
|||
xfree(savbuf);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies KbdFeedbackClass data, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
|
||||
{
|
||||
int i;
|
||||
register char n;
|
||||
xKbdFeedbackState *k2;
|
||||
|
||||
k2 = (xKbdFeedbackState *) * buf;
|
||||
k2->class = KbdFeedbackClass;
|
||||
k2->length = sizeof(xKbdFeedbackState);
|
||||
k2->id = k->ctrl.id;
|
||||
k2->click = k->ctrl.click;
|
||||
k2->percent = k->ctrl.bell;
|
||||
k2->pitch = k->ctrl.bell_pitch;
|
||||
k2->duration = k->ctrl.bell_duration;
|
||||
k2->led_mask = k->ctrl.leds;
|
||||
k2->global_auto_repeat = k->ctrl.autoRepeat;
|
||||
for (i = 0; i < 32; i++)
|
||||
k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
|
||||
if (client->swapped) {
|
||||
swaps(&k2->length, n);
|
||||
swaps(&k2->pitch, n);
|
||||
swaps(&k2->duration, n);
|
||||
swapl(&k2->led_mask, n);
|
||||
swapl(&k2->led_values, n);
|
||||
}
|
||||
*buf += sizeof(xKbdFeedbackState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies PtrFeedbackClass data, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
|
||||
{
|
||||
register char n;
|
||||
xPtrFeedbackState *p2;
|
||||
|
||||
p2 = (xPtrFeedbackState *) * buf;
|
||||
p2->class = PtrFeedbackClass;
|
||||
p2->length = sizeof(xPtrFeedbackState);
|
||||
p2->id = p->ctrl.id;
|
||||
p2->accelNum = p->ctrl.num;
|
||||
p2->accelDenom = p->ctrl.den;
|
||||
p2->threshold = p->ctrl.threshold;
|
||||
if (client->swapped) {
|
||||
swaps(&p2->length, n);
|
||||
swaps(&p2->accelNum, n);
|
||||
swaps(&p2->accelDenom, n);
|
||||
swaps(&p2->threshold, n);
|
||||
}
|
||||
*buf += sizeof(xPtrFeedbackState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies IntegerFeedbackClass data, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
|
||||
{
|
||||
register char n;
|
||||
xIntegerFeedbackState *i2;
|
||||
|
||||
i2 = (xIntegerFeedbackState *) * buf;
|
||||
i2->class = IntegerFeedbackClass;
|
||||
i2->length = sizeof(xIntegerFeedbackState);
|
||||
i2->id = i->ctrl.id;
|
||||
i2->resolution = i->ctrl.resolution;
|
||||
i2->min_value = i->ctrl.min_value;
|
||||
i2->max_value = i->ctrl.max_value;
|
||||
if (client->swapped) {
|
||||
swaps(&i2->length, n);
|
||||
swapl(&i2->resolution, n);
|
||||
swapl(&i2->min_value, n);
|
||||
swapl(&i2->max_value, n);
|
||||
}
|
||||
*buf += sizeof(xIntegerFeedbackState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies StringFeedbackClass data, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
|
||||
{
|
||||
int i;
|
||||
register char n;
|
||||
xStringFeedbackState *s2;
|
||||
KeySym *kptr;
|
||||
|
||||
s2 = (xStringFeedbackState *) * buf;
|
||||
s2->class = StringFeedbackClass;
|
||||
s2->length = sizeof(xStringFeedbackState) +
|
||||
s->ctrl.num_symbols_supported * sizeof(KeySym);
|
||||
s2->id = s->ctrl.id;
|
||||
s2->max_symbols = s->ctrl.max_symbols;
|
||||
s2->num_syms_supported = s->ctrl.num_symbols_supported;
|
||||
*buf += sizeof(xStringFeedbackState);
|
||||
kptr = (KeySym *) (*buf);
|
||||
for (i = 0; i < s->ctrl.num_symbols_supported; i++)
|
||||
*kptr++ = *(s->ctrl.symbols_supported + i);
|
||||
if (client->swapped) {
|
||||
swaps(&s2->length, n);
|
||||
swaps(&s2->max_symbols, n);
|
||||
swaps(&s2->num_syms_supported, n);
|
||||
kptr = (KeySym *) (*buf);
|
||||
for (i = 0; i < s->ctrl.num_symbols_supported; i++, kptr++) {
|
||||
swapl(kptr, n);
|
||||
}
|
||||
}
|
||||
*buf += (s->ctrl.num_symbols_supported * sizeof(KeySym));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies LedFeedbackClass data, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
|
||||
{
|
||||
register char n;
|
||||
xLedFeedbackState *l2;
|
||||
|
||||
l2 = (xLedFeedbackState *) * buf;
|
||||
l2->class = LedFeedbackClass;
|
||||
l2->length = sizeof(xLedFeedbackState);
|
||||
l2->id = l->ctrl.id;
|
||||
l2->led_values = l->ctrl.led_values;
|
||||
l2->led_mask = l->ctrl.led_mask;
|
||||
if (client->swapped) {
|
||||
swaps(&l2->length, n);
|
||||
swapl(&l2->led_values, n);
|
||||
swapl(&l2->led_mask, n);
|
||||
}
|
||||
*buf += sizeof(xLedFeedbackState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies BellFeedbackClass data, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
|
||||
{
|
||||
register char n;
|
||||
xBellFeedbackState *b2;
|
||||
|
||||
b2 = (xBellFeedbackState *) * buf;
|
||||
b2->class = BellFeedbackClass;
|
||||
b2->length = sizeof(xBellFeedbackState);
|
||||
b2->id = b->ctrl.id;
|
||||
b2->percent = b->ctrl.percent;
|
||||
b2->pitch = b->ctrl.pitch;
|
||||
b2->duration = b->ctrl.duration;
|
||||
if (client->swapped) {
|
||||
swaps(&b2->length, n);
|
||||
swaps(&b2->pitch, n);
|
||||
swaps(&b2->duration, n);
|
||||
}
|
||||
*buf += sizeof(xBellFeedbackState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure writes the reply for the xGetFeedbackControl function,
|
||||
* if the client and server have a different byte ordering.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
SRepXGetFeedbackControl(ClientPtr client, int size,
|
||||
xGetFeedbackControlReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
swaps(&rep->num_feedbacks, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
|
30
Xi/getfctl.h
30
Xi/getfctl.h
|
@ -36,36 +36,6 @@ int SProcXGetFeedbackControl(ClientPtr /* client */
|
|||
int ProcXGetFeedbackControl(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void CopySwapKbdFeedback(ClientPtr /* client */ ,
|
||||
KbdFeedbackPtr /* k */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void CopySwapPtrFeedback(ClientPtr /* client */ ,
|
||||
PtrFeedbackPtr /* p */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void CopySwapIntegerFeedback(ClientPtr /* client */ ,
|
||||
IntegerFeedbackPtr /* i */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void CopySwapStringFeedback(ClientPtr /* client */ ,
|
||||
StringFeedbackPtr /* s */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void CopySwapLedFeedback(ClientPtr /* client */ ,
|
||||
LedFeedbackPtr /* l */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void CopySwapBellFeedback(ClientPtr /* client */ ,
|
||||
BellFeedbackPtr /* b */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void SRepXGetFeedbackControl(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xGetFeedbackControlReply * /* rep */
|
||||
|
|
|
@ -75,9 +75,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXGetDeviceFocus(register ClientPtr client)
|
||||
SProcXGetDeviceFocus(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xGetDeviceFocusReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -138,7 +138,7 @@ ProcXGetDeviceFocus(ClientPtr client)
|
|||
void
|
||||
SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
|
@ -76,9 +76,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXGetDeviceKeyMapping(register ClientPtr client)
|
||||
SProcXGetDeviceKeyMapping(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xGetDeviceKeyMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -92,7 +92,7 @@ SProcXGetDeviceKeyMapping(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXGetDeviceKeyMapping(register ClientPtr client)
|
||||
ProcXGetDeviceKeyMapping(ClientPtr client)
|
||||
{
|
||||
xGetDeviceKeyMappingReply rep;
|
||||
DeviceIntPtr dev;
|
||||
|
@ -154,7 +154,7 @@ void
|
|||
SRepXGetDeviceKeyMapping(ClientPtr client, int size,
|
||||
xGetDeviceKeyMappingReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
|
@ -75,9 +75,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXGetDeviceModifierMapping(register ClientPtr client)
|
||||
SProcXGetDeviceModifierMapping(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xGetDeviceModifierMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -141,7 +141,7 @@ void
|
|||
SRepXGetDeviceModifierMapping(ClientPtr client, int size,
|
||||
xGetDeviceModifierMappingReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
|
@ -79,9 +79,9 @@ extern int ExtEventIndex;
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXGetDeviceDontPropagateList(register ClientPtr client)
|
||||
SProcXGetDeviceDontPropagateList(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xGetDeviceDontPropagateListReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -97,7 +97,7 @@ SProcXGetDeviceDontPropagateList(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXGetDeviceDontPropagateList(register ClientPtr client)
|
||||
ProcXGetDeviceDontPropagateList(ClientPtr client)
|
||||
{
|
||||
CARD16 count = 0;
|
||||
int i, rc;
|
||||
|
@ -187,7 +187,7 @@ void
|
|||
SRepXGetDeviceDontPropagateList(ClientPtr client, int size,
|
||||
xGetDeviceDontPropagateListReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
|
@ -77,9 +77,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXGetSelectedExtensionEvents(register ClientPtr client)
|
||||
SProcXGetSelectedExtensionEvents(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xGetSelectedExtensionEventsReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -96,7 +96,7 @@ SProcXGetSelectedExtensionEvents(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXGetSelectedExtensionEvents(register ClientPtr client)
|
||||
ProcXGetSelectedExtensionEvents(ClientPtr client)
|
||||
{
|
||||
int i, rc, total_length = 0;
|
||||
xGetSelectedExtensionEventsReply rep;
|
||||
|
@ -177,7 +177,7 @@ void
|
|||
SRepXGetSelectedExtensionEvents(ClientPtr client, int size,
|
||||
xGetSelectedExtensionEventsReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
|
@ -76,9 +76,9 @@ XExtensionVersion AllExtensionVersions[128];
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXGetExtensionVersion(register ClientPtr client)
|
||||
SProcXGetExtensionVersion(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xGetExtensionVersionReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -94,7 +94,7 @@ SProcXGetExtensionVersion(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXGetExtensionVersion(register ClientPtr client)
|
||||
ProcXGetExtensionVersion(ClientPtr client)
|
||||
{
|
||||
xGetExtensionVersionReply rep;
|
||||
|
||||
|
@ -136,7 +136,7 @@ void
|
|||
SRepXGetExtensionVersion(ClientPtr client, int size,
|
||||
xGetExtensionVersionReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
|
@ -93,7 +93,7 @@ void
|
|||
SRepXGrabAccessControl(ClientPtr client, int size,
|
||||
xGrabAccessControlReply* rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
10
Xi/grabdev.c
10
Xi/grabdev.c
|
@ -79,11 +79,11 @@ extern int ExtEventIndex;
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXGrabDevice(register ClientPtr client)
|
||||
SProcXGrabDevice(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
register long *p;
|
||||
register int i;
|
||||
char n;
|
||||
long *p;
|
||||
int i;
|
||||
|
||||
REQUEST(xGrabDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -202,7 +202,7 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
|
|||
void
|
||||
SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
|
@ -77,11 +77,11 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXGrabDeviceButton(register ClientPtr client)
|
||||
SProcXGrabDeviceButton(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
register long *p;
|
||||
register int i;
|
||||
char n;
|
||||
long *p;
|
||||
int i;
|
||||
|
||||
REQUEST(xGrabDeviceButtonReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
|
|
@ -77,11 +77,11 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXGrabDeviceKey(register ClientPtr client)
|
||||
SProcXGrabDeviceKey(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
register long *p;
|
||||
register int i;
|
||||
char n;
|
||||
long *p;
|
||||
int i;
|
||||
|
||||
REQUEST(xGrabDeviceKeyReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
|
|
@ -75,9 +75,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXGetDeviceMotionEvents(register ClientPtr client)
|
||||
SProcXGetDeviceMotionEvents(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xGetDeviceMotionEventsReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -162,7 +162,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
|||
WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
|
||||
if (nEvents) {
|
||||
if (client->swapped) {
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
bufptr = coords;
|
||||
for (i = 0; i < nEvents * (axes + 1); i++) {
|
||||
|
@ -188,7 +188,7 @@ void
|
|||
SRepXGetDeviceMotionEvents(ClientPtr client, int size,
|
||||
xGetDeviceMotionEventsReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
432
Xi/listdev.c
432
Xi/listdev.c
|
@ -77,15 +77,227 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXListInputDevices(register ClientPtr client)
|
||||
SProcXListInputDevices(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xListInputDevicesReq);
|
||||
swaps(&stuff->length, n);
|
||||
return (ProcXListInputDevices(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure calculates the size of the information to be returned
|
||||
* for an input device.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
SizeDeviceInfo(DeviceIntPtr d, int *namesize, int *size)
|
||||
{
|
||||
int chunks;
|
||||
|
||||
*namesize += 1;
|
||||
if (d->name)
|
||||
*namesize += strlen(d->name);
|
||||
if (d->key != NULL)
|
||||
*size += sizeof(xKeyInfo);
|
||||
if (d->button != NULL)
|
||||
*size += sizeof(xButtonInfo);
|
||||
if (d->valuator != NULL) {
|
||||
chunks = ((int)d->valuator->numAxes + 19) / VPC;
|
||||
*size += (chunks * sizeof(xValuatorInfo) +
|
||||
d->valuator->numAxes * sizeof(xAxisInfo));
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies data to the DeviceInfo struct, swapping if necessary.
|
||||
*
|
||||
* We need the extra byte in the allocated buffer, because the trailing null
|
||||
* hammers one extra byte, which is overwritten by the next name except for
|
||||
* the last name copied.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
CopyDeviceName(char **namebuf, char *name)
|
||||
{
|
||||
char *nameptr = (char *)*namebuf;
|
||||
|
||||
if (name) {
|
||||
*nameptr++ = strlen(name);
|
||||
strcpy(nameptr, name);
|
||||
*namebuf += (strlen(name) + 1);
|
||||
} else {
|
||||
*nameptr++ = 0;
|
||||
*namebuf += 1;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies ButtonClass information, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf)
|
||||
{
|
||||
char n;
|
||||
xButtonInfoPtr b2;
|
||||
|
||||
b2 = (xButtonInfoPtr) * buf;
|
||||
b2->class = ButtonClass;
|
||||
b2->length = sizeof(xButtonInfo);
|
||||
b2->num_buttons = b->numButtons;
|
||||
if (client->swapped) {
|
||||
swaps(&b2->num_buttons, n); /* macro - braces are required */
|
||||
}
|
||||
*buf += sizeof(xButtonInfo);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies data to the DeviceInfo struct, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
|
||||
char **buf)
|
||||
{
|
||||
char n;
|
||||
xDeviceInfoPtr dev;
|
||||
|
||||
dev = (xDeviceInfoPtr) * buf;
|
||||
|
||||
dev->id = d->id;
|
||||
dev->type = d->type;
|
||||
dev->num_classes = num_classes;
|
||||
if (d == inputInfo.keyboard)
|
||||
dev->use = IsXKeyboard;
|
||||
else if (d == inputInfo.pointer)
|
||||
dev->use = IsXPointer;
|
||||
else if (d->key && d->kbdfeed)
|
||||
dev->use = IsXExtensionKeyboard;
|
||||
else if (d->valuator && d->button)
|
||||
dev->use = IsXExtensionPointer;
|
||||
else
|
||||
dev->use = IsXExtensionDevice;
|
||||
if (client->swapped) {
|
||||
swapl(&dev->type, n); /* macro - braces are required */
|
||||
}
|
||||
*buf += sizeof(xDeviceInfo);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies KeyClass information, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf)
|
||||
{
|
||||
char n;
|
||||
xKeyInfoPtr k2;
|
||||
|
||||
k2 = (xKeyInfoPtr) * buf;
|
||||
k2->class = KeyClass;
|
||||
k2->length = sizeof(xKeyInfo);
|
||||
k2->min_keycode = k->curKeySyms.minKeyCode;
|
||||
k2->max_keycode = k->curKeySyms.maxKeyCode;
|
||||
k2->num_keys = k2->max_keycode - k2->min_keycode + 1;
|
||||
if (client->swapped) {
|
||||
swaps(&k2->num_keys, n);
|
||||
}
|
||||
*buf += sizeof(xKeyInfo);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies ValuatorClass information, swapping if necessary.
|
||||
*
|
||||
* Devices may have up to 255 valuators. The length of a ValuatorClass is
|
||||
* defined to be sizeof(ValuatorClassInfo) + num_axes * sizeof (xAxisInfo).
|
||||
* The maximum length is therefore (8 + 255 * 12) = 3068. However, the
|
||||
* length field is one byte. If a device has more than 20 valuators, we
|
||||
* must therefore return multiple valuator classes to the client.
|
||||
*
|
||||
*/
|
||||
|
||||
static int
|
||||
CopySwapValuatorClass(ClientPtr client, ValuatorClassPtr v, char **buf)
|
||||
{
|
||||
int i, j, axes, t_axes;
|
||||
char n;
|
||||
xValuatorInfoPtr v2;
|
||||
AxisInfo *a;
|
||||
xAxisInfoPtr a2;
|
||||
|
||||
for (i = 0, axes = v->numAxes; i < ((v->numAxes + 19) / VPC);
|
||||
i++, axes -= VPC) {
|
||||
t_axes = axes < VPC ? axes : VPC;
|
||||
if (t_axes < 0)
|
||||
t_axes = v->numAxes % VPC;
|
||||
v2 = (xValuatorInfoPtr) * buf;
|
||||
v2->class = ValuatorClass;
|
||||
v2->length = sizeof(xValuatorInfo) + t_axes * sizeof(xAxisInfo);
|
||||
v2->num_axes = t_axes;
|
||||
v2->mode = v->mode & DeviceMode;
|
||||
v2->motion_buffer_size = v->numMotionEvents;
|
||||
if (client->swapped) {
|
||||
swapl(&v2->motion_buffer_size, n);
|
||||
}
|
||||
*buf += sizeof(xValuatorInfo);
|
||||
a = v->axes + (VPC * i);
|
||||
a2 = (xAxisInfoPtr) * buf;
|
||||
for (j = 0; j < t_axes; j++) {
|
||||
a2->min_value = a->min_value;
|
||||
a2->max_value = a->max_value;
|
||||
a2->resolution = a->resolution;
|
||||
if (client->swapped) {
|
||||
swapl(&a2->min_value, n);
|
||||
swapl(&a2->max_value, n);
|
||||
swapl(&a2->resolution, n);
|
||||
}
|
||||
a2++;
|
||||
a++;
|
||||
*buf += sizeof(xAxisInfo);
|
||||
}
|
||||
}
|
||||
return (i);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure lists information to be returned for an input device.
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
ListDeviceInfo(ClientPtr client, DeviceIntPtr d, xDeviceInfoPtr dev,
|
||||
char **devbuf, char **classbuf, char **namebuf)
|
||||
{
|
||||
CopyDeviceName(namebuf, d->name);
|
||||
CopySwapDevice(client, d, 0, devbuf);
|
||||
if (d->key != NULL) {
|
||||
CopySwapKeyClass(client, d->key, classbuf);
|
||||
dev->num_classes++;
|
||||
}
|
||||
if (d->button != NULL) {
|
||||
CopySwapButtonClass(client, d->button, classbuf);
|
||||
dev->num_classes++;
|
||||
}
|
||||
if (d->valuator != NULL) {
|
||||
dev->num_classes +=
|
||||
CopySwapValuatorClass(client, d->valuator, classbuf);
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure lists the input devices available to the server.
|
||||
|
@ -93,7 +305,7 @@ SProcXListInputDevices(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXListInputDevices(register ClientPtr client)
|
||||
ProcXListInputDevices(ClientPtr client)
|
||||
{
|
||||
xListInputDevicesReply rep;
|
||||
int numdevs = 0;
|
||||
|
@ -154,218 +366,6 @@ ProcXListInputDevices(register ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure calculates the size of the information to be returned
|
||||
* for an input device.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
SizeDeviceInfo(DeviceIntPtr d, int *namesize, int *size)
|
||||
{
|
||||
int chunks;
|
||||
|
||||
*namesize += 1;
|
||||
if (d->name)
|
||||
*namesize += strlen(d->name);
|
||||
if (d->key != NULL)
|
||||
*size += sizeof(xKeyInfo);
|
||||
if (d->button != NULL)
|
||||
*size += sizeof(xButtonInfo);
|
||||
if (d->valuator != NULL) {
|
||||
chunks = ((int)d->valuator->numAxes + 19) / VPC;
|
||||
*size += (chunks * sizeof(xValuatorInfo) +
|
||||
d->valuator->numAxes * sizeof(xAxisInfo));
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure lists information to be returned for an input device.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
ListDeviceInfo(ClientPtr client, DeviceIntPtr d, xDeviceInfoPtr dev,
|
||||
char **devbuf, char **classbuf, char **namebuf)
|
||||
{
|
||||
CopyDeviceName(namebuf, d->name);
|
||||
CopySwapDevice(client, d, 0, devbuf);
|
||||
if (d->key != NULL) {
|
||||
CopySwapKeyClass(client, d->key, classbuf);
|
||||
dev->num_classes++;
|
||||
}
|
||||
if (d->button != NULL) {
|
||||
CopySwapButtonClass(client, d->button, classbuf);
|
||||
dev->num_classes++;
|
||||
}
|
||||
if (d->valuator != NULL) {
|
||||
dev->num_classes +=
|
||||
CopySwapValuatorClass(client, d->valuator, classbuf);
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies data to the DeviceInfo struct, swapping if necessary.
|
||||
*
|
||||
* We need the extra byte in the allocated buffer, because the trailing null
|
||||
* hammers one extra byte, which is overwritten by the next name except for
|
||||
* the last name copied.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
CopyDeviceName(char **namebuf, char *name)
|
||||
{
|
||||
char *nameptr = (char *)*namebuf;
|
||||
|
||||
if (name) {
|
||||
*nameptr++ = strlen(name);
|
||||
strcpy(nameptr, name);
|
||||
*namebuf += (strlen(name) + 1);
|
||||
} else {
|
||||
*nameptr++ = 0;
|
||||
*namebuf += 1;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies data to the DeviceInfo struct, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
CopySwapDevice(register ClientPtr client, DeviceIntPtr d, int num_classes,
|
||||
char **buf)
|
||||
{
|
||||
register char n;
|
||||
xDeviceInfoPtr dev;
|
||||
|
||||
dev = (xDeviceInfoPtr) * buf;
|
||||
|
||||
dev->id = d->id;
|
||||
dev->type = d->type;
|
||||
dev->num_classes = num_classes;
|
||||
if (d == inputInfo.keyboard)
|
||||
dev->use = IsXKeyboard;
|
||||
else if (d == inputInfo.pointer)
|
||||
dev->use = IsXPointer;
|
||||
else if (d->key && d->kbdfeed)
|
||||
dev->use = IsXExtensionKeyboard;
|
||||
else if (d->valuator && d->button)
|
||||
dev->use = IsXExtensionPointer;
|
||||
else
|
||||
dev->use = IsXExtensionDevice;
|
||||
if (client->swapped) {
|
||||
swapl(&dev->type, n); /* macro - braces are required */
|
||||
}
|
||||
*buf += sizeof(xDeviceInfo);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies KeyClass information, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
CopySwapKeyClass(register ClientPtr client, KeyClassPtr k, char **buf)
|
||||
{
|
||||
register char n;
|
||||
xKeyInfoPtr k2;
|
||||
|
||||
k2 = (xKeyInfoPtr) * buf;
|
||||
k2->class = KeyClass;
|
||||
k2->length = sizeof(xKeyInfo);
|
||||
k2->min_keycode = k->curKeySyms.minKeyCode;
|
||||
k2->max_keycode = k->curKeySyms.maxKeyCode;
|
||||
k2->num_keys = k2->max_keycode - k2->min_keycode + 1;
|
||||
if (client->swapped) {
|
||||
swaps(&k2->num_keys, n);
|
||||
}
|
||||
*buf += sizeof(xKeyInfo);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies ButtonClass information, swapping if necessary.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
CopySwapButtonClass(register ClientPtr client, ButtonClassPtr b, char **buf)
|
||||
{
|
||||
register char n;
|
||||
xButtonInfoPtr b2;
|
||||
|
||||
b2 = (xButtonInfoPtr) * buf;
|
||||
b2->class = ButtonClass;
|
||||
b2->length = sizeof(xButtonInfo);
|
||||
b2->num_buttons = b->numButtons;
|
||||
if (client->swapped) {
|
||||
swaps(&b2->num_buttons, n); /* macro - braces are required */
|
||||
}
|
||||
*buf += sizeof(xButtonInfo);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure copies ValuatorClass information, swapping if necessary.
|
||||
*
|
||||
* Devices may have up to 255 valuators. The length of a ValuatorClass is
|
||||
* defined to be sizeof(ValuatorClassInfo) + num_axes * sizeof (xAxisInfo).
|
||||
* The maximum length is therefore (8 + 255 * 12) = 3068. However, the
|
||||
* length field is one byte. If a device has more than 20 valuators, we
|
||||
* must therefore return multiple valuator classes to the client.
|
||||
*
|
||||
*/
|
||||
|
||||
int
|
||||
CopySwapValuatorClass(register ClientPtr client, ValuatorClassPtr v, char **buf)
|
||||
{
|
||||
int i, j, axes, t_axes;
|
||||
register char n;
|
||||
xValuatorInfoPtr v2;
|
||||
AxisInfo *a;
|
||||
xAxisInfoPtr a2;
|
||||
|
||||
for (i = 0, axes = v->numAxes; i < ((v->numAxes + 19) / VPC);
|
||||
i++, axes -= VPC) {
|
||||
t_axes = axes < VPC ? axes : VPC;
|
||||
if (t_axes < 0)
|
||||
t_axes = v->numAxes % VPC;
|
||||
v2 = (xValuatorInfoPtr) * buf;
|
||||
v2->class = ValuatorClass;
|
||||
v2->length = sizeof(xValuatorInfo) + t_axes * sizeof(xAxisInfo);
|
||||
v2->num_axes = t_axes;
|
||||
v2->mode = v->mode & DeviceMode;
|
||||
v2->motion_buffer_size = v->numMotionEvents;
|
||||
if (client->swapped) {
|
||||
swapl(&v2->motion_buffer_size, n);
|
||||
}
|
||||
*buf += sizeof(xValuatorInfo);
|
||||
a = v->axes + (VPC * i);
|
||||
a2 = (xAxisInfoPtr) * buf;
|
||||
for (j = 0; j < t_axes; j++) {
|
||||
a2->min_value = a->min_value;
|
||||
a2->max_value = a->max_value;
|
||||
a2->resolution = a->resolution;
|
||||
if (client->swapped) {
|
||||
swapl(&a2->min_value, n);
|
||||
swapl(&a2->max_value, n);
|
||||
swapl(&a2->resolution, n);
|
||||
}
|
||||
a2++;
|
||||
a++;
|
||||
*buf += sizeof(xAxisInfo);
|
||||
}
|
||||
}
|
||||
return (i);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure writes the reply for the XListInputDevices function,
|
||||
|
@ -376,7 +376,7 @@ CopySwapValuatorClass(register ClientPtr client, ValuatorClassPtr v, char **buf)
|
|||
void
|
||||
SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
38
Xi/listdev.h
38
Xi/listdev.h
|
@ -36,44 +36,6 @@ int SProcXListInputDevices(ClientPtr /* client */
|
|||
int ProcXListInputDevices(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void SizeDeviceInfo(DeviceIntPtr /* d */ ,
|
||||
int * /* namesize */ ,
|
||||
int * /* size */
|
||||
);
|
||||
|
||||
void ListDeviceInfo(ClientPtr /* client */ ,
|
||||
DeviceIntPtr /* d */ ,
|
||||
xDeviceInfoPtr /* dev */ ,
|
||||
char ** /* devbuf */ ,
|
||||
char ** /* classbuf */ ,
|
||||
char ** /* namebuf */
|
||||
);
|
||||
|
||||
void CopyDeviceName(char ** /* namebuf */ ,
|
||||
char * /* name */
|
||||
);
|
||||
|
||||
void CopySwapDevice(ClientPtr /* client */ ,
|
||||
DeviceIntPtr /* d */ ,
|
||||
int /* num_classes */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void CopySwapKeyClass(ClientPtr /* client */ ,
|
||||
KeyClassPtr /* k */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void CopySwapButtonClass(ClientPtr /* client */ ,
|
||||
ButtonClassPtr /* b */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
int CopySwapValuatorClass(ClientPtr /* client */ ,
|
||||
ValuatorClassPtr /* v */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void SRepXListInputDevices(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xListInputDevicesReply * /* rep */
|
||||
|
|
|
@ -79,9 +79,9 @@ extern CARD8 event_base[];
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXOpenDevice(register ClientPtr client)
|
||||
SProcXOpenDevice(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xOpenDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -95,7 +95,7 @@ SProcXOpenDevice(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXOpenDevice(register ClientPtr client)
|
||||
ProcXOpenDevice(ClientPtr client)
|
||||
{
|
||||
xInputClassInfo evbase[numInputClasses];
|
||||
Bool enableit = FALSE;
|
||||
|
@ -179,7 +179,7 @@ ProcXOpenDevice(register ClientPtr client)
|
|||
void
|
||||
SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
|
@ -62,9 +62,9 @@ from the author.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXQueryDevicePointer(register ClientPtr client)
|
||||
SProcXQueryDevicePointer(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xQueryDevicePointerReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -72,7 +72,7 @@ SProcXQueryDevicePointer(register ClientPtr client)
|
|||
}
|
||||
|
||||
int
|
||||
ProcXQueryDevicePointer(register ClientPtr client)
|
||||
ProcXQueryDevicePointer(ClientPtr client)
|
||||
{
|
||||
int rc;
|
||||
xQueryDevicePointerReply rep;
|
||||
|
@ -158,7 +158,7 @@ void
|
|||
SRepXQueryDevicePointer(ClientPtr client, int size,
|
||||
xQueryDevicePointerReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
10
Xi/queryst.c
10
Xi/queryst.c
|
@ -58,9 +58,9 @@ from The Open Group.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXQueryDeviceState(register ClientPtr client)
|
||||
SProcXQueryDeviceState(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xQueryDeviceStateReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -74,9 +74,9 @@ SProcXQueryDeviceState(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXQueryDeviceState(register ClientPtr client)
|
||||
ProcXQueryDeviceState(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
int i;
|
||||
int num_classes = 0;
|
||||
int total_length = 0;
|
||||
|
@ -187,7 +187,7 @@ ProcXQueryDeviceState(register ClientPtr client)
|
|||
void
|
||||
SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
|
@ -128,11 +128,11 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win,
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXSelectExtensionEvent(register ClientPtr client)
|
||||
SProcXSelectExtensionEvent(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
register long *p;
|
||||
register int i;
|
||||
char n;
|
||||
long *p;
|
||||
int i;
|
||||
|
||||
REQUEST(xSelectExtensionEventReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -154,7 +154,7 @@ SProcXSelectExtensionEvent(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXSelectExtensionEvent(register ClientPtr client)
|
||||
ProcXSelectExtensionEvent(ClientPtr client)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
|
|
|
@ -80,11 +80,11 @@ extern int lastEvent; /* Defined in extension.c */
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXSendExtensionEvent(register ClientPtr client)
|
||||
SProcXSendExtensionEvent(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
register long *p;
|
||||
register int i;
|
||||
char n;
|
||||
long *p;
|
||||
int i;
|
||||
xEvent eventT;
|
||||
xEvent *eventP;
|
||||
EventSwapPtr proc;
|
||||
|
@ -119,7 +119,7 @@ SProcXSendExtensionEvent(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXSendExtensionEvent(register ClientPtr client)
|
||||
ProcXSendExtensionEvent(ClientPtr client)
|
||||
{
|
||||
int ret;
|
||||
DeviceIntPtr dev;
|
||||
|
|
|
@ -78,9 +78,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXSetDeviceButtonMapping(register ClientPtr client)
|
||||
SProcXSetDeviceButtonMapping(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xSetDeviceButtonMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -94,7 +94,7 @@ SProcXSetDeviceButtonMapping(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXSetDeviceButtonMapping(register ClientPtr client)
|
||||
ProcXSetDeviceButtonMapping(ClientPtr client)
|
||||
{
|
||||
int ret;
|
||||
xSetDeviceButtonMappingReply rep;
|
||||
|
@ -149,7 +149,7 @@ void
|
|||
SRepXSetDeviceButtonMapping(ClientPtr client, int size,
|
||||
xSetDeviceButtonMappingReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
|
@ -75,9 +75,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXSetDeviceValuators(register ClientPtr client)
|
||||
SProcXSetDeviceValuators(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xSetDeviceValuatorsReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -91,7 +91,7 @@ SProcXSetDeviceValuators(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXSetDeviceValuators(register ClientPtr client)
|
||||
ProcXSetDeviceValuators(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
xSetDeviceValuatorsReply rep;
|
||||
|
@ -152,7 +152,7 @@ void
|
|||
SRepXSetDeviceValuators(ClientPtr client, int size,
|
||||
xSetDeviceValuatorsReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
|
@ -78,9 +78,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXSetDeviceFocus(register ClientPtr client)
|
||||
SProcXSetDeviceFocus(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xSetDeviceFocusReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -97,10 +97,10 @@ SProcXSetDeviceFocus(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXSetDeviceFocus(register ClientPtr client)
|
||||
ProcXSetDeviceFocus(ClientPtr client)
|
||||
{
|
||||
int ret;
|
||||
register DeviceIntPtr dev;
|
||||
DeviceIntPtr dev;
|
||||
|
||||
REQUEST(xSetDeviceFocusReq);
|
||||
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
|
||||
|
|
|
@ -76,9 +76,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXSetDeviceModifierMapping(register ClientPtr client)
|
||||
SProcXSetDeviceModifierMapping(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xSetDeviceModifierMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -145,7 +145,7 @@ void
|
|||
SRepXSetDeviceModifierMapping(ClientPtr client, int size,
|
||||
xSetDeviceModifierMappingReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
|
@ -75,9 +75,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXSetDeviceMode(register ClientPtr client)
|
||||
SProcXSetDeviceMode(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xSetDeviceModeReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -91,7 +91,7 @@ SProcXSetDeviceMode(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXSetDeviceMode(register ClientPtr client)
|
||||
ProcXSetDeviceMode(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
xSetDeviceModeReply rep;
|
||||
|
@ -139,7 +139,7 @@ ProcXSetDeviceMode(register ClientPtr client)
|
|||
void
|
||||
SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
|
|
@ -168,7 +168,7 @@ OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
|
|||
*/
|
||||
|
||||
int
|
||||
SetDeviceMode(register ClientPtr client, DeviceIntPtr dev, int mode)
|
||||
SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode)
|
||||
{
|
||||
return BadMatch;
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ SetDeviceMode(register ClientPtr client, DeviceIntPtr dev, int mode)
|
|||
*/
|
||||
|
||||
int
|
||||
SetDeviceValuators(register ClientPtr client, DeviceIntPtr dev,
|
||||
SetDeviceValuators(ClientPtr client, DeviceIntPtr dev,
|
||||
int *valuators, int first_valuator, int num_valuators)
|
||||
{
|
||||
return BadMatch;
|
||||
|
@ -201,7 +201,7 @@ SetDeviceValuators(register ClientPtr client, DeviceIntPtr dev,
|
|||
*/
|
||||
|
||||
int
|
||||
ChangeDeviceControl(register ClientPtr client, DeviceIntPtr dev,
|
||||
ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev,
|
||||
xDeviceCtl * control)
|
||||
{
|
||||
switch (control->control) {
|
||||
|
|
|
@ -74,9 +74,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXUngrabDevice(register ClientPtr client)
|
||||
SProcXUngrabDevice(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xUngrabDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -92,7 +92,7 @@ SProcXUngrabDevice(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXUngrabDevice(register ClientPtr client)
|
||||
ProcXUngrabDevice(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
GrabPtr grab;
|
||||
|
|
|
@ -80,9 +80,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXUngrabDeviceButton(register ClientPtr client)
|
||||
SProcXUngrabDeviceButton(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xUngrabDeviceButtonReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
|
|
@ -80,9 +80,9 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXUngrabDeviceKey(register ClientPtr client)
|
||||
SProcXUngrabDeviceKey(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xUngrabDeviceKeyReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
|
|
@ -59,9 +59,9 @@ from the author.
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXWarpDevicePointer(register ClientPtr client)
|
||||
SProcXWarpDevicePointer(ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
char n;
|
||||
|
||||
REQUEST(xWarpDevicePointerReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
@ -69,7 +69,7 @@ SProcXWarpDevicePointer(register ClientPtr client)
|
|||
}
|
||||
|
||||
int
|
||||
ProcXWarpDevicePointer(register ClientPtr client)
|
||||
ProcXWarpDevicePointer(ClientPtr client)
|
||||
{
|
||||
int err;
|
||||
int x, y;
|
||||
|
|
124
afb/afb.h
124
afb/afb.h
|
@ -78,27 +78,6 @@ extern void afbDoBitblt(
|
|||
unsigned long /*planemask*/
|
||||
);
|
||||
|
||||
extern RegionPtr afbBitBlt(
|
||||
DrawablePtr /*pSrc*/,
|
||||
DrawablePtr /*pDst*/,
|
||||
GCPtr /*pGC*/,
|
||||
int /*srcx*/,
|
||||
int /*srcy*/,
|
||||
int /*width*/,
|
||||
int /*height*/,
|
||||
int /*dstx*/,
|
||||
int /*dsty*/,
|
||||
void (*doBitBlt)(
|
||||
DrawablePtr /*pSrc*/,
|
||||
DrawablePtr /*pDst*/,
|
||||
int /*alu*/,
|
||||
RegionPtr /*prgnDst*/,
|
||||
DDXPointPtr /*pptSrc*/,
|
||||
unsigned long /*planemask*/
|
||||
),
|
||||
unsigned long /*planemask*/
|
||||
);
|
||||
|
||||
extern RegionPtr afbCopyArea(
|
||||
DrawablePtr /*pSrcDrawable*/,
|
||||
DrawablePtr /*pDstDrawable*/,
|
||||
|
@ -111,27 +90,6 @@ extern RegionPtr afbCopyArea(
|
|||
int /*dsty*/
|
||||
);
|
||||
|
||||
extern RegionPtr afbCopyPlane(
|
||||
DrawablePtr /*pSrcDrawable*/,
|
||||
DrawablePtr /*pDstDrawable*/,
|
||||
GCPtr/*pGC*/,
|
||||
int /*srcx*/,
|
||||
int /*srcy*/,
|
||||
int /*width*/,
|
||||
int /*height*/,
|
||||
int /*dstx*/,
|
||||
int /*dsty*/,
|
||||
unsigned long /*plane*/
|
||||
);
|
||||
|
||||
extern void afbCopy1ToN(
|
||||
DrawablePtr /*pSrc*/,
|
||||
DrawablePtr /*pDst*/,
|
||||
int /*alu*/,
|
||||
RegionPtr /*prgnDst*/,
|
||||
DDXPointPtr /*pptSrc*/,
|
||||
unsigned long /*planemask*/
|
||||
);
|
||||
/* afbbltC.c */
|
||||
|
||||
extern void afbDoBitbltCopy(
|
||||
|
@ -273,23 +231,6 @@ extern Bool afbInitializeColormap(
|
|||
ColormapPtr /*pmap*/
|
||||
);
|
||||
|
||||
extern int afbExpandDirectColors(
|
||||
ColormapPtr /*pmap*/,
|
||||
int /*ndefs*/,
|
||||
xColorItem * /*indefs*/,
|
||||
xColorItem * /*outdefs*/
|
||||
);
|
||||
|
||||
extern Bool afbCreateDefColormap(
|
||||
ScreenPtr /*pScreen*/
|
||||
);
|
||||
|
||||
extern Bool afbSetVisualTypes(
|
||||
int /*depth*/,
|
||||
int /*visuals*/,
|
||||
int /*bitsPerRGB*/
|
||||
);
|
||||
|
||||
extern Bool afbInitVisuals(
|
||||
VisualPtr * /*visualp*/,
|
||||
DepthPtr * /*depthp*/,
|
||||
|
@ -410,16 +351,6 @@ extern Bool afbCreateGC(
|
|||
GCPtr /*pGC*/
|
||||
);
|
||||
|
||||
extern void afbValidateGC(
|
||||
GCPtr /*pGC*/,
|
||||
unsigned long /*changes*/,
|
||||
DrawablePtr /*pDrawable*/
|
||||
);
|
||||
|
||||
extern void afbDestroyGC(
|
||||
GCPtr /*pGC*/
|
||||
);
|
||||
|
||||
extern void afbReduceRop(
|
||||
int /*alu*/,
|
||||
Pixel /*src*/,
|
||||
|
@ -428,19 +359,6 @@ extern void afbReduceRop(
|
|||
unsigned char * /*rrops*/
|
||||
);
|
||||
|
||||
extern void afbReduceOpaqueStipple (
|
||||
Pixel /*fg*/,
|
||||
Pixel /*bg*/,
|
||||
unsigned long /*planemask*/,
|
||||
int /*depth*/,
|
||||
unsigned char * /*rrops*/
|
||||
);
|
||||
|
||||
extern void afbComputeCompositeClip(
|
||||
GCPtr /*pGC*/,
|
||||
DrawablePtr /*pDrawable*/
|
||||
);
|
||||
|
||||
/* afbgetsp.c */
|
||||
|
||||
extern void afbGetSpans(
|
||||
|
@ -588,14 +506,6 @@ extern Bool afbDestroyPixmap(
|
|||
PixmapPtr /*pPixmap*/
|
||||
);
|
||||
|
||||
extern PixmapPtr afbCopyPixmap(
|
||||
PixmapPtr /*pSrc*/
|
||||
);
|
||||
|
||||
extern void afbPadPixmap(
|
||||
PixmapPtr /*pPixmap*/
|
||||
);
|
||||
|
||||
extern void afbXRotatePixmap(
|
||||
PixmapPtr /*pPix*/,
|
||||
int /*rw*/
|
||||
|
@ -637,20 +547,9 @@ extern void afbPushPixels(
|
|||
int /*xOrg*/,
|
||||
int /*yOrg*/
|
||||
);
|
||||
/* afbscrclse.c */
|
||||
|
||||
extern Bool afbCloseScreen(
|
||||
int /*index*/,
|
||||
ScreenPtr /*pScreen*/
|
||||
);
|
||||
/* afbscrinit.c */
|
||||
|
||||
extern Bool afbAllocatePrivates(
|
||||
ScreenPtr /*pScreen*/,
|
||||
int * /*pWinIndex*/,
|
||||
int * /*pGCIndex*/
|
||||
);
|
||||
|
||||
extern Bool afbScreenInit(
|
||||
ScreenPtr /*pScreen*/,
|
||||
pointer /*pbits*/,
|
||||
|
@ -661,15 +560,6 @@ extern Bool afbScreenInit(
|
|||
int /*width*/
|
||||
);
|
||||
|
||||
extern PixmapPtr afbGetWindowPixmap(
|
||||
WindowPtr /*pWin*/
|
||||
);
|
||||
|
||||
extern void afbSetWindowPixmap(
|
||||
WindowPtr /*pWin*/,
|
||||
PixmapPtr /*pPix*/
|
||||
);
|
||||
|
||||
/* afbseg.c */
|
||||
|
||||
extern void afbSegmentSS(
|
||||
|
@ -687,20 +577,6 @@ extern void afbSegmentSD(
|
|||
);
|
||||
/* afbsetsp.c */
|
||||
|
||||
extern void afbSetScanline(
|
||||
int /*y*/,
|
||||
int /*xOrigin*/,
|
||||
int /*xStart*/,
|
||||
int /*xEnd*/,
|
||||
PixelType * /*psrc*/,
|
||||
int /*alu*/,
|
||||
PixelType * /*pdstBase*/,
|
||||
int /*widthDst*/,
|
||||
int /*sizeDst*/,
|
||||
int /*depthDst*/,
|
||||
int /*sizeSrc*/
|
||||
);
|
||||
|
||||
extern void afbSetSpans(
|
||||
DrawablePtr /*pDrawable*/,
|
||||
GCPtr /*pGC*/,
|
||||
|
|
148
afb/afbbitblt.c
148
afb/afbbitblt.c
|
@ -67,9 +67,6 @@ SOFTWARE.
|
|||
#include "afb.h"
|
||||
#include "maskbits.h"
|
||||
|
||||
|
||||
static unsigned char afbRropsOS[AFB_MAX_DEPTH];
|
||||
|
||||
/* CopyArea and CopyPlane for a monchrome frame buffer
|
||||
|
||||
|
||||
|
@ -126,34 +123,7 @@ afbDoBitblt(DrawablePtr pSrc, DrawablePtr pDst, int alu, RegionPtr prgnDst, DDXP
|
|||
typedef void (*afb_blit_func)
|
||||
(DrawablePtr, DrawablePtr, int, RegionPtr, DDXPointPtr, unsigned long);
|
||||
|
||||
RegionPtr
|
||||
afbCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty)
|
||||
{
|
||||
afb_blit_func doBitBlt;
|
||||
|
||||
switch (pGC->alu) {
|
||||
case GXcopy:
|
||||
doBitBlt = afbDoBitbltCopy;
|
||||
break;
|
||||
case GXxor:
|
||||
doBitBlt = afbDoBitbltXor;
|
||||
break;
|
||||
case GXcopyInverted:
|
||||
doBitBlt = afbDoBitbltCopyInverted;
|
||||
break;
|
||||
case GXor:
|
||||
doBitBlt = afbDoBitbltOr;
|
||||
break;
|
||||
default:
|
||||
doBitBlt = afbDoBitbltGeneral;
|
||||
break;
|
||||
}
|
||||
|
||||
return(afbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
|
||||
width, height, dstx, dsty, doBitBlt, pGC->planemask));
|
||||
}
|
||||
|
||||
RegionPtr
|
||||
static RegionPtr
|
||||
afbBitBlt(register DrawablePtr pSrcDrawable, register DrawablePtr pDstDrawable, register GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, afb_blit_func doBitBlt, long unsigned int planemask)
|
||||
{
|
||||
RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
|
||||
|
@ -346,102 +316,28 @@ afbBitBlt(register DrawablePtr pSrcDrawable, register DrawablePtr pDstDrawable,
|
|||
}
|
||||
|
||||
RegionPtr
|
||||
afbCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, register GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, long unsigned int plane)
|
||||
afbCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty)
|
||||
{
|
||||
int alu;
|
||||
RegionPtr prgnExposed = NULL;
|
||||
unsigned long old_planemask;
|
||||
afb_blit_func doBitBlt;
|
||||
|
||||
if (pDstDrawable->depth == 1) {
|
||||
old_planemask = pGC->planemask;
|
||||
pGC->planemask = plane;
|
||||
if ((pGC->fgPixel & 1) == 1 && (pGC->bgPixel & 1) == 0) {
|
||||
prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable,
|
||||
pGC, srcx, srcy, width, height, dstx, dsty);
|
||||
} else if ((pGC->fgPixel & 1) == (pGC->bgPixel & 1)) {
|
||||
unsigned char rop;
|
||||
|
||||
afbReduceRop(pGC->alu, pGC->fgPixel, 1, 1, &rop);
|
||||
alu = pGC->alu;
|
||||
pGC->alu = rop;
|
||||
prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable, pGC,
|
||||
srcx, srcy, width, height, dstx,
|
||||
dsty);
|
||||
pGC->alu = alu;
|
||||
} else { /* need to invert the src */
|
||||
alu = pGC->alu;
|
||||
pGC->alu = afbInverseAlu[alu];
|
||||
prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable, pGC,
|
||||
srcx, srcy, width, height, dstx,
|
||||
dsty);
|
||||
pGC->alu = alu;
|
||||
}
|
||||
pGC->planemask = old_planemask;
|
||||
} else {
|
||||
int free_pixmap = FALSE;
|
||||
PixmapPtr pBitmap = (PixmapPtr)pSrcDrawable;
|
||||
ScreenPtr pScreen = pSrcDrawable->pScreen;
|
||||
GCPtr pGC1 = NULL;
|
||||
|
||||
if (pSrcDrawable == pDstDrawable ||
|
||||
pSrcDrawable->type == DRAWABLE_WINDOW || pSrcDrawable->depth != 1) {
|
||||
/* Copy a plane from source drawable to a tmp 1-bit deep pixmap */
|
||||
/* XXX: Range check width and height */
|
||||
pBitmap = (*pScreen->CreatePixmap)(pScreen, width, height, 1);
|
||||
|
||||
if (!pBitmap)
|
||||
return(NULL);
|
||||
pGC1 = GetScratchGC(1, pScreen);
|
||||
if (!pGC1) {
|
||||
(*pScreen->DestroyPixmap)(pBitmap);
|
||||
return(NULL);
|
||||
}
|
||||
ValidateGC((DrawablePtr)pBitmap, pGC1);
|
||||
(void)afbBitBlt(pSrcDrawable, (DrawablePtr)pBitmap, pGC1, srcx, srcy,
|
||||
width, height, 0, 0, afbDoBitbltCopy, plane);
|
||||
free_pixmap = TRUE;
|
||||
}
|
||||
#if 0
|
||||
else {
|
||||
/* XXX: could cope with N-deep pixmap source case without using tmp
|
||||
* src bitmap by setting up a scratch pixmap header and fiddle
|
||||
* around with the pbits pointer.
|
||||
*/
|
||||
}
|
||||
#endif
|
||||
afbReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask,
|
||||
pGC->depth, afbRropsOS);
|
||||
(void)afbBitBlt((DrawablePtr)pBitmap, pDstDrawable, pGC, 0, 0, width,
|
||||
height, dstx, dsty, afbCopy1ToN, pGC->planemask);
|
||||
if (free_pixmap) {
|
||||
(*pScreen->DestroyPixmap)(pBitmap);
|
||||
FreeScratchGC(pGC1);
|
||||
}
|
||||
|
||||
if (pGC->fExpose)
|
||||
prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx,
|
||||
srcy, width, height, dstx, dsty,
|
||||
plane);
|
||||
}
|
||||
return prgnExposed;
|
||||
}
|
||||
|
||||
void
|
||||
afbCopy1ToN(DrawablePtr pSrc, DrawablePtr pDst, int alu, RegionPtr prgnDst, DDXPointPtr pptSrc, long unsigned int planemask)
|
||||
{
|
||||
int numRects = REGION_NUM_RECTS(prgnDst);
|
||||
BoxPtr pbox = REGION_RECTS(prgnDst);
|
||||
int r;
|
||||
|
||||
for (r = 0; r < numRects; r++, pbox++, pptSrc++) {
|
||||
int dx = pptSrc->x;
|
||||
int dy = pptSrc->y;
|
||||
|
||||
if (alu == GXcopy)
|
||||
afbOpaqueStippleAreaCopy(pDst, 1, pbox, alu, (PixmapPtr)pSrc, dx, dy,
|
||||
afbRropsOS, planemask);
|
||||
else
|
||||
afbOpaqueStippleAreaGeneral(pDst, 1, pbox, alu, (PixmapPtr)pSrc, dx,
|
||||
dy, afbRropsOS, planemask);
|
||||
switch (pGC->alu) {
|
||||
case GXcopy:
|
||||
doBitBlt = afbDoBitbltCopy;
|
||||
break;
|
||||
case GXxor:
|
||||
doBitBlt = afbDoBitbltXor;
|
||||
break;
|
||||
case GXcopyInverted:
|
||||
doBitBlt = afbDoBitbltCopyInverted;
|
||||
break;
|
||||
case GXor:
|
||||
doBitBlt = afbDoBitbltOr;
|
||||
break;
|
||||
default:
|
||||
doBitBlt = afbDoBitbltGeneral;
|
||||
break;
|
||||
}
|
||||
|
||||
return(afbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
|
||||
width, height, dstx, dsty, doBitBlt, pGC->planemask));
|
||||
}
|
||||
|
|
|
@ -70,24 +70,6 @@ afbInitializeColormap(register ColormapPtr pmap)
|
|||
return miInitializeColormap(pmap);
|
||||
}
|
||||
|
||||
int
|
||||
afbExpandDirectColors(ColormapPtr pmap, int ndef, xColorItem *indefs, xColorItem *outdefs)
|
||||
{
|
||||
return miExpandDirectColors(pmap, ndef, indefs, outdefs);
|
||||
}
|
||||
|
||||
Bool
|
||||
afbCreateDefColormap(ScreenPtr pScreen)
|
||||
{
|
||||
return miCreateDefColormap(pScreen);
|
||||
}
|
||||
|
||||
Bool
|
||||
afbSetVisualTypes(int depth, int visuals, int bitsPerRGB)
|
||||
{
|
||||
return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Given a list of formats for a screen, create a list
|
||||
* of visuals and depths for the screen which correspond to
|
||||
|
|
266
afb/afbgc.c
266
afb/afbgc.c
|
@ -69,6 +69,9 @@ SOFTWARE.
|
|||
|
||||
#include "maskbits.h"
|
||||
|
||||
static void afbDestroyGC(GCPtr);
|
||||
static void afbValidateGC(GCPtr, unsigned long, DrawablePtr);
|
||||
|
||||
static GCFuncs afbFuncs = {
|
||||
afbValidateGC,
|
||||
miChangeGC,
|
||||
|
@ -102,6 +105,33 @@ static GCOps afbGCOps = {
|
|||
afbPushPixels
|
||||
};
|
||||
|
||||
static void
|
||||
afbReduceOpaqueStipple(PixelType fg, PixelType bg, unsigned long planemask,
|
||||
int depth, unsigned char *rop)
|
||||
{
|
||||
register int d;
|
||||
register Pixel mask = 1;
|
||||
|
||||
bg ^= fg;
|
||||
|
||||
for (d = 0; d < depth; d++, mask <<= 1) {
|
||||
if (!(planemask & mask))
|
||||
rop[d] = RROP_NOP;
|
||||
else if (!(bg & mask)) {
|
||||
/* Both fg and bg have a 0 or 1 in this plane */
|
||||
if (fg & mask)
|
||||
rop[d] = RROP_WHITE;
|
||||
else
|
||||
rop[d] = RROP_BLACK;
|
||||
} else {
|
||||
/* Both fg and bg have different bits on this plane */
|
||||
if (fg & mask)
|
||||
rop[d] = RROP_COPY;
|
||||
else
|
||||
rop[d] = RROP_INVERT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Bool
|
||||
afbCreateGC(pGC)
|
||||
|
@ -136,6 +166,95 @@ afbCreateGC(pGC)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
afbComputeCompositeClip(GCPtr pGC, DrawablePtr pDrawable)
|
||||
{
|
||||
if (pDrawable->type == DRAWABLE_WINDOW) {
|
||||
WindowPtr pWin = (WindowPtr) pDrawable;
|
||||
RegionPtr pregWin;
|
||||
Bool freeTmpClip, freeCompClip;
|
||||
|
||||
if (pGC->subWindowMode == IncludeInferiors) {
|
||||
pregWin = NotClippedByChildren(pWin);
|
||||
freeTmpClip = TRUE;
|
||||
} else {
|
||||
pregWin = &pWin->clipList;
|
||||
freeTmpClip = FALSE;
|
||||
}
|
||||
freeCompClip = pGC->freeCompClip;
|
||||
|
||||
/*
|
||||
* if there is no client clip, we can get by with just keeping the
|
||||
* pointer we got, and remembering whether or not should destroy (or
|
||||
* maybe re-use) it later. this way, we avoid unnecessary copying of
|
||||
* regions. (this wins especially if many clients clip by children
|
||||
* and have no client clip.)
|
||||
*/
|
||||
if (pGC->clientClipType == CT_NONE) {
|
||||
if (freeCompClip)
|
||||
REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
|
||||
pGC->pCompositeClip = pregWin;
|
||||
pGC->freeCompClip = freeTmpClip;
|
||||
} else {
|
||||
/*
|
||||
* we need one 'real' region to put into the composite clip. if
|
||||
* pregWin the current composite clip are real, we can get rid of
|
||||
* one. if pregWin is real and the current composite clip isn't,
|
||||
* use pregWin for the composite clip. if the current composite
|
||||
* clip is real and pregWin isn't, use the current composite
|
||||
* clip. if neither is real, create a new region.
|
||||
*/
|
||||
|
||||
REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
|
||||
pDrawable->x + pGC->clipOrg.x,
|
||||
pDrawable->y + pGC->clipOrg.y);
|
||||
|
||||
if (freeCompClip) {
|
||||
REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, pregWin,
|
||||
pGC->clientClip);
|
||||
if (freeTmpClip)
|
||||
REGION_DESTROY(pGC->pScreen, pregWin);
|
||||
} else if (freeTmpClip) {
|
||||
REGION_INTERSECT(pGC->pScreen, pregWin, pregWin, pGC->clientClip);
|
||||
pGC->pCompositeClip = pregWin;
|
||||
} else {
|
||||
pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, NullBox, 0);
|
||||
REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
|
||||
pregWin, pGC->clientClip);
|
||||
}
|
||||
pGC->freeCompClip = TRUE;
|
||||
REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
|
||||
-(pDrawable->x + pGC->clipOrg.x),
|
||||
-(pDrawable->y + pGC->clipOrg.y));
|
||||
}
|
||||
} /* end of composite clip for a window */
|
||||
else {
|
||||
BoxRec pixbounds;
|
||||
|
||||
/* XXX should we translate by drawable.x/y here ? */
|
||||
pixbounds.x1 = 0;
|
||||
pixbounds.y1 = 0;
|
||||
pixbounds.x2 = pDrawable->width;
|
||||
pixbounds.y2 = pDrawable->height;
|
||||
|
||||
if (pGC->freeCompClip) {
|
||||
REGION_RESET(pGC->pScreen, pGC->pCompositeClip, &pixbounds);
|
||||
} else {
|
||||
pGC->freeCompClip = TRUE;
|
||||
pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, &pixbounds, 1);
|
||||
}
|
||||
|
||||
if (pGC->clientClipType == CT_REGION) {
|
||||
REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, -pGC->clipOrg.x,
|
||||
-pGC->clipOrg.y);
|
||||
REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
|
||||
pGC->pCompositeClip, pGC->clientClip);
|
||||
REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, pGC->clipOrg.x,
|
||||
pGC->clipOrg.y);
|
||||
}
|
||||
} /* end of composite clip for pixmap */
|
||||
} /* end afbComputeCompositeClip */
|
||||
|
||||
/* Clipping conventions
|
||||
if the drawable is a window
|
||||
CT_REGION ==> pCompositeClip really is the composite
|
||||
|
@ -147,7 +266,7 @@ afbCreateGC(pGC)
|
|||
*/
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
static void
|
||||
afbValidateGC(pGC, changes, pDrawable)
|
||||
register GCPtr pGC;
|
||||
unsigned long changes;
|
||||
|
@ -434,7 +553,7 @@ afbValidateGC(pGC, changes, pDrawable)
|
|||
} /* end of new_fill */
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
afbDestroyGC(pGC)
|
||||
GCPtr pGC;
|
||||
{
|
||||
|
@ -445,58 +564,6 @@ afbDestroyGC(pGC)
|
|||
miDestroyGCOps(pGC->ops);
|
||||
}
|
||||
|
||||
/* table to map alu(src, dst) to alu(~src, dst) */
|
||||
int afbInverseAlu[16] = {
|
||||
GXclear,
|
||||
GXandInverted,
|
||||
GXnor,
|
||||
GXcopyInverted,
|
||||
GXand,
|
||||
GXnoop,
|
||||
GXequiv,
|
||||
GXorInverted,
|
||||
GXandReverse,
|
||||
GXxor,
|
||||
GXinvert,
|
||||
GXnand,
|
||||
GXcopy,
|
||||
GXor,
|
||||
GXorReverse,
|
||||
GXset
|
||||
};
|
||||
|
||||
void
|
||||
afbReduceOpaqueStipple(fg, bg, planemask, depth, rop)
|
||||
register PixelType fg;
|
||||
register PixelType bg;
|
||||
register unsigned long planemask;
|
||||
int depth;
|
||||
register unsigned char *rop;
|
||||
{
|
||||
register int d;
|
||||
register Pixel mask = 1;
|
||||
|
||||
bg ^= fg;
|
||||
|
||||
for (d = 0; d < depth; d++, mask <<= 1) {
|
||||
if (!(planemask & mask))
|
||||
rop[d] = RROP_NOP;
|
||||
else if (!(bg & mask)) {
|
||||
/* Both fg and bg have a 0 or 1 in this plane */
|
||||
if (fg & mask)
|
||||
rop[d] = RROP_WHITE;
|
||||
else
|
||||
rop[d] = RROP_BLACK;
|
||||
} else {
|
||||
/* Both fg and bg have different bits on this plane */
|
||||
if (fg & mask)
|
||||
rop[d] = RROP_COPY;
|
||||
else
|
||||
rop[d] = RROP_INVERT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
afbReduceRop(alu, src, planemask, depth, rop)
|
||||
register int alu;
|
||||
|
@ -615,94 +682,3 @@ afbReduceRop(alu, src, planemask, depth, rop)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
afbComputeCompositeClip(pGC, pDrawable)
|
||||
GCPtr pGC;
|
||||
DrawablePtr pDrawable;
|
||||
{
|
||||
if (pDrawable->type == DRAWABLE_WINDOW) {
|
||||
WindowPtr pWin = (WindowPtr) pDrawable;
|
||||
RegionPtr pregWin;
|
||||
Bool freeTmpClip, freeCompClip;
|
||||
|
||||
if (pGC->subWindowMode == IncludeInferiors) {
|
||||
pregWin = NotClippedByChildren(pWin);
|
||||
freeTmpClip = TRUE;
|
||||
} else {
|
||||
pregWin = &pWin->clipList;
|
||||
freeTmpClip = FALSE;
|
||||
}
|
||||
freeCompClip = pGC->freeCompClip;
|
||||
|
||||
/*
|
||||
* if there is no client clip, we can get by with just keeping the
|
||||
* pointer we got, and remembering whether or not should destroy (or
|
||||
* maybe re-use) it later. this way, we avoid unnecessary copying of
|
||||
* regions. (this wins especially if many clients clip by children
|
||||
* and have no client clip.)
|
||||
*/
|
||||
if (pGC->clientClipType == CT_NONE) {
|
||||
if (freeCompClip)
|
||||
REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
|
||||
pGC->pCompositeClip = pregWin;
|
||||
pGC->freeCompClip = freeTmpClip;
|
||||
} else {
|
||||
/*
|
||||
* we need one 'real' region to put into the composite clip. if
|
||||
* pregWin the current composite clip are real, we can get rid of
|
||||
* one. if pregWin is real and the current composite clip isn't,
|
||||
* use pregWin for the composite clip. if the current composite
|
||||
* clip is real and pregWin isn't, use the current composite
|
||||
* clip. if neither is real, create a new region.
|
||||
*/
|
||||
|
||||
REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
|
||||
pDrawable->x + pGC->clipOrg.x,
|
||||
pDrawable->y + pGC->clipOrg.y);
|
||||
|
||||
if (freeCompClip) {
|
||||
REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, pregWin,
|
||||
pGC->clientClip);
|
||||
if (freeTmpClip)
|
||||
REGION_DESTROY(pGC->pScreen, pregWin);
|
||||
} else if (freeTmpClip) {
|
||||
REGION_INTERSECT(pGC->pScreen, pregWin, pregWin, pGC->clientClip);
|
||||
pGC->pCompositeClip = pregWin;
|
||||
} else {
|
||||
pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, NullBox, 0);
|
||||
REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
|
||||
pregWin, pGC->clientClip);
|
||||
}
|
||||
pGC->freeCompClip = TRUE;
|
||||
REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
|
||||
-(pDrawable->x + pGC->clipOrg.x),
|
||||
-(pDrawable->y + pGC->clipOrg.y));
|
||||
}
|
||||
} /* end of composite clip for a window */
|
||||
else {
|
||||
BoxRec pixbounds;
|
||||
|
||||
/* XXX should we translate by drawable.x/y here ? */
|
||||
pixbounds.x1 = 0;
|
||||
pixbounds.y1 = 0;
|
||||
pixbounds.x2 = pDrawable->width;
|
||||
pixbounds.y2 = pDrawable->height;
|
||||
|
||||
if (pGC->freeCompClip) {
|
||||
REGION_RESET(pGC->pScreen, pGC->pCompositeClip, &pixbounds);
|
||||
} else {
|
||||
pGC->freeCompClip = TRUE;
|
||||
pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, &pixbounds, 1);
|
||||
}
|
||||
|
||||
if (pGC->clientClipType == CT_REGION) {
|
||||
REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, -pGC->clipOrg.x,
|
||||
-pGC->clipOrg.y);
|
||||
REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
|
||||
pGC->pCompositeClip, pGC->clientClip);
|
||||
REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, pGC->clipOrg.x,
|
||||
pGC->clipOrg.y);
|
||||
}
|
||||
} /* end of composite clip for pixmap */
|
||||
} /* end afbComputeCompositeClip */
|
||||
|
|
|
@ -42,39 +42,8 @@ afbPutImage(pDraw, pGC, depth, x, y, width, height, leftPad, format, pImage)
|
|||
(void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, pDraw, pGC, leftPad,
|
||||
0, width, height, x, y, 1);
|
||||
else {
|
||||
#if 0
|
||||
/* XXX: bit plane order wronge ! */
|
||||
pPixmap->drawable.depth = 1;
|
||||
pPixmap->drawable.bitsPerPixel = 1;
|
||||
|
||||
switch (pGC->alu) {
|
||||
case GXcopy:
|
||||
doBitBlt = afbDoBitbltCopy;
|
||||
break;
|
||||
case GXxor:
|
||||
doBitBlt = afbDoBitbltXor;
|
||||
break;
|
||||
case GXcopyInverted:
|
||||
doBitBlt = afbDoBitbltCopyInverted;
|
||||
break;
|
||||
case GXor:
|
||||
doBitBlt = afbDoBitbltOr;
|
||||
break;
|
||||
default:
|
||||
doBitBlt = afbDoBitbltGeneral;
|
||||
break;
|
||||
}
|
||||
|
||||
for (plane = (1L << (pPixmap->drawable.depth - 1)); plane;
|
||||
plane >>= 1) {
|
||||
(void)afbBitBlt((DrawablePtr)pPixmap, pDraw, pGC, leftPad, 0,
|
||||
width, height, x, y, doBitBlt, plane);
|
||||
/* pDraw->devKind += sizeDst; */
|
||||
}
|
||||
#else
|
||||
(void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, pDraw, pGC, leftPad,
|
||||
0, width, height, x, y);
|
||||
#endif
|
||||
}
|
||||
|
||||
pGC->fExpose = TRUE;
|
||||
|
|
|
@ -118,9 +118,8 @@ afbDestroyPixmap(pPixmap)
|
|||
}
|
||||
|
||||
|
||||
PixmapPtr
|
||||
afbCopyPixmap(pSrc)
|
||||
register PixmapPtr pSrc;
|
||||
static PixmapPtr
|
||||
afbCopyPixmap(PixmapPtr pSrc)
|
||||
{
|
||||
register PixmapPtr pDst;
|
||||
int size;
|
||||
|
@ -148,9 +147,8 @@ afbCopyPixmap(pSrc)
|
|||
zero out area to be filled with replicate
|
||||
left shift and or in original as many times as needed
|
||||
*/
|
||||
void
|
||||
afbPadPixmap(pPixmap)
|
||||
PixmapPtr pPixmap;
|
||||
static void
|
||||
afbPadPixmap(PixmapPtr pPixmap)
|
||||
{
|
||||
register int width = pPixmap->drawable.width;
|
||||
register int h;
|
||||
|
|
|
@ -77,7 +77,7 @@ int afbScreenPrivateIndex;
|
|||
|
||||
static unsigned long afbGeneration = 0;
|
||||
|
||||
BSFuncRec afbBSFuncRec = {
|
||||
static BSFuncRec afbBSFuncRec = {
|
||||
afbSaveAreas,
|
||||
afbRestoreAreas,
|
||||
(BackingStoreSetClipmaskRgnProcPtr) 0,
|
||||
|
@ -85,7 +85,7 @@ BSFuncRec afbBSFuncRec = {
|
|||
(BackingStoreGetSpansPixmapProcPtr) 0,
|
||||
};
|
||||
|
||||
Bool
|
||||
static Bool
|
||||
afbCloseScreen(int index, ScreenPtr pScreen)
|
||||
{
|
||||
int d;
|
||||
|
@ -119,7 +119,29 @@ afbCreateScreenResources(ScreenPtr pScreen)
|
|||
return(retval);
|
||||
}
|
||||
|
||||
Bool
|
||||
static PixmapPtr
|
||||
afbGetWindowPixmap(WindowPtr pWin)
|
||||
{
|
||||
#ifdef PIXMAP_PER_WINDOW
|
||||
return (PixmapPtr)(pWin->devPrivates[frameWindowPrivateIndex].ptr);
|
||||
#else
|
||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||
|
||||
return (* pScreen->GetScreenPixmap)(pScreen);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
afbSetWindowPixmap(WindowPtr pWin, PixmapPtr pPix)
|
||||
{
|
||||
#ifdef PIXMAP_PER_WINDOW
|
||||
pWin->devPrivates[frameWindowPrivateIndex].ptr = (pointer)pPix;
|
||||
#else
|
||||
(* pWin->drawable.pScreen->SetScreenPixmap)(pPix);
|
||||
#endif
|
||||
}
|
||||
|
||||
static Bool
|
||||
afbAllocatePrivates(ScreenPtr pScreen, int *pWinIndex, int *pGCIndex)
|
||||
{
|
||||
if (afbGeneration != serverGeneration) {
|
||||
|
@ -216,25 +238,3 @@ afbScreenInit(register ScreenPtr pScreen, pointer pbits, int xsize, int ysize, i
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PixmapPtr
|
||||
afbGetWindowPixmap(WindowPtr pWin)
|
||||
{
|
||||
#ifdef PIXMAP_PER_WINDOW
|
||||
return (PixmapPtr)(pWin->devPrivates[frameWindowPrivateIndex].ptr);
|
||||
#else
|
||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||
|
||||
return (* pScreen->GetScreenPixmap)(pScreen);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
afbSetWindowPixmap(WindowPtr pWin, PixmapPtr pPix)
|
||||
{
|
||||
#ifdef PIXMAP_PER_WINDOW
|
||||
pWin->devPrivates[frameWindowPrivateIndex].ptr = (pointer)pPix;
|
||||
#else
|
||||
(* pWin->drawable.pScreen->SetScreenPixmap)(pPix);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -73,20 +73,10 @@ SOFTWARE.
|
|||
* boxes, we may not want to start grabbing bits at psrc but at some offset
|
||||
* further on.)
|
||||
*/
|
||||
void
|
||||
afbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst,
|
||||
sizeDst, depthDst, sizeSrc)
|
||||
int y;
|
||||
int xOrigin; /* where this scanline starts */
|
||||
int xStart; /* first bit to use from scanline */
|
||||
int xEnd; /* last bit to use from scanline + 1 */
|
||||
register PixelType *psrc;
|
||||
register int alu; /* raster op */
|
||||
PixelType *pdstBase; /* start of the drawable */
|
||||
int widthDst; /* width of drawable in words */
|
||||
int sizeDst;
|
||||
int depthDst;
|
||||
int sizeSrc;
|
||||
static void
|
||||
afbSetScanline(int y, int xOrigin, int xStart, int xEnd, PixelType *psrc,
|
||||
int alu, PixelType *pdstBase, int widthDst, int sizeDst,
|
||||
int depthDst, int sizeSrc)
|
||||
{
|
||||
int w; /* width of scanline in bits */
|
||||
register PixelType *pdst; /* where to put the bits */
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
|
||||
#include "compint.h"
|
||||
|
||||
void
|
||||
static void
|
||||
compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
|
||||
{
|
||||
WindowPtr pWin = (WindowPtr) closure;
|
||||
|
|
|
@ -50,10 +50,10 @@
|
|||
#include "compint.h"
|
||||
|
||||
static CARD8 CompositeReqCode;
|
||||
int CompositeClientPrivateIndex;
|
||||
static int CompositeClientPrivateIndex;
|
||||
RESTYPE CompositeClientWindowType;
|
||||
RESTYPE CompositeClientSubwindowsType;
|
||||
RESTYPE CompositeClientOverlayType;
|
||||
static RESTYPE CompositeClientOverlayType;
|
||||
|
||||
static void deleteCompOverlayClient (CompOverlayClientPtr pOcToDel,
|
||||
ScreenPtr pScreen);
|
||||
|
@ -423,7 +423,7 @@ createOverlayWindow (ScreenPtr pScreen)
|
|||
return pWin;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
ProcCompositeGetOverlayWindow (ClientPtr client)
|
||||
{
|
||||
REQUEST(xCompositeGetOverlayWindowReq);
|
||||
|
@ -477,7 +477,7 @@ ProcCompositeGetOverlayWindow (ClientPtr client)
|
|||
return client->noClientException;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
ProcCompositeReleaseOverlayWindow (ClientPtr client)
|
||||
{
|
||||
REQUEST(xCompositeReleaseOverlayWindowReq);
|
||||
|
@ -515,7 +515,7 @@ ProcCompositeReleaseOverlayWindow (ClientPtr client)
|
|||
return client->noClientException;
|
||||
}
|
||||
|
||||
int (*ProcCompositeVector[CompositeNumberRequests])(ClientPtr) = {
|
||||
static int (*ProcCompositeVector[CompositeNumberRequests])(ClientPtr) = {
|
||||
ProcCompositeQueryVersion,
|
||||
ProcCompositeRedirectWindow,
|
||||
ProcCompositeRedirectSubwindows,
|
||||
|
@ -625,7 +625,7 @@ SProcCompositeNameWindowPixmap (ClientPtr client)
|
|||
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
SProcCompositeGetOverlayWindow (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
|
@ -637,7 +637,7 @@ SProcCompositeGetOverlayWindow (ClientPtr client)
|
|||
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
SProcCompositeReleaseOverlayWindow (ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
|
@ -649,7 +649,7 @@ SProcCompositeReleaseOverlayWindow (ClientPtr client)
|
|||
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
|
||||
}
|
||||
|
||||
int (*SProcCompositeVector[CompositeNumberRequests])(ClientPtr) = {
|
||||
static int (*SProcCompositeVector[CompositeNumberRequests])(ClientPtr) = {
|
||||
SProcCompositeQueryVersion,
|
||||
SProcCompositeRedirectWindow,
|
||||
SProcCompositeRedirectSubwindows,
|
||||
|
@ -678,6 +678,30 @@ CompositeExtensionInit (void)
|
|||
ExtensionEntry *extEntry;
|
||||
int s;
|
||||
|
||||
for (s = 0; s < screenInfo.numScreens; s++) {
|
||||
ScreenPtr pScreen = screenInfo.screens[s];
|
||||
VisualPtr vis;
|
||||
|
||||
/* Composite on 8bpp pseudocolor root windows appears to fail, so
|
||||
* just disable it on anything pseudocolor for safety.
|
||||
*/
|
||||
for (vis = pScreen->visuals; vis->vid != pScreen->rootVisual; vis++)
|
||||
;
|
||||
if ((vis->class | DynamicClass) == PseudoColor)
|
||||
return;
|
||||
|
||||
/* Ensure that Render is initialized, which is required for automatic
|
||||
* compositing.
|
||||
*/
|
||||
if (GetPictureScreenIfSet(pScreen) == NULL)
|
||||
return;
|
||||
}
|
||||
/* Xinerama's rewriting of window drawing before Composite gets to it
|
||||
* breaks Composite.
|
||||
*/
|
||||
if (!noPanoramiXExtension)
|
||||
return;
|
||||
|
||||
CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow);
|
||||
if (!CompositeClientWindowType)
|
||||
return;
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
int CompScreenPrivateIndex;
|
||||
int CompWindowPrivateIndex;
|
||||
int CompSubwindowsPrivateIndex;
|
||||
int CompGeneration;
|
||||
static int CompGeneration;
|
||||
|
||||
|
||||
static Bool
|
||||
|
|
|
@ -171,9 +171,6 @@ extern RESTYPE CompositeClientSubwindowsType;
|
|||
* compalloc.c
|
||||
*/
|
||||
|
||||
void
|
||||
compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure);
|
||||
|
||||
Bool
|
||||
compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
|
||||
|
||||
|
@ -292,18 +289,6 @@ compWindowUpdate (WindowPtr pWin);
|
|||
void
|
||||
deleteCompOverlayClientsForScreen (ScreenPtr pScreen);
|
||||
|
||||
int
|
||||
ProcCompositeGetOverlayWindow (ClientPtr client);
|
||||
|
||||
int
|
||||
ProcCompositeReleaseOverlayWindow (ClientPtr client);
|
||||
|
||||
int
|
||||
SProcCompositeGetOverlayWindow (ClientPtr client);
|
||||
|
||||
int
|
||||
SProcCompositeReleaseOverlayWindow (ClientPtr client);
|
||||
|
||||
WindowPtr
|
||||
CompositeRealChildHead (WindowPtr pWin);
|
||||
|
||||
|
|
|
@ -852,10 +852,6 @@ AC_DEFINE(DAMAGE,1,[Support Damage extension])
|
|||
DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la'
|
||||
DAMAGE_INC='-I$(top_srcdir)/damageext'
|
||||
MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la'
|
||||
dnl damage (may) need the composite wrapper when composite is enabled
|
||||
if test "$COMPOSITE" = yes; then
|
||||
MIEXT_DAMAGE_LIB="$MIEXT_DAMAGE_LIB "'$(top_builddir)/miext/cw/libcw.la'
|
||||
fi
|
||||
MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage'
|
||||
|
||||
AC_DEFINE(XINPUT, 1, [Support X Input extension])
|
||||
|
@ -1412,6 +1408,8 @@ return 0;}
|
|||
fi
|
||||
if test "${OS_MINOR}" -lt 8 ; then
|
||||
solaris_usl_console="yes"
|
||||
else
|
||||
XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
|
|
|
@ -28,12 +28,12 @@
|
|||
|
||||
#include "damageextint.h"
|
||||
|
||||
unsigned char DamageReqCode;
|
||||
int DamageEventBase;
|
||||
int DamageErrorBase;
|
||||
int DamageClientPrivateIndex;
|
||||
RESTYPE DamageExtType;
|
||||
RESTYPE DamageExtWinType;
|
||||
static unsigned char DamageReqCode;
|
||||
static int DamageEventBase;
|
||||
static int DamageErrorBase;
|
||||
static int DamageClientPrivateIndex;
|
||||
static RESTYPE DamageExtType;
|
||||
static RESTYPE DamageExtWinType;
|
||||
|
||||
/* Version of the damage extension supported by the server, as opposed to the
|
||||
* DAMAGE_* defines from damageproto for what version the proto header
|
||||
|
@ -319,7 +319,7 @@ static const int version_requests[] = {
|
|||
|
||||
#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0]))
|
||||
|
||||
int (*ProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
|
||||
static int (*ProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
|
||||
/*************** Version 1 ******************/
|
||||
ProcDamageQueryVersion,
|
||||
ProcDamageCreate,
|
||||
|
@ -408,7 +408,7 @@ SProcDamageAdd (ClientPtr client)
|
|||
return (*ProcDamageVector[stuff->damageReqType]) (client);
|
||||
}
|
||||
|
||||
int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
|
||||
static int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
|
||||
/*************** Version 1 ******************/
|
||||
SProcDamageQueryVersion,
|
||||
SProcDamageCreate,
|
||||
|
@ -478,7 +478,7 @@ FreeDamageExtWin (pointer value, XID wid)
|
|||
return Success;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
SDamageNotifyEvent (xDamageNotifyEvent *from,
|
||||
xDamageNotifyEvent *to)
|
||||
{
|
||||
|
|
|
@ -44,13 +44,6 @@
|
|||
#include "damage.h"
|
||||
#include "xfixes.h"
|
||||
|
||||
extern unsigned char DamageReqCode;
|
||||
extern int DamageEventBase;
|
||||
extern int DamageErrorBase;
|
||||
extern int DamageClientPrivateIndex;
|
||||
extern RESTYPE DamageExtType;
|
||||
extern RESTYPE DamageExtWinType;
|
||||
|
||||
typedef struct _DamageClient {
|
||||
CARD32 major_version;
|
||||
CARD32 minor_version;
|
||||
|
@ -67,9 +60,6 @@ typedef struct _DamageExt {
|
|||
XID id;
|
||||
} DamageExtRec, *DamageExtPtr;
|
||||
|
||||
extern int (*ProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
|
||||
extern int (*SProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
|
||||
|
||||
#define VERIFY_DAMAGEEXT(pDamageExt, rid, client, mode) { \
|
||||
pDamageExt = SecurityLookupIDByType (client, rid, DamageExtType, mode); \
|
||||
if (!pDamageExt) { \
|
||||
|
@ -78,10 +68,6 @@ extern int (*SProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
|
|||
} \
|
||||
}
|
||||
|
||||
void
|
||||
SDamageNotifyEvent (xDamageNotifyEvent *from,
|
||||
xDamageNotifyEvent *to);
|
||||
|
||||
void
|
||||
DamageExtSetCritical (ClientPtr pClient, Bool critical);
|
||||
|
||||
|
|
31
dbe/dbe.c
31
dbe/dbe.c
|
@ -79,36 +79,6 @@ static int dbeErrorBase;
|
|||
*/
|
||||
static Bool firstRegistrationPass = TRUE;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* DBE DIX Procedure: DbeValidateBuffer
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* This function is called from VALIDATE_DRAWABLE_AND_GC and from
|
||||
* various places in dispatch.c if the server has been compiled with
|
||||
* the flags -DNEED_DBE_BUF_BITS and -DNEED_DBE_BUF_VALIDATE.
|
||||
* When pWin->dstBuffer changes, this function will be called with pWin
|
||||
* as the first argument, the drawable ID that was specified as the
|
||||
* second argument (could be a back buffer id), and True for the third
|
||||
* argument.
|
||||
* When pWin->srcBuffer changes, the third argument will be False, and
|
||||
* the first two arguments are as described for dstBuffer.
|
||||
*
|
||||
* This function should prepare the hardware to access the specified
|
||||
* buffer for reads (if dstbuf is False) or writes (if dstbuf is True).
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DbeValidateBuffer(WindowPtr pWin, XID drawID, Bool dstbuf)
|
||||
{
|
||||
DbeScreenPrivPtr pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin);
|
||||
if (pDbeScreenPriv->ValidateBuffer)
|
||||
(*pDbeScreenPriv->ValidateBuffer)(pWin, drawID, dstbuf);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
|
@ -317,7 +287,6 @@ DbeStubScreen(DbeScreenPrivPtr pDbeScreenPriv, int *nStubbedScreens)
|
|||
pDbeScreenPriv->EndIdiom = NULL;
|
||||
pDbeScreenPriv->WinPrivDelete = NULL;
|
||||
pDbeScreenPriv->ResetProc = NULL;
|
||||
pDbeScreenPriv->ValidateBuffer = NULL;
|
||||
|
||||
(*nStubbedScreens)++;
|
||||
|
||||
|
|
|
@ -221,11 +221,6 @@ typedef struct _DbeScreenPrivRec
|
|||
void (*ResetProc)(
|
||||
ScreenPtr /*pScreen*/
|
||||
);
|
||||
void (*ValidateBuffer)(
|
||||
WindowPtr /*pWin*/,
|
||||
XID /*bufId*/,
|
||||
Bool /*dstbuffer*/
|
||||
);
|
||||
|
||||
/* Device-specific private information.
|
||||
*/
|
||||
|
|
25
dbe/midbe.c
25
dbe/midbe.c
|
@ -59,21 +59,12 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
/* DEFINES */
|
||||
|
||||
|
||||
/* TYPEDEFS */
|
||||
|
||||
|
||||
/* GLOBALS */
|
||||
|
||||
static int miDbePrivPrivGeneration = 0;
|
||||
static int miDbeWindowPrivPrivIndex = -1;
|
||||
RESTYPE dbeDrawableResType;
|
||||
RESTYPE dbeWindowPrivResType;
|
||||
int dbeScreenPrivIndex = -1;
|
||||
int dbeWindowPrivIndex = -1;
|
||||
|
||||
static RESTYPE dbeDrawableResType;
|
||||
static RESTYPE dbeWindowPrivResType;
|
||||
static int dbeScreenPrivIndex = -1;
|
||||
static int dbeWindowPrivIndex = -1;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -768,11 +759,6 @@ miDbeResetProc(ScreenPtr pScreen)
|
|||
|
||||
} /* miDbeResetProc() */
|
||||
|
||||
static void
|
||||
miDbeNopValidateBuffer(WindowPtr pWin, XID bufId, Bool dstbuffer)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
|
@ -830,9 +816,6 @@ miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv)
|
|||
pDbeScreenPriv->ResetProc = miDbeResetProc;
|
||||
pDbeScreenPriv->WinPrivDelete = miDbeWinPrivDelete;
|
||||
|
||||
/* The mi implementation doesn't need buffer validation. */
|
||||
pDbeScreenPriv->ValidateBuffer = miDbeNopValidateBuffer;
|
||||
|
||||
return(TRUE);
|
||||
|
||||
} /* miDbeInit() */
|
||||
|
|
|
@ -67,7 +67,7 @@ SOFTWARE.
|
|||
#define XKB_IN_SERVER
|
||||
#endif
|
||||
#ifdef XKB
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#endif
|
||||
#include "xace.h"
|
||||
|
||||
|
@ -79,7 +79,8 @@ SOFTWARE.
|
|||
#include "exglobals.h"
|
||||
#include "exevents.h"
|
||||
|
||||
int CoreDevicePrivatesIndex = 0, CoreDevicePrivatesGeneration = -1;
|
||||
int CoreDevicePrivatesIndex = 0;
|
||||
static int CoreDevicePrivatesGeneration = -1;
|
||||
|
||||
/* The client that is allowed to change pointer-keyboard pairings. */
|
||||
static ClientPtr pairingClient = NULL;
|
||||
|
@ -994,16 +995,16 @@ InitPtrFeedbackClassDeviceStruct(DeviceIntPtr dev, PtrCtrlProcPtr controlProc)
|
|||
}
|
||||
|
||||
|
||||
LedCtrl defaultLedControl = {
|
||||
static LedCtrl defaultLedControl = {
|
||||
DEFAULT_LEDS, DEFAULT_LEDS_MASK, 0};
|
||||
|
||||
BellCtrl defaultBellControl = {
|
||||
static BellCtrl defaultBellControl = {
|
||||
DEFAULT_BELL,
|
||||
DEFAULT_BELL_PITCH,
|
||||
DEFAULT_BELL_DURATION,
|
||||
0};
|
||||
|
||||
IntegerCtrl defaultIntegerControl = {
|
||||
static IntegerCtrl defaultIntegerControl = {
|
||||
DEFAULT_INT_RESOLUTION,
|
||||
DEFAULT_INT_MIN_VALUE,
|
||||
DEFAULT_INT_MAX_VALUE,
|
||||
|
|
|
@ -143,7 +143,7 @@ int ProcInitialConnection();
|
|||
#define XKB_IN_SERVER
|
||||
#endif
|
||||
#include "inputstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#endif
|
||||
|
||||
#ifdef XSERVER_DTRACE
|
||||
|
@ -297,9 +297,8 @@ long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL;
|
|||
long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL;
|
||||
long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE;
|
||||
long SmartScheduleTime;
|
||||
ClientPtr SmartLastClient;
|
||||
int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1];
|
||||
int SmartScheduleClient(int *clientReady, int nready);
|
||||
static ClientPtr SmartLastClient;
|
||||
static int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1];
|
||||
|
||||
#ifdef SMART_DEBUG
|
||||
long SmartLastPrint;
|
||||
|
@ -308,7 +307,7 @@ long SmartLastPrint;
|
|||
void Dispatch(void);
|
||||
void InitProcVectors(void);
|
||||
|
||||
int
|
||||
static int
|
||||
SmartScheduleClient (int *clientReady, int nready)
|
||||
{
|
||||
ClientPtr pClient;
|
||||
|
@ -834,7 +833,7 @@ ProcCirculateWindow(ClientPtr client)
|
|||
return(client->noClientException);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
GetGeometry(ClientPtr client, xGetGeometryReply *rep)
|
||||
{
|
||||
DrawablePtr pDraw;
|
||||
|
@ -1804,8 +1803,6 @@ ProcCopyArea(ClientPtr client)
|
|||
else
|
||||
pSrc = pDst;
|
||||
|
||||
SET_DBE_SRCBUF(pSrc, stuff->srcDrawable);
|
||||
|
||||
pRgn = (*pGC->ops->CopyArea)(pSrc, pDst, pGC, stuff->srcX, stuff->srcY,
|
||||
stuff->width, stuff->height,
|
||||
stuff->dstX, stuff->dstY);
|
||||
|
@ -1848,8 +1845,6 @@ ProcCopyPlane(ClientPtr client)
|
|||
else
|
||||
psrcDraw = pdstDraw;
|
||||
|
||||
SET_DBE_SRCBUF(psrcDraw, stuff->srcDrawable);
|
||||
|
||||
/* Check to see if stuff->bitPlane has exactly ONE good bit set */
|
||||
if(stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) ||
|
||||
(stuff->bitPlane > (1L << (psrcDraw->depth - 1))))
|
||||
|
@ -2157,8 +2152,7 @@ ProcPutImage(ClientPtr client)
|
|||
return (client->noClientException);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
static int
|
||||
DoGetImage(ClientPtr client, int format, Drawable drawable,
|
||||
int x, int y, int width, int height,
|
||||
Mask planemask, xGetImageReply **im_return)
|
||||
|
@ -2210,8 +2204,6 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
|
|||
xgi.visual = None;
|
||||
}
|
||||
|
||||
SET_DBE_SRCBUF(pDraw, drawable);
|
||||
|
||||
xgi.type = X_Reply;
|
||||
xgi.sequenceNumber = client->sequence;
|
||||
xgi.depth = pDraw->depth;
|
||||
|
@ -3383,6 +3375,28 @@ ProcChangeAccessControl(ClientPtr client)
|
|||
return (result);
|
||||
}
|
||||
|
||||
/*********************
|
||||
* CloseDownRetainedResources
|
||||
*
|
||||
* Find all clients that are gone and have terminated in RetainTemporary
|
||||
* and destroy their resources.
|
||||
*********************/
|
||||
|
||||
static void
|
||||
CloseDownRetainedResources(void)
|
||||
{
|
||||
int i;
|
||||
ClientPtr client;
|
||||
|
||||
for (i=1; i<currentMaxClients; i++)
|
||||
{
|
||||
client = clients[i];
|
||||
if (client && (client->closeDownMode == RetainTemporary)
|
||||
&& (client->clientGone))
|
||||
CloseDownClient(client);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
ProcKillClient(ClientPtr client)
|
||||
{
|
||||
|
@ -3653,28 +3667,6 @@ KillAllClients()
|
|||
}
|
||||
}
|
||||
|
||||
/*********************
|
||||
* CloseDownRetainedResources
|
||||
*
|
||||
* Find all clients that are gone and have terminated in RetainTemporary
|
||||
* and destroy their resources.
|
||||
*********************/
|
||||
|
||||
void
|
||||
CloseDownRetainedResources()
|
||||
{
|
||||
int i;
|
||||
ClientPtr client;
|
||||
|
||||
for (i=1; i<currentMaxClients; i++)
|
||||
{
|
||||
client = clients[i];
|
||||
if (client && (client->closeDownMode == RetainTemporary)
|
||||
&& (client->clientGone))
|
||||
CloseDownClient(client);
|
||||
}
|
||||
}
|
||||
|
||||
extern int clientPrivateLen;
|
||||
extern unsigned *clientPrivateSizes;
|
||||
extern unsigned totalClientSize;
|
||||
|
|
|
@ -882,9 +882,7 @@ static CallbackFuncsRec default_cbfuncs =
|
|||
_DeleteCallbackList
|
||||
};
|
||||
|
||||
/* ===== Public Procedures ===== */
|
||||
|
||||
Bool
|
||||
static Bool
|
||||
CreateCallbackList(CallbackListPtr *pcbl, CallbackFuncsPtr cbfuncs)
|
||||
{
|
||||
CallbackListPtr cbl;
|
||||
|
@ -916,6 +914,8 @@ CreateCallbackList(CallbackListPtr *pcbl, CallbackFuncsPtr cbfuncs)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/* ===== Public Procedures ===== */
|
||||
|
||||
_X_EXPORT Bool
|
||||
AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data)
|
||||
{
|
||||
|
|
|
@ -139,7 +139,7 @@ of the copyright holder.
|
|||
|
||||
#ifdef XKB
|
||||
#include <X11/extensions/XKBproto.h>
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
extern Bool XkbFilterEvents(ClientPtr, int, xEvent *);
|
||||
#endif
|
||||
|
||||
|
@ -162,7 +162,7 @@ extern Mask xevieFilters[128];
|
|||
extern int xevieEventSent;
|
||||
extern int xevieKBEventSent;
|
||||
int xeviegrabState = 0;
|
||||
xEvent *xeviexE;
|
||||
static xEvent *xeviexE;
|
||||
#endif
|
||||
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
|
|
@ -66,8 +66,6 @@ SOFTWARE.
|
|||
#define LAST_EVENT 128
|
||||
#define LAST_ERROR 255
|
||||
|
||||
ScreenProcEntry AuxillaryScreenProcs[MAXSCREENS];
|
||||
|
||||
static ExtensionEntry **extensions = (ExtensionEntry **)NULL;
|
||||
|
||||
int lastEvent = EXTENSION_EVENT_BASE;
|
||||
|
@ -298,21 +296,8 @@ CloseDownExtensions()
|
|||
extensions = (ExtensionEntry **)NULL;
|
||||
lastEvent = EXTENSION_EVENT_BASE;
|
||||
lastError = FirstExtensionError;
|
||||
for (i=0; i<MAXSCREENS; i++)
|
||||
{
|
||||
ScreenProcEntry *spentry = &AuxillaryScreenProcs[i];
|
||||
|
||||
while (spentry->num)
|
||||
{
|
||||
spentry->num--;
|
||||
xfree(spentry->procList[spentry->num].name);
|
||||
}
|
||||
xfree(spentry->procList);
|
||||
spentry->procList = (ProcEntryPtr)NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ProcQueryExtension(ClientPtr client)
|
||||
{
|
||||
|
@ -406,72 +391,6 @@ ProcListExtensions(ClientPtr client)
|
|||
return(client->noClientException);
|
||||
}
|
||||
|
||||
|
||||
ExtensionLookupProc
|
||||
LookupProc(char *name, GCPtr pGC)
|
||||
{
|
||||
int i;
|
||||
ScreenProcEntry *spentry;
|
||||
spentry = &AuxillaryScreenProcs[pGC->pScreen->myNum];
|
||||
if (spentry->num)
|
||||
{
|
||||
for (i = 0; i < spentry->num; i++)
|
||||
if (strcmp(name, spentry->procList[i].name) == 0)
|
||||
return(spentry->procList[i].proc);
|
||||
}
|
||||
return (ExtensionLookupProc)NULL;
|
||||
}
|
||||
|
||||
Bool
|
||||
RegisterProc(char *name, GC *pGC, ExtensionLookupProc proc)
|
||||
{
|
||||
return RegisterScreenProc(name, pGC->pScreen, proc);
|
||||
}
|
||||
|
||||
Bool
|
||||
RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc)
|
||||
{
|
||||
ScreenProcEntry *spentry;
|
||||
ProcEntryPtr procEntry = (ProcEntryPtr)NULL;
|
||||
char *newname;
|
||||
int i;
|
||||
|
||||
spentry = &AuxillaryScreenProcs[pScreen->myNum];
|
||||
/* first replace duplicates */
|
||||
if (spentry->num)
|
||||
{
|
||||
for (i = 0; i < spentry->num; i++)
|
||||
if (strcmp(name, spentry->procList[i].name) == 0)
|
||||
{
|
||||
procEntry = &spentry->procList[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (procEntry)
|
||||
procEntry->proc = proc;
|
||||
else
|
||||
{
|
||||
newname = (char *)xalloc(strlen(name)+1);
|
||||
if (!newname)
|
||||
return FALSE;
|
||||
procEntry = (ProcEntryPtr)
|
||||
xrealloc(spentry->procList,
|
||||
sizeof(ProcEntryRec) * (spentry->num+1));
|
||||
if (!procEntry)
|
||||
{
|
||||
xfree(newname);
|
||||
return FALSE;
|
||||
}
|
||||
spentry->procList = procEntry;
|
||||
procEntry += spentry->num;
|
||||
procEntry->name = newname;
|
||||
strcpy(newname, name);
|
||||
procEntry->proc = proc;
|
||||
spentry->num++;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef XSERVER_DTRACE
|
||||
void LoadExtensionNames(char **RequestNames) {
|
||||
int i;
|
||||
|
|
13
dix/gc.c
13
dix/gc.c
|
@ -69,7 +69,7 @@ extern FontPtr defaultFont;
|
|||
|
||||
static Bool CreateDefaultTile(GCPtr pGC);
|
||||
|
||||
unsigned char DefaultDash[2] = {4, 4};
|
||||
static unsigned char DefaultDash[2] = {4, 4};
|
||||
|
||||
_X_EXPORT void
|
||||
ValidateGC(DrawablePtr pDraw, GC *pGC)
|
||||
|
@ -907,17 +907,6 @@ FreeGC(pointer value, XID gid)
|
|||
return(Success);
|
||||
}
|
||||
|
||||
void
|
||||
SetGCMask(GCPtr pGC, Mask selectMask, Mask newDataMask)
|
||||
{
|
||||
pGC->stateChanges = (~selectMask & pGC->stateChanges) |
|
||||
(selectMask & newDataMask);
|
||||
if (selectMask & newDataMask)
|
||||
pGC->serialNumber |= GC_CHANGE_SERIAL_BIT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* CreateScratchGC(pScreen, depth)
|
||||
like CreateGC, but doesn't do the default tile or stipple,
|
||||
since we can't create them without already having a GC. any code
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
#ifdef XKB
|
||||
#include <X11/extensions/XKBproto.h>
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
extern Bool XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -246,7 +246,7 @@ CreateNewResourceClass()
|
|||
return next;
|
||||
}
|
||||
|
||||
ClientResourceRec clientTable[MAXCLIENTS];
|
||||
static ClientResourceRec clientTable[MAXCLIENTS];
|
||||
|
||||
/*****************
|
||||
* InitClientResources
|
||||
|
|
109
dix/swaprep.c
109
dix/swaprep.c
|
@ -317,7 +317,7 @@ SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply *pRep)
|
|||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
SwapTimecoord(xTimecoord* pCoord)
|
||||
{
|
||||
char n;
|
||||
|
@ -584,7 +584,7 @@ SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply *pRep
|
|||
(void)WriteToClient(pClient, size, (char *) pRep);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
SwapRGB(xrgb *prgb)
|
||||
{
|
||||
char n;
|
||||
|
@ -1159,6 +1159,58 @@ SKeymapNotifyEvent(xEvent *from, xEvent *to)
|
|||
*to = *from;
|
||||
}
|
||||
|
||||
static void
|
||||
SwapConnSetup(xConnSetup *pConnSetup, xConnSetup *pConnSetupT)
|
||||
{
|
||||
cpswapl(pConnSetup->release, pConnSetupT->release);
|
||||
cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase);
|
||||
cpswapl(pConnSetup->ridMask, pConnSetupT->ridMask);
|
||||
cpswapl(pConnSetup->motionBufferSize, pConnSetupT->motionBufferSize);
|
||||
cpswaps(pConnSetup->nbytesVendor, pConnSetupT->nbytesVendor);
|
||||
cpswaps(pConnSetup->maxRequestSize, pConnSetupT->maxRequestSize);
|
||||
pConnSetupT->minKeyCode = pConnSetup->minKeyCode;
|
||||
pConnSetupT->maxKeyCode = pConnSetup->maxKeyCode;
|
||||
pConnSetupT->numRoots = pConnSetup->numRoots;
|
||||
pConnSetupT->numFormats = pConnSetup->numFormats;
|
||||
pConnSetupT->imageByteOrder = pConnSetup->imageByteOrder;
|
||||
pConnSetupT->bitmapBitOrder = pConnSetup->bitmapBitOrder;
|
||||
pConnSetupT->bitmapScanlineUnit = pConnSetup->bitmapScanlineUnit;
|
||||
pConnSetupT->bitmapScanlinePad = pConnSetup->bitmapScanlinePad;
|
||||
}
|
||||
|
||||
static void
|
||||
SwapWinRoot(xWindowRoot *pRoot, xWindowRoot *pRootT)
|
||||
{
|
||||
cpswapl(pRoot->windowId, pRootT->windowId);
|
||||
cpswapl(pRoot->defaultColormap, pRootT->defaultColormap);
|
||||
cpswapl(pRoot->whitePixel, pRootT->whitePixel);
|
||||
cpswapl(pRoot->blackPixel, pRootT->blackPixel);
|
||||
cpswapl(pRoot->currentInputMask, pRootT->currentInputMask);
|
||||
cpswaps(pRoot->pixWidth, pRootT->pixWidth);
|
||||
cpswaps(pRoot->pixHeight, pRootT->pixHeight);
|
||||
cpswaps(pRoot->mmWidth, pRootT->mmWidth);
|
||||
cpswaps(pRoot->mmHeight, pRootT->mmHeight);
|
||||
cpswaps(pRoot->minInstalledMaps, pRootT->minInstalledMaps);
|
||||
cpswaps(pRoot->maxInstalledMaps, pRootT->maxInstalledMaps);
|
||||
cpswapl(pRoot->rootVisualID, pRootT->rootVisualID);
|
||||
pRootT->backingStore = pRoot->backingStore;
|
||||
pRootT->saveUnders = pRoot->saveUnders;
|
||||
pRootT->rootDepth = pRoot->rootDepth;
|
||||
pRootT->nDepths = pRoot->nDepths;
|
||||
}
|
||||
|
||||
static void
|
||||
SwapVisual(xVisualType *pVis, xVisualType *pVisT)
|
||||
{
|
||||
cpswapl(pVis->visualID, pVisT->visualID);
|
||||
pVisT->class = pVis->class;
|
||||
pVisT->bitsPerRGB = pVis->bitsPerRGB;
|
||||
cpswaps(pVis->colormapEntries, pVisT->colormapEntries);
|
||||
cpswapl(pVis->redMask, pVisT->redMask);
|
||||
cpswapl(pVis->greenMask, pVisT->greenMask);
|
||||
cpswapl(pVis->blueMask, pVisT->blueMask);
|
||||
}
|
||||
|
||||
_X_EXPORT void
|
||||
SwapConnSetupInfo(
|
||||
char *pInfo,
|
||||
|
@ -1210,7 +1262,6 @@ SwapConnSetupInfo(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
|
||||
{
|
||||
|
@ -1227,58 +1278,6 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
|
|||
DEALLOCATE_LOCAL(pInfoTBase);
|
||||
}
|
||||
|
||||
void
|
||||
SwapConnSetup(xConnSetup *pConnSetup, xConnSetup *pConnSetupT)
|
||||
{
|
||||
cpswapl(pConnSetup->release, pConnSetupT->release);
|
||||
cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase);
|
||||
cpswapl(pConnSetup->ridMask, pConnSetupT->ridMask);
|
||||
cpswapl(pConnSetup->motionBufferSize, pConnSetupT->motionBufferSize);
|
||||
cpswaps(pConnSetup->nbytesVendor, pConnSetupT->nbytesVendor);
|
||||
cpswaps(pConnSetup->maxRequestSize, pConnSetupT->maxRequestSize);
|
||||
pConnSetupT->minKeyCode = pConnSetup->minKeyCode;
|
||||
pConnSetupT->maxKeyCode = pConnSetup->maxKeyCode;
|
||||
pConnSetupT->numRoots = pConnSetup->numRoots;
|
||||
pConnSetupT->numFormats = pConnSetup->numFormats;
|
||||
pConnSetupT->imageByteOrder = pConnSetup->imageByteOrder;
|
||||
pConnSetupT->bitmapBitOrder = pConnSetup->bitmapBitOrder;
|
||||
pConnSetupT->bitmapScanlineUnit = pConnSetup->bitmapScanlineUnit;
|
||||
pConnSetupT->bitmapScanlinePad = pConnSetup->bitmapScanlinePad;
|
||||
}
|
||||
|
||||
void
|
||||
SwapWinRoot(xWindowRoot *pRoot, xWindowRoot *pRootT)
|
||||
{
|
||||
cpswapl(pRoot->windowId, pRootT->windowId);
|
||||
cpswapl(pRoot->defaultColormap, pRootT->defaultColormap);
|
||||
cpswapl(pRoot->whitePixel, pRootT->whitePixel);
|
||||
cpswapl(pRoot->blackPixel, pRootT->blackPixel);
|
||||
cpswapl(pRoot->currentInputMask, pRootT->currentInputMask);
|
||||
cpswaps(pRoot->pixWidth, pRootT->pixWidth);
|
||||
cpswaps(pRoot->pixHeight, pRootT->pixHeight);
|
||||
cpswaps(pRoot->mmWidth, pRootT->mmWidth);
|
||||
cpswaps(pRoot->mmHeight, pRootT->mmHeight);
|
||||
cpswaps(pRoot->minInstalledMaps, pRootT->minInstalledMaps);
|
||||
cpswaps(pRoot->maxInstalledMaps, pRootT->maxInstalledMaps);
|
||||
cpswapl(pRoot->rootVisualID, pRootT->rootVisualID);
|
||||
pRootT->backingStore = pRoot->backingStore;
|
||||
pRootT->saveUnders = pRoot->saveUnders;
|
||||
pRootT->rootDepth = pRoot->rootDepth;
|
||||
pRootT->nDepths = pRoot->nDepths;
|
||||
}
|
||||
|
||||
void
|
||||
SwapVisual(xVisualType *pVis, xVisualType *pVisT)
|
||||
{
|
||||
cpswapl(pVis->visualID, pVisT->visualID);
|
||||
pVisT->class = pVis->class;
|
||||
pVisT->bitsPerRGB = pVis->bitsPerRGB;
|
||||
cpswaps(pVis->colormapEntries, pVisT->colormapEntries);
|
||||
cpswapl(pVis->redMask, pVisT->redMask);
|
||||
cpswapl(pVis->greenMask, pVisT->greenMask);
|
||||
cpswapl(pVis->blueMask, pVisT->blueMask);
|
||||
}
|
||||
|
||||
_X_EXPORT void
|
||||
SwapConnSetupPrefix(xConnSetupPrefix *pcspFrom, xConnSetupPrefix *pcspTo)
|
||||
{
|
||||
|
|
175
dix/window.c
175
dix/window.c
|
@ -307,10 +307,6 @@ SetWindowToDefaults(WindowPtr pWin)
|
|||
pWin->deliverableEvents = 0;
|
||||
pWin->dontPropagate = 0;
|
||||
pWin->forcedBS = FALSE;
|
||||
#ifdef NEED_DBE_BUF_BITS
|
||||
pWin->srcBuffer = DBE_FRONT_BUFFER;
|
||||
pWin->dstBuffer = DBE_FRONT_BUFFER;
|
||||
#endif
|
||||
#ifdef COMPOSITE
|
||||
pWin->redirectDraw = 0;
|
||||
#endif
|
||||
|
@ -557,7 +553,7 @@ InitRootWindow(WindowPtr pWin)
|
|||
* window from which the region came.
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
ClippedRegionFromBox(WindowPtr pWin, RegionPtr Rgn,
|
||||
int x, int y,
|
||||
int w, int h)
|
||||
|
@ -853,6 +849,46 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
|
|||
return pWin;
|
||||
}
|
||||
|
||||
static void
|
||||
DisposeWindowOptional (WindowPtr pWin)
|
||||
{
|
||||
if (!pWin->optional)
|
||||
return;
|
||||
/*
|
||||
* everything is peachy. Delete the optional record
|
||||
* and clean up
|
||||
*/
|
||||
if (pWin->optional->cursor)
|
||||
{
|
||||
FreeCursor (pWin->optional->cursor, (Cursor)0);
|
||||
pWin->cursorIsNone = FALSE;
|
||||
}
|
||||
else
|
||||
pWin->cursorIsNone = TRUE;
|
||||
|
||||
if (pWin->optional->deviceCursors)
|
||||
{
|
||||
DevCursorList pList;
|
||||
DevCursorList pPrev;
|
||||
pList = pWin->optional->deviceCursors;
|
||||
while(pList)
|
||||
{
|
||||
if (pList->cursor)
|
||||
FreeCursor(pList->cursor, (XID)0);
|
||||
pPrev = pList;
|
||||
pList = pList->next;
|
||||
xfree(pPrev);
|
||||
}
|
||||
pWin->optional->deviceCursors = NULL;
|
||||
}
|
||||
|
||||
xfree(pWin->optional->access.perm);
|
||||
xfree(pWin->optional->access.deny);
|
||||
|
||||
xfree (pWin->optional);
|
||||
pWin->optional = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
FreeWindowResources(WindowPtr pWin)
|
||||
{
|
||||
|
@ -2721,6 +2757,30 @@ RealizeTree(WindowPtr pWin)
|
|||
}
|
||||
}
|
||||
|
||||
static WindowPtr windowDisableMapUnmapEvents;
|
||||
|
||||
void
|
||||
DisableMapUnmapEvents(WindowPtr pWin)
|
||||
{
|
||||
assert (windowDisableMapUnmapEvents == NULL);
|
||||
|
||||
windowDisableMapUnmapEvents = pWin;
|
||||
}
|
||||
|
||||
void
|
||||
EnableMapUnmapEvents(WindowPtr pWin)
|
||||
{
|
||||
assert (windowDisableMapUnmapEvents != NULL);
|
||||
|
||||
windowDisableMapUnmapEvents = NULL;
|
||||
}
|
||||
|
||||
static Bool
|
||||
MapUnmapEventsEnabled(WindowPtr pWin)
|
||||
{
|
||||
return pWin != windowDisableMapUnmapEvents;
|
||||
}
|
||||
|
||||
/*****
|
||||
* MapWindow
|
||||
* If some other client has selected SubStructureReDirect on the parent
|
||||
|
@ -3219,21 +3279,6 @@ HandleSaveSet(ClientPtr client)
|
|||
client->saveSet = (SaveSetElt *)NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* \param x,y in root
|
||||
* \param box "return" value
|
||||
*/
|
||||
Bool
|
||||
VisibleBoundingBoxFromPoint(WindowPtr pWin, int x, int y, BoxPtr box)
|
||||
{
|
||||
if (!pWin->realized)
|
||||
return (FALSE);
|
||||
if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->clipList, x, y, box))
|
||||
return(TRUE);
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* \param x,y in root
|
||||
|
@ -3342,30 +3387,6 @@ SendVisibilityNotify(WindowPtr pWin)
|
|||
DeliverEvents(pWin, &event, 1, NullWindow);
|
||||
}
|
||||
|
||||
static WindowPtr windowDisableMapUnmapEvents;
|
||||
|
||||
void
|
||||
DisableMapUnmapEvents(WindowPtr pWin)
|
||||
{
|
||||
assert (windowDisableMapUnmapEvents == NULL);
|
||||
|
||||
windowDisableMapUnmapEvents = pWin;
|
||||
}
|
||||
|
||||
void
|
||||
EnableMapUnmapEvents(WindowPtr pWin)
|
||||
{
|
||||
assert (windowDisableMapUnmapEvents != NULL);
|
||||
|
||||
windowDisableMapUnmapEvents = NULL;
|
||||
}
|
||||
|
||||
Bool
|
||||
MapUnmapEventsEnabled(WindowPtr pWin)
|
||||
{
|
||||
return pWin != windowDisableMapUnmapEvents;
|
||||
}
|
||||
|
||||
#define RANDOM_WIDTH 32
|
||||
|
||||
#ifndef NOLOGOHACK
|
||||
|
@ -3738,61 +3759,6 @@ MakeWindowOptional (WindowPtr pWin)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
DisposeWindowOptional (WindowPtr pWin)
|
||||
{
|
||||
if (!pWin->optional)
|
||||
return;
|
||||
/*
|
||||
* everything is peachy. Delete the optional record
|
||||
* and clean up
|
||||
*/
|
||||
/*
|
||||
* TOG changed this code to:
|
||||
*
|
||||
* if (pWin->cursorIsNone == FALSE)
|
||||
* FreeCursor (pWin->optional->cursor, (Cursor)0);
|
||||
* pWin->cursorIsNone = TRUE;
|
||||
*
|
||||
* This is blatently wrong; windows without optionals can have
|
||||
* two different cursor values, either None or sharing their
|
||||
* parents cursor. This difference is controlled by the
|
||||
* cursorIsNone value; when TRUE, the window has no cursor,
|
||||
* when false, it shares its cursor with its parent; TOG
|
||||
* made it impossible for a window to have a cursor without
|
||||
* an optional record.
|
||||
*/
|
||||
if (pWin->optional->cursor)
|
||||
{
|
||||
FreeCursor (pWin->optional->cursor, (Cursor)0);
|
||||
pWin->cursorIsNone = FALSE;
|
||||
}
|
||||
else
|
||||
pWin->cursorIsNone = TRUE;
|
||||
|
||||
if (pWin->optional->deviceCursors)
|
||||
{
|
||||
DevCursorList pList;
|
||||
DevCursorList pPrev;
|
||||
pList = pWin->optional->deviceCursors;
|
||||
while(pList)
|
||||
{
|
||||
if (pList->cursor)
|
||||
FreeCursor(pList->cursor, (XID)0);
|
||||
pPrev = pList;
|
||||
pList = pList->next;
|
||||
xfree(pPrev);
|
||||
}
|
||||
pWin->optional->deviceCursors = NULL;
|
||||
}
|
||||
|
||||
xfree(pWin->optional->access.perm);
|
||||
xfree(pWin->optional->access.deny);
|
||||
|
||||
xfree (pWin->optional);
|
||||
pWin->optional = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Changes the cursor struct for the given device and the given window.
|
||||
* A cursor that does not have a device cursor set will use whatever the
|
||||
|
@ -3807,9 +3773,10 @@ DisposeWindowOptional (WindowPtr pWin)
|
|||
* Assumption: If there is a node for a device in the list, the device has a
|
||||
* cursor. If the cursor is set to None, it is inherited by the parent.
|
||||
*/
|
||||
int ChangeWindowDeviceCursor(register WindowPtr pWin,
|
||||
DeviceIntPtr pDev,
|
||||
CursorPtr pCursor)
|
||||
_X_EXPORT int
|
||||
ChangeWindowDeviceCursor(WindowPtr pWin,
|
||||
DeviceIntPtr pDev,
|
||||
CursorPtr pCursor)
|
||||
{
|
||||
DevCursNodePtr pNode, pPrev;
|
||||
CursorPtr pOldCursor = NULL;
|
||||
|
@ -3905,7 +3872,8 @@ int ChangeWindowDeviceCursor(register WindowPtr pWin,
|
|||
}
|
||||
|
||||
/* Get device cursor for given device or None if none is set */
|
||||
CursorPtr WindowGetDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev)
|
||||
_X_EXPORT CursorPtr
|
||||
WindowGetDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev)
|
||||
{
|
||||
DevCursorList pList;
|
||||
|
||||
|
@ -4001,7 +3969,6 @@ WindowParentHasDeviceCursor(WindowPtr pWin,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NOLOGOHACK
|
||||
static void
|
||||
DrawLogo(WindowPtr pWin)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user