2 #include "e_devicemgr_privates.h"
\r
3 #include "e_mod_config.h"
\r
4 #include "scrnconf_devicemgr.h"
\r
6 /* local variables */
\r
7 static E_Config_DD *_devicemgr_conf_edd = NULL;
\r
8 static E_Config_DD *_devicemgr_conf_rotation_edd = NULL;
\r
10 static void _e_mod_devicemgr_config_free(void);
\r
11 static void _e_mod_devicemgr_config_new(void);
\r
13 /* external variables */
\r
14 E_Devicemgr_Config *_e_devicemgr_cfg = NULL;
\r
17 e_mod_devicemgr_config_init(void)
\r
19 /* create config structure for module */
\r
20 _devicemgr_conf_edd = E_CONFIG_DD_NEW("Devicemgr_Config", E_Devicemgr_Config);
\r
22 _devicemgr_conf_rotation_edd = E_CONFIG_DD_NEW("E_Devicemgr_Config_Rotation",
\r
23 E_Devicemgr_Config_Rotation);
\r
26 #define T E_Devicemgr_Config_Rotation
\r
27 #define D _devicemgr_conf_rotation_edd
\r
28 E_CONFIG_VAL(D, T, enable, UCHAR);
\r
29 E_CONFIG_VAL(D, T, angle, INT);
\r
33 #define T E_Devicemgr_Config
\r
34 #define D _devicemgr_conf_edd
\r
35 E_CONFIG_VAL(D, T, ScrnConf.enable, UCHAR);
\r
36 E_CONFIG_VAL(D, T, ScrnConf.default_dispmode, INT);
\r
37 E_CONFIG_VAL(D, T, ScrnConf.isPopUpEnabled, UCHAR);
\r
38 E_CONFIG_LIST(D, T, rotation, _devicemgr_conf_rotation_edd);
\r
40 /* attempt to load existing configuration */
\r
41 _e_devicemgr_cfg = e_config_domain_load(E_DEVICEMGR_CFG, _devicemgr_conf_edd);
\r
43 /* create new config if we need to */
\r
44 if (!_e_devicemgr_cfg)
\r
46 _e_mod_devicemgr_config_new();
\r
47 e_mod_devicemgr_config_save();
\r
48 SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][config] Config file for e_devicemgr was made/stored !\n");
\r
52 SLOG(LOG_DEBUG, "DEVICEMGR", "[e_devicemgr][config] Config file for e_devicemgr was loaded successfully !\n");
\r
59 e_mod_devicemgr_config_shutdown(void)
\r
61 /* free config structure */
\r
62 _e_mod_devicemgr_config_free();
\r
64 /* free data descriptors */
\r
65 E_CONFIG_DD_FREE(_devicemgr_conf_edd);
\r
71 e_mod_devicemgr_config_save(void)
\r
73 return e_config_domain_save(E_DEVICEMGR_CFG, _devicemgr_conf_edd, _e_devicemgr_cfg);
\r
76 /* local functions */
\r
78 _e_mod_devicemgr_config_free(void)
\r
80 /* check for config */
\r
81 if (!_e_devicemgr_cfg) return;
\r
83 /* free config structure */
\r
84 E_CONFIG_DD_FREE(_devicemgr_conf_rotation_edd);
\r
85 E_FREE(_e_devicemgr_cfg);
\r
89 _e_mod_devicemgr_config_new(void)
\r
91 /* create initial config */
\r
92 _e_devicemgr_cfg = E_NEW(E_Devicemgr_Config, 1);
\r
93 _e_devicemgr_cfg->ScrnConf.enable = EINA_TRUE;
\r
94 _e_devicemgr_cfg->ScrnConf.default_dispmode = UTILX_SCRNCONF_DISPMODE_CLONE;
\r
95 _e_devicemgr_cfg->ScrnConf.isPopUpEnabled = EINA_FALSE;
\r