devilhorns pushed a commit to branch master.

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

commit 6162914be59354a5113f9b6d81a9c0f51fe8a1c5
Author: Woochanlee <wc0917....@samsung.com>
Date:   Mon Dec 2 08:50:23 2019 -0500

    ecore_wl2: Add APIs to get window properies.
    
    Summary: Creates APIs to get property.
    
    Reviewers: devilhorns
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D10743
---
 src/lib/ecore_wl2/Ecore_Wl2.h        | 44 ++++++++++++++++++++++++++++++++++++
 src/lib/ecore_wl2/ecore_wl2_window.c | 34 ++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+)

diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 6f8f9dcd54..acca6d5f74 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -820,6 +820,13 @@ EAPI int ecore_wl2_window_surface_id_get(Ecore_Wl2_Window 
*window);
  */
 EAPI void ecore_wl2_window_aspect_set(Ecore_Wl2_Window *window, int w, int h, 
unsigned int aspect);
 
+/**
+ * @see evas_object_size_hint_aspect_get
+ * @ingroup Ecore_Wl2_Window_Group
+ * @since 1.24
+ */
+EAPI void ecore_wl2_window_aspect_get(Ecore_Wl2_Window *window, int *w, int 
*h, unsigned int *aspect);
+
 /**
  * Show a given Ecore_Wl2_Window
  *
@@ -1008,6 +1015,18 @@ EAPI void ecore_wl2_window_rotation_set(Ecore_Wl2_Window 
*window, int rotation);
  */
 EAPI void ecore_wl2_window_title_set(Ecore_Wl2_Window *window, const char 
*title);
 
+/**
+ * Get the title of a given window
+ *
+ * @param window The window to set the title of
+ *
+ * @return A string if found, or NULL otherwise
+ *
+ * @ingroup Ecore_Wl2_Window_Group
+ * @since 1.24
+ */
+EAPI const char *ecore_wl2_window_title_get(Ecore_Wl2_Window *window);
+
 /**
  * Set the class of a given window
  *
@@ -1019,6 +1038,19 @@ EAPI void ecore_wl2_window_title_set(Ecore_Wl2_Window 
*window, const char *title
  */
 EAPI void ecore_wl2_window_class_set(Ecore_Wl2_Window *window, const char 
*clas);
 
+
+/**
+ * Get the class of a given window
+ *
+ * @param window The window to set the class of
+ *
+ * @return A string if found, or NULL otherwise
+ *
+ * @ingroup Ecore_Wl2_Window_Group
+ * @since 1.24
+ */
+EAPI const char *ecore_wl2_window_class_get(Ecore_Wl2_Window *window);
+
 /**
  * Get the geometry of a given window
  *
@@ -1337,6 +1369,18 @@ EAPI Eina_Bool 
ecore_wl2_window_focus_skip_get(Ecore_Wl2_Window *window);
  */
 EAPI void ecore_wl2_window_role_set(Ecore_Wl2_Window *window, const char 
*role);
 
+/**
+ * Get the role of a given window
+ *
+ * @param window The window to set the class role
+ *
+ * @return A string if found, or NULL otherwise
+ *
+ * @ingroup Ecore_Wl2_Window_Group
+ * @since 1.24
+ */
+EAPI const char *ecore_wl2_window_role_get(Ecore_Wl2_Window *window);
+
 /**
  * Set if a given window is in floating mode
  *
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c 
b/src/lib/ecore_wl2/ecore_wl2_window.c
index d31dcafeb0..0085354d11 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -1017,6 +1017,14 @@ ecore_wl2_window_title_set(Ecore_Wl2_Window *window, 
const char *title)
    ecore_wl2_display_flush(window->display);
 }
 
+EAPI const char *
+ecore_wl2_window_title_get(Ecore_Wl2_Window *window)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL);
+
+   return window->title ? window->title : NULL;
+}
+
 EAPI void
 ecore_wl2_window_class_set(Ecore_Wl2_Window *window, const char *clas)
 {
@@ -1033,6 +1041,14 @@ ecore_wl2_window_class_set(Ecore_Wl2_Window *window, 
const char *clas)
    ecore_wl2_display_flush(window->display);
 }
 
+EAPI const char *
+ecore_wl2_window_class_get(Ecore_Wl2_Window *window)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL);
+
+   return window->class ? window->class : NULL;
+}
+
 EAPI void
 ecore_wl2_window_geometry_get(Ecore_Wl2_Window *window, int *x, int *y, int 
*w, int *h)
 {
@@ -1367,6 +1383,14 @@ ecore_wl2_window_role_set(Ecore_Wl2_Window *window, 
const char *role)
    eina_stringshare_replace(&window->role, role);
 }
 
+EAPI const char *
+ecore_wl2_window_role_get(Ecore_Wl2_Window *window)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL);
+
+   return window->role ? window->role : NULL;
+}
+
 EAPI void
 ecore_wl2_window_floating_mode_set(Ecore_Wl2_Window *window, Eina_Bool 
floating)
 {
@@ -1403,6 +1427,16 @@ ecore_wl2_window_aspect_set(Ecore_Wl2_Window *window, 
int w, int h, unsigned int
    ecore_wl2_display_flush(window->display);
 }
 
+EAPI void
+ecore_wl2_window_aspect_get(Ecore_Wl2_Window *window, int *w, int *h, unsigned 
int *aspect)
+{
+   EINA_SAFETY_ON_NULL_RETURN(window);
+
+   if (w) *w = window->aspect.w;
+   if (h) *h = window->aspect.h;
+   if (aspect) *aspect = window->aspect.aspect;
+}
+
 EAPI void
 ecore_wl2_window_weight_set(Ecore_Wl2_Window *window, double w, double h)
 {

-- 


Reply via email to