efl: Use Eina.Size2D for screen size
authorJean-Philippe Andre <jp.andre@samsung.com>
Mon, 18 Sep 2017 12:08:28 +0000 (21:08 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 19 Sep 2017 01:51:48 +0000 (10:51 +0900)
This API isn't so great when considering Wayland...

src/lib/efl/interfaces/efl_screen.eo
src/lib/elementary/efl_ui_win.c

index 75e3552..ee58232 100644 (file)
@@ -6,11 +6,14 @@ interface Efl.Screen
    methods {
       @property screen_size {
          get {
-            [[Get screen geometry details for the screen that a window is on.]]
+            [[Get screen geometry details for the screen that a window is on.
+
+              Note that on some display systems this information is not
+              available (this could be the case Wayland for instance).
+            ]]
          }
          values {
-            w: int; [[Where to return the width value. May be $null.]]
-            h: int; [[Where to return the height value. May be $null.]]
+            size: Eina.Size2D; [[The screen size.]]
          }
       }
       @property screen_rotation {
index a54274e..86b04d4 100644 (file)
@@ -6230,10 +6230,12 @@ _efl_ui_win_screen_constrain_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
    return sd->constrain;
 }
 
-EOLIAN static void
-_efl_ui_win_efl_screen_screen_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int *w, int *h)
+EOLIAN static Eina_Size2D
+_efl_ui_win_efl_screen_screen_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
 {
-   ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, w, h);
+   Eina_Size2D sz;
+   ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &sz.w, &sz.h);
+   return sz;
 }
 
 EOLIAN static void