From 7257590651328f89d23e80da1ec6241542a660cd Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 27 Mar 2006 21:15:06 +0000 Subject: Move XFree86 DDX XKB actions into dixmods. --- ChangeLog | 10 ++++++ hw/xfree86/dixmods/Makefile.am | 7 +---- hw/xfree86/dixmods/xkbKillSrv.c | 55 +++++++++++++++++++++++++++++++++ hw/xfree86/dixmods/xkbPrivate.c | 42 ++++++++++++++++++++++++++ hw/xfree86/dixmods/xkbVT.c | 67 +++++++++++++++++++++++++++++++++++++++++ xkb/ddxKillSrv.c | 8 ----- xkb/ddxPrivate.c | 24 --------------- xkb/ddxVT.c | 20 ------------ 8 files changed, 175 insertions(+), 58 deletions(-) create mode 100644 hw/xfree86/dixmods/xkbKillSrv.c create mode 100644 hw/xfree86/dixmods/xkbPrivate.c create mode 100644 hw/xfree86/dixmods/xkbVT.c diff --git a/ChangeLog b/ChangeLog index 83ac158e5..dd2235b82 100644 --- a/ChangeLog +++ b/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 * hw/xfree86/common/xf86Bus.c: diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am index 5162ee18b..7b6afc4db 100644 --- a/hw/xfree86/dixmods/Makefile.am +++ b/hw/xfree86/dixmods/Makefile.am @@ -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%=%}\"" >> $@ diff --git a/hw/xfree86/dixmods/xkbKillSrv.c b/hw/xfree86/dixmods/xkbKillSrv.c new file mode 100644 index 000000000..ee19454b0 --- /dev/null +++ b/hw/xfree86/dixmods/xkbKillSrv.c @@ -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 +#endif + +#ifdef HAVE_XORG_CONFIG_H +#include +#endif + +#include +#define NEED_EVENTS 1 +#include +#include +#include +#include "inputstr.h" +#include "scrnintstr.h" +#include "windowstr.h" +#include +#include + +#include "xf86.h" + +int +XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act) +{ + xf86ProcessActionEvent(ACTION_TERMINATE, NULL); + return 0; +} diff --git a/hw/xfree86/dixmods/xkbPrivate.c b/hw/xfree86/dixmods/xkbPrivate.c new file mode 100644 index 000000000..b632ecb89 --- /dev/null +++ b/hw/xfree86/dixmods/xkbPrivate.c @@ -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 +#endif + +#ifdef HAVE_XORG_CONFIG_H +#include +#endif + +#include +#define NEED_EVENTS 1 +#include +#include "windowstr.h" +#define XKBSRV_NEED_FILE_FUNCS +#include + +#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; +} diff --git a/hw/xfree86/dixmods/xkbVT.c b/hw/xfree86/dixmods/xkbVT.c new file mode 100644 index 000000000..c637d5545 --- /dev/null +++ b/hw/xfree86/dixmods/xkbVT.c @@ -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 +#endif + +#ifdef HAVE_XORG_CONFIG_H +#include +#endif + +#include +#define NEED_EVENTS 1 +#include +#include +#include +#include "inputstr.h" +#include "scrnintstr.h" +#include "windowstr.h" +#include +#include + +#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; +} diff --git a/xkb/ddxKillSrv.c b/xkb/ddxKillSrv.c index ee0acb028..740268eb9 100644 --- a/xkb/ddxKillSrv.c +++ b/xkb/ddxKillSrv.c @@ -45,17 +45,9 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#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; } diff --git a/xkb/ddxPrivate.c b/xkb/ddxPrivate.c index 5c0bca4cd..f4d3c5db4 100644 --- a/xkb/ddxPrivate.c +++ b/xkb/ddxPrivate.c @@ -15,32 +15,8 @@ #define XKBSRV_NEED_FILE_FUNCS #include -#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; } - diff --git a/xkb/ddxVT.c b/xkb/ddxVT.c index 1b7853fa0..922b2c65f 100644 --- a/xkb/ddxVT.c +++ b/xkb/ddxVT.c @@ -45,28 +45,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#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; } -- cgit v1.2.3