From 1332343910a1880854bae21a790cff198855cd24 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Sun, 3 Feb 2008 23:43:18 +1100 Subject: XKB: Remove usage of client-side types Since we're no longer sharing with Xlib, don't pass Displays and XPointers everywhere. --- xkb/xkbtext.c | 56 +++++++++++++++++++++++++++----------------------------- 1 file changed, 27 insertions(+), 29 deletions(-) (limited to 'xkb/xkbtext.c') diff --git a/xkb/xkbtext.c b/xkb/xkbtext.c index 1520a9f58..d08c91589 100644 --- a/xkb/xkbtext.c +++ b/xkb/xkbtext.c @@ -69,11 +69,11 @@ char *rtrn; /***====================================================================***/ char * -XkbAtomText(Display *dpy,Atom atm,unsigned format) +XkbAtomText(Atom atm,unsigned format) { char *rtrn,*tmp; - tmp= XkbAtomGetString(dpy,atm); + tmp= XkbAtomGetString(atm); if (tmp!=NULL) { int len; len= strlen(tmp)+1; @@ -101,7 +101,7 @@ char *rtrn,*tmp; /***====================================================================***/ char * -XkbVModIndexText(Display *dpy,XkbDescPtr xkb,unsigned ndx,unsigned format) +XkbVModIndexText(XkbDescPtr xkb,unsigned ndx,unsigned format) { register int len; register Atom *vmodNames; @@ -116,7 +116,7 @@ char numBuf[20]; if (ndx>=XkbNumVirtualMods) tmp= "illegal"; else if (vmodNames&&(vmodNames[ndx]!=None)) - tmp= XkbAtomGetString(dpy,vmodNames[ndx]); + tmp= XkbAtomGetString(vmodNames[ndx]); if (tmp==NULL) sprintf(tmp=numBuf,"%d",ndx); @@ -135,8 +135,7 @@ char numBuf[20]; } char * -XkbVModMaskText( Display * dpy, - XkbDescPtr xkb, +XkbVModMaskText( XkbDescPtr xkb, unsigned modMask, unsigned mask, unsigned format) @@ -163,7 +162,7 @@ char *str,buf[BUFFER_SIZE]; char *tmp; for (i=0,bit=1;ireal_mods || tmp) { TryCopyStr(buf, - XkbVModMaskText(dpy,xkb,act->real_mods,tmp,XkbXKBFile), + XkbVModMaskText(xkb,act->real_mods,tmp,XkbXKBFile), sz); } else TryCopyStr(buf,"none",sz); @@ -701,7 +700,7 @@ unsigned tmp; /*ARGSUSED*/ static Bool -CopyGroupActionArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf, +CopyGroupActionArgs(XkbDescPtr xkb,XkbAction *action,char *buf, int *sz) { XkbGroupAction * act; @@ -726,7 +725,7 @@ char tbuf[32]; /*ARGSUSED*/ static Bool -CopyMovePtrArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz) +CopyMovePtrArgs(XkbDescPtr xkb,XkbAction *action,char *buf,int *sz) { XkbPtrAction * act; int x,y; @@ -751,7 +750,7 @@ char tbuf[32]; /*ARGSUSED*/ static Bool -CopyPtrBtnArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz) +CopyPtrBtnArgs(XkbDescPtr xkb,XkbAction *action,char *buf,int *sz) { XkbPtrBtnAction * act; char tbuf[32]; @@ -785,7 +784,7 @@ char tbuf[32]; /*ARGSUSED*/ static Bool -CopySetPtrDfltArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf, +CopySetPtrDfltArgs(XkbDescPtr xkb,XkbAction *action,char *buf, int *sz) { XkbPtrDfltAction * act; @@ -803,7 +802,7 @@ char tbuf[32]; } static Bool -CopyISOLockArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz) +CopyISOLockArgs(XkbDescPtr xkb,XkbAction *action,char *buf,int *sz) { XkbISOAction * act; char tbuf[64]; @@ -831,7 +830,7 @@ char tbuf[64]; TryCopyStr(buf,"+",sz); } if (tmp) - TryCopyStr(buf,XkbVModMaskText(dpy,xkb,0,tmp,XkbXKBFile),sz); + TryCopyStr(buf,XkbVModMaskText(xkb,0,tmp,XkbXKBFile),sz); } else TryCopyStr(buf,"none",sz); } @@ -865,7 +864,7 @@ char tbuf[64]; /*ARGSUSED*/ static Bool -CopySwitchScreenArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf, +CopySwitchScreenArgs(XkbDescPtr xkb,XkbAction *action,char *buf, int *sz) { XkbSwitchScreenAction * act; @@ -884,7 +883,7 @@ char tbuf[32]; /*ARGSUSED*/ static Bool -CopySetLockControlsArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action, +CopySetLockControlsArgs(XkbDescPtr xkb,XkbAction *action, char *buf,int *sz) { XkbCtrlsAction * act; @@ -971,7 +970,7 @@ char tbuf[32]; /*ARGSUSED*/ static Bool -CopyActionMessageArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf, +CopyActionMessageArgs(XkbDescPtr xkb,XkbAction *action,char *buf, int *sz) { XkbMessageAction * act; @@ -998,7 +997,7 @@ char tbuf[32]; } static Bool -CopyRedirectKeyArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf, +CopyRedirectKeyArgs(XkbDescPtr xkb,XkbAction *action,char *buf, int *sz) { XkbRedirectKeyAction * act; @@ -1022,19 +1021,19 @@ unsigned vmods,vmods_mask; return True; if ((act->mods_mask==XkbAllModifiersMask)&& (vmods_mask==XkbAllVirtualModsMask)) { - tmp= XkbVModMaskText(dpy,xkb,act->mods,vmods,XkbXKBFile); + tmp= XkbVModMaskText(xkb,act->mods,vmods,XkbXKBFile); TryCopyStr(buf,",mods=",sz); TryCopyStr(buf,tmp,sz); } else { 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); TryCopyStr(buf,",mods= ",sz); TryCopyStr(buf,tmp,sz); } 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); TryCopyStr(buf,",clearMods= ",sz); TryCopyStr(buf,tmp,sz); @@ -1045,7 +1044,7 @@ unsigned vmods,vmods_mask; /*ARGSUSED*/ static Bool -CopyDeviceBtnArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf, +CopyDeviceBtnArgs(XkbDescPtr xkb,XkbAction *action,char *buf, int *sz) { XkbDeviceBtnAction * act; @@ -1078,7 +1077,7 @@ char tbuf[32]; /*ARGSUSED*/ static Bool -CopyOtherArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz) +CopyOtherArgs(XkbDescPtr xkb,XkbAction *action,char *buf,int *sz) { XkbAnyAction * act; char tbuf[32]; @@ -1096,7 +1095,6 @@ char tbuf[32]; } typedef Bool (*actionCopy)( - Display * /* dpy */, XkbDescPtr /* xkb */, XkbAction * /* action */, char * /* buf */, @@ -1128,7 +1126,7 @@ static actionCopy copyActionArgs[XkbSA_NumActions] = { #define ACTION_SZ 256 char * -XkbActionText(Display *dpy,XkbDescPtr xkb,XkbAction *action,unsigned format) +XkbActionText(XkbDescPtr xkb,XkbAction *action,unsigned format) { char buf[ACTION_SZ],*tmp; int sz; @@ -1145,8 +1143,8 @@ int sz; sprintf(buf,"%s(",XkbActionTypeText(action->type,XkbXKBFile)); sz= ACTION_SZ-strlen(buf)+2; /* room for close paren and NULL */ if (action->type<(unsigned)XkbSA_NumActions) - (*copyActionArgs[action->type])(dpy,xkb,action,buf,&sz); - else CopyOtherArgs(dpy,xkb,action,buf,&sz); + (*copyActionArgs[action->type])(xkb,action,buf,&sz); + else CopyOtherArgs(xkb,action,buf,&sz); TryCopyStr(buf,")",&sz); } tmp= tbGetBuffer(strlen(buf)+1); -- cgit v1.2.3