Commit 7c5d836c authored by Ulrich Sibiller's avatar Ulrich Sibiller

xserver: remove define XKB_IN_SERVER

it is no longer needed because the code here is only used in the server.
parent 2fdb1add
...@@ -61,7 +61,6 @@ SOFTWARE. ...@@ -61,7 +61,6 @@ SOFTWARE.
#include "cursorstr.h" #include "cursorstr.h"
#include "dixstruct.h" #include "dixstruct.h"
#include "site.h" #include "site.h"
#define XKB_IN_SERVER
#ifdef XKB #ifdef XKB
#include <xkbsrv.h> #include <xkbsrv.h>
#endif #endif
......
...@@ -109,7 +109,6 @@ int ProcInitialConnection(); ...@@ -109,7 +109,6 @@ int ProcInitialConnection();
#include <nx-X11/extensions/security.h> #include <nx-X11/extensions/security.h>
#endif #endif
#ifdef XKB #ifdef XKB
#define XKB_IN_SERVER
#include "inputstr.h" #include "inputstr.h"
#include <xkbsrv.h> #include <xkbsrv.h>
#endif #endif
......
...@@ -178,21 +178,6 @@ extern void XkbRF_Free( ...@@ -178,21 +178,6 @@ extern void XkbRF_Free(
#define _XKB_RF_NAMES_PROP_ATOM "_XKB_RULES_NAMES" #define _XKB_RF_NAMES_PROP_ATOM "_XKB_RULES_NAMES"
#define _XKB_RF_NAMES_PROP_MAXLEN 1024 #define _XKB_RF_NAMES_PROP_MAXLEN 1024
#ifndef XKB_IN_SERVER
extern Bool XkbRF_GetNamesProp(
Display * /* dpy */,
char ** /* rules_file_rtrn */,
XkbRF_VarDefsPtr /* var_defs_rtrn */
);
extern Bool XkbRF_SetNamesProp(
Display * /* dpy */,
char * /* rules_file */,
XkbRF_VarDefsPtr /* var_defs */
);
#endif
_XFUNCPROTOEND _XFUNCPROTOEND
......
...@@ -55,7 +55,7 @@ XF86INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) ...@@ -55,7 +55,7 @@ XF86INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC)
`pkg-config --cflags-only-I pixman-1` `pkg-config --cflags-only-I pixman-1`
LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln
DEFINES = -DXKB_IN_SERVER $(EXTRA_ALLOC_DEFINES) $(XKB_DDXDEFS) $(NX_DEFINES) DEFINES = $(EXTRA_ALLOC_DEFINES) $(XKB_DDXDEFS) $(NX_DEFINES)
XKB_DEFINES = -DXKB_BASE_DIRECTORY=\"$(LIBDIR)/xkb\" $(XKB_DISABLE) XKB_DEFINES = -DXKB_BASE_DIRECTORY=\"$(LIBDIR)/xkb\" $(XKB_DISABLE)
NormalLibraryObjectRule() NormalLibraryObjectRule()
......
...@@ -30,16 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -30,16 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <config.h> #include <config.h>
#endif #endif
#ifndef XKB_IN_SERVER
#include <stdio.h>
#include "Xlibint.h"
#include "XKBlibint.h"
#include "xkbgeom.h"
#include <nx-X11/extensions/XKBproto.h>
#include "XKBlibint.h"
#else
#include <stdio.h> #include <stdio.h>
#include <nx-X11/X.h> #include <nx-X11/X.h>
...@@ -49,7 +39,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -49,7 +39,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <xkbsrv.h> #include <xkbsrv.h>
#include "xkbgeom.h" #include "xkbgeom.h"
#endif /* XKB_IN_SERVER */
/***===================================================================***/ /***===================================================================***/
......
...@@ -30,15 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -30,15 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <config.h> #include <config.h>
#endif #endif
#ifndef XKB_IN_SERVER
#include <stdio.h>
#include "Xlibint.h"
#include "XKBlibint.h"
#include "xkbgeom.h"
#include <nx-X11/extensions/XKBproto.h>
#else
#include <stdio.h> #include <stdio.h>
#include <nx-X11/X.h> #include <nx-X11/X.h>
...@@ -48,7 +39,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -48,7 +39,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <xkbsrv.h> #include <xkbsrv.h>
#include "xkbgeom.h" #include "xkbgeom.h"
#endif /* XKB_IN_SERVER */
#ifdef X_NOT_POSIX #ifdef X_NOT_POSIX
#define Size_t unsigned int #define Size_t unsigned int
......
...@@ -30,15 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -30,15 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <config.h> #include <config.h>
#endif #endif
#ifndef XKB_IN_SERVER
#include <stdio.h>
#include "Xlibint.h"
#include <nx-X11/extensions/XKBproto.h>
#include <nx-X11/keysym.h>
#include "XKBlibint.h"
#else
#include <stdio.h> #include <stdio.h>
#include <nx-X11/X.h> #include <nx-X11/X.h>
...@@ -49,7 +40,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -49,7 +40,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define XKBSRV_NEED_FILE_FUNCS #define XKBSRV_NEED_FILE_FUNCS
#include <xkbsrv.h> #include <xkbsrv.h>
#endif /* XKB_IN_SERVER */
/***====================================================================***/ /***====================================================================***/
......
...@@ -30,15 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -30,15 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <config.h> #include <config.h>
#endif #endif
#ifndef XKB_IN_SERVER
#include <stdio.h>
#include "Xlibint.h"
#include <nx-X11/extensions/XKBproto.h>
#include <nx-X11/keysym.h>
#include "XKBlibint.h"
#else
#include <stdio.h> #include <stdio.h>
#include <nx-X11/X.h> #include <nx-X11/X.h>
...@@ -49,7 +40,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -49,7 +40,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define XKBSRV_NEED_FILE_FUNCS #define XKBSRV_NEED_FILE_FUNCS
#include <xkbsrv.h> #include <xkbsrv.h>
#endif /* XKB_IN_SERVER */
/***====================================================================***/ /***====================================================================***/
......
...@@ -38,21 +38,6 @@ ...@@ -38,21 +38,6 @@
#define XOS_USE_NO_LOCKING #define XOS_USE_NO_LOCKING
#include <nx-X11/Xos_r.h> #include <nx-X11/Xos_r.h>
#ifndef XKB_IN_SERVER
#include <nx-X11/Xproto.h>
#include <nx-X11/Xlib.h>
#include <nx-X11/Xos.h>
#include <nx-X11/Xfuncs.h>
#include <nx-X11/Xatom.h>
#include <nx-X11/keysym.h>
#include <nx-X11/XKBlib.h>
#include "xkbgeom.h"
#include "XKMformat.h"
#include "XKBfileInt.h"
#include "XKBrules.h"
#else
#include <nx-X11/Xproto.h> #include <nx-X11/Xproto.h>
#include <nx-X11/X.h> #include <nx-X11/X.h>
...@@ -67,7 +52,6 @@ ...@@ -67,7 +52,6 @@
#define XKBSRV_NEED_FILE_FUNCS #define XKBSRV_NEED_FILE_FUNCS
#include <xkbsrv.h> #include <xkbsrv.h>
#endif
#ifdef DEBUG #ifdef DEBUG
#define PR_DEBUG(s) fprintf(stderr,s) #define PR_DEBUG(s) fprintf(stderr,s)
...@@ -1349,131 +1333,3 @@ XkbRF_GroupPtr group; ...@@ -1349,131 +1333,3 @@ XkbRF_GroupPtr group;
return; return;
} }
#ifndef XKB_IN_SERVER
Bool
XkbRF_GetNamesProp(Display *dpy,char **rf_rtrn,XkbRF_VarDefsPtr vd_rtrn)
{
Atom rules_atom,actual_type;
int fmt;
unsigned long nitems,bytes_after;
char *data,*out;
Status rtrn;
rules_atom= XInternAtom(dpy,_XKB_RF_NAMES_PROP_ATOM,True);
if (rules_atom==None) /* property cannot exist */
return False;
rtrn= XGetWindowProperty(dpy,DefaultRootWindow(dpy),rules_atom,
0L,_XKB_RF_NAMES_PROP_MAXLEN,False,
XA_STRING,&actual_type,
&fmt,&nitems,&bytes_after,
(unsigned char **)&data);
if (rtrn!=Success)
return False;
if (rf_rtrn)
*rf_rtrn= NULL;
(void)bzero((char *)vd_rtrn,sizeof(XkbRF_VarDefsRec));
if ((bytes_after>0)||(actual_type!=XA_STRING)||(fmt!=8)) {
if (data) XFree(data);
return (fmt==0?True:False);
}
out= data;
if (out && (*out) && rf_rtrn)
*rf_rtrn= _XkbDupString(out);
out+=strlen(out)+1;
if ((out-data)<nitems) {
if (*out)
vd_rtrn->model= _XkbDupString(out);
out+=strlen(out)+1;
}
if ((out-data)<nitems) {
if (*out)
vd_rtrn->layout= _XkbDupString(out);
out+=strlen(out)+1;
}
if ((out-data)<nitems) {
if (*out)
vd_rtrn->variant= _XkbDupString(out);
out+=strlen(out)+1;
}
if ((out-data)<nitems) {
if (*out)
vd_rtrn->options= _XkbDupString(out);
out+=strlen(out)+1;
}
XFree(data);
return True;
}
Bool
XkbRF_SetNamesProp(Display *dpy,char *rules_file,XkbRF_VarDefsPtr var_defs)
{
int len,out;
Atom name;
char * pval;
len= (rules_file?strlen(rules_file):0);
len+= (var_defs->model?strlen(var_defs->model):0);
len+= (var_defs->layout?strlen(var_defs->layout):0);
len+= (var_defs->variant?strlen(var_defs->variant):0);
len+= (var_defs->options?strlen(var_defs->options):0);
if (len<1)
return True;
len+= 5; /* trailing NULs */
name= XInternAtom(dpy,_XKB_RF_NAMES_PROP_ATOM,False);
if (name==None) { /* should never happen */
_XkbLibError(_XkbErrXReqFailure,"XkbRF_SetNamesProp",X_InternAtom);
return False;
}
pval= (char *)_XkbAlloc(len);
if (!pval) {
_XkbLibError(_XkbErrBadAlloc,"XkbRF_SetNamesProp",len);
return False;
}
out= 0;
if (rules_file) {
strcpy(&pval[out],rules_file);
out+= strlen(rules_file);
}
pval[out++]= '\0';
if (var_defs->model) {
strcpy(&pval[out],var_defs->model);
out+= strlen(var_defs->model);
}
pval[out++]= '\0';
if (var_defs->layout) {
strcpy(&pval[out],var_defs->layout);
out+= strlen(var_defs->layout);
}
pval[out++]= '\0';
if (var_defs->variant) {
strcpy(&pval[out],var_defs->variant);
out+= strlen(var_defs->variant);
}
pval[out++]= '\0';
if (var_defs->options) {
strcpy(&pval[out],var_defs->options);
out+= strlen(var_defs->options);
}
pval[out++]= '\0';
if (out!=len) {
_XkbLibError(_XkbErrBadLength,"XkbRF_SetNamesProp",out);
_XkbFree(pval);
return False;
}
XChangeProperty(dpy,DefaultRootWindow(dpy),name,XA_STRING,8,PropModeReplace,
(unsigned char *)pval,len);
_XkbFree(pval);
return True;
}
#endif
...@@ -7,13 +7,8 @@ ...@@ -7,13 +7,8 @@
#ifndef DEFAULT_H #ifndef DEFAULT_H
#define DEFAULT_H 1 #define DEFAULT_H 1
#ifndef XKB_IN_SERVER
#define GET_ATOM(d,s) XInternAtom(d,s,0)
#define DPYTYPE Display *
#else
#define GET_ATOM(d,s) MakeAtom(s,strlen(s),1) #define GET_ATOM(d,s) MakeAtom(s,strlen(s),1)
#define DPYTYPE char * #define DPYTYPE char *
#endif
#define NUM_KEYS 1 #define NUM_KEYS 1
#define vmod_NumLock 0 #define vmod_NumLock 0
......
...@@ -38,15 +38,6 @@ ...@@ -38,15 +38,6 @@
#include <nx-X11/Xfuncs.h> #include <nx-X11/Xfuncs.h>
#ifndef XKB_IN_SERVER
#include <nx-X11/Xos.h>
#include <nx-X11/Xlib.h>
#include <nx-X11/keysym.h>
#include <nx-X11/XKBlib.h>
#include "XKBfileInt.h"
#else
#include <nx-X11/X.h> #include <nx-X11/X.h>
#include <nx-X11/keysym.h> #include <nx-X11/keysym.h>
...@@ -56,7 +47,6 @@ ...@@ -56,7 +47,6 @@
#include "dix.h" #include "dix.h"
#define XKBSRV_NEED_FILE_FUNCS #define XKBSRV_NEED_FILE_FUNCS
#include <xkbsrv.h> #include <xkbsrv.h>
#endif
#include <nx-X11/extensions/XKBconfig.h> #include <nx-X11/extensions/XKBconfig.h>
...@@ -1339,14 +1329,8 @@ char * msg; ...@@ -1339,14 +1329,8 @@ char * msg;
default: default:
msg= "unknown error on line %d"; break; msg= "unknown error on line %d"; break;
} }
#ifndef XKB_IN_SERVER
fprintf(file,msg,line);
if (name) fprintf(file," of %s\n",name);
else fprintf(file,"\n");
#else
ErrorF(msg,line); ErrorF(msg,line);
if (name) ErrorF(" of %s\n",name); if (name) ErrorF(" of %s\n",name);
else ErrorF("\n"); else ErrorF("\n");
#endif
return; return;
} }
...@@ -37,16 +37,6 @@ ...@@ -37,16 +37,6 @@
#include <nx-X11/Xos.h> #include <nx-X11/Xos.h>
#include <nx-X11/Xfuncs.h> #include <nx-X11/Xfuncs.h>
#ifndef XKB_IN_SERVER
#include <nx-X11/Xlib.h>
#include <nx-X11/keysym.h>
#include <nx-X11/XKBlib.h>
#include "xkbgeom.h"
#include "XKMformat.h"
#include "XKBfileInt.h"
#else
#include <nx-X11/X.h> #include <nx-X11/X.h>
#include <nx-X11/keysym.h> #include <nx-X11/keysym.h>
...@@ -60,7 +50,6 @@ ...@@ -60,7 +50,6 @@
#include "xkbgeom.h" #include "xkbgeom.h"
#include "xkb.h" #include "xkb.h"
#endif
unsigned unsigned
_XkbKSCheckCase(KeySym ks) _XkbKSCheckCase(KeySym ks)
......
...@@ -35,16 +35,6 @@ ...@@ -35,16 +35,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <nx-X11/Xfuncs.h> #include <nx-X11/Xfuncs.h>
#ifndef XKB_IN_SERVER
#include <nx-X11/Xlib.h>
#include <nx-X11/XKBlib.h>
#include "xkbgeom.h"
#include "XKMformat.h"
#include "XKBfileInt.h"
#else
#include <nx-X11/X.h> #include <nx-X11/X.h>
#include <nx-X11/keysym.h> #include <nx-X11/keysym.h>
...@@ -59,7 +49,6 @@ ...@@ -59,7 +49,6 @@
#include "xkbgeom.h" #include "xkbgeom.h"
#include "xkbfile.h" #include "xkbfile.h"
#endif
#define VMOD_HIDE_VALUE 0 #define VMOD_HIDE_VALUE 0
#define VMOD_SHOW_VALUE 1 #define VMOD_SHOW_VALUE 1
......
...@@ -36,16 +36,6 @@ ...@@ -36,16 +36,6 @@
#include <nx-X11/Xos.h> #include <nx-X11/Xos.h>
#ifndef XKB_IN_SERVER
#include <nx-X11/Xlib.h>
#include <nx-X11/XKBlib.h>
#include "xkbgeom.h"
#include "XKMformat.h"
#include "XKBfileInt.h"
#else
#include <nx-X11/X.h> #include <nx-X11/X.h>
#include <nx-X11/Xproto.h> #include <nx-X11/Xproto.h>
...@@ -57,7 +47,6 @@ ...@@ -57,7 +47,6 @@
#include <xkbsrv.h> #include <xkbsrv.h>
#include "xkbgeom.h" #include "xkbgeom.h"
#endif
/***====================================================================***/ /***====================================================================***/
...@@ -348,22 +337,10 @@ XkbKeysymText(KeySym sym,unsigned format) ...@@ -348,22 +337,10 @@ XkbKeysymText(KeySym sym,unsigned format)
{ {
static char buf[32],*rtrn; static char buf[32],*rtrn;
#ifndef XKB_IN_SERVER
if (sym==NoSymbol)
strcpy(rtrn=buf,"NoSymbol");
else if ((rtrn=XKeysymToString(sym))==NULL)
sprintf(rtrn=buf, "0x%lx", (long)sym);
else if (format==XkbCFile) {
sprintf(buf,"XK_%s",rtrn);
rtrn= buf;
}
return rtrn;
#else /* def XKB_IN_SERVER */
if (sym==NoSymbol) if (sym==NoSymbol)
strcpy(rtrn=buf,"NoSymbol"); strcpy(rtrn=buf,"NoSymbol");
else sprintf(rtrn=buf, "0x%lx", (long)sym); else sprintf(rtrn=buf, "0x%lx", (long)sym);
return rtrn; return rtrn;
#endif /* XKB_IN_SERVER */
} }
char * char *
...@@ -1348,90 +1325,3 @@ register int i; ...@@ -1348,90 +1325,3 @@ register int i;
return buf; return buf;
} }
#ifndef XKB_IN_SERVER
/***====================================================================***/
#define PIXEL_MAX 65535
Bool
XkbLookupCanonicalRGBColor(char *def,XColor *color)
{
int tmp;
if (_XkbStrCaseEqual(def,"black")) {
color->red= color->green= color->blue= 0;
return True;
}
else if (_XkbStrCaseEqual(def,"white")) {
color->red= color->green= color->blue= PIXEL_MAX;
return True;
}
else if ((sscanf(def,"grey%d",&tmp)==1)||
(sscanf(def,"gray%d",&tmp)==1)||
(sscanf(def,"Grey%d",&tmp)==1)||
(sscanf(def,"Gray%d",&tmp)==1)) {
if ((tmp>0)&&(tmp<=100)) {
tmp= (PIXEL_MAX*tmp)/100;
color->red= color->green= color->blue= tmp;
return True;
}
}
else if ((tmp=(_XkbStrCaseEqual(def,"red")*100))||
(sscanf(def,"red%d",&tmp)==1)) {
if ((tmp>0)&&(tmp<=100)) {
tmp= (PIXEL_MAX*tmp)/100;
color->red= tmp;
color->green= color->blue= 0;
return True;
}
}
else if ((tmp=(_XkbStrCaseEqual(def,"green")*100))||
(sscanf(def,"green%d",&tmp)==1)) {
if ((tmp>0)&&(tmp<=100)) {
tmp= (PIXEL_MAX*tmp)/100;
color->green= tmp;
color->red= color->blue= 0;
return True;
}
}
else if ((tmp=(_XkbStrCaseEqual(def,"blue")*100))||
(sscanf(def,"blue%d",&tmp)==1)) {
if ((tmp>0)&&(tmp<=100)) {
tmp= (PIXEL_MAX*tmp)/100;
color->blue= tmp;
color->red= color->green= 0;
return True;
}
}
else if ((tmp=(_XkbStrCaseEqual(def,"magenta")*100))||
(sscanf(def,"magenta%d",&tmp)==1)) {
if ((tmp>0)&&(tmp<=100)) {
tmp= (PIXEL_MAX*tmp)/100;
color->green= 0;
color->red= color->blue= tmp;
return True;
}
}
else if ((tmp=(_XkbStrCaseEqual(def,"cyan")*100))||
(sscanf(def,"cyan%d",&tmp)==1)) {
if ((tmp>0)&&(tmp<=100)) {
tmp= (PIXEL_MAX*tmp)/100;
color->red= 0;
color->green= color->blue= tmp;
return True;
}
}
else if ((tmp=(_XkbStrCaseEqual(def,"yellow")*100))||
(sscanf(def,"yellow%d",&tmp)==1)) {
if ((tmp>0)&&(tmp<=100)) {
tmp= (PIXEL_MAX*tmp)/100;
color->blue= 0;
color->red= color->green= tmp;
return True;
}
}
return False;
}
#endif
...@@ -35,19 +35,6 @@ ...@@ -35,19 +35,6 @@
#include <nx-X11/Xos.h> #include <nx-X11/Xos.h>
#include <nx-X11/Xfuncs.h> #include <nx-X11/Xfuncs.h>
#ifndef XKB_IN_SERVER
#include <stdlib.h>
#include <nx-X11/Xlib.h>
#include <nx-X11/keysym.h>
#include <nx-X11/XKBlib.h>
#include "xkbgeom.h"
#include "XKMformat.h"
#include "XKBfileInt.h"
#else
#include <nx-X11/X.h> #include <nx-X11/X.h>
#include <nx-X11/Xproto.h> #include <nx-X11/Xproto.h>
...@@ -67,7 +54,6 @@ XkbInternAtom(Display *dpy,char *str,Bool only_if_exists) ...@@ -67,7 +54,6 @@ XkbInternAtom(Display *dpy,char *str,Bool only_if_exists)
return MakeAtom(str,strlen(str),!only_if_exists); return MakeAtom(str,strlen(str),!only_if_exists);
} }
#endif
#ifndef SEEK_SET #ifndef SEEK_SET
#define SEEK_SET 0 #define SEEK_SET 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment