From 25505626ad221cbf7acd07a6771c2bd7efa98a39 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Tue, 6 Oct 2015 10:19:05 -0400 Subject: [PATCH] ecore-wl2: Add API function to get the position of a subsurface Signed-off-by: Chris Michael --- src/lib/ecore_wl2/Ecore_Wl2.h | 12 ++++++++++++ src/lib/ecore_wl2/ecore_wl2_subsurf.c | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index ac4f8b6113..33f2bc846f 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 c17566bfda..ebc7172977 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; +}