mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-23 15:00:12 +00:00
add saveSnapshotSync interface
Signed-off-by: 胡晗 <huhan17@huawei.com>
This commit is contained in:
parent
42f9a06d3f
commit
e515e87f03
@ -372,6 +372,8 @@ void JsSceneSession::BindNativeMethod(napi_env env, napi_value objValue, const c
|
||||
JsSceneSession::SetFrameGravity);
|
||||
BindNativeFunction(env, objValue, "setUseStartingWindowAboveLocked", moduleName,
|
||||
JsSceneSession::SetUseStartingWindowAboveLocked);
|
||||
BindNativeFunction(env, objValue, "saveSnapshotSync", moduleName,
|
||||
JsSceneSession::SaveSnapshotSync);
|
||||
}
|
||||
|
||||
void JsSceneSession::BindNativeMethodForKeyboard(napi_env env, napi_value objValue, const char* moduleName)
|
||||
@ -2149,6 +2151,13 @@ napi_value JsSceneSession::SetUseStartingWindowAboveLocked(napi_env env, napi_ca
|
||||
return (me != nullptr) ? me->OnSetUseStartingWindowAboveLocked(env, info) : nullptr;
|
||||
}
|
||||
|
||||
napi_value JsSceneSession::SaveSnapshotSync(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TLOGD(WmsLogTag::WMS_LAYOUT, "[NAPI]");
|
||||
JsSceneSession* me = CheckParamsAndGetThis<JsSceneSession>(env, info);
|
||||
return (me != nullptr) ? me->OnSaveSnapshotSync(env, info) : nullptr;
|
||||
}
|
||||
|
||||
bool JsSceneSession::IsCallbackRegistered(napi_env env, const std::string& type, napi_value jsListenerObject)
|
||||
{
|
||||
HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "JsSceneSession::IsCallbackRegistered[%s]", type.c_str());
|
||||
@ -5301,4 +5310,15 @@ napi_value JsSceneSession::OnSetUseStartingWindowAboveLocked(napi_env env, napi_
|
||||
session->SetUseStartingWindowAboveLocked(useStartingWindowAboveLocked);
|
||||
return NapiGetUndefined(env);
|
||||
}
|
||||
|
||||
napi_value JsSceneSession::OnSaveSnapshotSync(napi_env env, napi_callback_info info)
|
||||
{
|
||||
auto session = weakSession_.promote();
|
||||
if (session == nullptr) {
|
||||
TLOGE(WmsLogTag::DEFAULT, "[NAPI]session is nullptr, id:%{public}d", persistentId_);
|
||||
return NapiGetUndefined(env);
|
||||
}
|
||||
session->SaveSnapshot(false);
|
||||
return NapiGetUndefined(env);
|
||||
}
|
||||
} // namespace OHOS::Rosen
|
||||
|
@ -157,6 +157,7 @@ private:
|
||||
static napi_value SetIsActivatedAfterScreenLocked(napi_env env, napi_callback_info info);
|
||||
static napi_value SetFrameGravity(napi_env env, napi_callback_info info);
|
||||
static napi_value SetUseStartingWindowAboveLocked(napi_env env, napi_callback_info info);
|
||||
static napi_value SaveSnapshotSync(napi_env env, napi_callback_info info);
|
||||
|
||||
napi_value OnRegisterCallback(napi_env env, napi_callback_info info);
|
||||
napi_value OnUpdateNativeVisibility(napi_env env, napi_callback_info info);
|
||||
@ -217,6 +218,7 @@ private:
|
||||
napi_value OnSetIsActivatedAfterScreenLocked(napi_env env, napi_callback_info info);
|
||||
napi_value OnSetFrameGravity(napi_env env, napi_callback_info info);
|
||||
napi_value OnSetUseStartingWindowAboveLocked(napi_env env, napi_callback_info info);
|
||||
napi_value OnSaveSnapshotSync(napi_env env, napi_callback_info info);
|
||||
|
||||
bool IsCallbackRegistered(napi_env env, const std::string& type, napi_value jsListenerObject);
|
||||
void ProcessChangeSessionVisibilityWithStatusBarRegister();
|
||||
|
Loading…
Reference in New Issue
Block a user