summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-11-01 13:01:45 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-11-01 13:02:26 -0400
commit054b72912ba51abd9bdce347a1b6e2eddee4cbc4 (patch)
tree4f9ad4c6d01cc37b71b2de4ddddb9d1a4915fda4
parent1a2d94810a63174d5d9201ae5116a360fe3ef033 (diff)
add parsing for X-Gadget-Orientations in sandboxed gadgets
specify all supported orientations with semicolons for separators
-rw-r--r--src/runner.c25
1 files changed, 25 insertions, 0 deletions
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
701 if (*id > 0) ci = _conf_item_get(id); 701 if (*id > 0) ci = _conf_item_get(id);
702 if ((*id < 0) || (ci && ci->inst)) 702 if ((*id < 0) || (ci && ci->inst))
703 { 703 {
704 if (ed->x)
705 {
706 const char *orients = eina_hash_find(ed->x, "X-Gadget-Orientations");
707
708 if (orients)
709 {
710 const char *ostring[] =
711 {
712 "None",
713 "Horizontal",
714 "Vertical",
715 };
716 char *v, *val = strdup(orients);
717 Eina_Bool found = EINA_FALSE;
718
719 for (v = strtok(val, ";"); v; v = strtok(NULL, ";"))
720 if (!strcmp(v, ostring[orient]))
721 {
722 found = EINA_TRUE;
723 break;
724 }
725 free(val);
726 if (!found) return NULL;
727 }
728 }
704 if (ed->icon) 729 if (ed->icon)
705 { 730 {
706 int w, h; 731 int w, h;