1#ifndef _XKBRULES_H_ 2#define _XKBRULES_H_ 1 3 4/************************************************************ 5 Copyright (c) 1996 by Silicon Graphics Computer Systems, Inc. 6 7 Permission to use, copy, modify, and distribute this 8 software and its documentation for any purpose and without 9 fee is hereby granted, provided that the above copyright 10 notice appear in all copies and that both that copyright 11 notice and this permission notice appear in supporting 12 documentation, and that the name of Silicon Graphics not be 13 used in advertising or publicity pertaining to distribution 14 of the software without specific prior written permission. 15 Silicon Graphics makes no representation about the suitability 16 of this software for any purpose. It is provided "as is" 17 without any express or implied warranty. 18 19 SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 20 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 21 AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON 22 GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 23 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 24 DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 25 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH 26 THE USE OR PERFORMANCE OF THIS SOFTWARE. 27 28 ********************************************************/ 29 30/***====================================================================***/ 31 32typedef struct _XkbRMLVOSet { 33 char *rules; 34 char *model; 35 char *layout; 36 char *variant; 37 char *options; 38} XkbRMLVOSet; 39 40typedef struct _XkbRF_VarDefs { 41 const char *model; 42 const char *layout; 43 const char *variant; 44 const char *options; 45} XkbRF_VarDefsRec, *XkbRF_VarDefsPtr; 46 47typedef struct _XkbRF_Rule { 48 int number; 49 int layout_num; 50 int variant_num; 51 const char *model; 52 const char *layout; 53 const char *variant; 54 const char *option; 55 /* yields */ 56 const char *keycodes; 57 const char *symbols; 58 const char *types; 59 const char *compat; 60 const char *geometry; 61 unsigned flags; 62} XkbRF_RuleRec, *XkbRF_RulePtr; 63 64typedef struct _XkbRF_Group { 65 int number; 66 const char *name; 67 char *words; 68} XkbRF_GroupRec, *XkbRF_GroupPtr; 69 70#define XkbRF_PendingMatch (1L<<1) 71#define XkbRF_Option (1L<<2) 72#define XkbRF_Append (1L<<3) 73#define XkbRF_Normal (1L<<4) 74#define XkbRF_Invalid (1L<<5) 75 76typedef struct _XkbRF_Rules { 77 unsigned short sz_rules; 78 unsigned short num_rules; 79 XkbRF_RulePtr rules; 80 unsigned short sz_groups; 81 unsigned short num_groups; 82 XkbRF_GroupPtr groups; 83} XkbRF_RulesRec, *XkbRF_RulesPtr; 84 85/***====================================================================***/ 86 87_XFUNCPROTOBEGIN 88 89/* Seems preferable to dragging xkbstr.h in. */ 90 struct _XkbComponentNames; 91 92extern _X_EXPORT Bool XkbRF_GetComponents(XkbRF_RulesPtr /* rules */ , 93 XkbRF_VarDefsPtr /* var_defs */ , 94 struct _XkbComponentNames * /* names */ 95 ); 96 97extern _X_EXPORT Bool XkbRF_LoadRules(FILE * /* file */ , 98 XkbRF_RulesPtr /* rules */ 99 ); 100 101extern _X_EXPORT Bool XkbRF_LoadRulesByName(char * /* base */ , 102 char * /* locale */ , 103 XkbRF_RulesPtr /* rules */ 104 ); 105 106/***====================================================================***/ 107 108extern _X_EXPORT XkbRF_RulesPtr XkbRF_Create(void); 109 110extern _X_EXPORT void XkbRF_Free(XkbRF_RulesPtr /* rules */ , 111 Bool /* freeRules */ 112 ); 113 114/***====================================================================***/ 115 116#define _XKB_RF_NAMES_PROP_ATOM "_XKB_RULES_NAMES" 117#define _XKB_RF_NAMES_PROP_MAXLEN 1024 118 119_XFUNCPROTOEND 120#endif /* _XKBRULES_H_ */ 121