elm_config: add offline and powersave config members

these will be used by enlightenment in the future to notify applications of
global system states

@feature
This commit is contained in:
Mike Blumenkrantz 2017-10-16 15:41:26 -04:00
parent ffac7fc539
commit fd00e3de1a
3 changed files with 76 additions and 0 deletions

View File

@ -506,6 +506,8 @@ _desc_init(void)
ELM_CONFIG_VAL(D, T, spinner_min_max_filter_enable, T_UCHAR);
ELM_CONFIG_VAL(D, T, icon_theme, T_STRING);
ELM_CONFIG_VAL(D, T, entry_select_allow, T_UCHAR);
ELM_CONFIG_VAL(D, T, offline, T_UCHAR);
ELM_CONFIG_VAL(D, T, powersave, T_INT);
#undef T
#undef D
#undef T_INT
@ -4590,6 +4592,34 @@ elm_config_web_backend_get(void)
return _elm_config->web_backend;
}
EAPI Eina_Bool
elm_config_offline_get(void)
{
if (!_elm_config) return EINA_FALSE;
return _elm_config->offline;
}
EAPI void
elm_config_offline_set(Eina_Bool set)
{
if (!_elm_config) return;
_elm_config->offline = !!set;
}
EAPI int
elm_config_powersave_get(void)
{
if (!_elm_config) return EINA_FALSE;
return _elm_config->powersave;
}
EAPI void
elm_config_powersave_set(int set)
{
if (!_elm_config) return;
_elm_config->powersave = set;
}
void
_elm_config_profile_set(const char *profile)
{
@ -4891,6 +4921,8 @@ _efl_config_global_efl_config_config_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNU
CONFIG_SETB(atspi_mode);
CONFIG_SETD(transition_duration_factor);
CONFIG_SETS(web_backend);
CONFIG_SETB(offline);
CONFIG_SETI(powersave);
const size_t len = sizeof("audio_mute") - 1;
if (!strncmp(name, "audio_mute", len))
@ -5023,6 +5055,8 @@ _efl_config_global_efl_config_config_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNU
CONFIG_GETB(atspi_mode);
CONFIG_GETD(transition_duration_factor);
CONFIG_GETS(web_backend);
CONFIG_GETB(offline);
CONFIG_GETI(powersave);
const size_t len = sizeof("audio_mute") - 1;
if (!strncmp(name, "audio_mute", len))

View File

@ -2140,6 +2140,46 @@ EAPI void elm_config_web_backend_set(const char *backend);
*/
EAPI const char *elm_config_web_backend_get(void);
/**
* Get whether the system is offline
*
* @return True only if the system config is set as offline
*
* @since 1.21
* @see elm_config_offline_set()
*/
EAPI Eina_Bool elm_config_offline_get(void);
/**
* Set whether the system is offline
*
* @param set True only if the system is offline
*
* @since 1.21
* @see elm_config_offline_get()
*/
EAPI void elm_config_offline_set(Eina_Bool set);
/**
* Get whether the system should be conserving power
*
* @return Values greater than 0 if power is being conserved; higher numbers indicate greater conservation
*
* @since 1.21
* @see elm_config_powersave_set()
*/
EAPI int elm_config_powersave_get(void);
/**
* Set whether the system should be conserving power
*
* @param set Values greater than 0 if power is being conserved; higher numbers indicate greater conservation
*
* @since 1.21
* @see elm_config_powersave_set()
*/
EAPI void elm_config_powersave_set(int set);
/* new efl.config interface helpers in C */

View File

@ -449,6 +449,8 @@ struct _Elm_Config
int gl_msaa;
const char *icon_theme;
unsigned char entry_select_allow;
Eina_Bool offline;
int powersave;
/* Not part of the EET file */
Eina_Bool is_mirrored : 1;