Commit 8d4d2bc2 authored by Ulrich Sibiller's avatar Ulrich Sibiller

move xkblib to xserver

Upstream does not use xkbfile but has own copies of the required files. It was not used elsewhere.
parent 43f135be
...@@ -180,9 +180,6 @@ XORGRELSTRING = XorgManVersionString ...@@ -180,9 +180,6 @@ XORGRELSTRING = XorgManVersionString
#ifndef BuildXKBlib #ifndef BuildXKBlib
#define BuildXKBlib (BuildXKB && !BuildServersOnly) #define BuildXKBlib (BuildXKB && !BuildServersOnly)
#endif #endif
#ifndef BuildXKBfilelib
#define BuildXKBfilelib (BuildXKB && !BuildServersOnly)
#endif
/* /*
* WARNING: Setting UseXKBInClients to YES cause incompatibilities * WARNING: Setting UseXKBInClients to YES cause incompatibilities
...@@ -1235,56 +1232,11 @@ MOTIFINCLUDES = -I$(MOTIFINCDIR) ...@@ -1235,56 +1232,11 @@ MOTIFINCLUDES = -I$(MOTIFINCDIR)
#endif #endif
#if BuildXKBlib #if BuildXKBlib
# ifndef SharedLibxkbfile
# define SharedLibxkbfile HasSharedLibraries
# endif
# ifndef NormalLibxkbfile
# define NormalLibxkbfile (!SharedLibxkbfile | ForceNormalLib)
# endif
# ifndef DebugLibxkbfile
# define DebugLibxkbfile NO
# endif
# ifndef ProfileLibxkbfile
# define ProfileLibxkbfile NO
# endif
#else
# ifndef SharedLibxkbfile
# define SharedLibxkbfile NO
# endif
# ifndef NormalLibxkbfile
# define NormalLibxkbfile NO
# endif
# ifndef DebugLibxkbfile
# define DebugLibxkbfile NO
# endif
# ifndef ProfileLibxkbfile
# define ProfileLibxkbfile NO
# endif
#endif
XKBFILELIBSRC = $(LIBSRC)/xkbfile
#if SharedLibxkbfile
# ifndef SharedxkbfileRev
# define SharedxkbfileRev 1.0
# endif
SharedLibReferences(XKBFILE,NX_xkbfile,$(XKBFILESRC),SOXKBFILEREV, SharedxkbfileRev)
#else
ProjectUnsharedLibReferences(XKBFILE,NX_xkbfile,$(XKBFILELIBSRC),XBuildLibDir)
#endif
#if BuildXKBlib
# ifndef XkbClientDepLibs # ifndef XkbClientDepLibs
# if UseXKBInClients
# define XkbClientDepLibs $(DEPXKBFILELIB)
# else
# define XkbClientDepLibs /**/ # define XkbClientDepLibs /**/
# endif
# endif # endif
# ifndef XkbClientLibs # ifndef XkbClientLibs
# if UseXKBInClients
# define XkbClientLibs $(XKBFILELIB)
# else
# define XkbClientLibs /**/ # define XkbClientLibs /**/
# endif
# endif # endif
#else /* !BuildXKBlib */ #else /* !BuildXKBlib */
......
...@@ -9,6 +9,4 @@ XCOMM $XFree86: xc/config/cf/lnxLib.tmpl,v 3.19 2003/10/15 22:47:48 herrb Exp $ ...@@ -9,6 +9,4 @@ XCOMM $XFree86: xc/config/cf/lnxLib.tmpl,v 3.19 2003/10/15 22:47:48 herrb Exp $
#define SharedXlibi18nReqs $(LDPRELIB) $(XONLYLIB) #define SharedXlibi18nReqs $(LDPRELIB) $(XONLYLIB)
#define SharedXextReqs $(LDPRELIB) $(XONLYLIB) #define SharedXextReqs $(LDPRELIB) $(XONLYLIB)
#define SharedxkbfileReqs $(LDPRELIB) $(XONLYLIB)
#define NoMessageCatalog #define NoMessageCatalog
...@@ -193,7 +193,6 @@ NX_VERSION_CURRENT_STRING = nxVersionString ...@@ -193,7 +193,6 @@ NX_VERSION_CURRENT_STRING = nxVersionString
#if BuildXFree86ConfigTools && BuildLibrariesForConfigTools #if BuildXFree86ConfigTools && BuildLibrariesForConfigTools
#define BuildLibraries YES #define BuildLibraries YES
#define BuildXKBlib YES #define BuildXKBlib YES
#define BuildXKBfilelib YES
#endif #endif
/* /*
......
...@@ -41,6 +41,8 @@ DAMAGEHEADERS = damagewire.h damageproto.h ...@@ -41,6 +41,8 @@ DAMAGEHEADERS = damagewire.h damageproto.h
XRESHEADERS = XResproto.h XRESHEADERS = XResproto.h
#endif #endif
XKBFILEHEADERS = XKMformat.h XKM.h XKBconfig.h XKBfile.h XKBrules.h
EXTRAHEADERS = \ EXTRAHEADERS = \
$(SCREENSAVERHEADERS) \ $(SCREENSAVERHEADERS) \
$(XINERAMAHEADERS) \ $(XINERAMAHEADERS) \
...@@ -53,6 +55,7 @@ EXTRAHEADERS = \ ...@@ -53,6 +55,7 @@ EXTRAHEADERS = \
$(COMPOSITEHEADERS) \ $(COMPOSITEHEADERS) \
$(DAMAGEHEADERS) \ $(DAMAGEHEADERS) \
$(XRESHEADERS) \ $(XRESHEADERS) \
$(XKBFILEHEADERS) \
$(NULL) $(NULL)
HEADERS = \ HEADERS = \
......
...@@ -11,17 +11,12 @@ XCOMM $XFree86: xc/lib/Imakefile,v 3.74 2003/04/14 20:37:07 herrb Exp $ ...@@ -11,17 +11,12 @@ XCOMM $XFree86: xc/lib/Imakefile,v 3.74 2003/04/14 20:37:07 herrb Exp $
NULL = NULL =
#if BuildXKBfilelib || BuildXKB
XKBLIBDIR = xkbfile
#endif
#if BuildX11Lib #if BuildX11Lib
X11LIBDIR = X11 X11LIBDIR = X11
#endif #endif
LINTSUBDIRS = \ LINTSUBDIRS = \
$(X11LIBDIR) \ $(X11LIBDIR) \
$(XKBLIBDIR) \
$(NULL) $(NULL)
SUBDIRS = xtrans $(LINTSUBDIRS) SUBDIRS = xtrans $(LINTSUBDIRS)
......
XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:46:42 cpqbld Exp $
XCOMM $XFree86: xc/lib/xkbfile/Imakefile,v 3.5 2003/10/15 21:23:38 herrb Exp $
#define DoNormalLib NormalLibxkbfile
#define DoSharedLib SharedLibxkbfile
#define DoExtraLib SharedLibxkbfile
#define DoDebugLib DebugLibxkbfile
#define DoProfileLib ProfileLibxkbfile
#define HasSharedData NO
#define LibName NX_xkbfile
#define SoRev SOXKBFILEREV
#define IncSubdir nx-X11
#define IncSubSubdir extensions
#ifdef SharedxkbfileReqs
REQUIREDLIBS = SharedxkbfileReqs
#endif
#if !BuildXKBfilelib
#define LibBuild NO
#endif
SRCS = xkbtext.c xkbdraw.c xkbmisc.c xkbatom.c xkberrs.c \
cout.c xkbout.c xkmout.c \
xkmread.c srvmisc.c \
xkbconfig.c xkbbells.c maprules.c
OBJS = xkbtext.o xkbdraw.o xkbmisc.o xkbatom.o xkberrs.o \
cout.o xkbout.o xkmout.o \
xkmread.o srvmisc.o \
xkbconfig.o xkbbells.o maprules.o
HEADERS = XKBfile.h XKM.h XKMformat.h XKBrules.h \
XKBconfig.h XKBbells.h
INCLUDES = -I. -I$(EXTINCSRC)
ROOT_DEFINES = -DDFLT_XKB_CONFIG_ROOT=\"$(LIBDIR)/xkb\"
#include <Library.tmpl>
DependTarget()
#ifndef _XKBBELLS_H_
#define _XKBBELLS_H_ 1
/************************************************************
Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
/* $XFree86$ */
#define XkbBN_Info "Info"
#define XkbBN_Warning "Warning"
#define XkbBN_MinorError "MinorError"
#define XkbBN_MajorError "MajorError"
#define XkbBN_BadValue "BadValue"
#define XkbBN_InvalidLocation "InvalidLocation"
#define XkbBN_Question "Question"
#define XkbBN_Start "Start"
#define XkbBN_End "End"
#define XkbBN_Success "Success"
#define XkbBN_Failure "Failure"
#define XkbBN_Wait "Wait"
#define XkbBN_Proceed "Proceed"
#define XkbBN_Ignore "Ignore"
#define XkbBN_Iconify "Iconify"
#define XkbBN_Deiconify "Deconify"
#define XkbBN_Open "Open"
#define XkbBN_Close "Close"
#define XkbBN_TerminalBell "TerminalBell"
#define XkbBN_MarginBell "MarginBell"
#define XkbBN_CursorStuck "CursorStuck"
#define XkbBN_NewMail "NewMail"
#define XkbBN_LaunchApp "LaunchApp"
#define XkbBN_AppDeath "AppDeath"
#define XkbBN_ImAlive "ImAlive"
#define XkbBN_ClockChimeHour "ClockChimeHour"
#define XkbBN_ClockChimeHalf "ClockChimeHalf"
#define XkbBN_ClockChimeQuarter "ClockChimeQuarter"
#define XkbBN_RepeatingLastBell "RepeatingLastBell"
#define XkbBN_ComposeFail "ComposeFail"
#define XkbBN_AX_FeatureOn "AX_FeatureOn"
#define XkbBN_AX_FeatureOff "AX_FeatureOff"
#define XkbBN_AX_FeatureChange "AX_FeatureChange"
#define XkbBN_AX_IndicatorOn "AX_IndicatorOn"
#define XkbBN_AX_IndicatorOff "AX_IndicatorOff"
#define XkbBN_AX_IndicatorChange "AX_IndicatorChange"
#define XkbBN_AX_SlowKeysWarning "AX_SlowKeysWarning"
#define XkbBN_AX_SlowKeyPress "AX_SlowKeyPress"
#define XkbBN_AX_SlowKeyAccept "AX_SlowKeyAccept"
#define XkbBN_AX_SlowKeyReject "AX_SlowKeyReject"
#define XkbBN_AX_SlowKeyRelease "AX_SlowKeyRelease"
#define XkbBN_AX_BounceKeyReject "AX_BounceKeyReject"
#define XkbBN_AX_StickyLatch "AX_StickyLatch"
#define XkbBN_AX_StickyLock "AX_StickyLock"
#define XkbBN_AX_StickyUnlock "AX_StickyUnlock"
#define XkbBI_Info 0
#define XkbBI_Warning 1
#define XkbBI_MinorError 2
#define XkbBI_MajorError 3
#define XkbBI_BadValue 4
#define XkbBI_InvalidLocation 5
#define XkbBI_Question 6
#define XkbBI_Start 7
#define XkbBI_End 8
#define XkbBI_Success 9
#define XkbBI_Failure 10
#define XkbBI_Wait 11
#define XkbBI_Proceed 12
#define XkbBI_Ignore 13
#define XkbBI_Iconify 14
#define XkbBI_Deiconify 15
#define XkbBI_Open 16
#define XkbBI_Close 17
#define XkbBI_TerminalBell 18
#define XkbBI_MarginBell 19
#define XkbBI_CursorStuck 20
#define XkbBI_NewMail 21
#define XkbBI_LaunchApp 22
#define XkbBI_AppDeath 23
#define XkbBI_ImAlive 24
#define XkbBI_ClockChimeHour 25
#define XkbBI_ClockChimeHalf 26
#define XkbBI_ClockChimeQuarter 27
#define XkbBI_RepeatingLastBell 28
#define XkbBI_ComposeFail 29
#define XkbBI_AX_FeatureOn 30
#define XkbBI_AX_FeatureOff 31
#define XkbBI_AX_FeatureChange 32
#define XkbBI_AX_IndicatorOn 33
#define XkbBI_AX_IndicatorOff 34
#define XkbBI_AX_IndicatorChange 35
#define XkbBI_AX_SlowKeysWarning 36
#define XkbBI_AX_SlowKeyPress 37
#define XkbBI_AX_SlowKeyAccept 38
#define XkbBI_AX_SlowKeyReject 39
#define XkbBI_AX_SlowKeyRelease 40
#define XkbBI_AX_BounceKeyReject 41
#define XkbBI_AX_StickyLatch 42
#define XkbBI_AX_StickyLock 43
#define XkbBI_AX_StickyUnlock 44
#define XkbBI_NumBells 45
_XFUNCPROTOBEGIN
extern Bool XkbStdBell(
Display * /* dpy */,
Window /* win */,
int /* percent */,
int /* bellDef */
);
extern Bool XkbStdBellEvent(
Display * /* dpy */,
Window /* win */,
int /* percent */,
int /* bellDef */
);
_XFUNCPROTOEND
#endif /* _XKBBELLS_H_ */
#ifndef _XKBFILEINT_H_
#define _XKBFILEINT_H_ 1
/************************************************************
Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
/* $XFree86$ */
#include "XKBfile.h"
#ifdef DEBUG
#define _XkbLibError(c,l,d) \
{ fprintf(stderr,"xkbfile: %s in %s\n",_XkbErrMessages[c],(l)); \
_XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
#else
#define _XkbLibError(c,l,d) \
{ _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
#endif
#ifndef XKB_IN_SERVER
#define _XkbAlloc(s) malloc((s))
#define _XkbCalloc(n,s) calloc((n),(s))
#define _XkbRealloc(o,s) realloc((o),(s))
#define _XkbTypedAlloc(t) ((t *)malloc(sizeof(t)))
#define _XkbTypedCalloc(n,t) ((t *)calloc((n),sizeof(t)))
#define _XkbTypedRealloc(o,n,t) \
((o)?(t *)realloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
#define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
#define _XkbFree(p) free(p)
#ifndef PATH_MAX
#ifdef MAXPATHLEN
#define PATH_MAX MAXPATHLEN
#else
#define PATH_MAX 1024
#endif
#endif
#endif
_XFUNCPROTOBEGIN
extern char * _XkbDupString(
char * /* old_str */
);
extern int _XkbStrCaseCmp(
char * /* str1 */,
char * /* str2 */
);
#define _XkbStrCaseEqual(s1,s2) (_XkbStrCaseCmp(s1,s2)==0)
_XFUNCPROTOEND
#endif /* _XKBFILEINT_H_ */
# $Xorg: magic,v 1.3 2000/08/17 19:46:43 cpqbld Exp $
# Here are some lines you can add to /etc/magic
# to identify XKM (compiled X keymap) files
# and determine their version and the byte ordering
# with which they were compiled
1 string mkx Compiled XKB Keymap: lsb,
>0 byte >0 version %d
>0 byte =0 obsolete
0 string xkm Compiled XKB Keymap: msb,
>3 byte >0 version %d
>0 byte =0 obsolete
/************************************************************
Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <nx-X11/Xlib.h>
#include <nx-X11/XKBlib.h>
#include <nx-X11/extensions/XKBgeom.h>
#include "XKMformat.h"
#include "XKBfileInt.h"
Bool
XkbWriteToServer(XkbFileInfo *result)
{
XkbDescPtr xkb;
Display * dpy;
if ((result==NULL)||(result->xkb==NULL)||(result->xkb->dpy==NULL))
return False;
xkb= result->xkb;
dpy= xkb->dpy;
if (!XkbSetMap(dpy,XkbAllMapComponentsMask,xkb))
return False;
if (!XkbSetIndicatorMap(dpy,~0,xkb))
return False;
#ifdef NOTYET
if (!XkbSetControls(dpy,XkbAllControlsMask,xkb))
return False;
#endif
if (!XkbSetCompatMap(dpy,XkbAllCompatMask,xkb,True))
return False;
if (!XkbSetNames(dpy,XkbAllNamesMask,0,xkb->map->num_types,xkb))
return False;
if (xkb->geom) {
if (XkbSetGeometry(dpy,xkb->device_spec,xkb->geom)!=Success)
return False;
}
return True;
#ifdef NOTYET
switch (result->type) {
case XkmSemanticsFile:
func= WriteCHdrSemantics;
break;
case XkmLayoutFile:
func= WriteCHdrLayout;
break;
case XkmKeymapFile:
func= WriteCHdrKeymap;
break;
default:
_XkbLibError(_XkbErrIllegalContents,"XkbWriteToServer",result->type);
break;
}
return ok;
#endif
}
unsigned
XkbReadFromServer(Display *dpy,unsigned need,unsigned want,XkbFileInfo *result)
{
unsigned which= need|want;
unsigned tmp = 0;
if ((result==NULL)||(dpy==NULL))
return which;
if (which&XkmSymbolsMask) tmp= XkbAllMapComponentsMask;
else if (which&XkmTypesMask) tmp= XkbKeyTypesMask;
if (result->xkb==NULL) {
result->xkb= XkbGetMap(dpy,tmp,XkbUseCoreKbd);
if (!result->xkb)
return which;
else which&= ~(XkmSymbolsMask|XkmTypesMask|XkmVirtualModsMask);
}
else if ((tmp)&&(XkbGetUpdatedMap(dpy,tmp,result->xkb)==Success))
which&= ~(XkmSymbolsMask|XkmTypesMask|XkmVirtualModsMask);
if (which&XkmIndicatorsMask) {
if (XkbGetIndicatorMap(dpy,XkbAllIndicatorsMask,result->xkb)==Success)
which&= ~XkmIndicatorsMask;
}
if (which&XkmCompatMapMask) {
if (XkbGetCompatMap(dpy,XkbAllCompatMask,result->xkb)==Success)
which&= ~XkmCompatMapMask;
}
if (which&XkmGeometryMask) {
if (XkbGetGeometry(dpy,result->xkb)==Success)
which&= ~XkmGeometryMask;
}
XkbGetNames(dpy,XkbAllNamesMask,result->xkb);
return which;
}
Status
XkbChangeKbdDisplay(Display *newDpy,XkbFileInfo *result)
{
register int i;
XkbDescPtr xkb;
Display * oldDpy;
Atom * atm;
if ((result->xkb==NULL)||(result->xkb->dpy==newDpy))
return Success;
xkb= result->xkb;
oldDpy= xkb->dpy;
if (xkb->names) {
XkbNamesPtr names= xkb->names;
names->keycodes= XkbChangeAtomDisplay(oldDpy,newDpy,names->keycodes);
names->geometry= XkbChangeAtomDisplay(oldDpy,newDpy,names->geometry);
names->symbols= XkbChangeAtomDisplay(oldDpy,newDpy,names->symbols);
names->types= XkbChangeAtomDisplay(oldDpy,newDpy,names->types);
names->compat= XkbChangeAtomDisplay(oldDpy,newDpy,names->compat);
names->phys_symbols= XkbChangeAtomDisplay(oldDpy,newDpy,
names->phys_symbols);
for (i=0,atm=names->vmods;i<XkbNumVirtualMods;i++,atm++) {
*atm= XkbChangeAtomDisplay(oldDpy,newDpy,*atm);
}
for (i=0,atm=names->indicators;i<XkbNumIndicators;i++,atm++) {
*atm= XkbChangeAtomDisplay(oldDpy,newDpy,*atm);
}
for (i=0,atm=names->groups;i<XkbNumKbdGroups;i++,atm++) {
*atm= XkbChangeAtomDisplay(oldDpy,newDpy,*atm);
}
for (i=0,atm=names->radio_groups;i<names->num_rg;i++,atm++) {
*atm= XkbChangeAtomDisplay(oldDpy,newDpy,*atm);
}
}
if (xkb->map) {
register int t;
XkbKeyTypePtr type;
for (t=0,type=xkb->map->types;t<xkb->map->num_types;t++,type++) {
type->name= XkbChangeAtomDisplay(oldDpy,newDpy,type->name);
if (type->level_names!=NULL) {
for (i=0,atm=type->level_names;i<type->num_levels;i++,atm++) {
*atm= XkbChangeAtomDisplay(oldDpy,newDpy,*atm);
}
}
}
}
if (xkb->geom) {
XkbGeometryPtr geom= xkb->geom;
geom->name= XkbChangeAtomDisplay(oldDpy,newDpy,geom->name);
if (geom->shapes) {
register int s;
XkbShapePtr shape;
for (s=0,shape=geom->shapes;s<geom->num_shapes;s++,shape++) {
shape->name= XkbChangeAtomDisplay(oldDpy,newDpy,shape->name);
}
}
if (geom->sections) {
register int s;
XkbSectionPtr section;
for (s=0,section=geom->sections;s<geom->num_sections;s++,section++){
section->name=XkbChangeAtomDisplay(oldDpy,newDpy,section->name);
if (section->doodads) {
register int d;
XkbDoodadPtr doodad;
for (d=0,doodad=section->doodads;d<section->num_doodads;
d++,doodad++) {
doodad->any.name= XkbChangeAtomDisplay(oldDpy,newDpy,
doodad->any.name);
}
}
if (section->overlays) {
register int o;
register XkbOverlayPtr ol;
for (o=0,ol=section->overlays;o<section->num_overlays;
o++,ol++) {
ol->name= XkbChangeAtomDisplay(oldDpy,newDpy,ol->name);
}
}
}
}
if (geom->doodads) {
register int d;
XkbDoodadPtr doodad;
for (d=0,doodad=geom->doodads;d<geom->num_doodads;d++,doodad++) {
doodad->any.name= XkbChangeAtomDisplay(oldDpy,newDpy,
doodad->any.name);
}
}
}
xkb->dpy= newDpy;
return Success;
}
/***********************************************************
Copyright 1987, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
/************************************************************
Copyright 1994 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <nx-X11/Xos.h>
#include <nx-X11/Xlib.h>
#include <nx-X11/XKBlib.h>
#include "XKMformat.h"
#include "XKBfileInt.h"
/***====================================================================***/
#define InitialTableSize 100
typedef struct _Node {
struct _Node *left, *right;
Atom a;
unsigned int fingerPrint;
char *string;
} NodeRec, *NodePtr;
#define BAD_RESOURCE 0xe0000000
static Atom lastAtom = None;
static NodePtr atomRoot = (NodePtr)NULL;
static unsigned long tableLength;
static NodePtr *nodeTable;
static Atom
_XkbMakeAtom(char *string,unsigned len,Bool makeit)
{
register NodePtr * np;
unsigned i;
int comp;
register unsigned int fp = 0;
np = &atomRoot;
for (i = 0; i < (len+1)/2; i++)
{
fp = fp * 27 + string[i];
fp = fp * 27 + string[len - 1 - i];
}
while (*np != (NodePtr) NULL)
{
if (fp < (*np)->fingerPrint)
np = &((*np)->left);
else if (fp > (*np)->fingerPrint)
np = &((*np)->right);
else
{ /* now start testing the strings */
comp = strncmp(string, (*np)->string, (int)len);
if ((comp < 0) || ((comp == 0) && (len < strlen((*np)->string))))
np = &((*np)->left);
else if (comp > 0)
np = &((*np)->right);
else
return(*np)->a;
}
}
if (makeit)
{
register NodePtr nd;
nd = (NodePtr) _XkbAlloc(sizeof(NodeRec));
if (!nd)
return BAD_RESOURCE;
nd->string = (char *) _XkbAlloc(len + 1);
if (!nd->string) {
_XkbFree(nd);
return BAD_RESOURCE;
}
strncpy(nd->string, string, (int)len);
nd->string[len] = 0;
if ((lastAtom + 1) >= tableLength) {
NodePtr *table;
table = (NodePtr *) _XkbRealloc(nodeTable,
tableLength * (2 * sizeof(NodePtr)));
if (!table) {
if (nd->string != string)
_XkbFree(nd->string);
_XkbFree(nd);
return BAD_RESOURCE;
}
tableLength <<= 1;
nodeTable = table;
}
*np = nd;
nd->left = nd->right = (NodePtr) NULL;
nd->fingerPrint = fp;
nd->a = (++lastAtom);
*(nodeTable+lastAtom) = nd;
return nd->a;
}
else
return None;
}
static char *
_XkbNameForAtom(Atom atom)
{
NodePtr node;
if (atom > lastAtom) return 0;
if ((node = nodeTable[atom]) == (NodePtr)NULL) return 0;
return node->string;
}
static void
_XkbInitAtoms(void)
{
tableLength = InitialTableSize;
nodeTable = (NodePtr *)_XkbAlloc(InitialTableSize*sizeof(NodePtr));
nodeTable[None] = (NodePtr)NULL;
}
/***====================================================================***/
char *
XkbAtomGetString(Display *dpy,Atom atm)
{
if (atm==None)
return NULL;
if (dpy==NULL)
return _XkbNameForAtom(atm);
return XGetAtomName(dpy,atm);
}
/***====================================================================***/
Atom
XkbInternAtom(Display *dpy,char *name,Bool onlyIfExists)
{
if (name==NULL)
return None;
if (dpy==NULL) {
return _XkbMakeAtom(name, strlen(name), (!onlyIfExists));
}
return XInternAtom(dpy,name,onlyIfExists);
}
/***====================================================================***/
Atom
XkbChangeAtomDisplay(Display *oldDpy,Display *newDpy,Atom atm)
{
char *tmp;
if (atm!=None) {
tmp= XkbAtomGetString(oldDpy,atm);
if (tmp!=NULL)
return XkbInternAtom(newDpy,tmp,False);
}
return None;
}
/***====================================================================***/
void
XkbInitAtoms(Display *dpy)
{
static int been_here= 0;
if ((dpy==NULL)&&(!been_here)) {
_XkbInitAtoms();
been_here= 1;
}
return;
}
/************************************************************
Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
/* $XFree86$ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <nx-X11/Xlib.h>
#include <nx-X11/XKBlib.h>
#include "XKBbells.h"
static char *_xkbStdBellNames[XkbBI_NumBells] = {
"Info",
"Warning",
"MinorError",
"MajorError",
"BadValue",
"InvalidLocation",
"Question",
"Start",
"End",
"Success",
"Failure",
"Wait",
"Proceed",
"Ignore",
"Iconify",
"Deconify",
"Open",
"Close",
"TerminalBell",
"MarginBell",
"CursorStuck",
"NewMail",
"LaunchApp",
"AppDeath",
"ImAlive",
"ClockChimeHour",
"ClockChimeHalf",
"ClockChimeQuarter",
"RepeatingLastBell",
"ComposeFail",
"AX_FeatureOn",
"AX_FeatureOff",
"AX_FeatureChange",
"AX_IndicatorOn",
"AX_IndicatorOff",
"AX_IndicatorChange",
"AX_SlowKeysWarning",
"AX_SlowKeyPress",
"AX_SlowKeyAccept",
"AX_SlowKeyReject",
"AX_SlowKeyRelease",
"AX_BounceKeyReject",
"AX_StickyLatch",
"AX_StickyLock",
"AX_StickyUnlock"
};
static Atom _xkbStdBellAtoms[XkbBI_NumBells];
Bool
XkbStdBell(Display *dpy,Window win,int percent,int bellDef)
{
if ((bellDef<0)||(bellDef>=XkbBI_NumBells))
bellDef= XkbBI_Info;
if (_xkbStdBellAtoms[bellDef]==None)
_xkbStdBellAtoms[bellDef]= XInternAtom(dpy,_xkbStdBellNames[bellDef],0);
return XkbBell(dpy,win,percent,_xkbStdBellAtoms[bellDef]);
}
Bool
XkbStdBellEvent(Display *dpy,Window win,int percent,int bellDef)
{
if ((bellDef<0)||(bellDef>=XkbBI_NumBells))
bellDef= XkbBI_Info;
if (_xkbStdBellAtoms[bellDef]==None)
_xkbStdBellAtoms[bellDef]= XInternAtom(dpy,_xkbStdBellNames[bellDef],0);
return XkbBellEvent(dpy,win,percent,_xkbStdBellAtoms[bellDef]);
}
/************************************************************
Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <nx-X11/Xos.h>
#include <nx-X11/Xfuncs.h>
#include <nx-X11/Xlib.h>
#include <nx-X11/keysym.h>
#include <nx-X11/XKBlib.h>
#include <nx-X11/extensions/XKBgeom.h>
#include "XKMformat.h"
#include "XKBfileInt.h"
static void
_XkbAddDrawable(XkbDrawablePtr *pfirst,XkbDrawablePtr *plast,XkbDrawablePtr tmp)
{
XkbDrawablePtr old;
if (*pfirst==NULL) {
*pfirst= *plast= tmp;
}
else if (tmp->priority>=(*plast)->priority) {
(*plast)->next= tmp;
*plast= tmp;
}
else if (tmp->priority<(*pfirst)->priority) {
tmp->next= (*pfirst);
(*pfirst)= tmp;
}
else {
old= *pfirst;
while ((old->next)&&(old->next->priority<=tmp->priority)) {
old= old->next;
}
tmp->next= old->next;
old->next= tmp;
}
return;
}
XkbDrawablePtr
XkbGetOrderedDrawables(XkbGeometryPtr geom,XkbSectionPtr section)
{
XkbDrawablePtr first,last,tmp;
int i;
first= last= NULL;
if (geom!=NULL) {
XkbSectionPtr section;
XkbDoodadPtr doodad;
for (i=0,section=geom->sections;i<geom->num_sections;i++,section++) {
tmp= _XkbTypedCalloc(1,XkbDrawableRec);
if (!tmp) {
XkbFreeOrderedDrawables(first);
return NULL;
}
tmp->type= XkbDW_Section;
tmp->priority= section->priority;
tmp->u.section= section;
tmp->next= NULL;
_XkbAddDrawable(&first,&last,tmp);
}
for (i=0,doodad=geom->doodads;i<geom->num_doodads;i++,doodad++) {
tmp= _XkbTypedCalloc(1,XkbDrawableRec);
if (!tmp) {
XkbFreeOrderedDrawables(first);
return NULL;
}
tmp->type= XkbDW_Doodad;
tmp->priority= doodad->any.priority;
tmp->u.doodad= doodad;
tmp->next= NULL;
_XkbAddDrawable(&first,&last,tmp);
}
}
if (section!=NULL) {
XkbDoodadPtr doodad;
for (i=0,doodad=section->doodads;i<section->num_doodads;i++,doodad++) {
tmp= _XkbTypedCalloc(1,XkbDrawableRec);
if (!tmp) {
XkbFreeOrderedDrawables(first);
return NULL;
}
tmp->type= XkbDW_Doodad;
tmp->priority= doodad->any.priority;
tmp->u.doodad= doodad;
tmp->next= NULL;
_XkbAddDrawable(&first,&last,tmp);
}
}
return first;
}
void
XkbFreeOrderedDrawables(XkbDrawablePtr draw)
{
XkbDrawablePtr tmp;
for (;draw!=NULL;draw=tmp) {
tmp= draw->next;
_XkbFree(draw);
}
return;
}
LIBRARY xkbfile
VERSION LIBRARY_VERSION
EXPORTS
XkbAccessXDetailText
XkbActionText
XkbActionTypeText
XkbAtomGetString
XkbAtomText
XkbBehaviorText
XkbCFAddModByName
XkbCFAddPrivate
XkbCFApplyMods
XkbCFApplyRtrnValues
XkbCFBindMods
XkbCFDup
XkbCFFree
XkbCFFreeRtrn
XkbCFParse
XkbCFReportError
XkbCFScan
XkbChangeAtomDisplay
XkbChangeKbdDisplay
XkbConfigText
XkbControlsMaskText
XkbConvertGetByNameComponents
XkbConvertXkbComponents
XkbDetermineFileType
XkbDoodadTypeText
XkbEnsureSafeMapName
XkbFindKeycodeByName
XkbFreeOrderedDrawables
XkbGeomFPText
XkbGetOrderedDrawables
XkbIMWhichStateMaskText
XkbIndentText
XkbInitAtoms
XkbInternAtom
XkbKeyNameText
XkbKeysymText
XkbLookupCanonicalRGBColor
XkbLookupGroupAndLevel
XkbMergeFile
XkbModIndexText
XkbModMaskText
XkbNKNDetailMaskText
XkbNameMatchesPattern
XkbRF_AddGroup
XkbRF_AddRule
XkbRF_AddVarDesc
XkbRF_AddVarDescCopy
XkbRF_AddVarToDescribe
XkbRF_Create
XkbRF_Free
XkbRF_GetComponents
XkbRF_GetNamesProp
XkbRF_Load
XkbRF_LoadDescriptions
XkbRF_LoadDescriptionsByName
XkbRF_LoadRules
XkbRF_LoadRulesByName
XkbRF_SetNamesProp
XkbReadFromServer
XkbSIMatchText
XkbStdBell
XkbStdBellEvent
XkbStringText
XkbVModIndexText
XkbVModMaskText
XkbWriteCFile
XkbWriteToServer
XkbWriteXKBCompatMap
XkbWriteXKBFile
XkbWriteXKBGeometry
XkbWriteXKBKeyTypes
XkbWriteXKBKeycodes
XkbWriteXKBKeymap
XkbWriteXKBKeymapForNames
XkbWriteXKBLayout
XkbWriteXKBSemantics
XkbWriteXKBSymbols
XkbWriteXKMFile
XkmFindTOCEntry
XkmProbe
XkmReadFile
XkmReadFileSection
XkmReadFileSectionName
XkmReadTOC
#ifdef __UNIXOS2__
_XkbStrCaseCmp
XkbCFDflts
_XkbErrLocation
_XkbErrCode
_XkbErrMessages
_XkbKSCheckCase
#endif
...@@ -72,14 +72,7 @@ AllTarget($(XF86_OBJS)) ...@@ -72,14 +72,7 @@ AllTarget($(XF86_OBJS))
SpecialCObjectRule(xkbInit,$(ICONFIGFILES),$(XKB_DEFINES)) SpecialCObjectRule(xkbInit,$(ICONFIGFILES),$(XKB_DEFINES))
LinkSourceFile(maprules.c,$(XKBFILELIBSRC))
LinkSourceFile(xkmread.c,$(XKBFILELIBSRC))
LinkSourceFile(xkbtext.c,$(XKBFILELIBSRC))
XCOMM avoid clash between XKBMisc.c and xkbmisc.c on NT XCOMM avoid clash between XKBMisc.c and xkbmisc.c on NT
LinkFile(xkbfmisc.c,$(XKBFILELIBSRC)/xkbmisc.c)
LinkSourceFile(xkberrs.c,$(XKBFILELIBSRC))
LinkSourceFile(xkbconfig.c,$(XKBFILELIBSRC))
LinkSourceFile(xkbout.c,$(XKBFILELIBSRC))
LinkSourceFile(XKBMisc.c,$(XLIBSRC)) LinkSourceFile(XKBMisc.c,$(XLIBSRC))
LinkSourceFile(XKBMAlloc.c,$(XLIBSRC)) LinkSourceFile(XKBMAlloc.c,$(XLIBSRC))
LinkSourceFile(XKBAlloc.c,$(XLIBSRC)) LinkSourceFile(XKBAlloc.c,$(XLIBSRC))
......
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