mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
超大函数整改
Signed-off-by: b30058220 <baodi1@huawei.com> Change-Id: Id1fb622ff56fe97c1218d4c040385bc6d6a95ccd
This commit is contained in:
parent
c340abcf41
commit
3420bd8c0b
@ -118,6 +118,7 @@ bool GetPixelMapByCustom(DragControllerAsyncCtx* asyncCtx);
|
||||
bool GetPixelMapArrayByCustom(DragControllerAsyncCtx* asyncCtx, napi_value customBuilder, int arrayLength);
|
||||
ParameterType getParameterType(DragControllerAsyncCtx* asyncCtx);
|
||||
void SetMouseDragMonitorState(DragControllerAsyncCtx *asyncCtx, bool state);
|
||||
void HandleExecuteDrag(napi_env env, DragControllerAsyncCtx *asyncCtx);
|
||||
|
||||
class DragAction {
|
||||
public:
|
||||
@ -556,6 +557,18 @@ void SetMouseDragMonitorState(DragControllerAsyncCtx *asyncCtx, bool state)
|
||||
TAG_LOGI(AceLogTag::ACE_DRAG, "Set mouse drag monitor state %{public}d success", state);
|
||||
}
|
||||
|
||||
void HandleExecuteDrag(napi_env env, DragControllerAsyncCtx *asyncCtx)
|
||||
{
|
||||
ParameterType parameterType = getParameterType(asyncCtx);
|
||||
if (parameterType == ParameterType::DRAGITEMINFO) {
|
||||
OnComplete(asyncCtx);
|
||||
} else if (parameterType == ParameterType::CUSTOMBUILDER) {
|
||||
GetPixelMapByCustom(asyncCtx);
|
||||
} else {
|
||||
NapiThrow(env, "parameter parsing error.", ERROR_CODE_PARAM_INVALID);
|
||||
}
|
||||
}
|
||||
|
||||
void HandleSuccess(DragControllerAsyncCtx* asyncCtx, const DragNotifyMsg& dragNotifyMsg,
|
||||
const DragStatus dragStatus)
|
||||
{
|
||||
@ -1561,14 +1574,7 @@ static napi_value JSExecuteDrag(napi_env env, napi_callback_info info)
|
||||
return result;
|
||||
}
|
||||
SetMouseDragMonitorState(dragAsyncContext, true);
|
||||
ParameterType parameterType = getParameterType(dragAsyncContext);
|
||||
if (parameterType == ParameterType::DRAGITEMINFO) {
|
||||
OnComplete(dragAsyncContext);
|
||||
} else if (parameterType == ParameterType::CUSTOMBUILDER) {
|
||||
GetPixelMapByCustom(dragAsyncContext);
|
||||
} else {
|
||||
NapiThrow(env, "parameter parsing error.", ERROR_CODE_PARAM_INVALID);
|
||||
}
|
||||
HandleExecuteDrag(env, dragAsyncContext);
|
||||
napi_escape_handle(env, scope, result, &result);
|
||||
napi_close_escapable_handle_scope(env, scope);
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user