mirror of
https://gitee.com/openharmony/window_window_manager
synced 2025-05-13 06:41:12 +00:00
add ndk
Signed-off-by: 红书包指挥官 <gongjingbo2@huawei.com>
This commit is contained in:
parent
9e2aedff61
commit
e8053d050d
@ -70,5 +70,9 @@
|
||||
{
|
||||
"first_instroduced":"16",
|
||||
"name":"OH_WindowManager_Snapshot"
|
||||
},
|
||||
{
|
||||
"first_instroduced":"16",
|
||||
"name":"OH_WindowManager_SetWindowTouchable"
|
||||
}
|
||||
]
|
@ -203,6 +203,20 @@ int32_t OH_WindowManager_GetWindowProperties(
|
||||
*/
|
||||
int32_t OH_WindowManager_Snapshot(int32_t windowId, OH_PixelmapNative* pixelMap);
|
||||
|
||||
/**
|
||||
* @brief set window touchable status.
|
||||
*
|
||||
* @param windowId windowId when window is created.
|
||||
* @param touchable window touchable status.
|
||||
* @return Return the result code.
|
||||
* {@link OK} the function call is successful.
|
||||
* {@link WINDOW_MANAGER_ERRORCODE_INVALID_PARAM} parameter error.
|
||||
* {@link WINDOW_MANAGER_ERRORCODE_STATE_ABNORMALLY} this window state is abnormal.
|
||||
* {@link WINDOW_MANAGER_ERRORCODE_SYSTEM_ABNORMALLY} the window manager service works abnormal.
|
||||
* @since 16
|
||||
*/
|
||||
int32_t OH_WindowManager_SetWindowTouchable(int32_t windowId, bool touchable);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -437,4 +437,24 @@ int32_t OH_WindowManager_GetWindowProperties(
|
||||
TransformedToWindowManagerRect(drawableRect, windowProperties->drawableRect);
|
||||
}, __func__);
|
||||
return errCode;
|
||||
}
|
||||
|
||||
int32_t OH_WindowManager_SetWindowTouchable(int32_t windowId, bool touchable)
|
||||
{
|
||||
auto eventHandler = GetMainEventHandler();
|
||||
if (eventHandler == nullptr) {
|
||||
TLOGE(WmsLogTag::WMS_EVENT, "eventHandler null, windowId:%{public}d", windowId);
|
||||
return WindowManager_ErrorCode::SERVICE_ERROR;
|
||||
}
|
||||
WindowManager_ErrorCode errCode = WindowManager_ErrorCode::SERVICE_ERROR;
|
||||
eventHandler->PostSyncTask([windowId, touchable, &errCode, where = __func__] {
|
||||
auto window = Window::GetWindowWithId(windowId);
|
||||
if (window == nullptr) {
|
||||
TLOGNE(WmsLogTag::WMS_EVENT, "%{public}s window is null, windowId:%{public}d", where, windowId);
|
||||
errCode = WindowManager_ErrorCode::INVAILD_WINDOW_ID;
|
||||
return;
|
||||
}
|
||||
errCode = OH_WINDOW_TO_ERROR_CODE_MAP.at(window->SetTouchable(touchable));
|
||||
}, __func__);
|
||||
return errCode;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user