Static markup and dead code cull over xkb/.
The former <X11/extensions/XKBsrv.h> has been pulled into the server now as include/xkbsrv.h, and the world updated to look for it in the new place, since it made no sense to define server API in an extension header. Any further work along this line will need to do similar things with XKBgeom.h and friends.
This commit is contained in:
parent
9398d62f27
commit
021fc5cb2c
|
@ -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"
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ SOFTWARE.
|
|||
#define XKB_IN_SERVER
|
||||
#endif
|
||||
#ifdef XKB
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#endif
|
||||
#include "xace.h"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -133,7 +133,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
|
||||
|
||||
|
|
|
@ -44,7 +44,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
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ typedef XID KeySym64;
|
|||
#undef KeySym
|
||||
#endif
|
||||
|
||||
/* These are in exglobals.h, but that conflicts with X11/extensions/XKBsrv.h */
|
||||
/* These are in exglobals.h, but that conflicts with xkbsrv.h */
|
||||
extern int ProximityIn;
|
||||
extern int ProximityOut;
|
||||
extern int DeviceValuator;
|
||||
|
@ -144,7 +144,7 @@ extern int ChangeDeviceNotify;
|
|||
#ifndef XKB_IN_SERVER
|
||||
#define XKB_IN_SERVER
|
||||
#endif
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#undef XPointer
|
||||
#endif
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef XKB
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#endif
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
|
|
|
@ -75,7 +75,7 @@ extern DeviceAssocRec mouse_assoc;
|
|||
#ifdef XKB
|
||||
#undef XKB_IN_SERVER
|
||||
#define XKB_IN_SERVER
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#endif
|
||||
|
||||
#ifdef RENDER
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include "servermd.h"
|
||||
#include "micmap.h"
|
||||
#ifdef XKB
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#endif
|
||||
#include "xf86Xinput.h"
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#define XF86_OS_PRIVS
|
||||
#include "xf86_OSlib.h"
|
||||
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
|
||||
void
|
||||
xf86InitXkb(void)
|
||||
|
|
|
@ -40,7 +40,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
#include "xf86.h"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include <X11/X.h>
|
||||
#include "windowstr.h"
|
||||
#define XKBSRV_NEED_FILE_FUNCS
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
|
||||
#include "xf86.h"
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
#include "xf86.h"
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
#endif
|
||||
#include "selection.h"
|
||||
#ifdef XKB
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
extern int XkbDfltRepeatDelay, XkbDfltRepeatInterval;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
#ifdef XKB
|
||||
#define XKB_IN_SERVER
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#endif
|
||||
|
||||
static DeviceIntPtr pKdKeyboard, pKdPointer;
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
#ifdef XKB
|
||||
#include <X11/extensions/XKB.h>
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XKBconfig.h>
|
||||
|
||||
extern Bool
|
||||
|
|
|
@ -36,7 +36,7 @@ is" without express or implied warranty.
|
|||
|
||||
#ifdef XKB
|
||||
#include <X11/extensions/XKB.h>
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XKBconfig.h>
|
||||
|
||||
extern Bool
|
||||
|
|
|
@ -44,7 +44,7 @@ from The Open Group.
|
|||
#include <mntent.h>
|
||||
#endif
|
||||
#if defined(XKB) && defined(WIN32)
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#endif
|
||||
#ifdef RELOCATE_PROJECTROOT
|
||||
#include <shlobj.h>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#ifndef XKB_IN_SERVER
|
||||
#define XKB_IN_SERVER
|
||||
#endif
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#endif
|
||||
|
||||
#ifdef XWIN_XF86CONFIG
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#ifndef XKB_IN_SERVER
|
||||
#define XKB_IN_SERVER
|
||||
#endif
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#endif
|
||||
|
||||
static Bool g_winKeyState[NUM_KEYCODES];
|
||||
|
|
1022
include/xkbsrv.h
Normal file
1022
include/xkbsrv.h
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -117,7 +117,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#endif
|
||||
|
||||
#ifdef XKB
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#endif
|
||||
#ifdef XCSECURITY
|
||||
#include "securitysrv.h"
|
||||
|
|
|
@ -41,7 +41,8 @@ X11_SRCS = \
|
|||
XKBGAlloc.c \
|
||||
XKBMAlloc.c
|
||||
|
||||
XI_SRCS = xkbPrOtherEv.c
|
||||
# ends up unused...
|
||||
# XI_SRCS = xkbPrOtherEv.c
|
||||
|
||||
libxkb_la_SOURCES = $(DDX_SRCS) $(DIX_SRCS) $(XI_SRCS) $(XKBFILE_SRCS) \
|
||||
$(X11_SRCS)
|
||||
|
|
157
xkb/XKBAlloc.c
157
xkb/XKBAlloc.c
|
@ -35,7 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/Xproto.h>
|
||||
#include "misc.h"
|
||||
#include "inputstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XKBgeom.h>
|
||||
|
||||
/***===================================================================***/
|
||||
|
@ -259,7 +259,7 @@ XkbAllocControls(XkbDescPtr xkb,unsigned which)
|
|||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
static void
|
||||
XkbFreeControls(XkbDescPtr xkb,unsigned which,Bool freeMap)
|
||||
{
|
||||
if (freeMap && (xkb!=NULL) && (xkb->ctrls!=NULL)) {
|
||||
|
@ -284,7 +284,7 @@ XkbAllocIndicatorMaps(XkbDescPtr xkb)
|
|||
return Success;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
XkbFreeIndicatorMaps(XkbDescPtr xkb)
|
||||
{
|
||||
if ((xkb!=NULL)&&(xkb->indicators!=NULL)) {
|
||||
|
@ -335,154 +335,3 @@ XkbFreeKeyboard(XkbDescPtr xkb,unsigned which,Bool freeAll)
|
|||
_XkbFree(xkb);
|
||||
return;
|
||||
}
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
XkbDeviceLedInfoPtr
|
||||
XkbAddDeviceLedInfo(XkbDeviceInfoPtr devi,unsigned ledClass,unsigned ledId)
|
||||
{
|
||||
XkbDeviceLedInfoPtr devli;
|
||||
register int i;
|
||||
|
||||
if ((!devi)||(!XkbSingleXIClass(ledClass))||(!XkbSingleXIId(ledId)))
|
||||
return NULL;
|
||||
for (i=0,devli=devi->leds;i<devi->num_leds;i++,devli++) {
|
||||
if ((devli->led_class==ledClass)&&(devli->led_id==ledId))
|
||||
return devli;
|
||||
}
|
||||
if (devi->num_leds>=devi->sz_leds) {
|
||||
XkbDeviceLedInfoRec *prev_leds = devi->leds;
|
||||
|
||||
if (devi->sz_leds>0) devi->sz_leds*= 2;
|
||||
else devi->sz_leds= 1;
|
||||
devi->leds= _XkbTypedRealloc(devi->leds,devi->sz_leds,
|
||||
XkbDeviceLedInfoRec);
|
||||
if (!devi->leds) {
|
||||
_XkbFree(prev_leds);
|
||||
devi->sz_leds= devi->num_leds= 0;
|
||||
return NULL;
|
||||
}
|
||||
i= devi->num_leds;
|
||||
for (devli=&devi->leds[i];i<devi->sz_leds;i++,devli++) {
|
||||
bzero(devli,sizeof(XkbDeviceLedInfoRec));
|
||||
devli->led_class= XkbXINone;
|
||||
devli->led_id= XkbXINone;
|
||||
}
|
||||
}
|
||||
devli= &devi->leds[devi->num_leds++];
|
||||
bzero(devli,sizeof(XkbDeviceLedInfoRec));
|
||||
devli->led_class= ledClass;
|
||||
devli->led_id= ledId;
|
||||
return devli;
|
||||
}
|
||||
|
||||
Status
|
||||
XkbResizeDeviceButtonActions(XkbDeviceInfoPtr devi,unsigned newTotal)
|
||||
{
|
||||
XkbAction *prev_btn_acts;
|
||||
|
||||
if ((!devi)||(newTotal>255))
|
||||
return BadValue;
|
||||
if ((devi->btn_acts!=NULL)&&(newTotal==devi->num_btns))
|
||||
return Success;
|
||||
if (newTotal==0) {
|
||||
if (devi->btn_acts!=NULL) {
|
||||
_XkbFree(devi->btn_acts);
|
||||
devi->btn_acts= NULL;
|
||||
}
|
||||
devi->num_btns= 0;
|
||||
return Success;
|
||||
}
|
||||
prev_btn_acts = devi->btn_acts;
|
||||
devi->btn_acts= _XkbTypedRealloc(devi->btn_acts,newTotal,XkbAction);
|
||||
if (devi->btn_acts==NULL) {
|
||||
_XkbFree(prev_btn_acts);
|
||||
devi->num_btns= 0;
|
||||
return BadAlloc;
|
||||
}
|
||||
if (newTotal>devi->num_btns) {
|
||||
XkbAction *act;
|
||||
act= &devi->btn_acts[devi->num_btns];
|
||||
bzero((char *)act,(newTotal-devi->num_btns)*sizeof(XkbAction));
|
||||
}
|
||||
devi->num_btns= newTotal;
|
||||
return Success;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
XkbDeviceInfoPtr
|
||||
XkbAllocDeviceInfo(unsigned deviceSpec,unsigned nButtons,unsigned szLeds)
|
||||
{
|
||||
XkbDeviceInfoPtr devi;
|
||||
|
||||
devi= _XkbTypedCalloc(1,XkbDeviceInfoRec);
|
||||
if (devi!=NULL) {
|
||||
devi->device_spec= deviceSpec;
|
||||
devi->has_own_state= False;
|
||||
devi->num_btns= 0;
|
||||
devi->btn_acts= NULL;
|
||||
if (nButtons>0) {
|
||||
devi->num_btns= nButtons;
|
||||
devi->btn_acts= _XkbTypedCalloc(nButtons,XkbAction);
|
||||
if (!devi->btn_acts) {
|
||||
_XkbFree(devi);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
devi->dflt_kbd_fb= XkbXINone;
|
||||
devi->dflt_led_fb= XkbXINone;
|
||||
devi->num_leds= 0;
|
||||
devi->sz_leds= 0;
|
||||
devi->leds= NULL;
|
||||
if (szLeds>0) {
|
||||
devi->sz_leds= szLeds;
|
||||
devi->leds= _XkbTypedCalloc(szLeds,XkbDeviceLedInfoRec);
|
||||
if (!devi->leds) {
|
||||
if (devi->btn_acts)
|
||||
_XkbFree(devi->btn_acts);
|
||||
_XkbFree(devi);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return devi;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
XkbFreeDeviceInfo(XkbDeviceInfoPtr devi,unsigned which,Bool freeDevI)
|
||||
{
|
||||
if (devi) {
|
||||
if (freeDevI) {
|
||||
which= XkbXI_AllDeviceFeaturesMask;
|
||||
if (devi->name) {
|
||||
_XkbFree(devi->name);
|
||||
devi->name= NULL;
|
||||
}
|
||||
}
|
||||
if ((which&XkbXI_ButtonActionsMask)&&(devi->btn_acts)) {
|
||||
_XkbFree(devi->btn_acts);
|
||||
devi->num_btns= 0;
|
||||
devi->btn_acts= NULL;
|
||||
}
|
||||
if ((which&XkbXI_IndicatorsMask)&&(devi->leds)) {
|
||||
register int i;
|
||||
if ((which&XkbXI_IndicatorsMask)==XkbXI_IndicatorsMask) {
|
||||
_XkbFree(devi->leds);
|
||||
devi->sz_leds= devi->num_leds= 0;
|
||||
devi->leds= NULL;
|
||||
}
|
||||
else {
|
||||
XkbDeviceLedInfoPtr devli;
|
||||
for (i=0,devli=devi->leds;i<devi->num_leds;i++,devli++) {
|
||||
if (which&XkbXI_IndicatorMapsMask)
|
||||
bzero((char *)&devli->maps[0],sizeof(devli->maps));
|
||||
else bzero((char *)&devli->names[0],sizeof(devli->names));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (freeDevI)
|
||||
_XkbFree(devi);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/Xproto.h>
|
||||
#include "misc.h"
|
||||
#include "inputstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XKBgeom.h>
|
||||
|
||||
#ifdef X_NOT_POSIX
|
||||
|
|
|
@ -39,7 +39,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
#include <X11/keysym.h>
|
||||
#define XKBSRV_NEED_FILE_FUNCS
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
|
@ -220,7 +220,7 @@ XkbServerMapPtr map;
|
|||
|
||||
/***====================================================================***/
|
||||
|
||||
Status
|
||||
static Status
|
||||
XkbCopyKeyType(XkbKeyTypePtr from,XkbKeyTypePtr into)
|
||||
{
|
||||
if ((!from)||(!into))
|
||||
|
@ -275,82 +275,6 @@ register int i,rtrn;
|
|||
return Success;
|
||||
}
|
||||
|
||||
XkbKeyTypePtr
|
||||
XkbAddKeyType( XkbDescPtr xkb,
|
||||
Atom name,
|
||||
int map_count,
|
||||
Bool want_preserve,
|
||||
int num_lvls)
|
||||
{
|
||||
register int i;
|
||||
unsigned tmp;
|
||||
XkbKeyTypePtr type;
|
||||
XkbClientMapPtr map;
|
||||
|
||||
if ((!xkb)||(num_lvls<1))
|
||||
return NULL;
|
||||
map= xkb->map;
|
||||
if ((map)&&(map->types)) {
|
||||
for (i=0;i<map->num_types;i++) {
|
||||
if (map->types[i].name==name) {
|
||||
Status status;
|
||||
status=XkbResizeKeyType(xkb,i,map_count,want_preserve,num_lvls);
|
||||
return (status==Success?&map->types[i]:NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((!map)||(!map->types)||(!map->num_types<XkbNumRequiredTypes)) {
|
||||
tmp= XkbNumRequiredTypes+1;
|
||||
if (XkbAllocClientMap(xkb,XkbKeyTypesMask,tmp)!=Success)
|
||||
return NULL;
|
||||
map = xkb->map;
|
||||
tmp= 0;
|
||||
if (map->num_types<=XkbKeypadIndex)
|
||||
tmp|= XkbKeypadMask;
|
||||
if (map->num_types<=XkbAlphabeticIndex)
|
||||
tmp|= XkbAlphabeticMask;
|
||||
if (map->num_types<=XkbTwoLevelIndex)
|
||||
tmp|= XkbTwoLevelMask;
|
||||
if (map->num_types<=XkbOneLevelIndex)
|
||||
tmp|= XkbOneLevelMask;
|
||||
if (XkbInitCanonicalKeyTypes(xkb,tmp,XkbNoModifier)==Success) {
|
||||
for (i=0;i<map->num_types;i++) {
|
||||
Status status;
|
||||
if (map->types[i].name!=name)
|
||||
continue;
|
||||
status=XkbResizeKeyType(xkb,i,map_count,want_preserve,num_lvls);
|
||||
return (status==Success?&map->types[i]:NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((map->num_types<=map->size_types)&&
|
||||
(XkbAllocClientMap(xkb,XkbKeyTypesMask,map->num_types+1)!=Success)) {
|
||||
return NULL;
|
||||
}
|
||||
type= &map->types[map->num_types];
|
||||
map->num_types++;
|
||||
bzero((char *)type,sizeof(XkbKeyTypeRec));
|
||||
type->num_levels= num_lvls;
|
||||
type->map_count= map_count;
|
||||
type->name= name;
|
||||
if (map_count>0) {
|
||||
type->map= _XkbTypedCalloc(map_count,XkbKTMapEntryRec);
|
||||
if (!type->map) {
|
||||
map->num_types--;
|
||||
return NULL;
|
||||
}
|
||||
if (want_preserve) {
|
||||
type->preserve= _XkbTypedCalloc(map_count,XkbModsRec);
|
||||
if (!type->preserve) {
|
||||
_XkbFree(type->map);
|
||||
map->num_types--;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
Status
|
||||
XkbResizeKeyType( XkbDescPtr xkb,
|
||||
int type_ndx,
|
||||
|
|
183
xkb/XKBMisc.c
183
xkb/XKBMisc.c
|
@ -39,102 +39,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
#include <X11/keysym.h>
|
||||
#define XKBSRV_NEED_FILE_FUNCS
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
#define mapSize(m) (sizeof(m)/sizeof(XkbKTMapEntryRec))
|
||||
static XkbKTMapEntryRec map2Level[]= {
|
||||
{ True, ShiftMask, {1, ShiftMask, 0} }
|
||||
};
|
||||
|
||||
static XkbKTMapEntryRec mapAlpha[]= {
|
||||
{ True, ShiftMask, { 1, ShiftMask, 0 } },
|
||||
{ True, LockMask, { 0, LockMask, 0 } }
|
||||
};
|
||||
|
||||
static XkbModsRec preAlpha[]= {
|
||||
{ 0, 0, 0 },
|
||||
{ LockMask, LockMask, 0 }
|
||||
};
|
||||
|
||||
#define NL_VMOD_MASK 0
|
||||
static XkbKTMapEntryRec mapKeypad[]= {
|
||||
{ True, ShiftMask, { 1, ShiftMask, 0 } },
|
||||
{ False, 0, { 1, 0, NL_VMOD_MASK } }
|
||||
};
|
||||
|
||||
static XkbKeyTypeRec canonicalTypes[XkbNumRequiredTypes] = {
|
||||
{ { 0, 0, 0 },
|
||||
1, /* num_levels */
|
||||
0, /* map_count */
|
||||
NULL, NULL,
|
||||
None, NULL
|
||||
},
|
||||
{ { ShiftMask, ShiftMask, 0 },
|
||||
2, /* num_levels */
|
||||
mapSize(map2Level), /* map_count */
|
||||
map2Level, NULL,
|
||||
None, NULL
|
||||
},
|
||||
{ { ShiftMask|LockMask, ShiftMask|LockMask, 0 },
|
||||
2, /* num_levels */
|
||||
mapSize(mapAlpha), /* map_count */
|
||||
mapAlpha, preAlpha,
|
||||
None, NULL
|
||||
},
|
||||
{ { ShiftMask, ShiftMask, NL_VMOD_MASK },
|
||||
2, /* num_levels */
|
||||
mapSize(mapKeypad), /* map_count */
|
||||
mapKeypad, NULL,
|
||||
None, NULL
|
||||
}
|
||||
};
|
||||
|
||||
Status
|
||||
XkbInitCanonicalKeyTypes(XkbDescPtr xkb,unsigned which,int keypadVMod)
|
||||
{
|
||||
XkbClientMapPtr map;
|
||||
XkbKeyTypePtr from,to;
|
||||
Status rtrn;
|
||||
|
||||
if (!xkb)
|
||||
return BadMatch;
|
||||
rtrn= XkbAllocClientMap(xkb,XkbKeyTypesMask,XkbNumRequiredTypes);
|
||||
if (rtrn!=Success)
|
||||
return rtrn;
|
||||
map= xkb->map;
|
||||
if ((which&XkbAllRequiredTypes)==0)
|
||||
return Success;
|
||||
rtrn= Success;
|
||||
from= canonicalTypes;
|
||||
to= map->types;
|
||||
if (which&XkbOneLevelMask)
|
||||
rtrn= XkbCopyKeyType(&from[XkbOneLevelIndex],&to[XkbOneLevelIndex]);
|
||||
if ((which&XkbTwoLevelMask)&&(rtrn==Success))
|
||||
rtrn= XkbCopyKeyType(&from[XkbTwoLevelIndex],&to[XkbTwoLevelIndex]);
|
||||
if ((which&XkbAlphabeticMask)&&(rtrn==Success))
|
||||
rtrn= XkbCopyKeyType(&from[XkbAlphabeticIndex],&to[XkbAlphabeticIndex]);
|
||||
if ((which&XkbKeypadMask)&&(rtrn==Success)) {
|
||||
XkbKeyTypePtr type;
|
||||
rtrn= XkbCopyKeyType(&from[XkbKeypadIndex],&to[XkbKeypadIndex]);
|
||||
type= &to[XkbKeypadIndex];
|
||||
if ((keypadVMod>=0)&&(keypadVMod<XkbNumVirtualMods)&&(rtrn==Success)) {
|
||||
type->mods.vmods= (1<<keypadVMod);
|
||||
type->map[0].active= True;
|
||||
type->map[0].mods.mask= ShiftMask;
|
||||
type->map[0].mods.real_mods= ShiftMask;
|
||||
type->map[0].mods.vmods= 0;
|
||||
type->map[0].level= 1;
|
||||
type->map[1].active= False;
|
||||
type->map[1].mods.mask= 0;
|
||||
type->map[1].mods.real_mods= 0;
|
||||
type->map[1].mods.vmods= (1<<keypadVMod);
|
||||
type->map[1].level= 1;
|
||||
}
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
#include <xkbsrv.h>
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
|
@ -558,88 +463,6 @@ unsigned changed,tmp;
|
|||
return True;
|
||||
}
|
||||
|
||||
Bool
|
||||
XkbUpdateMapFromCore( XkbDescPtr xkb,
|
||||
KeyCode first_key,
|
||||
int num_keys,
|
||||
int map_width,
|
||||
KeySym * core_keysyms,
|
||||
XkbChangesPtr changes)
|
||||
{
|
||||
register int key,last_key;
|
||||
KeySym * syms;
|
||||
|
||||
syms= &core_keysyms[(first_key-xkb->min_key_code)*map_width];
|
||||
if (changes) {
|
||||
if (changes->map.changed&XkbKeySymsMask) {
|
||||
_XkbAddKeyChange(&changes->map.first_key_sym,
|
||||
&changes->map.num_key_syms,first_key);
|
||||
if (num_keys>1) {
|
||||
_XkbAddKeyChange(&changes->map.first_key_sym,
|
||||
&changes->map.num_key_syms,
|
||||
first_key+num_keys-1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
changes->map.changed|= XkbKeySymsMask;
|
||||
changes->map.first_key_sym= first_key;
|
||||
changes->map.num_key_syms= num_keys;
|
||||
}
|
||||
}
|
||||
last_key= first_key+num_keys-1;
|
||||
for (key=first_key;key<=last_key;key++,syms+= map_width) {
|
||||
XkbMapChangesPtr mc;
|
||||
unsigned explicit;
|
||||
KeySym tsyms[XkbMaxSymsPerKey];
|
||||
int types[XkbNumKbdGroups];
|
||||
int nG;
|
||||
|
||||
explicit= xkb->server->explicit[key]&XkbExplicitKeyTypesMask;
|
||||
types[XkbGroup1Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup1Index);
|
||||
types[XkbGroup2Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup2Index);
|
||||
types[XkbGroup3Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup3Index);
|
||||
types[XkbGroup4Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup4Index);
|
||||
nG= XkbKeyTypesForCoreSymbols(xkb,map_width,syms,explicit,types,tsyms);
|
||||
if (changes)
|
||||
mc= &changes->map;
|
||||
else mc= NULL;
|
||||
XkbChangeTypesOfKey(xkb,key,nG,XkbAllGroupsMask,types,mc);
|
||||
memcpy((char *)XkbKeySymsPtr(xkb,key),(char *)tsyms,
|
||||
XkbKeyNumSyms(xkb,key)*sizeof(KeySym));
|
||||
XkbApplyCompatMapToKey(xkb,key,changes);
|
||||
}
|
||||
|
||||
if ((xkb->server->vmods!=NULL)&&(xkb->map->modmap!=NULL)&&(changes)&&
|
||||
(changes->map.changed&(XkbVirtualModMapMask|XkbModifierMapMask))) {
|
||||
unsigned char newVMods[XkbNumVirtualMods];
|
||||
register unsigned bit,i;
|
||||
unsigned present;
|
||||
|
||||
bzero(newVMods,XkbNumVirtualMods);
|
||||
present= 0;
|
||||
for (key=xkb->min_key_code;key<=xkb->max_key_code;key++) {
|
||||
if (xkb->server->vmodmap[key]==0)
|
||||
continue;
|
||||
for (i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
|
||||
if (bit&xkb->server->vmodmap[key]) {
|
||||
present|= bit;
|
||||
newVMods[i]|= xkb->map->modmap[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
|
||||
if ((bit&present)&&(newVMods[i]!=xkb->server->vmods[i])) {
|
||||
changes->map.changed|= XkbVirtualModsMask;
|
||||
changes->map.vmods|= bit;
|
||||
xkb->server->vmods[i]= newVMods[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changes && (changes->map.changed&XkbVirtualModsMask))
|
||||
XkbApplyVirtualModChanges(xkb,changes->map.vmods,changes);
|
||||
return True;
|
||||
}
|
||||
|
||||
Status
|
||||
XkbChangeTypesOfKey( XkbDescPtr xkb,
|
||||
int key,
|
||||
|
@ -788,7 +611,7 @@ register unsigned mask;
|
|||
|
||||
/***====================================================================***/
|
||||
|
||||
Bool
|
||||
static Bool
|
||||
XkbUpdateActionVirtualMods(XkbDescPtr xkb,XkbAction *act,unsigned changed)
|
||||
{
|
||||
unsigned int tmp;
|
||||
|
@ -814,7 +637,7 @@ unsigned int tmp;
|
|||
return False;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
XkbUpdateKeyTypeVirtualMods( XkbDescPtr xkb,
|
||||
XkbKeyTypePtr type,
|
||||
unsigned int changed,
|
||||
|
|
|
@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
/*#define FALLING_TONE 1*/
|
||||
|
|
|
@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
void
|
||||
|
|
|
@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
void
|
||||
|
|
|
@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
#ifdef PANORAMIX
|
||||
|
|
|
@ -37,7 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
int
|
||||
|
|
|
@ -37,7 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
void
|
||||
|
|
|
@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
|
||||
int
|
||||
XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act)
|
||||
|
|
|
@ -37,10 +37,10 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
void
|
||||
static void
|
||||
XkbDDXUpdateIndicators(DeviceIntPtr dev,CARD32 new)
|
||||
{
|
||||
dev->kbdfeed->ctrl.leds= new;
|
||||
|
|
|
@ -40,7 +40,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#define XKBSRV_NEED_FILE_FUNCS
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
#ifndef PATH_MAX
|
||||
|
|
|
@ -44,7 +44,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#define XKBSRV_NEED_FILE_FUNCS
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XI.h>
|
||||
#include "xkb.h"
|
||||
|
||||
|
@ -211,7 +211,7 @@ OutputDirectory(
|
|||
}
|
||||
}
|
||||
|
||||
Bool
|
||||
static Bool
|
||||
XkbDDXCompileNamedKeymap( XkbDescPtr xkb,
|
||||
XkbComponentNamesPtr names,
|
||||
char * nameRtrn,
|
||||
|
@ -298,7 +298,7 @@ char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile;
|
|||
return False;
|
||||
}
|
||||
|
||||
Bool
|
||||
static Bool
|
||||
XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
|
||||
XkbComponentNamesPtr names,
|
||||
unsigned want,
|
||||
|
@ -432,7 +432,7 @@ char tmpname[PATH_MAX];
|
|||
return False;
|
||||
}
|
||||
|
||||
FILE *
|
||||
static FILE *
|
||||
XkbDDXOpenConfigFile(char *mapName,char *fileNameRtrn,int fileNameRtrnLen)
|
||||
{
|
||||
char buf[PATH_MAX],xkm_output_dir[PATH_MAX];
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#define NEED_EVENTS
|
||||
#include <X11/X.h>
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
|
||||
int
|
||||
XkbDDXPrivate(DeviceIntPtr dev,KeyCode key,XkbAction *act)
|
||||
|
|
|
@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
|
||||
int
|
||||
XkbDDXSwitchScreen(DeviceIntPtr dev,KeyCode key,XkbAction *act)
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include "dix.h"
|
||||
#include <X11/extensions/XKBstr.h>
|
||||
#define XKBSRV_NEED_FILE_FUNCS
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
#define PR_DEBUG(s) fprintf(stderr,s)
|
||||
|
|
63
xkb/xkb.c
63
xkb/xkb.c
|
@ -36,23 +36,20 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "misc.h"
|
||||
#include "inputstr.h"
|
||||
#define XKBSRV_NEED_FILE_FUNCS
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include "extnsionst.h"
|
||||
#include "xkb.h"
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
int XkbEventBase;
|
||||
int XkbErrorBase;
|
||||
static int XkbErrorBase;
|
||||
int XkbReqCode;
|
||||
int XkbKeyboardErrorCode;
|
||||
Atom xkbONE_LEVEL;
|
||||
Atom xkbTWO_LEVEL;
|
||||
Atom xkbKEYPAD;
|
||||
static int XkbKeyboardErrorCode;
|
||||
CARD32 xkbDebugFlags = 0;
|
||||
CARD32 xkbDebugCtrls = 0;
|
||||
static CARD32 xkbDebugCtrls = 0;
|
||||
|
||||
RESTYPE RT_XKBCLIENT;
|
||||
static RESTYPE RT_XKBCLIENT;
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
|
@ -895,52 +892,6 @@ ProcXkbSetControls(ClientPtr client)
|
|||
return client->noClientException;
|
||||
}
|
||||
|
||||
/* FIXME: Needs to set rate on all core-sending devices. */
|
||||
int
|
||||
XkbSetRepeatRate(DeviceIntPtr dev,int timeout,int interval,int major,int minor)
|
||||
{
|
||||
int changed= 0;
|
||||
XkbControlsRec old,*xkb;
|
||||
|
||||
if ((!dev)||(!dev->key)||(!dev->key->xkbInfo))
|
||||
return 0;
|
||||
xkb= dev->key->xkbInfo->desc->ctrls;
|
||||
old= *xkb;
|
||||
if ((timeout!=0) && (xkb->repeat_delay!=timeout)) {
|
||||
xkb->repeat_delay= timeout;
|
||||
changed++;
|
||||
}
|
||||
if ((interval!=0) && (xkb->repeat_interval!=interval)) {
|
||||
xkb->repeat_interval= interval;
|
||||
changed++;
|
||||
}
|
||||
if (changed) {
|
||||
xkbControlsNotify cn;
|
||||
XkbDDXChangeControls(dev,&old,xkb);
|
||||
if (XkbComputeControlsNotify(dev,&old,xkb,&cn,False)) {
|
||||
cn.keycode= 0;
|
||||
cn.eventType = 0;
|
||||
cn.requestMajor = major;
|
||||
cn.requestMinor = minor;
|
||||
XkbSendControlsNotify(dev,&cn);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
XkbGetRepeatRate(DeviceIntPtr dev,int *timeout,int *interval)
|
||||
{
|
||||
XkbControlsPtr xkb;
|
||||
|
||||
if ((!dev)||(!dev->key)||(!dev->key->xkbInfo))
|
||||
return 0;
|
||||
xkb= dev->key->xkbInfo->desc->ctrls;
|
||||
if (timeout) *timeout= xkb->repeat_delay;
|
||||
if (interval) *interval= xkb->repeat_interval;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
static int
|
||||
|
@ -2820,7 +2771,7 @@ ProcXkbGetIndicatorState(ClientPtr client)
|
|||
|
||||
/***====================================================================***/
|
||||
|
||||
Status
|
||||
static Status
|
||||
XkbComputeGetIndicatorMapReplySize(
|
||||
XkbIndicatorPtr indicators,
|
||||
xkbGetIndicatorMapReply *rep)
|
||||
|
@ -2837,7 +2788,7 @@ int nIndicators;
|
|||
return Success;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
XkbSendIndicatorMap( ClientPtr client,
|
||||
XkbIndicatorPtr indicators,
|
||||
xkbGetIndicatorMapReply * rep)
|
||||
|
|
42
xkb/xkb.h
42
xkb/xkb.h
|
@ -1,5 +1,3 @@
|
|||
/* $XFree86$ */
|
||||
|
||||
/* #include "XKBfile.h" */
|
||||
|
||||
extern int ProcXkbUseExtension(ClientPtr client);
|
||||
|
@ -29,50 +27,10 @@ extern int ProcXkbGetDeviceInfo(ClientPtr client);
|
|||
extern int ProcXkbSetDeviceInfo(ClientPtr client);
|
||||
extern int ProcXkbSetDebuggingFlags(ClientPtr client);
|
||||
|
||||
extern int XkbSetRepeatRate(DeviceIntPtr dev, int timeout, int interval, int major, int minor);
|
||||
extern int XkbGetRepeatRate(DeviceIntPtr dev, int *timeout, int *interval);
|
||||
|
||||
extern void XkbExtensionInit(void);
|
||||
|
||||
extern Status XkbComputeGetIndicatorMapReplySize(
|
||||
XkbIndicatorPtr indicators,
|
||||
xkbGetIndicatorMapReply *rep);
|
||||
extern int XkbSendIndicatorMap(
|
||||
ClientPtr client,
|
||||
XkbIndicatorPtr indicators,
|
||||
xkbGetIndicatorMapReply *rep);
|
||||
|
||||
extern void XkbComputeCompatState(XkbSrvInfoPtr xkbi);
|
||||
extern void XkbSetPhysicalLockingKey(DeviceIntPtr dev, unsigned key);
|
||||
|
||||
extern Bool XkbFilterEvents(ClientPtr pClient, int nEvents, xEvent *xE);
|
||||
|
||||
extern Bool XkbApplyLEDChangeToKeyboard(
|
||||
XkbSrvInfoPtr xkbi,
|
||||
XkbIndicatorMapPtr map,
|
||||
Bool on,
|
||||
XkbChangesPtr change);
|
||||
|
||||
extern Bool XkbWriteRulesProp(ClientPtr client, pointer closure);
|
||||
|
||||
extern XkbAction XkbGetButtonAction(DeviceIntPtr kbd, DeviceIntPtr dev, int button);
|
||||
|
||||
/* extern Status XkbMergeFile(XkbDescPtr xkb, XkbFileInfo finfo); */
|
||||
|
||||
extern Bool XkbDDXCompileNamedKeymap(
|
||||
XkbDescPtr xkb,
|
||||
XkbComponentNamesPtr names,
|
||||
char * nameRtrn,
|
||||
int nameRtrnLen);
|
||||
|
||||
extern Bool XkbDDXCompileKeymapByNames(
|
||||
XkbDescPtr xkb,
|
||||
XkbComponentNamesPtr names,
|
||||
unsigned want,
|
||||
unsigned need,
|
||||
char * nameRtrn,
|
||||
int nameRtrnLen);
|
||||
|
||||
extern Bool XkbCopyKeymap(
|
||||
XkbDescPtr src,
|
||||
XkbDescPtr dst,
|
||||
|
|
|
@ -38,7 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/Xproto.h>
|
||||
#include <X11/keysym.h>
|
||||
#include "inputstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#if !defined(WIN32) && !defined(Lynx)
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
@ -52,9 +52,9 @@ pointer XkbLastRepeatEvent= NULL;
|
|||
|
||||
unsigned short XkbDfltAccessXTimeout= 120;
|
||||
unsigned int XkbDfltAccessXTimeoutMask= DFLT_TIMEOUT_CTRLS;
|
||||
unsigned int XkbDfltAccessXTimeoutValues= 0;
|
||||
unsigned int XkbDfltAccessXTimeoutOptionsMask= DFLT_TIMEOUT_OPTS;
|
||||
unsigned int XkbDfltAccessXTimeoutOptionsValues= 0;
|
||||
static unsigned int XkbDfltAccessXTimeoutValues= 0;
|
||||
static unsigned int XkbDfltAccessXTimeoutOptionsMask= DFLT_TIMEOUT_OPTS;
|
||||
static unsigned int XkbDfltAccessXTimeoutOptionsValues= 0;
|
||||
unsigned int XkbDfltAccessXFeedback= XkbAccessXFeedbackMask;
|
||||
unsigned short XkbDfltAccessXOptions= XkbAX_AllOptionsMask & ~(XkbAX_IndicatorFBMask|XkbAX_SKReleaseFBMask|XkbAX_SKRejectFBMask);
|
||||
|
||||
|
|
|
@ -36,14 +36,14 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/keysym.h>
|
||||
#include "misc.h"
|
||||
#include "inputstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include "xkb.h"
|
||||
#include <ctype.h>
|
||||
|
||||
static unsigned int _xkbServerGeneration;
|
||||
int xkbDevicePrivateIndex = -1;
|
||||
static int xkbDevicePrivateIndex = -1;
|
||||
|
||||
void
|
||||
static void
|
||||
xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc,
|
||||
pointer data)
|
||||
{
|
||||
|
@ -216,7 +216,7 @@ static XkbAction fake;
|
|||
return fake;
|
||||
}
|
||||
|
||||
XkbAction
|
||||
static XkbAction
|
||||
XkbGetButtonAction(DeviceIntPtr kbd,DeviceIntPtr dev,int button)
|
||||
{
|
||||
XkbAction fake;
|
||||
|
|
|
@ -456,43 +456,6 @@ static XkbCompatMapRec compatMap= {
|
|||
num_dfltSI, num_dfltSI
|
||||
};
|
||||
|
||||
static XkbIndicatorRec indicators= {
|
||||
0x0,
|
||||
{
|
||||
{ 0x80, 0, 0x00, XkbIM_UseEffective, { LockMask, LockMask, 0 }, 0 },
|
||||
{ 0x80, 0, 0x00, XkbIM_UseEffective, { 0, 0, vmod_NumLockMask }, 0 },
|
||||
{ 0x80, 0, 0x00, XkbIM_UseLocked, { ShiftMask, ShiftMask, 0 }, 0 },
|
||||
{ 0x80, 0, 0x00, 0, { 0, 0, 0 }, XkbMouseKeysMask },
|
||||
{ 0x80, 0, 0x00, XkbIM_UseLocked, { 0, 0, vmod_ScrollLockMask }, 0 },
|
||||
{ 0x80, XkbIM_UseEffective, 0xfe, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
|
||||
{ 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }
|
||||
}
|
||||
};
|
||||
static void
|
||||
initIndicatorNames(DPYTYPE dpy,XkbDescPtr xkb)
|
||||
{
|
||||
|
|
|
@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/extensions/XI.h>
|
||||
#include "inputstr.h"
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include "xkb.h"
|
||||
|
||||
/***====================================================================***/
|
||||
|
@ -331,7 +331,7 @@ Time time = 0;
|
|||
return;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
XkbSendIndicatorNotify(DeviceIntPtr kbd,int xkbType,xkbIndicatorNotify *pEv)
|
||||
{
|
||||
int initialized;
|
||||
|
@ -971,48 +971,6 @@ XkbInterestPtr interest;
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
XkbRemoveClient(DevicePtr inDev,ClientPtr client)
|
||||
{
|
||||
XkbSrvInfoPtr xkbi;
|
||||
DeviceIntPtr dev = (DeviceIntPtr)inDev;
|
||||
XkbInterestPtr interest;
|
||||
unsigned long autoCtrls,autoValues;
|
||||
Bool found;
|
||||
|
||||
found= False;
|
||||
autoCtrls= autoValues= 0;
|
||||
if ( dev->xkb_interest ) {
|
||||
interest = dev->xkb_interest;
|
||||
if (interest && (interest->client==client)){
|
||||
dev->xkb_interest = interest->next;
|
||||
autoCtrls= interest->autoCtrls;
|
||||
autoValues= interest->autoCtrlValues;
|
||||
_XkbFree(interest);
|
||||
found= True;
|
||||
}
|
||||
while ((!found)&&(interest->next)) {
|
||||
if (interest->next->client==client) {
|
||||
XkbInterestPtr victim = interest->next;
|
||||
interest->next = victim->next;
|
||||
autoCtrls= victim->autoCtrls;
|
||||
autoValues= victim->autoCtrlValues;
|
||||
_XkbFree(victim);
|
||||
found= True;
|
||||
}
|
||||
interest = interest->next;
|
||||
}
|
||||
}
|
||||
if (found && autoCtrls && dev->key && dev->key->xkbInfo ) {
|
||||
XkbEventCauseRec cause;
|
||||
|
||||
xkbi= dev->key->xkbInfo;
|
||||
XkbSetCauseXkbReq(&cause,X_kbPerClientFlags,client);
|
||||
XkbEnableDisableControls(xkbi,autoCtrls,autoValues,NULL,&cause);
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
int
|
||||
XkbRemoveResourceClient(DevicePtr inDev,XID id)
|
||||
{
|
||||
|
|
|
@ -47,7 +47,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "opaque.h"
|
||||
#include "property.h"
|
||||
#define XKBSRV_NEED_FILE_FUNCS
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XKBgeom.h>
|
||||
#include <X11/extensions/XKMformat.h>
|
||||
#include <X11/extensions/XKBfile.h>
|
||||
|
@ -124,7 +124,7 @@ typedef struct _SrvXkmInfo {
|
|||
|
||||
char * XkbBaseDirectory= XKB_BASE_DIRECTORY;
|
||||
char * XkbBinDirectory= XKB_BIN_DIRECTORY;
|
||||
int XkbWantAccessX= 0;
|
||||
static int XkbWantAccessX= 0;
|
||||
static XkbFileInfo * _XkbInitFileInfo= NULL;
|
||||
|
||||
static Bool rulesDefined= False;
|
||||
|
@ -134,20 +134,17 @@ static char * XkbLayoutDflt= NULL;
|
|||
static char * XkbVariantDflt= NULL;
|
||||
static char * XkbOptionsDflt= NULL;
|
||||
|
||||
char * XkbModelUsed= NULL;
|
||||
char * XkbLayoutUsed= NULL;
|
||||
char * XkbVariantUsed= NULL;
|
||||
char * XkbOptionsUsed= NULL;
|
||||
|
||||
int _XkbClientMajor= XkbMajorVersion;
|
||||
int _XkbClientMinor= XkbMinorVersion;
|
||||
static char * XkbModelUsed= NULL;
|
||||
static char * XkbLayoutUsed= NULL;
|
||||
static char * XkbVariantUsed= NULL;
|
||||
static char * XkbOptionsUsed= NULL;
|
||||
|
||||
_X_EXPORT Bool noXkbExtension= XKB_DFLT_DISABLED;
|
||||
Bool XkbWantRulesProp= XKB_DFLT_RULES_PROP;
|
||||
static Bool XkbWantRulesProp= XKB_DFLT_RULES_PROP;
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
char *
|
||||
static char *
|
||||
XkbGetRulesDflts(XkbRF_VarDefsPtr defs)
|
||||
{
|
||||
if (XkbModelDflt) defs->model= XkbModelDflt;
|
||||
|
@ -161,7 +158,7 @@ XkbGetRulesDflts(XkbRF_VarDefsPtr defs)
|
|||
return (rulesDefined?XkbRulesFile:XKB_DFLT_RULES_FILE);
|
||||
}
|
||||
|
||||
Bool
|
||||
static Bool
|
||||
XkbWriteRulesProp(ClientPtr client, pointer closure)
|
||||
{
|
||||
int len,out;
|
||||
|
@ -230,7 +227,7 @@ char * pval;
|
|||
return True;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
XkbSetRulesUsed(XkbRF_VarDefsPtr defs)
|
||||
{
|
||||
if (XkbModelUsed)
|
||||
|
@ -289,9 +286,6 @@ XkbSetRulesDflts(char *rulesFile,char *model,char *layout,
|
|||
|
||||
#include "xkbDflts.h"
|
||||
|
||||
/* A dummy to keep the compiler quiet */
|
||||
pointer xkbBogus = &indicators;
|
||||
|
||||
static Bool
|
||||
XkbInitKeyTypes(XkbDescPtr xkb,SrvXkmInfo *file)
|
||||
{
|
||||
|
|
453
xkb/xkbLEDs.c
453
xkb/xkbLEDs.c
|
@ -38,7 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include "xkb.h"
|
||||
|
||||
/***====================================================================***/
|
||||
|
@ -82,7 +82,7 @@ XkbSrvLedInfoPtr sli;
|
|||
|
||||
/*
|
||||
* Bool
|
||||
* XkbApplyLEDChangeToKeyboard(xkbi,map,on,change)
|
||||
*XkbApplyLEDChangeToKeyboard(xkbi,map,on,change)
|
||||
*
|
||||
* Some indicators "drive" the keyboard when their state is explicitly
|
||||
* changed, as described in section 9.2.1 of the XKB protocol spec.
|
||||
|
@ -91,7 +91,7 @@ XkbSrvLedInfoPtr sli;
|
|||
* when the indicator described by 'map' is turned on or off. The
|
||||
* extent of the changes is reported in change, which must be defined.
|
||||
*/
|
||||
Bool
|
||||
static Bool
|
||||
XkbApplyLEDChangeToKeyboard( XkbSrvInfoPtr xkbi,
|
||||
XkbIndicatorMapPtr map,
|
||||
Bool on,
|
||||
|
@ -166,6 +166,164 @@ XkbStatePtr state;
|
|||
}
|
||||
return (stateChange || ctrlChange);
|
||||
}
|
||||
|
||||
/*
|
||||
* Bool
|
||||
* ComputeAutoState(map,state,ctrls)
|
||||
*
|
||||
* This function reports the effect of applying the specified
|
||||
* indicator map given the specified state and controls, as
|
||||
* described in section 9.2 of the XKB protocol specification.
|
||||
*/
|
||||
|
||||
static Bool
|
||||
ComputeAutoState( XkbIndicatorMapPtr map,
|
||||
XkbStatePtr state,
|
||||
XkbControlsPtr ctrls)
|
||||
{
|
||||
Bool on;
|
||||
CARD8 mods,group;
|
||||
|
||||
on= False;
|
||||
mods= group= 0;
|
||||
if (map->which_mods&XkbIM_UseAnyMods) {
|
||||
if (map->which_mods&XkbIM_UseBase)
|
||||
mods|= state->base_mods;
|
||||
if (map->which_mods&XkbIM_UseLatched)
|
||||
mods|= state->latched_mods;
|
||||
if (map->which_mods&XkbIM_UseLocked)
|
||||
mods|= state->locked_mods;
|
||||
if (map->which_mods&XkbIM_UseEffective)
|
||||
mods|= state->mods;
|
||||
if (map->which_mods&XkbIM_UseCompat)
|
||||
mods|= state->compat_state;
|
||||
on = ((map->mods.mask&mods)!=0);
|
||||
on = on||((mods==0)&&(map->mods.mask==0)&&(map->mods.vmods==0));
|
||||
}
|
||||
if (map->which_groups&XkbIM_UseAnyGroup) {
|
||||
if (map->which_groups&XkbIM_UseBase)
|
||||
group|= (1L << state->base_group);
|
||||
if (map->which_groups&XkbIM_UseLatched)
|
||||
group|= (1L << state->latched_group);
|
||||
if (map->which_groups&XkbIM_UseLocked)
|
||||
group|= (1L << state->locked_group);
|
||||
if (map->which_groups&XkbIM_UseEffective)
|
||||
group|= (1L << state->group);
|
||||
on = on||(((map->groups&group)!=0)||(map->groups==0));
|
||||
}
|
||||
if (map->ctrls)
|
||||
on = on||(ctrls->enabled_ctrls&map->ctrls);
|
||||
return on;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
XkbUpdateLedAutoState( DeviceIntPtr dev,
|
||||
XkbSrvLedInfoPtr sli,
|
||||
unsigned maps_to_check,
|
||||
xkbExtensionDeviceNotify * ed,
|
||||
XkbChangesPtr changes,
|
||||
XkbEventCausePtr cause)
|
||||
{
|
||||
DeviceIntPtr kbd;
|
||||
XkbStatePtr state;
|
||||
XkbControlsPtr ctrls;
|
||||
XkbChangesRec my_changes;
|
||||
xkbExtensionDeviceNotify my_ed;
|
||||
register unsigned i,bit,affected;
|
||||
register XkbIndicatorMapPtr map;
|
||||
unsigned oldState;
|
||||
|
||||
if ((maps_to_check==0)||(sli->maps==NULL)||(sli->mapsPresent==0))
|
||||
return;
|
||||
|
||||
if (dev->key && dev->key->xkbInfo)
|
||||
kbd= dev;
|
||||
else kbd= (DeviceIntPtr)LookupKeyboardDevice();
|
||||
|
||||
state= &kbd->key->xkbInfo->state;
|
||||
ctrls= kbd->key->xkbInfo->desc->ctrls;
|
||||
affected= maps_to_check;
|
||||
oldState= sli->effectiveState;
|
||||
sli->autoState&= ~affected;
|
||||
for (i=0,bit=1;(i<XkbNumIndicators)&&(affected);i++,bit<<=1) {
|
||||
if ((affected&bit)==0)
|
||||
continue;
|
||||
affected&= ~bit;
|
||||
map= &sli->maps[i];
|
||||
if((!(map->flags&XkbIM_NoAutomatic))&&ComputeAutoState(map,state,ctrls))
|
||||
sli->autoState|= bit;
|
||||
}
|
||||
sli->effectiveState= (sli->autoState|sli->explicitState);
|
||||
affected= sli->effectiveState^oldState;
|
||||
if (affected==0)
|
||||
return;
|
||||
|
||||
if (ed==NULL) {
|
||||
ed= &my_ed;
|
||||
bzero((char *)ed,sizeof(xkbExtensionDeviceNotify));
|
||||
}
|
||||
else if ((ed->reason&XkbXI_IndicatorsMask)&&
|
||||
((ed->ledClass!=sli->class)||(ed->ledID!=sli->id))) {
|
||||
XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
|
||||
}
|
||||
|
||||
if ((kbd==dev)&&(sli->flags&XkbSLI_IsDefault)) {
|
||||
if (changes==NULL) {
|
||||
changes= &my_changes;
|
||||
bzero((char *)changes,sizeof(XkbChangesRec));
|
||||
}
|
||||
changes->indicators.state_changes|= affected;
|
||||
}
|
||||
|
||||
ed->reason|= XkbXI_IndicatorStateMask;
|
||||
ed->ledClass= sli->class;
|
||||
ed->ledID= sli->id;
|
||||
ed->ledsDefined= sli->namesPresent|sli->mapsPresent;
|
||||
ed->ledState= sli->effectiveState;
|
||||
ed->unsupported|= XkbXI_IndicatorStateMask;
|
||||
ed->supported= XkbXI_AllFeaturesMask;
|
||||
|
||||
if (changes!=&my_changes) changes= NULL;
|
||||
if (ed!=&my_ed) ed= NULL;
|
||||
if (changes || ed)
|
||||
XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
XkbUpdateAllDeviceIndicators(XkbChangesPtr changes,XkbEventCausePtr cause)
|
||||
{
|
||||
DeviceIntPtr edev;
|
||||
XkbSrvLedInfoPtr sli;
|
||||
|
||||
for (edev=inputInfo.devices;edev!=NULL;edev=edev->next) {
|
||||
if (edev->kbdfeed) {
|
||||
KbdFeedbackPtr kf;
|
||||
for (kf=edev->kbdfeed;kf!=NULL;kf=kf->next) {
|
||||
if ((kf->xkb_sli==NULL)||(kf->xkb_sli->maps==NULL))
|
||||
continue;
|
||||
sli= kf->xkb_sli;
|
||||
XkbUpdateLedAutoState(edev,sli,sli->mapsPresent,NULL,
|
||||
changes,cause);
|
||||
|
||||
}
|
||||
}
|
||||
if (edev->leds) {
|
||||
LedFeedbackPtr lf;
|
||||
for (lf=edev->leds;lf!=NULL;lf=lf->next) {
|
||||
if ((lf->xkb_sli==NULL)||(lf->xkb_sli->maps==NULL))
|
||||
continue;
|
||||
sli= lf->xkb_sli;
|
||||
XkbUpdateLedAutoState(edev,sli,sli->mapsPresent,NULL,
|
||||
changes,cause);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
|
@ -228,55 +386,6 @@ unsigned side_affected;
|
|||
|
||||
/***====================================================================***/
|
||||
|
||||
/*
|
||||
* Bool
|
||||
* ComputeAutoState(map,state,ctrls)
|
||||
*
|
||||
* This function reports the effect of applying the specified
|
||||
* indicator map given the specified state and controls, as
|
||||
* described in section 9.2 of the XKB protocol specification.
|
||||
*/
|
||||
|
||||
static Bool
|
||||
ComputeAutoState( XkbIndicatorMapPtr map,
|
||||
XkbStatePtr state,
|
||||
XkbControlsPtr ctrls)
|
||||
{
|
||||
Bool on;
|
||||
CARD8 mods,group;
|
||||
|
||||
on= False;
|
||||
mods= group= 0;
|
||||
if (map->which_mods&XkbIM_UseAnyMods) {
|
||||
if (map->which_mods&XkbIM_UseBase)
|
||||
mods|= state->base_mods;
|
||||
if (map->which_mods&XkbIM_UseLatched)
|
||||
mods|= state->latched_mods;
|
||||
if (map->which_mods&XkbIM_UseLocked)
|
||||
mods|= state->locked_mods;
|
||||
if (map->which_mods&XkbIM_UseEffective)
|
||||
mods|= state->mods;
|
||||
if (map->which_mods&XkbIM_UseCompat)
|
||||
mods|= state->compat_state;
|
||||
on = ((map->mods.mask&mods)!=0);
|
||||
on = on||((mods==0)&&(map->mods.mask==0)&&(map->mods.vmods==0));
|
||||
}
|
||||
if (map->which_groups&XkbIM_UseAnyGroup) {
|
||||
if (map->which_groups&XkbIM_UseBase)
|
||||
group|= (1L << state->base_group);
|
||||
if (map->which_groups&XkbIM_UseLatched)
|
||||
group|= (1L << state->latched_group);
|
||||
if (map->which_groups&XkbIM_UseLocked)
|
||||
group|= (1L << state->locked_group);
|
||||
if (map->which_groups&XkbIM_UseEffective)
|
||||
group|= (1L << state->group);
|
||||
on = on||(((map->groups&group)!=0)||(map->groups==0));
|
||||
}
|
||||
if (map->ctrls)
|
||||
on = on||(ctrls->enabled_ctrls&map->ctrls);
|
||||
return on;
|
||||
}
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
/*
|
||||
|
@ -314,39 +423,6 @@ XkbSrvLedInfoPtr sli;
|
|||
|
||||
/***====================================================================***/
|
||||
|
||||
void
|
||||
XkbUpdateAllDeviceIndicators(XkbChangesPtr changes,XkbEventCausePtr cause)
|
||||
{
|
||||
DeviceIntPtr edev;
|
||||
XkbSrvLedInfoPtr sli;
|
||||
|
||||
for (edev=inputInfo.devices;edev!=NULL;edev=edev->next) {
|
||||
if (edev->kbdfeed) {
|
||||
KbdFeedbackPtr kf;
|
||||
for (kf=edev->kbdfeed;kf!=NULL;kf=kf->next) {
|
||||
if ((kf->xkb_sli==NULL)||(kf->xkb_sli->maps==NULL))
|
||||
continue;
|
||||
sli= kf->xkb_sli;
|
||||
XkbUpdateLedAutoState(edev,sli,sli->mapsPresent,NULL,
|
||||
changes,cause);
|
||||
|
||||
}
|
||||
}
|
||||
if (edev->leds) {
|
||||
LedFeedbackPtr lf;
|
||||
for (lf=edev->leds;lf!=NULL;lf=lf->next) {
|
||||
if ((lf->xkb_sli==NULL)||(lf->xkb_sli->maps==NULL))
|
||||
continue;
|
||||
sli= lf->xkb_sli;
|
||||
XkbUpdateLedAutoState(edev,sli,sli->mapsPresent,NULL,
|
||||
changes,cause);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
/*
|
||||
|
@ -856,210 +932,3 @@ Bool kb_changed;
|
|||
XkbUpdateAllDeviceIndicators(NULL,cause);
|
||||
return;
|
||||
}
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
void
|
||||
XkbUpdateLedAutoState( DeviceIntPtr dev,
|
||||
XkbSrvLedInfoPtr sli,
|
||||
unsigned maps_to_check,
|
||||
xkbExtensionDeviceNotify * ed,
|
||||
XkbChangesPtr changes,
|
||||
XkbEventCausePtr cause)
|
||||
{
|
||||
DeviceIntPtr kbd;
|
||||
XkbStatePtr state;
|
||||
XkbControlsPtr ctrls;
|
||||
XkbChangesRec my_changes;
|
||||
xkbExtensionDeviceNotify my_ed;
|
||||
register unsigned i,bit,affected;
|
||||
register XkbIndicatorMapPtr map;
|
||||
unsigned oldState;
|
||||
|
||||
if ((maps_to_check==0)||(sli->maps==NULL)||(sli->mapsPresent==0))
|
||||
return;
|
||||
|
||||
if (dev->key && dev->key->xkbInfo)
|
||||
kbd= dev;
|
||||
else kbd= (DeviceIntPtr)LookupKeyboardDevice();
|
||||
|
||||
state= &kbd->key->xkbInfo->state;
|
||||
ctrls= kbd->key->xkbInfo->desc->ctrls;
|
||||
affected= maps_to_check;
|
||||
oldState= sli->effectiveState;
|
||||
sli->autoState&= ~affected;
|
||||
for (i=0,bit=1;(i<XkbNumIndicators)&&(affected);i++,bit<<=1) {
|
||||
if ((affected&bit)==0)
|
||||
continue;
|
||||
affected&= ~bit;
|
||||
map= &sli->maps[i];
|
||||
if((!(map->flags&XkbIM_NoAutomatic))&&ComputeAutoState(map,state,ctrls))
|
||||
sli->autoState|= bit;
|
||||
}
|
||||
sli->effectiveState= (sli->autoState|sli->explicitState);
|
||||
affected= sli->effectiveState^oldState;
|
||||
if (affected==0)
|
||||
return;
|
||||
|
||||
if (ed==NULL) {
|
||||
ed= &my_ed;
|
||||
bzero((char *)ed,sizeof(xkbExtensionDeviceNotify));
|
||||
}
|
||||
else if ((ed->reason&XkbXI_IndicatorsMask)&&
|
||||
((ed->ledClass!=sli->class)||(ed->ledID!=sli->id))) {
|
||||
XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
|
||||
}
|
||||
|
||||
if ((kbd==dev)&&(sli->flags&XkbSLI_IsDefault)) {
|
||||
if (changes==NULL) {
|
||||
changes= &my_changes;
|
||||
bzero((char *)changes,sizeof(XkbChangesRec));
|
||||
}
|
||||
changes->indicators.state_changes|= affected;
|
||||
}
|
||||
|
||||
ed->reason|= XkbXI_IndicatorStateMask;
|
||||
ed->ledClass= sli->class;
|
||||
ed->ledID= sli->id;
|
||||
ed->ledsDefined= sli->namesPresent|sli->mapsPresent;
|
||||
ed->ledState= sli->effectiveState;
|
||||
ed->unsupported|= XkbXI_IndicatorStateMask;
|
||||
ed->supported= XkbXI_AllFeaturesMask;
|
||||
|
||||
if (changes!=&my_changes) changes= NULL;
|
||||
if (ed!=&my_ed) ed= NULL;
|
||||
if (changes || ed)
|
||||
XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
|
||||
return;
|
||||
}
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
static void
|
||||
_UpdateButtonVMods( XkbDescPtr xkb,
|
||||
unsigned num_btns,
|
||||
XkbAction * acts,
|
||||
unsigned changed,
|
||||
xkbExtensionDeviceNotify * ed_inout)
|
||||
{
|
||||
register int i;
|
||||
|
||||
for (i=0;i<num_btns;i++,acts++) {
|
||||
if ((acts->any.type!=XkbSA_NoAction)&&
|
||||
XkbUpdateActionVirtualMods(xkb,acts,changed)) {
|
||||
if ((ed_inout->reason&XkbXI_ButtonActionsMask)==0) {
|
||||
ed_inout->reason|= XkbXI_ButtonActionsMask;
|
||||
ed_inout->firstBtn= i;
|
||||
ed_inout->nBtns= 1;
|
||||
}
|
||||
else {
|
||||
ed_inout->nBtns= (i-ed_inout->firstBtn)+1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
_UpdateMapVMods( XkbDescPtr xkb,
|
||||
register XkbIndicatorMapPtr map,
|
||||
unsigned changed_vmods,
|
||||
unsigned * changed_maps_rtrn)
|
||||
{
|
||||
register int i;
|
||||
|
||||
*changed_maps_rtrn= 0;
|
||||
for (i=0;i<XkbNumIndicators;i++,map++) {
|
||||
if (map->mods.vmods&changed_vmods) {
|
||||
map->mods.mask= map->mods.real_mods;
|
||||
map->mods.mask|= XkbMaskForVMask(xkb,map->mods.vmods);
|
||||
*changed_maps_rtrn|= (1L<<i);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
_UpdateDeviceVMods( DeviceIntPtr dev,
|
||||
XkbDescPtr xkb,
|
||||
unsigned changed,
|
||||
XkbEventCausePtr cause)
|
||||
{
|
||||
xkbExtensionDeviceNotify ed;
|
||||
XkbSrvLedInfoPtr sli;
|
||||
unsigned changed_maps;
|
||||
|
||||
bzero((char *)&ed,sizeof(xkbExtensionDeviceNotify));
|
||||
ed.deviceID= dev->id;
|
||||
if ((dev->button)&&(dev->button->xkb_acts)) {
|
||||
_UpdateButtonVMods(xkb,dev->button->numButtons,
|
||||
dev->button->xkb_acts,changed,&ed);
|
||||
}
|
||||
if (dev->kbdfeed) {
|
||||
KbdFeedbackPtr kf;
|
||||
for (kf=dev->kbdfeed;kf!=NULL;kf=kf->next) {
|
||||
if ((kf->xkb_sli==NULL)||(kf->xkb_sli->maps==NULL))
|
||||
continue;
|
||||
sli= kf->xkb_sli;
|
||||
_UpdateMapVMods(xkb,sli->maps,changed,&changed_maps);
|
||||
if (changed_maps) {
|
||||
if (ed.reason&XkbXI_IndicatorsMask) {
|
||||
XkbSendExtensionDeviceNotify(dev,NULL,&ed);
|
||||
ed.reason= 0;
|
||||
ed.firstBtn= ed.nBtns;
|
||||
}
|
||||
ed.ledClass= sli->class;
|
||||
ed.ledID= sli->id;
|
||||
ed.ledsDefined= sli->namesPresent|sli->mapsPresent;
|
||||
ed.reason|= XkbXI_IndicatorMapsMask;
|
||||
XkbUpdateLedAutoState(dev,sli,changed_maps,&ed,NULL,cause);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dev->leds) {
|
||||
LedFeedbackPtr lf;
|
||||
for (lf=dev->leds;lf!=NULL;lf=lf->next) {
|
||||
if ((lf->xkb_sli==NULL)||(lf->xkb_sli->maps==NULL))
|
||||
continue;
|
||||
sli= lf->xkb_sli;
|
||||
_UpdateMapVMods(xkb,sli->maps,changed,&changed_maps);
|
||||
if (changed_maps) {
|
||||
if (ed.reason&XkbXI_IndicatorsMask) {
|
||||
XkbSendExtensionDeviceNotify(dev,NULL,&ed);
|
||||
ed.reason= 0;
|
||||
ed.firstBtn= ed.nBtns;
|
||||
}
|
||||
ed.ledClass= sli->class;
|
||||
ed.ledID= sli->id;
|
||||
ed.ledsDefined= sli->namesPresent|sli->mapsPresent;
|
||||
ed.reason|= XkbXI_IndicatorMapsMask;
|
||||
XkbUpdateLedAutoState(dev,sli,changed_maps,&ed,NULL,cause);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ed.reason!=0)
|
||||
XkbSendExtensionDeviceNotify(dev,NULL,&ed);
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
XkbApplyVModChangesToAllDevices( DeviceIntPtr dev,
|
||||
XkbDescPtr xkb,
|
||||
unsigned changed,
|
||||
XkbEventCausePtr cause)
|
||||
{
|
||||
DeviceIntPtr edev;
|
||||
if (dev!=(DeviceIntPtr)LookupKeyboardDevice())
|
||||
return;
|
||||
for (edev=inputInfo.devices;edev!=NULL;edev=edev->next) {
|
||||
if (edev->key)
|
||||
continue;
|
||||
_UpdateDeviceVMods(edev,xkb,changed,cause);
|
||||
}
|
||||
for (edev=inputInfo.off_devices;edev!=NULL;edev=edev->next) {
|
||||
if (edev->key)
|
||||
continue;
|
||||
_UpdateDeviceVMods(edev,xkb,changed,cause);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/keysym.h>
|
||||
#include "misc.h"
|
||||
#include "inputstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/Xproto.h>
|
||||
#include "misc.h"
|
||||
#include "inputstr.h"
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XKBstr.h>
|
||||
#include "extnsionst.h"
|
||||
#include "xkb.h"
|
||||
|
|
|
@ -41,7 +41,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "inputstr.h"
|
||||
|
||||
#define XKBSRV_NEED_FILE_FUNCS
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XKBgeom.h>
|
||||
#include "xkb.h"
|
||||
|
||||
|
@ -172,44 +172,6 @@ register unsigned mask;
|
|||
return mask;
|
||||
}
|
||||
|
||||
|
||||
Bool
|
||||
XkbApplyVModChanges( XkbSrvInfoPtr xkbi,
|
||||
unsigned changed,
|
||||
XkbChangesPtr changes,
|
||||
unsigned * needChecksRtrn,
|
||||
XkbEventCausePtr cause)
|
||||
{
|
||||
XkbDescPtr xkb;
|
||||
Bool check;
|
||||
|
||||
xkb= xkbi->desc;
|
||||
#ifdef DEBUG
|
||||
{
|
||||
register unsigned i,bit;
|
||||
for (i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
|
||||
if ((changed&bit)==0)
|
||||
continue;
|
||||
if (xkbDebugFlags)
|
||||
ErrorF("Should be applying: change vmod %d to 0x%x\n",i,
|
||||
xkb->server->vmods[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
check= XkbApplyVirtualModChanges(xkb,changed,changes);
|
||||
XkbApplyVModChangesToAllDevices(xkbi->device,xkb,changed,cause);
|
||||
|
||||
if (needChecksRtrn!=NULL) {
|
||||
if (check)
|
||||
*needChecksRtrn= XkbStateNotifyMask|XkbIndicatorStateNotifyMask;
|
||||
else *needChecksRtrn= 0;
|
||||
}
|
||||
else if (check) {
|
||||
/* 7/12/95 (ef) -- XXX check compatibility and/or indicator state */
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
void
|
||||
|
@ -658,7 +620,7 @@ int changed;
|
|||
return changed;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
XkbComputeCompatState(XkbSrvInfoPtr xkbi)
|
||||
{
|
||||
CARD16 grp_mask;
|
||||
|
@ -772,21 +734,6 @@ XkbCheckSecondaryEffects( XkbSrvInfoPtr xkbi,
|
|||
|
||||
/***====================================================================***/
|
||||
|
||||
void
|
||||
XkbSetPhysicalLockingKey(DeviceIntPtr dev,unsigned key)
|
||||
{
|
||||
XkbDescPtr xkb;
|
||||
|
||||
xkb= dev->key->xkbInfo->desc;
|
||||
if ((key>=xkb->min_key_code) && (key<=xkb->max_key_code)) {
|
||||
xkb->server->behaviors[key].type= XkbKB_Lock|XkbKB_Permanent;
|
||||
}
|
||||
else ErrorF("Internal Error! Bad XKB info in SetPhysicalLockingKey\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
Bool
|
||||
XkbEnableDisableControls( XkbSrvInfoPtr xkbi,
|
||||
unsigned long change,
|
||||
|
|
|
@ -32,37 +32,6 @@
|
|||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
char * _XkbErrMessages[] = {
|
||||
"success", /* _XkbSuccess */
|
||||
"key names not defined", /* _XkbErrMissingNames */
|
||||
"key types not defined", /* _XkbErrMissingTypes */
|
||||
"required key types not present", /* _XkbErrMissingReqTypes */
|
||||
"symbols not defined", /* _XkbErrMissingSymbols */
|
||||
"virtual modifier bindings not defined",/* _XkbErrMissingVMods */
|
||||
"indicators not defined", /* _XkbErrMissingIndicators */
|
||||
"compatibility map not defined", /* _XkbErrMissingCompatMap */
|
||||
"symbol interpretations not defined", /* _XkbErrMissingSymInterps */
|
||||
"geometry not defined", /* _XkbErrMissingGeometry */
|
||||
"illegal doodad type", /* _XkbErrIllegalDoodad */
|
||||
"illegal TOC type", /* _XkbErrIllegalTOCType */
|
||||
"illegal contents", /* _XkbErrIllegalContents */
|
||||
"empty file", /* _XkbErrEmptyFile */
|
||||
"file not found", /* _XkbErrFileNotFound */
|
||||
"cannot open", /* _XkbErrFileCannotOpen */
|
||||
"bad value", /* _XkbErrBadValue */
|
||||
"bad match", /* _XkbErrBadMatch */
|
||||
"illegal name for type", /* _XkbErrBadTypeName */
|
||||
"illegal width for type", /* _XkbErrBadTypeWidth */
|
||||
"bad file type", /* _XkbErrBadFileType */
|
||||
"bad file version", /* _XkbErrBadFileVersion */
|
||||
"error in Xkm file", /* _XkbErrBadFileFormat */
|
||||
"allocation failed", /* _XkbErrBadAlloc */
|
||||
"bad length", /* _XkbErrBadLength */
|
||||
"X request failed", /* _XkbErrXReqFailure */
|
||||
"not implemented" /* _XkbErrBadImplementation */
|
||||
};
|
||||
|
||||
unsigned _XkbErrCode;
|
||||
char * _XkbErrLocation= NULL;
|
||||
unsigned _XkbErrData;
|
||||
|
||||
|
|
109
xkb/xkbfmisc.c
109
xkb/xkbfmisc.c
|
@ -44,7 +44,7 @@
|
|||
#include "dix.h"
|
||||
#include <X11/extensions/XKBstr.h>
|
||||
#define XKBSRV_NEED_FILE_FUNCS 1
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XKBgeom.h>
|
||||
#include "xkb.h"
|
||||
|
||||
|
@ -133,76 +133,6 @@ unsigned set,rtrn;
|
|||
|
||||
/***===================================================================***/
|
||||
|
||||
Bool
|
||||
XkbLookupGroupAndLevel( XkbDescPtr xkb,
|
||||
int key,
|
||||
int * mods_inout,
|
||||
int * grp_inout,
|
||||
int * lvl_rtrn)
|
||||
{
|
||||
int nG,eG;
|
||||
|
||||
if ((!xkb)||(!XkbKeycodeInRange(xkb,key))||(!grp_inout))
|
||||
return False;
|
||||
|
||||
nG= XkbKeyNumGroups(xkb,key);
|
||||
eG= *grp_inout;
|
||||
|
||||
if ( nG==0 ) {
|
||||
*grp_inout= 0;
|
||||
if (lvl_rtrn!=NULL)
|
||||
*lvl_rtrn= 0;
|
||||
return False;
|
||||
}
|
||||
else if ( nG==1 ) {
|
||||
eG= 0;
|
||||
}
|
||||
else if ( eG>=nG ) {
|
||||
unsigned gI= XkbKeyGroupInfo(xkb,key);
|
||||
switch (XkbOutOfRangeGroupAction(gI)) {
|
||||
default:
|
||||
eG %= nG;
|
||||
break;
|
||||
case XkbClampIntoRange:
|
||||
eG = nG-1;
|
||||
break;
|
||||
case XkbRedirectIntoRange:
|
||||
eG = XkbOutOfRangeGroupNumber(gI);
|
||||
if (eG>=nG)
|
||||
eG= 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
*grp_inout= eG;
|
||||
if (mods_inout!=NULL) {
|
||||
XkbKeyTypePtr type;
|
||||
int preserve;
|
||||
|
||||
type = XkbKeyKeyType(xkb,key,eG);
|
||||
if (lvl_rtrn!=NULL)
|
||||
*lvl_rtrn= 0;
|
||||
preserve= 0;
|
||||
if (type->map) { /* find the shift level */
|
||||
register int i;
|
||||
register XkbKTMapEntryPtr entry;
|
||||
for (i=0,entry=type->map;i<type->map_count;i++,entry++) {
|
||||
if ((entry->active)&&
|
||||
(((*mods_inout)&type->mods.mask)==entry->mods.mask)){
|
||||
if (lvl_rtrn!=NULL)
|
||||
*lvl_rtrn= entry->level;
|
||||
if (type->preserve)
|
||||
preserve= type->preserve[i].mask;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
(*mods_inout)&= ~(type->mods.mask&(~preserve));
|
||||
}
|
||||
return True;
|
||||
}
|
||||
|
||||
/***===================================================================***/
|
||||
|
||||
static Bool
|
||||
XkbWriteSectionFromName(FILE *file,char *sectionName,char *name)
|
||||
{
|
||||
|
@ -416,15 +346,6 @@ XkbFileInfo finfo;
|
|||
|
||||
/***====================================================================***/
|
||||
|
||||
/*ARGSUSED*/
|
||||
Status
|
||||
XkbMergeFile(XkbDescPtr xkb,XkbFileInfo finfo)
|
||||
{
|
||||
return BadImplementation;
|
||||
}
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
int
|
||||
XkbFindKeycodeByName(XkbDescPtr xkb,char *name,Bool use_aliases)
|
||||
{
|
||||
|
@ -484,34 +405,6 @@ unsigned rtrn;
|
|||
return rtrn;
|
||||
}
|
||||
|
||||
unsigned
|
||||
XkbConvertXkbComponents(Bool toXkm,unsigned orig)
|
||||
{
|
||||
unsigned rtrn;
|
||||
|
||||
rtrn= 0;
|
||||
if (toXkm) {
|
||||
if (orig&XkbClientMapMask) rtrn|= XkmTypesMask|XkmSymbolsMask;
|
||||
if (orig&XkbServerMapMask) rtrn|= XkmTypesMask|XkmSymbolsMask;
|
||||
if (orig&XkbCompatMapMask) rtrn|= XkmCompatMapMask;
|
||||
if (orig&XkbIndicatorMapMask) rtrn|= XkmIndicatorsMask;
|
||||
if (orig&XkbNamesMask) rtrn|= XkmKeyNamesMask;
|
||||
if (orig&XkbGeometryMask) rtrn|= XkmGeometryMask;
|
||||
}
|
||||
else {
|
||||
if (orig!=0) rtrn|= XkbNamesMask;
|
||||
if (orig&XkmTypesMask) rtrn|= XkbClientMapMask;
|
||||
if (orig&XkmCompatMapMask)
|
||||
rtrn|= XkbCompatMapMask|XkbIndicatorMapMask;
|
||||
if (orig&XkmSymbolsMask) rtrn|=XkbClientMapMask|XkbServerMapMask;
|
||||
if (orig&XkmIndicatorsMask) rtrn|= XkbIndicatorMapMask;
|
||||
if (orig&XkmKeyNamesMask)
|
||||
rtrn|= XkbNamesMask|XkbIndicatorMapMask;
|
||||
if (orig&XkmGeometryMask) rtrn|= XkbGeometryMask;
|
||||
}
|
||||
return rtrn;
|
||||
}
|
||||
|
||||
Bool
|
||||
XkbDetermineFileType(XkbFileInfoPtr finfo,int format,int *opts_missing)
|
||||
{
|
||||
|
|
126
xkb/xkbout.c
126
xkb/xkbout.c
|
@ -44,7 +44,7 @@
|
|||
#include "dix.h"
|
||||
#include <X11/extensions/XKBstr.h>
|
||||
#define XKBSRV_NEED_FILE_FUNCS 1
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
|
||||
#include <X11/extensions/XKBgeom.h>
|
||||
#include <X11/extensions/XKBfile.h>
|
||||
|
@ -925,127 +925,3 @@ XkbGeometryPtr geom;
|
|||
fprintf(file,"};\n\n");
|
||||
return True;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
Bool
|
||||
XkbWriteXKBSemantics( FILE * file,
|
||||
XkbFileInfo * result,
|
||||
Bool topLevel,
|
||||
Bool showImplicit,
|
||||
XkbFileAddOnFunc addOn,
|
||||
void * priv)
|
||||
{
|
||||
Bool ok;
|
||||
|
||||
fprintf(file,"xkb_semantics {\n");
|
||||
ok= XkbWriteXKBKeyTypes(file,result,False,False,addOn,priv);
|
||||
ok= ok&&XkbWriteXKBCompatMap(file,result,False,False,addOn,priv);
|
||||
fprintf(file,"};\n");
|
||||
return ok;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
Bool
|
||||
XkbWriteXKBLayout( FILE * file,
|
||||
XkbFileInfo * result,
|
||||
Bool topLevel,
|
||||
Bool showImplicit,
|
||||
XkbFileAddOnFunc addOn,
|
||||
void * priv)
|
||||
{
|
||||
Bool ok;
|
||||
XkbDescPtr xkb;
|
||||
|
||||
xkb= result->xkb;
|
||||
fprintf(file,"xkb_layout {\n");
|
||||
ok= XkbWriteXKBKeycodes(file,result,False,showImplicit,addOn,priv);
|
||||
ok= ok&&XkbWriteXKBKeyTypes(file,result,False,showImplicit,addOn,priv);
|
||||
ok= ok&&XkbWriteXKBSymbols(file,result,False,showImplicit,addOn,priv);
|
||||
if (xkb->geom)
|
||||
ok= ok&&XkbWriteXKBGeometry(file,result,False,showImplicit,addOn,priv);
|
||||
fprintf(file,"};\n");
|
||||
return ok;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
Bool
|
||||
XkbWriteXKBKeymap( FILE * file,
|
||||
XkbFileInfo * result,
|
||||
Bool topLevel,
|
||||
Bool showImplicit,
|
||||
XkbFileAddOnFunc addOn,
|
||||
void * priv)
|
||||
{
|
||||
Bool ok;
|
||||
XkbDescPtr xkb;
|
||||
|
||||
xkb= result->xkb;
|
||||
fprintf(file,"xkb_keymap {\n");
|
||||
ok= XkbWriteXKBKeycodes(file,result,False,showImplicit,addOn,priv);
|
||||
ok= ok&&XkbWriteXKBKeyTypes(file,result,False,showImplicit,addOn,priv);
|
||||
ok= ok&&XkbWriteXKBCompatMap(file,result,False,showImplicit,addOn,priv);
|
||||
ok= ok&&XkbWriteXKBSymbols(file,result,False,showImplicit,addOn,priv);
|
||||
if (xkb->geom)
|
||||
ok= ok&&XkbWriteXKBGeometry(file,result,False,showImplicit,addOn,priv);
|
||||
fprintf(file,"};\n");
|
||||
return ok;
|
||||
}
|
||||
|
||||
Bool
|
||||
XkbWriteXKBFile( FILE * out,
|
||||
XkbFileInfo * result,
|
||||
Bool showImplicit,
|
||||
XkbFileAddOnFunc addOn,
|
||||
void * priv)
|
||||
{
|
||||
Bool ok = False;
|
||||
Bool (*func)(
|
||||
FILE * /* file */,
|
||||
XkbFileInfo * /* result */,
|
||||
Bool /* topLevel */,
|
||||
Bool /* showImplicit */,
|
||||
XkbFileAddOnFunc /* addOn */,
|
||||
void * /* priv */
|
||||
) = NULL;
|
||||
|
||||
switch (result->type) {
|
||||
case XkmSemanticsFile:
|
||||
func= XkbWriteXKBSemantics;
|
||||
break;
|
||||
case XkmLayoutFile:
|
||||
func= XkbWriteXKBLayout;
|
||||
break;
|
||||
case XkmKeymapFile:
|
||||
func= XkbWriteXKBKeymap;
|
||||
break;
|
||||
case XkmTypesIndex:
|
||||
func= XkbWriteXKBKeyTypes;
|
||||
break;
|
||||
case XkmCompatMapIndex:
|
||||
func= XkbWriteXKBCompatMap;
|
||||
break;
|
||||
case XkmSymbolsIndex:
|
||||
func= XkbWriteXKBSymbols;
|
||||
break;
|
||||
case XkmKeyNamesIndex:
|
||||
func= XkbWriteXKBKeycodes;
|
||||
break;
|
||||
case XkmGeometryFile:
|
||||
case XkmGeometryIndex:
|
||||
func= XkbWriteXKBGeometry;
|
||||
break;
|
||||
case XkmVirtualModsIndex:
|
||||
case XkmIndicatorsIndex:
|
||||
_XkbLibError(_XkbErrBadImplementation,
|
||||
XkbConfigText(result->type,XkbMessage),0);
|
||||
return False;
|
||||
}
|
||||
if (out==NULL) {
|
||||
_XkbLibError(_XkbErrFileCannotOpen,"XkbWriteXkbFile",0);
|
||||
ok= False;
|
||||
}
|
||||
else if (func) {
|
||||
ok= (*func)(out,result,True,showImplicit,addOn,priv);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include "dix.h"
|
||||
#include <X11/extensions/XKBstr.h>
|
||||
#define XKBSRV_NEED_FILE_FUNCS 1
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XKBgeom.h>
|
||||
|
||||
/***====================================================================***/
|
||||
|
@ -448,100 +448,6 @@ char * buf;
|
|||
return buf;
|
||||
}
|
||||
|
||||
char *
|
||||
XkbAccessXDetailText(unsigned state,unsigned format)
|
||||
{
|
||||
char *buf,*prefix;
|
||||
|
||||
buf= tbGetBuffer(32);
|
||||
if (format==XkbMessage) prefix= "";
|
||||
else prefix= "XkbAXN_";
|
||||
switch (state){
|
||||
case XkbAXN_SKPress: sprintf(buf,"%sSKPress",prefix); break;
|
||||
case XkbAXN_SKAccept: sprintf(buf,"%sSKAccept",prefix); break;
|
||||
case XkbAXN_SKRelease: sprintf(buf,"%sSKRelease",prefix); break;
|
||||
case XkbAXN_SKReject: sprintf(buf,"%sSKReject",prefix); break;
|
||||
case XkbAXN_BKAccept: sprintf(buf,"%sBKAccept",prefix); break;
|
||||
case XkbAXN_BKReject: sprintf(buf,"%sBKReject",prefix); break;
|
||||
case XkbAXN_AXKWarning: sprintf(buf,"%sAXKWarning",prefix); break;
|
||||
default: sprintf(buf,"ILLEGAL"); break;
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
static char *nknNames[] = {
|
||||
"keycodes", "geometry", "deviceID"
|
||||
};
|
||||
#define NUM_NKN (sizeof(nknNames)/sizeof(char *))
|
||||
|
||||
char *
|
||||
XkbNKNDetailMaskText(unsigned detail,unsigned format)
|
||||
{
|
||||
char *buf,*prefix,*suffix;
|
||||
register int i;
|
||||
register unsigned bit;
|
||||
int len,plen,slen;
|
||||
|
||||
|
||||
if ((detail&XkbAllNewKeyboardEventsMask)==0) {
|
||||
char *tmp = "";
|
||||
if (format==XkbCFile) tmp= "0";
|
||||
else if (format==XkbMessage) tmp= "none";
|
||||
buf= tbGetBuffer(strlen(tmp)+1);
|
||||
strcpy(buf,tmp);
|
||||
return buf;
|
||||
}
|
||||
else if ((detail&XkbAllNewKeyboardEventsMask)==XkbAllNewKeyboardEventsMask){
|
||||
char * tmp;
|
||||
if (format==XkbCFile) tmp= "XkbAllNewKeyboardEventsMask";
|
||||
else tmp= "all";
|
||||
buf= tbGetBuffer(strlen(tmp)+1);
|
||||
strcpy(buf,tmp);
|
||||
return buf;
|
||||
}
|
||||
if (format==XkbMessage) {
|
||||
prefix= "";
|
||||
suffix= "";
|
||||
slen= plen= 0;
|
||||
}
|
||||
else {
|
||||
prefix= "XkbNKN_";
|
||||
plen= 7;
|
||||
if (format==XkbCFile)
|
||||
suffix= "Mask";
|
||||
else suffix= "";
|
||||
slen= strlen(suffix);
|
||||
}
|
||||
for (len=0,i=0,bit=1;i<NUM_NKN;i++,bit<<=1) {
|
||||
if (detail&bit) {
|
||||
if (len!=0) len+= 1; /* room for '+' or '|' */
|
||||
len+= plen+slen+strlen(nknNames[i]);
|
||||
}
|
||||
}
|
||||
buf= tbGetBuffer(len+1);
|
||||
buf[0]= '\0';
|
||||
for (len=0,i=0,bit=1;i<NUM_NKN;i++,bit<<=1) {
|
||||
if (detail&bit) {
|
||||
if (len!=0) {
|
||||
if (format==XkbCFile) buf[len++]= '|';
|
||||
else buf[len++]= '+';
|
||||
}
|
||||
if (plen) {
|
||||
strcpy(&buf[len],prefix);
|
||||
len+= plen;
|
||||
}
|
||||
strcpy(&buf[len],nknNames[i]);
|
||||
len+= strlen(nknNames[i]);
|
||||
if (slen) {
|
||||
strcpy(&buf[len],suffix);
|
||||
len+= slen;
|
||||
}
|
||||
}
|
||||
}
|
||||
buf[len++]= '\0';
|
||||
return buf;
|
||||
}
|
||||
|
||||
static char *ctrlNames[] = {
|
||||
"repeatKeys",
|
||||
"slowKeys",
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include "inputstr.h"
|
||||
#include <X11/extensions/XKBstr.h>
|
||||
#define XKBSRV_NEED_FILE_FUNCS
|
||||
#include <X11/extensions/XKBsrv.h>
|
||||
#include <xkbsrv.h>
|
||||
#include <X11/extensions/XKBgeom.h>
|
||||
|
||||
Atom
|
||||
|
@ -1098,18 +1098,6 @@ unsigned i,size_toc;
|
|||
return 1;
|
||||
}
|
||||
|
||||
xkmSectionInfo *
|
||||
XkmFindTOCEntry(xkmFileInfo *finfo,xkmSectionInfo *toc,unsigned type)
|
||||
{
|
||||
register int i;
|
||||
|
||||
for (i=0;i<finfo->num_toc;i++) {
|
||||
if (toc[i].type==type)
|
||||
return &toc[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Bool
|
||||
XkmReadFileSection( FILE * file,
|
||||
xkmSectionInfo * toc,
|
||||
|
|
Loading…
Reference in New Issue
Block a user