diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index 09efe7649d..594e6eb9ce 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -42,6 +42,7 @@ efl_eolian_files = \ lib/efl/interfaces/efl_event.eo \ lib/efl/interfaces/efl_input_interface.eo \ lib/efl/interfaces/efl_input_state.eo \ + lib/efl/interfaces/efl_screen.eo \ $(efl_eolian_legacy_files) \ $(NULL) diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index 7d8d55b8e5..777c874fe8 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -80,6 +80,8 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; #include "interfaces/efl_ui_spin.eo.h" #include "interfaces/efl_ui_progress.eo.h" +#include "interfaces/efl_screen.eo.h" + #define EFL_ORIENT_0 EFL_ORIENT_UP #define EFL_ORIENT_90 EFL_ORIENT_RIGHT #define EFL_ORIENT_180 EFL_ORIENT_DOWN diff --git a/src/lib/efl/Makefile.am b/src/lib/efl/Makefile.am index 4735080ca7..b8c22f35de 100644 --- a/src/lib/efl/Makefile.am +++ b/src/lib/efl/Makefile.am @@ -36,6 +36,7 @@ interfaces/efl_vpath_core.eo \ interfaces/efl_vpath_file_core.eo \ interfaces/efl_ui_spin.eo \ interfaces/efl_ui_progress.eo \ +interfaces/efl_screen.eo \ $(efl_eolian_legacy_files) \ $(NULL) diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c index f82474e9f7..71241bdb8d 100644 --- a/src/lib/efl/interfaces/efl_interfaces_main.c +++ b/src/lib/efl/interfaces/efl_interfaces_main.c @@ -28,6 +28,8 @@ #include "interfaces/efl_vpath.eo.c" +#include "interfaces/efl_screen.eo.c" + EAPI const Eo_Event_Description _EFL_GFX_CHANGED = EO_EVENT_DESCRIPTION("Graphics changed"); diff --git a/src/lib/efl/interfaces/efl_screen.eo b/src/lib/efl/interfaces/efl_screen.eo new file mode 100644 index 0000000000..15092ea32f --- /dev/null +++ b/src/lib/efl/interfaces/efl_screen.eo @@ -0,0 +1,39 @@ +import eina_types; + +interface Efl.Screen { + methods { + @property size { + get { + [[Get screen geometry details for the screen that a window is on.]] + } + values { + w: int; [[Where to return the width value. May be $null.]] + h: int; [[Where to return the height value. May be $null.]] + } + } + @property rotation { + get { + [[Get the rotation of the screen. + + Most engines only return multiples of 90. + @since 1.19 + ]] + } + values { + rotation: int; [[The degree of the screen.]] + } + } + @property dpi { + get { + [[Get screen dpi for the screen that a window is on. + + @since 1.7 + ]] + } + values { + xdpi: int; [[Pointer to value to store return horizontal dpi. May be $null.]] + ydpi: int; [[Pointer to value to store return vertical dpi. May be $null.]] + } + } + } +} diff --git a/src/lib/elementary/elm_win.c b/src/lib/elementary/elm_win.c index 195db54967..f8f689972b 100644 --- a/src/lib/elementary/elm_win.c +++ b/src/lib/elementary/elm_win.c @@ -4929,15 +4929,6 @@ _win_rotate(Evas_Object *obj, Elm_Win_Data *sd, int rotation, Eina_Bool resize) (obj, ELM_WIN_EVENT_ROTATION_CHANGED, NULL); } -EOLIAN static int -_elm_win_screen_rotation_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd) -{ - //TODO: query to wm about device's rotation - (void)sd; - - return 0; -} - EOLIAN static void _elm_win_wm_available_rotations_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const int *rotations, unsigned int count) { @@ -5076,11 +5067,26 @@ _elm_win_screen_constrain_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd) } EOLIAN static void -_elm_win_screen_dpi_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *xdpi, int *ydpi) +_elm_win_efl_screen_size_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *w, int *h) +{ + ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, w, h); +} + +EOLIAN static void +_elm_win_efl_screen_dpi_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, int *xdpi, int *ydpi) { ecore_evas_screen_dpi_get(sd->ee, xdpi, ydpi); } +EOLIAN static int +_elm_win_efl_screen_rotation_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd) +{ + //TODO: query to wm about device's rotation + (void)sd; + + return 0; +} + EOLIAN static void _elm_win_prop_focus_skip_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool skip) { @@ -6221,4 +6227,13 @@ elm_win_screen_position_get(const Evas_Object *obj, int *x, int *y) if (y) *y = sd->screen.y; } +EAPI void +elm_win_efl_screen_dpi_get(const Evas_Object *obj, int *xdpi, int *ydpi) +{ + ELM_WIN_CHECK(obj); + ELM_WIN_DATA_GET_OR_RETURN(obj, sd); + + ecore_evas_screen_dpi_get(sd->ee, xdpi, ydpi); +} + #include "elm_win.eo.c" diff --git a/src/lib/elementary/elm_win.eo b/src/lib/elementary/elm_win.eo index 30ec08d43b..e5dde4f2f2 100644 --- a/src/lib/elementary/elm_win.eo +++ b/src/lib/elementary/elm_win.eo @@ -150,7 +150,7 @@ enum Elm.Illume_Command class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window, Elm.Interface.Atspi_Widget_Action, Efl.Pack, - Efl.Input.State, Efl.Input.Interface) + Efl.Input.State, Efl.Input.Interface, Efl.Screen) { legacy_prefix: elm_win; eo_prefix: elm_obj_win; @@ -230,16 +230,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window, return: bool; } } - @property screen_rotation { - get { - [[Get the rotation of the screen. - - Most engines only return multiples of 90. - @since 1.19 - ]] - return: int; - } - } @property autodel { set { [[Set the window's autodel state. @@ -762,18 +752,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window, legacy: null; } } - @property screen_dpi { - get { - [[Get screen dpi for the screen that a window is on. - - @since 1.7 - ]] - } - values { - xdpi: int; [[Pointer to value to store return horizontal dpi. May be $null.]] - ydpi: int; [[Pointer to value to store return vertical dpi. May be $null.]] - } - } @property inlined_image_object { get { [[Get the inlined image object handle @@ -1025,6 +1003,9 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window, Efl.Pack.pack; Efl.Input.State.modifier_enabled.get; Efl.Input.State.lock_enabled.get; + Efl.Screen.dpi.get; + Efl.Screen.rotation.get; + Efl.Screen.size.get; } constructors { .name; diff --git a/src/lib/elementary/elm_win_legacy.h b/src/lib/elementary/elm_win_legacy.h index ac336a19c3..272430d6e4 100644 --- a/src/lib/elementary/elm_win_legacy.h +++ b/src/lib/elementary/elm_win_legacy.h @@ -697,3 +697,18 @@ EAPI void elm_win_screen_position_get(const Evas_Object *obj, int *x, int *y); * @ingroup Elm_Win */ EAPI void elm_win_screen_size_get(const Evas_Object *obj, int *x, int *y, int *w, int *h); + +/** + * @brief Get screen dpi for the screen that a window is on. + * + * @param[out] xdpi Pointer to value to store return horizontal dpi. May be + * @c null. + * @param[out] ydpi Pointer to value to store return vertical dpi. May be + * @c null. + * + * @since 1.7 + * + * @ingroup Elm_Win + */ +EAPI void elm_win_screen_dpi_get(const Evas_Object *obj, int *xdpi, int *ydpi); +