From: Chris Michael Date: Tue, 6 Oct 2015 14:19:05 +0000 (-0400) Subject: ecore-wl2: Add API function to get the position of a subsurface X-Git-Tag: upstream/1.20.0~8008^2~83 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25505626ad221cbf7acd07a6771c2bd7efa98a39;p=platform%2Fupstream%2Fefl.git ecore-wl2: Add API function to get the position of a subsurface Signed-off-by: Chris Michael --- diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index ac4f8b6..33f2bc8 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -623,6 +623,18 @@ EAPI struct wl_surface *ecore_wl2_subsurface_surface_get(Ecore_Wl2_Subsurface *s */ EAPI void ecore_wl2_subsurface_position_set(Ecore_Wl2_Subsurface *subsurface, int x, int y); +/** + * Get the position of this subsurface, relative to its parent surface. + * Coordinates will be returned in x and y if non-NULL. + * + * @param subsurface the subsurface + * @param x coordinate in the parent surface, or NULL to ignore + * @param y coordinate in the parent surface, or NULL to ignore + * + * @ingroup Ecore_Wl2_Subsurface_Group + */ +EAPI void ecore_wl2_subsurface_position_get(Ecore_Wl2_Subsurface *subsurface, int *x, int *y); + /* # ifdef __cplusplus */ /* } */ /* # endif */ diff --git a/src/lib/ecore_wl2/ecore_wl2_subsurf.c b/src/lib/ecore_wl2/ecore_wl2_subsurf.c index c17566b..ebc7172 100644 --- a/src/lib/ecore_wl2/ecore_wl2_subsurf.c +++ b/src/lib/ecore_wl2/ecore_wl2_subsurf.c @@ -99,3 +99,12 @@ ecore_wl2_subsurface_position_set(Ecore_Wl2_Subsurface *subsurface, int x, int y wl_subsurface_set_position(subsurface->wl.subsurface, x, y); } + +EAPI void +ecore_wl2_subsurface_position_get(Ecore_Wl2_Subsurface *subsurface, int *x, int *y) +{ + EINA_SAFETY_ON_NULL_RETURN(subsurface); + + if (x) *x = subsurface->x; + if (y) *y = subsurface->y; +}