Back to index

im-sdk  12.3.91
Classes | Typedefs | Functions
lexmlconf.h File Reference
#include "SunIM.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _IIIMLEXMLConf
struct  _IIIMLEInfoList
struct  _IIIMLEInfo
struct  _IIIMLELanguageList
struct  _HotKeyStruct
struct  _HotKeyList

Typedefs

typedef struct _IIIMLEXMLConf
typedef struct _IIIMLEXMLConfPrivate
typedef struct _IIIMLEInfoList
typedef struct _IIIMLEInfo
typedef struct _IIIMLELanguageList
typedef struct _HotKeyStruct
typedef struct _HotKeyList

Functions

void iiim_log_init (const char *name)
void iiim_log_debug_mode (void)
IIIMLEXMLConf * iiim_le_xmlconf_new (const char *filename)
void iiim_le_xmlconf_free (IIIMLEXMLConf *conf)
int iiim_le_xmlconf_load_file (IIIMLEXMLConf *conf)
int iiim_le_xmlconf_load_with_nsio (IIIMLEXMLConf *conf, iml_desktop_t *iml_desktop)
int iiim_le_xmlconf_save_file (IIIMLEXMLConf *conf)
int iiim_le_xmlconf_is_empty_module (IIIMLEXMLConf *conf)
int iiim_le_xmlconf_append_module (IIIMLEXMLConf *conf, const char *modulename, const char *language)
int iiim_le_xmlconf_prepend_module (IIIMLEXMLConf *conf, const char *modulename, const char *language)
int iiim_le_xmlconf_remove_module (IIIMLEXMLConf *conf, const char *modulename, const char *language)
IIIMLEInfoList * iiim_le_xmlconf_get_le_info_list (IIIMLEXMLConf *conf, const char *language)
IIIMLELanguageList * iiim_le_xmlconf_get_lang_list (IIIMLEXMLConf *conf)
int iiim_le_xmlconf_is_empty_hotkey (IIIMLEXMLConf *conf)
int iiim_le_xmlconf_append_hotkey (IIIMLEXMLConf *conf, HotKeyStruct *hotkey, const char *language)
int iiim_le_xmlconf_remove_hotkey (IIIMLEXMLConf *conf, HotKeyStruct *hotkey, const char *language)
int iiim_le_xmlconf_clear_hotkey (IIIMLEXMLConf *conf, const char *language)
HotKeyList * iiim_le_xmlconf_get_hotkey_list (IIIMLEXMLConf *conf, const char *language)
HotKeyStruct * iiim_le_hotkey_struct_new (const char *name, const char *modifiers)
void iiim_le_hotkey_struct_free (HotKeyStruct *hotkey)
HotKeyList * iiim_le_hotkey_list_new (HotKeyStruct *hotkey)
HotKeyList * iiim_le_hotkey_list_add (HotKeyList *list, HotKeyStruct *hotkey)
HotKeyList * iiim_le_hotkey_list_remove (HotKeyList *list, HotKeyStruct *hotkey)
HotKeyList * iiim_le_hotkey_list_find (HotKeyList *list, HotKeyStruct *hotkey)
void iiim_le_hotkey_list_free (HotKeyList *list)

Class Documentation

struct _IIIMLEXMLConf

Definition at line 59 of file lexmlconf.h.

Class Members
char * filename
IIIMLEXMLConfPrivate * priv
struct _IIIMLEInfoList

Definition at line 63 of file lexmlconf.h.

Class Members
IIIMLEInfo * data
IIIMLEInfoList * next
struct _IIIMLEInfo

Definition at line 67 of file lexmlconf.h.

Class Members
char * language
char * lename
struct _IIIMLELanguageList

Definition at line 71 of file lexmlconf.h.

Collaboration diagram for _IIIMLELanguageList:
Class Members
char * language
struct _IIIMLELanguageList * next
struct _HotKeyStruct

Definition at line 75 of file lexmlconf.h.

Class Members
char * key
int keycode
char * modifiers
int modmask
struct _HotKeyList

Definition at line 81 of file lexmlconf.h.

Class Members
HotKeyStruct * hotkey
HotKeyList * next

Typedef Documentation

typedef struct _HotKeyList

Definition at line 57 of file lexmlconf.h.

typedef struct _HotKeyStruct

Definition at line 56 of file lexmlconf.h.

typedef struct _IIIMLEInfo

Definition at line 54 of file lexmlconf.h.

typedef struct _IIIMLEInfoList

Definition at line 53 of file lexmlconf.h.

typedef struct _IIIMLELanguageList

Definition at line 55 of file lexmlconf.h.

typedef struct _IIIMLEXMLConf

Definition at line 51 of file lexmlconf.h.

typedef struct _IIIMLEXMLConfPrivate

Definition at line 52 of file lexmlconf.h.


Function Documentation

HotKeyList* iiim_le_hotkey_list_add ( HotKeyList *  list,
HotKeyStruct *  hotkey 
)

Definition at line 1217 of file lexmlconf.cpp.

{
       HotKeyList *retval, *l, *prev;

       if (list != NULL) {
              for (l = list, prev = list; l != NULL; prev = l, l = prev->next) {
                     if (iiim_le_hotkey_list_find(list, hotkey) != NULL) {
                            return list;
                     }
              }
              prev->next = iiim_le_hotkey_list_new(hotkey);
              retval = list;
       } else {
              retval = iiim_le_hotkey_list_new(hotkey);
       }

       return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

HotKeyList* iiim_le_hotkey_list_find ( HotKeyList *  list,
HotKeyStruct *  hotkey 
)

Definition at line 1264 of file lexmlconf.cpp.

{
       HotKeyList *l;

       if (hotkey == NULL)
              return NULL;

       for (l = list; l != NULL; l = l->next) {
              if (!strcasecmp(l->hotkey->key, hotkey->key) &&
                  !_compare_modifiers(l->hotkey->modifiers, hotkey->modifiers)) {
                     return l;
              }
       }

       return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void iiim_le_hotkey_list_free ( HotKeyList *  list)

Definition at line 1283 of file lexmlconf.cpp.

{
       HotKeyList *last;

       while (list) {
              last = list;
              list = last->next;
              if (last->hotkey)
                     iiim_le_hotkey_struct_free(last->hotkey);
              free(last);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

HotKeyList* iiim_le_hotkey_list_new ( HotKeyStruct *  hotkey)

Definition at line 1205 of file lexmlconf.cpp.

{
       HotKeyList *list;

       list = (HotKeyList *)malloc(sizeof (HotKeyList) * 1);
       list->hotkey = hotkey;
       list->next = NULL;

       return list;
}

Here is the caller graph for this function:

HotKeyList* iiim_le_hotkey_list_remove ( HotKeyList *  list,
HotKeyStruct *  hotkey 
)

Definition at line 1238 of file lexmlconf.cpp.

{
       HotKeyList *tmp, *prev = NULL;

       tmp = list;
       while (tmp) {
              if (!strcasecmp(tmp->hotkey->key, hotkey->key) &&
                  !_compare_modifiers(tmp->hotkey->modifiers, hotkey->modifiers)) {
                     if (prev)
                            prev->next = tmp->next;
                     else
                            list = tmp->next;
                     iiim_le_hotkey_struct_free(tmp->hotkey);
                     free(tmp);

                     break;
              }
              prev = tmp;
              tmp = prev->next;
       }

       return list;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void iiim_le_hotkey_struct_free ( HotKeyStruct *  hotkey)

Definition at line 1192 of file lexmlconf.cpp.

{
       if (hotkey == NULL)
              return;

       if (hotkey->modifiers)
              free(hotkey->modifiers);
       if (hotkey->key)
              free(hotkey->key);
       free(hotkey);
}

Here is the caller graph for this function:

HotKeyStruct* iiim_le_hotkey_struct_new ( const char *  name,
const char *  modifiers 
)

Definition at line 1166 of file lexmlconf.cpp.

{
       HotKeyStruct *retval;
       int i;

       retval = (HotKeyStruct *)malloc(sizeof (HotKeyStruct) * 1);
       if (modifiers) {
              retval->modifiers = strdup(modifiers);
              retval->modmask = _symbol2mask(modifiers);
       } else {
              retval->modifiers = NULL;
              retval->modmask = 0;
       }
       retval->key = strdup(name);
       for (i = 0; keysymtable[i].keyname != NULL; i++) {
              if (!strcasecmp(name, keysymtable[i].keyname)) {
                     retval->keycode = keysymtable[i].keysym;
                     break;
              }
       }

       return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int iiim_le_xmlconf_append_hotkey ( IIIMLEXMLConf *  conf,
HotKeyStruct *  hotkey,
const char *  language 
)

Definition at line 1019 of file lexmlconf.cpp.

{
       HotKeyList *list;
       struct _HotKeyEntry *ent;
       int stored = 0;

       if (conf == NULL || hotkey == NULL || language == NULL)
              return 0;

       for (ent = conf->priv->hotkeys; ent != NULL; ent = ent->next) {
              if (!strcmp(ent->language, language)) {
                     list = iiim_le_hotkey_list_find(ent->list, hotkey);
                     if (list != NULL) {
                            LOG_DEBUG("Hotkey (lang:%s, key:%s, modifier:%s) has already been registered.", language, hotkey->key, hotkey->modifiers);
                            return 0;
                     }
                     LOG_DEBUG("Adding Hotkey (lang:%s, key:%s, modifier:%s)", language, hotkey->key, hotkey->modifiers);
                     ent->list = iiim_le_hotkey_list_add(ent->list, hotkey);
                     stored = 1;
                     break;
              }
       }
       if (!stored) {
              struct _HotKeyEntry *entry, *tmp;

              entry = (struct _HotKeyEntry *)malloc(sizeof (struct _HotKeyEntry) * 1);

              LOG_DEBUG("Adding Hotkey (lang:%s, key:%s, modifier:%s)", language, hotkey->key, hotkey->modifiers);
              entry->language = strdup(language);
              entry->list = iiim_le_hotkey_list_new(hotkey);
              entry->next = NULL;
              if (conf->priv->hotkeys != NULL) {
                     for (tmp = conf->priv->hotkeys; tmp->next != NULL; tmp = tmp->next);
                     tmp->next = entry;
              } else {
                     conf->priv->hotkeys = entry;
              }
       }

       return 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int iiim_le_xmlconf_append_module ( IIIMLEXMLConf *  conf,
const char *  modulename,
const char *  language 
)

Definition at line 836 of file lexmlconf.cpp.

{
       IIIMLEInfo *leinfo, *le;
       struct _LEEntry *ent;
       int stored = 0;

       if (conf == NULL)
              return 0;

       leinfo = iiim_le_info_new(language, modulename);
       if (leinfo == NULL)
              return 0;

       for (ent = conf->priv->entries; ent != NULL; ent = ent->next) {
              if (!strcmp(ent->language, language)) {
                     le = iiim_le_info_list_find(ent->list, leinfo);
                     if (le != NULL) {
                            LOG_DEBUG("LE (lang:%s, %s) has already been registered.", language, le->lename);
                            iiim_le_info_free(leinfo);

                            return 0;
                     }
                     LOG_DEBUG("Adding LE (lang:%s, %s)", language, modulename);
                     ent->list = iiim_le_info_list_add(ent->list, leinfo);
                     stored = 1;
                     break;
              }
       }
       if (!stored) {
              struct _LEEntry *entry, *tmp;

              entry = (struct _LEEntry *)malloc(sizeof (struct _LEEntry) * 1);

              LOG_DEBUG("Adding LE (lang:%s, %s)", language, modulename);
              entry->language = strdup(language);
              entry->list = iiim_le_info_list_new(leinfo);
              entry->next = NULL;
              if (conf->priv->entries != NULL) {
                     for (tmp = conf->priv->entries; tmp->next != NULL; tmp = tmp->next);
                     tmp->next = entry;
              } else {
                     conf->priv->entries = entry;
              }
       }
       conf->priv->lang_list = iiim_le_lang_list_add(conf->priv->lang_list,
                                                language);

       return 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int iiim_le_xmlconf_clear_hotkey ( IIIMLEXMLConf *  conf,
const char *  language 
)

Definition at line 1119 of file lexmlconf.cpp.

{
       struct _HotKeyEntry *ent, *prev;
       int removed = 0;

       if (conf == NULL || language == NULL)
              return 0;

       for (ent = conf->priv->hotkeys, prev = NULL; ent != NULL; prev = ent, ent = prev->next) {
              if (!strcmp(ent->language, language)) {
                     LOG_DEBUG("Clearing Hotkey (lang:%s)", language);
                     iiim_le_hotkey_list_free(ent->list);
                     if (prev != NULL) {
                            prev->next = ent->next;
                     } else {
                            conf->priv->hotkeys = NULL;
                     }
                     free(ent->language);
                     free(ent);
                     removed = 1;
                     break;
              }
       }

       return removed;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void iiim_le_xmlconf_free ( IIIMLEXMLConf *  conf)

Definition at line 592 of file lexmlconf.cpp.

{
       if (conf == NULL)
              return;

       if (conf->filename)
              free(conf->filename);
       iiim_le_xmlconf_remove_modules(conf);
       iiim_le_xmlconf_remove_hotkeys(conf);
       free(conf->priv);

       free(conf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

HotKeyList* iiim_le_xmlconf_get_hotkey_list ( IIIMLEXMLConf *  conf,
const char *  language 
)

Definition at line 1148 of file lexmlconf.cpp.

{
       struct _HotKeyEntry *ent;

       if (conf == NULL || language == NULL)
              return NULL;

       for (ent = conf->priv->hotkeys; ent != NULL; ent = ent->next) {
              if (!strcmp(ent->language, language)) {
                     return ent->list;
              }
       }

       return NULL;
}

Here is the caller graph for this function:

IIIMLELanguageList* iiim_le_xmlconf_get_lang_list ( IIIMLEXMLConf *  conf)

Definition at line 1005 of file lexmlconf.cpp.

{
       return conf->priv->lang_list;
}

Here is the caller graph for this function:

IIIMLEInfoList* iiim_le_xmlconf_get_le_info_list ( IIIMLEXMLConf *  conf,
const char *  language 
)

Definition at line 985 of file lexmlconf.cpp.

{
       struct _LEEntry *ent;
       IIIMLEInfoList *retval = NULL;

       if (conf == NULL || language == NULL || language[0] == 0)
              return NULL;

       for (ent = conf->priv->entries; ent != NULL; ent = ent->next) {
              if (!strcmp(ent->language, language)) {
                     retval = ent->list;
                     break;
              }
       }

       return retval;
}

Here is the caller graph for this function:

int iiim_le_xmlconf_is_empty_hotkey ( IIIMLEXMLConf *  conf)

Definition at line 1011 of file lexmlconf.cpp.

{
       if (conf == NULL)
              return 0;
       return conf->priv->hotkeys == NULL;
}

Here is the caller graph for this function:

int iiim_le_xmlconf_is_empty_module ( IIIMLEXMLConf *  conf)

Definition at line 828 of file lexmlconf.cpp.

{
       if (conf == NULL)
              return 0;
       return conf->priv->entries == NULL;
}

Here is the caller graph for this function:

int iiim_le_xmlconf_load_file ( IIIMLEXMLConf *  conf)

Definition at line 645 of file lexmlconf.cpp.

{
#ifdef HAVE_XMLCTXTREAD
    xmlParserCtxtPtr parser = NULL;
#endif
    xmlDocPtr doc = NULL;
    int retval = 0;

    if (conf == NULL)
           return 0;
    if (conf->filename == NULL)
           return 0;

    /* make sure that there is no older data */
    if (!iiim_le_xmlconf_is_empty_module(conf)) {
           iiim_le_xmlconf_remove_modules(conf);
           iiim_le_xmlconf_remove_hotkeys(conf);
    }

#ifdef HAVE_XMLCTXTREAD
    parser = xmlNewParserCtxt();
    if ((doc = xmlCtxtReadFile(parser, conf->filename, "UTF-8", 0)) == NULL) {
#else
    if ((doc = xmlParseFile(conf->filename)) == NULL) {
#endif
       goto ensure;
#ifdef HAVE_XMLCTXTREAD
    }
#else
    }
#endif

    retval = _parse_xml(conf, doc);

  ensure:
#ifdef HAVE_XMLCTXTREAD
    if (parser != NULL)
       xmlFreeParserCtxt(parser);
#endif

    return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int iiim_le_xmlconf_load_with_nsio ( IIIMLEXMLConf *  conf,
iml_desktop_t iml_desktop 
)

Definition at line 689 of file lexmlconf.cpp.

{
    xmlDocPtr doc = NULL;
    int retval = 0;
    iml_nsc_create_t nsc_create = (iml_nsc_create_t)(iml_desktop->If->nsc_get_function("_nsc_create"));
    iml_nsc_free_t nsc_free = (iml_nsc_free_t)(iml_desktop->If->nsc_get_function("_nsc_free"));
    iml_nsc_open_t nsc_open = (iml_nsc_open_t)(iml_desktop->If->nsc_get_function("open"));
    iml_nsc_close_t nsc_close = (iml_nsc_close_t)(iml_desktop->If->nsc_get_function("close"));
    iml_nsc_read_t nsc_read = (iml_nsc_read_t)(iml_desktop->If->nsc_get_function("read"));
    iml_nsc_lstat_t nsc_lstat = (iml_nsc_lstat_t)(iml_desktop->If->nsc_get_function("lstat"));
    iml_nsc_t nsc = NULL;
    int fd = 0, size;
    size_t len;
    char *buffer = NULL;
    struct stat st;

    if (conf == NULL)
           return 0;
    if (conf->filename == NULL)
           return 0;

    /* make sure that there is no older data */
    if (!iiim_le_xmlconf_is_empty_module(conf)) {
           iiim_le_xmlconf_remove_modules(conf);
           iiim_le_xmlconf_remove_hotkeys(conf);
    }

    /* FIXME: read the conf here */
    nsc = (iml_nsc_t)nsc_create("IIIMLEXMLConf", IML_NSC_TYPE_DESKTOP, iml_desktop);
    if (nsc_lstat(nsc, conf->filename, &st) == -1) {
           LOG_DEBUG("Failed to stat %s via the namespace I/O: %s", conf->filename, strerror(errno));
           goto ensure;
    }
    size = st.st_size;
    buffer = (char *)malloc(sizeof (char) * (size + 1));
    if ((fd = nsc_open(nsc, conf->filename, O_RDONLY)) == -1) {
           LOG_DEBUG("Failed to open %s via the namespace I/O: %s", conf->filename, strerror(errno));
           goto ensure;
    }
    if ((len = nsc_read(nsc, fd, buffer, size)) == -1) {
           LOG_DEBUG("Failed to read %s via the namespace I/O: %s", conf->filename, strerror(errno));
           goto ensure;
    }
    nsc_close(nsc, fd);
    fd = 0;

    if ((doc = xmlParseMemory(buffer, size)) == NULL) {
           goto ensure;
    }

    retval = _parse_xml(conf, doc);

  ensure:
    if (fd > 0)
           nsc_close(nsc, fd);
    if (buffer)
           free(buffer);
    if (nsc)
           nsc_free(nsc);

    return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

IIIMLEXMLConf* iiim_le_xmlconf_new ( const char *  filename)

Definition at line 552 of file lexmlconf.cpp.

{
       IIIMLEXMLConf *conf;

       /* need to initialize IMLog instance here to use LOG_* macros. */
       iiim_log_init(__FILE__);

       if (filename == NULL)
              return NULL;

       conf = (IIIMLEXMLConf *) malloc(sizeof (IIIMLEXMLConf) * 1);
       conf->filename = strdup(filename);
       conf->priv = (IIIMLEXMLConfPrivate *)malloc(sizeof (IIIMLEXMLConfPrivate) * 1);
       conf->priv->entries = NULL;
       conf->priv->lang_list = NULL;
       conf->priv->hotkeys = NULL;

       return conf;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int iiim_le_xmlconf_prepend_module ( IIIMLEXMLConf *  conf,
const char *  modulename,
const char *  language 
)

Definition at line 889 of file lexmlconf.cpp.

{
       IIIMLEInfo *leinfo, *le;
       struct _LEEntry *ent;
       int stored = 0;

       if (conf == NULL)
              return 0;
       leinfo = iiim_le_info_new(language, modulename);
       if (leinfo == NULL)
              return 0;

       for (ent = conf->priv->entries; ent != NULL; ent = ent->next) {
              if (!strcmp(ent->language, language)) {
                     le = iiim_le_info_list_find(ent->list, leinfo);
                     if (le != NULL) {
                            LOG_DEBUG("Removing old entry of LE (lang:%s, %s)", language, le->lename);
                            ent->list = iiim_le_info_list_remove(ent->list, le);
                     }
                     LOG_DEBUG("Prepending LE (lang:%s, %s)", language, modulename);
                     ent->list = iiim_le_info_list_prepend(ent->list, leinfo);
                     stored = 1;
                     break;
              }
       }
       if (!stored) {
              struct _LEEntry *entry, *tmp;
              IIIMLEInfo *info;

              entry = (struct _LEEntry *)malloc(sizeof (struct _LEEntry) * 1);
              info = iiim_le_info_new(language, modulename);

              LOG_DEBUG("Prepending LE (lang:%s, %s)", language, modulename);
              entry->language = strdup(language);
              entry->list = iiim_le_info_list_new(info);
              entry->next = NULL;
              if (conf->priv->entries != NULL) {
                     for (tmp = conf->priv->entries; tmp->next != NULL; tmp = tmp->next);
                     tmp->next = entry;
              } else {
                     conf->priv->entries = entry;
              }
       }
       conf->priv->lang_list = iiim_le_lang_list_add(conf->priv->lang_list,
                                                language);

       return 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int iiim_le_xmlconf_remove_hotkey ( IIIMLEXMLConf *  conf,
HotKeyStruct *  hotkey,
const char *  language 
)

Definition at line 1064 of file lexmlconf.cpp.

{
       HotKeyList *list;
       struct _HotKeyEntry *ent, *prev;
       int removed = 0;

       if (conf == NULL || hotkey == NULL || language == NULL)
              return 0;

       for (ent = conf->priv->hotkeys, prev = NULL; ent != NULL; prev = ent, ent = prev->next) {
              if (!strcmp(ent->language, language)) {
                     list = iiim_le_hotkey_list_find(ent->list, hotkey);
                     if (list != NULL) {
                            LOG_DEBUG("Removing Hotkey (lang:%s, key:%s, modifiers:%s)", language, hotkey->key, hotkey->modifiers);
                            ent->list = iiim_le_hotkey_list_remove(ent->list, hotkey);
                            if (ent->list == NULL) {
                                   if (prev != NULL) {
                                          prev->next = ent->next;
                                   } else {
                                          conf->priv->hotkeys = NULL;
                                   }
                            }
                            removed = 1;
                            break;
                     } else {
                            break;
                     }
              }
       }

       return removed;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int iiim_le_xmlconf_remove_module ( IIIMLEXMLConf *  conf,
const char *  modulename,
const char *  language 
)

Definition at line 941 of file lexmlconf.cpp.

{
       IIIMLEInfo *leinfo, *le;
       struct _LEEntry *ent, *prev;
       int removed = 0;

       if (conf == NULL || modulename == NULL || language == NULL)
              return 0;

       leinfo = iiim_le_info_new(language, modulename);

       for (ent = conf->priv->entries, prev = NULL; ent != NULL; prev = ent, ent = prev->next) {
              if (!strcmp(ent->language, language)) {
                     le = iiim_le_info_list_find(ent->list, leinfo);
                     if (le != NULL) {
                            LOG_DEBUG("Removing LE (lang:%s, %s)", language, le->lename);
                            ent->list = iiim_le_info_list_remove(ent->list, le);
                            if (ent->list == NULL) {
                                   free(ent->language);
                                   conf->priv->lang_list = iiim_le_lang_list_remove(conf->priv->lang_list,
                                                                              language);
                                   if (prev != NULL) {
                                          prev->next = ent->next;
                                   } else {
                                          conf->priv->entries = NULL;
                                   }
                                   free(ent);
                            }
                            removed = 1;
                            break;
                     } else {
                            break;
                     }
              }
       }

       iiim_le_info_free(leinfo);

       return removed;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int iiim_le_xmlconf_save_file ( IIIMLEXMLConf *  conf)

Definition at line 754 of file lexmlconf.cpp.

{
       xmlDocPtr doc = NULL;
       xmlNodePtr root, les, le, node, key;
       xmlAttrPtr attr;
       int retval = 1;
       struct _LEEntry *ent;

       if (conf == NULL)
              return 0;

       doc = xmlNewDoc((xmlChar *)"1.0");
       doc->encoding = xmlStrdup((xmlChar *)"UTF-8");
       root = xmlNewDocNode(doc, NULL, (xmlChar *)"iiimf", NULL);
       xmlDocSetRootElement(doc, root);
       les = xmlNewTextChild(root, NULL, (xmlChar *)"LanguageEngines", NULL);
       xmlSaveFile(conf->filename, doc);

       if (conf->priv->entries != NULL) {
              for (ent = conf->priv->entries; ent != NULL; ent = ent->next) {
                     IIIMLEInfoList *l;
                     struct _HotKeyEntry *hent;
                     HotKeyList *hlist, *h;

                     le = xmlNewTextChild(les, NULL, (xmlChar *)"LanguageEngine", NULL);
                     attr = xmlNewProp(le, (xmlChar *)"lang", (xmlChar *)ent->language);
                     for (l = ent->list; l != NULL; l = l->next) {
                            IIIMLEInfo *ll = l->data;

                            node = xmlNewTextChild(le, NULL, (xmlChar *)"module", NULL);
                            attr = xmlNewProp(node, (xmlChar *)"path", (xmlChar *)ll->lename);
                     }
                     for (hent = conf->priv->hotkeys; hent != NULL; hent = hent->next) {
                            if (!strcmp(hent->language, ent->language)) {
                                   node = xmlNewTextChild(le, NULL, (xmlChar *)"hotkey", NULL);
                                   hlist = hent->list;
                                   for (h = hlist; h != NULL; h = h->next) {
                                          key = xmlNewTextChild(node, NULL, (xmlChar *)"key", NULL);
                                          if (h->hotkey->modifiers != NULL)
                                                 attr = xmlNewProp(key, (xmlChar *)"modifier", (xmlChar *)h->hotkey->modifiers);
                                          attr = xmlNewProp(key, (xmlChar *)"name", (xmlChar *)h->hotkey->key);
                                   }
                            }
                     }
              }
       } else {
              struct _HotKeyEntry *hent;
              HotKeyList *hlist, *h;

              /* try to store the hotkeys only */
              for (hent = conf->priv->hotkeys; hent != NULL; hent = hent->next) {
                     le = xmlNewTextChild(les, NULL, (xmlChar *)"LanguageEngine", NULL);
                     attr = xmlNewProp(le, (xmlChar *)"lang", (xmlChar *)hent->language);

                     node = xmlNewTextChild(le, NULL, (xmlChar *)"hotkey", NULL);
                     hlist = hent->list;
                     for (h = hlist; h != NULL; h = h->next) {
                            key = xmlNewTextChild(node, NULL, (xmlChar *)"key", NULL);
                            if (h->hotkey->modifiers != NULL)
                                   attr = xmlNewProp(key, (xmlChar *)"modifier", (xmlChar *)h->hotkey->modifiers);
                            attr = xmlNewProp(key, (xmlChar *)"name", (xmlChar *)h->hotkey->key);
                     }
              }
       }
       if (xmlSaveFile(conf->filename, doc) > 0)
              retval = true;

       if (doc != NULL)
              xmlFreeDoc(doc);

       return 1;
}

Here is the caller graph for this function:

void iiim_log_debug_mode ( void  )

Definition at line 545 of file lexmlconf.cpp.

{
       IMLog::get_instance()->set_log_level(IMLog::DEBUGLOG);
       IMLog::get_instance()->set_default_destination(IMLog::IMLOG_STDERR);
}

Here is the caller graph for this function:

void iiim_log_init ( const char *  name)

Definition at line 538 of file lexmlconf.cpp.

{
       if (__imlog == NULL)
              __imlog = IMLog::construct(name);
}

Here is the caller graph for this function: