summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-10-16 15:41:26 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-10-25 10:44:16 -0400
commitfd00e3de1a6c59d935726166031b7a4a017d6017 (patch)
tree525337a4a1adf3865e2c44e883b79414c39f0045 /src/lib/elementary
parentffac7fc539f644439b35f7f360b8cad3578ecfc3 (diff)
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
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/elm_config.c34
-rw-r--r--src/lib/elementary/elm_config.h40
-rw-r--r--src/lib/elementary/elm_priv.h2
3 files changed, 76 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index a79899c610..2227e3be37 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -506,6 +506,8 @@ _desc_init(void)
506 ELM_CONFIG_VAL(D, T, spinner_min_max_filter_enable, T_UCHAR); 506 ELM_CONFIG_VAL(D, T, spinner_min_max_filter_enable, T_UCHAR);
507 ELM_CONFIG_VAL(D, T, icon_theme, T_STRING); 507 ELM_CONFIG_VAL(D, T, icon_theme, T_STRING);
508 ELM_CONFIG_VAL(D, T, entry_select_allow, T_UCHAR); 508 ELM_CONFIG_VAL(D, T, entry_select_allow, T_UCHAR);
509 ELM_CONFIG_VAL(D, T, offline, T_UCHAR);
510 ELM_CONFIG_VAL(D, T, powersave, T_INT);
509#undef T 511#undef T
510#undef D 512#undef D
511#undef T_INT 513#undef T_INT
@@ -4590,6 +4592,34 @@ elm_config_web_backend_get(void)
4590 return _elm_config->web_backend; 4592 return _elm_config->web_backend;
4591} 4593}
4592 4594
4595EAPI Eina_Bool
4596elm_config_offline_get(void)
4597{
4598 if (!_elm_config) return EINA_FALSE;
4599 return _elm_config->offline;
4600}
4601
4602EAPI void
4603elm_config_offline_set(Eina_Bool set)
4604{
4605 if (!_elm_config) return;
4606 _elm_config->offline = !!set;
4607}
4608
4609EAPI int
4610elm_config_powersave_get(void)
4611{
4612 if (!_elm_config) return EINA_FALSE;
4613 return _elm_config->powersave;
4614}
4615
4616EAPI void
4617elm_config_powersave_set(int set)
4618{
4619 if (!_elm_config) return;
4620 _elm_config->powersave = set;
4621}
4622
4593void 4623void
4594_elm_config_profile_set(const char *profile) 4624_elm_config_profile_set(const char *profile)
4595{ 4625{
@@ -4891,6 +4921,8 @@ _efl_config_global_efl_config_config_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNU
4891 CONFIG_SETB(atspi_mode); 4921 CONFIG_SETB(atspi_mode);
4892 CONFIG_SETD(transition_duration_factor); 4922 CONFIG_SETD(transition_duration_factor);
4893 CONFIG_SETS(web_backend); 4923 CONFIG_SETS(web_backend);
4924 CONFIG_SETB(offline);
4925 CONFIG_SETI(powersave);
4894 4926
4895 const size_t len = sizeof("audio_mute") - 1; 4927 const size_t len = sizeof("audio_mute") - 1;
4896 if (!strncmp(name, "audio_mute", len)) 4928 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
5023 CONFIG_GETB(atspi_mode); 5055 CONFIG_GETB(atspi_mode);
5024 CONFIG_GETD(transition_duration_factor); 5056 CONFIG_GETD(transition_duration_factor);
5025 CONFIG_GETS(web_backend); 5057 CONFIG_GETS(web_backend);
5058 CONFIG_GETB(offline);
5059 CONFIG_GETI(powersave);
5026 5060
5027 const size_t len = sizeof("audio_mute") - 1; 5061 const size_t len = sizeof("audio_mute") - 1;
5028 if (!strncmp(name, "audio_mute", len)) 5062 if (!strncmp(name, "audio_mute", len))
diff --git a/src/lib/elementary/elm_config.h b/src/lib/elementary/elm_config.h
index 272fdf6957..0e38471bde 100644
--- a/src/lib/elementary/elm_config.h
+++ b/src/lib/elementary/elm_config.h
@@ -2140,6 +2140,46 @@ EAPI void elm_config_web_backend_set(const char *backend);
2140 */ 2140 */
2141EAPI const char *elm_config_web_backend_get(void); 2141EAPI const char *elm_config_web_backend_get(void);
2142 2142
2143/**
2144 * Get whether the system is offline
2145 *
2146 * @return True only if the system config is set as offline
2147 *
2148 * @since 1.21
2149 * @see elm_config_offline_set()
2150 */
2151EAPI Eina_Bool elm_config_offline_get(void);
2152
2153/**
2154 * Set whether the system is offline
2155 *
2156 * @param set True only if the system is offline
2157 *
2158 * @since 1.21
2159 * @see elm_config_offline_get()
2160 */
2161EAPI void elm_config_offline_set(Eina_Bool set);
2162
2163/**
2164 * Get whether the system should be conserving power
2165 *
2166 * @return Values greater than 0 if power is being conserved; higher numbers indicate greater conservation
2167 *
2168 * @since 1.21
2169 * @see elm_config_powersave_set()
2170 */
2171EAPI int elm_config_powersave_get(void);
2172
2173/**
2174 * Set whether the system should be conserving power
2175 *
2176 * @param set Values greater than 0 if power is being conserved; higher numbers indicate greater conservation
2177 *
2178 * @since 1.21
2179 * @see elm_config_powersave_set()
2180 */
2181EAPI void elm_config_powersave_set(int set);
2182
2143 2183
2144/* new efl.config interface helpers in C */ 2184/* new efl.config interface helpers in C */
2145 2185
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index c07617b1f0..6097f0e0e1 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -449,6 +449,8 @@ struct _Elm_Config
449 int gl_msaa; 449 int gl_msaa;
450 const char *icon_theme; 450 const char *icon_theme;
451 unsigned char entry_select_allow; 451 unsigned char entry_select_allow;
452 Eina_Bool offline;
453 int powersave;
452 454
453 /* Not part of the EET file */ 455 /* Not part of the EET file */
454 Eina_Bool is_mirrored : 1; 456 Eina_Bool is_mirrored : 1;