devilhorns pushed a commit to branch master.

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

commit 25390920be5a8863870fe790885a2b55f3cc4a02
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Mon Sep 28 11:58:51 2015 -0400

    ecore-wl2: Add API function to retrieve screen size
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/ecore_wl2/Ecore_Wl2.h         |  3 ++-
 src/lib/ecore_wl2/ecore_wl2_display.c | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index c1b8407..30ded28 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -257,9 +257,10 @@ EAPI struct wl_shm 
*ecore_wl2_display_shm_get(Ecore_Wl2_Display *display);
  */
 EAPI Eina_Iterator *ecore_wl2_display_globals_get(Ecore_Wl2_Display *display);
 
-
 EAPI Eina_Bool ecore_wl2_display_animator_source_set(Ecore_Wl2_Display 
*display, Ecore_Animator_Source source);
 
+EAPI void ecore_wl2_display_screen_size_get(Ecore_Wl2_Display *display, int 
*w, int *h);
+
 /**
  * @defgroup Ecore_Wl2_Window_Group Wayland Library Window Functions
  * @ingroup Ecore_Wl2_Group
diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c 
b/src/lib/ecore_wl2/ecore_wl2_display.c
index aef10a2..c7b5a50 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -452,3 +452,36 @@ ecore_wl2_display_animator_source_set(Ecore_Wl2_Display 
*display, Ecore_Animator
 
    return EINA_TRUE;
 }
+
+EAPI void
+ecore_wl2_display_screen_size_get(Ecore_Wl2_Display *display, int *w, int *h)
+{
+   Ecore_Wl2_Output *output;
+   int ow = 0, oh = 0;
+
+   EINA_SAFETY_ON_NULL_RETURN(display);
+
+   if (w) *w = 0;
+   if (h) *h = 0;
+
+   EINA_INLIST_FOREACH(display->outputs, output)
+     {
+        switch (output->transform)
+          {
+           case WL_OUTPUT_TRANSFORM_90:
+           case WL_OUTPUT_TRANSFORM_270:
+           case WL_OUTPUT_TRANSFORM_FLIPPED_90:
+           case WL_OUTPUT_TRANSFORM_FLIPPED_270:
+             ow += output->geometry.h;
+             oh += output->geometry.w;
+             break;
+           default:
+             ow += output->geometry.w;
+             oh += output->geometry.h;
+             break;
+          }
+     }
+
+   if (w) *w = ow;
+   if (h) *h = oh;
+}

-- 


Reply via email to