add parsing for X-Gadget-Orientations in sandboxed gadgets

specify all supported orientations with semicolons for separators
master
Mike Blumenkrantz 5 years ago
parent 1a2d94810a
commit 054b72912b
  1. 25
      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;

Loading…
Cancel
Save