Move XFree86 DDX XKB actions into dixmods.
This commit is contained in:
parent
d7b9e2b0e9
commit
7257590651
10
ChangeLog
10
ChangeLog
|
@ -20,6 +20,16 @@
|
|||
* xkb/maprules.c:
|
||||
Bug #3819: Remove open-coding of strcasecmp.
|
||||
|
||||
* xkb/ddxVT.c:
|
||||
* xkb/ddxPrivate.c:
|
||||
* xkb/ddxKillSrv.c:
|
||||
* hw/xfree86/dixmods/Makefile.am:
|
||||
* hw/xfree86/dixmods/xkbVT.c:
|
||||
* hw/xfree86/dixmods/xkbPrivate.c:
|
||||
* hw/xfree86/dixmods/xkbKillSrv.c:
|
||||
Move XFree86 DDX actions out of xkb/ and into proper files in their
|
||||
own right in dixmods.
|
||||
|
||||
2006-03-25 Adam Jackson <ajax@freedesktop.org>
|
||||
|
||||
* hw/xfree86/common/xf86Bus.c:
|
||||
|
|
|
@ -101,13 +101,8 @@ libtype1_la_SOURCES = type1mod.c
|
|||
|
||||
libdixmods_la_SOURCES = $(top_srcdir)/mi/miinitext.c
|
||||
|
||||
XKB_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c
|
||||
libxorgxkb_la_SOURCES = $(XKB_SOURCES)
|
||||
libxorgxkb_la_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c
|
||||
|
||||
libxtrap_la_LDFLAGS = -avoid-version
|
||||
libxtrap_la_LIBADD = $(top_builddir)/XTrap/libxtrap.la
|
||||
libxtrap_la_SOURCES = xf86XTrapModule.c
|
||||
|
||||
$(XKB_SOURCES):
|
||||
echo "#define XF86DDXACTIONS" > $@
|
||||
echo "#include \"$(top_srcdir)/xkb/ddx${@:xkb%=%}\"" >> $@
|
||||
|
|
55
hw/xfree86/dixmods/xkbKillSrv.c
Normal file
55
hw/xfree86/dixmods/xkbKillSrv.c
Normal file
|
@ -0,0 +1,55 @@
|
|||
/* $Xorg: ddxKillSrv.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */
|
||||
/************************************************************
|
||||
Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
|
||||
|
||||
Permission to use, copy, modify, and distribute this
|
||||
software and its documentation for any purpose and without
|
||||
fee is hereby granted, provided that the above copyright
|
||||
notice appear in all copies and that both that copyright
|
||||
notice and this permission notice appear in supporting
|
||||
documentation, and that the name of Silicon Graphics not be
|
||||
used in advertising or publicity pertaining to distribution
|
||||
of the software without specific prior written permission.
|
||||
Silicon Graphics makes no representation about the suitability
|
||||
of this software for any purpose. It is provided "as is"
|
||||
without any express or implied warranty.
|
||||
|
||||
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
||||
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
|
||||
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
|
||||
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
|
||||
THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/xkb/ddxKillSrv.c,v 1.3 2002/11/23 19:27:50 tsi Exp $ */
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#define NEED_EVENTS 1
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/keysym.h>
|
||||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
#include "xf86.h"
|
||||
|
||||
int
|
||||
XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act)
|
||||
{
|
||||
xf86ProcessActionEvent(ACTION_TERMINATE, NULL);
|
||||
return 0;
|
||||
}
|
42
hw/xfree86/dixmods/xkbPrivate.c
Normal file
42
hw/xfree86/dixmods/xkbPrivate.c
Normal file
|
@ -0,0 +1,42 @@
|
|||
/* $XFree86: xc/programs/Xserver/xkb/ddxPrivate.c,v 1.2 2003/04/03 16:20:22 dawes Exp $ */
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#define NEED_EVENTS 1
|
||||
#include <X11/X.h>
|
||||
#include "windowstr.h"
|
||||
#define XKBSRV_NEED_FILE_FUNCS
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
|
||||
#include "xf86.h"
|
||||
|
||||
int
|
||||
XkbDDXPrivate(DeviceIntPtr dev,KeyCode key,XkbAction *act)
|
||||
{
|
||||
XkbAnyAction *xf86act = &(act->any);
|
||||
char msgbuf[XkbAnyActionDataSize+1];
|
||||
|
||||
if (xf86act->type == XkbSA_XFree86Private) {
|
||||
memcpy(msgbuf, xf86act->data, XkbAnyActionDataSize);
|
||||
msgbuf[XkbAnyActionDataSize]= '\0';
|
||||
if (_XkbStrCaseCmp(msgbuf, "-vmode")==0)
|
||||
xf86ProcessActionEvent(ACTION_PREV_MODE, NULL);
|
||||
else if (_XkbStrCaseCmp(msgbuf, "+vmode")==0)
|
||||
xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL);
|
||||
else if (_XkbStrCaseCmp(msgbuf, "ungrab")==0)
|
||||
xf86ProcessActionEvent(ACTION_DISABLEGRAB, NULL);
|
||||
else if (_XkbStrCaseCmp(msgbuf, "clsgrb")==0)
|
||||
xf86ProcessActionEvent(ACTION_CLOSECLIENT, NULL);
|
||||
else
|
||||
xf86ProcessActionEvent(ACTION_MESSAGE, (void *) msgbuf);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
67
hw/xfree86/dixmods/xkbVT.c
Normal file
67
hw/xfree86/dixmods/xkbVT.c
Normal file
|
@ -0,0 +1,67 @@
|
|||
/* $Xorg: ddxVT.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */
|
||||
/************************************************************
|
||||
Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
|
||||
|
||||
Permission to use, copy, modify, and distribute this
|
||||
software and its documentation for any purpose and without
|
||||
fee is hereby granted, provided that the above copyright
|
||||
notice appear in all copies and that both that copyright
|
||||
notice and this permission notice appear in supporting
|
||||
documentation, and that the name of Silicon Graphics not be
|
||||
used in advertising or publicity pertaining to distribution
|
||||
of the software without specific prior written permission.
|
||||
Silicon Graphics makes no representation about the suitability
|
||||
of this software for any purpose. It is provided "as is"
|
||||
without any express or implied warranty.
|
||||
|
||||
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
||||
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
|
||||
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
|
||||
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
|
||||
THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/xkb/ddxVT.c,v 1.3 2002/11/23 19:27:50 tsi Exp $ */
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#define NEED_EVENTS 1
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/keysym.h>
|
||||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
#include "xf86.h"
|
||||
|
||||
int
|
||||
XkbDDXSwitchScreen(DeviceIntPtr dev,KeyCode key,XkbAction *act)
|
||||
{
|
||||
int scrnnum = XkbSAScreen(&act->screen);
|
||||
|
||||
if (act->screen.flags & XkbSA_SwitchApplication) {
|
||||
if (act->screen.flags & XkbSA_SwitchAbsolute)
|
||||
xf86ProcessActionEvent(ACTION_SWITCHSCREEN,(void *) &scrnnum);
|
||||
else {
|
||||
if (scrnnum < 0)
|
||||
xf86ProcessActionEvent(ACTION_SWITCHSCREEN_PREV,NULL);
|
||||
else
|
||||
xf86ProcessActionEvent(ACTION_SWITCHSCREEN_NEXT,NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
|
@ -45,17 +45,9 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
#ifdef XF86DDXACTIONS
|
||||
#include "xf86.h"
|
||||
#endif
|
||||
|
||||
int
|
||||
XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act)
|
||||
{
|
||||
#ifdef XF86DDXACTIONS
|
||||
xf86ProcessActionEvent(ACTION_TERMINATE, NULL);
|
||||
#else
|
||||
GiveUp(1);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -15,32 +15,8 @@
|
|||
#define XKBSRV_NEED_FILE_FUNCS
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
|
||||
#ifdef XF86DDXACTIONS
|
||||
#include "xf86.h"
|
||||
#endif
|
||||
|
||||
int
|
||||
XkbDDXPrivate(DeviceIntPtr dev,KeyCode key,XkbAction *act)
|
||||
{
|
||||
#ifdef XF86DDXACTIONS
|
||||
XkbAnyAction *xf86act = &(act->any);
|
||||
char msgbuf[XkbAnyActionDataSize+1];
|
||||
|
||||
if (xf86act->type == XkbSA_XFree86Private) {
|
||||
memcpy(msgbuf, xf86act->data, XkbAnyActionDataSize);
|
||||
msgbuf[XkbAnyActionDataSize]= '\0';
|
||||
if (_XkbStrCaseCmp(msgbuf, "-vmode")==0)
|
||||
xf86ProcessActionEvent(ACTION_PREV_MODE, NULL);
|
||||
else if (_XkbStrCaseCmp(msgbuf, "+vmode")==0)
|
||||
xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL);
|
||||
else if (_XkbStrCaseCmp(msgbuf, "ungrab")==0)
|
||||
xf86ProcessActionEvent(ACTION_DISABLEGRAB, NULL);
|
||||
else if (_XkbStrCaseCmp(msgbuf, "clsgrb")==0)
|
||||
xf86ProcessActionEvent(ACTION_CLOSECLIENT, NULL);
|
||||
else
|
||||
xf86ProcessActionEvent(ACTION_MESSAGE, (void *) msgbuf);
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
20
xkb/ddxVT.c
20
xkb/ddxVT.c
|
@ -45,28 +45,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
#ifdef XF86DDXACTIONS
|
||||
#include "xf86.h"
|
||||
#endif
|
||||
|
||||
int
|
||||
XkbDDXSwitchScreen(DeviceIntPtr dev,KeyCode key,XkbAction *act)
|
||||
{
|
||||
#ifdef XF86DDXACTIONS
|
||||
{
|
||||
int scrnnum = XkbSAScreen(&act->screen);
|
||||
|
||||
if (act->screen.flags & XkbSA_SwitchApplication) {
|
||||
if (act->screen.flags & XkbSA_SwitchAbsolute)
|
||||
xf86ProcessActionEvent(ACTION_SWITCHSCREEN,(void *) &scrnnum);
|
||||
else {
|
||||
if (scrnnum < 0)
|
||||
xf86ProcessActionEvent(ACTION_SWITCHSCREEN_PREV,NULL);
|
||||
else
|
||||
xf86ProcessActionEvent(ACTION_SWITCHSCREEN_NEXT,NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user