XKB: Remove usage of client-side types
Since we're no longer sharing with Xlib, don't pass Displays and XPointers everywhere.
This commit is contained in:
parent
534fc5140b
commit
1332343910
|
@ -96,7 +96,6 @@ extern char * XkbIndentText(
|
||||||
);
|
);
|
||||||
|
|
||||||
extern char * XkbAtomText(
|
extern char * XkbAtomText(
|
||||||
Display * /* dpy */,
|
|
||||||
Atom /* atm */,
|
Atom /* atm */,
|
||||||
unsigned /* format */
|
unsigned /* format */
|
||||||
);
|
);
|
||||||
|
@ -129,14 +128,12 @@ XkbModMaskText(
|
||||||
);
|
);
|
||||||
|
|
||||||
extern char * XkbVModIndexText(
|
extern char * XkbVModIndexText(
|
||||||
Display * /* dpy */,
|
|
||||||
XkbDescPtr /* xkb */,
|
XkbDescPtr /* xkb */,
|
||||||
unsigned /* ndx */,
|
unsigned /* ndx */,
|
||||||
unsigned /* format */
|
unsigned /* format */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern char * XkbVModMaskText(
|
extern char * XkbVModMaskText(
|
||||||
Display * /* dpy */,
|
|
||||||
XkbDescPtr /* xkb */,
|
XkbDescPtr /* xkb */,
|
||||||
unsigned /* modMask */,
|
unsigned /* modMask */,
|
||||||
unsigned /* mask */,
|
unsigned /* mask */,
|
||||||
|
@ -189,7 +186,6 @@ extern char * XkbActionTypeText(
|
||||||
);
|
);
|
||||||
|
|
||||||
extern char * XkbActionText(
|
extern char * XkbActionText(
|
||||||
Display * /* dpy */,
|
|
||||||
XkbDescPtr /* xkb */,
|
XkbDescPtr /* xkb */,
|
||||||
XkbAction * /* action */,
|
XkbAction * /* action */,
|
||||||
unsigned /* format */
|
unsigned /* format */
|
||||||
|
@ -232,31 +228,12 @@ extern Bool XkbLookupGroupAndLevel(
|
||||||
|
|
||||||
/***====================================================================***/
|
/***====================================================================***/
|
||||||
|
|
||||||
extern char * XkbAtomGetString(
|
|
||||||
Display * /* dpy */,
|
|
||||||
Atom /* atm */
|
|
||||||
);
|
|
||||||
|
|
||||||
extern Atom XkbInternAtom(
|
extern Atom XkbInternAtom(
|
||||||
Display * /* dpy */,
|
|
||||||
char * /* name */,
|
char * /* name */,
|
||||||
Bool /* onlyIfExists */
|
Bool /* onlyIfExists */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern Status XkbChangeKbdDisplay(
|
extern void XkbInitAtoms(void);
|
||||||
Display * /* newDpy */,
|
|
||||||
XkbFileInfo * /* result */
|
|
||||||
);
|
|
||||||
|
|
||||||
extern Atom XkbChangeAtomDisplay(
|
|
||||||
Display * /* oldDpy */,
|
|
||||||
Display * /* newDpy */,
|
|
||||||
Atom /* atm */
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void XkbInitAtoms(
|
|
||||||
Display * /* dpy */
|
|
||||||
);
|
|
||||||
|
|
||||||
/***====================================================================***/
|
/***====================================================================***/
|
||||||
|
|
||||||
|
@ -415,7 +392,6 @@ extern void XkbEnsureSafeMapName(
|
||||||
extern Bool XkbWriteXKBKeymapForNames(
|
extern Bool XkbWriteXKBKeymapForNames(
|
||||||
FILE * /* file */,
|
FILE * /* file */,
|
||||||
XkbComponentNamesPtr /* names */,
|
XkbComponentNamesPtr /* names */,
|
||||||
Display * /* dpy */,
|
|
||||||
XkbDescPtr /* xkb */,
|
XkbDescPtr /* xkb */,
|
||||||
unsigned /* want */,
|
unsigned /* want */,
|
||||||
unsigned /* need */
|
unsigned /* need */
|
||||||
|
@ -432,13 +408,6 @@ extern Bool XkmProbe(
|
||||||
FILE * /* file */
|
FILE * /* file */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern unsigned XkbReadFromServer(
|
|
||||||
Display * /* dpy */,
|
|
||||||
unsigned /* need */,
|
|
||||||
unsigned /* want */,
|
|
||||||
XkbFileInfo * /* result */
|
|
||||||
);
|
|
||||||
|
|
||||||
extern unsigned XkmReadFile(
|
extern unsigned XkmReadFile(
|
||||||
FILE * /* file */,
|
FILE * /* file */,
|
||||||
unsigned /* need */,
|
unsigned /* need */,
|
||||||
|
|
|
@ -328,12 +328,10 @@ extern int DeviceEnterNotify,DeviceLeaveNotify;
|
||||||
#define IsKeypadKey(s) XkbKSIsKeypad(s)
|
#define IsKeypadKey(s) XkbKSIsKeypad(s)
|
||||||
|
|
||||||
#define Status int
|
#define Status int
|
||||||
#define XPointer pointer
|
|
||||||
#define Display struct _XDisplay
|
|
||||||
|
|
||||||
#ifndef True
|
#ifndef True
|
||||||
#define True 1
|
#define True TRUE
|
||||||
#define False 0
|
#define False FALSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_XFUNCPROTOBEGIN
|
_XFUNCPROTOBEGIN
|
||||||
|
@ -1020,11 +1018,11 @@ extern Bool XkbDDXNamesFromRules(
|
||||||
);
|
);
|
||||||
|
|
||||||
extern Bool XkbDDXApplyConfig(
|
extern Bool XkbDDXApplyConfig(
|
||||||
XPointer /* cfg_in */,
|
void * /* cfg_in */,
|
||||||
XkbSrvInfoPtr /* xkbi */
|
XkbSrvInfoPtr /* xkbi */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern XPointer XkbDDXPreloadConfig(
|
extern void *XkbDDXPreloadConfig(
|
||||||
char ** /* rulesFileRtrn */,
|
char ** /* rulesFileRtrn */,
|
||||||
XkbRF_VarDefsPtr /* defs */,
|
XkbRF_VarDefsPtr /* defs */,
|
||||||
XkbComponentNamesPtr /* names */,
|
XkbComponentNamesPtr /* names */,
|
||||||
|
@ -1038,6 +1036,6 @@ extern int _XkbStrCaseCmp(
|
||||||
|
|
||||||
_XFUNCPROTOEND
|
_XFUNCPROTOEND
|
||||||
|
|
||||||
#define XkbAtomGetString(d,s) NameForAtom(s)
|
#define XkbAtomGetString(s) NameForAtom(s)
|
||||||
|
|
||||||
#endif /* _XKBSRV_H_ */
|
#endif /* _XKBSRV_H_ */
|
||||||
|
|
|
@ -418,7 +418,6 @@ typedef struct _XkbGeometry *XkbGeometryPtr;
|
||||||
* Tie it all together into one big keyboard description
|
* Tie it all together into one big keyboard description
|
||||||
*/
|
*/
|
||||||
typedef struct _XkbDesc {
|
typedef struct _XkbDesc {
|
||||||
struct _XDisplay * dpy;
|
|
||||||
unsigned short flags;
|
unsigned short flags;
|
||||||
unsigned short device_spec;
|
unsigned short device_spec;
|
||||||
KeyCode min_key_code;
|
KeyCode min_key_code;
|
||||||
|
|
|
@ -455,7 +455,7 @@ XkbFreeGeometry(XkbGeometryPtr geom,unsigned which,Bool freeMap)
|
||||||
/***====================================================================***/
|
/***====================================================================***/
|
||||||
|
|
||||||
static Status
|
static Status
|
||||||
_XkbGeomAlloc( XPointer * old,
|
_XkbGeomAlloc( void ** old,
|
||||||
unsigned short * num,
|
unsigned short * num,
|
||||||
unsigned short * total,
|
unsigned short * total,
|
||||||
int num_new,
|
int num_new,
|
||||||
|
@ -471,8 +471,8 @@ _XkbGeomAlloc( XPointer * old,
|
||||||
|
|
||||||
*total= (*num)+num_new;
|
*total= (*num)+num_new;
|
||||||
if ((*old)!=NULL)
|
if ((*old)!=NULL)
|
||||||
(*old)= (XPointer)_XkbRealloc((*old),(*total)*sz_elem);
|
(*old)= _XkbRealloc((*old),(*total)*sz_elem);
|
||||||
else (*old)= (XPointer)_XkbCalloc((*total),sz_elem);
|
else (*old)= _XkbCalloc((*total),sz_elem);
|
||||||
if ((*old)==NULL) {
|
if ((*old)==NULL) {
|
||||||
*total= *num= 0;
|
*total= *num= 0;
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
@ -485,44 +485,44 @@ _XkbGeomAlloc( XPointer * old,
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define _XkbAllocProps(g,n) _XkbGeomAlloc((XPointer *)&(g)->properties,\
|
#define _XkbAllocProps(g,n) _XkbGeomAlloc((void *)&(g)->properties,\
|
||||||
&(g)->num_properties,&(g)->sz_properties,\
|
&(g)->num_properties,&(g)->sz_properties,\
|
||||||
(n),sizeof(XkbPropertyRec))
|
(n),sizeof(XkbPropertyRec))
|
||||||
#define _XkbAllocColors(g,n) _XkbGeomAlloc((XPointer *)&(g)->colors,\
|
#define _XkbAllocColors(g,n) _XkbGeomAlloc((void *)&(g)->colors,\
|
||||||
&(g)->num_colors,&(g)->sz_colors,\
|
&(g)->num_colors,&(g)->sz_colors,\
|
||||||
(n),sizeof(XkbColorRec))
|
(n),sizeof(XkbColorRec))
|
||||||
#define _XkbAllocShapes(g,n) _XkbGeomAlloc((XPointer *)&(g)->shapes,\
|
#define _XkbAllocShapes(g,n) _XkbGeomAlloc((void *)&(g)->shapes,\
|
||||||
&(g)->num_shapes,&(g)->sz_shapes,\
|
&(g)->num_shapes,&(g)->sz_shapes,\
|
||||||
(n),sizeof(XkbShapeRec))
|
(n),sizeof(XkbShapeRec))
|
||||||
#define _XkbAllocSections(g,n) _XkbGeomAlloc((XPointer *)&(g)->sections,\
|
#define _XkbAllocSections(g,n) _XkbGeomAlloc((void *)&(g)->sections,\
|
||||||
&(g)->num_sections,&(g)->sz_sections,\
|
&(g)->num_sections,&(g)->sz_sections,\
|
||||||
(n),sizeof(XkbSectionRec))
|
(n),sizeof(XkbSectionRec))
|
||||||
#define _XkbAllocDoodads(g,n) _XkbGeomAlloc((XPointer *)&(g)->doodads,\
|
#define _XkbAllocDoodads(g,n) _XkbGeomAlloc((void *)&(g)->doodads,\
|
||||||
&(g)->num_doodads,&(g)->sz_doodads,\
|
&(g)->num_doodads,&(g)->sz_doodads,\
|
||||||
(n),sizeof(XkbDoodadRec))
|
(n),sizeof(XkbDoodadRec))
|
||||||
#define _XkbAllocKeyAliases(g,n) _XkbGeomAlloc((XPointer *)&(g)->key_aliases,\
|
#define _XkbAllocKeyAliases(g,n) _XkbGeomAlloc((void *)&(g)->key_aliases,\
|
||||||
&(g)->num_key_aliases,&(g)->sz_key_aliases,\
|
&(g)->num_key_aliases,&(g)->sz_key_aliases,\
|
||||||
(n),sizeof(XkbKeyAliasRec))
|
(n),sizeof(XkbKeyAliasRec))
|
||||||
|
|
||||||
#define _XkbAllocOutlines(s,n) _XkbGeomAlloc((XPointer *)&(s)->outlines,\
|
#define _XkbAllocOutlines(s,n) _XkbGeomAlloc((void *)&(s)->outlines,\
|
||||||
&(s)->num_outlines,&(s)->sz_outlines,\
|
&(s)->num_outlines,&(s)->sz_outlines,\
|
||||||
(n),sizeof(XkbOutlineRec))
|
(n),sizeof(XkbOutlineRec))
|
||||||
#define _XkbAllocRows(s,n) _XkbGeomAlloc((XPointer *)&(s)->rows,\
|
#define _XkbAllocRows(s,n) _XkbGeomAlloc((void *)&(s)->rows,\
|
||||||
&(s)->num_rows,&(s)->sz_rows,\
|
&(s)->num_rows,&(s)->sz_rows,\
|
||||||
(n),sizeof(XkbRowRec))
|
(n),sizeof(XkbRowRec))
|
||||||
#define _XkbAllocPoints(o,n) _XkbGeomAlloc((XPointer *)&(o)->points,\
|
#define _XkbAllocPoints(o,n) _XkbGeomAlloc((void *)&(o)->points,\
|
||||||
&(o)->num_points,&(o)->sz_points,\
|
&(o)->num_points,&(o)->sz_points,\
|
||||||
(n),sizeof(XkbPointRec))
|
(n),sizeof(XkbPointRec))
|
||||||
#define _XkbAllocKeys(r,n) _XkbGeomAlloc((XPointer *)&(r)->keys,\
|
#define _XkbAllocKeys(r,n) _XkbGeomAlloc((void *)&(r)->keys,\
|
||||||
&(r)->num_keys,&(r)->sz_keys,\
|
&(r)->num_keys,&(r)->sz_keys,\
|
||||||
(n),sizeof(XkbKeyRec))
|
(n),sizeof(XkbKeyRec))
|
||||||
#define _XkbAllocOverlays(s,n) _XkbGeomAlloc((XPointer *)&(s)->overlays,\
|
#define _XkbAllocOverlays(s,n) _XkbGeomAlloc((void *)&(s)->overlays,\
|
||||||
&(s)->num_overlays,&(s)->sz_overlays,\
|
&(s)->num_overlays,&(s)->sz_overlays,\
|
||||||
(n),sizeof(XkbOverlayRec))
|
(n),sizeof(XkbOverlayRec))
|
||||||
#define _XkbAllocOverlayRows(o,n) _XkbGeomAlloc((XPointer *)&(o)->rows,\
|
#define _XkbAllocOverlayRows(o,n) _XkbGeomAlloc((void *)&(o)->rows,\
|
||||||
&(o)->num_rows,&(o)->sz_rows,\
|
&(o)->num_rows,&(o)->sz_rows,\
|
||||||
(n),sizeof(XkbOverlayRowRec))
|
(n),sizeof(XkbOverlayRowRec))
|
||||||
#define _XkbAllocOverlayKeys(r,n) _XkbGeomAlloc((XPointer *)&(r)->keys,\
|
#define _XkbAllocOverlayKeys(r,n) _XkbGeomAlloc((void *)&(r)->keys,\
|
||||||
&(r)->num_keys,&(r)->sz_keys,\
|
&(r)->num_keys,&(r)->sz_keys,\
|
||||||
(n),sizeof(XkbOverlayKeyRec))
|
(n),sizeof(XkbOverlayKeyRec))
|
||||||
|
|
||||||
|
|
|
@ -321,10 +321,10 @@ char tmpname[PATH_MAX];
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (xkbDebugFlags) {
|
if (xkbDebugFlags) {
|
||||||
ErrorF("XkbDDXCompileKeymapByNames compiling keymap:\n");
|
ErrorF("XkbDDXCompileKeymapByNames compiling keymap:\n");
|
||||||
XkbWriteXKBKeymapForNames(stderr,names,NULL,xkb,want,need);
|
XkbWriteXKBKeymapForNames(stderr,names,xkb,want,need);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
XkbWriteXKBKeymapForNames(out,names,NULL,xkb,want,need);
|
XkbWriteXKBKeymapForNames(out,names,xkb,want,need);
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
if (Pclose(out)==0)
|
if (Pclose(out)==0)
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -160,7 +160,6 @@ _AddIncl( FILE * file,
|
||||||
Bool
|
Bool
|
||||||
XkbWriteXKBKeymapForNames( FILE * file,
|
XkbWriteXKBKeymapForNames( FILE * file,
|
||||||
XkbComponentNamesPtr names,
|
XkbComponentNamesPtr names,
|
||||||
Display * dpy,
|
|
||||||
XkbDescPtr xkb,
|
XkbDescPtr xkb,
|
||||||
unsigned want,
|
unsigned want,
|
||||||
unsigned need)
|
unsigned need)
|
||||||
|
@ -233,7 +232,7 @@ XkbFileInfo finfo;
|
||||||
if ((xkb!=NULL) && (old_names!=NULL)) {
|
if ((xkb!=NULL) && (old_names!=NULL)) {
|
||||||
if (wantNames&XkmTypesMask) {
|
if (wantNames&XkmTypesMask) {
|
||||||
if (old_names->types!=None) {
|
if (old_names->types!=None) {
|
||||||
tmp= XkbAtomGetString(dpy,old_names->types);
|
tmp= XkbAtomGetString(old_names->types);
|
||||||
names->types= _XkbDupString(tmp);
|
names->types= _XkbDupString(tmp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -243,7 +242,7 @@ XkbFileInfo finfo;
|
||||||
}
|
}
|
||||||
if (wantNames&XkmCompatMapMask) {
|
if (wantNames&XkmCompatMapMask) {
|
||||||
if (old_names->compat!=None) {
|
if (old_names->compat!=None) {
|
||||||
tmp= XkbAtomGetString(dpy,old_names->compat);
|
tmp= XkbAtomGetString(old_names->compat);
|
||||||
names->compat= _XkbDupString(tmp);
|
names->compat= _XkbDupString(tmp);
|
||||||
}
|
}
|
||||||
else wantDflts|= XkmCompatMapMask;
|
else wantDflts|= XkmCompatMapMask;
|
||||||
|
@ -252,13 +251,13 @@ XkbFileInfo finfo;
|
||||||
if (wantNames&XkmSymbolsMask) {
|
if (wantNames&XkmSymbolsMask) {
|
||||||
if (old_names->symbols==None)
|
if (old_names->symbols==None)
|
||||||
return False;
|
return False;
|
||||||
tmp= XkbAtomGetString(dpy,old_names->symbols);
|
tmp= XkbAtomGetString(old_names->symbols);
|
||||||
names->symbols= _XkbDupString(tmp);
|
names->symbols= _XkbDupString(tmp);
|
||||||
complete|= XkmSymbolsMask;
|
complete|= XkmSymbolsMask;
|
||||||
}
|
}
|
||||||
if (wantNames&XkmKeyNamesMask) {
|
if (wantNames&XkmKeyNamesMask) {
|
||||||
if (old_names->keycodes!=None) {
|
if (old_names->keycodes!=None) {
|
||||||
tmp= XkbAtomGetString(dpy,old_names->keycodes);
|
tmp= XkbAtomGetString(old_names->keycodes);
|
||||||
names->keycodes= _XkbDupString(tmp);
|
names->keycodes= _XkbDupString(tmp);
|
||||||
}
|
}
|
||||||
else wantDflts|= XkmKeyNamesMask;
|
else wantDflts|= XkmKeyNamesMask;
|
||||||
|
@ -267,7 +266,7 @@ XkbFileInfo finfo;
|
||||||
if (wantNames&XkmGeometryMask) {
|
if (wantNames&XkmGeometryMask) {
|
||||||
if (old_names->geometry==None)
|
if (old_names->geometry==None)
|
||||||
return False;
|
return False;
|
||||||
tmp= XkbAtomGetString(dpy,old_names->geometry);
|
tmp= XkbAtomGetString(old_names->geometry);
|
||||||
names->geometry= _XkbDupString(tmp);
|
names->geometry= _XkbDupString(tmp);
|
||||||
complete|= XkmGeometryMask;
|
complete|= XkmGeometryMask;
|
||||||
wantNames&= ~XkmGeometryMask;
|
wantNames&= ~XkmGeometryMask;
|
||||||
|
|
|
@ -599,13 +599,6 @@ XkbAllocGeometry(
|
||||||
XkbGeometrySizesPtr /* sizes */
|
XkbGeometrySizesPtr /* sizes */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern Status
|
|
||||||
XkbSetGeometry(
|
|
||||||
Display * /* dpy */,
|
|
||||||
unsigned /* deviceSpec */,
|
|
||||||
XkbGeometryPtr /* geom */
|
|
||||||
);
|
|
||||||
|
|
||||||
extern Bool
|
extern Bool
|
||||||
XkbComputeShapeTop(
|
XkbComputeShapeTop(
|
||||||
XkbShapePtr /* shape */,
|
XkbShapePtr /* shape */,
|
||||||
|
@ -637,19 +630,6 @@ XkbFindOverlayForKey(
|
||||||
char * /* under */
|
char * /* under */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern Status
|
|
||||||
XkbGetGeometry(
|
|
||||||
Display * /* dpy */,
|
|
||||||
XkbDescPtr /* xkb */
|
|
||||||
);
|
|
||||||
|
|
||||||
extern Status
|
|
||||||
XkbGetNamedGeometry(
|
|
||||||
Display * /* dpy */,
|
|
||||||
XkbDescPtr /* xkb */,
|
|
||||||
Atom /* name */
|
|
||||||
);
|
|
||||||
|
|
||||||
_XFUNCPROTOEND
|
_XFUNCPROTOEND
|
||||||
|
|
||||||
#endif /* _XKBGEOM_H_ */
|
#endif /* _XKBGEOM_H_ */
|
||||||
|
|
96
xkb/xkbout.c
96
xkb/xkbout.c
|
@ -52,7 +52,7 @@
|
||||||
#define VMOD_COMMENT_VALUE 2
|
#define VMOD_COMMENT_VALUE 2
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
WriteXKBVModDecl(FILE *file,Display *dpy,XkbDescPtr xkb,int showValue)
|
WriteXKBVModDecl(FILE *file,XkbDescPtr xkb,int showValue)
|
||||||
{
|
{
|
||||||
register int i,nMods;
|
register int i,nMods;
|
||||||
Atom * vmodNames;
|
Atom * vmodNames;
|
||||||
|
@ -67,7 +67,7 @@ Atom * vmodNames;
|
||||||
if ((vmodNames!=NULL)&&(vmodNames[i]!=None)) {
|
if ((vmodNames!=NULL)&&(vmodNames[i]!=None)) {
|
||||||
if (nMods==0) fprintf(file," virtual_modifiers ");
|
if (nMods==0) fprintf(file," virtual_modifiers ");
|
||||||
else fprintf(file,",");
|
else fprintf(file,",");
|
||||||
fprintf(file,"%s",XkbAtomText(dpy,vmodNames[i],XkbXKBFile));
|
fprintf(file,"%s",XkbAtomText(vmodNames[i],XkbXKBFile));
|
||||||
if ((showValue!=VMOD_HIDE_VALUE)&&
|
if ((showValue!=VMOD_HIDE_VALUE)&&
|
||||||
(xkb->server)&&(xkb->server->vmods[i]!=XkbNoModifierMask)) {
|
(xkb->server)&&(xkb->server->vmods[i]!=XkbNoModifierMask)) {
|
||||||
if (showValue==VMOD_COMMENT_VALUE) {
|
if (showValue==VMOD_COMMENT_VALUE) {
|
||||||
|
@ -92,12 +92,7 @@ Atom * vmodNames;
|
||||||
static Bool
|
static Bool
|
||||||
WriteXKBAction(FILE *file,XkbFileInfo *result,XkbAnyAction *action)
|
WriteXKBAction(FILE *file,XkbFileInfo *result,XkbAnyAction *action)
|
||||||
{
|
{
|
||||||
XkbDescPtr xkb;
|
fprintf(file,"%s",XkbActionText(result->xkb,(XkbAction *)action,XkbXKBFile));
|
||||||
Display * dpy;
|
|
||||||
|
|
||||||
xkb= result->xkb;
|
|
||||||
dpy= xkb->dpy;
|
|
||||||
fprintf(file,"%s",XkbActionText(dpy,xkb,(XkbAction *)action,XkbXKBFile));
|
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,11 +109,9 @@ XkbWriteXKBKeycodes( FILE * file,
|
||||||
Atom kcName;
|
Atom kcName;
|
||||||
register unsigned i;
|
register unsigned i;
|
||||||
XkbDescPtr xkb;
|
XkbDescPtr xkb;
|
||||||
Display * dpy;
|
|
||||||
char * alternate;
|
char * alternate;
|
||||||
|
|
||||||
xkb= result->xkb;
|
xkb= result->xkb;
|
||||||
dpy= xkb->dpy;
|
|
||||||
if ((!xkb)||(!xkb->names)||(!xkb->names->keys)) {
|
if ((!xkb)||(!xkb->names)||(!xkb->names->keys)) {
|
||||||
_XkbLibError(_XkbErrMissingNames,"XkbWriteXKBKeycodes",0);
|
_XkbLibError(_XkbErrMissingNames,"XkbWriteXKBKeycodes",0);
|
||||||
return False;
|
return False;
|
||||||
|
@ -126,7 +119,7 @@ char * alternate;
|
||||||
kcName= xkb->names->keycodes;
|
kcName= xkb->names->keycodes;
|
||||||
if (kcName!=None)
|
if (kcName!=None)
|
||||||
fprintf(file,"xkb_keycodes \"%s\" {\n",
|
fprintf(file,"xkb_keycodes \"%s\" {\n",
|
||||||
XkbAtomText(dpy,kcName,XkbXKBFile));
|
XkbAtomText(kcName,XkbXKBFile));
|
||||||
else fprintf(file,"xkb_keycodes {\n");
|
else fprintf(file,"xkb_keycodes {\n");
|
||||||
fprintf(file," minimum = %d;\n",xkb->min_key_code);
|
fprintf(file," minimum = %d;\n",xkb->min_key_code);
|
||||||
fprintf(file," maximum = %d;\n",xkb->max_key_code);
|
fprintf(file," maximum = %d;\n",xkb->max_key_code);
|
||||||
|
@ -148,7 +141,7 @@ char * alternate;
|
||||||
else type= " virtual ";
|
else type= " virtual ";
|
||||||
if (xkb->names->indicators[i]!=None) {
|
if (xkb->names->indicators[i]!=None) {
|
||||||
fprintf(file,"%sindicator %d = \"%s\";\n",type,i+1,
|
fprintf(file,"%sindicator %d = \"%s\";\n",type,i+1,
|
||||||
XkbAtomText(dpy,xkb->names->indicators[i],XkbXKBFile));
|
XkbAtomText(xkb->names->indicators[i],XkbXKBFile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,14 +168,12 @@ XkbWriteXKBKeyTypes( FILE * file,
|
||||||
XkbFileAddOnFunc addOn,
|
XkbFileAddOnFunc addOn,
|
||||||
void * priv)
|
void * priv)
|
||||||
{
|
{
|
||||||
Display * dpy;
|
|
||||||
register unsigned i,n;
|
register unsigned i,n;
|
||||||
XkbKeyTypePtr type;
|
XkbKeyTypePtr type;
|
||||||
XkbKTMapEntryPtr entry;
|
XkbKTMapEntryPtr entry;
|
||||||
XkbDescPtr xkb;
|
XkbDescPtr xkb;
|
||||||
|
|
||||||
xkb= result->xkb;
|
xkb= result->xkb;
|
||||||
dpy= xkb->dpy;
|
|
||||||
if ((!xkb)||(!xkb->map)||(!xkb->map->types)) {
|
if ((!xkb)||(!xkb->map)||(!xkb->map->types)) {
|
||||||
_XkbLibError(_XkbErrMissingTypes,"XkbWriteXKBKeyTypes",0);
|
_XkbLibError(_XkbErrMissingTypes,"XkbWriteXKBKeyTypes",0);
|
||||||
return False;
|
return False;
|
||||||
|
@ -194,27 +185,27 @@ XkbDescPtr xkb;
|
||||||
if ((xkb->names==NULL)||(xkb->names->types==None))
|
if ((xkb->names==NULL)||(xkb->names->types==None))
|
||||||
fprintf(file,"xkb_types {\n\n");
|
fprintf(file,"xkb_types {\n\n");
|
||||||
else fprintf(file,"xkb_types \"%s\" {\n\n",
|
else fprintf(file,"xkb_types \"%s\" {\n\n",
|
||||||
XkbAtomText(dpy,xkb->names->types,XkbXKBFile));
|
XkbAtomText(xkb->names->types,XkbXKBFile));
|
||||||
WriteXKBVModDecl(file,dpy,xkb,
|
WriteXKBVModDecl(file,xkb,
|
||||||
(showImplicit?VMOD_COMMENT_VALUE:VMOD_HIDE_VALUE));
|
(showImplicit?VMOD_COMMENT_VALUE:VMOD_HIDE_VALUE));
|
||||||
|
|
||||||
type= xkb->map->types;
|
type= xkb->map->types;
|
||||||
for (i=0;i<xkb->map->num_types;i++,type++) {
|
for (i=0;i<xkb->map->num_types;i++,type++) {
|
||||||
fprintf(file," type \"%s\" {\n",
|
fprintf(file," type \"%s\" {\n",
|
||||||
XkbAtomText(dpy,type->name,XkbXKBFile));
|
XkbAtomText(type->name,XkbXKBFile));
|
||||||
fprintf(file," modifiers= %s;\n",
|
fprintf(file," modifiers= %s;\n",
|
||||||
XkbVModMaskText(dpy,xkb,type->mods.real_mods,type->mods.vmods,
|
XkbVModMaskText(xkb,type->mods.real_mods,type->mods.vmods,
|
||||||
XkbXKBFile));
|
XkbXKBFile));
|
||||||
entry= type->map;
|
entry= type->map;
|
||||||
for (n=0;n<type->map_count;n++,entry++) {
|
for (n=0;n<type->map_count;n++,entry++) {
|
||||||
char *str;
|
char *str;
|
||||||
str=XkbVModMaskText(dpy,xkb,entry->mods.real_mods,entry->mods.vmods,
|
str=XkbVModMaskText(xkb,entry->mods.real_mods,entry->mods.vmods,
|
||||||
XkbXKBFile);
|
XkbXKBFile);
|
||||||
fprintf(file," map[%s]= Level%d;\n",str,entry->level+1);
|
fprintf(file," map[%s]= Level%d;\n",str,entry->level+1);
|
||||||
if ((type->preserve)&&((type->preserve[n].real_mods)||
|
if ((type->preserve)&&((type->preserve[n].real_mods)||
|
||||||
(type->preserve[n].vmods))) {
|
(type->preserve[n].vmods))) {
|
||||||
fprintf(file," preserve[%s]= ",str);
|
fprintf(file," preserve[%s]= ",str);
|
||||||
fprintf(file,"%s;\n",XkbVModMaskText(dpy,xkb,
|
fprintf(file,"%s;\n",XkbVModMaskText(xkb,
|
||||||
type->preserve[n].real_mods,
|
type->preserve[n].real_mods,
|
||||||
type->preserve[n].vmods,
|
type->preserve[n].vmods,
|
||||||
XkbXKBFile));
|
XkbXKBFile));
|
||||||
|
@ -226,7 +217,7 @@ XkbDescPtr xkb;
|
||||||
if ((*name)==None)
|
if ((*name)==None)
|
||||||
continue;
|
continue;
|
||||||
fprintf(file," level_name[Level%d]= \"%s\";\n",n+1,
|
fprintf(file," level_name[Level%d]= \"%s\";\n",n+1,
|
||||||
XkbAtomText(dpy,*name,XkbXKBFile));
|
XkbAtomText(*name,XkbXKBFile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf(file," };\n");
|
fprintf(file," };\n");
|
||||||
|
@ -248,7 +239,7 @@ WriteXKBIndicatorMap( FILE * file,
|
||||||
XkbDescPtr xkb;
|
XkbDescPtr xkb;
|
||||||
|
|
||||||
xkb= result->xkb;
|
xkb= result->xkb;
|
||||||
fprintf(file," indicator \"%s\" {\n",XkbAtomGetString(xkb->dpy,name));
|
fprintf(file," indicator \"%s\" {\n",XkbAtomGetString(name));
|
||||||
if (led->flags&XkbIM_NoExplicit)
|
if (led->flags&XkbIM_NoExplicit)
|
||||||
fprintf(file," !allowExplicit;\n");
|
fprintf(file," !allowExplicit;\n");
|
||||||
if (led->flags&XkbIM_LEDDrivesKB)
|
if (led->flags&XkbIM_LEDDrivesKB)
|
||||||
|
@ -266,7 +257,7 @@ XkbDescPtr xkb;
|
||||||
XkbIMWhichStateMaskText(led->which_mods,XkbXKBFile));
|
XkbIMWhichStateMaskText(led->which_mods,XkbXKBFile));
|
||||||
}
|
}
|
||||||
fprintf(file," modifiers= %s;\n",
|
fprintf(file," modifiers= %s;\n",
|
||||||
XkbVModMaskText(xkb->dpy,xkb,
|
XkbVModMaskText(xkb,
|
||||||
led->mods.real_mods,led->mods.vmods,
|
led->mods.real_mods,led->mods.vmods,
|
||||||
XkbXKBFile));
|
XkbXKBFile));
|
||||||
}
|
}
|
||||||
|
@ -288,13 +279,11 @@ XkbWriteXKBCompatMap( FILE * file,
|
||||||
XkbFileAddOnFunc addOn,
|
XkbFileAddOnFunc addOn,
|
||||||
void * priv)
|
void * priv)
|
||||||
{
|
{
|
||||||
Display * dpy;
|
|
||||||
register unsigned i;
|
register unsigned i;
|
||||||
XkbSymInterpretPtr interp;
|
XkbSymInterpretPtr interp;
|
||||||
XkbDescPtr xkb;
|
XkbDescPtr xkb;
|
||||||
|
|
||||||
xkb= result->xkb;
|
xkb= result->xkb;
|
||||||
dpy= xkb->dpy;
|
|
||||||
if ((!xkb)||(!xkb->compat)||(!xkb->compat->sym_interpret)) {
|
if ((!xkb)||(!xkb->compat)||(!xkb->compat->sym_interpret)) {
|
||||||
_XkbLibError(_XkbErrMissingCompatMap,"XkbWriteXKBCompatMap",0);
|
_XkbLibError(_XkbErrMissingCompatMap,"XkbWriteXKBCompatMap",0);
|
||||||
return False;
|
return False;
|
||||||
|
@ -302,8 +291,8 @@ XkbDescPtr xkb;
|
||||||
if ((xkb->names==NULL)||(xkb->names->compat==None))
|
if ((xkb->names==NULL)||(xkb->names->compat==None))
|
||||||
fprintf(file,"xkb_compatibility {\n\n");
|
fprintf(file,"xkb_compatibility {\n\n");
|
||||||
else fprintf(file,"xkb_compatibility \"%s\" {\n\n",
|
else fprintf(file,"xkb_compatibility \"%s\" {\n\n",
|
||||||
XkbAtomText(dpy,xkb->names->compat,XkbXKBFile));
|
XkbAtomText(xkb->names->compat,XkbXKBFile));
|
||||||
WriteXKBVModDecl(file,dpy,xkb,
|
WriteXKBVModDecl(file,xkb,
|
||||||
(showImplicit?VMOD_COMMENT_VALUE:VMOD_HIDE_VALUE));
|
(showImplicit?VMOD_COMMENT_VALUE:VMOD_HIDE_VALUE));
|
||||||
|
|
||||||
fprintf(file," interpret.useModMapMods= AnyLevel;\n");
|
fprintf(file," interpret.useModMapMods= AnyLevel;\n");
|
||||||
|
@ -318,7 +307,7 @@ XkbDescPtr xkb;
|
||||||
XkbModMaskText(interp->mods,XkbXKBFile));
|
XkbModMaskText(interp->mods,XkbXKBFile));
|
||||||
if (interp->virtual_mod!=XkbNoModifier) {
|
if (interp->virtual_mod!=XkbNoModifier) {
|
||||||
fprintf(file," virtualModifier= %s;\n",
|
fprintf(file," virtualModifier= %s;\n",
|
||||||
XkbVModIndexText(dpy,xkb,interp->virtual_mod,XkbXKBFile));
|
XkbVModIndexText(xkb,interp->virtual_mod,XkbXKBFile));
|
||||||
}
|
}
|
||||||
if (interp->match&XkbSI_LevelOneOnly)
|
if (interp->match&XkbSI_LevelOneOnly)
|
||||||
fprintf(file," useModMapMods=level1;\n");
|
fprintf(file," useModMapMods=level1;\n");
|
||||||
|
@ -337,7 +326,7 @@ XkbDescPtr xkb;
|
||||||
gc= &xkb->compat->groups[i];
|
gc= &xkb->compat->groups[i];
|
||||||
if ((gc->real_mods==0)&&(gc->vmods==0))
|
if ((gc->real_mods==0)&&(gc->vmods==0))
|
||||||
continue;
|
continue;
|
||||||
fprintf(file," group %d = %s;\n",i+1,XkbVModMaskText(xkb->dpy,xkb,
|
fprintf(file," group %d = %s;\n",i+1,XkbVModMaskText(xkb,
|
||||||
gc->real_mods,gc->vmods,
|
gc->real_mods,gc->vmods,
|
||||||
XkbXKBFile));
|
XkbXKBFile));
|
||||||
}
|
}
|
||||||
|
@ -367,7 +356,6 @@ XkbWriteXKBSymbols( FILE * file,
|
||||||
XkbFileAddOnFunc addOn,
|
XkbFileAddOnFunc addOn,
|
||||||
void * priv)
|
void * priv)
|
||||||
{
|
{
|
||||||
Display * dpy;
|
|
||||||
register unsigned i,tmp;
|
register unsigned i,tmp;
|
||||||
XkbDescPtr xkb;
|
XkbDescPtr xkb;
|
||||||
XkbClientMapPtr map;
|
XkbClientMapPtr map;
|
||||||
|
@ -377,7 +365,6 @@ Bool showActions;
|
||||||
xkb= result->xkb;
|
xkb= result->xkb;
|
||||||
map= xkb->map;
|
map= xkb->map;
|
||||||
srv= xkb->server;
|
srv= xkb->server;
|
||||||
dpy= xkb->dpy;
|
|
||||||
if ((!xkb)||(!map)||(!map->syms)||(!map->key_sym_map)) {
|
if ((!xkb)||(!map)||(!map->syms)||(!map->key_sym_map)) {
|
||||||
_XkbLibError(_XkbErrMissingSymbols,"XkbWriteXKBSymbols",0);
|
_XkbLibError(_XkbErrMissingSymbols,"XkbWriteXKBSymbols",0);
|
||||||
return False;
|
return False;
|
||||||
|
@ -389,11 +376,11 @@ Bool showActions;
|
||||||
if ((xkb->names==NULL)||(xkb->names->symbols==None))
|
if ((xkb->names==NULL)||(xkb->names->symbols==None))
|
||||||
fprintf(file,"xkb_symbols {\n\n");
|
fprintf(file,"xkb_symbols {\n\n");
|
||||||
else fprintf(file,"xkb_symbols \"%s\" {\n\n",
|
else fprintf(file,"xkb_symbols \"%s\" {\n\n",
|
||||||
XkbAtomText(dpy,xkb->names->symbols,XkbXKBFile));
|
XkbAtomText(xkb->names->symbols,XkbXKBFile));
|
||||||
for (tmp=i=0;i<XkbNumKbdGroups;i++) {
|
for (tmp=i=0;i<XkbNumKbdGroups;i++) {
|
||||||
if (xkb->names->groups[i]!=None) {
|
if (xkb->names->groups[i]!=None) {
|
||||||
fprintf(file," name[group%d]=\"%s\";\n",i+1,
|
fprintf(file," name[group%d]=\"%s\";\n",i+1,
|
||||||
XkbAtomText(dpy,xkb->names->groups[i],XkbXKBFile));
|
XkbAtomText(xkb->names->groups[i],XkbXKBFile));
|
||||||
tmp++;
|
tmp++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -429,19 +416,19 @@ Bool showActions;
|
||||||
if (srv->explicit[i]&(1<<g)) {
|
if (srv->explicit[i]&(1<<g)) {
|
||||||
fprintf(file,"\n%s type[group%d]= \"%s\",",
|
fprintf(file,"\n%s type[group%d]= \"%s\",",
|
||||||
comment,g+1,
|
comment,g+1,
|
||||||
XkbAtomText(dpy,map->types[typeNdx].name,
|
XkbAtomText(map->types[typeNdx].name,
|
||||||
XkbXKBFile));
|
XkbXKBFile));
|
||||||
}
|
}
|
||||||
else if (showImplicit) {
|
else if (showImplicit) {
|
||||||
fprintf(file,"\n// type[group%d]= \"%s\",",g+1,
|
fprintf(file,"\n// type[group%d]= \"%s\",",g+1,
|
||||||
XkbAtomText(dpy,map->types[typeNdx].name,
|
XkbAtomText(map->types[typeNdx].name,
|
||||||
XkbXKBFile));
|
XkbXKBFile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fprintf(file,"\n%s type= \"%s\",",comment,
|
fprintf(file,"\n%s type= \"%s\",",comment,
|
||||||
XkbAtomText(dpy,map->types[typeNdx].name,
|
XkbAtomText(map->types[typeNdx].name,
|
||||||
XkbXKBFile));
|
XkbXKBFile));
|
||||||
}
|
}
|
||||||
simple= False;
|
simple= False;
|
||||||
|
@ -457,13 +444,13 @@ Bool showActions;
|
||||||
(xkb->server->vmodmap[i]!=0)) {
|
(xkb->server->vmodmap[i]!=0)) {
|
||||||
if ((srv->explicit[i]&XkbExplicitVModMapMask)!=0) {
|
if ((srv->explicit[i]&XkbExplicitVModMapMask)!=0) {
|
||||||
fprintf(file,"\n virtualMods= %s,",
|
fprintf(file,"\n virtualMods= %s,",
|
||||||
XkbVModMaskText(dpy,xkb,0,
|
XkbVModMaskText(xkb,0,
|
||||||
xkb->server->vmodmap[i],
|
xkb->server->vmodmap[i],
|
||||||
XkbXKBFile));
|
XkbXKBFile));
|
||||||
}
|
}
|
||||||
else if (showImplicit) {
|
else if (showImplicit) {
|
||||||
fprintf(file,"\n// virtualMods= %s,",
|
fprintf(file,"\n// virtualMods= %s,",
|
||||||
XkbVModMaskText(dpy,xkb,0,
|
XkbVModMaskText(xkb,0,
|
||||||
xkb->server->vmodmap[i],
|
xkb->server->vmodmap[i],
|
||||||
XkbXKBFile));
|
XkbXKBFile));
|
||||||
}
|
}
|
||||||
|
@ -603,7 +590,6 @@ char * iStr;
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
WriteXKBDoodad( FILE * file,
|
WriteXKBDoodad( FILE * file,
|
||||||
Display * dpy,
|
|
||||||
unsigned indent,
|
unsigned indent,
|
||||||
XkbGeometryPtr geom,
|
XkbGeometryPtr geom,
|
||||||
XkbDoodadPtr doodad)
|
XkbDoodadPtr doodad)
|
||||||
|
@ -615,7 +601,7 @@ XkbColorPtr color;
|
||||||
i_str= XkbIndentText(indent);
|
i_str= XkbIndentText(indent);
|
||||||
fprintf(file,"%s%s \"%s\" {\n",i_str,
|
fprintf(file,"%s%s \"%s\" {\n",i_str,
|
||||||
XkbDoodadTypeText(doodad->any.type,XkbMessage),
|
XkbDoodadTypeText(doodad->any.type,XkbMessage),
|
||||||
XkbAtomText(dpy,doodad->any.name,XkbMessage));
|
XkbAtomText(doodad->any.name,XkbMessage));
|
||||||
fprintf(file,"%s top= %s;\n",i_str,
|
fprintf(file,"%s top= %s;\n",i_str,
|
||||||
XkbGeomFPText(doodad->any.top,XkbXKBFile));
|
XkbGeomFPText(doodad->any.top,XkbXKBFile));
|
||||||
fprintf(file,"%s left= %s;\n",i_str,
|
fprintf(file,"%s left= %s;\n",i_str,
|
||||||
|
@ -634,7 +620,7 @@ XkbColorPtr color;
|
||||||
}
|
}
|
||||||
shape= XkbShapeDoodadShape(geom,&doodad->shape);
|
shape= XkbShapeDoodadShape(geom,&doodad->shape);
|
||||||
fprintf(file,"%s shape= \"%s\";\n",i_str,
|
fprintf(file,"%s shape= \"%s\";\n",i_str,
|
||||||
XkbAtomText(dpy,shape->name,XkbXKBFile));
|
XkbAtomText(shape->name,XkbXKBFile));
|
||||||
break;
|
break;
|
||||||
case XkbTextDoodad:
|
case XkbTextDoodad:
|
||||||
if (doodad->text.angle!=0) {
|
if (doodad->text.angle!=0) {
|
||||||
|
@ -670,7 +656,7 @@ XkbColorPtr color;
|
||||||
fprintf(file,"%s offColor= \"%s\";\n",i_str,
|
fprintf(file,"%s offColor= \"%s\";\n",i_str,
|
||||||
XkbStringText(color->spec,XkbXKBFile));
|
XkbStringText(color->spec,XkbXKBFile));
|
||||||
fprintf(file,"%s shape= \"%s\";\n",i_str,
|
fprintf(file,"%s shape= \"%s\";\n",i_str,
|
||||||
XkbAtomText(dpy,shape->name,XkbXKBFile));
|
XkbAtomText(shape->name,XkbXKBFile));
|
||||||
break;
|
break;
|
||||||
case XkbLogoDoodad:
|
case XkbLogoDoodad:
|
||||||
fprintf(file,"%s logoName= \"%s\";\n",i_str,
|
fprintf(file,"%s logoName= \"%s\";\n",i_str,
|
||||||
|
@ -685,7 +671,7 @@ XkbColorPtr color;
|
||||||
}
|
}
|
||||||
shape= XkbLogoDoodadShape(geom,&doodad->logo);
|
shape= XkbLogoDoodadShape(geom,&doodad->logo);
|
||||||
fprintf(file,"%s shape= \"%s\";\n",i_str,
|
fprintf(file,"%s shape= \"%s\";\n",i_str,
|
||||||
XkbAtomText(dpy,shape->name,XkbXKBFile));
|
XkbAtomText(shape->name,XkbXKBFile));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fprintf(file,"%s};\n",i_str);
|
fprintf(file,"%s};\n",i_str);
|
||||||
|
@ -695,7 +681,6 @@ XkbColorPtr color;
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static Bool
|
static Bool
|
||||||
WriteXKBOverlay( FILE * file,
|
WriteXKBOverlay( FILE * file,
|
||||||
Display * dpy,
|
|
||||||
unsigned indent,
|
unsigned indent,
|
||||||
XkbGeometryPtr geom,
|
XkbGeometryPtr geom,
|
||||||
XkbOverlayPtr ol)
|
XkbOverlayPtr ol)
|
||||||
|
@ -708,7 +693,7 @@ XkbOverlayKeyPtr key;
|
||||||
i_str= XkbIndentText(indent);
|
i_str= XkbIndentText(indent);
|
||||||
if (ol->name!=None) {
|
if (ol->name!=None) {
|
||||||
fprintf(file,"%soverlay \"%s\" {\n",i_str,
|
fprintf(file,"%soverlay \"%s\" {\n",i_str,
|
||||||
XkbAtomText(dpy,ol->name,XkbMessage));
|
XkbAtomText(ol->name,XkbMessage));
|
||||||
}
|
}
|
||||||
else fprintf(file,"%soverlay {\n",i_str);
|
else fprintf(file,"%soverlay {\n",i_str);
|
||||||
for (nOut=r=0,row=ol->rows;r<ol->num_rows;r++,row++) {
|
for (nOut=r=0,row=ol->rows;r<ol->num_rows;r++,row++) {
|
||||||
|
@ -730,7 +715,6 @@ XkbOverlayKeyPtr key;
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
WriteXKBSection( FILE * file,
|
WriteXKBSection( FILE * file,
|
||||||
Display * dpy,
|
|
||||||
XkbSectionPtr s,
|
XkbSectionPtr s,
|
||||||
XkbGeometryPtr geom)
|
XkbGeometryPtr geom)
|
||||||
{
|
{
|
||||||
|
@ -739,7 +723,7 @@ XkbRowPtr row;
|
||||||
int dfltKeyColor = 0;
|
int dfltKeyColor = 0;
|
||||||
|
|
||||||
fprintf(file," section \"%s\" {\n",
|
fprintf(file," section \"%s\" {\n",
|
||||||
XkbAtomText(dpy,s->name,XkbXKBFile));
|
XkbAtomText(s->name,XkbXKBFile));
|
||||||
if (s->rows&&(s->rows->num_keys>0)) {
|
if (s->rows&&(s->rows->num_keys>0)) {
|
||||||
dfltKeyColor= s->rows->keys[0].color_ndx;
|
dfltKeyColor= s->rows->keys[0].color_ndx;
|
||||||
fprintf(file," key.color= \"%s\";\n",
|
fprintf(file," key.color= \"%s\";\n",
|
||||||
|
@ -788,7 +772,7 @@ int dfltKeyColor = 0;
|
||||||
shape= XkbKeyShape(geom,key);
|
shape= XkbKeyShape(geom,key);
|
||||||
fprintf(file,"{ %6s, \"%s\", %3s",
|
fprintf(file,"{ %6s, \"%s\", %3s",
|
||||||
XkbKeyNameText(key->name.name,XkbXKBFile),
|
XkbKeyNameText(key->name.name,XkbXKBFile),
|
||||||
XkbAtomText(dpy,shape->name,XkbXKBFile),
|
XkbAtomText(shape->name,XkbXKBFile),
|
||||||
XkbGeomFPText(key->gap,XkbXKBFile));
|
XkbGeomFPText(key->gap,XkbXKBFile));
|
||||||
if (key->color_ndx!=dfltKeyColor) {
|
if (key->color_ndx!=dfltKeyColor) {
|
||||||
fprintf(file,", color=\"%s\"",XkbKeyColor(geom,key)->spec);
|
fprintf(file,", color=\"%s\"",XkbKeyColor(geom,key)->spec);
|
||||||
|
@ -803,17 +787,17 @@ int dfltKeyColor = 0;
|
||||||
if (s->doodads!=NULL) {
|
if (s->doodads!=NULL) {
|
||||||
XkbDoodadPtr doodad;
|
XkbDoodadPtr doodad;
|
||||||
for (i=0,doodad=s->doodads;i<s->num_doodads;i++,doodad++) {
|
for (i=0,doodad=s->doodads;i<s->num_doodads;i++,doodad++) {
|
||||||
WriteXKBDoodad(file,dpy,8,geom,doodad);
|
WriteXKBDoodad(file,8,geom,doodad);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (s->overlays!=NULL) {
|
if (s->overlays!=NULL) {
|
||||||
XkbOverlayPtr ol;
|
XkbOverlayPtr ol;
|
||||||
for (i=0,ol=s->overlays;i<s->num_overlays;i++,ol++) {
|
for (i=0,ol=s->overlays;i<s->num_overlays;i++,ol++) {
|
||||||
WriteXKBOverlay(file,dpy,8,geom,ol);
|
WriteXKBOverlay(file,8,geom,ol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf(file," }; // End of \"%s\" section\n\n",
|
fprintf(file," }; // End of \"%s\" section\n\n",
|
||||||
XkbAtomText(dpy,s->name,XkbXKBFile));
|
XkbAtomText(s->name,XkbXKBFile));
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -825,7 +809,6 @@ XkbWriteXKBGeometry( FILE * file,
|
||||||
XkbFileAddOnFunc addOn,
|
XkbFileAddOnFunc addOn,
|
||||||
void * priv)
|
void * priv)
|
||||||
{
|
{
|
||||||
Display * dpy;
|
|
||||||
register unsigned i,n;
|
register unsigned i,n;
|
||||||
XkbDescPtr xkb;
|
XkbDescPtr xkb;
|
||||||
XkbGeometryPtr geom;
|
XkbGeometryPtr geom;
|
||||||
|
@ -835,12 +818,11 @@ XkbGeometryPtr geom;
|
||||||
_XkbLibError(_XkbErrMissingGeometry,"XkbWriteXKBGeometry",0);
|
_XkbLibError(_XkbErrMissingGeometry,"XkbWriteXKBGeometry",0);
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
dpy= xkb->dpy;
|
|
||||||
geom= xkb->geom;
|
geom= xkb->geom;
|
||||||
if (geom->name==None)
|
if (geom->name==None)
|
||||||
fprintf(file,"xkb_geometry {\n\n");
|
fprintf(file,"xkb_geometry {\n\n");
|
||||||
else fprintf(file,"xkb_geometry \"%s\" {\n\n",
|
else fprintf(file,"xkb_geometry \"%s\" {\n\n",
|
||||||
XkbAtomText(dpy,geom->name,XkbXKBFile));
|
XkbAtomText(geom->name,XkbXKBFile));
|
||||||
fprintf(file," width= %s;\n",
|
fprintf(file," width= %s;\n",
|
||||||
XkbGeomFPText(geom->width_mm,XkbXKBFile));
|
XkbGeomFPText(geom->width_mm,XkbXKBFile));
|
||||||
fprintf(file," height= %s;\n\n",
|
fprintf(file," height= %s;\n\n",
|
||||||
|
@ -889,7 +871,7 @@ XkbGeometryPtr geom;
|
||||||
for (shape=geom->shapes,i=0;i<geom->num_shapes;i++,shape++) {
|
for (shape=geom->shapes,i=0;i<geom->num_shapes;i++,shape++) {
|
||||||
lastR=0;
|
lastR=0;
|
||||||
fprintf(file," shape \"%s\" {",
|
fprintf(file," shape \"%s\" {",
|
||||||
XkbAtomText(dpy,shape->name,XkbXKBFile));
|
XkbAtomText(shape->name,XkbXKBFile));
|
||||||
outline= shape->outlines;
|
outline= shape->outlines;
|
||||||
if (shape->num_outlines>1) {
|
if (shape->num_outlines>1) {
|
||||||
for (n=0;n<shape->num_outlines;n++,outline++) {
|
for (n=0;n<shape->num_outlines;n++,outline++) {
|
||||||
|
@ -909,13 +891,13 @@ XkbGeometryPtr geom;
|
||||||
if (geom->num_sections>0) {
|
if (geom->num_sections>0) {
|
||||||
XkbSectionPtr section;
|
XkbSectionPtr section;
|
||||||
for (section=geom->sections,i=0;i<geom->num_sections;i++,section++){
|
for (section=geom->sections,i=0;i<geom->num_sections;i++,section++){
|
||||||
WriteXKBSection(file,dpy,section,geom);
|
WriteXKBSection(file,section,geom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (geom->num_doodads>0) {
|
if (geom->num_doodads>0) {
|
||||||
XkbDoodadPtr doodad;
|
XkbDoodadPtr doodad;
|
||||||
for (i=0,doodad=geom->doodads;i<geom->num_doodads;i++,doodad++) {
|
for (i=0,doodad=geom->doodads;i<geom->num_doodads;i++,doodad++) {
|
||||||
WriteXKBDoodad(file,dpy,4,geom,doodad);
|
WriteXKBDoodad(file,4,geom,doodad);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (addOn)
|
if (addOn)
|
||||||
|
|
|
@ -69,11 +69,11 @@ char *rtrn;
|
||||||
/***====================================================================***/
|
/***====================================================================***/
|
||||||
|
|
||||||
char *
|
char *
|
||||||
XkbAtomText(Display *dpy,Atom atm,unsigned format)
|
XkbAtomText(Atom atm,unsigned format)
|
||||||
{
|
{
|
||||||
char *rtrn,*tmp;
|
char *rtrn,*tmp;
|
||||||
|
|
||||||
tmp= XkbAtomGetString(dpy,atm);
|
tmp= XkbAtomGetString(atm);
|
||||||
if (tmp!=NULL) {
|
if (tmp!=NULL) {
|
||||||
int len;
|
int len;
|
||||||
len= strlen(tmp)+1;
|
len= strlen(tmp)+1;
|
||||||
|
@ -101,7 +101,7 @@ char *rtrn,*tmp;
|
||||||
/***====================================================================***/
|
/***====================================================================***/
|
||||||
|
|
||||||
char *
|
char *
|
||||||
XkbVModIndexText(Display *dpy,XkbDescPtr xkb,unsigned ndx,unsigned format)
|
XkbVModIndexText(XkbDescPtr xkb,unsigned ndx,unsigned format)
|
||||||
{
|
{
|
||||||
register int len;
|
register int len;
|
||||||
register Atom *vmodNames;
|
register Atom *vmodNames;
|
||||||
|
@ -116,7 +116,7 @@ char numBuf[20];
|
||||||
if (ndx>=XkbNumVirtualMods)
|
if (ndx>=XkbNumVirtualMods)
|
||||||
tmp= "illegal";
|
tmp= "illegal";
|
||||||
else if (vmodNames&&(vmodNames[ndx]!=None))
|
else if (vmodNames&&(vmodNames[ndx]!=None))
|
||||||
tmp= XkbAtomGetString(dpy,vmodNames[ndx]);
|
tmp= XkbAtomGetString(vmodNames[ndx]);
|
||||||
if (tmp==NULL)
|
if (tmp==NULL)
|
||||||
sprintf(tmp=numBuf,"%d",ndx);
|
sprintf(tmp=numBuf,"%d",ndx);
|
||||||
|
|
||||||
|
@ -135,8 +135,7 @@ char numBuf[20];
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
XkbVModMaskText( Display * dpy,
|
XkbVModMaskText( XkbDescPtr xkb,
|
||||||
XkbDescPtr xkb,
|
|
||||||
unsigned modMask,
|
unsigned modMask,
|
||||||
unsigned mask,
|
unsigned mask,
|
||||||
unsigned format)
|
unsigned format)
|
||||||
|
@ -163,7 +162,7 @@ char *str,buf[BUFFER_SIZE];
|
||||||
char *tmp;
|
char *tmp;
|
||||||
for (i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
|
for (i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
|
||||||
if (mask&bit) {
|
if (mask&bit) {
|
||||||
tmp= XkbVModIndexText(dpy,xkb,i,format);
|
tmp= XkbVModIndexText(xkb,i,format);
|
||||||
len= strlen(tmp)+1+(str==buf?0:1);
|
len= strlen(tmp)+1+(str==buf?0:1);
|
||||||
if (format==XkbCFile)
|
if (format==XkbCFile)
|
||||||
len+= 4;
|
len+= 4;
|
||||||
|
@ -667,13 +666,13 @@ register int len;
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static Bool
|
static Bool
|
||||||
CopyNoActionArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int*sz)
|
CopyNoActionArgs(XkbDescPtr xkb,XkbAction *action,char *buf,int*sz)
|
||||||
{
|
{
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
CopyModActionArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,
|
CopyModActionArgs(XkbDescPtr xkb,XkbAction *action,char *buf,
|
||||||
int* sz)
|
int* sz)
|
||||||
{
|
{
|
||||||
XkbModAction * act;
|
XkbModAction * act;
|
||||||
|
@ -686,7 +685,7 @@ unsigned tmp;
|
||||||
TryCopyStr(buf,"modMapMods",sz);
|
TryCopyStr(buf,"modMapMods",sz);
|
||||||
else if (act->real_mods || tmp) {
|
else if (act->real_mods || tmp) {
|
||||||
TryCopyStr(buf,
|
TryCopyStr(buf,
|
||||||
XkbVModMaskText(dpy,xkb,act->real_mods,tmp,XkbXKBFile),
|
XkbVModMaskText(xkb,act->real_mods,tmp,XkbXKBFile),
|
||||||
sz);
|
sz);
|
||||||
}
|
}
|
||||||
else TryCopyStr(buf,"none",sz);
|
else TryCopyStr(buf,"none",sz);
|
||||||
|
@ -701,7 +700,7 @@ unsigned tmp;
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static Bool
|
static Bool
|
||||||
CopyGroupActionArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,
|
CopyGroupActionArgs(XkbDescPtr xkb,XkbAction *action,char *buf,
|
||||||
int *sz)
|
int *sz)
|
||||||
{
|
{
|
||||||
XkbGroupAction * act;
|
XkbGroupAction * act;
|
||||||
|
@ -726,7 +725,7 @@ char tbuf[32];
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static Bool
|
static Bool
|
||||||
CopyMovePtrArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz)
|
CopyMovePtrArgs(XkbDescPtr xkb,XkbAction *action,char *buf,int *sz)
|
||||||
{
|
{
|
||||||
XkbPtrAction * act;
|
XkbPtrAction * act;
|
||||||
int x,y;
|
int x,y;
|
||||||
|
@ -751,7 +750,7 @@ char tbuf[32];
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static Bool
|
static Bool
|
||||||
CopyPtrBtnArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz)
|
CopyPtrBtnArgs(XkbDescPtr xkb,XkbAction *action,char *buf,int *sz)
|
||||||
{
|
{
|
||||||
XkbPtrBtnAction * act;
|
XkbPtrBtnAction * act;
|
||||||
char tbuf[32];
|
char tbuf[32];
|
||||||
|
@ -785,7 +784,7 @@ char tbuf[32];
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static Bool
|
static Bool
|
||||||
CopySetPtrDfltArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,
|
CopySetPtrDfltArgs(XkbDescPtr xkb,XkbAction *action,char *buf,
|
||||||
int *sz)
|
int *sz)
|
||||||
{
|
{
|
||||||
XkbPtrDfltAction * act;
|
XkbPtrDfltAction * act;
|
||||||
|
@ -803,7 +802,7 @@ char tbuf[32];
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
CopyISOLockArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz)
|
CopyISOLockArgs(XkbDescPtr xkb,XkbAction *action,char *buf,int *sz)
|
||||||
{
|
{
|
||||||
XkbISOAction * act;
|
XkbISOAction * act;
|
||||||
char tbuf[64];
|
char tbuf[64];
|
||||||
|
@ -831,7 +830,7 @@ char tbuf[64];
|
||||||
TryCopyStr(buf,"+",sz);
|
TryCopyStr(buf,"+",sz);
|
||||||
}
|
}
|
||||||
if (tmp)
|
if (tmp)
|
||||||
TryCopyStr(buf,XkbVModMaskText(dpy,xkb,0,tmp,XkbXKBFile),sz);
|
TryCopyStr(buf,XkbVModMaskText(xkb,0,tmp,XkbXKBFile),sz);
|
||||||
}
|
}
|
||||||
else TryCopyStr(buf,"none",sz);
|
else TryCopyStr(buf,"none",sz);
|
||||||
}
|
}
|
||||||
|
@ -865,7 +864,7 @@ char tbuf[64];
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static Bool
|
static Bool
|
||||||
CopySwitchScreenArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,
|
CopySwitchScreenArgs(XkbDescPtr xkb,XkbAction *action,char *buf,
|
||||||
int *sz)
|
int *sz)
|
||||||
{
|
{
|
||||||
XkbSwitchScreenAction * act;
|
XkbSwitchScreenAction * act;
|
||||||
|
@ -884,7 +883,7 @@ char tbuf[32];
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static Bool
|
static Bool
|
||||||
CopySetLockControlsArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,
|
CopySetLockControlsArgs(XkbDescPtr xkb,XkbAction *action,
|
||||||
char *buf,int *sz)
|
char *buf,int *sz)
|
||||||
{
|
{
|
||||||
XkbCtrlsAction * act;
|
XkbCtrlsAction * act;
|
||||||
|
@ -971,7 +970,7 @@ char tbuf[32];
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static Bool
|
static Bool
|
||||||
CopyActionMessageArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,
|
CopyActionMessageArgs(XkbDescPtr xkb,XkbAction *action,char *buf,
|
||||||
int *sz)
|
int *sz)
|
||||||
{
|
{
|
||||||
XkbMessageAction * act;
|
XkbMessageAction * act;
|
||||||
|
@ -998,7 +997,7 @@ char tbuf[32];
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
CopyRedirectKeyArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,
|
CopyRedirectKeyArgs(XkbDescPtr xkb,XkbAction *action,char *buf,
|
||||||
int *sz)
|
int *sz)
|
||||||
{
|
{
|
||||||
XkbRedirectKeyAction * act;
|
XkbRedirectKeyAction * act;
|
||||||
|
@ -1022,19 +1021,19 @@ unsigned vmods,vmods_mask;
|
||||||
return True;
|
return True;
|
||||||
if ((act->mods_mask==XkbAllModifiersMask)&&
|
if ((act->mods_mask==XkbAllModifiersMask)&&
|
||||||
(vmods_mask==XkbAllVirtualModsMask)) {
|
(vmods_mask==XkbAllVirtualModsMask)) {
|
||||||
tmp= XkbVModMaskText(dpy,xkb,act->mods,vmods,XkbXKBFile);
|
tmp= XkbVModMaskText(xkb,act->mods,vmods,XkbXKBFile);
|
||||||
TryCopyStr(buf,",mods=",sz);
|
TryCopyStr(buf,",mods=",sz);
|
||||||
TryCopyStr(buf,tmp,sz);
|
TryCopyStr(buf,tmp,sz);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ((act->mods_mask&act->mods)||(vmods_mask&vmods)) {
|
if ((act->mods_mask&act->mods)||(vmods_mask&vmods)) {
|
||||||
tmp= XkbVModMaskText(dpy,xkb,act->mods_mask&act->mods,
|
tmp= XkbVModMaskText(xkb,act->mods_mask&act->mods,
|
||||||
vmods_mask&vmods,XkbXKBFile);
|
vmods_mask&vmods,XkbXKBFile);
|
||||||
TryCopyStr(buf,",mods= ",sz);
|
TryCopyStr(buf,",mods= ",sz);
|
||||||
TryCopyStr(buf,tmp,sz);
|
TryCopyStr(buf,tmp,sz);
|
||||||
}
|
}
|
||||||
if ((act->mods_mask&(~act->mods))||(vmods_mask&(~vmods))) {
|
if ((act->mods_mask&(~act->mods))||(vmods_mask&(~vmods))) {
|
||||||
tmp= XkbVModMaskText(dpy,xkb,act->mods_mask&(~act->mods),
|
tmp= XkbVModMaskText(xkb,act->mods_mask&(~act->mods),
|
||||||
vmods_mask&(~vmods),XkbXKBFile);
|
vmods_mask&(~vmods),XkbXKBFile);
|
||||||
TryCopyStr(buf,",clearMods= ",sz);
|
TryCopyStr(buf,",clearMods= ",sz);
|
||||||
TryCopyStr(buf,tmp,sz);
|
TryCopyStr(buf,tmp,sz);
|
||||||
|
@ -1045,7 +1044,7 @@ unsigned vmods,vmods_mask;
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static Bool
|
static Bool
|
||||||
CopyDeviceBtnArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,
|
CopyDeviceBtnArgs(XkbDescPtr xkb,XkbAction *action,char *buf,
|
||||||
int *sz)
|
int *sz)
|
||||||
{
|
{
|
||||||
XkbDeviceBtnAction * act;
|
XkbDeviceBtnAction * act;
|
||||||
|
@ -1078,7 +1077,7 @@ char tbuf[32];
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static Bool
|
static Bool
|
||||||
CopyOtherArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz)
|
CopyOtherArgs(XkbDescPtr xkb,XkbAction *action,char *buf,int *sz)
|
||||||
{
|
{
|
||||||
XkbAnyAction * act;
|
XkbAnyAction * act;
|
||||||
char tbuf[32];
|
char tbuf[32];
|
||||||
|
@ -1096,7 +1095,6 @@ char tbuf[32];
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef Bool (*actionCopy)(
|
typedef Bool (*actionCopy)(
|
||||||
Display * /* dpy */,
|
|
||||||
XkbDescPtr /* xkb */,
|
XkbDescPtr /* xkb */,
|
||||||
XkbAction * /* action */,
|
XkbAction * /* action */,
|
||||||
char * /* buf */,
|
char * /* buf */,
|
||||||
|
@ -1128,7 +1126,7 @@ static actionCopy copyActionArgs[XkbSA_NumActions] = {
|
||||||
#define ACTION_SZ 256
|
#define ACTION_SZ 256
|
||||||
|
|
||||||
char *
|
char *
|
||||||
XkbActionText(Display *dpy,XkbDescPtr xkb,XkbAction *action,unsigned format)
|
XkbActionText(XkbDescPtr xkb,XkbAction *action,unsigned format)
|
||||||
{
|
{
|
||||||
char buf[ACTION_SZ],*tmp;
|
char buf[ACTION_SZ],*tmp;
|
||||||
int sz;
|
int sz;
|
||||||
|
@ -1145,8 +1143,8 @@ int sz;
|
||||||
sprintf(buf,"%s(",XkbActionTypeText(action->type,XkbXKBFile));
|
sprintf(buf,"%s(",XkbActionTypeText(action->type,XkbXKBFile));
|
||||||
sz= ACTION_SZ-strlen(buf)+2; /* room for close paren and NULL */
|
sz= ACTION_SZ-strlen(buf)+2; /* room for close paren and NULL */
|
||||||
if (action->type<(unsigned)XkbSA_NumActions)
|
if (action->type<(unsigned)XkbSA_NumActions)
|
||||||
(*copyActionArgs[action->type])(dpy,xkb,action,buf,&sz);
|
(*copyActionArgs[action->type])(xkb,action,buf,&sz);
|
||||||
else CopyOtherArgs(dpy,xkb,action,buf,&sz);
|
else CopyOtherArgs(xkb,action,buf,&sz);
|
||||||
TryCopyStr(buf,")",&sz);
|
TryCopyStr(buf,")",&sz);
|
||||||
}
|
}
|
||||||
tmp= tbGetBuffer(strlen(buf)+1);
|
tmp= tbGetBuffer(strlen(buf)+1);
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#include "xkbgeom.h"
|
#include "xkbgeom.h"
|
||||||
|
|
||||||
Atom
|
Atom
|
||||||
XkbInternAtom(Display *dpy,char *str,Bool only_if_exists)
|
XkbInternAtom(char *str,Bool only_if_exists)
|
||||||
{
|
{
|
||||||
if (str==NULL)
|
if (str==NULL)
|
||||||
return None;
|
return None;
|
||||||
|
@ -66,18 +66,18 @@ char *new;
|
||||||
|
|
||||||
/***====================================================================***/
|
/***====================================================================***/
|
||||||
|
|
||||||
static XPointer
|
static void *
|
||||||
XkmInsureSize(XPointer oldPtr,int oldCount,int *newCountRtrn,int elemSize)
|
XkmInsureSize(void *oldPtr,int oldCount,int *newCountRtrn,int elemSize)
|
||||||
{
|
{
|
||||||
int newCount= *newCountRtrn;
|
int newCount= *newCountRtrn;
|
||||||
|
|
||||||
if (oldPtr==NULL) {
|
if (oldPtr==NULL) {
|
||||||
if (newCount==0)
|
if (newCount==0)
|
||||||
return NULL;
|
return NULL;
|
||||||
oldPtr= (XPointer)_XkbCalloc(newCount,elemSize);
|
oldPtr= _XkbCalloc(newCount,elemSize);
|
||||||
}
|
}
|
||||||
else if (oldCount<newCount) {
|
else if (oldCount<newCount) {
|
||||||
oldPtr= (XPointer)_XkbRealloc(oldPtr,newCount*elemSize);
|
oldPtr= _XkbRealloc(oldPtr,newCount*elemSize);
|
||||||
if (oldPtr!=NULL) {
|
if (oldPtr!=NULL) {
|
||||||
char *tmp= (char *)oldPtr;
|
char *tmp= (char *)oldPtr;
|
||||||
bzero(&tmp[oldCount*elemSize],(newCount-oldCount)*elemSize);
|
bzero(&tmp[oldCount*elemSize],(newCount-oldCount)*elemSize);
|
||||||
|
@ -197,7 +197,7 @@ XkbDescPtr xkb;
|
||||||
char name[100];
|
char name[100];
|
||||||
if (named&bit) {
|
if (named&bit) {
|
||||||
if (nRead+=XkmGetCountedString(file,name,100)) {
|
if (nRead+=XkmGetCountedString(file,name,100)) {
|
||||||
xkb->names->vmods[i]= XkbInternAtom(xkb->dpy,name,False);
|
xkb->names->vmods[i]= XkbInternAtom(name,False);
|
||||||
if (changes)
|
if (changes)
|
||||||
changes->names.changed_vmods|= bit;
|
changes->names.changed_vmods|= bit;
|
||||||
}
|
}
|
||||||
|
@ -244,7 +244,7 @@ XkbDescPtr xkb;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (name[0]!='\0') {
|
if (name[0]!='\0') {
|
||||||
xkb->names->keycodes= XkbInternAtom(xkb->dpy,name,False);
|
xkb->names->keycodes= XkbInternAtom(name,False);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (pN=&xkb->names->keys[minKC],i=minKC;i<=(int)maxKC;i++,pN++) {
|
for (pN=&xkb->names->keys[minKC],i=minKC;i<=(int)maxKC;i++,pN++) {
|
||||||
|
@ -300,7 +300,7 @@ XkbDescPtr xkb;
|
||||||
_XkbLibError(_XkbErrBadAlloc,"ReadXkmKeyTypes",0);
|
_XkbLibError(_XkbErrBadAlloc,"ReadXkmKeyTypes",0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
xkb->names->types= XkbInternAtom(xkb->dpy,buf,False);
|
xkb->names->types= XkbInternAtom(buf,False);
|
||||||
}
|
}
|
||||||
num_types= XkmGetCARD16(file,&nRead);
|
num_types= XkmGetCARD16(file,&nRead);
|
||||||
nRead+= XkmSkipPadding(file,2);
|
nRead+= XkmSkipPadding(file,2);
|
||||||
|
@ -355,7 +355,7 @@ XkbDescPtr xkb;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (buf[0]!='\0') {
|
if (buf[0]!='\0') {
|
||||||
type->name= XkbInternAtom(xkb->dpy,buf,False);
|
type->name= XkbInternAtom(buf,False);
|
||||||
}
|
}
|
||||||
else type->name= None;
|
else type->name= None;
|
||||||
|
|
||||||
|
@ -393,7 +393,7 @@ XkbDescPtr xkb;
|
||||||
nRead+= tmp;
|
nRead+= tmp;
|
||||||
if (strlen(buf)==0)
|
if (strlen(buf)==0)
|
||||||
type->level_names[n]= None;
|
type->level_names[n]= None;
|
||||||
else type->level_names[n]= XkbInternAtom(xkb->dpy,buf,0);
|
else type->level_names[n]= XkbInternAtom(buf,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -437,7 +437,7 @@ XkbCompatMapPtr compat;
|
||||||
_XkbLibError(_XkbErrBadAlloc,"ReadXkmCompatMap",0);
|
_XkbLibError(_XkbErrBadAlloc,"ReadXkmCompatMap",0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
xkb->names->compat= XkbInternAtom(xkb->dpy,name,False);
|
xkb->names->compat= XkbInternAtom(name,False);
|
||||||
}
|
}
|
||||||
num_si= XkmGetCARD16(file,&nRead);
|
num_si= XkmGetCARD16(file,&nRead);
|
||||||
groups= XkmGetCARD8(file,&nRead);
|
groups= XkmGetCARD8(file,&nRead);
|
||||||
|
@ -523,7 +523,7 @@ XkbDescPtr xkb;
|
||||||
}
|
}
|
||||||
nRead+= tmp;
|
nRead+= tmp;
|
||||||
if (buf[0]!='\0')
|
if (buf[0]!='\0')
|
||||||
name= XkbInternAtom(xkb->dpy,buf,False);
|
name= XkbInternAtom(buf,False);
|
||||||
else name= None;
|
else name= None;
|
||||||
if ((tmp=fread(&wire,SIZEOF(xkmIndicatorMapDesc),1,file))<1) {
|
if ((tmp=fread(&wire,SIZEOF(xkmIndicatorMapDesc),1,file))<1) {
|
||||||
_XkbLibError(_XkbErrBadLength,"ReadXkmIndicators",0);
|
_XkbLibError(_XkbErrBadLength,"ReadXkmIndicators",0);
|
||||||
|
@ -600,7 +600,7 @@ XkbDescPtr xkb;
|
||||||
}
|
}
|
||||||
if ((buf[0]!='\0')&&(xkb->names)) {
|
if ((buf[0]!='\0')&&(xkb->names)) {
|
||||||
Atom name;
|
Atom name;
|
||||||
name= XkbInternAtom(xkb->dpy,buf,0);
|
name= XkbInternAtom(buf,0);
|
||||||
xkb->names->symbols= name;
|
xkb->names->symbols= name;
|
||||||
xkb->names->phys_symbols= name;
|
xkb->names->phys_symbols= name;
|
||||||
}
|
}
|
||||||
|
@ -611,7 +611,7 @@ XkbDescPtr xkb;
|
||||||
nRead+= tmp;
|
nRead+= tmp;
|
||||||
if ((buf[0]!='\0')&&(xkb->names)) {
|
if ((buf[0]!='\0')&&(xkb->names)) {
|
||||||
Atom name;
|
Atom name;
|
||||||
name= XkbInternAtom(xkb->dpy,buf,0);
|
name= XkbInternAtom(buf,0);
|
||||||
xkb->names->groups[i]= name;
|
xkb->names->groups[i]= name;
|
||||||
}
|
}
|
||||||
else xkb->names->groups[i]= None;
|
else xkb->names->groups[i]= None;
|
||||||
|
@ -654,7 +654,7 @@ XkbDescPtr xkb;
|
||||||
for (g=0;g<XkbNumKbdGroups;g++) {
|
for (g=0;g<XkbNumKbdGroups;g++) {
|
||||||
if ((wireMap.flags&(1<<g))&&
|
if ((wireMap.flags&(1<<g))&&
|
||||||
((tmp=XkmGetCountedString(file,buf,100))>0)) {
|
((tmp=XkmGetCountedString(file,buf,100))>0)) {
|
||||||
typeName[g]= XkbInternAtom(xkb->dpy,buf,1);
|
typeName[g]= XkbInternAtom(buf,1);
|
||||||
nRead+= tmp;
|
nRead+= tmp;
|
||||||
}
|
}
|
||||||
type[g]=FindTypeForKey(xkb,typeName[g],wireMap.width,NULL);
|
type[g]=FindTypeForKey(xkb,typeName[g],wireMap.width,NULL);
|
||||||
|
@ -732,7 +732,6 @@ XkbDescPtr xkb;
|
||||||
static int
|
static int
|
||||||
ReadXkmGeomDoodad(
|
ReadXkmGeomDoodad(
|
||||||
FILE * file,
|
FILE * file,
|
||||||
Display * dpy,
|
|
||||||
XkbGeometryPtr geom,
|
XkbGeometryPtr geom,
|
||||||
XkbSectionPtr section)
|
XkbSectionPtr section)
|
||||||
{
|
{
|
||||||
|
@ -745,7 +744,7 @@ int nRead=0;
|
||||||
nRead+= XkmGetCountedString(file,buf,100);
|
nRead+= XkmGetCountedString(file,buf,100);
|
||||||
tmp= fread(&doodadWire,SIZEOF(xkmDoodadDesc),1,file);
|
tmp= fread(&doodadWire,SIZEOF(xkmDoodadDesc),1,file);
|
||||||
nRead+= SIZEOF(xkmDoodadDesc)*tmp;
|
nRead+= SIZEOF(xkmDoodadDesc)*tmp;
|
||||||
doodad= XkbAddGeomDoodad(geom,section,XkbInternAtom(dpy,buf,False));
|
doodad= XkbAddGeomDoodad(geom,section,XkbInternAtom(buf,False));
|
||||||
if (!doodad)
|
if (!doodad)
|
||||||
return nRead;
|
return nRead;
|
||||||
doodad->any.type= doodadWire.any.type;
|
doodad->any.type= doodadWire.any.type;
|
||||||
|
@ -790,7 +789,6 @@ int nRead=0;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ReadXkmGeomOverlay( FILE * file,
|
ReadXkmGeomOverlay( FILE * file,
|
||||||
Display * dpy,
|
|
||||||
XkbGeometryPtr geom,
|
XkbGeometryPtr geom,
|
||||||
XkbSectionPtr section)
|
XkbSectionPtr section)
|
||||||
{
|
{
|
||||||
|
@ -806,7 +804,7 @@ register int r;
|
||||||
nRead+= XkmGetCountedString(file,buf,100);
|
nRead+= XkmGetCountedString(file,buf,100);
|
||||||
tmp= fread(&olWire,SIZEOF(xkmOverlayDesc),1,file);
|
tmp= fread(&olWire,SIZEOF(xkmOverlayDesc),1,file);
|
||||||
nRead+= tmp*SIZEOF(xkmOverlayDesc);
|
nRead+= tmp*SIZEOF(xkmOverlayDesc);
|
||||||
ol= XkbAddGeomOverlay(section,XkbInternAtom(dpy,buf,False),
|
ol= XkbAddGeomOverlay(section,XkbInternAtom(buf,False),
|
||||||
olWire.num_rows);
|
olWire.num_rows);
|
||||||
if (!ol)
|
if (!ol)
|
||||||
return nRead;
|
return nRead;
|
||||||
|
@ -833,7 +831,6 @@ register int r;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ReadXkmGeomSection( FILE * file,
|
ReadXkmGeomSection( FILE * file,
|
||||||
Display * dpy,
|
|
||||||
XkbGeometryPtr geom)
|
XkbGeometryPtr geom)
|
||||||
{
|
{
|
||||||
register int i;
|
register int i;
|
||||||
|
@ -845,7 +842,7 @@ char buf[100];
|
||||||
Atom nameAtom;
|
Atom nameAtom;
|
||||||
|
|
||||||
nRead+= XkmGetCountedString(file,buf,100);
|
nRead+= XkmGetCountedString(file,buf,100);
|
||||||
nameAtom= XkbInternAtom(dpy,buf,False);
|
nameAtom= XkbInternAtom(buf,False);
|
||||||
tmp= fread(§ionWire,SIZEOF(xkmSectionDesc),1,file);
|
tmp= fread(§ionWire,SIZEOF(xkmSectionDesc),1,file);
|
||||||
nRead+= SIZEOF(xkmSectionDesc)*tmp;
|
nRead+= SIZEOF(xkmSectionDesc)*tmp;
|
||||||
section= XkbAddGeomSection(geom,nameAtom,sectionWire.num_rows,
|
section= XkbAddGeomSection(geom,nameAtom,sectionWire.num_rows,
|
||||||
|
@ -896,7 +893,7 @@ Atom nameAtom;
|
||||||
}
|
}
|
||||||
if (sectionWire.num_doodads>0) {
|
if (sectionWire.num_doodads>0) {
|
||||||
for (i=0;i<sectionWire.num_doodads;i++) {
|
for (i=0;i<sectionWire.num_doodads;i++) {
|
||||||
tmp= ReadXkmGeomDoodad(file,dpy,geom,section);
|
tmp= ReadXkmGeomDoodad(file,geom,section);
|
||||||
nRead+= tmp;
|
nRead+= tmp;
|
||||||
if (tmp<1)
|
if (tmp<1)
|
||||||
return nRead;
|
return nRead;
|
||||||
|
@ -904,7 +901,7 @@ Atom nameAtom;
|
||||||
}
|
}
|
||||||
if (sectionWire.num_overlays>0) {
|
if (sectionWire.num_overlays>0) {
|
||||||
for (i=0;i<sectionWire.num_overlays;i++) {
|
for (i=0;i<sectionWire.num_overlays;i++) {
|
||||||
tmp= ReadXkmGeomOverlay(file,dpy,geom,section);
|
tmp= ReadXkmGeomOverlay(file,geom,section);
|
||||||
nRead+= tmp;
|
nRead+= tmp;
|
||||||
if (tmp<1)
|
if (tmp<1)
|
||||||
return nRead;
|
return nRead;
|
||||||
|
@ -939,7 +936,7 @@ XkbGeometrySizesRec sizes;
|
||||||
return nRead;
|
return nRead;
|
||||||
}
|
}
|
||||||
geom= result->xkb->geom;
|
geom= result->xkb->geom;
|
||||||
geom->name= XkbInternAtom(result->xkb->dpy,buf,False);
|
geom->name= XkbInternAtom(buf,False);
|
||||||
geom->width_mm= wireGeom.width_mm;
|
geom->width_mm= wireGeom.width_mm;
|
||||||
geom->height_mm= wireGeom.height_mm;
|
geom->height_mm= wireGeom.height_mm;
|
||||||
nRead+= XkmGetCountedString(file,buf,100);
|
nRead+= XkmGetCountedString(file,buf,100);
|
||||||
|
@ -975,7 +972,7 @@ XkbGeometrySizesRec sizes;
|
||||||
XkbOutlinePtr ol;
|
XkbOutlinePtr ol;
|
||||||
xkmOutlineDesc olWire;
|
xkmOutlineDesc olWire;
|
||||||
nRead+= XkmGetCountedString(file,buf,100);
|
nRead+= XkmGetCountedString(file,buf,100);
|
||||||
nameAtom= XkbInternAtom(result->xkb->dpy,buf,False);
|
nameAtom= XkbInternAtom(buf,False);
|
||||||
tmp= fread(&shapeWire,SIZEOF(xkmShapeDesc),1,file);
|
tmp= fread(&shapeWire,SIZEOF(xkmShapeDesc),1,file);
|
||||||
nRead+= tmp*SIZEOF(xkmShapeDesc);
|
nRead+= tmp*SIZEOF(xkmShapeDesc);
|
||||||
shape= XkbAddGeomShape(geom,nameAtom,shapeWire.num_outlines);
|
shape= XkbAddGeomShape(geom,nameAtom,shapeWire.num_outlines);
|
||||||
|
@ -1014,7 +1011,7 @@ XkbGeometrySizesRec sizes;
|
||||||
}
|
}
|
||||||
if (wireGeom.num_sections>0) {
|
if (wireGeom.num_sections>0) {
|
||||||
for (i=0;i<wireGeom.num_sections;i++) {
|
for (i=0;i<wireGeom.num_sections;i++) {
|
||||||
tmp= ReadXkmGeomSection(file,result->xkb->dpy,geom);
|
tmp= ReadXkmGeomSection(file,geom);
|
||||||
nRead+= tmp;
|
nRead+= tmp;
|
||||||
if (tmp==0)
|
if (tmp==0)
|
||||||
return nRead;
|
return nRead;
|
||||||
|
@ -1022,7 +1019,7 @@ XkbGeometrySizesRec sizes;
|
||||||
}
|
}
|
||||||
if (wireGeom.num_doodads>0) {
|
if (wireGeom.num_doodads>0) {
|
||||||
for (i=0;i<wireGeom.num_doodads;i++) {
|
for (i=0;i<wireGeom.num_doodads;i++) {
|
||||||
tmp= ReadXkmGeomDoodad(file,result->xkb->dpy,geom,NULL);
|
tmp= ReadXkmGeomDoodad(file,geom,NULL);
|
||||||
nRead+= tmp;
|
nRead+= tmp;
|
||||||
if (tmp==0)
|
if (tmp==0)
|
||||||
return nRead;
|
return nRead;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user