disable a keyrotuer module
[platform/core/uifw/e-mod-tizen-keyrouter.git] / src / e_mod_keyrouter_conf.c
1 #ifndef _F_ENABLE_KEYROUTER_CORE
2
3 #define E_COMP_WL
4 #include "e_mod_main_wl.h"
5
6 void
7 e_keyrouter_conf_init(E_Keyrouter_Config_Data *kconfig)
8 {
9    kconfig->conf_hwkeys_edd= E_CONFIG_DD_NEW("E_Keyrouter_Config_Key",
10                                                E_Keyrouter_Tizen_HWKey);
11 #undef T
12 #undef D
13 #define T E_Keyrouter_Tizen_HWKey
14 #define D kconfig->conf_hwkeys_edd
15    E_CONFIG_VAL(D, T, name, STR);
16    E_CONFIG_VAL(D, T, keycode, INT);
17    E_CONFIG_VAL(D, T, no_privcheck, INT);
18    E_CONFIG_VAL(D, T, repeat, INT);
19
20    kconfig->conf_edd = E_CONFIG_DD_NEW("Keyrouter_Config", E_Keyrouter_Conf_Edd);
21 #undef T
22 #undef D
23 #define T E_Keyrouter_Conf_Edd
24 #define D kconfig->conf_edd
25    E_CONFIG_VAL(D, T, num_keycode, INT);
26    E_CONFIG_VAL(D, T, max_keycode, INT);
27    E_CONFIG_VAL(D, T, pictureoff_disabled, INT);
28    E_CONFIG_LIST(D, T, KeyList, kconfig->conf_hwkeys_edd);
29
30 #undef T
31 #undef D
32    kconfig->conf = e_config_domain_load("module.keyrouter", kconfig->conf_edd);
33
34    if (!kconfig->conf)
35      {
36         KLDBG("Failed to find module.keyrouter config file.");
37      }
38 }
39
40 void
41 e_keyrouter_conf_deinit(E_Keyrouter_Config_Data *kconfig)
42 {
43    E_Keyrouter_Tizen_HWKey *kdata;
44
45    if (kconfig->conf)
46      {
47         EINA_LIST_FREE(kconfig->conf->KeyList, kdata)
48           {
49              eina_stringshare_del(kdata->name);
50              free(kdata);
51           }
52         free(kconfig->conf);
53      }
54
55    E_CONFIG_DD_FREE(kconfig->conf_hwkeys_edd);
56    E_CONFIG_DD_FREE(kconfig->conf_edd);
57 }
58
59 #endif