Add new API for finding a zone by its id string

This commit is contained in:
Derek Foreman 2016-06-20 13:42:12 -05:00
parent 36c486906d
commit fc37423c2e
2 changed files with 19 additions and 0 deletions

View File

@ -1704,3 +1704,20 @@ _e_zone_obstacle_free(E_Zone_Obstacle *obs)
}
free(obs);
}
E_API E_Zone *
e_zone_for_id_get(const char *id)
{
Eina_List *l = NULL;
E_Zone *zone;
if (!e_comp) return NULL;
EINA_LIST_FOREACH(e_comp->zones, l, zone)
{
if (strcmp(zone->randr2_id, id) == 0)
return zone;
}
return NULL;
}

View File

@ -166,6 +166,8 @@ E_API void e_zone_fade_handle(E_Zone *zone, int out, double tim);
E_API E_Zone_Obstacle *e_zone_obstacle_add(E_Zone *zone, E_Desk *desk, Eina_Rectangle *geom, Eina_Bool vertical);
E_API void e_zone_obstacle_modify(E_Zone_Obstacle *obs, Eina_Rectangle *geom, Eina_Bool vertical);
E_API E_Zone *e_zone_for_id_get(const char *id);
extern E_API int E_EVENT_ZONE_DESK_COUNT_SET;
extern E_API int E_EVENT_ZONE_MOVE_RESIZE;
extern E_API int E_EVENT_ZONE_ADD;