ecore-wl2: Add API function to get the position of a subsurface
authorChris Michael <cp.michael@samsung.com>
Tue, 6 Oct 2015 14:19:05 +0000 (10:19 -0400)
committerChris Michael <cp.michael@samsung.com>
Thu, 3 Dec 2015 17:02:40 +0000 (12:02 -0500)
Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_wl2/Ecore_Wl2.h
src/lib/ecore_wl2/ecore_wl2_subsurf.c

index ac4f8b6..33f2bc8 100644 (file)
@@ -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 */
index c17566b..ebc7172 100644 (file)
@@ -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;
+}