From 1747283bd9cf91056951a500d9c75e97205bad8a Mon Sep 17 00:00:00 2001 From: Wonki Kim Date: Mon, 19 Mar 2018 13:52:15 +0900 Subject: [PATCH] Modify to support ecore_wl2 this patch replaces ecore_wayland by ecore_wl2 for efl 1.20 upgrade. Change-Id: I847cf9dfb9ebc79912e1259f89db4ea5b33bf4f6 Signed-off-by: Wonki Kim --- configure.ac | 2 +- packaging/efl-config.spec | 4 +++- src/efl_config.c | 20 ++++++++++++-------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 3a643bd..eafb272 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,7 @@ LT_INIT AC_PROG_LIBTOOL # Checks for library functions. PKG_CHECK_MODULES([ELEMENTARY],[elementary]) -PKG_CHECK_MODULES([ECOREWAYLAND],[ecore-wayland]) +PKG_CHECK_MODULES([ECOREWAYLAND],[ecore-wl2]) PKG_CHECK_MODULES([CAPISYSTEMINFO],[capi-system-info]) AC_SUBST([DESKTOP]) diff --git a/packaging/efl-config.spec b/packaging/efl-config.spec index 74728f1..0a6790e 100644 --- a/packaging/efl-config.spec +++ b/packaging/efl-config.spec @@ -11,7 +11,7 @@ Source2: %{alias}.manifest BuildRequires: automake BuildRequires: libtool BuildRequires: pkgconfig(elementary) -BuildRequires: pkgconfig(ecore-wayland) +BuildRequires: pkgconfig(ecore-wl2) BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(libsystemd) BuildRequires: pkgconfig(capi-system-info) @@ -24,6 +24,8 @@ EFL config daemon cp %{SOURCE2} . %build +export CFLAGS+=" -DEFL_BETA_API_SUPPORT " + ./autogen.sh TZ_SYS_BIN=%{TZ_SYS_BIN} ./configure --prefix %{_prefix}/ diff --git a/src/efl_config.c b/src/efl_config.c index 579ab93..3230c9a 100644 --- a/src/efl_config.c +++ b/src/efl_config.c @@ -1,5 +1,5 @@ #include -#include +#include #include #include @@ -71,19 +71,23 @@ static inline tizen_profile_t get_tizen_profile() } static void -_scale_set(void) +_scale_set(Evas_Object *win) { Evas_Coord w, h; float inch, scale = 0.0, saved_scale = 0.0, profile_factor = 1.0; int dpi; - ecore_wl_sync(); - dpi = ecore_wl_dpi_get(); + Ecore_Wl2_Window *wlwin = elm_win_wl_window_get(win); + Ecore_Wl2_Output *wlout = ecore_wl2_window_output_find(wlwin); + Ecore_Wl2_Display *wldp = ecore_wl2_window_display_get(wlwin); + + ecore_wl2_sync(); + dpi = ecore_wl2_output_dpi_get(wlout); tizen_profile_t prof = get_tizen_profile(); if (prof == TIZEN_PROFILE_MOBILE || prof == TIZEN_PROFILE_IVI || prof == TIZEN_PROFILE_COMMON) { - ecore_wl_screen_size_get(&w, &h); + ecore_wl2_display_screen_size_get(wldp, &w, &h); inch = floor(sqrt((w * w) + (h * h)) / dpi * 10 + 0.5) / 10; @@ -99,7 +103,7 @@ _scale_set(void) } else /* prof == TIZEN_PROFILE_TV */ { - ecore_wl_screen_size_get(&w, &h); + ecore_wl2_display_screen_size_get(wldp, &w, &h); profile_factor = 2.0; scale = floor((double)w * profile_factor / 1920 * 10 + 0.5) / 10; @@ -322,7 +326,7 @@ int main(int argc, char **argv) EINA_LOG_INFO("efl-config :: START"); - elm_win_add(NULL, "config", ELM_WIN_BASIC); + Evas_Object *win = elm_win_add(NULL, "config", ELM_WIN_BASIC); if (argc > 1) { @@ -339,7 +343,7 @@ int main(int argc, char **argv) else { EINA_LOG_DBG("efl-config :: Launching without option. Call _scale_set()"); - _scale_set(); + _scale_set(win); } if (opt_with_message) -- 2.7.4