devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a5739c5ded39ae794804f8ccc69061129617a0e6

commit a5739c5ded39ae794804f8ccc69061129617a0e6
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Wed Sep 9 12:12:53 2015 -0400

    ecore-wl2: Add API function to free a window
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/ecore_wl2/Ecore_Wl2.h        |  9 +++++++++
 src/lib/ecore_wl2/ecore_wl2_window.c | 17 +++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index cf24f37..e059e17 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -274,6 +274,15 @@ EAPI void ecore_wl2_window_show(Ecore_Wl2_Window *window);
  */
 EAPI void ecore_wl2_window_hide(Ecore_Wl2_Window *window);
 
+/**
+ * Free a given Ecore_Wl2_Window
+ *
+ * @param window The Ecore_Wl2_Window to free
+ *
+ * @ingroup Ecore_Wl2_Window_Group
+ */
+EAPI void ecore_wl2_window_free(Ecore_Wl2_Window *window);
+
 /* # ifdef __cplusplus */
 /* } */
 /* # endif */
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c 
b/src/lib/ecore_wl2/ecore_wl2_window.c
index eb2ee8d..7f354f0 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -282,3 +282,20 @@ ecore_wl2_window_hide(Ecore_Wl2_Window *window)
    if (window->surface) wl_surface_destroy(window->surface);
    window->surface = NULL;
 }
+
+EAPI void
+ecore_wl2_window_free(Ecore_Wl2_Window *window)
+{
+   EINA_SAFETY_ON_NULL_RETURN(window);
+
+   /* TODO: reset input pointer and keyboard focus */
+   /* TODO: delete window anim callback */
+   /* TODO: destroy subsurfaces */
+
+   ecore_wl2_window_hide(window);
+
+   if (window->title) eina_stringshare_del(window->title);
+   if (window->class) eina_stringshare_del(window->class);
+
+   free(window);
+}

-- 


Reply via email to