Add a new APIs for ui plugin module 26/271426/2
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 21 Feb 2022 05:47:14 +0000 (14:47 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 21 Feb 2022 23:12:57 +0000 (08:12 +0900)
The app_core_ui_base APIs are added for ui plugin module. The functions
have a handle parameter about an app_core_ui_base_h. The AppCoreUiBase plugin
loads a new interface for cpp based app-core. It's to avoid conflicts
between old version and new version.

Change-Id: I00721aa070a3696e98252628268cf6631d2e1882
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
packaging/app-core.spec
tizen-cpp/app-core-ui-cpp/CMakeLists.txt
tizen-cpp/app-core-ui-cpp/api/app_core_ui_base.cc [new file with mode: 0644]
tizen-cpp/app-core-ui-cpp/api/app_core_ui_base.h [new file with mode: 0644]
tizen-cpp/app-core-ui-cpp/app-core-ui-cpp.pc.in
tizen-cpp/app-core-ui-cpp/app_core_ui_base.cc
tizen-cpp/app-core-ui-cpp/app_core_ui_delegator_private.cc
tizen-cpp/app-core-ui-cpp/app_core_ui_delegator_private.hh
tizen-cpp/app-core-ui-cpp/app_core_ui_plugin_private.cc
tizen-cpp/app-core-ui-cpp/app_core_ui_plugin_private.hh
unittests/CMakeLists.txt

index b432d5e..62b6750 100644 (file)
@@ -263,6 +263,7 @@ install -m 0644 app-core.zip %{buildroot}%{_datadir}/gcov/
 %{_libdir}/pkgconfig/appcore-ui.pc
 
 %{_includedir}/appcore_cpp/app_core_ui_base.hh
+%{_includedir}/appcore_cpp/api/app_core_ui_base.h
 %{_libdir}/libapp-core-ui-cpp.so
 %{_libdir}/pkgconfig/app-core-ui-cpp.pc
 
index a8b6188..b722e69 100644 (file)
@@ -1,12 +1,15 @@
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/api API_SRCS)
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} APP_CORE_UI_CPP_SRCS)
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../common COMMON_SRCS)
 
 ADD_LIBRARY(${TARGET_APP_CORE_UI_CPP} SHARED
+  ${API_SRCS}
   ${APP_CORE_UI_CPP_SRCS}
   ${COMMON_SRCS})
 
 TARGET_INCLUDE_DIRECTORIES(${TARGET_APP_CORE_UI_CPP} PUBLIC
   ${CMAKE_CURRENT_SOURCE_DIR}
+  ${CMAKE_CURRENT_SOURCE_DIR}/api
   ${CMAKE_CURRENT_SOURCE_DIR}/../)
 
 TARGET_LINK_LIBRARIES(${TARGET_APP_CORE_UI_CPP} PUBLIC
@@ -42,3 +45,8 @@ INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION include/appcore_cpp
   FILES_MATCHING
   PATTERN "*_private.hh" EXCLUDE
   PATTERN "*.hh")
+
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/api/
+  DESTINATION include/appcore_cpp/api
+  FILES_MATCHING
+  PATTERN "*.h")
diff --git a/tizen-cpp/app-core-ui-cpp/api/app_core_ui_base.cc b/tizen-cpp/app-core-ui-cpp/api/app_core_ui_base.cc
new file mode 100644 (file)
index 0000000..1a0d337
--- /dev/null
@@ -0,0 +1,258 @@
+/*
+ * Copyright (c) 2022 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 "app-core-ui-cpp/api/app_core_ui_base.h"
+
+#include "app-core-ui-cpp/app_core_ui_base.hh"
+
+#undef API
+#define API extern "C" __attribute__ ((visibility("default")))
+
+using namespace tizen_cpp;
+
+API int app_core_ui_base_on_receive(app_core_ui_base_h h, aul_type type,
+    bundle* b) {
+  if (h == nullptr || b == nullptr)
+    return -1;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  return base->OnReceive(type, tizen_base::Bundle(b));
+}
+
+API int app_core_ui_base_on_create(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return -1;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  return base->OnCreate();
+}
+
+API int app_core_ui_base_on_terminate(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return -1;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  return base->OnTerminate();
+}
+
+API int app_core_ui_base_on_pause(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return -1;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  return base->OnPause();
+}
+
+API int app_core_ui_base_on_resume(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return -1;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  return base->OnResume();
+}
+
+API int app_core_ui_base_on_control(app_core_ui_base_h h, bundle* b) {
+  if (h == nullptr)
+    return -1;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  return base->OnControl(b ? tizen_base::Bundle(b) : tizen_base::Bundle());
+}
+
+API int app_core_ui_base_on_trim_memory(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return -1;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  return base->OnTrimMemory();
+}
+
+API void app_core_ui_base_window_on_show(app_core_ui_base_h h, int type,
+    void* event) {
+  if (h == nullptr)
+    return;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  base->OnShow(type, event);
+}
+
+API void app_core_ui_base_window_on_hide(app_core_ui_base_h h, int type,
+    void* event) {
+  if (h == nullptr)
+    return;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  base->OnHide(type, event);
+}
+
+API void app_core_ui_base_window_on_lower(app_core_ui_base_h h, int type,
+    void* event) {
+  if (h == nullptr)
+    return;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  base->OnLower(type, event);
+}
+
+API void app_core_ui_base_window_on_visibility(app_core_ui_base_h h, int type,
+    void* event) {
+  if (h == nullptr)
+    return;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  base->OnVisibility(type, event);
+}
+
+API void app_core_ui_base_window_on_pre_visibility(app_core_ui_base_h h,
+    int type, void* event) {
+  if (h == nullptr)
+    return;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  base->OnPreVisibility(type, event);
+}
+
+API void app_core_ui_base_window_on_aux_message(app_core_ui_base_h h, int type,
+    void* event) {
+  if (h == nullptr)
+    return;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  base->OnAuxMessage(type, event);
+}
+
+API int app_core_ui_base_on_set_i18n(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return -1;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  return base->OnSetI18n();
+}
+
+API void app_core_ui_base_on_set_event(app_core_ui_base_h h,
+    app_core_ui_base_event_e event) {
+  if (h == nullptr)
+    return;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  base->OnSetEvent(static_cast<AppCoreBase::IEvent::Type>(event));
+}
+
+API void app_core_ui_base_on_unset_event(app_core_ui_base_h h,
+    app_core_ui_base_event_e event) {
+  if (h == nullptr)
+    return;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  base->OnUnsetEvent(static_cast<AppCoreBase::IEvent::Type>(event));
+}
+
+API void app_core_ui_base_pause(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  base->Pause();
+}
+
+API void app_core_ui_base_resume(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  base->Resume();
+}
+
+API bool app_core_ui_base_is_resumed(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return false;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  return base->IsResumed();
+}
+
+API void app_core_ui_base_exit(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  base->Exit();
+}
+
+API int app_core_ui_base_group_add(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return -1;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  return base->GroupAdd();
+}
+
+API void app_core_ui_base_group_remove(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  base->GroupRemove();
+}
+
+API unsigned int app_core_ui_base_get_main_window(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return 0;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  return base->GetMainWindow();
+}
+
+API unsigned int app_core_ui_base_get_main_surface(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return 0;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  return base->GetMainSurface();
+}
+
+API int app_core_ui_base_get_hint(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return 0;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  return base->GetHint();
+}
+
+API bool app_core_ui_base_get_bg_state(app_core_ui_base_h h) {
+  if (h == nullptr)
+    return false;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  return base->GetBgState();
+}
+
+API void app_core_ui_base_set_bg_state(app_core_ui_base_h h, bool bg_state) {
+  if (h == nullptr)
+    return;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  base->SetBgState(bg_state);
+}
+
+API void app_core_ui_base_set_system_resource_reclaiming(app_core_ui_base_h h,
+    bool enable) {
+  if (h == nullptr)
+    return;
+
+  auto* base = static_cast<AppCoreUiBase*>(h);
+  base->SetSystemResourceReclaiming(enable);
+}
diff --git a/tizen-cpp/app-core-ui-cpp/api/app_core_ui_base.h b/tizen-cpp/app-core-ui-cpp/api/app_core_ui_base.h
new file mode 100644 (file)
index 0000000..8e255fc
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2022 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.
+ */
+
+#ifndef TIZEN_CPP_APP_CORE_UI_BASE_API_APP_CORE_UI_BASE_H_
+#define TIZEN_CPP_APP_CORE_UI_BASE_API_APP_CORE_UI_BASE_H_
+
+#include <libintl.h>
+#include <bundle.h>
+#include <aul.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif  // __cplusplus
+
+typedef void *app_core_ui_base_h;
+
+typedef enum {
+       APP_CORE_UI_BASE_EVENT_START,
+        APP_CORE_UI_BASE_EVENT_LOW_MEMORY,
+        APP_CORE_UI_BASE_EVENT_LOW_BATTERY,
+        APP_CORE_UI_BASE_EVENT_LANG_CHANGE,
+        APP_CORE_UI_BASE_EVENT_DEVICE_ORIENTATION_CHANGED,
+        APP_CORE_UI_BASE_EVENT_REGION_CHANGE,
+        APP_CORE_UI_BASE_EVENT_SUSPENDED_STATE_CHANGE,
+        APP_CORE_UI_BASE_EVENT_UPDATE_REQUESTED,
+        APP_CORE_UI_BASE_EVENT_MAX,
+} app_core_ui_base_event_e;
+
+typedef enum {
+        APP_CORE_UI_BASE_HINT_WINDOW_GROUP_CONTROL = 0x1,
+        APP_CORE_UI_BASE_HINT_WINDOW_STACK_CONTROL = 0x2,
+        APP_CORE_UI_BASE_HINT_BG_LAUNCH_CONTROL = 0x4,
+        APP_CORE_UI_BASE_HINT_HW_ACC_CONTROL = 0x8,
+        APP_CORE_UI_BASE_HINT_WINDOW_AUTO_CONTROL = 0x10,
+        APP_CORE_UI_BASE_HINT_LEGACY_CONTROL = 0x20,
+        APP_CORE_UI_BASE_HINT_WINDOW_ID_CONTROL = 0x40,
+} app_core_ui_base_hint_e;
+
+typedef struct {
+       int (*create)(void *data);
+        int (*terminate)(void *data);
+        int (*control)(bundle *b, void *data);
+        int (*receive)(aul_type type, bundle *b, void *data);
+        int (*set_i18n)(void *data);
+        void (*init)(int argc, char **argv, void *data);
+        void (*finish)(void* data);
+        void (*run)(void *data);
+        void (*exit)(void *data);
+        void (*set_event)(app_core_ui_base_event_e event, void *data);
+        void (*unset_event)(app_core_ui_base_event_e event, void *data);
+        void (*trim_memory)(void *data);
+} app_core_base_ops;
+
+typedef struct {
+        void (*show)(int type, void *event, void *data);
+        void (*hide)(int type, void *event, void *data);
+        void (*lower)(int type, void *event, void *data);
+        void (*visibility)(int type, void *event, void *data);
+        void (*pre_visibility)(int type, void *event, void *data);
+        void (*aux_message)(int type, void *event, void *data);
+} app_core_ui_base_window_ops;
+
+typedef struct {
+        int (*pause) (void *data);
+        int (*resume) (void *data);
+        app_core_base_ops base;
+        app_core_ui_base_window_ops window;
+} app_core_ui_base_ops;
+
+int app_core_ui_base_on_receive(app_core_ui_base_h h, aul_type type, bundle *b);
+
+int app_core_ui_base_on_create(app_core_ui_base_h h);
+
+int app_core_ui_base_on_terminate(app_core_ui_base_h h);
+
+int app_core_ui_base_on_pause(app_core_ui_base_h h);
+
+int app_core_ui_base_on_resume(app_core_ui_base_h h);
+
+int app_core_ui_base_on_control(app_core_ui_base_h h, bundle *b);
+
+int app_core_ui_base_on_trim_memory(app_core_ui_base_h);
+
+void app_core_ui_base_window_on_show(app_core_ui_base_h h, int type, void *event);
+
+void app_core_ui_base_window_on_hide(app_core_ui_base_h h, int type, void *event);
+
+void app_core_ui_base_window_on_lower(app_core_ui_base_h h, int type, void *event);
+
+void app_core_ui_base_window_on_visibility(app_core_ui_base_h h, int type, void *event);
+
+void app_core_ui_base_window_on_pre_visibility(app_core_ui_base_h h, int type, void *event);
+
+void app_core_ui_base_window_on_aux_message(app_core_ui_base_h h, int type, void *event);
+
+int app_core_ui_base_on_set_i18n(app_core_ui_base_h h);
+
+void app_core_ui_base_on_set_event(app_core_ui_base_h h, app_core_ui_base_event_e event);
+
+void app_core_ui_base_on_unset_event(app_core_ui_base_h h, app_core_ui_base_event_e event);
+
+void app_core_ui_base_pause(app_core_ui_base_h h);
+
+void app_core_ui_base_resume(app_core_ui_base_h h);
+
+bool app_core_ui_base_is_resumed(app_core_ui_base_h h);
+
+void app_core_ui_base_exit(app_core_ui_base_h h);
+
+int app_core_ui_base_group_add(app_core_ui_base_h h);
+
+void app_core_ui_base_group_remove(app_core_ui_base_h h);
+
+unsigned int app_core_ui_base_get_main_window(app_core_ui_base_h);
+
+unsigned int app_core_ui_base_get_main_surface(app_core_ui_base_h);
+
+int app_core_ui_base_get_hint(app_core_ui_base_h h);
+
+bool app_core_ui_base_get_bg_state(app_core_ui_base_h h);
+
+void app_core_ui_base_set_bg_state(app_core_ui_base_h h, bool bg_state);
+
+void app_core_ui_base_set_system_resource_reclaiming(app_core_ui_base_h h, bool enable);
+
+#ifdef __cplusplus
+}
+#endif  // __cplusplus
+
+#endif  // TIZEN_CPP_APP_CORE_UI_BASE_API_UI_APP_CORE_BASE_H_
index 20ed780..d7e6271 100644 (file)
@@ -11,5 +11,5 @@ Version: @VERSION@
 Requires.private: dlog
 Requires: app-core-cpp
 Libs: -L${libdir} -lapp-core-ui-cpp
-Cflags: -I${includedir} -I${includedir}/appcore_cpp
-cppflags: I${includedir} -I${includedir}/appcore_cpp
+Cflags: -I${includedir} -I${includedir}/appcore_cpp -I${includedir}/appcore_cpp/api
+cppflags: I${includedir} -I${includedir}/appcore_cpp --I${includedir}/appcore_cpp/api
index 7102c71..a3c67ca 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 - 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include "app-core-ui-cpp/app_core_ui_base.hh"
+
 #include <Ecore_Wl2.h>
 #include <aul_app_lifecycle.h>
 #include <aul_rpc_port.h>
 #include <string>
 
 #include "app-core-cpp/app_core_base.hh"
-#include "app-core-ui-cpp/app_core_ui_base.hh"
+#include "app-core-ui-cpp/api/app_core_ui_base.h"
 #include "app-core-ui-cpp/app_core_ui_delegator_private.hh"
 #include "app-core-ui-cpp/app_core_ui_plugin_private.hh"
-#include "app-core-ui-cpp/appcore_ui_base.h"
 #include "app-core-ui-cpp/wayland_handler_private.hh"
 #include "common/ecore_handler.hh"
 #include "common/log_private.hh"
@@ -250,7 +251,7 @@ void AppCoreUiBase::Impl::PluginInit(int argc, char** argv) {
   if (plugin_ == nullptr)
     return;
 
-  appcore_ui_base_ops ops;
+  app_core_ui_base_ops ops;
   ops.base.create = [](void* data) -> int {
     auto* base = reinterpret_cast<AppCoreUiBase*>(data);
     return base->OnCreate();
@@ -296,12 +297,12 @@ void AppCoreUiBase::Impl::PluginInit(int argc, char** argv) {
     base->OnLoopExit();
   };
 
-  ops.base.set_event = [](enum appcore_base_event event, void* data) {
+  ops.base.set_event = [](app_core_ui_base_event_e event, void* data) {
     auto* base = reinterpret_cast<AppCoreUiBase*>(data);
     base->OnSetEvent(static_cast<IAppCore::IEvent::Type>(event));
   };
 
-  ops.base.unset_event = [](enum appcore_base_event event, void* data) {
+  ops.base.unset_event = [](app_core_ui_base_event_e event, void* data) {
     auto* base = reinterpret_cast<AppCoreUiBase*>(data);
     base->OnUnsetEvent(static_cast<IAppCore::IEvent::Type>(event));
   };
@@ -351,7 +352,7 @@ void AppCoreUiBase::Impl::PluginInit(int argc, char** argv) {
     base->OnAuxMessage(type, event);
   };
 
-  plugin_->Init(&ops, argc, argv, &hint_);
+  plugin_->Init(parent_, &ops, argc, argv, &hint_);
   plugin_delegator_.reset(new AppCoreUiDelegator(ops, parent_));
   parent_->SetCoreDelegator(plugin_delegator_.get());
   parent_->SetLoopDelegator(plugin_delegator_.get());
@@ -363,7 +364,7 @@ void AppCoreUiBase::Impl::PluginFini() {
   if (plugin_ == nullptr)
     return;
 
-  plugin_->Fini();
+  plugin_->Fini(parent_);
 }
 
 void AppCoreUiBase::Run(int argc, char** argv) {
index 335676b..870fffb 100644 (file)
@@ -18,7 +18,7 @@
 
 namespace tizen_cpp {
 
-AppCoreUiDelegator::AppCoreUiDelegator(appcore_ui_base_ops ops,
+AppCoreUiDelegator::AppCoreUiDelegator(app_core_ui_base_ops ops,
     AppCoreUiBase* base)
     : ops_(ops), base_(base) {
 }
@@ -55,13 +55,13 @@ int AppCoreUiDelegator::OnSetI18n() {
 
 int AppCoreUiDelegator::OnSetEvent(IEvent::Type event) {
   if (ops_.base.set_event)
-    ops_.base.set_event(static_cast<appcore_base_event>(event), base_);
+    ops_.base.set_event(static_cast<app_core_ui_base_event_e>(event), base_);
   return 0;
 }
 
 int AppCoreUiDelegator::OnUnsetEvent(IEvent::Type event) {
   if (ops_.base.unset_event)
-    ops_.base.unset_event(static_cast<appcore_base_event>(event), base_);
+    ops_.base.unset_event(static_cast<app_core_ui_base_event_e>(event), base_);
   return 0;
 }
 
index 6b6dd4f..c211409 100644 (file)
@@ -17,8 +17,8 @@
 #ifndef TIZEN_CPP_APP_CORE_UI_CPP_APP_CORE_UI_DELEGATOR_PRIVATE_HH_
 #define TIZEN_CPP_APP_CORE_UI_CPP_APP_CORE_UI_DELEGATOR_PRIVATE_HH_
 
+#include "app-core-ui-cpp/api/app_core_ui_base.h"
 #include "app-core-ui-cpp/app_core_ui_base.hh"
-#include "app-core-ui-cpp/appcore_ui_base.h"
 
 namespace tizen_cpp {
 
@@ -27,7 +27,7 @@ class AppCoreUiDelegator : public IAppCore,
                            public IAppCoreUi,
                            public IWindow {
  public:
-  AppCoreUiDelegator(appcore_ui_base_ops ops, AppCoreUiBase* base);
+  AppCoreUiDelegator(app_core_ui_base_ops ops, AppCoreUiBase* base);
 
   int OnReceive(aul_type type, tizen_base::Bundle b) override;
   int OnCreate();
@@ -51,7 +51,7 @@ class AppCoreUiDelegator : public IAppCore,
   void OnAuxMessage(int type, void* event);
 
  private:
-  appcore_ui_base_ops ops_;
+  app_core_ui_base_ops ops_;
   AppCoreUiBase* base_;
 };
 
index 71b01e9..4cdcc10 100644 (file)
@@ -29,8 +29,8 @@ namespace {
 
 constexpr const char kPathLibAppCoreUiPlugin[] =
     "/usr/share/appcore/plugins/libappcore-ui-plugin.so";
-constexpr const char kAppCoreUiPluginInit[] = "APPCORE_UI_PLUGIN_INIT";
-constexpr const char kAppCoreUiPluginFini[] = "APPCORE_UI_PLUGIN_FINI";
+constexpr const char kAppCoreUiPluginInit[] = "APP_CORE_UI_PLUGIN_INIT";
+constexpr const char kAppCoreUiPluginFini[] = "APP_CORE_UI_PLUGIN_FINI";
 
 }  // namespace
 
@@ -67,21 +67,21 @@ AppCoreUiPlugin* AppCoreUiPlugin::Load() {
   return new (std::nothrow) AppCoreUiPlugin(handle, init_func, fini_func);
 }
 
-void AppCoreUiPlugin::Init(appcore_ui_base_ops* ops, int argc, char** argv,
-    unsigned int* hint) {
+void AppCoreUiPlugin::Init(AppCoreUiBase* base, app_core_ui_base_ops* ops,
+    int argc, char** argv, unsigned int* hint) {
   _I("[__PLUGIN__] INIT");
   if (init_func_ == nullptr)
     return;
 
-  init_func_(ops, argc, argv, hint);
+  init_func_(static_cast<app_core_ui_base_h>(base), ops, argc, argv, hint);
 }
 
-void AppCoreUiPlugin::Fini() {
+void AppCoreUiPlugin::Fini(AppCoreUiBase* base) {
   _I("[__PLUGIN__] FINI");
   if (fini_func_ == nullptr)
     return;
 
-  fini_func_();
+  fini_func_(static_cast<app_core_ui_base_h>(base));
 }
 
 }  // namespace tizen_cpp
index 77e8ce7..983c8a1 100644 (file)
 #ifndef TIZEN_CPP_APP_CORE_UI_CPP_APP_CORE_UI_PLUGIN_PRIVATE_HH_
 #define TIZEN_CPP_APP_CORE_UI_CPP_APP_CORE_UI_PLUGIN_PRIVATE_HH_
 
-#include "appcore_ui_base.h"
+#include "app-core-ui-cpp/api/app_core_ui_base.h"
+#include "app-core-ui-cpp/app_core_ui_base.hh"
 
 namespace tizen_cpp {
 
 class AppCoreUiPlugin {
  public:
   using PluginInitFunc =
-      int (*)(appcore_ui_base_ops*, int, char**, unsigned int*);
-  using PluginFiniFunc = int (*)(void);
+      int (*)(app_core_ui_base_h, app_core_ui_base_ops*, int, char**,
+              unsigned int*);
+  using PluginFiniFunc = int (*)(app_core_ui_base_h);
 
   AppCoreUiPlugin(void* handle, PluginInitFunc init_func,
       PluginFiniFunc fini_func);
@@ -33,9 +35,9 @@ class AppCoreUiPlugin {
 
   static AppCoreUiPlugin* Load();
 
-  void Init(appcore_ui_base_ops* ops, int argc, char** argv,
-      unsigned int* hint);
-  void Fini();
+  void Init(AppCoreUiBase* base, app_core_ui_base_ops* ops, int argc,
+      char** argv, unsigned int* hint);
+  void Fini(AppCoreUiBase* base);
 
  private:
   void* handle_ = nullptr;
index 72d1744..4a0ab78 100644 (file)
@@ -4,6 +4,8 @@ AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../tizen-cpp/app-core-cpp
   LIB_APP_CORE_CPP_SRCS)
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../tizen-cpp/app-core-ui-cpp
   LIB_APP_CORE_UI_CPP_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../tizen-cpp/app-core-ui-cpp/api
+  LIB_APP_CORE_UI_CPP_API_SRCS)
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../tizen-cpp/app-core-efl-cpp
   LIB_APP_CORE_EFL_CPP_SRCS)
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../tizen-cpp/app-core-multi-window-cpp
@@ -18,6 +20,7 @@ ADD_EXECUTABLE(${TARGET_UNIT_TEST}
   ${TEST_SRCS}
   ${LIB_APP_CORE_CPP_SRCS}
   ${LIB_APP_CORE_UI_CPP_SRCS}
+  ${LIB_APP_CORE_UI_CPP_API_SRCS}
   ${LIB_APP_CORE_EFL_CPP_SRCS}
   ${LIB_APP_CORE_MULTI_WINDOW_CPP_SRCS}
   ${LIB_COMMON_SRCS})