forked from enlightenment/efl
ecore-evas: Added support for setting/getting window auxiliary hints
Summary: There are no APIs for getting window auxiliary hint value which was set by a user. Below APIs can get the window auxiliary hint value. - ecore_evas_aux_hint_val_get - ecore_evas_aux_hint_string_val_get And below API can set the window auxiliary hint value by using string not id. - ecore_evas_aux_hint_string_val_set Test Plan: N/A Reviewers: raster, cedric, seoz, Hermet Reviewed By: Hermet Subscribers: c, cedric Differential Revision: https://phab.enlightenment.org/D2493
This commit is contained in:
parent
8b8c78b638
commit
365e390a37
|
@ -835,6 +835,41 @@ EAPI Eina_Bool ecore_evas_aux_hint_del(Ecore_Evas *ee, const int id);
|
|||
* @since 1.10.0
|
||||
*/
|
||||
EAPI Eina_Bool ecore_evas_aux_hint_val_set(Ecore_Evas *ee, const int id, const char *val);
|
||||
/**
|
||||
* @brief Get a value of the auxiliary hint.
|
||||
*
|
||||
* @param ee The Ecore_Evas
|
||||
* @param id The auxiliary hint ID.
|
||||
* @return The string value of the auxiliary hint ID, or NULL if none exists
|
||||
* @warning Support for this depends on the underlying windowing system.
|
||||
*
|
||||
* @since 1.15
|
||||
*/
|
||||
EAPI const char *ecore_evas_aux_hint_val_get(const Ecore_Evas *ee, const int id);
|
||||
/**
|
||||
* @brief Change a value of the auxiliary hint by using hit string.
|
||||
*
|
||||
* @param ee The Ecore_Evas to set
|
||||
* @param hint The auxiliary hint string.
|
||||
* @param val The value string to be set.
|
||||
* @return @c EINA_TRUE if no error occurred, @c EINA_FALSE otherwise.
|
||||
* @warning Support for this depends on the underlying windowing system.
|
||||
*
|
||||
* @since 1.15
|
||||
*/
|
||||
EAPI Eina_Bool ecore_evas_aux_hint_string_val_set(Ecore_Evas *ee, const char *hint, const char *val);
|
||||
/**
|
||||
* @brief Get a value of the auxiliary hint by using hit string.
|
||||
*
|
||||
* @param ee The Ecore_Evas
|
||||
* @param hint The auxiliary hint string.
|
||||
* @return The string value of the auxiliary hint string, or NULL if none exists
|
||||
* @warning Support for this depends on the underlying windowing system.
|
||||
*
|
||||
* @since 1.15
|
||||
*/
|
||||
EAPI const char *ecore_evas_aux_hint_string_val_get(const Ecore_Evas *ee, const char *hint);
|
||||
|
||||
/**
|
||||
* @brief Send message to parent ecore
|
||||
*
|
||||
|
|
|
@ -2324,6 +2324,83 @@ ecore_evas_aux_hint_val_set(Ecore_Evas *ee, const int id, const char *val)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
ecore_evas_aux_hint_val_get(const Ecore_Evas *ee, const int id)
|
||||
{
|
||||
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
|
||||
{
|
||||
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
|
||||
"ecore_evas_aux_hint_val_get");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Eina_List *ll;
|
||||
Ecore_Evas_Aux_Hint *aux;
|
||||
EINA_LIST_FOREACH(ee->prop.aux_hint.hints, ll, aux)
|
||||
{
|
||||
if (id == aux->id) return aux->val;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
ecore_evas_aux_hint_string_val_set(Ecore_Evas *ee, const char *hint, const char *val)
|
||||
{
|
||||
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
|
||||
{
|
||||
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
|
||||
"ecore_evas_aux_hint_string_val_set");
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
Eina_List *ll;
|
||||
Ecore_Evas_Aux_Hint *aux;
|
||||
EINA_LIST_FOREACH(ee->prop.aux_hint.hints, ll, aux)
|
||||
{
|
||||
if (!strcmp(hint,aux->hint))
|
||||
{
|
||||
eina_stringshare_del(aux->val);
|
||||
aux->val = eina_stringshare_add(val);
|
||||
aux->allowed = 0;
|
||||
aux->notified = 0;
|
||||
|
||||
Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee);
|
||||
if (buf)
|
||||
{
|
||||
if (ee->engine.func->fn_aux_hints_set)
|
||||
ee->engine.func->fn_aux_hints_set(ee, eina_strbuf_string_get(buf));
|
||||
|
||||
eina_strbuf_free(buf);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
ecore_evas_aux_hint_string_val_get(const Ecore_Evas *ee, const char *hint)
|
||||
{
|
||||
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
|
||||
{
|
||||
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
|
||||
"ecore_evas_aux_hint_string_val_get");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Eina_List *ll;
|
||||
Ecore_Evas_Aux_Hint *aux;
|
||||
EINA_LIST_FOREACH(ee->prop.aux_hint.hints, ll, aux)
|
||||
{
|
||||
if (!strcmp(hint,aux->hint)) return aux->val;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue