efl_screen: create efl_screen interface

elm_win have three feature releated with screen.
1. screen_rotation_get
2. scrren_size_get
3. screen_dpi_get
so create efl_screen interface, and elm_win implement that interface
This commit is contained in:
Ji-Youn Park 2016-06-01 15:17:31 +08:30
parent 3519d8ac31
commit 0e6139e487
8 changed files with 89 additions and 33 deletions

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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");

View File

@ -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.]]
}
}
}
}

View File

@ -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"

View File

@ -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;

View File

@ -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);