summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2017-06-02 13:17:26 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2017-06-05 10:01:54 +0900
commitd82ac10ce2075e4ee89ea37594e05cfc4adc3d87 (patch)
tree3d5867e28653d16c14493acc711ce341e77ba135
parent2d7b58b2d4c0888571886446facc7bb78eea5812 (diff)
downloadapp-core-d82ac10ce2075e4ee89ea37594e05cfc4adc3d87.tar.gz
app-core-d82ac10ce2075e4ee89ea37594e05cfc4adc3d87.tar.bz2
app-core-d82ac10ce2075e4ee89ea37594e05cfc4adc3d87.zip
Separate appcore-ui package from appcore-efl package
This patch is for deleting elementary dependency from appcore_ui_base API. - Add appcore_efl_base API (appcore_ui_base wrapper API) - Add appcore_ui_base_get_hint API - Delete elementary dependency from appcore-ui - Add init and finish callback on appcore base Change-Id: Ief47c6b4e7c9c26d955bf8c30c69efec05c5ee99 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--CMakeLists.txt40
-rw-r--r--appcore-common.pc.in2
-rw-r--r--appcore-efl.pc.in4
-rw-r--r--appcore-multiwindow.pc.in2
-rw-r--r--appcore-ui.pc.in14
-rw-r--r--include/appcore_base.h2
-rw-r--r--include/appcore_efl_base.h68
-rw-r--r--include/appcore_ui_base.h1
-rw-r--r--packaging/app-core.spec38
-rw-r--r--src/base/appcore_base.c8
-rw-r--r--src/efl_base/appcore_efl_base.c217
-rw-r--r--src/efl_base/appcore_efl_base_private.h29
-rw-r--r--src/legacy/appcore-efl.c59
-rw-r--r--src/multiwindow_base/appcore_multiwindow_base.c31
-rw-r--r--src/ui_base/appcore_ui_base.c82
15 files changed, 469 insertions, 128 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bc52ac3..c42167d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,14 +51,44 @@ FOREACH(hfile ${HEADERS_common})
ENDFOREACH(hfile)
#################################################################
+# Build appcore-ui Library
+# ------------------------------
+SET(APPCORE_UI "appcore-ui")
+SET(SRCS_ui src/ui_base/appcore_ui_base.c src/ui_base/appcore_ui_plugin.c)
+SET(HEADERS_ui appcore_ui_base.h)
+
+INCLUDE(FindPkgConfig)
+SET(APPCORE_UI_PKG_CHECK_MODULES "dlog ecore gobject-2.0 glib-2.0 aul bundle pkgmgr-info ttrace ecore-wayland tizen-extension-client wayland-client")
+
+pkg_check_modules(pkg_ui REQUIRED ${APPCORE_UI_PKG_CHECK_MODULES})
+
+FOREACH(flag ${pkg_ui_CFLAGS})
+ SET(EXTRA_CFLAGS_ui "${EXTRA_CFLAGS_ui} ${flag}")
+ENDFOREACH(flag)
+
+ADD_LIBRARY(${APPCORE_UI} SHARED ${SRCS_ui})
+SET_TARGET_PROPERTIES(${APPCORE_UI} PROPERTIES SOVERSION ${MAJORVER})
+SET_TARGET_PROPERTIES(${APPCORE_UI} PROPERTIES VERSION ${FULLVER})
+SET_TARGET_PROPERTIES(${APPCORE_UI} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS_ui})
+TARGET_LINK_LIBRARIES(${APPCORE_UI} ${pkg_efl_LDFLAGS} ${APPCORE_COMMON})
+
+CONFIGURE_FILE(${APPCORE_UI}.pc.in ${APPCORE_UI}.pc @ONLY)
+
+INSTALL(TARGETS ${APPCORE_UI} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${APPCORE_UI}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+FOREACH(hfile ${HEADERS_ui})
+ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/${hfile} DESTINATION include/appcore)
+ENDFOREACH(hfile)
+
+#################################################################
# Build appcore-efl Library
# ------------------------------
SET(APPCORE_EFL "appcore-efl")
-SET(SRCS_efl src/legacy/appcore-efl.c src/ui_base/appcore_ui_base.c src/ui_base/appcore_ui_plugin.c)
-SET(HEADERS_efl appcore-efl.h appcore_ui_base.h)
+SET(SRCS_efl src/legacy/appcore-efl.c src/efl_base/appcore_efl_base.c)
+SET(HEADERS_efl appcore-efl.h appcore_efl_base.h)
INCLUDE(FindPkgConfig)
-SET(APPCORE_PKG_CHECK_MODULES2 "elementary dlog ecore gobject-2.0 glib-2.0 aul pkgmgr-info ttrace capi-system-info voice-control-elm")
+SET(APPCORE_PKG_CHECK_MODULES2 "elementary dlog aul bundle voice-control-elm")
pkg_check_modules(pkg_efl REQUIRED ${APPCORE_PKG_CHECK_MODULES2})
@@ -70,7 +100,7 @@ ADD_LIBRARY(${APPCORE_EFL} SHARED ${SRCS_efl})
SET_TARGET_PROPERTIES(${APPCORE_EFL} PROPERTIES SOVERSION ${MAJORVER})
SET_TARGET_PROPERTIES(${APPCORE_EFL} PROPERTIES VERSION ${FULLVER})
SET_TARGET_PROPERTIES(${APPCORE_EFL} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS_efl})
-TARGET_LINK_LIBRARIES(${APPCORE_EFL} ${pkg_efl_LDFLAGS} ${APPCORE_COMMON})
+TARGET_LINK_LIBRARIES(${APPCORE_EFL} ${pkg_efl_LDFLAGS} ${APPCORE_UI})
CONFIGURE_FILE(${APPCORE_EFL}.pc.in ${APPCORE_EFL}.pc @ONLY)
@@ -113,5 +143,3 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${APPCORE_MULTIWINDOW}.pc DESTINATION
FOREACH(hfile ${HEADERS_mw})
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/${hfile} DESTINATION include/appcore)
ENDFOREACH(hfile)
-
-
diff --git a/appcore-common.pc.in b/appcore-common.pc.in
index e701dc0..3c0953c 100644
--- a/appcore-common.pc.in
+++ b/appcore-common.pc.in
@@ -6,7 +6,7 @@ libdir=@LIB_INSTALL_DIR@
includedir=@INCLUDEDIR@
Name: app-core-common
-Description: SAMSUNG Linux platform application library
+Description: Tizen application core library
Version: @VERSION@
Requires.private: sensor vconf aul dlog
Libs: -L${libdir} -lappcore-common
diff --git a/appcore-efl.pc.in b/appcore-efl.pc.in
index eeb592c..046ca63 100644
--- a/appcore-efl.pc.in
+++ b/appcore-efl.pc.in
@@ -6,9 +6,9 @@ libdir=@LIB_INSTALL_DIR@
includedir=@INCLUDEDIR@
Name: app-core-efl
-Description: SAMSUNG Linux platform efl application library
+Description: Tizen application core library for EFL
Version: @VERSION@
Requires.private: elementary dlog
-Requires: appcore-common
+Requires: appcore-common appcore-ui
Libs: -L${libdir} -lappcore-efl
Cflags: -I${includedir} -I${includedir}/appcore
diff --git a/appcore-multiwindow.pc.in b/appcore-multiwindow.pc.in
index db0e6e9..c5502cc 100644
--- a/appcore-multiwindow.pc.in
+++ b/appcore-multiwindow.pc.in
@@ -6,7 +6,7 @@ libdir=@LIB_INSTALL_DIR@
includedir=@INCLUDEDIR@
Name: app-core-multiwindow
-Description: application core library for multiwindow
+Description: Tizen application core library for multiwindow
Version: @VERSION@
Requires.private: elementary dlog
Requires: appcore-common
diff --git a/appcore-ui.pc.in b/appcore-ui.pc.in
new file mode 100644
index 0000000..3346af5
--- /dev/null
+++ b/appcore-ui.pc.in
@@ -0,0 +1,14 @@
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=@EXEC_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDEDIR@
+
+Name: app-core-ui
+Description: Tizen application core library for UI
+Version: @VERSION@
+Requires.private: dlog
+Requires: appcore-common
+Libs: -L${libdir} -lappcore-ui
+Cflags: -I${includedir} -I${includedir}/appcore
diff --git a/include/appcore_base.h b/include/appcore_base.h
index 6122119..a3a53ea 100644
--- a/include/appcore_base.h
+++ b/include/appcore_base.h
@@ -60,6 +60,8 @@ typedef struct _appcore_base_ops {
int (*control) (bundle *b, void *data);
int (*receive)(aul_type type, bundle *b, void *data);
int (*set_i18n)(void *data);
+ int (*init)(int argc, char **argv, void *data);
+ void (*finish)(void);
void (*run)(void *data);
void (*exit)(void *data);
void (*set_event)(enum appcore_base_event event, void *data);
diff --git a/include/appcore_efl_base.h b/include/appcore_efl_base.h
new file mode 100644
index 0000000..ac86a72
--- /dev/null
+++ b/include/appcore_efl_base.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <libintl.h>
+#include <aul.h>
+#include <bundle.h>
+#include <appcore_ui_base.h>
+
+typedef struct _appcore_efl_base_ops {
+ appcore_ui_base_ops ui_base;
+} appcore_efl_base_ops;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum appcore_efl_base_hint {
+ APPCORE_EFL_BASE_HINT_WINDOW_GROUP_CONTROL = APPCORE_UI_BASE_HINT_WINDOW_GROUP_CONTROL,
+ APPCORE_EFL_BASE_HINT_WINDOW_STACK_CONTROL = APPCORE_UI_BASE_HINT_WINDOW_STACK_CONTROL,
+ APPCORE_EFL_BASE_HINT_BG_LAUNCH_CONTROL = APPCORE_UI_BASE_HINT_BG_LAUNCH_CONTROL,
+ APPCORE_EFL_BASE_HINT_HW_ACC_CONTROL = APPCORE_UI_BASE_HINT_HW_ACC_CONTROL,
+ APPCORE_EFL_BASE_HINT_WINDOW_AUTO_CONTROL = APPCORE_UI_BASE_HINT_WINDOW_AUTO_CONTROL,
+};
+
+int appcore_efl_base_on_receive(aul_type type, bundle *b);
+int appcore_efl_base_on_create(void);
+int appcore_efl_base_on_terminate(void);
+int appcore_efl_base_on_pause(void);
+int appcore_efl_base_on_resume(void);
+int appcore_efl_base_on_control(bundle *b);
+void appcore_efl_base_window_on_show(int type, void *event);
+void appcore_efl_base_window_on_hide(int type, void *event);
+void appcore_efl_base_window_on_lower(int type, void *event);
+void appcore_efl_base_window_on_visibility(int type, void *event);
+int appcore_efl_base_init(appcore_efl_base_ops ops, int argc, char **argv,
+ void *data, unsigned int hint);
+void appcore_efl_base_fini(void);
+appcore_efl_base_ops appcore_efl_base_get_default_ops(void);
+void appcore_efl_base_pause(void);
+void appcore_efl_base_resume(void);
+bool appcore_efl_base_is_resumed(void);
+void appcore_efl_base_exit(void);
+void appcore_efl_base_group_add();
+void appcore_efl_base_group_remove();
+unsigned int appcore_efl_base_get_main_window(void);
+unsigned int appcore_efl_base_get_main_surface(void);
+int appcore_efl_base_get_hint(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+
diff --git a/include/appcore_ui_base.h b/include/appcore_ui_base.h
index a92b430..3ce7867 100644
--- a/include/appcore_ui_base.h
+++ b/include/appcore_ui_base.h
@@ -69,6 +69,7 @@ void appcore_ui_base_group_add();
void appcore_ui_base_group_remove();
unsigned int appcore_ui_base_get_main_window(void);
unsigned int appcore_ui_base_get_main_surface(void);
+int appcore_ui_base_get_hint(void);
#ifdef __cplusplus
}
diff --git a/packaging/app-core.spec b/packaging/app-core.spec
index eb36ddc..87c9b13 100644
--- a/packaging/app-core.spec
+++ b/packaging/app-core.spec
@@ -14,7 +14,7 @@ BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(sensor)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(aul)
-BuildRequires: pkgconfig(rua)
+BuildRequires: pkgconfig(bundle)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(ecore)
@@ -44,7 +44,7 @@ Application basic EFL
Summary: App basic EFL (devel)
Group: Development/Libraries
Requires: %{name}-efl = %{version}-%{release}
-Requires: %{name}-common-devel = %{version}-%{release}
+Requires: %{name}-ui-devel = %{version}-%{release}
%description efl-devel
Application basic EFL (devel)
@@ -89,6 +89,24 @@ Requires: pkgconfig(aul)
%description common-devel
Application basics common (devel)
+%package ui
+Summary: App basic UI
+Group: Development/Libraries
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description ui
+Application basic UI
+
+%package ui-devel
+Summary: App basic UI (devel)
+Group: Development/Libraries
+Requires: %{name}-ui = %{version}-%{release}
+Requires: %{name}-common-devel = %{version}-%{release}
+
+%description ui-devel
+Application basic EFL (devel)
+
%package template
Summary: App basics template
@@ -128,6 +146,10 @@ rm -rf %{buildroot}
%postun -n app-core-common -p /sbin/ldconfig
+%post -n app-core-ui -p /sbin/ldconfig
+
+%postun -n app-core-ui -p /sbin/ldconfig
+
%files efl
%manifest %{name}.manifest
@@ -137,7 +159,7 @@ rm -rf %{buildroot}
%files efl-devel
%manifest %{name}.manifest
%{_includedir}/appcore/appcore-efl.h
-%{_includedir}/appcore/appcore_ui_base.h
+%{_includedir}/appcore/appcore_efl_base.h
%{_libdir}/libappcore-efl.so
%{_libdir}/pkgconfig/appcore-efl.pc
@@ -164,3 +186,13 @@ rm -rf %{buildroot}
%{_includedir}/appcore/appcore-common.h
%{_includedir}/appcore/appcore_base.h
+%files ui
+%manifest %{name}.manifest
+%{_libdir}/libappcore-ui.so.*
+%license LICENSE
+
+%files ui-devel
+%manifest %{name}.manifest
+%{_includedir}/appcore/appcore_ui_base.h
+%{_libdir}/libappcore-ui.so
+%{_libdir}/pkgconfig/appcore-ui.pc
diff --git a/src/base/appcore_base.c b/src/base/appcore_base.c
index 00ab25e..e4208e7 100644
--- a/src/base/appcore_base.c
+++ b/src/base/appcore_base.c
@@ -868,6 +868,9 @@ EXPORT_API int appcore_base_init(appcore_base_ops ops, int argc, char **argv, vo
__context.suspended_state = false;
__context.allowed_bg = false;
+ if (__context.ops.init)
+ __context.ops.init(argc, argv, data);
+
if (__context.ops.set_i18n)
__context.ops.set_i18n(__context.data);
@@ -928,6 +931,9 @@ EXPORT_API void appcore_base_fini(void)
}
__context.dirty = false;
+
+ if (__context.ops.finish)
+ __context.ops.finish();
}
EXPORT_API int appcore_base_flush_memory(void)
@@ -1238,6 +1244,8 @@ EXPORT_API appcore_base_ops appcore_base_get_default_ops(void)
ops.terminate = __on_terminate;
ops.receive = __on_receive;
ops.set_i18n = __on_set_i18n;
+ ops.init = NULL;
+ ops.finish = NULL;
ops.run = NULL;
ops.exit = NULL;
ops.set_event = __on_set_event;
diff --git a/src/efl_base/appcore_efl_base.c b/src/efl_base/appcore_efl_base.c
new file mode 100644
index 0000000..387f69c
--- /dev/null
+++ b/src/efl_base/appcore_efl_base.c
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <Elementary.h>
+#include <voice_control_elm.h>
+#include <voice_control_elm_private.h>
+
+#include "appcore_efl_base_private.h"
+#include "appcore_efl_base.h"
+
+static int __efl_app_init(int argc, char **argv, void *data)
+{
+ int r;
+ int hint;
+ int is_vc_vt_automode = 0;
+ const char *hwacc;
+
+ elm_init(argc, argv);
+
+ r = vc_elm_is_supported_vt_auto(&is_vc_vt_automode);
+ if (r != 0) {
+ _ERR("[VC] Failed to get vconfkey of vt_automode");
+ } else {
+ if (is_vc_vt_automode) {
+ vc_elm_initialize();
+ vc_elm_set_auto_register_mode(2, 0);
+ }
+ }
+
+ hint = appcore_efl_base_get_hint();
+ if (hint & APPCORE_EFL_BASE_HINT_HW_ACC_CONTROL) {
+ hwacc = getenv("HWACC");
+ if (hwacc == NULL) {
+ _DBG("elm_config_accel_preference_set is not called");
+ } else if (strcmp(hwacc, "USE") == 0) {
+ elm_config_accel_preference_set("hw");
+ _DBG("elm_config_accel_preference_set : hw");
+ } else if (strcmp(hwacc, "NOT_USE") == 0) {
+ elm_config_accel_preference_set("none");
+ _DBG("elm_config_accel_preference_set : none");
+ } else {
+ _DBG("elm_config_accel_preference_set is not called");
+ }
+ }
+
+ return 0;
+}
+
+static void __efl_app_finish(void)
+{
+ int r;
+ int is_vc_vt_automode = 0;
+
+ r = vc_elm_is_supported_vt_auto(&is_vc_vt_automode);
+ if (r != 0) {
+ _ERR("[VC] Failed to get vconfkey of vt_automode");
+ } else {
+ if (is_vc_vt_automode)
+ vc_elm_deinitialize();
+ }
+
+ elm_shutdown();
+
+ /* Check loader case */
+ if (getenv("AUL_LOADER_INIT")) {
+ unsetenv("AUL_LOADER_INIT");
+ elm_shutdown();
+ }
+}
+
+static void __efl_app_run(void *data)
+{
+ elm_run();
+}
+
+static void __efl_app_exit(void *data)
+{
+ elm_exit();
+}
+
+EXPORT_API int appcore_efl_base_init(appcore_efl_base_ops ops, int argc,
+ char **argv, void *data, unsigned int hint)
+{
+ return appcore_ui_base_init(ops.ui_base, argc, argv, data, hint);
+}
+
+EXPORT_API void appcore_efl_base_fini(void)
+{
+ appcore_ui_base_fini();
+}
+
+EXPORT_API appcore_efl_base_ops appcore_efl_base_get_default_ops(void)
+{
+ appcore_efl_base_ops ops;
+
+ ops.ui_base = appcore_ui_base_get_default_ops();
+
+ /* override methods */
+ ops.ui_base.base.init = __efl_app_init;
+ ops.ui_base.base.finish = __efl_app_finish;
+ ops.ui_base.base.run = __efl_app_run;
+ ops.ui_base.base.exit = __efl_app_exit;
+
+ return ops;
+}
+
+EXPORT_API int appcore_efl_base_on_receive(aul_type type, bundle *b)
+{
+ return appcore_ui_base_on_receive(type, b);
+}
+
+EXPORT_API int appcore_efl_base_on_create(void)
+{
+ return appcore_ui_base_on_create();
+}
+
+EXPORT_API int appcore_efl_base_on_terminate(void)
+{
+ return appcore_ui_base_on_terminate();
+}
+
+EXPORT_API int appcore_efl_base_on_pause(void)
+{
+ return appcore_ui_base_on_pause();
+}
+
+EXPORT_API int appcore_efl_base_on_resume(void)
+{
+ return appcore_ui_base_on_resume();
+}
+
+EXPORT_API int appcore_efl_base_on_control(bundle *b)
+{
+ return appcore_ui_base_on_control(b);
+}
+
+EXPORT_API void appcore_efl_base_window_on_show(int type, void *event)
+{
+ appcore_ui_base_window_on_show(type, event);
+}
+
+EXPORT_API void appcore_efl_base_window_on_hide(int type, void *event)
+{
+ appcore_ui_base_window_on_hide(type, event);
+}
+
+EXPORT_API void appcore_efl_base_window_on_lower(int type, void *event)
+{
+ appcore_ui_base_window_on_lower(type, event);
+}
+
+EXPORT_API void appcore_efl_base_window_on_visibility(int type, void *event)
+{
+ appcore_ui_base_window_on_visibility(type, event);
+}
+
+EXPORT_API void appcore_efl_base_pause(void)
+{
+ appcore_ui_base_pause();
+}
+
+EXPORT_API void appcore_efl_base_resume(void)
+{
+ appcore_ui_base_resume();
+}
+
+EXPORT_API bool appcore_efl_base_is_resumed(void)
+{
+ return appcore_ui_base_is_resumed();
+}
+
+EXPORT_API void appcore_efl_base_exit(void)
+{
+ appcore_ui_base_exit();
+}
+
+EXPORT_API void appcore_efl_base_group_add(void)
+{
+ appcore_ui_base_group_add();
+}
+
+EXPORT_API void appcore_efl_base_group_remove(void)
+{
+ appcore_ui_base_group_remove();
+}
+
+EXPORT_API unsigned int appcore_efl_base_get_main_window(void)
+{
+ return appcore_ui_base_get_main_window();
+}
+
+EXPORT_API unsigned int appcore_efl_base_get_main_surface(void)
+{
+ return appcore_ui_base_get_main_surface();
+}
+
+EXPORT_API int appcore_efl_base_get_hint(void)
+{
+ return appcore_ui_base_get_hint();
+}
diff --git a/src/efl_base/appcore_efl_base_private.h b/src/efl_base/appcore_efl_base_private.h
new file mode 100644
index 0000000..2105107
--- /dev/null
+++ b/src/efl_base/appcore_efl_base_private.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#define LOG_TAG "APP_CORE_EFL_BASE"
+
+#include <dlog.h>
+
+#ifndef EXPORT_API
+#define EXPORT_API __attribute__ ((visibility("default")))
+#endif
+
+#define _ERR(...) LOGE(__VA_ARGS__)
+#define _INFO(...) LOGI(__VA_ARGS__)
+#define _DBG(...) LOGD(__VA_ARGS__)
diff --git a/src/legacy/appcore-efl.c b/src/legacy/appcore-efl.c
index 17053ae..503e550 100644
--- a/src/legacy/appcore-efl.c
+++ b/src/legacy/appcore-efl.c
@@ -17,18 +17,11 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-
-#include <glib-object.h>
-#include <malloc.h>
-#include <glib.h>
-#include <gio/gio.h>
#include <stdbool.h>
-#include <Elementary.h>
#include "appcore-internal.h"
#include "appcore-efl.h"
-#include "appcore_ui_base.h"
-#include <system_info.h>
+#include "appcore_efl_base.h"
struct appcore_efl_context {
struct appcore_ops ops;
@@ -38,7 +31,7 @@ static struct appcore_efl_context __context;
static int __ui_app_create(void *data)
{
- appcore_ui_base_on_create();
+ appcore_efl_base_on_create();
if (__context.ops.create) {
if (__context.ops.create(__context.ops.data) < 0)
@@ -50,7 +43,7 @@ static int __ui_app_create(void *data)
static int __ui_app_terminate(void *data)
{
- appcore_ui_base_on_terminate();
+ appcore_efl_base_on_terminate();
if (__context.ops.terminate)
__context.ops.terminate(__context.ops.data);
@@ -60,7 +53,7 @@ static int __ui_app_terminate(void *data)
static int __ui_app_control(bundle *b, void *data)
{
- appcore_ui_base_on_control(b);
+ appcore_efl_base_on_control(b);
if (__context.ops.reset)
__context.ops.reset(b, __context.ops.data);
@@ -70,7 +63,7 @@ static int __ui_app_control(bundle *b, void *data)
static int __ui_app_pause(void *data)
{
- appcore_ui_base_on_pause();
+ appcore_efl_base_on_pause();
if (__context.ops.pause)
__context.ops.pause(__context.ops.data);
@@ -79,7 +72,7 @@ static int __ui_app_pause(void *data)
static int __ui_app_resume(void *data)
{
- appcore_ui_base_on_resume();
+ appcore_efl_base_on_resume();
if (__context.ops.resume)
__context.ops.resume(__context.ops.data);
@@ -90,31 +83,30 @@ EXPORT_API int appcore_efl_init(const char *name, int *argc, char ***argv,
struct appcore_ops *ops)
{
int ret;
- appcore_ui_base_ops ui_ops = appcore_ui_base_get_default_ops();
+ appcore_efl_base_ops efl_ops = appcore_efl_base_get_default_ops();
/* override methods */
- ui_ops.base.create = __ui_app_create;
- ui_ops.base.control = __ui_app_control;
- ui_ops.base.terminate = __ui_app_terminate;
- ui_ops.pause = __ui_app_pause;
- ui_ops.resume = __ui_app_resume;
- ui_ops.base.run = NULL;
+ efl_ops.ui_base.base.create = __ui_app_create;
+ efl_ops.ui_base.base.control = __ui_app_control;
+ efl_ops.ui_base.base.terminate = __ui_app_terminate;
+ efl_ops.ui_base.pause = __ui_app_pause;
+ efl_ops.ui_base.resume = __ui_app_resume;
__context.ops = *ops;
- ret = appcore_ui_base_init(ui_ops, *argc, *argv, NULL,
- APPCORE_UI_BASE_HINT_WINDOW_GROUP_CONTROL |
- APPCORE_UI_BASE_HINT_WINDOW_STACK_CONTROL |
- APPCORE_UI_BASE_HINT_BG_LAUNCH_CONTROL |
- APPCORE_UI_BASE_HINT_HW_ACC_CONTROL |
- APPCORE_UI_BASE_HINT_WINDOW_AUTO_CONTROL);
+ ret = appcore_efl_base_init(efl_ops, *argc, *argv, NULL,
+ APPCORE_EFL_BASE_HINT_WINDOW_GROUP_CONTROL |
+ APPCORE_EFL_BASE_HINT_WINDOW_STACK_CONTROL |
+ APPCORE_EFL_BASE_HINT_BG_LAUNCH_CONTROL |
+ APPCORE_EFL_BASE_HINT_HW_ACC_CONTROL |
+ APPCORE_EFL_BASE_HINT_WINDOW_AUTO_CONTROL);
return ret;
}
EXPORT_API void appcore_efl_fini(void)
{
- appcore_ui_base_fini();
+ appcore_efl_base_fini();
}
EXPORT_API int appcore_efl_main(const char *name, int *argc, char ***argv,
@@ -123,9 +115,8 @@ EXPORT_API int appcore_efl_main(const char *name, int *argc, char ***argv,
int r;
r = appcore_efl_init(name, argc, argv, ops);
-
- if (r >= 0)
- elm_run();
+ if (r < 0)
+ return r;
appcore_efl_fini();
@@ -134,17 +125,17 @@ EXPORT_API int appcore_efl_main(const char *name, int *argc, char ***argv,
EXPORT_API void appcore_group_attach()
{
- appcore_ui_base_group_add();
+ appcore_efl_base_group_add();
}
EXPORT_API void appcore_group_lower()
{
- appcore_ui_base_group_remove();
+ appcore_efl_base_group_remove();
}
EXPORT_API unsigned int appcore_get_main_window(void)
{
- return appcore_ui_base_get_main_window();
+ return appcore_efl_base_get_main_window();
}
EXPORT_API unsigned int appcore_get_main_surface(void)
@@ -156,5 +147,3 @@ EXPORT_API int appcore_set_system_resource_reclaiming(bool enable)
{
return 0;
}
-
-
diff --git a/src/multiwindow_base/appcore_multiwindow_base.c b/src/multiwindow_base/appcore_multiwindow_base.c
index 854a6c9..89f184b 100644
--- a/src/multiwindow_base/appcore_multiwindow_base.c
+++ b/src/multiwindow_base/appcore_multiwindow_base.c
@@ -78,7 +78,6 @@ EXPORT_API int appcore_multiwindow_base_init(appcore_multiwindow_base_ops ops, i
_appcore_mw_context.argc = argc;
_appcore_mw_context.argv = argv;
- elm_init(argc, argv);
_appcore_mw_context.hshow = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_SHOW, __stub_show_cb, NULL);
_appcore_mw_context.hhide = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_HIDE, __stub_hide_cb, NULL);
_appcore_mw_context.hvchange = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE,
@@ -113,8 +112,6 @@ static void __free_class(gpointer data)
EXPORT_API void appcore_multiwindow_base_fini(void)
{
- appcore_base_fini();
-
__destroy_all();
g_list_free_full(_appcore_mw_context.classes, __free_class);
_appcore_mw_context.classes = NULL;
@@ -139,13 +136,7 @@ EXPORT_API void appcore_multiwindow_base_fini(void)
_appcore_mw_context.hlower = NULL;
}
- elm_shutdown();
-
- /* Check loader case */
- if (getenv("AUL_LOADER_INIT")) {
- unsetenv("AUL_LOADER_INIT");
- elm_shutdown();
- }
+ appcore_base_fini();
}
EXPORT_API void appcore_multiwindow_base_exit(void)
@@ -199,6 +190,24 @@ static void __exit(void *data)
elm_exit();
}
+static int __init(int argc, char **argv, void *data)
+{
+ elm_init(argc, argv);
+
+ return 0;
+}
+
+static void __finish(void)
+{
+ elm_shutdown();
+
+ /* Check loader case */
+ if (getenv("AUL_LOADER_INIT")) {
+ unsetenv("AUL_LOADER_INIT");
+ elm_shutdown();
+ }
+}
+
EXPORT_API appcore_multiwindow_base_ops appcore_multiwindow_base_get_default_ops(void)
{
appcore_multiwindow_base_ops ops;
@@ -209,6 +218,8 @@ EXPORT_API appcore_multiwindow_base_ops appcore_multiwindow_base_get_default_ops
ops.base.create = __on_create;
ops.base.terminate = __on_terminate;
ops.base.receive = __on_receive;
+ ops.base.init = __init;
+ ops.base.finish = __finish;
ops.base.run = __run;
ops.base.exit = __exit;
diff --git a/src/ui_base/appcore_ui_base.c b/src/ui_base/appcore_ui_base.c
index 822aabc..0108d5f 100644
--- a/src/ui_base/appcore_ui_base.c
+++ b/src/ui_base/appcore_ui_base.c
@@ -31,9 +31,6 @@
#include <tizen-extension-client-protocol.h>
#include <Ecore.h>
-#include <Ecore_Evas.h>
-#include <Ecore_Input_Evas.h>
-#include <Elementary.h>
#include <glib-object.h>
#include <malloc.h>
#include <glib.h>
@@ -43,8 +40,6 @@
#include <aul_svc.h>
#include <bundle_internal.h>
#include <ttrace.h>
-#include <voice_control_elm.h>
-#include <voice_control_elm_private.h>
#include "appcore_base.h"
#include "appcore_ui_base.h"
@@ -688,12 +683,9 @@ EXPORT_API void appcore_ui_base_window_on_visibility(int type, void *event)
EXPORT_API int appcore_ui_base_init(appcore_ui_base_ops ops, int argc, char **argv,
void *data, unsigned int hint)
{
- char *hwacc;
const char *bg_launch;
bundle *b;
char appid[PATH_MAX] = {0, };
- int r;
- bool is_vc_vt_automode = false;
appcore_ui_plugin_init(&ops, argc, argv, &hint);
aul_app_get_appid_bypid(getpid(), appid, sizeof(appid));
@@ -706,34 +698,6 @@ EXPORT_API int appcore_ui_base_init(appcore_ui_base_ops ops, int argc, char **ar
__context.appid = strdup(appid);
LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:main:done]", appid);
- elm_init(argc, argv);
-
- r = vc_elm_is_supported_vt_auto(&is_vc_vt_automode);
- if (r != 0) {
- _ERR("[VC] Fail to get vconfkey of vt_automode");
- } else {
- if (is_vc_vt_automode == true) {
- vc_elm_initialize();
- vc_elm_set_auto_register_mode(2, 0);
- }
- }
-
- if (__context.hint & APPCORE_UI_BASE_HINT_HW_ACC_CONTROL) {
- hwacc = getenv("HWACC");
-
- if (hwacc == NULL) {
- _DBG("elm_config_accel_preference_set is not called");
- } else if (strcmp(hwacc, "USE") == 0) {
- elm_config_accel_preference_set("hw");
- _DBG("elm_config_accel_preference_set : hw");
- } else if (strcmp(hwacc, "NOT_USE") == 0) {
- elm_config_accel_preference_set("none");
- _DBG("elm_config_accel_preference_set : none");
- } else {
- _DBG("elm_config_accel_preference_set is not called");
- }
- }
-
if (__context.hint & APPCORE_UI_BASE_HINT_BG_LAUNCH_CONTROL) {
b = bundle_import_from_argv(argc, argv);
if (b) {
@@ -750,12 +714,6 @@ EXPORT_API int appcore_ui_base_init(appcore_ui_base_ops ops, int argc, char **ar
EXPORT_API void appcore_ui_base_fini(void)
{
- bool is_vc_vt_automode = false;
- int r;
-
- appcore_base_fini();
- appcore_ui_plugin_fini();
-
if (__context.hshow)
ecore_event_handler_del(__context.hshow);
if (__context.hhide)
@@ -767,24 +725,11 @@ EXPORT_API void appcore_ui_base_fini(void)
__finish_wl();
- r = vc_elm_is_supported_vt_auto(&is_vc_vt_automode);
- if (r != 0) {
- _ERR("[VC] Fail to get vconfkey of vt_automode");
- } else {
- if (is_vc_vt_automode == true)
- vc_elm_deinitialize();
- }
-
- elm_shutdown();
-
- /* Check loader case */
- if (getenv("AUL_LOADER_INIT")) {
- unsetenv("AUL_LOADER_INIT");
- elm_shutdown();
- }
-
free(__context.appid);
__context.appid = NULL;
+
+ appcore_ui_plugin_fini();
+ appcore_base_fini();
}
EXPORT_API void appcore_ui_base_pause(void)
@@ -818,6 +763,11 @@ EXPORT_API unsigned int appcore_ui_base_get_main_surface(void)
return __get_main_surface();
}
+EXPORT_API int appcore_ui_base_get_hint(void)
+{
+ return __context.hint;
+}
+
static int __on_receive(aul_type type, bundle *b, void *data)
{
return appcore_ui_base_on_receive(type, b);
@@ -863,16 +813,6 @@ static void __window_on_visibility(int type, void *event, void *data)
appcore_ui_base_window_on_visibility(type, event);
}
-static void __run(void *data)
-{
- elm_run();
-}
-
-static void __exit(void *data)
-{
- elm_exit();
-}
-
EXPORT_API appcore_ui_base_ops appcore_ui_base_get_default_ops(void)
{
appcore_ui_base_ops ops;
@@ -883,8 +823,10 @@ EXPORT_API appcore_ui_base_ops appcore_ui_base_get_default_ops(void)
ops.base.create = __on_create;
ops.base.terminate = __on_terminate;
ops.base.receive = __on_receive;
- ops.base.run = __run;
- ops.base.exit = __exit;
+ ops.base.init = NULL;
+ ops.base.finish = NULL;
+ ops.base.run = NULL;
+ ops.base.exit = NULL;
ops.pause = __on_pause;
ops.resume = __on_resume;