ecore-wl2: Add API function to set the position of a subsurface

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-10-06 10:17:25 -04:00
parent 32bb1237c6
commit 0b8d2f1f24
2 changed files with 27 additions and 0 deletions

View File

@ -610,6 +610,19 @@ EAPI void ecore_wl2_subsurface_del(Ecore_Wl2_Subsurface *subsurface);
*/
EAPI struct wl_surface *ecore_wl2_subsurface_surface_get(Ecore_Wl2_Subsurface *subsurface);
/**
* Set the position of this subsurface, relative to its parent surface.
* If subsurface is defined and the x, y coordinates differ from the currently
* tracked position, this also schedules a sub-surface position change.
*
* @param subsurface the subsurface
* @param x coordinate in the parent surface
* @param y coordinate in the parent surface
*
* @ingroup Ecore_Wl2_Subsurface_Group
*/
EAPI void ecore_wl2_subsurface_position_set(Ecore_Wl2_Subsurface *subsurface, int x, int y);
/* # ifdef __cplusplus */
/* } */
/* # endif */

View File

@ -85,3 +85,17 @@ ecore_wl2_subsurface_surface_get(Ecore_Wl2_Subsurface *subsurface)
return subsurface->wl.surface;
}
EAPI void
ecore_wl2_subsurface_position_set(Ecore_Wl2_Subsurface *subsurface, int x, int y)
{
EINA_SAFETY_ON_NULL_RETURN(subsurface);
EINA_SAFETY_ON_NULL_RETURN(subsurface->wl.subsurface);
if ((subsurface->x == x) && (subsurface->y == y)) return;
subsurface->x = x;
subsurface->y = y;
wl_subsurface_set_position(subsurface->wl.subsurface, x, y);
}