From 1766c2e99f821bb335431a68e10bac1c50c303b5 Mon Sep 17 00:00:00 2001 From: qpzeng Date: Fri, 21 Apr 2023 15:16:45 +0800 Subject: [PATCH 1/3] add surface node to tree to receive buffer available callback Signed-off-by: qpzeng Change-Id: I0963dc29fdf8284bbdbcc201368d8f45bb8c99b2 --- .../scene/host/host_window_pattern.cpp | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/frameworks/core/components_ng/pattern/window_scene/scene/host/host_window_pattern.cpp b/frameworks/core/components_ng/pattern/window_scene/scene/host/host_window_pattern.cpp index d330ccd6a..30d34186d 100644 --- a/frameworks/core/components_ng/pattern/window_scene/scene/host/host_window_pattern.cpp +++ b/frameworks/core/components_ng/pattern/window_scene/scene/host/host_window_pattern.cpp @@ -88,16 +88,26 @@ void HostWindowPattern::InitContent() context->SetRSNode(surfaceNode); } - LOGI("Session state is %{public}u.", session_->GetSessionState()); - if (session_->GetSessionState() == Rosen::SessionState::STATE_DISCONNECT) { - CreateStartingNode(); - } else if (session_->GetSessionState() == Rosen::SessionState::STATE_BACKGROUND) { - CreateSnapshotNode(); - } else { - LOGW("Unexpected session state: %{public}u.", session_->GetSessionState()); - auto host = GetHost(); - CHECK_NULL_VOID(host); - host->AddChild(contentNode_); + auto state = session_->GetSessionState(); + LOGI("Session state is %{public}u.", state); + switch (state) { + case Rosen::SessionState::STATE_DISCONNECT: { + auto host = GetHost(); + CHECK_NULL_VOID(host); + host->AddChild(contentNode_); + CreateStartingNode(); + break; + } + case Rosen::SessionState::STATE_BACKGROUND: { + CreateSnapshotNode(); + break; + } + default: { + auto host = GetHost(); + CHECK_NULL_VOID(host); + host->AddChild(contentNode_); + break; + } } } @@ -141,6 +151,7 @@ void HostWindowPattern::CreateSnapshotNode() void HostWindowPattern::OnConnect() { + ContainerScope scope(instanceId_); CHECK_NULL_VOID(session_); auto surfaceNode = session_->GetSurfaceNode(); CHECK_NULL_VOID(surfaceNode); @@ -149,17 +160,15 @@ void HostWindowPattern::OnConnect() auto context = AceType::DynamicCast(contentNode_->GetRenderContext()); CHECK_NULL_VOID(context); context->SetRSNode(surfaceNode); + context->SyncGeometryProperties(nullptr); - if (!HasStartingPage()) { - ContainerScope scope(instanceId_); - auto host = GetHost(); - CHECK_NULL_VOID(host); + auto host = GetHost(); + CHECK_NULL_VOID(host); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE); - host->AddChild(contentNode_); - host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE); + if (!HasStartingPage()) { return; } - surfaceNode->SetBufferAvailableCallback([weak = WeakClaim(this)]() { LOGI("RSSurfaceNode buffer available callback"); auto hostWindowPattern = weak.Upgrade(); @@ -177,8 +186,6 @@ void HostWindowPattern::BufferAvailableCallback() host->RemoveChild(startingNode_); startingNode_.Reset(); - - host->AddChild(contentNode_); host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE); } -- Gitee From 4ad6f0f0ae069f8ca9d062a97c77cf70a4cdaf5a Mon Sep 17 00:00:00 2001 From: qpzeng Date: Sun, 23 Apr 2023 10:07:28 +0800 Subject: [PATCH 2/3] no depends on napi Signed-off-by: qpzeng Change-Id: I393771a4ff9c91751effa6474c410ab847417f7f --- .../bridge/declarative_frontend/BUILD.gn | 4 +- .../declarative_frontend/jsview/js_utils.cpp | 91 ------------------- .../declarative_frontend/jsview/js_utils.h | 6 -- .../window_scene/js_host_window_scene.cpp | 16 +++- .../jsview/window_scene/js_screen.cpp | 16 +++- 5 files changed, 32 insertions(+), 101 deletions(-) diff --git a/frameworks/bridge/declarative_frontend/BUILD.gn b/frameworks/bridge/declarative_frontend/BUILD.gn index 4f26cd710..369865a40 100644 --- a/frameworks/bridge/declarative_frontend/BUILD.gn +++ b/frameworks/bridge/declarative_frontend/BUILD.gn @@ -471,10 +471,10 @@ template("declarative_js_engine") { "jsview/window_scene/js_screen.cpp", ] external_deps += [ - "input:libmmi-client", "window_manager:scene_session", + "window_manager:scene_session_manager", "window_manager:screen_session", - "window_manager:window_scene_napi_packages", + "window_manager:screen_session_manager", ] } } diff --git a/frameworks/bridge/declarative_frontend/jsview/js_utils.cpp b/frameworks/bridge/declarative_frontend/jsview/js_utils.cpp index 6cca3d2b8..77f19cbd7 100644 --- a/frameworks/bridge/declarative_frontend/jsview/js_utils.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/js_utils.cpp @@ -21,11 +21,6 @@ #include #endif -#include "scene_session_manager/js_scene_session.h" -#include "screen_session_manager/js_screen_session.h" -#include "session/host/include/scene_session.h" -#include "session/screen/include/screen_session.h" - #include "base/image/pixel_map.h" #include "base/log/ace_trace.h" #include "base/want/want_wrap.h" @@ -157,91 +152,5 @@ RefPtr CreateWantWrapFromNapiValue(JSRef obj) return WantWrap::CreateWantWrap(reinterpret_cast(nativeEngine), reinterpret_cast(nativeValue)); } -sptr CreateSceneSessionFromNapiValue(JSRef obj) -{ -#ifdef ENABLE_ROSEN_BACKEND - if (!obj->IsObject()) { - LOGE("obj is not an object"); - return nullptr; - } - auto engine = EngineHelper::GetCurrentEngine(); - if (!engine) { - LOGE("engine is nullptr"); - return nullptr; - } - auto nativeEngine = engine->GetNativeEngine(); - if (nativeEngine == nullptr) { - LOGE("nativeEngine is nullptr"); - return nullptr; - } -#ifdef USE_ARK_ENGINE - panda::Local value = obj.Get().GetLocalHandle(); -#endif - JSValueWrapper valueWrapper = value; - NativeValue* nativeValue = nativeEngine->ValueToNativeValue(valueWrapper); - if (nativeValue == nullptr) { - LOGE("nativeValue is nullptr"); - return nullptr; - } - NativeObject* object = static_cast(nativeValue->GetInterface(NativeObject::INTERFACE_ID)); - if (object == nullptr) { - LOGE("nativeObject is nullptr"); - return nullptr; - } - - auto jsSceneSession = static_cast(object->GetNativePointer()); - if (jsSceneSession == nullptr) { - LOGE("jsSceneSession is nullptr"); - return nullptr; - } - return jsSceneSession->GetNativeSession(); -#else - return nullptr; -#endif -} - -sptr CreateScreenSessionFromNapiValue(JSRef obj) -{ -#ifdef ENABLE_ROSEN_BACKEND - if (!obj->IsObject()) { - LOGE("obj is not an object"); - return nullptr; - } - auto engine = EngineHelper::GetCurrentEngine(); - if (!engine) { - LOGE("engine is nullptr"); - return nullptr; - } - auto nativeEngine = engine->GetNativeEngine(); - if (nativeEngine == nullptr) { - LOGE("nativeEngine is nullptr"); - return nullptr; - } -#ifdef USE_ARK_ENGINE - panda::Local value = obj.Get().GetLocalHandle(); -#endif - JSValueWrapper valueWrapper = value; - NativeValue* nativeValue = nativeEngine->ValueToNativeValue(valueWrapper); - if (nativeValue == nullptr) { - LOGE("nativeValue is nullptr"); - return nullptr; - } - NativeObject* object = static_cast(nativeValue->GetInterface(NativeObject::INTERFACE_ID)); - if (object == nullptr) { - LOGE("nativeObject is nullptr"); - return nullptr; - } - - auto jsScreenSession = static_cast(object->GetNativePointer()); - if (jsScreenSession == nullptr) { - LOGE("jsScreenSession is nullptr"); - return nullptr; - } - return jsScreenSession->GetNativeSession(); -#else - return nullptr; -#endif -} - #endif } // namespace OHOS::Ace::Framework diff --git a/frameworks/bridge/declarative_frontend/jsview/js_utils.h b/frameworks/bridge/declarative_frontend/jsview/js_utils.h index 240714a00..d712cc722 100644 --- a/frameworks/bridge/declarative_frontend/jsview/js_utils.h +++ b/frameworks/bridge/declarative_frontend/jsview/js_utils.h @@ -16,8 +16,6 @@ #ifndef FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_UTILS_H #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_UTILS_H -#include - #include "frameworks/bridge/declarative_frontend/jsview/js_interactable_view.h" #include "frameworks/bridge/declarative_frontend/jsview/js_view_abstract.h" @@ -29,8 +27,6 @@ #if !defined(PREVIEW) namespace OHOS::Rosen { class RSNode; -class Session; -class ScreenSession; } namespace OHOS::Ace { @@ -41,8 +37,6 @@ namespace OHOS::Ace::Framework { RefPtr CreatePixelMapFromNapiValue(JSRef obj); const std::shared_ptr CreateRSNodeFromNapiValue(JSRef obj); RefPtr CreateWantWrapFromNapiValue(JSRef obj); - sptr CreateSceneSessionFromNapiValue(JSRef obj); - sptr CreateScreenSessionFromNapiValue(JSRef obj); } // namespace OHOS::Ace::Framework #endif #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_UTILS_H diff --git a/frameworks/bridge/declarative_frontend/jsview/window_scene/js_host_window_scene.cpp b/frameworks/bridge/declarative_frontend/jsview/window_scene/js_host_window_scene.cpp index 9b454b016..1bd19ff3a 100644 --- a/frameworks/bridge/declarative_frontend/jsview/window_scene/js_host_window_scene.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/window_scene/js_host_window_scene.cpp @@ -15,6 +15,9 @@ #include "bridge/declarative_frontend/jsview/window_scene/js_host_window_scene.h" +#include "session/host/include/scene_session.h" +#include "session_manager/include/scene_session_manager.h" + #include "bridge/declarative_frontend/jsview/js_utils.h" #include "core/components_ng/pattern/window_scene/scene/host/host_window_scene_model.h" @@ -44,7 +47,18 @@ void JSHostWindowScene::Create(const JSCallbackInfo& info) return; } - auto sceneSession = CreateSceneSessionFromNapiValue(info[0]); + if (!info[0]->IsNumber()) { + LOGE("The arg is not a number"); + return; + } + + auto persistentId = static_cast(info[0]->ToNumber()); + auto sceneSession = Rosen::SceneSessionManager::GetInstance().GetSceneSession(persistentId); + if (sceneSession == nullptr) { + LOGE("sceneSession is nullptr"); + return; + } + NG::HostWindowSceneModel::Create(sceneSession); } } // namespace OHOS::Ace::Framework diff --git a/frameworks/bridge/declarative_frontend/jsview/window_scene/js_screen.cpp b/frameworks/bridge/declarative_frontend/jsview/window_scene/js_screen.cpp index 417024baf..a4563aa1f 100644 --- a/frameworks/bridge/declarative_frontend/jsview/window_scene/js_screen.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/window_scene/js_screen.cpp @@ -15,6 +15,9 @@ #include "bridge/declarative_frontend/jsview/window_scene/js_screen.h" +#include "session/screen/include/screen_session.h" +#include "session_manager/include/screen_session_manager.h" + #include "bridge/declarative_frontend/jsview/js_utils.h" #include "core/components_ng/pattern/window_scene/screen/screen_model.h" @@ -44,7 +47,18 @@ void JSScreen::Create(const JSCallbackInfo& info) return; } - auto screenSession = CreateScreenSessionFromNapiValue(info[0]); + if (!info[0]->IsNumber()) { + LOGE("The arg is not a number"); + return; + } + + auto screenId = static_cast(info[0]->ToNumber()); + auto screenSession = Rosen::ScreenSessionManager::GetInstance().GetScreenSession(screenId); + if (screenSession == nullptr) { + LOGE("screenSession is nullptr"); + return; + } + NG::ScreenModel::Create(screenSession); } } // namespace OHOS::Ace::Framework -- Gitee From 4c92677432ee62ff323a4d59c39628ea4c61b494 Mon Sep 17 00:00:00 2001 From: liuqi Date: Mon, 24 Apr 2023 12:59:25 +0000 Subject: [PATCH 3/3] Signed-off-by: liuqi Change-Id: Ief2745a1c22f04e264e912a4ed8c3c24a13c1239 Change-Id: Ife4880d372b7ebae04b45a8e1da24e27ebceb23c --- frameworks/core/common/window.h | 2 +- .../scene/container/window_pattern.cpp | 59 +++++++++++++++++++ .../scene/container/window_pattern.h | 15 +++-- .../scene/container/window_scene.cpp | 8 +++ .../scene/host/host_window_pattern.cpp | 3 + interfaces/inner_api/ace/ui_window.cpp | 34 +++++++++-- interfaces/inner_api/ace/ui_window.h | 16 +++++ 7 files changed, 127 insertions(+), 10 deletions(-) diff --git a/frameworks/core/common/window.h b/frameworks/core/common/window.h index ad4cba9e8..53bfd463e 100644 --- a/frameworks/core/common/window.h +++ b/frameworks/core/common/window.h @@ -49,7 +49,7 @@ public: return windowName_; } - void SetWindowRect(Rect rect) + void SetWindowRect(const Rect& rect) { windowRect_ = rect; } diff --git a/frameworks/core/components_ng/pattern/window_scene/scene/container/window_pattern.cpp b/frameworks/core/components_ng/pattern/window_scene/scene/container/window_pattern.cpp index 0068197b0..078cc280c 100644 --- a/frameworks/core/components_ng/pattern/window_scene/scene/container/window_pattern.cpp +++ b/frameworks/core/components_ng/pattern/window_scene/scene/container/window_pattern.cpp @@ -22,6 +22,9 @@ #include "core/common/container_scope.h" #include "core/common/thread_checker.h" #include "core/components_ng/render/adapter/rosen_render_context.h" +#include + +#include "interfaces/include/ws_common.h" namespace { constexpr int32_t IDLE_TASK_DELAY_MILLISECOND = 51; @@ -106,6 +109,7 @@ private: }; } // namespace +std::map> WindowPattern::uiWindowMap_; WindowPattern::WindowPattern(const std::shared_ptr& context) : context_(context) { @@ -116,6 +120,11 @@ WindowPattern::WindowPattern(const std::shared_ptr& con name = (pos == std::string::npos) ? name : name.substr(pos + 1); // skip '.' windowName_ = name + std::to_string(windowId_); surfaceNode_ = CreateSurfaceNode(windowName_); + // update uiWindow map + auto iter = uiWindowMap_.find(surfaceNode_->GetName()); + if (iter == uiWindowMap_.end()) { + uiWindowMap_.insert(std::make_pair(surfaceNode_->GetName(), this)); + } } void WindowPattern::Init() @@ -347,6 +356,12 @@ void WindowPattern::Background() sessionStage_->Background(); } +void WindowPattern::SetActive(bool status) +{ + CHECK_NULL_VOID(sessionStage_); + sessionStage_->SetActive(status); +} + void WindowPattern::Disconnect() { if (uiContent_) { @@ -355,4 +370,48 @@ void WindowPattern::Disconnect() CHECK_NULL_VOID(sessionStage_); sessionStage_->Disconnect(); } + +std::shared_ptr WindowPattern::GetSurfaceNode() +{ + return surfaceNode_; +} + +void WindowPattern::AddUIWindow(std::shared_ptr uiWindow) +{ + uiWindowMap_.insert({ surfaceNode_->GetName(), uiWindow }); +} + +std::shared_ptr WindowPattern::FindUIWindow(const std::string& uiWindowName) +{ + if (uiWindowMap_.find(uiWindowName) == uiWindowMap_.end()) { + return nullptr; + } + return uiWindowMap_[uiWindowName]; +} + + +sptr WindowPattern::GetSessionStage() +{ + return sessionStage_; +} + +std::shared_ptr WindowPattern::GetContext() +{ + return context_; +} + +void WindowPattern::MoveTo(int32_t x, int32_t y) +{ + const auto& rect = GetCurrentWindowRect(); + Rosen::WSRect sessionRect = { x, y, static_cast(rect.Width()), static_cast(rect.Height())}; + LOGD("WindowPattern MoveTo, newRect:[%{public}d, %{public}d, %{public}u, %{public}u]", + sessionRect.posX_, sessionRect.posY_, sessionRect.width_, sessionRect.height_); + CHECK_NULL_VOID(sessionStage_); + sessionStage_->UpdateSessionRect(sessionRect); +} + +void WindowPattern::Resize(uint32_t w, uint32_t h) +{ + +} } // namespace OHOS::Ace::NG diff --git a/frameworks/core/components_ng/pattern/window_scene/scene/container/window_pattern.h b/frameworks/core/components_ng/pattern/window_scene/scene/container/window_pattern.h index 8be72a2e9..0b2201484 100644 --- a/frameworks/core/components_ng/pattern/window_scene/scene/container/window_pattern.h +++ b/frameworks/core/components_ng/pattern/window_scene/scene/container/window_pattern.h @@ -45,10 +45,7 @@ public: void UpdateViewportConfig(const Rect& rect, Rosen::WindowSizeChangeReason reason); - std::shared_ptr GetSurfaceNode() - { - return surfaceNode_; - } + std::shared_ptr GetSurfaceNode() override; Rect GetCurrentWindowRect() const override { @@ -103,6 +100,15 @@ public: void Foreground() override; void Background() override; void Disconnect() override; + void SetActive(bool status) override; + + void AddUIWindow(std::shared_ptr uiWindow) override; + std::shared_ptr FindUIWindow(const std::string& uiWindowName) override; + sptr GetSessionStage() override; + std::shared_ptr GetContext() override; + + void MoveTo(int32_t x, int32_t y) override; + void Resize(uint32_t w, uint32_t h) override; protected: std::shared_ptr surfaceNode_; @@ -121,6 +127,7 @@ private: int32_t instanceId_ = -1; std::shared_ptr rsUIDirector_; std::shared_ptr vsyncCallback_; + static std::map> uiWindowMap_; ACE_DISALLOW_COPY_AND_MOVE(WindowPattern); }; diff --git a/frameworks/core/components_ng/pattern/window_scene/scene/container/window_scene.cpp b/frameworks/core/components_ng/pattern/window_scene/scene/container/window_scene.cpp index f15610fa1..19244119c 100644 --- a/frameworks/core/components_ng/pattern/window_scene/scene/container/window_scene.cpp +++ b/frameworks/core/components_ng/pattern/window_scene/scene/container/window_scene.cpp @@ -27,6 +27,14 @@ extern "C" ACE_EXPORT void* OHOS_ACE_CreateWindowScene(const std::shared_ptr(windowScene); } +extern "C" ACE_EXPORT void* OHOS_ACE_CreateSpecificWindowScene(const std::shared_ptr& context, + const sptr& iSession) +{ + LOGI("Ace lib loaded, CreateWindowScene."); + auto windowScene = std::make_shared(context, iSession); + return new std::shared_ptr(windowScene); +} + WindowScene::WindowScene(const std::shared_ptr& context, const sptr& iSession) : WindowPattern(context) diff --git a/frameworks/core/components_ng/pattern/window_scene/scene/host/host_window_pattern.cpp b/frameworks/core/components_ng/pattern/window_scene/scene/host/host_window_pattern.cpp index 30d34186d..9bf9aa6d8 100644 --- a/frameworks/core/components_ng/pattern/window_scene/scene/host/host_window_pattern.cpp +++ b/frameworks/core/components_ng/pattern/window_scene/scene/host/host_window_pattern.cpp @@ -215,6 +215,9 @@ bool HostWindowPattern::OnDirtyLayoutWrapperSwap(const RefPtr& di }; CHECK_NULL_RETURN(session_, false); + LOGI("==== HostWindowPattern === session update rect[%{public}d, %{public}d, %{public}u, %{public}u], ", + rect.posX_, rect.posY_, rect.width_, rect.height_); + LOGI("frame size not changed, just return"); session_->UpdateRect(rect, Rosen::SizeChangeReason::SHOW); return false; } diff --git a/interfaces/inner_api/ace/ui_window.cpp b/interfaces/inner_api/ace/ui_window.cpp index 1032fa71c..b9fa88739 100644 --- a/interfaces/inner_api/ace/ui_window.cpp +++ b/interfaces/inner_api/ace/ui_window.cpp @@ -26,7 +26,9 @@ using CreateWindowExtensionFunc = std::shared_ptr* (*)(const std::shar const sptr&); constexpr char CREATE_ROOT_SCENE_FUNC[] = "OHOS_ACE_CreateRootScene"; constexpr char CREATE_WINDOW_SCENE_FUNC[] = "OHOS_ACE_CreateWindowScene"; +constexpr char CREATE_SPECIFIC_WINDOW_SCENE_FUNC[] = "OHOS_ACE_CreateSpecificWindowScene"; constexpr char CREATE_WINDOW_EXTENSION_FUNC[] = "OHOS_ACE_CreateWindowExtension"; +void* UIWindow::handle_ = nullptr; std::shared_ptr UIWindow::CreateRootScene() { @@ -54,13 +56,36 @@ std::shared_ptr UIWindow::CreateRootScene() std::shared_ptr UIWindow::CreateWindowScene(const std::shared_ptr& context, const sptr& iSession) { - void* handle = dlopen("libace.z.so", RTLD_LAZY); - if (handle == nullptr) { + handle_ = dlopen("libace.z.so", RTLD_LAZY); + if (handle_ == nullptr) { return nullptr; } - auto entry = reinterpret_cast(dlsym(handle, CREATE_WINDOW_SCENE_FUNC)); - dlclose(handle); + auto entry = reinterpret_cast(dlsym(handle_, CREATE_WINDOW_SCENE_FUNC)); + dlclose(handle_); + if (entry == nullptr) { + return nullptr; + } + + auto uiWindowPtr = entry(context, iSession); + if (uiWindowPtr == nullptr) { + return nullptr; + } + std::shared_ptr uiWindow = *uiWindowPtr; + delete uiWindowPtr; + + return uiWindow; +} + +std::shared_ptr UIWindow::CreateSpecificWindowScene(const std::shared_ptr& context, + const sptr& iSession) +{ + if (handle_ == nullptr) { + return nullptr; + } + + auto entry = reinterpret_cast(dlsym(handle_, CREATE_SPECIFIC_WINDOW_SCENE_FUNC)); + dlclose(handle_); if (entry == nullptr) { return nullptr; } @@ -98,5 +123,4 @@ std::shared_ptr UIWindow::CreateWindowExtension(const std::shared_ptr< return uiWindow; } - } // namespace OHOS::Ace::NG diff --git a/interfaces/inner_api/ace/ui_window.h b/interfaces/inner_api/ace/ui_window.h index 57fcd77f0..a379fc5ff 100644 --- a/interfaces/inner_api/ace/ui_window.h +++ b/interfaces/inner_api/ace/ui_window.h @@ -24,6 +24,7 @@ namespace OHOS::Rosen { class RSSurfaceNode; class ISession; class ISessionStageStateListener; +class SessionStage; } namespace OHOS::Ace::NG { @@ -35,6 +36,9 @@ public: static std::shared_ptr CreateWindowScene(const std::shared_ptr& context, const sptr& iSession); + static std::shared_ptr CreateSpecificWindowScene(const std::shared_ptr& context, + const sptr& iSession); + static std::shared_ptr CreateWindowExtension(const std::shared_ptr& context, const sptr& iSession); @@ -43,6 +47,12 @@ public: virtual void LoadContent(const std::string& contentUrl, NativeEngine* engine, NativeValue* storage, AbilityRuntime::Context* context = nullptr) = 0; + virtual std::shared_ptr GetSurfaceNode() = 0; + virtual void AddUIWindow(std::shared_ptr uiWindow) = 0; + virtual std::shared_ptr FindUIWindow(const std::string& uiWindowName) = 0; + virtual sptr GetSessionStage() = 0; + virtual std::shared_ptr GetContext() = 0; + // for lifecycle virtual void RegisterSessionStageStateListener( const std::shared_ptr& listener) = 0; @@ -51,6 +61,12 @@ public: virtual void Foreground() = 0; virtual void Background() = 0; virtual void Disconnect() = 0; + virtual void SetActive(bool status) = 0; + virtual void MoveTo(int32_t x, int32_t y) = 0; + virtual void Resize(uint32_t w, uint32_t h) = 0; + +private: + static void* handle_; }; } // namespace OHOS::Ace::NG -- Gitee