00001
00005 #ifndef __XKLAVIER_CONFIG_H__
00006 #define __XKLAVIER_CONFIG_H__
00007
00008 #include <libxklavier/xklavier.h>
00009
00013 #define XKL_MAX_CI_NAME_LENGTH 32
00014
00020 #define XKL_MAX_CI_SHORT_DESC_LENGTH 10
00021
00027 #define XKL_MAX_CI_DESC_LENGTH 192
00028
00029 #ifdef __cplusplus
00030 extern "C"
00031 {
00032 #endif
00033
00037 typedef struct _XklConfigItem
00038 {
00042 char name[XKL_MAX_CI_NAME_LENGTH];
00043
00047 char shortDescription[XKL_MAX_CI_DESC_LENGTH];
00048
00052 char description[XKL_MAX_CI_DESC_LENGTH];
00053 }
00054 XklConfigItem, *XklConfigItemPtr;
00055
00059 typedef struct _XklConfigRec
00060 {
00064 char *model;
00068 int numLayouts;
00072 char **layouts;
00076 int numVariants;
00080 char **variants;
00084 int numOptions;
00088 char **options;
00089 }
00090 XklConfigRec, *XklConfigRecPtr;
00099 extern void XklConfigInit( void );
00100
00104 extern void XklConfigTerm( void );
00105
00111 extern Bool XklConfigLoadRegistryFromFile( const char* fileName );
00112
00117 extern Bool XklConfigLoadRegistry( void );
00118
00122 extern void XklConfigFreeRegistry( void );
00135 typedef void ( *ConfigItemProcessFunc ) ( const XklConfigItemPtr configItem,
00136 void *userData );
00137
00144 typedef void ( *GroupProcessFunc ) ( const XklConfigItemPtr configItem,
00145 Bool allowMultipleSelection,
00146 void *userData );
00152 extern void XklConfigEnumModels( ConfigItemProcessFunc func,
00153 void *userData );
00154
00160 extern void XklConfigEnumLayouts( ConfigItemProcessFunc func,
00161 void *userData );
00162
00169 extern void XklConfigEnumLayoutVariants( const char *layoutName,
00170 ConfigItemProcessFunc func,
00171 void *userData );
00172
00178 extern void XklConfigEnumOptionGroups( GroupProcessFunc func,
00179 void *userData );
00180
00188 extern void XklConfigEnumOptions( const char *optionGroupName,
00189 ConfigItemProcessFunc func,
00190 void *userData );
00191
00205 extern Bool XklConfigFindModel( XklConfigItemPtr ptr );
00206
00213 extern Bool XklConfigFindLayout( XklConfigItemPtr ptr );
00214
00223 extern Bool XklConfigFindVariant( const char *layoutName,
00224 XklConfigItemPtr ptr );
00225
00235 extern Bool XklConfigFindOptionGroup( XklConfigItemPtr ptr,
00236 Bool * allowMultipleSelection );
00237
00246 extern Bool XklConfigFindOption( const char *optionGroupName,
00247 XklConfigItemPtr ptr );
00263 extern Bool XklConfigActivate( const XklConfigRecPtr data );
00264
00270 extern Bool XklConfigGetFromServer( XklConfigRecPtr data );
00271
00278 extern Bool XklConfigGetFromBackup( XklConfigRecPtr data );
00279
00288 extern Bool XklConfigWriteFile( const char *fileName,
00289 const XklConfigRecPtr data,
00290 const Bool binary );
00291
00308 extern Bool XklGetNamesProp( Atom rulesAtomName,
00309 char **rulesFileOut,
00310 XklConfigRecPtr configOut );
00311
00319 extern Bool XklSetNamesProp( Atom rulesAtomName,
00320 char *rulesFile, XklConfigRecPtr config );
00321
00327 extern Bool XklBackupNamesProp( );
00328
00334 extern Bool XklRestoreNamesProp( );
00335
00348 extern void XklConfigRecInit( XklConfigRecPtr data );
00349
00354 extern void XklConfigRecReset( XklConfigRecPtr data );
00355
00360 extern void XklConfigRecDestroy( XklConfigRecPtr data );
00361
00368 extern Bool XklConfigRecEquals( XklConfigRecPtr data1, XklConfigRecPtr data2 );
00369
00372 #ifdef __cplusplus
00373 }
00374 #endif
00375
00376 #endif