Back to index

im-sdk  12.3.91
imbean.h
Go to the documentation of this file.
00001 #ifndef _IBML_H_
00002 #define _IBML_H_
00003 
00004 /*
00005 IBML: Input Bean Markup Language
00006 
00007 It's designed mainly for the configure for language engines and auxiliary window.
00008 
00009 the format of ibml file as follow:
00010 
00011 <imconfig scope="cle">
00012 <im scope="engines">
00013 <imbean id="palette_aux">
00014     <property
00015         name="object"
00016         value="/usr/lib/im/locale/zh_CN/PaletteAux"/>
00017     <property
00018         name="args"
00019         value="-locale zh_CN.gb18030"/>
00020 </imbean>
00021 </im>
00022 </imconfig>
00023 
00024 */
00025 
00026 #define IBML_ELEMENT_ROOT             "imconfig"
00027 #define IBML_ELEMENT_SCOPE            "scope"
00028 #define IBML_ELEMENT_CATAGORY         "im"
00029 #define IBML_ELEMENT_IMBEAN           "imbean"
00030 #define IBML_ELEMENT_IMBEAN_ID        "id"
00031 #define IBML_ELEMENT_PROPERTY         "property"
00032 #define IBML_ELEMENT_PROPERTY_NAME    "name"
00033 #define IBML_ELEMENT_PROPERTY_VALUE   "value"
00034 #define IBML_ELEMENT_PROPERTY_OPTIONS "options"
00035 #define IBML_ELEMENT_PROPERTY_TYPE    "type"
00036 
00037 #define IBML_OK            0
00038 #define IBML_ERROR         -1
00039 
00040 typedef struct _IbmlProperty {
00041     char *name;
00042     char *type;
00043     char *value;
00044     char *options;
00045     char *scope;
00046 } IbmlProperty, *IbmlPropertyPtr;
00047 
00048 typedef struct _IbmlElement {
00049     char *id;
00050     char *scope;
00051     char *class;
00052 
00053     int num_properties;
00054     IbmlPropertyPtr *properties;
00055 } IbmlElement, *IbmlElementPtr;
00056 
00057 typedef struct _IbmlCategory {
00058     char *scope;
00059 
00060     int num_elements;
00061     IbmlElementPtr *elements;
00062 } IbmlCategory, *IbmlCategoryPtr;
00063 
00064 typedef struct _IbmlData {
00065     char *scope;
00066     int num_categories;
00067     IbmlCategoryPtr *categories;
00068 } IbmlData;
00069 
00070 #endif                      /* _IBML_H_ */