summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-06-13 12:54:05 -0400
committerChris Michael <cp.michael@samsung.com>2017-06-13 12:57:29 -0400
commit0d5d15755920a9011d41f7d5af19ff4c212c7b19 (patch)
treee284c44ff23e505652655db78fcf37e03f912ab7
parent1d453eece4b9813f0a7a58f548e59be63fa95e7a (diff)
downloadefl-0d5d15755920a9011d41f7d5af19ff4c212c7b19.tar.gz
ecore-evas: Support auxiliary hints for ecore-evas-wayland
Small patch to support using Ecore_Evas_Interface_Wayland in order to add support for setting auxiliary hints on a surface @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_evas/ecore_evas.c89
1 files changed, 70 insertions, 19 deletions
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index b5c9f35020..f375559c98 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -2304,20 +2304,38 @@ ecore_evas_aux_hint_add(Ecore_Evas *ee, const char *hint, const char *val)
aux->hint = eina_stringshare_add(hint);
aux->val = eina_stringshare_add(val);
- ee->prop.aux_hint.hints = eina_list_append(ee->prop.aux_hint.hints, aux);
+ ee->prop.aux_hint.hints =
+ eina_list_append(ee->prop.aux_hint.hints, aux);
- Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee);
- if (buf)
+ if (!strncmp(ee->driver, "wayland", 7))
{
- if (ee->engine.func->fn_aux_hints_set)
- ee->engine.func->fn_aux_hints_set(ee, eina_strbuf_string_get(buf));
+ Ecore_Evas_Interface_Wayland *iface;
- eina_strbuf_free(buf);
+ iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland");
+ EINA_SAFETY_ON_NULL_RETURN_VAL(iface, -1);
+
+ if (iface->aux_hint_add)
+ iface->aux_hint_add(ee, aux->id, hint, val);
ee->prop.aux_hint.id++;
return aux->id;
}
+ else
+ {
+ 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);
+
+ ee->prop.aux_hint.id++;
+
+ return aux->id;
+ }
+ }
eina_stringshare_del(aux->hint);
eina_stringshare_del(aux->val);
@@ -2341,22 +2359,39 @@ ecore_evas_aux_hint_del(Ecore_Evas *ee, const int id)
{
if (id == aux->id)
{
- ee->prop.aux_hint.hints = eina_list_remove(ee->prop.aux_hint.hints, aux);
+ ee->prop.aux_hint.hints =
+ eina_list_remove(ee->prop.aux_hint.hints, aux);
eina_stringshare_del(aux->hint);
eina_stringshare_del(aux->val);
free(aux);
- Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee);
- if (buf)
+ if (!strncmp(ee->driver, "wayland", 7))
{
- if (ee->engine.func->fn_aux_hints_set)
- ee->engine.func->fn_aux_hints_set(ee, eina_strbuf_string_get(buf));
+ Ecore_Evas_Interface_Wayland *iface;
+
+ iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland");
+ EINA_SAFETY_ON_NULL_RETURN_VAL(iface, EINA_FALSE);
- eina_strbuf_free(buf);
+ if (iface->aux_hint_del)
+ iface->aux_hint_del(ee, id);
return EINA_TRUE;
}
+ else
+ {
+ 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;
+ }
+ }
+
break;
}
}
@@ -2377,19 +2412,35 @@ ecore_evas_aux_hint_val_set(Ecore_Evas *ee, const int id, const char *val)
{
eina_stringshare_del(aux->val);
aux->val = eina_stringshare_add(val);
- aux->allowed = 0;
- aux->notified = 0;
+ aux->allowed = 0;
+ aux->notified = 0;
- Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee);
- if (buf)
+ if (!strncmp(ee->driver, "wayland", 7))
{
- if (ee->engine.func->fn_aux_hints_set)
- ee->engine.func->fn_aux_hints_set(ee, eina_strbuf_string_get(buf));
+ Ecore_Evas_Interface_Wayland *iface;
+
+ iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland");
+ EINA_SAFETY_ON_NULL_RETURN_VAL(iface, EINA_FALSE);
- eina_strbuf_free(buf);
+ if (iface->aux_hint_change)
+ iface->aux_hint_change(ee, id, val);
return EINA_TRUE;
}
+ else
+ {
+ 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;
+ }
+ }
+
break;
}
}