mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-30 10:31:17 +00:00
修复client编译错误
Signed-off-by: lu <zhaolu2@huawei.com> Change-Id: I6b8b88127ad1a5669f4fede64d6c073070f5a09c
This commit is contained in:
parent
5477b13de7
commit
891bbcd86a
@ -26,14 +26,15 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace Rosen {
|
||||
class JsWindowExtensionContext : public AbilityRuntime::AbilityConnectCallback {
|
||||
class JsWindowExtensionContext;
|
||||
class JsAbilityConnectCallback : public AbilityRuntime::AbilityConnectCallback {
|
||||
public:
|
||||
explicit JsWindowExtensionContext(const std::shared_ptr<JsWindowExtensionContext>& context);
|
||||
~JsWindowExtensionContext() = default;
|
||||
static void Finalizer(NativeEngine* engine, void* data, void* hint);
|
||||
void OnWindowCreate(sptr<Window> window);
|
||||
private:
|
||||
std::shared_ptr<JsWindowExtensionContext> context_;
|
||||
explicit JsAbilityConnectCallback() = default;
|
||||
~JsAbilityConnectCallback() = default;
|
||||
// void OnWindowCreate(sptr<Window> window); //TODO
|
||||
virtual void OnAbilityConnectDone(const AppExecFwk::ElementName &element,
|
||||
const sptr<IRemoteObject> &remoteObject, int resultCode) override;
|
||||
virtual void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) override;
|
||||
};
|
||||
|
||||
NativeValue* CreateJsWindowExtensionContext(NativeEngine& engine,
|
||||
|
@ -28,22 +28,38 @@ namespace {
|
||||
std::shared_ptr<AppExecFwk::EventHandler> handler_;
|
||||
}
|
||||
|
||||
JsWindowExtensionContext::JsWindowExtensionContext(const std::shared_ptr<JsWindowExtensionContext>& context)
|
||||
: context_(context) {}
|
||||
class JsWindowExtensionContext final {
|
||||
public:
|
||||
explicit JsWindowExtensionContext(
|
||||
const std::shared_ptr<WindowExtensionContext>& context) : context_(context) {}
|
||||
~JsWindowExtensionContext() = default;
|
||||
|
||||
void JsWindowExtensionContext::Finalizer(NativeEngine* engine, void* data, void* hint)
|
||||
static void Finalizer(NativeEngine* engine, void* data, void* hint)
|
||||
{
|
||||
WLOGI("JsWindowExtensionContext::Finalizer is called");
|
||||
std::unique_ptr<JsWindowExtensionContext>(static_cast<JsWindowExtensionContext*>(data));
|
||||
}
|
||||
private:
|
||||
std::shared_ptr<WindowExtensionContext> context_;
|
||||
};
|
||||
// void JsAbilityConnectCallback::OnWindowCreate(sptr<Window> window)
|
||||
// {
|
||||
// // call js api
|
||||
// }
|
||||
|
||||
void JsAbilityConnectCallback::OnAbilityConnectDone(const AppExecFwk::ElementName &element,
|
||||
const sptr<IRemoteObject> &remoteObject, int resultCode)
|
||||
{
|
||||
WLOGFI("Finalizer is called");
|
||||
std::unique_ptr<JsWindowExtensionContext>(static_cast<JsWindowExtensionContext*>(data));
|
||||
|
||||
}
|
||||
|
||||
void JsWindowExtensionContext::OnWindowCreate(sptr<Window> window)
|
||||
void JsAbilityConnectCallback::OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode)
|
||||
{
|
||||
// call js api
|
||||
|
||||
}
|
||||
|
||||
NativeValue* CreateJsWindowExtensionContext(NativeEngine& engine,
|
||||
std::shared_ptr<AbilityRuntime::ServiceExtensionContext> context)
|
||||
std::shared_ptr<WindowExtensionContext> context)
|
||||
{
|
||||
WLOGFI("CreateJsWindowExtensionContext begin");
|
||||
NativeValue* objValue = CreateJsExtensionContext(engine, context); // TODO CreateJsBaseContext?
|
||||
|
Loading…
Reference in New Issue
Block a user