From 054b72912ba51abd9bdce347a1b6e2eddee4cbc4 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 1 Nov 2017 13:01:45 -0400 Subject: [PATCH] add parsing for X-Gadget-Orientations in sandboxed gadgets specify all supported orientations with semicolons for separators --- src/runner.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/runner.c b/src/runner.c index b7dd411..434cdae 100644 --- a/src/runner.c +++ b/src/runner.c @@ -701,6 +701,31 @@ sandbox_create(Evas_Object *parent, const char *type, int *id, E_Gadget_Site_Ori if (*id > 0) ci = _conf_item_get(id); if ((*id < 0) || (ci && ci->inst)) { + if (ed->x) + { + const char *orients = eina_hash_find(ed->x, "X-Gadget-Orientations"); + + if (orients) + { + const char *ostring[] = + { + "None", + "Horizontal", + "Vertical", + }; + char *v, *val = strdup(orients); + Eina_Bool found = EINA_FALSE; + + for (v = strtok(val, ";"); v; v = strtok(NULL, ";")) + if (!strcmp(v, ostring[orient])) + { + found = EINA_TRUE; + break; + } + free(val); + if (!found) return NULL; + } + } if (ed->icon) { int w, h;